Skip to content
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
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
check-strictly | Boolean | false | \- | N
close-btn | Boolean | true | \- | N
filter | Function | - | Typescript: `CascaderFilterFunction ` `type CascaderFilterFunction<CascaderOption extends TreeOptionData = TreeOptionData> = (keyword: string, option: CascaderOption, path: CascaderOption[]) => boolean`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/cascader/type.ts) | N
filter-placeholder | String | - | \- | N
filterable | Boolean | false | \- | N
keys | Object | - | Typescript: `CascaderKeysType` `type CascaderKeysType = TreeKeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/cascader/type.ts) | N
options | Array | [] | Typescript: `Array<CascaderOption>` | N
placeholder | String | - | \- | N
Expand All @@ -25,6 +28,7 @@ visible | Boolean | false | \- | N
name | params | description
-- | -- | --
change | `(value: string \| number, selectedOptions: string[])` | `1.0.1`
change | `(detail: { value: string \| number, selectedOptions: string[] })` | `1.0.1`
close | `(trigger: CascaderTriggerSource)` | `1.0.1`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/cascader/type.ts)。<br/>`type CascaderTriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/>
pick | `(value: string \| number, label: string, index: number, level: number)` | `1.0.1`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
check-strictly | Boolean | false | 父子节点选中状态不再关联,可各自选中或取消 | N
close-btn | Boolean | true | 关闭按钮 | N
filter | Function | - | 自定义过滤函数。返回 true 表示匹配,未设置时使用内置匹配规则:对路径中所有 label 拼接后做大小写不敏感的 includes 匹配。TS 类型:`CascaderFilterFunction ` `type CascaderFilterFunction<CascaderOption extends TreeOptionData = TreeOptionData> = (keyword: string, option: CascaderOption, path: CascaderOption[]) => boolean`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/cascader/type.ts) | N
filter-placeholder | String | - | 搜索框占位符描述文本 | N
filterable | Boolean | false | 是否可搜索,开启后顶部会展示一个搜索框 | N
keys | Object | - | 用来定义 value / label / children / disabled 在 `options` 中对应的字段别名。TS 类型:`CascaderKeysType` `type CascaderKeysType = TreeKeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/cascader/type.ts) | N
options | Array | [] | 可选项数据源。TS 类型:`Array<CascaderOption>` | N
placeholder | String | - | 未选中时的提示文案。组件内置默认值为:'选择选项' | N
Expand All @@ -25,6 +28,7 @@ visible | Boolean | false | 是否展示 | N
名称 | 参数 | 描述
-- | -- | --
change | `(value: string \| number, selectedOptions: string[])` | `1.0.1`。值发生变更时触发
change | `(detail: { value: string \| number, selectedOptions: string[] })` | `1.0.1`。值发生变更时触发
close | `(trigger: CascaderTriggerSource)` | `1.0.1`。关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/cascader/type.ts)。<br/>`type CascaderTriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/>
pick | `(value: string \| number, label: string, index: number, level: number)` | `1.0.1`。选择后触发

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ const props: TdCascaderProps = {
type: Boolean,
value: true,
},
/** 自定义过滤函数。返回 true 表示匹配,未设置时使用内置匹配规则:对路径中所有 label 拼接后做大小写不敏感的 includes 匹配 */
filter: {
type: null,
},
/** 搜索框占位符描述文本 */
filterPlaceholder: {
type: String,
value: '',
},
/** 是否可搜索,开启后顶部会展示一个搜索框 */
filterable: {
type: Boolean,
value: false,
},
/** 用来定义 value / label / children / disabled 在 `options` 中对应的字段别名 */
keys: {
type: Object,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TreeOptionData, TreeKeysType } from '../common/common';
import type { TreeOptionData, TreeKeysType } from '../common/common';

export interface TdCascaderProps<CascaderOption extends TreeOptionData = TreeOptionData> {
/**
Expand All @@ -23,6 +23,29 @@ export interface TdCascaderProps<CascaderOption extends TreeOptionData = TreeOpt
type: BooleanConstructor;
value?: boolean;
};
/**
* 自定义过滤函数。返回 true 表示匹配,未设置时使用内置匹配规则:对路径中所有 label 拼接后做大小写不敏感的 includes 匹配
*/
filter?: {
type: undefined;
value?: CascaderFilterFunction;
};
/**
* 搜索框占位符描述文本
* @default ''
*/
filterPlaceholder?: {
type: StringConstructor;
value?: string;
};
/**
* 是否可搜索,开启后顶部会展示一个搜索框
* @default false
*/
filterable?: {
type: BooleanConstructor;
value?: boolean;
};
/**
* 用来定义 value / label / children / disabled 在 `options` 中对应的字段别名
*/
Expand Down Expand Up @@ -95,4 +118,10 @@ export interface TdCascaderProps<CascaderOption extends TreeOptionData = TreeOpt
};
}

export type CascaderFilterFunction<CascaderOption extends TreeOptionData = TreeOptionData> = (
keyword: string,
option: CascaderOption,
path: CascaderOption[],
) => boolean;

