Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(n-tree-select): add show-line prop #6570

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## NEXT_VERSION

`NEXT_VERSION`

### Features

- `n-tree-select` adds `show-line` prop.

## 2.40.2

`2024-11-26`
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## NEXT_VERSION

`NEXT_VERSION`

### Features

- `n-tree-select` 新增 `show-line` 属性

## 2.40.2

`2024-11-26`
Expand Down
1 change: 1 addition & 0 deletions src/tree-select/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ debug.vue
| render-switcher-icon | `() => VNodeChild` | `undefined` | Render function of option switcher icon. | 2.30.7 |
| render-tag | `(props: { option: TreeSelectOption, handleClose: () => void }) => VNodeChild` | `undefined` | Render function for each option tag. | 2.30.7 |
| separator | `string` | `' / '` | Option value separator. | |
| show-line | `boolean` | `false` | Whether to show the hierarchy of selected nodes in the label. | NEXT_VERSION |
| show-path | `boolean` | `false` | Whether to also show the hierarchy of selected nodes in the label. | |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | Component size. | |
| status | `'success' \| 'warning' \| 'error'` | `undefined` | Validation status. | 2.27.0 |
Expand Down
1 change: 1 addition & 0 deletions src/tree-select/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ render-debug.vue
| render-switcher-icon | `() => VNodeChild` | `undefined` | 节点展开开关的渲染函数 | 2.30.7 |
| render-tag | `(props: { option: TreeSelectOption, handleClose: () => void }) => VNodeChild` | `undefined` | 控制标签的渲染 | 2.30.7 |
| separator | `string` | `' / '` | 数据分隔符 | |
| show-line | `boolean` | `false` | 是否显示节点连接线 | NEXT_VERSION |
| show-path | `boolean` | `false` | 是否在选择器中显示选项路径 | |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | 组件尺寸 | |
| status | `'success' \| 'warning' \| 'error'` | `undefined` | 验证状态 | 2.27.0 |
Expand Down
68 changes: 35 additions & 33 deletions src/tree-select/src/TreeSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,44 +1,19 @@
import type { ThemeProps } from '../../_mixins'
import type { FormValidationStatus } from '../../form/src/interface'
import type { PopoverProps } from '../../popover'
import type { SelectBaseOption, SelectOption } from '../../select/src/interface'
import type {
GetChildren,
InternalTreeInst,
Key,
TreeOption,
TreeOverrideNodeClickBehaviorReturn
} from '../../tree/src/interface'
import type { OnUpdateExpandedKeysImpl } from '../../tree/src/Tree'
import type {
OnUpdateIndeterminateKeysImpl,
OnUpdateValue,
OnUpdateValueImpl,
TreeSelectInst,
TreeSelectNodeProps,
TreeSelectOption,
TreeSelectRenderLabel,
TreeSelectRenderPrefix,
TreeSelectRenderSuffix,
TreeSelectRenderTag,
Value
} from './interface'
import { getPreciseEventTarget, happensIn } from 'seemly'
import { type CheckStrategy, createTreeMate } from 'treemate'
import { clickoutside } from 'vdirs'
import { useIsMounted, useMergedState } from 'vooks'
import {
computed,
type CSSProperties,
defineComponent,
h,
type HTMLAttributes,
type PropType,
Transition,
type VNodeChild,
computed,

Check failure on line 11 in src/tree-select/src/TreeSelect.tsx

View workflow job for this annotation

GitHub Actions / lint (20)

Expected "computed" to come before "VNodeChild"
defineComponent,
h,
provide,
ref,
toRef,
Transition,
type VNodeChild,
watchEffect,
withDirectives
} from 'vue'
Expand All @@ -49,6 +24,18 @@
VFollower,
VTarget
} from 'vueuc'
import type { OnUpdateExpandedKeysImpl } from '../../tree/src/Tree'

Check failure on line 27 in src/tree-select/src/TreeSelect.tsx

View workflow job for this annotation

