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(Empty): add empty component #2817

Merged
merged 24 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d5033b0
feat(empty): add empty component
ZWkang Mar 28, 2024
2a17dd8
feat(empty): 增加 empty component 使用默认预设值,增加样式
ZWkang Jul 1, 2024
a2f7299
feat(empty): props className
ZWkang Jul 1, 2024
c4bae07
fix: empty wrapper class
ZWkang Jul 1, 2024
f6415ff
fix(empty): update name -> prefix
ZWkang Jul 1, 2024
8059207
Merge branch 'develop' into feature/react-empty-component
ZWkang Aug 8, 2024
c7c2a1f
docs(empty): add empty example
ZWkang Aug 8, 2024
56cef30
docs(empty): update docs example
HaixingOoO Aug 11, 2024
2246e5a
test(empty): update test snap
HaixingOoO Aug 11, 2024
7494fcb
chore: update snapshot
github-actions[bot] Aug 11, 2024
50cc97c
chore: update site route
Aug 12, 2024
5510bd3
test: update test snapshot
Aug 12, 2024
9f854ef
chore(empty): update ConfigProvider and i18n
HaixingOoO Aug 12, 2024
bf7521d
chore: update snapshot
github-actions[bot] Aug 12, 2024
ec6de9e
docs(empty): update ConfigProvider
liweijie0812 Aug 13, 2024
204b38b
docs(config-provider): delete ConfigProvider attach message
HaixingOoO Aug 13, 2024
d5dd983
chore(config-provider): delete attach message type
HaixingOoO Aug 13, 2024
a11d243
chore: add size api
Aug 21, 2024
9cdd8d8
chore: add size api
Aug 21, 2024
72b12a8
chore(empty): update type and md
HaixingOoO Aug 21, 2024
f59b924
chore(empty): update _common
HaixingOoO Aug 21, 2024
6c31467
Merge branch 'develop' of github.com:Tencent/tdesign-react into zw-up…
uyarn Aug 21, 2024
42593f1
chore: update snapshot
github-actions[bot] Aug 21, 2024
c029f20
chore: update common
Aug 22, 2024
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
27 changes: 18 additions & 9 deletions src/config-provider/config-provider.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +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; popup?: AttachNode; dialog?: AttachNode; }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.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
HaixingOoO marked this conversation as resolved.
Show resolved Hide resolved
calendar | Object | - | Calendar global configs。Typescript:`CalendarConfig` | N
cascader | Object | - | Cascader global configs。Typescript:`CascaderConfig` | N
classPrefix | String | t | \- | N
Expand Down Expand Up @@ -36,6 +36,7 @@ timePicker | Object | - | TimePicker global configs。Typescript:`TimePickerCo
transfer | Object | - | Transfer global configs。Typescript:`TransferConfig` | N
tree | Object | - | Tree global configs。Typescript:`TreeConfig` | N
treeSelect | Object | - | TreeSelect global configs。Typescript:`TreeSelectConfig` | N
typography | Object | - | Typography global configs。Typescript:`TypographyConfig` | N
upload | Object | - | Upload global configs。Typescript:`UploadConfig` | N

### InputConfig
Expand All @@ -61,7 +62,7 @@ name | type | default | description | required
cellMonth | String | - | \- | N
controllerConfig | Object | - | Typescript:`CalendarController`,[Calendar API Documents](./calendar?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/config-provider/type.ts) | N
fillWithZero | Boolean | true | \- | N
firstDayOfWeek | Number | 1 | options1/2/3/4/5/6/7 | N
firstDayOfWeek | Number | 1 | options: 1/2/3/4/5/6/7 | N
hideWeekend | String | - | \- | N
monthRadio | String | - | \- | N
monthSelection | String | - | \- | N
Expand Down Expand Up @@ -114,7 +115,7 @@ confirm | String | - | confirm text | N
dayAriaLabel | String | - | date text | N
dayjsLocale | String | - | dayjs language international configuration | N
direction | String | 'ltr' | range separator text | N
firstDayOfWeek | Number | 7 | options1/2/3/4/5/6/7 | N
firstDayOfWeek | Number | 7 | options: 1/2/3/4/5/6/7 | N
format | String | 'YYYY-MM-DD' | date format rules | N
monthAriaLabel | String | - | month text | N
months | Array | - | Typescript:`string[]` | N
Expand All @@ -140,7 +141,7 @@ yearAriaLabel | String | - | year text | N
name | type | default | description | required
-- | -- | -- | -- | --
cancel | Object | - | Typescript:`string \| ButtonProps`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/config-provider/type.ts) | N
closeOnEscKeydown | Boolean | true | \- | N
closeOnEscKeydown | Boolean | true | trigger dialog close on `ESC` keydown | N
closeOnOverlayClick | Boolean | true | \- | N
confirm | Object | - | Typescript:`string \| ButtonProps` | N
confirmBtnTheme | Object | - | Typescript:`{ default: string; info: string; warning: string; danger: string; success: string; }` | N
Expand All @@ -150,7 +151,7 @@ confirmBtnTheme | Object | - | Typescript:`{ default: string; info: string; wa
name | type | default | description | required
-- | -- | -- | -- | --
cancel | String | - | Typescript:`string \| ButtonProps` | N
closeOnEscKeydown | Boolean | true | \- | N
closeOnEscKeydown | Boolean | true | trigger drawer close event on `ESC` keydown | N
closeOnOverlayClick | Boolean | true | \- | N
confirm | String | - | Typescript:`string \| ButtonProps` | N
size | String | 'small' | \- | N
Expand Down Expand Up @@ -182,6 +183,7 @@ loadingText | String | - | \- | N
resetText | String | - | \- | N
searchResultText | String | - | \- | N
selectAllText | String | - | \- | N
size | String | medium | options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
sortAscendingOperationText | String | - | \- | N
sortCancelOperationText | String | - | \- | N
sortDescendingOperationText | String | - | \- | N
Expand Down Expand Up @@ -262,6 +264,7 @@ fileStatusText | String | - | \- | N

name | type | default | description | required
-- | -- | -- | -- | --
colon | String | - | colon on the right of label ":" | N
errorMessage | Object | - | Typescript:`FormErrorMessage`,[Form API Documents](./form?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/config-provider/type.ts) | N
requiredMark | Boolean | true | \- | N

Expand All @@ -285,6 +288,12 @@ name | type | default | description | required
collapseText | String | - | \- | N
expandText | String | - | \- | N

### DescriptionsConfig

name | type | default | description | required
-- | -- | -- | -- | --
colon | String | - | colon on the right of label, ":" | N

### AnchorConfig

name | type | default | description | required
Expand Down Expand Up @@ -328,19 +337,19 @@ skipButtonProps | Object | - | skip button. `{ content: 'Skip', theme: 'default'

name | type | default | description | required
-- | -- | -- | -- | --
rateText | Array | - | \- | N
rateText | Array | - | Typescript:`Array<string>` | N

### EmptyConfig

name | type | default | description | required
-- | -- | -- | -- | --
image | Object | - | Typescript:`{ maintenance: TNode; success: TNode; fail: TNode; empty: TNode; networkError: TNode; }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
image | Object | - | Typescript:`{ maintenance: TNode; success: TNode; fail: TNode; empty: TNode; networkError: TNode; }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
titleText | Object | - | Typescript:`{ maintenance: string; success: string; fail: string; empty: string; networkError: string; }` | N

### TypographyConfig

名称 | 类型 | 默认值 | 说明 | 必传
name | type | default | description | required
-- | -- | -- | -- | --
collapseText | String | - | collapse text | N
copiedText | String | - | copied text | N
expandText | String | - | expand text | N
copiedText | String | - | copied text | N
16 changes: 12 additions & 4 deletions src/config-provider/config-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import 'tdesign-react/esm/style/index.js'
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; }`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.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 @@ -213,6 +213,7 @@ loadingText | String | - | 语言配置,“正在加载中,请稍后” 描
resetText | String | - | 语言配置,“重置” 描述文本 | N
searchResultText | String | - | 语言配置,过滤功能中,过滤条件和结果描述文本,示例:'搜索“{result}”,找到 {count} 条结果' | N
selectAllText | String | - | 语言配置,'全选' 描述文本 | N
size | String | medium | 全局表格尺寸配置。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
sortAscendingOperationText | String | - | 语言配置,'点击升序' 描述文本 | N
sortCancelOperationText | String | - | 语言配置,'点击取消排序' 描述文本 | N
sortDescendingOperationText | String | - | 语言配置,'点击降序' 描述文本 | N
Expand Down Expand Up @@ -293,6 +294,7 @@ fileStatusText | String | - | 语言配置,“状态” 描述文本 | N

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
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

Expand All @@ -316,6 +318,12 @@ errorIcon | TElement | - | 错误步骤图标,【注意】使用渲染函数
collapseText | String | - | 语言配置,“收起”描述文本 | N
expandText | String | - | 语言配置,“展开更多”描述文本 | N

### DescriptionsConfig

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

### AnchorConfig

名称 | 类型 | 默认值 | 描述 | 必传
Expand Down Expand Up @@ -359,19 +367,19 @@ skipButtonProps | Object | - | 跳过按钮,示例:`{ content: '跳过', the

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
rateText | Array | - | 评分描述,默认值:['极差', '失望', '一般', '满意', '惊喜'] | N
rateText | Array | - | 评分描述,默认值:['极差', '失望', '一般', '满意', '惊喜']。TS 类型:`Array<string>` | N

### EmptyConfig

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
image | Object | - | 空状态组件各类型的图片配置。TS 类型:`{ maintenance: TNode; success: TNode; fail: TNode; empty: TNode; networkError: TNode; }`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
image | Object | - | 空状态组件各类型的图片配置。TS 类型:`{ maintenance: TNode; success: TNode; fail: TNode; empty: TNode; networkError: TNode; }`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
titleText | Object | - | 空状态组件各类型的标题文本配置。TS 类型:`{ maintenance: string; success: string; fail: string; empty: string; networkError: string; }` | N

### TypographyConfig

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
collapseText | String | - | 语言配置,“收起”描述文本 | N
copiedText | String | - | 语言配置,“复制成功”描述文本 | N
expandText | String | - | 语言配置,“展开”描述文本 | N
copiedText | String | - | 语言配置,“复制成功”描述文本 | N
26 changes: 26 additions & 0 deletions src/config-provider/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ export interface GlobalConfigProvider {
* 树选择器组件全局配置
*/
treeSelect?: TreeSelectConfig;
/**
* 排版组件全局配置
*/
typography?: TypographyConfig;
/**
* 上传组件全局配置
*/
Expand Down Expand Up @@ -811,6 +815,10 @@ export interface TagConfig {
}

export interface StepsConfig {
/**
* 已完成步骤图标,【注意】使用渲染函数输出图标组件
*/
checkIcon?: TElement;
/**
* 错误步骤图标,【注意】使用渲染函数输出图标组件
*/
Expand Down Expand Up @@ -930,6 +938,24 @@ export interface EmptyConfig {
titleText?: { maintenance: string; success: string; fail: string; empty: string; networkError: string };
}

export interface TypographyConfig {
/**
* 语言配置,“收起”描述文本
* @default ''
*/
collapseText?: string;
/**
* 语言配置,“复制成功”描述文本
* @default ''
*/
copiedText?: string;
/**
* 语言配置,“展开”描述文本
* @default ''
*/
expandText?: string;
}

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

export type IconConfig = GlobalIconConfig;
Expand Down
Loading