Skip to content

Commit 8dbcb00

Browse files
committed
feat(Table): update mobile-react table props
1 parent 86db2bd commit 8dbcb00

9 files changed

Lines changed: 187 additions & 83 deletions

File tree

db/TDesign.db

4 KB
Binary file not shown.

packages/products/tdesign-mobile-react/src/config-provider/config-provider.en-US.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,28 @@
66

77
name | type | default | description | required
88
-- | -- | -- | -- | --
9-
globalConfig | Object | - | global config。Typescript`GlobalConfigProvider` | N
9+
globalConfig | Object | - | global config。Typescript: `GlobalConfigProvider` | N
1010

1111
### GlobalConfigProvider
1212

1313
name | type | default | description | required
1414
-- | -- | -- | -- | --
15-
actionSheet | Object | - | ActionSheet global configs。Typescript`ActionSheetConfig` | N
16-
calendar | Object | - | Calendar global configs。Typescript`CalendarConfig` | N
17-
cascader | Object | - | Cascader global configs。Typescript`CascaderConfig` | N
15+
actionSheet | Object | - | ActionSheet global configs。Typescript: `ActionSheetConfig` | N
16+
calendar | Object | - | Calendar global configs。Typescript: `CalendarConfig` | N
17+
cascader | Object | - | Cascader global configs。Typescript: `CascaderConfig` | N
1818
classPrefix | String | t | \- | N
19-
dateTimePicker | Object | - | DateTimePicker global configs。Typescript:`DateTimePickerConfig` | N
20-
dropdownMenu | Object | - | DropdownMenu global configs。Typescript:`DropdownMenuConfig` | N
21-
guide | Object | - | Guide global configs。Typescript:`GuideConfig` | N
22-
list | Object | - | List global configs。Typescript:`ListConfig` | N
23-
picker | Object | - | Picker global configs。Typescript:`PickerConfig` | N
24-
pullDownRefresh | Object | - | PullDownRefresh global configs。Typescript:`PullDownRefreshConfig` | N
25-
qrcode | Object | - | QRCode global configs。Typescript:`QRCodeConfig` | N
26-
rate | Object | - | Rate global configs。Typescript:`RateConfig` | N
27-
tabBar | Object | - | TabBar global configs。Typescript:`TabBarConfig` | N
28-
table | Object | - | Table global configs。Typescript:`TableConfig` | N
29-
upload | Object | - | Upload global configs。Typescript:`UploadConfig` | N
19+
dateTimePicker | Object | - | DateTimePicker global configs。Typescript: `DateTimePickerConfig` | N
20+
dropdownMenu | Object | - | DropdownMenu global configs。Typescript: `DropdownMenuConfig` | N
21+
form | Object | - | Form global configs。Typescript: `FormConfig` | N
22+
guide | Object | - | Guide global configs。Typescript: `GuideConfig` | N
23+
list | Object | - | List global configs。Typescript: `ListConfig` | N
24+
picker | Object | - | Picker global configs。Typescript: `PickerConfig` | N
25+
pullDownRefresh | Object | - | PullDownRefresh global configs。Typescript: `PullDownRefreshConfig` | N
26+
qrcode | Object | - | QRCode global configs。Typescript: `QRCodeConfig` | N
27+
rate | Object | - | Rate global configs。Typescript: `RateConfig` | N
28+
tabBar | Object | - | TabBar global configs。Typescript: `TabBarConfig` | N
29+
table | Object | - | Table global configs。Typescript: `TableConfig` | N
30+
upload | Object | - | Upload global configs。Typescript: `UploadConfig` | N
3031

3132
### ActionSheetConfig
3233

@@ -40,9 +41,9 @@ name | type | default | description | required
4041
-- | -- | -- | -- | --
4142
confirm | String | - | confirm text | N
4243
monthTitle | String | - | \- | N
43-
months | Array | - | Typescript`string[]` | N
44+
months | Array | - | Typescript: `string[]` | N
4445
title | String | - | \- | N
45-
weekdays | Array | - | Typescript`string[]` | N
46+
weekdays | Array | - | Typescript: `string[]` | N
4647