export type CascaderKeysType = TreeKeysType;
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ name | type | default | description | required
custom-style | Object | - | CSS(Cascading Style Sheets) | N
check-strictly | Boolean | false | \- | N
close-btn | Boolean | true | \- | N
filter | Function | - | Typescript: `CascaderFilterFunction ` `type CascaderFilterFunction<CascaderOption extends TreeOptionData = TreeOptionData> = (keyword: string, option: CascaderOption, path: CascaderOption[]) => boolean`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/common/common.ts)。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/cascader/type.ts) | N
filter-placeholder | String | - | \- | N
filterable | Boolean | false | \- | N
keys | Object | - | Typescript: `CascaderKeysType` `type CascaderKeysType = TreeKeysType`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/common/common.ts)。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/cascader/type.ts) | N
options | Array | [] | Typescript: `Array<CascaderOption>` | N
placeholder | String | - | \- | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
custom-style | Object | - | 自定义样式 | N
check-strictly | Boolean | false | 父子节点选中状态不再关联,可各自选中或取消 | N
close-btn | Boolean | true | 关闭按钮 | N
filter | Function | - | 自定义过滤函数。返回 true 表示匹配,未设置时使用内置匹配规则:对路径中所有 label 拼接后做大小写不敏感的 includes 匹配。TS 类型:`CascaderFilterFunction ` `type CascaderFilterFunction<CascaderOption extends TreeOptionData = TreeOptionData> = (keyword: string, option: CascaderOption, path: CascaderOption[]) => boolean`。[通用类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/common/common.ts)。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/cascader/type.ts) | N
filter-placeholder | String | - | 搜索框占位符描述文本 | N
filterable | Boolean | false | 是否可搜索,开启后顶部会展示一个搜索框 | N
keys | Object | - | 用来定义 value / label / children / disabled 在 `options` 中对应的字段别名。TS 类型:`CascaderKeysType` `type CascaderKeysType = TreeKeysType`。[通用类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/common/common.ts)。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/cascader/type.ts) | N
options | Array | [] | 可选项数据源。TS 类型:`Array<CascaderOption>` | N
placeholder | String | - | 未选中时的提示文案。组件内置默认值为:'选择选项' | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ export default {
type: Boolean,
default: true as TdCascaderProps['closeBtn'],
},
/** 自定义过滤函数。返回 true 表示匹配,未设置时使用内置匹配规则:对路径中所有 label 拼接后做大小写不敏感的 includes 匹配 */
filter: {
type: Function,
},
/** 搜索框占位符描述文本 */
filterPlaceholder: {
type: String,
default: '',
},
/** 是否可搜索,开启后顶部会展示一个搜索框 */
filterable: Boolean,
/** 用来定义 value / label / children / disabled 在 `options` 中对应的字段别名 */
keys: {
type: Object,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ export interface TdCascaderProps<CascaderOption extends TreeOptionData = TreeOpt
* @default true
*/
closeBtn?: boolean;
/**
* 自定义过滤函数。返回 true 表示匹配,未设置时使用内置匹配规则:对路径中所有 label 拼接后做大小写不敏感的 includes 匹配
*/
filter?: CascaderFilterFunction;
/**
* 搜索框占位符描述文本
* @default ''
*/
filterPlaceholder?: string;
/**
* 是否可搜索,开启后顶部会展示一个搜索框
* @default false
*/
filterable?: boolean;
/**
* 用来定义 value / label / children / disabled 在 `options` 中对应的字段别名
*/
Expand Down Expand Up @@ -78,6 +92,12 @@ export interface TdCascaderProps<CascaderOption extends TreeOptionData = TreeOpt
onPick?: (context: { value: string | number; label: string; index: number; level: number }) => void;
}

export type CascaderFilterFunction<CascaderOption extends TreeOptionData = TreeOptionData> = (
keyword: string,
option: CascaderOption,
path: CascaderOption[],
) => boolean;

export type CascaderKeysType = TreeKeysType;

