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(config-provider): add AutoCompleteConfig #520

Merged
merged 5 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -9,6 +9,7 @@ alert | Object | - | Alert global configs。Typescript:`AlertConfig` | N
anchor | Object | - | Anchor global configs。Typescript:`AnchorConfig` | N
animation | Object | - | Typescript:`Partial<Record<'include'\|'exclude', Array<AnimationType>>>` `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
Expand Down Expand Up @@ -354,3 +355,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
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record<'include'\|'exclude', Array<AnimationType>>>` `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
Expand Down Expand Up @@ -354,3 +355,9 @@ titleText | Object | - | 空状态组件各类型的标题文本配置。TS 类
collapseText | String | - | 语言配置,“收起”描述文本 | N
copiedText | String | - | 语言配置,“复制成功”描述文本 | N
expandText | String | - | 语言配置,“展开”描述文本 | N

### AutoCompleteConfig

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
empty | String | - | 语言配置,“暂无数据”描述文本 | N
12 changes: 12 additions & 0 deletions packages/products/tdesign-react/src/config-provider/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export interface GlobalConfigProvider {
* null
*/
attach?: AttachNode | { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode };
/**
* 自动填充组件全局配置
*/
autoComplete?: AutoCompleteConfig;
/**
* 日历组件全局配置
*/
Expand Down Expand Up @@ -960,6 +964,14 @@ export interface TypographyConfig {
expandText?: string;
}

export interface AutoCompleteConfig {
/**
* 语言配置,“暂无数据”描述文本
* @default ''
*/
empty?: string;
}

export type AnimationType = 'ripple' | 'expand' | 'fade';

export type IconConfig = GlobalIconConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ alert | Object | - | Alert global configs。Typescript:`AlertConfig` | N
anchor | Object | - | Anchor global configs。Typescript:`AnchorConfig` | N
animation | Object | - | Typescript:`Partial<Record<'include'\|'exclude', Array<AnimationType>>>` `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
Expand Down Expand Up @@ -354,3 +355,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
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record<'include'\|'exclude', Array<AnimationType>>>` `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
Expand Down Expand Up @@ -354,3 +355,9 @@ titleText | Object | - | 空状态组件各类型的标题文本配置。TS 类
collapseText | String | - | 语言配置,“收起”描述文本 | N
copiedText | String | - | 语言配置,“复制成功”描述文本 | N
expandText | String | - | 语言配置,“展开”描述文本 | N

### AutoCompleteConfig

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
empty | String | - | 语言配置,“暂无数据”描述文本 | N
12 changes: 12 additions & 0 deletions packages/products/tdesign-vue-next/src/config-provider/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export interface GlobalConfigProvider {
* null
*/
attach?: AttachNode | { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode };
/**
* 自动填充组件全局配置
*/
autoComplete?: AutoCompleteConfig;
/**
* 日历组件全局配置
*/
Expand Down Expand Up @@ -960,6 +964,14 @@ export interface TypographyConfig {
expandText?: string;
}

export interface AutoCompleteConfig {
/**
* 语言配置,“暂无数据”描述文本
* @default ''
*/
empty?: string;
}

export type AnimationType = 'ripple' | 'expand' | 'fade';

export type IconConfig = GlobalIconConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ alert | Object | - | Alert global configs。Typescript:`AlertConfig` | N
anchor | Object | - | Anchor global configs。Typescript:`AnchorConfig` | N
animation | Object | - | Typescript:`Partial<Record<'include'\|'exclude', Array<AnimationType>>>` `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
Expand Down Expand Up @@ -354,3 +355,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
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record<'include'\|'exclude', Array<AnimationType>>>` `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
Expand Down Expand Up @@ -354,3 +355,9 @@ titleText | Object | - | 空状态组件各类型的标题文本配置。TS 类
collapseText | String | - | 语言配置,“收起”描述文本 | N
copiedText | String | - | 语言配置,“复制成功”描述文本 | N
expandText | String | - | 语言配置,“展开”描述文本 | N

### AutoCompleteConfig

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
empty | String | - | 语言配置,“暂无数据”描述文本 | N
12 changes: 12 additions & 0 deletions packages/products/tdesign-vue/src/config-provider/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export interface GlobalConfigProvider {
* null
*/
attach?: AttachNode | { imageViewer?: AttachNode; popup?: AttachNode; dialog?: AttachNode; drawer?: AttachNode };
/**
* 自动填充组件全局配置
*/
autoComplete?: AutoCompleteConfig;
/**
* 日历组件全局配置
*/
Expand Down Expand Up @@ -960,6 +964,14 @@ export interface TypographyConfig {
expandText?: string;
}

export interface AutoCompleteConfig {
/**
* 语言配置,“暂无数据”描述文本
* @default ''
*/
empty?: string;
}

export type AnimationType = 'ripple' | 'expand' | 'fade';

export type IconConfig = GlobalIconConfig;
Expand Down
82 changes: 82 additions & 0 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -53340,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": [
Expand Down
1 change: 1 addition & 0 deletions packages/scripts/config/files-combine.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const GLOBAL_COMPONENTS_CONFIG = [
'RateConfig',
'EmptyConfig',
'TypographyConfig',
'AutoCompleteConfig',
].sort((a, b) => a.localeCompare(b) > 0);

const MESSAGE_LIST = [
Expand Down
5 changes: 5 additions & 0 deletions packages/scripts/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@
"value": "AutoComplete",
"label": "自动填充"
},
{
"value": "AutoCompleteConfig",
"label": "自动填充全局配置",
"type": "TS"
},
{
"value": "Avatar",
"label": "头像"
Expand Down
1 change: 1 addition & 0 deletions packages/server/controllers/ComponentApi/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ export const COMPONENTS_PC: Array<MapItem> = [
{ 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<MapItem> = [
Expand Down