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

Docs/affix treeselect #2696

Merged
merged 2 commits into from
Aug 16, 2023
Merged
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: 4 additions & 4 deletions src/affix/affix.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

name | type | default | description | required
-- | -- | -- | -- | --
container | String / Function | () => (() => window) | Typescript:`ScrollContainer` | N
content(暂未实现) | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
container | String / Function | () => (() => window) | Typescript:`ScrollContainer`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
content(暂未实现) | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
default | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
offsetBottom | Number | 0 | \- | N
offsetTop | Number | 0 | \- | N
offsetBottom | Number | 0 | When the distance from the bottom of the container reaches the specified distance, the trigger is fixed | N
offsetTop | Number | 0 | When the distance from the top of the container reaches the specified distance, the trigger is fixed | N
zIndex | Number | - | \- | N
onFixedChange | Function | | Typescript:`(affixed: boolean, context: { top: number }) => void`<br/> | N

Expand Down
6 changes: 3 additions & 3 deletions src/affix/affix.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
container | String / Function | () => (() => window) | 指定滚动的容器。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:`ScrollContainer` | N
container | String / Function | () => (() => window) | 指定滚动的容器。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:`ScrollContainer`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
content(暂未实现) | String / Slot / Function | - | 内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
default | String / Slot / Function | - | 内容,同 content。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
offsetBottom | Number | 0 | 距离容器顶部达到指定距离后触发固定 | N
offsetTop | Number | 0 | 距离容器底部达到指定距离后触发固定 | N
offsetBottom | Number | 0 | 距离容器底部达到指定距离后触发固定 | N
offsetTop | Number | 0 | 距离容器顶部达到指定距离后触发固定 | N
zIndex | Number | - | 固钉定位层级,样式默认为 500 | N
onFixedChange | Function | | TS 类型:`(affixed: boolean, context: { top: number }) => void`<br/>固定状态发生变化时触发 | N

Expand Down
15 changes: 11 additions & 4 deletions src/affix/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* updated at 2021-11-19 10:44:26
* */