export type CascaderTriggerSource = 'overlay' | 'close-btn' | 'finish';
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N
checkStrictly | Boolean | false | \- | N
closeBtn | TNode | true | Typescript: `boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
filter | Function | - | Typescript: `CascaderFilterFunction ` `type CascaderFilterFunction<CascaderOption extends TreeOptionData = TreeOptionData> = (keyword: string, option: CascaderOption, path: CascaderOption[]) => boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/cascader/type.ts) | N
filterPlaceholder | String | - | \- | N
filterable | Boolean | false | \- | N
header | TElement | - | `0.21.2`。Typescript: `TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
keys | Object | - | Typescript: `CascaderKeysType` `type CascaderKeysType = TreeKeysType`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/cascader/type.ts) | N
lazy | Boolean | false | \- | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
checkStrictly | Boolean | false | 父子节点选中状态不再关联,可各自选中或取消 | N
closeBtn | TNode | true | 关闭按钮。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
filter | Function | - | 自定义过滤函数。返回 true 表示匹配,未设置时使用内置匹配规则:对路径中所有 label 拼接后做大小写不敏感的 includes 匹配。TS 类型:`CascaderFilterFunction ` `type CascaderFilterFunction<CascaderOption extends TreeOptionData = TreeOptionData> = (keyword: string, option: CascaderOption, path: CascaderOption[]) => boolean`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/cascader/type.ts) | N
filterPlaceholder | String | - | 搜索框占位符描述文本 | N
filterable | Boolean | false | 是否可搜索,开启后顶部会展示一个搜索框 | N
header | TElement | - | `0.21.2`。头部。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
keys | Object | - | 用来定义 value / label / children / disabled 在 `options` 中对应的字段别名。TS 类型:`CascaderKeysType` `type CascaderKeysType = TreeKeysType`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/cascader/type.ts) | N
lazy | Boolean | false | 是否异步加载 | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { TdCascaderProps } from './type';
export const cascaderDefaultProps: TdCascaderProps = {
checkStrictly: false,
closeBtn: true,
filterable: false,
lazy: false,
loadCompleted: false,
options: [],
Expand Down
20 changes: 20 additions & 0 deletions packages/products/tdesign-mobile-react/src/cascader/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ export interface TdCascaderProps<CascaderOption extends TreeOptionData = TreeOpt
* @default true
*/
closeBtn?: TNode;
/**
* 自定义过滤函数。返回 true 表示匹配,未设置时使用内置匹配规则:对路径中所有 label 拼接后做大小写不敏感的 includes 匹配
*/
filter?: CascaderFilterFunction;
/**
* 搜索框占位符描述文本
* @default ''
*/
filterPlaceholder?: string;
/**
* 是否可搜索,开启后顶部会展示一个搜索框
* @default false
*/
filterable?: boolean;
/**
* 头部
*/
Expand Down Expand Up @@ -100,6 +114,12 @@ export interface TdCascaderProps<CascaderOption extends TreeOptionData = TreeOpt
onPick?: (context: { value: string | number; label: string; index: number; level: number }) => void;
}

export type CascaderFilterFunction<CascaderOption extends TreeOptionData = TreeOptionData> = (
keyword: string,
option: CascaderOption,
path: CascaderOption[],
) => boolean;

export type CascaderKeysType = TreeKeysType;

export type CascaderTriggerSource = 'overlay' | 'close-btn' | 'finish';
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ name | type | default | description | required
-- | -- | -- | -- | --
checkStrictly | Boolean | false | \- | N
closeBtn | Boolean / Slot / Function | true | Typescript: `boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
filter | Function | - | Typescript: `CascaderFilterFunction ` `type CascaderFilterFunction<CascaderOption extends TreeOptionData = TreeOptionData> = (keyword: string, option: CascaderOption, path: CascaderOption[]) => boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts) | N
filterPlaceholder | String | - | \- | N
filterable | Boolean | false | \- | N
header | Slot / Function | - | `1.11.0`。Typescript: `TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
keys | Object | - | Typescript: `CascaderKeysType` `type CascaderKeysType = TreeKeysType`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts) | N
load | Function | - | `1.12.0`。loading subtree data (only effective when the node's children value is true)。Typescript: `(node: CascaderOption) => Promise<Array<CascaderOption>>` | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
-- | -- | -- | -- | --
checkStrictly | Boolean | false | 父子节点选中状态不再关联,可各自选中或取消 | N
closeBtn | Boolean / Slot / Function | true | 关闭按钮。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
filter | Function | - | 自定义过滤函数。返回 true 表示匹配,未设置时使用内置匹配规则:对路径中所有 label 拼接后做大小写不敏感的 includes 匹配。TS 类型:`CascaderFilterFunction ` `type CascaderFilterFunction<CascaderOption extends TreeOptionData = TreeOptionData> = (keyword: string, option: CascaderOption, path: CascaderOption[]) => boolean`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts) | N
filterPlaceholder | String | - | 搜索框占位符描述文本 | N
filterable | Boolean | false | 是否可搜索,开启后顶部会展示一个搜索框 | N
header | Slot / Function | - | `1.11.0`。头部。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
keys | Object | - | 用来定义 value / label / children / disabled 在 `options` 中对应的字段别名。TS 类型:`CascaderKeysType` `type CascaderKeysType = TreeKeysType`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/cascader/type.ts) | N
load | Function | - | `1.12.0`。加载子树数据的方法(仅当节点 children 为 true 时生效)。TS 类型:`(node: CascaderOption) => Promise<Array<CascaderOption>>` | N
Expand Down
11 changes: 11 additions & 0 deletions packages/products/tdesign-mobile-vue/src/cascader/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ export default {
type: [Boolean, Function] as PropType<TdCascaderProps['closeBtn']>,
default: true as TdCascaderProps['closeBtn'],
},
/** 自定义过滤函数。返回 true 表示匹配,未设置时使用内置匹配规则:对路径中所有 label 拼接后做大小写不敏感的 includes 匹配 */
filter: {
type: Function as PropType<TdCascaderProps['filter']>,
},
/** 搜索框占位符描述文本 */
filterPlaceholder: {
type: String,
default: '',
},
/** 是否可搜索,开启后顶部会展示一个搜索框 */
filterable: Boolean,
/** 头部 */
header: {
type: Function as PropType<TdCascaderProps['header']>,
Expand Down
Loading