4748
### CascaderConfig
4849

@@ -78,7 +79,7 @@ reset | String | - | reset text | N
7879
name | type | default | description | required
7980
-- | -- | -- | -- | --
8081
colonText | String | - | colon on the right of label ":" | N
81-
errorMessage | Object | - | Typescript`FormErrorMessage`[Form API Documents](./form?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/config-provider/type.ts) | N
82+
errorMessage | Object | - | Typescript: `FormErrorMessage`[Form API Documents](./form?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/config-provider/type.ts) | N
8283
requiredMark | Boolean | true | \- | N
8384
requiredMarkPosition | String | left | Display position of required symbols。options: left/right | N
8485

@@ -97,7 +98,7 @@ name | type | default | description | required
9798
-- | -- | -- | -- | --
9899
errorText | String | - | loading text, default value is "Error" | N
99100
loadingText | String | - | loading text, default value is "loading" | N
100-
replaceImageSrc | Function | - | replace all `src` attribute of images。Typescript`(params: ImageProps) => string`[Image API Documents](./image?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/config-provider/type.ts) | N
101+
replaceImageSrc | Function | - | replace all `src` attribute of images。Typescript: `(params: ImageProps) => string`[Image API Documents](./image?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/config-provider/type.ts) | N
101102

102103
### InputConfig
103104

@@ -126,7 +127,7 @@ confirm | String | - | confirm text | N
126127

127128
name | type | default | description | required
128129
-- | -- | -- | -- | --
129-
loadingTexts | Array | - | Typescript`string[]` | N
130+
loadingTexts | Array | - | Typescript: `string[]` | N
130131

131132
### QRCodeConfig
132133

@@ -156,13 +157,16 @@ newsAriaLabel | String | - | \- | N
156157

157158
name | type | default | description | required
158159
-- | -- | -- | -- | --
159-
empty | TNode | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
160+
clearFilterResultButtonText | String | - | \- | N
161+
empty | TNode | - | Typescript: `string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
162+
hideSortTips | Boolean | false | hide sort tips | N
163+
searchResultText | String | - | \- | N
160164

161165
### UploadConfig
162166

163167
name | type | default | description | required
164168
-- | -- | -- | -- | --
165-
progress | Object | - | Typescript`UploadConfigProgress` | N
169+
progress | Object | - | Typescript: `UploadConfigProgress` | N
166170

167171
### UploadConfigProgress
168172

packages/products/tdesign-mobile-react/src/config-provider/config-provider.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ cascader | Object | - | 级联选择器全局配置。TS 类型:`CascaderConfi
1818
classPrefix | String | t | CSS 类名前缀 | N
1919
dateTimePicker | Object | - | 时间选择器全局配置。TS 类型:`DateTimePickerConfig` | N
2020
dropdownMenu | Object | - | 下拉菜单全局配置。TS 类型:`DropdownMenuConfig` | N
21+
form | Object | - | 表单组件全局配置。TS 类型:`FormConfig` | N
2122
guide | Object | - | 引导全局配置。TS 类型:`GuideConfig` | N
2223
list | Object | - | 列表组件全局配置。TS 类型:`ListConfig` | N
2324
picker | Object | - | 选择器全局配置。TS 类型:`PickerConfig` | N
@@ -156,7 +157,10 @@ newsAriaLabel | String | - | 语言配置,“有新的消息”描述文本 |
156157

157158
名称 | 类型 | 默认值 | 描述 | 必传
158159
-- | -- | -- | -- | --
160+
clearFilterResultButtonText | String | - | 语言配置,过滤功能中,“清空筛选” 描述文本 | N
159161
empty | TNode | - | 语言配置,“暂无数据” 描述文本。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
162+
hideSortTips | Boolean | false | 隐藏排序文本提示 | N
163+
searchResultText | String | - | 语言配置,过滤功能中,过滤条件和结果描述文本,示例:'搜索“{result}”,找到 {count} 条结果' | N
160164