import { TdAffixProps } from './type';
Expand All @@ -12,14 +11,22 @@ export default {
/** 指定滚动的容器。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body */
container: {
type: [String, Function] as PropType<TdAffixProps['container']>,
default: () => (() => window),
default: () => () => window,
},
/** 距离容器顶部达到指定距离后触发固定 */
/** 内容 */
content: {
type: [String, Function] as PropType<TdAffixProps['content']>,
},
/** 内容,同 content */
default: {
type: [String, Function] as PropType<TdAffixProps['default']>,
},
/** 距离容器底部达到指定距离后触发固定 */
offsetBottom: {
type: Number,
default: 0,
},
/** 距离容器底部达到指定距离后触发固定 */
/** 距离容器顶部达到指定距离后触发固定 */
offsetTop: {
type: Number,
default: 0,
Expand Down
17 changes: 12 additions & 5 deletions src/affix/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* updated at 2021-11-19 10:44:26
* */

import { ScrollContainer } from '../common';
import { TNode, ScrollContainer } from '../common';

export interface TdAffixProps {
/**
Expand All @@ -14,12 +13,20 @@ export interface TdAffixProps {
*/
container?: ScrollContainer;
/**
* 距离容器顶部达到指定距离后触发固定
* 内容
*/
content?: string | TNode;
/**
* 内容,同 content
*/
default?: string | TNode;
/**
* 距离容器底部达到指定距离后触发固定
* @default 0
*/
offsetBottom?: number;
/**
* 距离容器底部达到指定距离后触发固定
* 距离容器顶部达到指定距离后触发固定
* @default 0
*/
offsetTop?: number;
Expand All @@ -31,4 +38,4 @@ export interface TdAffixProps {
* 固定状态发生变化时触发
*/
onFixedChange?: (affixed: boolean, context: { top: number }) => void;
};
}
14 changes: 11 additions & 3 deletions src/tree-select/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ export default {
/** 输入框的值 */
inputValue: {
type: [String, Number] as PropType<TdTreeSelectProps['inputValue']>,
default: undefined,
},
/** 输入框的值,非受控属性 */
defaultInputValue: {
type: [String, Number] as PropType<TdTreeSelectProps['defaultInputValue']>,
},
/** 用来定义 `value / label / children` 在 `data` 数据中对应的字段别名,示例:`{ value: 'key', label 'name', children: 'list' }` */
/** 用来定义 `value / label / disabled / children` 在 `data` 数据中对应的字段别名,示例:`{ value: 'key', label: 'name', children: 'list' }` */
keys: {
type: Object as PropType<TdTreeSelectProps['keys']>,
},
Expand All @@ -76,6 +75,14 @@ export default {
},
/** 是否允许多选 */
multiple: Boolean,
/** 面板内的底部内容 */
panelBottomContent: {
type: [String, Function] as PropType<TdTreeSelectProps['panelBottomContent']>,
},
/** 面板内的顶部内容 */
panelTopContent: {
type: [String, Function] as PropType<TdTreeSelectProps['panelTopContent']>,
},
/** 占位符 */
placeholder: {
type: String,
Expand All @@ -101,6 +108,8 @@ export default {
},
/** 只读状态,值为真会隐藏输入框,且无法打开下拉框 */
readonly: Boolean,
/** 多选且可搜索时,是否在选中一个选项后保留当前的搜索关键词 */
reserveKeyword: Boolean,
/** 【开发中】透传 SelectInput 筛选器输入框组件的全部属性 */
selectInputProps: {
type: Object as PropType<TdTreeSelectProps['selectInputProps']>,
Expand Down Expand Up @@ -146,7 +155,6 @@ export default {
/** 选中值,泛型 `TreeValueType` 继承自 `TreeSelectValue` */
value: {
type: [String, Number, Object, Array] as PropType<TdTreeSelectProps['value']>,
default: undefined,
},
/** 选中值,泛型 `TreeValueType` 继承自 `TreeSelectValue`,非受控属性 */
defaultValue: {
Expand Down
11 changes: 7 additions & 4 deletions src/tree-select/tree-select.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,25 @@ filterable | Boolean | false | \- | N
inputProps | Object | - | Typescript:`InputProps`,[Input API Documents](./input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
inputValue | String / Number | - | input value。`.sync` is supported。Typescript:`InputValue`,[Input API Documents](./input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
defaultInputValue | String / Number | - | input value。uncontrolled property。Typescript:`InputValue`,[Input API Documents](./input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
keys | Object | - | Typescript:`TreeKeysType`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
keys | Object | - | alias filed name in data。Typescript:`TreeKeysType`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
label | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
loading | Boolean | false | \- | N
loadingText | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
max | Number | 0 | \- | N
minCollapsedNum | Number | 0 | \- | N
multiple | Boolean | false | \- | N
panelBottomContent | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
panelTopContent | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
placeholder | String | undefined | \- | N
popupProps | Object | - | Typescript:`PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
popupVisible | Boolean | undefined | show popup。`.sync` is supported | N
defaultPopupVisible | Boolean | undefined | show popup。uncontrolled property | N
prefixIcon | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
readonly | Boolean | false | \- | N
reserveKeyword | Boolean | false | \- | N
selectInputProps | Object | - | Typescript:`SelectInputProps`,[SelectInput API Documents](./select-input?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
size | String | medium | optionssmall/medium/large | N
status | String | default | optionsdefault/success/warning/error | N
size | String | medium | options: small/medium/large | N
status | String | default | options: default/success/warning/error | N
suffix | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
suffixIcon | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
tagProps | Object | - | Typescript:`TagProps`,[Tag API Documents](./tag?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
Expand All @@ -42,7 +45,7 @@ treeProps | Object | - | Typescript:`TreeProps`,[Tree API Documents](./tree?
value | String / Number / Object / Array | - | `v-model` is supported。Typescript:`TreeValueType` `type TreeSelectValue = string \| number \| TreeOptionData \| Array<string \| number \| TreeOptionData>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
defaultValue | String / Number / Object / Array | - | uncontrolled property。Typescript:`TreeValueType` `type TreeSelectValue = string \| number \| TreeOptionData \| Array<string \| number \| TreeOptionData>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
valueDisplay | Slot / Function | - | Typescript:`string \| TNode<{ value: TreeOptionData \| TreeOptionData[]; onClose: (index: number) => void }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
valueType | String | value | optionsvalue/object | N
valueType | String | value | options: value/object | N
onBlur | Function | | Typescript:`(context: SelectInputBlurContext & { value: TreeSelectValue }) => void`<br/> | N
onChange | Function | | Typescript:`(value: TreeValueType, context: TreeSelectChangeContext<DataOption>) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts)。<br/>`interface TreeSelectChangeContext<DataOption> { node: TreeNodeModel<DataOption>; data: DataOption; index?: number; trigger: TreeSelectValueChangeTrigger; e?: MouseEvent \| KeyboardEvent \| Event }`<br/><br/>`type TreeSelectValueChangeTrigger = 'clear' \| 'tag-remove' \| 'backspace' \| 'check' \| 'uncheck'`<br/> | N
onClear | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N
Expand Down
5 changes: 4 additions & 1 deletion src/tree-select/tree-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@ filterable | Boolean | false | 是否可搜索 | N
inputProps | Object | - | 透传给 输入框 Input 组件的全部属性。TS 类型:`InputProps`,[Input API Documents](./input?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
inputValue | String / Number | - | 输入框的值。支持语法糖 `.sync`。TS 类型:`InputValue`,[Input API Documents](./input?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
defaultInputValue | String / Number | - | 输入框的值。非受控属性。TS 类型:`InputValue`,[Input API Documents](./input?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
keys | Object | - | 用来定义 `value / label / children` 在 `data` 数据中对应的字段别名,示例:`{ value: 'key', label 'name', children: 'list' }`。TS 类型:`TreeKeysType`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
keys | Object | - | 用来定义 `value / label / disabled / children` 在 `data` 数据中对应的字段别名,示例:`{ value: 'key', label: 'name', children: 'list' }`。TS 类型:`TreeKeysType`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
label | String / Slot / Function | - | 左侧文本。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
loading | Boolean | false | 是否正在加载数据 | N
loadingText | String / Slot / Function | - | 远程加载时显示的文字,支持自定义。如加上超链接。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
max | Number | 0 | 用于控制多选数量,值为 0 则不限制 | N
minCollapsedNum | Number | 0 | 最小折叠数量,用于多选情况下折叠选中项,超出该数值的选中项折叠。值为 0 则表示不折叠 | N
multiple | Boolean | false | 是否允许多选 | N
panelBottomContent | String / Slot / Function | - | 面板内的底部内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
panelTopContent | String / Slot / Function | - | 面板内的顶部内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
placeholder | String | undefined | 占位符 | N
popupProps | Object | - | 透传给 popup 组件的全部属性。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
popupVisible | Boolean | undefined | 是否显示下拉框。支持语法糖 `.sync` | N
defaultPopupVisible | Boolean | undefined | 是否显示下拉框。非受控属性 | N
prefixIcon | Slot / Function | - | 组件前置图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
readonly | Boolean | false | 只读状态,值为真会隐藏输入框,且无法打开下拉框 | N
reserveKeyword | Boolean | false | 多选且可搜索时,是否在选中一个选项后保留当前的搜索关键词 | N
selectInputProps | Object | - | 【开发中】透传 SelectInput 筛选器输入框组件的全部属性。TS 类型:`SelectInputProps`,[SelectInput API Documents](./select-input?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/tree-select/type.ts) | N
size | String | medium | 尺寸。可选项:small/medium/large | N
status | String | default | 输入框状态。可选项:default/success/warning/error | N
Expand Down
17 changes: 15 additions & 2 deletions src/tree-select/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { PopupProps } from '../popup';
import { SelectInputProps, SelectInputBlurContext, SelectInputValueChangeContext } from '../select-input';
import { TagProps } from '../tag';
import { TreeProps, TreeNodeModel, TreeKeysType } from '../tree';
import { PopupVisibleChangeContext, PopupTriggerEvent, PopupTriggerSource } from '../popup';
import { PopupTriggerEvent, PopupTriggerSource } from '../popup';
import { TNode, TreeOptionData } from '../common';

export interface TdTreeSelectProps<
Expand Down Expand Up @@ -76,7 +76,7 @@ export interface TdTreeSelectProps<
*/
defaultInputValue?: InputValue;
/**
* 用来定义 `value / label / children` 在 `data` 数据中对应的字段别名,示例:`{ value: 'key', label 'name', children: 'list' }`
* 用来定义 `value / label / disabled / children` 在 `data` 数据中对应的字段别名,示例:`{ value: 'key', label: 'name', children: 'list' }`
*/
keys?: TreeKeysType;
/**
Expand Down Expand Up @@ -107,6 +107,14 @@ export interface TdTreeSelectProps<
* @default false
*/
multiple?: boolean;
/**
* 面板内的底部内容
*/
panelBottomContent?: string | TNode;
/**
* 面板内的顶部内容
*/
panelTopContent?: string | TNode;
/**
* 占位符
*/
Expand All @@ -132,6 +140,11 @@ export interface TdTreeSelectProps<
* @default false
*/
readonly?: boolean;
/**
* 多选且可搜索时,是否在选中一个选项后保留当前的搜索关键词
* @default false
*/
reserveKeyword?: boolean;
/**
* 【开发中】透传 SelectInput 筛选器输入框组件的全部属性
*/
Expand Down
Loading