Skip to content

Commit

Permalink
feat(GlobalConfig): add attach global config (#336)
Browse files Browse the repository at this point in the history
* chore: update type file

* chore: backup docs

* feat(GlobalConfig): add attach global config
  • Loading branch information
uyarn authored Jul 19, 2024
1 parent d6b63b6 commit 448efd2
Show file tree
Hide file tree
Showing 11 changed files with 1,176 additions and 95 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ name | type | default | description | required
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; message?: AttachNode; popup?: AttachNode; dialog?: AttachNode; }`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
calendar | Object | - | Calendar global configs。Typescript:`CalendarConfig` | N
cascader | Object | - | Cascader global configs。Typescript:`CascaderConfig` | N
classPrefix | String | t | \- | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
## API
### GlobalConfigProvider

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
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; message?: AttachNode; popup?: AttachNode; dialog?: AttachNode; }`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
calendar | Object | - | 日历组件全局配置。TS 类型:`CalendarConfig` | N
cascader | Object | - | 级联选择器全局配置。TS 类型:`CascaderConfig` | N
classPrefix | String | t | CSS 类名前缀 | N
Expand Down Expand Up @@ -37,14 +38,14 @@ upload | Object | - | 上传组件全局配置。TS 类型:`UploadConfig` | N

### InputConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
autocomplete | String | - | 是否开启自动填充功能 | N
placeholder | String | - | 语言配置,“请输入”占位符描述文本 | N

### PaginationConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
itemsPerPage | String | - | 语言配置,每页条数文本,示例:`'{size} 条/页'` | N
jumpTo | String | - | 语言配置,页码跳转文本,示例:'跳至' | N
Expand All @@ -53,7 +54,7 @@ total | String | - | 语言配置,数据总条数文本,示例:`'共 {tota

### CalendarConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
cellMonth | String | - | 语言配置,月份描述文本,示例:'一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月' | N
controllerConfig | Object | - | 日历右上角控制器按钮配置。TS 类型:`CalendarController`[Calendar API Documents](./calendar?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/config-provider/type.ts) | N
Expand All @@ -71,31 +72,31 @@ yearSelection | String | - | 语言配置,“年”选择描述文本,示例

### CascaderConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
empty | String | - | 语言配置,“暂无数据”描述文本 | N
loadingText | String | - | 语言配置,“加载中”描述文本 | N
placeholder | String | - | 语言配置,“请选择”占位描述文本 | N

### ColorPickerConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
clearConfirmText | String | - | 语言配置,“确定清空最近使用的颜色吗?”清空颜色确认文案 | N
recentColorTitle | String | - | 语言配置,“最近使用颜色” 区域标题文本 | N
swatchColorTitle | String | - | 语言配置,\"系统预设颜色\" 区域标题文本 | N

### TransferConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
empty | String | - | 语言配置,“暂无数据”空数据描述文本 | N
placeholder | String | - | 语言配置,“请输入关键词搜索”占位符描述文本 | N
title | String | - | 语言配置,穿梭框标题描述文本,示例:“{checked} / {total} 项” | N

### TimePickerConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
anteMeridiem | String | - | 语言配置,“上午”描述文本 | N
confirm | String | - | 语言配置,“确定”描述文本 | N
Expand All @@ -105,7 +106,7 @@ postMeridiem | String | - | 语言配置,“下午”描述文本 | N

### DatePickerConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
confirm | String | - | 语言配置,“确定” 描述文本 | N
dayAriaLabel | String | - | 语言配置,“日” 描述文本 | N
Expand Down Expand Up @@ -134,7 +135,7 @@ yearAriaLabel | String | - | 语言配置,“年” 描述文本 | N

### DialogConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
cancel | Object | - | 取消按钮风格。TS 类型:`string \| ButtonProps`[Button API Documents](./button?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/config-provider/type.ts) | N
closeOnEscKeydown | Boolean | true | 按下 ESC 时是否触发对话框关闭事件 | N
Expand All @@ -144,7 +145,7 @@ confirmBtnTheme | Object | - | 确认按钮主题色,即 Dialog 的 `theme`

### DrawerConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
cancel | String | - | 语言配置,“取消”描述文本。TS 类型:`string \| ButtonProps` | N
closeOnEscKeydown | Boolean | true | 按下 ESC 时是否触发抽屉关闭事件 | N
Expand All @@ -154,15 +155,15 @@ size | String | 'small' | 尺寸配置,配置Drawer尺寸 | N

### PopconfirmConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
cancel | String / Object | - | 语言配置,“取消”描述文本。TS 类型:`string \| ButtonProps`[Button API Documents](./button?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/config-provider/type.ts) | N
confirm | String / Object | - | 语言配置,“确定”描述文本。TS 类型:`string \| ButtonProps` | N
confirmBtnTheme | Object | - | 确认按钮主题色,即 Popconfirm 的 `theme` 和 确认按钮的 `theme` 映射关系。示例:{ danger: 'danger' }。TS 类型:`{ default: string; warning: string; danger: string; }` | N

### TableConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
cancelText | String | - | 语言配置,“取消” 描述文本 | N
clearFilterResultButtonText | String | - | 语言配置,过滤功能中,“清空筛选” 描述文本 | N
Expand All @@ -188,7 +189,7 @@ treeExpandAndFoldIcon | Function | undefined | 树形结构,展开和折叠图

### SelectConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
clearIcon | Function | - | 清除图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
empty | String | - | 语言配置,“暂无数据”描述文本 | N
Expand All @@ -198,29 +199,29 @@ placeholder | String | - | 语言配置,“请选择”占位符描述文本 |

### TreeConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
empty | String | - | 语言配置,“暂无数据”描述文本 | N
folderIcon | Function | - | 目录层级图标,传入收起状态图标即可。【注意】使用渲染函数输出图标组件。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N

### TreeSelectConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
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
Expand All @@ -231,7 +232,7 @@ triggerUploadText | Object | - | 语言配置,上传功能触发文案。示

### UploadConfigProgress

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
failText | String | - | 语言配置,“上传失败”文本描述 | N
successText | String | - | 语言配置,“上传成功”文本描述 | N
Expand All @@ -240,15 +241,15 @@ waitingText | String | - | 语言配置,“待上传”文本描述 | N

### UploadConfigDragger

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
clickAndDragText | String | - | 语言配置,“ 点击上方“选择文件”或将文件拖到此区域 ” 描述文本 | N
dragDropText | String | - | 语言配置,“释放图标” 描述文本 | N
draggingText | String | - | 语言配置,'拖拽到此区域' 描述文本 | N

### UploadConfigFileList

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
fileNameText | String | - | 语言配置,“文件名” 描述文本 | N
fileOperationDateText | String | - | 语言配置,“上传日期” 描述文本 | N
Expand All @@ -258,61 +259,61 @@ fileStatusText | String | - | 语言配置,“状态” 描述文本 | N

### FormConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
colon | String | - | 字段旁边的冒号,中文为“:” | N
errorMessage | Object | - | 表单错误信息配置,示例:`{ idcard: '请输入正确的身份证号码', max: '字符长度不能超过 ${max}' }`。TS 类型:`FormErrorMessage`[Form API Documents](./form?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/config-provider/type.ts) | N
requiredMark | Boolean | true | 是否显示必填符号(*),默认显示 | N

### TagConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
closeIcon | Function | - | 关闭图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N

### StepsConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
errorIcon | TElement | - | 错误步骤图标,【注意】使用渲染函数输出图标组件。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N

### AlertConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
collapseText | String | - | 语言配置,“收起”描述文本 | N
expandText | String | - | 语言配置,“展开更多”描述文本 | N

### DescriptionsConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
colon | String | - | 字段旁边的冒号,中文为“:” | N

### AnchorConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
copySuccessText | String | - | 语言配置,“链接复制成功”描述文本 | N
copyText | String | - | 语言配置,“复制链接” 描述文本 | N

### MessageConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
`MessageOptions` | \- | - | 继承 `MessageOptions` 中的全部属性 | N

### ImageConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
errorText | String | - | 图片加载失败显示的文本,中文默认为“图片无法显示” | N
loadingText | String | - | 图片加载中显示的文本,中文默认为“图片加载中” | N
replaceImageSrc | Function | - | 统一替换图片 `src` 地址,参数为组件的全部属性,返回值为新的图片地址。TS 类型:`(params: ImageProps) => string`[Image API Documents](./image?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/config-provider/type.ts) | N

### ImageViewerConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
errorText | String | - | 全局语言配置,默认为 “图片加载失败,可尝试重新加载” | N
mirrorTipText | String | - | 全局语言配置,默认为 “镜像” | N
Expand All @@ -321,7 +322,7 @@ rotateTipText | String | - | 全局语言配置,默认为 “旋转” | N

### GuideConfig

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
finishButtonProps | Object | - | 最后一步中的完成按钮,示例:`{ content: '完成', theme: 'primary' }`。TS 类型:`ButtonProps` | N
nextButtonProps | Object | - | 下一步按钮,示例:`{ content: '下一步', theme: 'primary' }`。TS 类型:`ButtonProps` | N
Expand Down
Loading

0 comments on commit 448efd2

Please sign in to comment.