diff --git a/examples/config-provider/config-provider.md b/examples/config-provider/config-provider.md index c8d2aa7c4..d64d11668 100644 --- a/examples/config-provider/config-provider.md +++ b/examples/config-provider/config-provider.md @@ -7,7 +7,7 @@ -- | -- | -- | -- | -- alert | Object | - | 警告全局配置。TS 类型:`AlertConfig` | N anchor | Object | - | 锚点全局配置。TS 类型:`AnchorConfig` | N -animation | Object | - | 动画效果控制,`ripple`指波纹动画, `expand` 指展开动画,`fade` 指渐变动画。默认为 `{ include: ['ripple','expand','fade'], exclude: [] }`。TS 类型:`Record<'include'|'exclude', Array>` `type AnimationType = 'ripple' | 'expand' | 'fade'`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | 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 calendar | Object | - | 日历组件全局配置。TS 类型:`CalendarConfig` | N cascader | Object | - | 级联选择器全局配置。TS 类型:`CascaderConfig` | N classPrefix | String | t | CSS 类名前缀 | N @@ -30,41 +30,20 @@ tree | Object | - | 树组件全局配置。TS 类型:`TreeConfig` | N treeSelect | Object | - | 树选择器组件全局配置。TS 类型:`TreeSelectConfig` | N upload | Object | - | 上传组件全局配置。TS 类型:`UploadConfig` | N -### TreeConfig - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -empty | String | - | 语言配置,“暂无数据”描述文本 | N -folderIcon | Function | - | 目录层级图标,传入收起状态图标即可。【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N - -### AnchorConfig - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -copySuccessText | String | - | 语言配置,“链接复制成功”描述文本 | N -copyText | String | - | 语言配置,“复制链接” 描述文本 | N - -### AlertConfig - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -collapseText | String | - | 语言配置,“收起”描述文本 | N -expandText | String | - | 语言配置,“展开更多”描述文本 | N - -### ListConfig +### InputConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -loadingMoreText | String | - | 语言配置,'点击加载更多' 描述文本 | N -loadingText | String | - | 语言配置,'正在加载中,请稍后' 描述文本 | N +placeholder | String | - | 语言配置,“请输入”占位符描述文本 | N -### CascaderConfig +### PaginationConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -empty | String | - | 语言配置,“暂无数据”描述文本 | N -loadingText | String | - | 语言配置,“加载中”描述文本 | N -placeholder | String | - | 语言配置,“请选择”占位描述文本 | N +itemsPerPage | String | - | 语言配置,每页条数文本,示例:`'{size} 条/页'` | N +jumpTo | String | - | 语言配置,页码跳转文本,示例:'跳至' | N +page | String | - | 语言配置,“页”描述文本 | N +total | String | - | 语言配置,数据总条数文本,示例:`'共 {total} 项数据'` | N ### CalendarConfig @@ -84,44 +63,39 @@ week | String | - | 语言配置,星期描述文本,示例:`'周一,周二 yearRadio | String | - | 语言配置,模式切换时的“年”描述文本 | N yearSelection | String | - | 语言配置,“年”选择描述文本,示例:`'{year} 年'` | N -### UploadConfig - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -cancelUploadText | String | - | 语言配置,“取消上传” 描述文本 | N -dragger | Object | - | 语言配置,拖拽相关。示例:{ dragDropText: '释放图标', draggingText: '拖拽到此区域', clickAndDragText: '点击上方“选择文件”或将文件拖到此区域' }。TS 类型:`UploadConfigDragger` | N -file | Object | - | 语言配置,文件信息相关。示例:{ fileNameText: '文件名', fileSizeText: '文件尺寸', fileStatusText: '状态', fileOperationText: '操作', fileOperationDateText: '上传日期' }。TS 类型:`UploadConfigFileList` | N -progress | Object | - | 语言配置,上传进度相关。示例:{ uploadText: '上传中', waitingText: '待上传', 'failText': '上传失败', successText: '上传成功' }。TS 类型:`UploadConfigProgress` | N -sizeLimitMessage | String | - | 语言配置,文件大小超出限制时提醒文本。示例:`'文件大小不能超过 {sizeLimit}'` | N -triggerUploadText | Object | - | 语言配置,上传功能触发文案。示例:{ image: '点击上传图片', normal: '点击上传', fileInput: '选择文件',reupload: '重新上传',fileInput: '删除' }。TS 类型:`UploadTriggerUploadText` `interface UploadTriggerUploadText { image?: string, normal?: string, fileInput?: string, reupload?: string, continueUpload: string, delete?: string }`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N - -### InputConfig +### CascaderConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -placeholder | String | - | 语言配置,“请输入”占位符描述文本 | N +empty | String | - | 语言配置,“暂无数据”描述文本 | N +loadingText | String | - | 语言配置,“加载中”描述文本 | N +placeholder | String | - | 语言配置,“请选择”占位描述文本 | N -### DialogConfig +### ColorPickerConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -cancel | Object | - | 取消按钮风格。TS 类型:`string | ButtonProps`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N -confirm | Object | - | 确认按钮风格。TS 类型:`string | ButtonProps` | N -confirmBtnTheme | Object | - | 确认按钮主题色,即 Dialog 的 `theme` 和 确认按钮的 `theme` 映射关系。示例:{ danger: 'danger' }。TS 类型:`{ default: string; info: string; warning: string; danger: string; success: string; }` | N +clearConfirmText | String | - | 语言配置,“确定清空最近使用的颜色吗?”清空颜色确认文案 | N +recentColorTitle | String | - | 语言配置,“最近使用颜色” 区域标题文本 | N +swatchColorTitle | String | - | 语言配置,"系统预设颜色" 区域标题文本 | N -### DrawerConfig +### TransferConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -cancel | String | - | 语言配置,“取消”描述文本。TS 类型:`string | ButtonProps` | N -confirm | String | - | 语言配置,“确认”描述文本。TS 类型:`string | ButtonProps` | N +empty | String | - | 语言配置,“暂无数据”空数据描述文本 | N +placeholder | String | - | 语言配置,“请输入关键词搜索”占位符描述文本 | N +title | String | - | 语言配置,穿梭框标题描述文本,示例:“{checked} / {total} 项” | N -### FormConfig +### TimePickerConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -errorMessage | Object | - | 表单错误信息配置,示例:`{ idcard: '请输入正确的身份证号码', max: '字符长度不能超过 ${max}' }`。TS 类型:`FormErrorMessage`,[Form API Documents](./form?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N -requiredMark | Boolean | true | 是否显示必填符号(*),默认显示 | N +anteMeridiem | String | - | 语言配置,“上午”描述文本 | N +confirm | String | - | 语言配置,“确定”描述文本 | N +now | String | - | 语言配置,“此刻”描述文本 | N +placeholder | String | - | 语言配置,"请选择时间"占位符描述文本 | N +postMeridiem | String | - | 语言配置,“下午”描述文本 | N ### DatePickerConfig @@ -150,31 +124,20 @@ weekAbbreviation | String | - | 语言配置,“周” 描述文本 | N weekdays | Object | - | 星期文本描述,默认值:['日', '一', '二', '三', '四', '五', '六']。TS 类型:`string[]` | N yearAriaLabel | String | - | 语言配置,“年” 描述文本 | N -### ColorPickerConfig - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -clearConfirmText | String | - | 语言配置,“确定清空最近使用的颜色吗?”清空颜色确认文案 | N -recentColorTitle | String | - | 语言配置,“最近使用颜色” 区域标题文本 | N -swatchColorTitle | String | - | 语言配置,"系统预设颜色" 区域标题文本 | N - -### PaginationConfig +### DialogConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -itemsPerPage | String | - | 语言配置,每页条数文本,示例:`'{size} 条/页'` | N -jumpTo | String | - | 语言配置,页码跳转文本,示例:'跳至' | N -page | String | - | 语言配置,“页”描述文本 | N -total | String | - | 语言配置,数据总条数文本,示例:`'共 {total} 项数据'` | N +cancel | Object | - | 取消按钮风格。TS 类型:`string | ButtonProps`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N +confirm | Object | - | 确认按钮风格。TS 类型:`string | ButtonProps` | N +confirmBtnTheme | Object | - | 确认按钮主题色,即 Dialog 的 `theme` 和 确认按钮的 `theme` 映射关系。示例:{ danger: 'danger' }。TS 类型:`{ default: string; info: string; warning: string; danger: string; success: string; }` | N -### SelectConfig +### DrawerConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -clearIcon | Function | - | 清除图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -empty | String | - | 语言配置,“暂无数据”描述文本 | N -loadingText | String | - | 语言配置,“加载中”描述文本 | N -placeholder | String | - | 语言配置,“请选择”占位符描述文本 | N +cancel | String | - | 语言配置,“取消”描述文本。TS 类型:`string | ButtonProps` | N +confirm | String | - | 语言配置,“确认”描述文本。TS 类型:`string | ButtonProps` | N ### PopconfirmConfig @@ -184,12 +147,6 @@ cancel | String / Object | - | 语言配置,“取消”描述文本。TS 类 confirm | String / Object | - | 语言配置,“确定”描述文本。TS 类型:`string | ButtonProps` | N confirmBtnTheme | Object | - | 确认按钮主题色,即 Popconfirm 的 `theme` 和 确认按钮的 `theme` 映射关系。示例:{ danger: 'danger' }。TS 类型:`{ default: string; warning: string; danger: string; }` | N -### StepsConfig - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -errorIcon | Slot / Function | - | 错误步骤图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N - ### TableConfig 名称 | 类型 | 默认值 | 说明 | 必传 @@ -213,29 +170,21 @@ sortCancelOperationText | String | - | 语言配置,'点击取消排序' 描 sortDescendingOperationText | String | - | 语言配置,'点击降序' 描述文本 | N sortIcon | Slot / Function | undefined | 排序图标(配置传入降序图标即可),如果没有配置,组件会内置默认图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N -### TagConfig - -名称 | 类型 | 默认值 | 说明 | 必传 --- | -- | -- | -- | -- -closeIcon | Function | - | 关闭图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N - -### TimePickerConfig +### SelectConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -anteMeridiem | String | - | 语言配置,“上午”描述文本 | N -confirm | String | - | 语言配置,“确定”描述文本 | N -now | String | - | 语言配置,“此刻”描述文本 | N -placeholder | String | - | 语言配置,"请选择时间"占位符描述文本 | N -postMeridiem | String | - | 语言配置,“下午”描述文本 | N +clearIcon | Function | - | 清除图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +empty | String | - | 语言配置,“暂无数据”描述文本 | N +loadingText | String | - | 语言配置,“加载中”描述文本 | N +placeholder | String | - | 语言配置,“请选择”占位符描述文本 | N -### TransferConfig +### TreeConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -empty | String | - | 语言配置,“暂无数据”空数据描述文本 | N -placeholder | String | - | 语言配置,“请输入关键词搜索”占位符描述文本 | N -title | String | - | 语言配置,穿梭框标题描述文本,示例:“{checked} / {total} 项” | N +empty | String | - | 语言配置,“暂无数据”描述文本 | N +folderIcon | Function | - | 目录层级图标,传入收起状态图标即可。【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N ### TreeSelectConfig @@ -245,6 +194,33 @@ empty | String | - | 语言配置,“暂无数据”描述文本 | N loadingText | String | - | 语言配置,“加载中”描述文本 | N placeholder | String | - | 语言配置,“请选择”占位符描述文本 | N +### ListConfig + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +loadingMoreText | String | - | 语言配置,'点击加载更多' 描述文本 | N +loadingText | String | - | 语言配置,'正在加载中,请稍后' 描述文本 | N + +### UploadConfig + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +cancelUploadText | String | - | 语言配置,“取消上传” 描述文本 | N +dragger | Object | - | 语言配置,拖拽相关。示例:{ dragDropText: '释放图标', draggingText: '拖拽到此区域', clickAndDragText: '点击上方“选择文件”或将文件拖到此区域' }。TS 类型:`UploadConfigDragger` | N +file | Object | - | 语言配置,文件信息相关。示例:{ fileNameText: '文件名', fileSizeText: '文件尺寸', fileStatusText: '状态', fileOperationText: '操作', fileOperationDateText: '上传日期' }。TS 类型:`UploadConfigFileList` | N +progress | Object | - | 语言配置,上传进度相关。示例:{ uploadText: '上传中', waitingText: '待上传', 'failText': '上传失败', successText: '上传成功' }。TS 类型:`UploadConfigProgress` | N +sizeLimitMessage | String | - | 语言配置,文件大小超出限制时提醒文本。示例:`'文件大小不能超过 {sizeLimit}'` | N +triggerUploadText | Object | - | 语言配置,上传功能触发文案。示例:{ image: '点击上传图片', normal: '点击上传', fileInput: '选择文件',reupload: '重新上传',fileInput: '删除' }。TS 类型:`UploadTriggerUploadText` `interface UploadTriggerUploadText { image?: string, normal?: string, fileInput?: string, reupload?: string, continueUpload: string, delete?: string }`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N + +### UploadConfigProgress + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +failText | String | - | 语言配置,“上传失败”文本描述 | N +successText | String | - | 语言配置,“上传成功”文本描述 | N +uploadingText | String | - | 语言配置,“上传中”文本描述 | N +waitingText | String | - | 语言配置,“待上传”文本描述 | N + ### UploadConfigDragger 名称 | 类型 | 默认值 | 说明 | 必传 @@ -263,11 +239,35 @@ fileOperationText | String | - | 语言配置,“操作” 描述文本 | N fileSizeText | String | - | 语言配置,“文件尺寸” 描述文本 | N fileStatusText | String | - | 语言配置,“状态” 描述文本 | N -### UploadConfigProgress +### FormConfig 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- -failText | String | - | 语言配置,“上传失败”文本描述 | N -successText | String | - | 语言配置,“上传成功”文本描述 | N -uploadingText | String | - | 语言配置,“上传中”文本描述 | N -waitingText | String | - | 语言配置,“待上传”文本描述 | N +errorMessage | Object | - | 表单错误信息配置,示例:`{ idcard: '请输入正确的身份证号码', max: '字符长度不能超过 ${max}' }`。TS 类型:`FormErrorMessage`,[Form API Documents](./form?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/config-provider/type.ts) | N +requiredMark | Boolean | true | 是否显示必填符号(*),默认显示 | N + +### TagConfig + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +closeIcon | Function | - | 关闭图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N + +### StepsConfig + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +errorIcon | Slot / Function | - | 错误步骤图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N + +### AlertConfig + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +collapseText | String | - | 语言配置,“收起”描述文本 | N +expandText | String | - | 语言配置,“展开更多”描述文本 | N + +### AnchorConfig + +名称 | 类型 | 默认值 | 说明 | 必传 +-- | -- | -- | -- | -- +copySuccessText | String | - | 语言配置,“链接复制成功”描述文本 | N +copyText | String | - | 语言配置,“复制链接” 描述文本 | N diff --git a/src/config-provider/type.ts b/src/config-provider/type.ts index 2ee5d9857..7c396ff24 100644 --- a/src/config-provider/type.ts +++ b/src/config-provider/type.ts @@ -19,9 +19,9 @@ export interface GlobalConfigProvider { */ anchor?: AnchorConfig; /** - * 动画效果控制,`ripple`指波纹动画, `expand` 指展开动画,`fade` 指渐变动画。默认为 `{ include: ['ripple','expand','fade'], exclude: [] }` + * 动画效果控制,`ripple` 指波纹动画, `expand` 指展开动画,`fade` 指渐变动画。默认为 `{ include: ['ripple','expand','fade'], exclude: [] }` */ - animation?: Record<'include' | 'exclude', Array>; + animation?: Partial>>; /** * 日历组件全局配置 */ @@ -109,73 +109,35 @@ export interface GlobalConfigProvider { upload?: UploadConfig; } -export interface TreeConfig { - /** - * 语言配置,“暂无数据”描述文本 - * @default '' - */ - empty?: string; - /** - * 目录层级图标,传入收起状态图标即可。【注意】使用渲染函数输出图标组件 - */ - folderIcon?: TNode; -} - -export interface AnchorConfig { - /** - * 语言配置,“链接复制成功”描述文本 - * @default '' - */ - copySuccessText?: string; - /** - * 语言配置,“复制链接” 描述文本 - * @default '' - */ - copyText?: string; -} - -export interface AlertConfig { - /** - * 语言配置,“收起”描述文本 - * @default '' - */ - collapseText?: string; +export interface InputConfig { /** - * 语言配置,“展开更多”描述文本 + * 语言配置,“请输入”占位符描述文本 * @default '' */ - expandText?: string; + placeholder?: string; } -export interface ListConfig { - /** - * 语言配置,'点击加载更多' 描述文本 - * @default '' - */ - loadingMoreText?: string; +export interface PaginationConfig { /** - * 语言配置,'正在加载中,请稍后' 描述文本 + * 语言配置,每页条数文本,示例:`'{size} 条/页'` * @default '' */ - loadingText?: string; -} - -export interface CascaderConfig { + itemsPerPage?: string; /** - * 语言配置,“暂无数据”描述文本 + * 语言配置,页码跳转文本,示例:'跳至' * @default '' */ - empty?: string; + jumpTo?: string; /** - * 语言配置,“加载中”描述文本 + * 语言配置,“页”描述文本 * @default '' */ - loadingText?: string; + page?: string; /** - * 语言配置,“请选择”占位描述文本 + * 语言配置,数据总条数文本,示例:`'共 {total} 项数据'` * @default '' */ - placeholder?: string; + total?: string; } export interface CalendarConfig { @@ -245,81 +207,86 @@ export interface CalendarConfig { yearSelection?: string; } -export interface UploadConfig { +export interface CascaderConfig { /** - * 语言配置,“取消上传” 描述文本 + * 语言配置,“暂无数据”描述文本 * @default '' */ - cancelUploadText?: string; - /** - * 语言配置,拖拽相关。示例:{ dragDropText: '释放图标', draggingText: '拖拽到此区域', clickAndDragText: '点击上方“选择文件”或将文件拖到此区域' } - */ - dragger?: UploadConfigDragger; + empty?: string; /** - * 语言配置,文件信息相关。示例:{ fileNameText: '文件名', fileSizeText: '文件尺寸', fileStatusText: '状态', fileOperationText: '操作', fileOperationDateText: '上传日期' } + * 语言配置,“加载中”描述文本 + * @default '' */ - file?: UploadConfigFileList; + loadingText?: string; /** - * 语言配置,上传进度相关。示例:{ uploadText: '上传中', waitingText: '待上传', 'failText': '上传失败', successText: '上传成功' } + * 语言配置,“请选择”占位描述文本 + * @default '' */ - progress?: UploadConfigProgress; + placeholder?: string; +} + +export interface ColorPickerConfig { /** - * 语言配置,文件大小超出限制时提醒文本。示例:`'文件大小不能超过 {sizeLimit}'` + * 语言配置,“确定清空最近使用的颜色吗?”清空颜色确认文案 * @default '' */ - sizeLimitMessage?: string; + clearConfirmText?: string; /** - * 语言配置,上传功能触发文案。示例:{ image: '点击上传图片', normal: '点击上传', fileInput: '选择文件',reupload: '重新上传',fileInput: '删除' } + * 语言配置,“最近使用颜色” 区域标题文本 + * @default '' */ - triggerUploadText?: UploadTriggerUploadText; -} - -export interface InputConfig { + recentColorTitle?: string; /** - * 语言配置,“请输入”占位符描述文本 + * 语言配置,"系统预设颜色" 区域标题文本 * @default '' */ - placeholder?: string; + swatchColorTitle?: string; } -export interface DialogConfig { +export interface TransferConfig { /** - * 取消按钮风格 + * 语言配置,“暂无数据”空数据描述文本 + * @default '' */ - cancel?: string | ButtonProps; + empty?: string; /** - * 确认按钮风格 + * 语言配置,“请输入关键词搜索”占位符描述文本 + * @default '' */ - confirm?: string | ButtonProps; + placeholder?: string; /** - * 确认按钮主题色,即 Dialog 的 `theme` 和 确认按钮的 `theme` 映射关系。示例:{ danger: 'danger' } + * 语言配置,穿梭框标题描述文本,示例:“{checked} / {total} 项” + * @default '' */ - confirmBtnTheme?: { default: string; info: string; warning: string; danger: string; success: string }; + title?: string; } -export interface DrawerConfig { +export interface TimePickerConfig { /** - * 语言配置,“取消”描述文本 + * 语言配置,“上午”描述文本 * @default '' */ - cancel?: string | ButtonProps; + anteMeridiem?: string; /** - * 语言配置,“确认”描述文本 + * 语言配置,“确定”描述文本 * @default '' */ - confirm?: string | ButtonProps; -} - -export interface FormConfig { + confirm?: string; /** - * 表单错误信息配置,示例:`{ idcard: '请输入正确的身份证号码', max: '字符长度不能超过 ${max}' }` + * 语言配置,“此刻”描述文本 + * @default '' */ - errorMessage?: FormErrorMessage; + now?: string; /** - * 是否显示必填符号(*),默认显示 - * @default true + * 语言配置,"请选择时间"占位符描述文本 + * @default '' */ - requiredMark?: boolean; + placeholder?: string; + /** + * 语言配置,“下午”描述文本 + * @default '' + */ + postMeridiem?: string; } export interface DatePickerConfig { @@ -431,67 +398,32 @@ export interface DatePickerConfig { yearAriaLabel?: string; } -export interface ColorPickerConfig { - /** - * 语言配置,“确定清空最近使用的颜色吗?”清空颜色确认文案 - * @default '' - */ - clearConfirmText?: string; - /** - * 语言配置,“最近使用颜色” 区域标题文本 - * @default '' - */ - recentColorTitle?: string; - /** - * 语言配置,"系统预设颜色" 区域标题文本 - * @default '' - */ - swatchColorTitle?: string; -} - -export interface PaginationConfig { - /** - * 语言配置,每页条数文本,示例:`'{size} 条/页'` - * @default '' - */ - itemsPerPage?: string; +export interface DialogConfig { /** - * 语言配置,页码跳转文本,示例:'跳至' - * @default '' + * 取消按钮风格 */ - jumpTo?: string; + cancel?: string | ButtonProps; /** - * 语言配置,“页”描述文本 - * @default '' + * 确认按钮风格 */ - page?: string; + confirm?: string | ButtonProps; /** - * 语言配置,数据总条数文本,示例:`'共 {total} 项数据'` - * @default '' + * 确认按钮主题色,即 Dialog 的 `theme` 和 确认按钮的 `theme` 映射关系。示例:{ danger: 'danger' } */ - total?: string; + confirmBtnTheme?: { default: string; info: string; warning: string; danger: string; success: string }; } -export interface SelectConfig { - /** - * 清除图标,【注意】使用渲染函数输出图标组件 - */ - clearIcon?: TNode; - /** - * 语言配置,“暂无数据”描述文本 - * @default '' - */ - empty?: string; +export interface DrawerConfig { /** - * 语言配置,“加载中”描述文本 + * 语言配置,“取消”描述文本 * @default '' */ - loadingText?: string; + cancel?: string | ButtonProps; /** - * 语言配置,“请选择”占位符描述文本 + * 语言配置,“确认”描述文本 * @default '' */ - placeholder?: string; + confirm?: string | ButtonProps; } export interface PopconfirmConfig { @@ -509,13 +441,6 @@ export interface PopconfirmConfig { confirmBtnTheme?: { default: string; warning: string; danger: string }; } -export interface StepsConfig { - /** - * 错误步骤图标,【注意】使用渲染函数输出图标组件 - */ - errorIcon?: TNode; -} - export interface TableConfig { /** * 语言配置,“取消” 描述文本 @@ -605,75 +530,121 @@ export interface TableConfig { sortIcon?: TNode; } -export interface TagConfig { +export interface SelectConfig { /** - * 关闭图标,【注意】使用渲染函数输出图标组件 + * 清除图标,【注意】使用渲染函数输出图标组件 */ - closeIcon?: TNode; + clearIcon?: TNode; + /** + * 语言配置,“暂无数据”描述文本 + * @default '' + */ + empty?: string; + /** + * 语言配置,“加载中”描述文本 + * @default '' + */ + loadingText?: string; + /** + * 语言配置,“请选择”占位符描述文本 + * @default '' + */ + placeholder?: string; } -export interface TimePickerConfig { +export interface TreeConfig { /** - * 语言配置,“上午”描述文本 + * 语言配置,“暂无数据”描述文本 * @default '' */ - anteMeridiem?: string; + empty?: string; /** - * 语言配置,“确定”描述文本 + * 目录层级图标,传入收起状态图标即可。【注意】使用渲染函数输出图标组件 + */ + folderIcon?: TNode; +} + +export interface TreeSelectConfig { + /** + * 语言配置,“暂无数据”描述文本 * @default '' */ - confirm?: string; + empty?: string; /** - * 语言配置,“此刻”描述文本 + * 语言配置,“加载中”描述文本 * @default '' */ - now?: string; + loadingText?: string; /** - * 语言配置,"请选择时间"占位符描述文本 + * 语言配置,“请选择”占位符描述文本 * @default '' */ placeholder?: string; +} + +export interface ListConfig { /** - * 语言配置,“下午”描述文本 + * 语言配置,'点击加载更多' 描述文本 * @default '' */ - postMeridiem?: string; + loadingMoreText?: string; + /** + * 语言配置,'正在加载中,请稍后' 描述文本 + * @default '' + */ + loadingText?: string; } -export interface TransferConfig { +export interface UploadConfig { /** - * 语言配置,“暂无数据”空数据描述文本 + * 语言配置,“取消上传” 描述文本 * @default '' */ - empty?: string; + cancelUploadText?: string; /** - * 语言配置,“请输入关键词搜索”占位符描述文本 - * @default '' + * 语言配置,拖拽相关。示例:{ dragDropText: '释放图标', draggingText: '拖拽到此区域', clickAndDragText: '点击上方“选择文件”或将文件拖到此区域' } */ - placeholder?: string; + dragger?: UploadConfigDragger; /** - * 语言配置,穿梭框标题描述文本,示例:“{checked} / {total} 项” + * 语言配置,文件信息相关。示例:{ fileNameText: '文件名', fileSizeText: '文件尺寸', fileStatusText: '状态', fileOperationText: '操作', fileOperationDateText: '上传日期' } + */ + file?: UploadConfigFileList; + /** + * 语言配置,上传进度相关。示例:{ uploadText: '上传中', waitingText: '待上传', 'failText': '上传失败', successText: '上传成功' } + */ + progress?: UploadConfigProgress; + /** + * 语言配置,文件大小超出限制时提醒文本。示例:`'文件大小不能超过 {sizeLimit}'` * @default '' */ - title?: string; + sizeLimitMessage?: string; + /** + * 语言配置,上传功能触发文案。示例:{ image: '点击上传图片', normal: '点击上传', fileInput: '选择文件',reupload: '重新上传',fileInput: '删除' } + */ + triggerUploadText?: UploadTriggerUploadText; } -export interface TreeSelectConfig { +export interface UploadConfigProgress { /** - * 语言配置,“暂无数据”描述文本 + * 语言配置,“上传失败”文本描述 * @default '' */ - empty?: string; + failText?: string; /** - * 语言配置,“加载中”描述文本 + * 语言配置,“上传成功”文本描述 * @default '' */ - loadingText?: string; + successText?: string; /** - * 语言配置,“请选择”占位符描述文本 + * 语言配置,“上传中”文本描述 * @default '' */ - placeholder?: string; + uploadingText?: string; + /** + * 语言配置,“待上传”文本描述 + * @default '' + */ + waitingText?: string; } export interface UploadConfigDragger { @@ -722,31 +693,66 @@ export interface UploadConfigFileList { fileStatusText?: string; } -export interface UploadConfigProgress { +export interface FormConfig { /** - * 语言配置,“上传失败”文本描述 + * 表单错误信息配置,示例:`{ idcard: '请输入正确的身份证号码', max: '字符长度不能超过 ${max}' }` + */ + errorMessage?: FormErrorMessage; + /** + * 是否显示必填符号(*),默认显示 + * @default true + */ + requiredMark?: boolean; +} + +export interface TagConfig { + /** + * 关闭图标,【注意】使用渲染函数输出图标组件 + */ + closeIcon?: TNode; +} + +export interface StepsConfig { + /** + * 错误步骤图标,【注意】使用渲染函数输出图标组件 + */ + errorIcon?: TNode; +} + +export interface AlertConfig { + /** + * 语言配置,“收起”描述文本 * @default '' */ - failText?: string; + collapseText?: string; /** - * 语言配置,“上传成功”文本描述 + * 语言配置,“展开更多”描述文本 * @default '' */ - successText?: string; + expandText?: string; +} + +export interface AnchorConfig { /** - * 语言配置,“上传中”文本描述 + * 语言配置,“链接复制成功”描述文本 * @default '' */ - uploadingText?: string; + copySuccessText?: string; /** - * 语言配置,“待上传”文本描述 + * 语言配置,“复制链接” 描述文本 * @default '' */ - waitingText?: string; + copyText?: string; } export type AnimationType = 'ripple' | 'expand' | 'fade'; +export interface ConfigPresetDate { + [name: string]: DateConfigValue | (() => DateConfigValue); +} + +export type DateConfigValue = string | Date | Array; + export interface UploadTriggerUploadText { image?: string; normal?: string; @@ -755,9 +761,3 @@ export interface UploadTriggerUploadText { continueUpload: string; delete?: string; } - -export interface ConfigPresetDate { - [name: string]: DateConfigValue | (() => DateConfigValue); -} - -export type DateConfigValue = string | Date | Array; diff --git a/src/table/interface.ts b/src/table/interface.ts index 33d34935e..60f54a2d0 100644 --- a/src/table/interface.ts +++ b/src/table/interface.ts @@ -13,7 +13,7 @@ export interface BaseTableProps extends TdBaseTableProps { /** * 渲染展开行,非公开属性,请勿在业务中使用 */ - renderExpandedRow: (h: CreateElement, params: TableExpandedRowParams) => JSX.Element; + renderExpandedRow?: (h: CreateElement, params: TableExpandedRowParams) => JSX.Element; } export type PrimaryTableProps = TdPrimaryTableProps;