From 18792c7b9a36487f9449a00ea0fbe682ed340c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?w=C5=AB=20y=C4=81ng?= Date: Tue, 10 Sep 2024 12:09:30 +0800 Subject: [PATCH] feat(cascader): add panel content api (#414) --- db/TDesign.db | Bin 1003520 -> 1003520 bytes .../src/cascader/cascader.en-US.md | 2 + .../tdesign-react/src/cascader/cascader.md | 2 + .../tdesign-react/src/cascader/type.ts | 8 ++ .../src/cascader/cascader.en-US.md | 2 + .../tdesign-vue-next/src/cascader/cascader.md | 2 + .../tdesign-vue-next/src/cascader/props.ts | 8 ++ .../tdesign-vue-next/src/cascader/type.ts | 8 ++ .../src/cascader/cascader.en-US.md | 2 + .../tdesign-vue/src/cascader/cascader.md | 2 + .../tdesign-vue/src/cascader/props.ts | 8 ++ .../products/tdesign-vue/src/cascader/type.ts | 8 ++ packages/scripts/api.json | 86 ++++++++++++++++++ 13 files changed, 138 insertions(+) diff --git a/db/TDesign.db b/db/TDesign.db index 467d1714008816d7ee9058795aace408bb7275fe..62f4a2e5cf6fdb8e3bceae29cb630661e5a6c385 100644 GIT binary patch delta 354 zcmZozVB4_3c7imc)kGO*Rx1X*vaZII))dCp6sFb`=GGLJ))dy(6t>nB_SO`R))dax z6t313?$#8Z))d~YDSUI|*_mY+U6^(-OqWaI_1qqqz-Pn6{DtY&^a)9PQ6ikoEKF(l zk0$d~LRr3i72E$M@v-Uhv2rUg@K#p8N7y78Dx^@5n3tMkWME{XYhbBsXrN$VVg*E|hFFBQ@0`sS z!pOuhbvplCzKL3m(sL>#Sr}zG4H@~8)u-C|PyZt=AgBt-;d1i(H delta 197 zcmZozVB4_3c7imc#Y7orRtpBbvW~`-))dCp6sFb`=GGLJ))dy(6t>nB_SO`R))dax z6t313?$#8Z))d~YDSUI|*_mE3Ix+2Fm@b#Z>$yEJfzO7C`5)82=@XLpqC}Ww7(~)U z<#KpGL0M+JAGiNY;$ze0W9Ht;z+cI|lh2;}1()}Bp$U9^+|⩔gFmDx|GRsdQ~r< w)ApUS`9c_(7)_@0&*hsq{pCEq3H%HUjGodgjG~-^oV>h^k=yO(@g3X<0JAMThyVZp diff --git a/packages/products/tdesign-react/src/cascader/cascader.en-US.md b/packages/products/tdesign-react/src/cascader/cascader.en-US.md index f21f6d19d..b10c27265 100644 --- a/packages/products/tdesign-react/src/cascader/cascader.en-US.md +++ b/packages/products/tdesign-react/src/cascader/cascader.en-US.md @@ -30,6 +30,8 @@ minCollapsedNum | Number | 0 | \- | N multiple | Boolean | false | \- | N option | TElement | - | customize one option。Typescript:`TNode<{ item: CascaderOption; index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N options | Array | [] | Typescript:`Array` | N +panelBottomContent | TNode | - | bottom content of the cascader panel。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N +panelTopContent | TNode | - | top content of the cascader panel。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/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-react/blob/develop/src/cascader/type.ts) | N popupVisible | Boolean | - | \- | N diff --git a/packages/products/tdesign-react/src/cascader/cascader.md b/packages/products/tdesign-react/src/cascader/cascader.md index ee054df22..88dedb903 100644 --- a/packages/products/tdesign-react/src/cascader/cascader.md +++ b/packages/products/tdesign-react/src/cascader/cascader.md @@ -30,6 +30,8 @@ minCollapsedNum | Number | 0 | 最小折叠数量,用于多选情况下折叠 multiple | Boolean | false | 是否允许多选 | N option | TElement | - | 自定义单个级联选项。TS 类型:`TNode<{ item: CascaderOption; index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N options | Array | [] | 可选项数据源。TS 类型:`Array` | N +panelBottomContent | TNode | - | 面板内的底部内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N +panelTopContent | TNode | - | 面板内的顶部内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N placeholder | String | undefined | 占位符 | N popupProps | Object | - | 参考 popup 组件 API。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/cascader/type.ts) | N popupVisible | Boolean | - | 是否显示下拉框 | N diff --git a/packages/products/tdesign-react/src/cascader/type.ts b/packages/products/tdesign-react/src/cascader/type.ts index 93259cdc6..c6c9c22d6 100644 --- a/packages/products/tdesign-react/src/cascader/type.ts +++ b/packages/products/tdesign-react/src/cascader/type.ts @@ -119,6 +119,14 @@ export interface TdCascaderProps; + /** + * 面板内的底部内容 + */ + panelBottomContent?: TNode; + /** + * 面板内的顶部内容 + */ + panelTopContent?: TNode; /** * 占位符 */ diff --git a/packages/products/tdesign-vue-next/src/cascader/cascader.en-US.md b/packages/products/tdesign-vue-next/src/cascader/cascader.en-US.md index d1f18423e..17bc1ebb9 100644 --- a/packages/products/tdesign-vue-next/src/cascader/cascader.en-US.md +++ b/packages/products/tdesign-vue-next/src/cascader/cascader.en-US.md @@ -28,6 +28,8 @@ minCollapsedNum | Number | 0 | \- | N multiple | Boolean | false | \- | N option | Slot / Function | - | customize one option。Typescript:`TNode<{ item: CascaderOption; index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N options | Array | [] | Typescript:`Array` | N +panelBottomContent | String / Slot / Function | - | bottom content of the cascader panel。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N +panelTopContent | String / Slot / Function | - | top content of the cascader panel。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/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-next/tree/develop/src/cascader/type.ts) | N popupVisible | Boolean | - | \- | N diff --git a/packages/products/tdesign-vue-next/src/cascader/cascader.md b/packages/products/tdesign-vue-next/src/cascader/cascader.md index 74d5dfdc5..d012c3ea0 100644 --- a/packages/products/tdesign-vue-next/src/cascader/cascader.md +++ b/packages/products/tdesign-vue-next/src/cascader/cascader.md @@ -28,6 +28,8 @@ minCollapsedNum | Number | 0 | 最小折叠数量,用于多选情况下折叠 multiple | Boolean | false | 是否允许多选 | N option | Slot / Function | - | 自定义单个级联选项。TS 类型:`TNode<{ item: CascaderOption; index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N options | Array | [] | 可选项数据源。TS 类型:`Array` | N +panelBottomContent | String / Slot / Function | - | 面板内的底部内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N +panelTopContent | String / Slot / Function | - | 面板内的顶部内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N placeholder | String | undefined | 占位符 | N popupProps | Object | - | 参考 popup 组件 API。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/cascader/type.ts) | N popupVisible | Boolean | - | 是否显示下拉框 | N diff --git a/packages/products/tdesign-vue-next/src/cascader/props.ts b/packages/products/tdesign-vue-next/src/cascader/props.ts index 9a275f2fb..8a5ea5d60 100644 --- a/packages/products/tdesign-vue-next/src/cascader/props.ts +++ b/packages/products/tdesign-vue-next/src/cascader/props.ts @@ -87,6 +87,14 @@ export default { type: Array as PropType, default: (): TdCascaderProps['options'] => [], }, + /** 面板内的底部内容 */ + panelBottomContent: { + type: [String, Function] as PropType, + }, + /** 面板内的顶部内容 */ + panelTopContent: { + type: [String, Function] as PropType, + }, /** 占位符 */ placeholder: { type: String, diff --git a/packages/products/tdesign-vue-next/src/cascader/type.ts b/packages/products/tdesign-vue-next/src/cascader/type.ts index 42454a5e2..38bb4ff46 100644 --- a/packages/products/tdesign-vue-next/src/cascader/type.ts +++ b/packages/products/tdesign-vue-next/src/cascader/type.ts @@ -118,6 +118,14 @@ export interface TdCascaderProps; + /** + * 面板内的底部内容 + */ + panelBottomContent?: string | TNode; + /** + * 面板内的顶部内容 + */ + panelTopContent?: string | TNode; /** * 占位符 */ diff --git a/packages/products/tdesign-vue/src/cascader/cascader.en-US.md b/packages/products/tdesign-vue/src/cascader/cascader.en-US.md index 671feb75a..9eaa9ffb9 100644 --- a/packages/products/tdesign-vue/src/cascader/cascader.en-US.md +++ b/packages/products/tdesign-vue/src/cascader/cascader.en-US.md @@ -28,6 +28,8 @@ minCollapsedNum | Number | 0 | \- | N multiple | Boolean | false | \- | N option | Slot / Function | - | customize one option。Typescript:`TNode<{ item: CascaderOption; index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N options | Array | [] | Typescript:`Array` | N +panelBottomContent | String / Slot / Function | - | bottom content of the cascader panel。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +panelTopContent | String / Slot / Function | - | top content of the cascader panel。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/cascader/type.ts) | N popupVisible | Boolean | - | \- | N diff --git a/packages/products/tdesign-vue/src/cascader/cascader.md b/packages/products/tdesign-vue/src/cascader/cascader.md index 00cc9e7bf..51c3b1af6 100644 --- a/packages/products/tdesign-vue/src/cascader/cascader.md +++ b/packages/products/tdesign-vue/src/cascader/cascader.md @@ -28,6 +28,8 @@ minCollapsedNum | Number | 0 | 最小折叠数量,用于多选情况下折叠 multiple | Boolean | false | 是否允许多选 | N option | Slot / Function | - | 自定义单个级联选项。TS 类型:`TNode<{ item: CascaderOption; index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N options | Array | [] | 可选项数据源。TS 类型:`Array` | 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 组件 API。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/cascader/type.ts) | N popupVisible | Boolean | - | 是否显示下拉框 | N diff --git a/packages/products/tdesign-vue/src/cascader/props.ts b/packages/products/tdesign-vue/src/cascader/props.ts index bf5034b74..da06d3d3e 100644 --- a/packages/products/tdesign-vue/src/cascader/props.ts +++ b/packages/products/tdesign-vue/src/cascader/props.ts @@ -87,6 +87,14 @@ export default { type: Array as PropType, default: (): TdCascaderProps['options'] => [], }, + /** 面板内的底部内容 */ + panelBottomContent: { + type: [String, Function] as PropType, + }, + /** 面板内的顶部内容 */ + panelTopContent: { + type: [String, Function] as PropType, + }, /** 占位符 */ placeholder: { type: String, diff --git a/packages/products/tdesign-vue/src/cascader/type.ts b/packages/products/tdesign-vue/src/cascader/type.ts index b754f8e31..9bcb39c6c 100644 --- a/packages/products/tdesign-vue/src/cascader/type.ts +++ b/packages/products/tdesign-vue/src/cascader/type.ts @@ -118,6 +118,14 @@ export interface TdCascaderProps; + /** + * 面板内的底部内容 + */ + panelBottomContent?: string | TNode; + /** + * 面板内的顶部内容 + */ + panelTopContent?: string | TNode; /** * 占位符 */ diff --git a/packages/scripts/api.json b/packages/scripts/api.json index f3ab246fd..04a7dd5b0 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -20748,6 +20748,92 @@ "Array" ] }, + { + "id": 1725941069, + "platform_framework": [ + "1", + "2", + "4" + ], + "component": "Cascader", + "field_category": 1, + "field_name": "panelBottomContent", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "面板内的底部内容", + "field_desc_en": "bottom content of the cascader panel", + "field_required": 0, + "event_input": "", + "create_time": "2024-09-10 04:04:29", + "update_time": "2024-09-10 04:04:29", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)", + "Angular(PC)" + ], + "field_type_text": [ + "String", + "TNode" + ] + }, + { + "id": 1725941091, + "platform_framework": [ + "1", + "2", + "4" + ], + "component": "Cascader", + "field_category": 1, + "field_name": "panelTopContent", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "面板内的顶部内容", + "field_desc_en": "top content of the cascader panel", + "field_required": 0, + "event_input": "", + "create_time": "2024-09-10 04:04:51", + "update_time": "2024-09-10 04:04:51", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)", + "Angular(PC)" + ], + "field_type_text": [ + "String", + "TNode" + ] + }, { "id": 386, "platform_framework": [