161165
### UploadConfig
162166

packages/products/tdesign-mobile-react/src/config-provider/type.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { FormErrorMessage } from '../form';
88
import { ImageProps } from '../image';
9-
import { TNode } from '../common';
9+
import type { TNode } from '../common';
1010

1111
export interface TdConfigProviderProps {
1212
/**
@@ -41,6 +41,10 @@ export interface GlobalConfigProvider {
4141
* 下拉菜单全局配置
4242
*/
4343
dropdownMenu?: DropdownMenuConfig;
44+
/**
45+
* 表单组件全局配置
46+
*/
47+
form?: FormConfig;
4448
/**
4549
* 引导全局配置
4650
*/
@@ -365,10 +369,25 @@ export interface TabBarConfig {
365369
}
366370

367371
export interface TableConfig {
372+
/**
373+
* 语言配置,过滤功能中,“清空筛选” 描述文本
374+
* @default ''
375+
*/
376+
clearFilterResultButtonText?: string;
368377
/**
369378
* 语言配置,“暂无数据” 描述文本
370379
*/
371380
empty?: TNode;
381+
/**
382+
* 隐藏排序文本提示
383+
* @default false
384+
*/
385+
hideSortTips?: boolean;
386+
/**
387+
* 语言配置,过滤功能中,过滤条件和结果描述文本,示例:'搜索“{result}”,找到 {count} 条结果'
388+
* @default ''
389+
*/
390+
searchResultText?: string;
372391
}
373392

374393
export interface UploadConfig {

packages/products/tdesign-mobile-react/src/table/defaultProps.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const baseTableDefaultProps: TdBaseTableProps = {
1010
data: [],
1111
empty: '',
1212
loading: undefined,
13+
loadingMode: 'pull-refresh',
1314
rowKey: 'id',
1415
showHeader: true,
1516
stripe: false,
@@ -22,7 +23,6 @@ export const primaryTableDefaultProps: Pick<
2223
| 'columns'
2324
| 'expandIcon'
2425
| 'defaultExpandedRowKeys'
25-
| 'loadingMode'
2626
| 'multipleSort'
2727
| 'reserveSelectedRowOnPaginate'
2828
| 'defaultSelectedRowKeys'
@@ -31,7 +31,6 @@ export const primaryTableDefaultProps: Pick<
3131
columns: [],
3232
expandIcon: true,
3333
defaultExpandedRowKeys: [],
34-
loadingMode: 'pull-refresh',
3534
multipleSort: false,
3635
reserveSelectedRowOnPaginate: true,
3736
defaultSelectedRowKeys: [],

packages/products/tdesign-mobile-react/src/table/table.en-US.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ fixedRows | Array | - | `0.16.0`。Typescript: `Array<number>` | N
1717
footerSummary | TNode | - | footer summary content。Typescript: `string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
1818
height | String / Number | - | table height | N
1919
loading | TNode | undefined | loading state table。Typescript: `boolean \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
20+
loadingMode | String | pull-refresh | Data Loading Mode。options: pull-refresh/pagination | N
2021
loadingProps | Object | - | Typescript: `Partial<LoadingProps>`[Loading API Documents](./loading?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/table/type.ts) | N
2122
maxHeight | String / Number | - | table max height | N
22-
pagination | Object | - | you can use all props of pagination component with paginationProps。Typescript: `PaginationProps`[Pagination API Documents](./pagination?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/table/type.ts) | N
23+
pagination | Object | - | you can use all props of pagination component with paginationProps。Typescript: `PaginationProps` `interface PaginationProps { current?: number; defaultCurrent?: number; disabled?: boolean; foldedMaxPageBtn?: number; maxPageBtn?: number; pageEllipsisMode?: 'mid' \| 'both-ends'; pageSize?: number; defaultPageSize?: number; pageSizeOptions?: Array<number \| { label: string; value: number }>; showFirstAndLastPageBtn?: boolean; showJumper?: boolean; showPageNumber?: boolean; showPageSize?: boolean; showPreviousAndNextBtn?: boolean; size?: 'small' \| 'medium'; theme?: 'default' \| 'simple'; total?: number; totalContent?: TNode; onChange?: (pageInfo: PageInfo) => void; onCurrentChange?: (current: number, pageInfo: PageInfo) => void; onPageSizeChange?: (pageSize: number, pageInfo: PageInfo) => void; }` `interface PageInfo { current: number; previous: number; pageSize: number }`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/table/type.ts) | N
2324
rowAttributes | Object / Array / Function | - | `0.17.0``tr` attributes。Typescript: `TableRowAttributes<T>` `type TableRowAttributes<T> = HTMLElementAttributes \| ((params: { row: T; rowIndex: number; type: 'body' \| 'foot' }) => HTMLElementAttributes) \| Array<TableRowAttributes<T>>`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/table/type.ts) | N
2425
rowClassName | String / Object / Array / Function | - | `0.17.0`。table `th` classname。Typescript: `ClassName \| ((params: RowClassNameParams<T>) => ClassName)` `interface RowClassNameParams<T> { row: T; rowIndex: number; rowKey?: string; type?: 'body' \| 'foot' }`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/table/type.ts) | N
2526
rowKey | String | 'id' | required。unique key for each row data | Y
@@ -30,6 +31,7 @@ tableContentWidth | String | - | \- | N
3031
tableLayout | String | fixed | table-layout css properties, [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout). set value to be `fixed` on `resizable=true` please。options: auto/fixed | N
3132
verticalAlign | String | middle | vertical align。options: top/middle/bottom | N
3233
onCellClick | Function | | Typescript: `(context: BaseTableCellEventContext<T>) => void`<br/>trigger on cell clicked。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/table/type.ts)。<br/>`interface BaseTableCellEventContext<T extends TableRowData = TableRowData> { row: T; col: BaseTableCol<T>; rowIndex: number; colIndex: number; e: MouseEvent }`<br/> | N
34+
onPageChange | Function | | Typescript: `(pageInfo: PageInfo, newDataSource: Array<T>) => void`<br/>trigger on pagination changing | N
3335
onRowClick | Function | | Typescript: `(context: RowEventContext<T>) => void`<br/>trigger on row click。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/table/type.ts)。<br/>`interface RowEventContext<T extends TableRowData = TableRowData> { row: T; index: number; e: MouseEvent }`<br/> | N
3436
onScroll | Function | | Typescript: `(params: { e: UIEvent }) => void`<br/>trigger on table content scroll | N
3537

@@ -80,7 +82,6 @@ filterValue | Object | - | filter value。Typescript: `FilterValue` `type Filter
8082
defaultFilterValue | Object | - | filter value。uncontrolled property。Typescript: `FilterValue` `type FilterValue = { [key: string]: any }`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/table/type.ts) | N
8183
hideSortTips | Boolean | - | hide sort tips | N
8284
indeterminateSelectedRowKeys | Array | - | indeterminate selected row keys, row key is from data[rowKey]。Typescript: `Array<string \| number>` | N
83-
loadingMode | String | pull-refresh | Data Loading Mode。options: pull-refresh/pagination | N
8485
multipleSort | Boolean | false | support multiple column fields sort | N
8586
reserveSelectedRowOnPaginate | Boolean | true | Controls whether selected rows are retained across pagination. When enabled, selections persist across all pages, allowing batch operations on multi-page data. If set to `false`, selections are confined to the current page and do not extend to other pages. | N
8687
selectOnRowClick | Boolean | - | select row data on row click | N

0 commit comments

Comments
 (0)