From 0dd79be3a9e14abfd7e525ea0554b0f4f4cee1f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Wed, 8 Jan 2025 18:09:41 +0800 Subject: [PATCH 1/3] feat(config-provider): add AutoCompleteConfig empty api --- db/TDesign.db | Bin 1007616 -> 1007616 bytes .../config-provider/config-provider.en-US.md | 6 +++ .../src/config-provider/config-provider.md | 6 +++ .../tdesign-react/src/config-provider/type.ts | 8 ++++ .../config-provider/config-provider.en-US.md | 6 +++ .../src/config-provider/config-provider.md | 6 +++ .../src/config-provider/type.ts | 8 ++++ .../config-provider/config-provider.en-US.md | 6 +++ .../src/config-provider/config-provider.md | 6 +++ .../tdesign-vue/src/config-provider/type.ts | 8 ++++ packages/scripts/api.json | 41 ++++++++++++++++++ packages/scripts/config/files-combine.js | 1 + packages/scripts/map.json | 5 +++ .../server/controllers/ComponentApi/const.ts | 1 + 14 files changed, 108 insertions(+) diff --git a/db/TDesign.db b/db/TDesign.db index 4ba1804d545315bbd0958ee40e19c2125f96dc0d..4837eaf3803e8ea2f5b807839cdb1e0a997eecb1 100644 GIT binary patch delta 218 zcmZoTVB2uOc7imc?L--8R$B(WvW~`-))dCp6sFb`=GGLJ))dy(6t>nB_SO`R))dax z6t313?$#8Z))d~YDSQj!83VSnCh#p}V&eX_eMJ(VIVYps^at5|a%|~!e!hI$mb2vW zJrQE(c4pu&;%DH=;Zxvs;Xcppyj{_NYXawXhXc%W8Mzuc=9)>eFdA}-Prqo*DJ%%m z%I;WNlJA_KTac4lk~-b6nnh=NO(6@vvZ=0tp{{|2f}w$xfw`4|rICRVy3qFX(fo!i E0B46jXaE2J delta 136 zcmV;30C)d@z&(J#J&+p#Jdqqj1v~&Qc8Y;yg=7JRWCDd`1BGM+g=7VVWCn#~2Zdw^ zg=7hZWD1333x#A1g=7u2WDcNT0Z+FDU=E=I0t5oLsA3K`2>~dV;A;*Z24)N9X$=CW q1Z)oE5C#j+01t8x01RvnAPqzd&$l5k3Xlo6K)?el0=Lgw4>1I3=qSzr diff --git a/packages/products/tdesign-react/src/config-provider/config-provider.en-US.md b/packages/products/tdesign-react/src/config-provider/config-provider.en-US.md index 31db4c77..162166ae 100644 --- a/packages/products/tdesign-react/src/config-provider/config-provider.en-US.md +++ b/packages/products/tdesign-react/src/config-provider/config-provider.en-US.md @@ -354,3 +354,9 @@ name | type | default | description | required collapseText | String | - | collapse text | N copiedText | String | - | copied text | N expandText | String | - | expand text | N + +### AutoCompleteConfig + +name | type | default | description | required +-- | -- | -- | -- | -- +empty | String | - | \- | N diff --git a/packages/products/tdesign-react/src/config-provider/config-provider.md b/packages/products/tdesign-react/src/config-provider/config-provider.md index c50b8756..81fbe58d 100644 --- a/packages/products/tdesign-react/src/config-provider/config-provider.md +++ b/packages/products/tdesign-react/src/config-provider/config-provider.md @@ -354,3 +354,9 @@ titleText | Object | - | 空状态组件各类型的标题文本配置。TS 类 collapseText | String | - | 语言配置,“收起”描述文本 | N copiedText | String | - | 语言配置,“复制成功”描述文本 | N expandText | String | - | 语言配置,“展开”描述文本 | N + +### AutoCompleteConfig + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +empty | String | - | 语言配置,“暂无数据”描述文本 | N diff --git a/packages/products/tdesign-react/src/config-provider/type.ts b/packages/products/tdesign-react/src/config-provider/type.ts index 7bc3452f..34b9dec9 100644 --- a/packages/products/tdesign-react/src/config-provider/type.ts +++ b/packages/products/tdesign-react/src/config-provider/type.ts @@ -960,6 +960,14 @@ export interface TypographyConfig { expandText?: string; } +export interface AutoCompleteConfig { + /** + * 语言配置,“暂无数据”描述文本 + * @default '' + */ + empty?: string; +} + export type AnimationType = 'ripple' | 'expand' | 'fade'; export type IconConfig = GlobalIconConfig; diff --git a/packages/products/tdesign-vue-next/src/config-provider/config-provider.en-US.md b/packages/products/tdesign-vue-next/src/config-provider/config-provider.en-US.md index 3dcfd7a2..5d4202b4 100644 --- a/packages/products/tdesign-vue-next/src/config-provider/config-provider.en-US.md +++ b/packages/products/tdesign-vue-next/src/config-provider/config-provider.en-US.md @@ -354,3 +354,9 @@ name | type | default | description | required collapseText | String | - | collapse text | N copiedText | String | - | copied text | N expandText | String | - | expand text | N + +### AutoCompleteConfig + +name | type | default | description | required +-- | -- | -- | -- | -- +empty | String | - | \- | N diff --git a/packages/products/tdesign-vue-next/src/config-provider/config-provider.md b/packages/products/tdesign-vue-next/src/config-provider/config-provider.md index 9789a82e..07140139 100644 --- a/packages/products/tdesign-vue-next/src/config-provider/config-provider.md +++ b/packages/products/tdesign-vue-next/src/config-provider/config-provider.md @@ -354,3 +354,9 @@ titleText | Object | - | 空状态组件各类型的标题文本配置。TS 类 collapseText | String | - | 语言配置,“收起”描述文本 | N copiedText | String | - | 语言配置,“复制成功”描述文本 | N expandText | String | - | 语言配置,“展开”描述文本 | N + +### AutoCompleteConfig + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +empty | String | - | 语言配置,“暂无数据”描述文本 | N diff --git a/packages/products/tdesign-vue-next/src/config-provider/type.ts b/packages/products/tdesign-vue-next/src/config-provider/type.ts index 597f63e9..74baba80 100644 --- a/packages/products/tdesign-vue-next/src/config-provider/type.ts +++ b/packages/products/tdesign-vue-next/src/config-provider/type.ts @@ -960,6 +960,14 @@ export interface TypographyConfig { expandText?: string; } +export interface AutoCompleteConfig { + /** + * 语言配置,“暂无数据”描述文本 + * @default '' + */ + empty?: string; +} + export type AnimationType = 'ripple' | 'expand' | 'fade'; export type IconConfig = GlobalIconConfig; diff --git a/packages/products/tdesign-vue/src/config-provider/config-provider.en-US.md b/packages/products/tdesign-vue/src/config-provider/config-provider.en-US.md index 2fecc6d8..0fb99047 100644 --- a/packages/products/tdesign-vue/src/config-provider/config-provider.en-US.md +++ b/packages/products/tdesign-vue/src/config-provider/config-provider.en-US.md @@ -354,3 +354,9 @@ name | type | default | description | required collapseText | String | - | collapse text | N copiedText | String | - | copied text | N expandText | String | - | expand text | N + +### AutoCompleteConfig + +name | type | default | description | required +-- | -- | -- | -- | -- +empty | String | - | \- | N diff --git a/packages/products/tdesign-vue/src/config-provider/config-provider.md b/packages/products/tdesign-vue/src/config-provider/config-provider.md index fcbe4b35..638e5ac5 100644 --- a/packages/products/tdesign-vue/src/config-provider/config-provider.md +++ b/packages/products/tdesign-vue/src/config-provider/config-provider.md @@ -354,3 +354,9 @@ titleText | Object | - | 空状态组件各类型的标题文本配置。TS 类 collapseText | String | - | 语言配置,“收起”描述文本 | N copiedText | String | - | 语言配置,“复制成功”描述文本 | N expandText | String | - | 语言配置,“展开”描述文本 | N + +### AutoCompleteConfig + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +empty | String | - | 语言配置,“暂无数据”描述文本 | N diff --git a/packages/products/tdesign-vue/src/config-provider/type.ts b/packages/products/tdesign-vue/src/config-provider/type.ts index 23ea74e1..26c7c1e5 100644 --- a/packages/products/tdesign-vue/src/config-provider/type.ts +++ b/packages/products/tdesign-vue/src/config-provider/type.ts @@ -960,6 +960,14 @@ export interface TypographyConfig { expandText?: string; } +export interface AutoCompleteConfig { + /** + * 语言配置,“暂无数据”描述文本 + * @default '' + */ + empty?: string; +} + export type AnimationType = 'ripple' | 'expand' | 'fade'; export type IconConfig = GlobalIconConfig; diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 8920dceb..36625f75 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -5778,6 +5778,47 @@ ], "field_type_text": [] }, + { + "id": 1736330829, + "platform_framework": [ + "1", + "2", + "4" + ], + "component": "AutoCompleteConfig", + "field_category": 1, + "field_name": "empty", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "语言配置,“暂无数据”描述文本", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2025-01-08 10:07:09", + "update_time": "2025-01-08 10:07:09", + "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" + ] + }, { "id": 1466, "platform_framework": [ diff --git a/packages/scripts/config/files-combine.js b/packages/scripts/config/files-combine.js index aa3bac97..7e3ba8f6 100644 --- a/packages/scripts/config/files-combine.js +++ b/packages/scripts/config/files-combine.js @@ -38,6 +38,7 @@ const GLOBAL_COMPONENTS_CONFIG = [ 'RateConfig', 'EmptyConfig', 'TypographyConfig', + 'AutoCompleteConfig', ].sort((a, b) => a.localeCompare(b) > 0); const MESSAGE_LIST = [ diff --git a/packages/scripts/map.json b/packages/scripts/map.json index 6a485602..394d28bf 100644 --- a/packages/scripts/map.json +++ b/packages/scripts/map.json @@ -299,6 +299,11 @@ "value": "AutoComplete", "label": "自动填充" }, + { + "value": "AutoCompleteConfig", + "label": "自动填充全局配置", + "type": "TS" + }, { "value": "Avatar", "label": "头像" diff --git a/packages/server/controllers/ComponentApi/const.ts b/packages/server/controllers/ComponentApi/const.ts index 4f865d14..fb9f8bcd 100644 --- a/packages/server/controllers/ComponentApi/const.ts +++ b/packages/server/controllers/ComponentApi/const.ts @@ -341,6 +341,7 @@ export const COMPONENTS_PC: Array = [ { value: 'WatermarkText', label: '水印文字配置', type: 'TS' }, { value: 'WatermarkImage', label: '水印图片配置', type: 'TS' }, { value: 'TypographyConfig', label: '排版全局配置', type: 'TS' }, + { value: 'AutoCompleteConfig', label: '自动填充全局配置', type: 'TS' }, ].sort((a, b) => a.value.localeCompare(b.value)); export const COMPONENTS_MOBILE: Array = [ From 0890fb07bc9cdc4179673ff3baf83f90094b77e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Wed, 8 Jan 2025 20:49:18 +0800 Subject: [PATCH 2/3] feat(GlobalConfigProvider): add autoComplete --- db/TDesign.db | Bin 1007616 -> 1007616 bytes .../config-provider/config-provider.en-US.md | 1 + .../src/config-provider/config-provider.md | 1 + .../tdesign-react/src/config-provider/type.ts | 4 ++ .../config-provider/config-provider.en-US.md | 1 + .../src/config-provider/config-provider.md | 1 + .../src/config-provider/type.ts | 4 ++ .../config-provider/config-provider.en-US.md | 1 + .../src/config-provider/config-provider.md | 1 + .../tdesign-vue/src/config-provider/type.ts | 4 ++ packages/scripts/api.json | 41 ++++++++++++++++++ 11 files changed, 59 insertions(+) diff --git a/db/TDesign.db b/db/TDesign.db index 4837eaf3803e8ea2f5b807839cdb1e0a997eecb1..88e9687a5f088078b8e476f078aaf1ba5c59c1d9 100644 GIT binary patch delta 302 zcmZoTVB2uOc7imc{X`jOM*GHu)&$1Z1g6#m=GFw3)&$np1h&=$_SOWB)&$Ph1g_Qu z?$!jJ)&$pUoH8y52 zWZ>lB<=|!D02wsBF_lHsG_kZK-#I_GASbmXmE%SGs;6Bmo-SPdw6*p5?v^LJw>@oL z@pNOu%hulKd)GO_l}_Ji$}eJXs%v1VYha;ZXk=w#W@TbwWMG6YgwRrw>YSgKmYLqj YG1m;}EJIH5=@+dzg|{a}^Dkfl0J?=_ivR!s delta 149 zcmV;G0BZk$z&(J#J&+p#J&_zk0X>0Wg3;1BGA&g~9L;A;*PmyBZ#3b+1i4hG~B z2Ma?04{{Fx3~UY{4MYpi3q!XdFba?fw?M!HodF7g2%R<=1OYJ#7njjH2@|(qTMwWF D>|QN3 diff --git a/packages/products/tdesign-react/src/config-provider/config-provider.en-US.md b/packages/products/tdesign-react/src/config-provider/config-provider.en-US.md index 162166ae..78ac0808 100644 --- a/packages/products/tdesign-react/src/config-provider/config-provider.en-US.md +++ b/packages/products/tdesign-react/src/config-provider/config-provider.en-US.md @@ -9,6 +9,7 @@ alert | Object | - | Alert global configs。Typescript:`AlertConfig` | N anchor | Object | - | Anchor global configs。Typescript:`AnchorConfig` | N animation | Object | - | Typescript:`Partial>>` `type AnimationType = 'ripple' \| 'expand' \| 'fade'`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/config-provider/type.ts) | N attach | String / Object / Function | - | Typescript:`AttachNode \| { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode; }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N +autoComplete | Object | - | AutoComplete global configs。Typescript:`AutoCompleteConfig` | N calendar | Object | - | Calendar global configs。Typescript:`CalendarConfig` | N cascader | Object | - | Cascader global configs。Typescript:`CascaderConfig` | N classPrefix | String | t | \- | N diff --git a/packages/products/tdesign-react/src/config-provider/config-provider.md b/packages/products/tdesign-react/src/config-provider/config-provider.md index 81fbe58d..ee6bb9bf 100644 --- a/packages/products/tdesign-react/src/config-provider/config-provider.md +++ b/packages/products/tdesign-react/src/config-provider/config-provider.md @@ -9,6 +9,7 @@ alert | Object | - | 警告全局配置。TS 类型:`AlertConfig` | N anchor | Object | - | 锚点全局配置。TS 类型:`AnchorConfig` | N animation | Object | - | 动画效果控制,`ripple` 指波纹动画, `expand` 指展开动画,`fade` 指渐变动画。默认为 `{ include: ['ripple','expand','fade'], exclude: [] }`。TS 类型:`Partial>>` `type AnimationType = 'ripple' \| 'expand' \| 'fade'`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/config-provider/type.ts) | N attach | String / Object / Function | - | TS 类型:`AttachNode \| { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode; }`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N +autoComplete | Object | - | 自动填充组件全局配置。TS 类型:`AutoCompleteConfig` | N calendar | Object | - | 日历组件全局配置。TS 类型:`CalendarConfig` | N cascader | Object | - | 级联选择器全局配置。TS 类型:`CascaderConfig` | N classPrefix | String | t | CSS 类名前缀 | N diff --git a/packages/products/tdesign-react/src/config-provider/type.ts b/packages/products/tdesign-react/src/config-provider/type.ts index 34b9dec9..9cfa7217 100644 --- a/packages/products/tdesign-react/src/config-provider/type.ts +++ b/packages/products/tdesign-react/src/config-provider/type.ts @@ -29,6 +29,10 @@ export interface GlobalConfigProvider { * null */ attach?: AttachNode | { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode }; + /** + * 自动填充组件全局配置 + */ + autoComplete?: AutoCompleteConfig; /** * 日历组件全局配置 */ diff --git a/packages/products/tdesign-vue-next/src/config-provider/config-provider.en-US.md b/packages/products/tdesign-vue-next/src/config-provider/config-provider.en-US.md index 5d4202b4..b5bb4543 100644 --- a/packages/products/tdesign-vue-next/src/config-provider/config-provider.en-US.md +++ b/packages/products/tdesign-vue-next/src/config-provider/config-provider.en-US.md @@ -9,6 +9,7 @@ alert | Object | - | Alert global configs。Typescript:`AlertConfig` | N anchor | Object | - | Anchor global configs。Typescript:`AnchorConfig` | N animation | Object | - | Typescript:`Partial>>` `type AnimationType = 'ripple' \| 'expand' \| 'fade'`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/config-provider/type.ts) | N attach | String / Object / Function | - | Typescript:`AttachNode \| { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode; }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N +autoComplete | Object | - | AutoComplete global configs。Typescript:`AutoCompleteConfig` | N calendar | Object | - | Calendar global configs。Typescript:`CalendarConfig` | N cascader | Object | - | Cascader global configs。Typescript:`CascaderConfig` | N classPrefix | String | t | \- | N diff --git a/packages/products/tdesign-vue-next/src/config-provider/config-provider.md b/packages/products/tdesign-vue-next/src/config-provider/config-provider.md index 07140139..f1427653 100644 --- a/packages/products/tdesign-vue-next/src/config-provider/config-provider.md +++ b/packages/products/tdesign-vue-next/src/config-provider/config-provider.md @@ -9,6 +9,7 @@ alert | Object | - | 警告全局配置。TS 类型:`AlertConfig` | N anchor | Object | - | 锚点全局配置。TS 类型:`AnchorConfig` | N animation | Object | - | 动画效果控制,`ripple` 指波纹动画, `expand` 指展开动画,`fade` 指渐变动画。默认为 `{ include: ['ripple','expand','fade'], exclude: [] }`。TS 类型:`Partial>>` `type AnimationType = 'ripple' \| 'expand' \| 'fade'`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/config-provider/type.ts) | N attach | String / Object / Function | - | TS 类型:`AttachNode \| { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode; }`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N +autoComplete | Object | - | 自动填充组件全局配置。TS 类型:`AutoCompleteConfig` | N calendar | Object | - | 日历组件全局配置。TS 类型:`CalendarConfig` | N cascader | Object | - | 级联选择器全局配置。TS 类型:`CascaderConfig` | N classPrefix | String | t | CSS 类名前缀 | N diff --git a/packages/products/tdesign-vue-next/src/config-provider/type.ts b/packages/products/tdesign-vue-next/src/config-provider/type.ts index 74baba80..909eee71 100644 --- a/packages/products/tdesign-vue-next/src/config-provider/type.ts +++ b/packages/products/tdesign-vue-next/src/config-provider/type.ts @@ -29,6 +29,10 @@ export interface GlobalConfigProvider { * null */ attach?: AttachNode | { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode }; + /** + * 自动填充组件全局配置 + */ + autoComplete?: AutoCompleteConfig; /** * 日历组件全局配置 */ diff --git a/packages/products/tdesign-vue/src/config-provider/config-provider.en-US.md b/packages/products/tdesign-vue/src/config-provider/config-provider.en-US.md index 0fb99047..8efc7c39 100644 --- a/packages/products/tdesign-vue/src/config-provider/config-provider.en-US.md +++ b/packages/products/tdesign-vue/src/config-provider/config-provider.en-US.md @@ -9,6 +9,7 @@ alert | Object | - | Alert global configs。Typescript:`AlertConfig` | N anchor | Object | - | Anchor global configs。Typescript:`AnchorConfig` | N animation | Object | - | Typescript:`Partial>>` `type AnimationType = 'ripple' \| 'expand' \| 'fade'`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N attach | String / Object / Function | - | Typescript:`AttachNode \| { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode; }`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +autoComplete | Object | - | AutoComplete global configs。Typescript:`AutoCompleteConfig` | N calendar | Object | - | Calendar global configs。Typescript:`CalendarConfig` | N cascader | Object | - | Cascader global configs。Typescript:`CascaderConfig` | N classPrefix | String | t | \- | N diff --git a/packages/products/tdesign-vue/src/config-provider/config-provider.md b/packages/products/tdesign-vue/src/config-provider/config-provider.md index 638e5ac5..24097eaa 100644 --- a/packages/products/tdesign-vue/src/config-provider/config-provider.md +++ b/packages/products/tdesign-vue/src/config-provider/config-provider.md @@ -9,6 +9,7 @@ alert | Object | - | 警告全局配置。TS 类型:`AlertConfig` | N anchor | Object | - | 锚点全局配置。TS 类型:`AnchorConfig` | N animation | Object | - | 动画效果控制,`ripple` 指波纹动画, `expand` 指展开动画,`fade` 指渐变动画。默认为 `{ include: ['ripple','expand','fade'], exclude: [] }`。TS 类型:`Partial>>` `type AnimationType = 'ripple' \| 'expand' \| 'fade'`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N attach | String / Object / Function | - | TS 类型:`AttachNode \| { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode; }`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +autoComplete | Object | - | 自动填充组件全局配置。TS 类型:`AutoCompleteConfig` | N calendar | Object | - | 日历组件全局配置。TS 类型:`CalendarConfig` | N cascader | Object | - | 级联选择器全局配置。TS 类型:`CascaderConfig` | N classPrefix | String | t | CSS 类名前缀 | N diff --git a/packages/products/tdesign-vue/src/config-provider/type.ts b/packages/products/tdesign-vue/src/config-provider/type.ts index 26c7c1e5..462e2e4b 100644 --- a/packages/products/tdesign-vue/src/config-provider/type.ts +++ b/packages/products/tdesign-vue/src/config-provider/type.ts @@ -29,6 +29,10 @@ export interface GlobalConfigProvider { * null */ attach?: AttachNode | { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode }; + /** + * 自动填充组件全局配置 + */ + autoComplete?: AutoCompleteConfig; /** * 日历组件全局配置 */ diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 36625f75..b8f0efee 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -53381,6 +53381,47 @@ "Function" ] }, + { + "id": 1736340408, + "platform_framework": [ + "1", + "2", + "4" + ], + "component": "GlobalConfigProvider", + "field_category": 1, + "field_name": "autoComplete", + "field_type": [ + "8" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "自动填充组件全局配置", + "field_desc_en": "AutoComplete global configs", + "field_required": 0, + "event_input": "", + "create_time": "2025-01-08 12:46:48", + "update_time": "2025-01-08 12:46:48", + "event_output": null, + "custom_field_type": "AutoCompleteConfig", + "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": [ + "Object" + ] + }, { "id": 1873, "platform_framework": [ From 38fadbee9b00eefc7b8c63974ddea1305c11d982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Wed, 8 Jan 2025 22:35:28 +0800 Subject: [PATCH 3/3] feat(auto-complete): add empty --- db/TDesign.db | Bin 1007616 -> 1007616 bytes .../src/auto-complete/auto-complete.en-US.md | 1 + .../src/auto-complete/auto-complete.md | 1 + .../tdesign-react/src/auto-complete/type.ts | 4 ++ .../src/auto-complete/auto-complete.en-US.md | 1 + .../src/auto-complete/auto-complete.md | 1 + .../src/auto-complete/props.ts | 4 ++ .../src/auto-complete/type.ts | 4 ++ .../src/auto-complete/auto-complete.en-US.md | 1 + .../src/auto-complete/auto-complete.md | 1 + .../tdesign-vue/src/auto-complete/props.ts | 4 ++ .../tdesign-vue/src/auto-complete/type.ts | 4 ++ packages/scripts/api.json | 43 ++++++++++++++++++ 13 files changed, 69 insertions(+) diff --git a/db/TDesign.db b/db/TDesign.db index a7f3dba8def242ec184089be489419f7667c2a6f..fcda5560e1a9386240291dbc996428fa0c33911d 100644 GIT binary patch delta 337 zcmZoTVB2uOc7imc(?l6(MyJMv)&$1Z1g6#m=GFw3)&$np1h&=$_SOWB)&$Ph1g_Qu z?$!jJ)&$E$5^x)U^Ye*vT?f3ZYBewO#TT@s%jCl|j816LaNi)>!j?a#9LCGrb>TkG^_wf7bN6;d1Fi|2lN}TUx9^VRKgPn{#KNe^Db6Xbs;WJ` vCWhZcYIn<%-P>L+?t8XiPjY^4L4ICpUWr0*No7vzbi-JFVKA{Qo}Uo_Tkk%W diff --git a/packages/products/tdesign-react/src/auto-complete/auto-complete.en-US.md b/packages/products/tdesign-react/src/auto-complete/auto-complete.en-US.md index 09e0a354..9bbacb2e 100644 --- a/packages/products/tdesign-react/src/auto-complete/auto-complete.en-US.md +++ b/packages/products/tdesign-react/src/auto-complete/auto-complete.en-US.md @@ -13,6 +13,7 @@ borderless | Boolean | false | \- | N children | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N clearable | Boolean | - | \- | N disabled | Boolean | undefined | \- | N +empty | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N filter | Function | - | Typescript:`(filterWords: string, option: T) => boolean \| Promise` | N filterable | Boolean | true | \- | N highlightKeyword | Boolean | true | \- | N diff --git a/packages/products/tdesign-react/src/auto-complete/auto-complete.md b/packages/products/tdesign-react/src/auto-complete/auto-complete.md index c4791d73..7565f0a3 100644 --- a/packages/products/tdesign-react/src/auto-complete/auto-complete.md +++ b/packages/products/tdesign-react/src/auto-complete/auto-complete.md @@ -13,6 +13,7 @@ borderless | Boolean | false | 无边框模式 | N children | TNode | - | 触发显示联想词下拉框的元素,同 `triggerElement`。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N clearable | Boolean | - | 是否允许清空 | N disabled | Boolean | undefined | 是否禁用 | N +empty | TNode | - | 当下拉联想词列表为空时显示的内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N filter | Function | - | 自定义过滤规则,用于对现有数据进行搜索过滤,判断是否过滤某一项数据。参数 `filterWords` 表示搜索词,`option`表示单个选项内容,返回值为 `true` 保留该选项,返回值为 `false` 则隐藏该选项。使用该方法时无需设置 `filterable`。TS 类型:`(filterWords: string, option: T) => boolean \| Promise` | N filterable | Boolean | true | 是否根据输入内容过滤联想词。默认过滤规则不区分大小写,全文本任意位置匹配。如果默认搜索规则不符合业务需求,可以更为使用 `filter` 自定义过滤规则。部分场景下输入关键词和下拉联想词完全不同,此时可以设置为 `false` | N highlightKeyword | Boolean | true | 是否高亮联想词中和输入值的相同部分 | N diff --git a/packages/products/tdesign-react/src/auto-complete/type.ts b/packages/products/tdesign-react/src/auto-complete/type.ts index 996b5a49..32aacdc9 100644 --- a/packages/products/tdesign-react/src/auto-complete/type.ts +++ b/packages/products/tdesign-react/src/auto-complete/type.ts @@ -32,6 +32,10 @@ export interface TdAutoCompleteProps boolean \| Promise` | N filterable | Boolean | true | \- | N highlightKeyword | Boolean | true | \- | N diff --git a/packages/products/tdesign-vue-next/src/auto-complete/auto-complete.md b/packages/products/tdesign-vue-next/src/auto-complete/auto-complete.md index e426315e..ecdad5b6 100644 --- a/packages/products/tdesign-vue-next/src/auto-complete/auto-complete.md +++ b/packages/products/tdesign-vue-next/src/auto-complete/auto-complete.md @@ -11,6 +11,7 @@ borderless | Boolean | false | 无边框模式 | N clearable | Boolean | - | 是否允许清空 | N default | String / Slot / Function | - | 触发显示联想词下拉框的元素,同 `triggerElement`。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N disabled | Boolean | undefined | 是否禁用 | N +empty | String / Slot / Function | - | 当下拉联想词列表为空时显示的内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N filter | Function | - | 自定义过滤规则,用于对现有数据进行搜索过滤,判断是否过滤某一项数据。参数 `filterWords` 表示搜索词,`option`表示单个选项内容,返回值为 `true` 保留该选项,返回值为 `false` 则隐藏该选项。使用该方法时无需设置 `filterable`。TS 类型:`(filterWords: string, option: T) => boolean \| Promise` | N filterable | Boolean | true | 是否根据输入内容过滤联想词。默认过滤规则不区分大小写,全文本任意位置匹配。如果默认搜索规则不符合业务需求,可以更为使用 `filter` 自定义过滤规则。部分场景下输入关键词和下拉联想词完全不同,此时可以设置为 `false` | N highlightKeyword | Boolean | true | 是否高亮联想词中和输入值的相同部分 | N diff --git a/packages/products/tdesign-vue-next/src/auto-complete/props.ts b/packages/products/tdesign-vue-next/src/auto-complete/props.ts index fec2ab61..785f135e 100644 --- a/packages/products/tdesign-vue-next/src/auto-complete/props.ts +++ b/packages/products/tdesign-vue-next/src/auto-complete/props.ts @@ -23,6 +23,10 @@ export default { type: Boolean, default: undefined, }, + /** 当下拉联想词列表为空时显示的内容 */ + empty: { + type: [String, Function] as PropType, + }, /** 自定义过滤规则,用于对现有数据进行搜索过滤,判断是否过滤某一项数据。参数 `filterWords` 表示搜索词,`option`表示单个选项内容,返回值为 `true` 保留该选项,返回值为 `false` 则隐藏该选项。使用该方法时无需设置 `filterable` */ filter: { type: Function as PropType, diff --git a/packages/products/tdesign-vue-next/src/auto-complete/type.ts b/packages/products/tdesign-vue-next/src/auto-complete/type.ts index e37255d6..835342cf 100644 --- a/packages/products/tdesign-vue-next/src/auto-complete/type.ts +++ b/packages/products/tdesign-vue-next/src/auto-complete/type.ts @@ -31,6 +31,10 @@ export interface TdAutoCompleteProps boolean \| Promise` | N filterable | Boolean | true | \- | N highlightKeyword | Boolean | true | \- | N diff --git a/packages/products/tdesign-vue/src/auto-complete/auto-complete.md b/packages/products/tdesign-vue/src/auto-complete/auto-complete.md index bcbb416b..05a28990 100644 --- a/packages/products/tdesign-vue/src/auto-complete/auto-complete.md +++ b/packages/products/tdesign-vue/src/auto-complete/auto-complete.md @@ -11,6 +11,7 @@ borderless | Boolean | false | 无边框模式 | N clearable | Boolean | - | 是否允许清空 | N default | String / Slot / Function | - | 触发显示联想词下拉框的元素,同 `triggerElement`。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N disabled | Boolean | undefined | 是否禁用 | N +empty | String / Slot / Function | - | 当下拉联想词列表为空时显示的内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N filter | Function | - | 自定义过滤规则,用于对现有数据进行搜索过滤,判断是否过滤某一项数据。参数 `filterWords` 表示搜索词,`option`表示单个选项内容,返回值为 `true` 保留该选项,返回值为 `false` 则隐藏该选项。使用该方法时无需设置 `filterable`。TS 类型:`(filterWords: string, option: T) => boolean \| Promise` | N filterable | Boolean | true | 是否根据输入内容过滤联想词。默认过滤规则不区分大小写,全文本任意位置匹配。如果默认搜索规则不符合业务需求,可以更为使用 `filter` 自定义过滤规则。部分场景下输入关键词和下拉联想词完全不同,此时可以设置为 `false` | N highlightKeyword | Boolean | true | 是否高亮联想词中和输入值的相同部分 | N diff --git a/packages/products/tdesign-vue/src/auto-complete/props.ts b/packages/products/tdesign-vue/src/auto-complete/props.ts index 467fa446..4fb63f70 100644 --- a/packages/products/tdesign-vue/src/auto-complete/props.ts +++ b/packages/products/tdesign-vue/src/auto-complete/props.ts @@ -23,6 +23,10 @@ export default { type: Boolean, default: undefined, }, + /** 当下拉联想词列表为空时显示的内容 */ + empty: { + type: [String, Function] as PropType, + }, /** 自定义过滤规则,用于对现有数据进行搜索过滤,判断是否过滤某一项数据。参数 `filterWords` 表示搜索词,`option`表示单个选项内容,返回值为 `true` 保留该选项,返回值为 `false` 则隐藏该选项。使用该方法时无需设置 `filterable` */ filter: { type: Function as PropType, diff --git a/packages/products/tdesign-vue/src/auto-complete/type.ts b/packages/products/tdesign-vue/src/auto-complete/type.ts index d7eb4869..c1bd5418 100644 --- a/packages/products/tdesign-vue/src/auto-complete/type.ts +++ b/packages/products/tdesign-vue/src/auto-complete/type.ts @@ -31,6 +31,10 @@ export interface TdAutoCompleteProps