GitHub Actions / lint (20)

Expected "../../tree/src/Tree" (parent-type) to come before "vueuc" (external)
import type {

Check failure on line 28 in src/tree-select/src/TreeSelect.tsx

View workflow job for this annotation

GitHub Actions / lint (20)

Expected "../../tree/src/interface" to come before "../../tree/src/Tree"
GetChildren,
InternalTreeInst,
Key,
TreeOption,
TreeOverrideNodeClickBehaviorReturn
} from '../../tree/src/interface'
import type { SelectBaseOption, SelectOption } from '../../select/src/interface'

Check failure on line 35 in src/tree-select/src/TreeSelect.tsx

View workflow job for this annotation

GitHub Actions / lint (20)

Expected "../../select/src/interface" to come before "../../tree/src/interface"
import type { PopoverProps } from '../../popover'

Check failure on line 36 in src/tree-select/src/TreeSelect.tsx

View workflow job for this annotation

GitHub Actions / lint (20)

Expected "../../popover" to come before "../../select/src/interface"
import type { FormValidationStatus } from '../../form/src/interface'

Check failure on line 37 in src/tree-select/src/TreeSelect.tsx

View workflow job for this annotation

GitHub Actions / lint (20)

Expected "../../form/src/interface" to come before "../../popover"
import type { ThemeProps } from '../../_mixins'

Check failure on line 38 in src/tree-select/src/TreeSelect.tsx

View workflow job for this annotation

GitHub Actions / lint (20)

Expected "../../_mixins" to come before "../../form/src/interface"
import {
type InternalSelectionInst,
NBaseFocusDetector,
Expand All @@ -62,10 +49,10 @@
useThemeClass
} from '../../_mixins'
import {
call,
type ExtractPublicPropTypes,
markEventEffectPerformed,
type MaybeArray,
call,

Check failure on line 54 in src/tree-select/src/TreeSelect.tsx

View workflow job for this annotation

GitHub Actions / lint (20)

Expected "call" to come before "MaybeArray"
markEventEffectPerformed,
resolveSlot,
resolveWrappedSlot,
useAdjustedTo,
Expand All @@ -76,7 +63,20 @@
import { NTree } from '../../tree'
import { createTreeMateOptions, treeSharedProps } from '../../tree/src/Tree'
import { useMergedCheckStrategy } from '../../tree/src/utils'
import { treeSelectLight, type TreeSelectTheme } from '../styles'
import { type TreeSelectTheme, treeSelectLight } from '../styles'

Check failure on line 66 in src/tree-select/src/TreeSelect.tsx

View workflow job for this annotation

GitHub Actions / lint (20)

Expected "treeSelectLight" to come before "TreeSelectTheme"
import type {

Check failure on line 67 in src/tree-select/src/TreeSelect.tsx

View workflow job for this annotation

GitHub Actions / lint (20)

Expected "./interface" (sibling-type) to come before "../styles" (parent)
OnUpdateIndeterminateKeysImpl,
OnUpdateValue,
OnUpdateValueImpl,
TreeSelectInst,
TreeSelectNodeProps,
TreeSelectOption,
TreeSelectRenderLabel,
TreeSelectRenderPrefix,
TreeSelectRenderSuffix,
TreeSelectRenderTag,
Value
} from './interface'
import { treeSelectInjectionKey } from './interface'
import style from './styles/index.cssr'
import {
Expand Down Expand Up @@ -140,6 +140,7 @@
type: Boolean as PropType<boolean | undefined>,
default: undefined
},
showLine: Boolean,
size: String as PropType<'small' | 'medium' | 'large'>,
value: [String, Number, Array] as PropType<
string | number | Array<string | number> | null
Expand Down Expand Up @@ -988,6 +989,7 @@
<NTree
ref="treeInstRef"
blockLine
showLine={this.showLine}
allowCheckingNotLoaded={
this.allowCheckingNotLoaded
}
Expand Down
Loading