From 0d57c1db6693fa5841f527bf0481bf7c6e867b5c Mon Sep 17 00:00:00 2001 From: Uyarn Date: Sat, 21 Sep 2024 18:52:25 +0800 Subject: [PATCH 1/2] feat(table): rowclassnameparams type extend --- db/TDesign.db | Bin 1003520 -> 1003520 bytes .../tdesign-react/src/table/defaultProps.ts | 2 -- .../tdesign-react/src/table/table.en-US.md | 2 +- .../products/tdesign-react/src/table/table.md | 2 +- .../products/tdesign-react/src/table/type.ts | 1 + .../tdesign-vue-next/src/table/table.en-US.md | 2 +- .../tdesign-vue-next/src/table/table.md | 2 +- .../tdesign-vue-next/src/table/type.ts | 1 + .../tdesign-vue/src/table/table.en-US.md | 2 +- .../products/tdesign-vue/src/table/table.md | 2 +- .../products/tdesign-vue/src/table/type.ts | 1 + packages/scripts/api.json | 2 +- 12 files changed, 10 insertions(+), 9 deletions(-) diff --git a/db/TDesign.db b/db/TDesign.db index 2a25cce1b8e4f2bd6c001ba9f6240455189ddc6d..faf292e8cd41b082b157e5645d623172ac02672a 100644 GIT binary patch delta 132 zcmZozVB4_3c7ilx#Y7or)(Qr_cP^Pm$y0Bl!MpUn4u|r`^t-KM;Y0Q^2@zbE2m!!VG(XGyUYf} b>_E%`#GF9P1;pGy%mc){+siKVb=3d>KbtR1 delta 124 zcmZozVB4_3c7ilx`9v9K)^Y~DvW~`-))dCp6sFb`=GGLJ))dyQDQt_*vrJ-OoV1!Syu8i1rX0M+#tcoS+h<&4JIdIecbN@{*@2h?h&h3n T3y8Uam = { columnControllerVisible: undefined, columns: [], @@ -47,7 +46,6 @@ export const primaryTableDefaultProps: Pick< reserveSelectedRowOnPaginate: true, defaultSelectedRowKeys: [], showSortColumnBgColor: false, - sortOnRowDraggable: false, }; export const enhancedTableDefaultProps: TdEnhancedTableProps = { defaultExpandedTreeNodes: [] }; diff --git a/packages/products/tdesign-react/src/table/table.en-US.md b/packages/products/tdesign-react/src/table/table.en-US.md index 18830ac4a..6305b2f85 100644 --- a/packages/products/tdesign-react/src/table/table.en-US.md +++ b/packages/products/tdesign-react/src/table/table.en-US.md @@ -42,7 +42,7 @@ pagination | Object | - | you can use all props of pagination component with pag paginationAffixedBottom | Boolean / Object | - | affix props。Typescript:`boolean \| Partial` | N resizable | Boolean | false | allow to resize column width, set `tableLayout=fixed` would be better | N rowAttributes | Object / Array / Function | - | `tr` attributes。Typescript:`TableRowAttributes` `type TableRowAttributes = HTMLElementAttributes \| ((params: { row: T; rowIndex: number; type: 'body' \| 'foot' }) => HTMLElementAttributes) \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/table/type.ts) | N -rowClassName | String / Object / Array / Function | - | table `th` classname。Typescript:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; type?: 'body' \| 'foot' }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/table/type.ts) | N +rowClassName | String / Object / Array / Function | - | table `th` classname。Typescript:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; rowKey?: string; type?: 'body' \| 'foot' }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/table/type.ts) | N rowKey | String | 'id' | required。unique key for each row data | Y rowspanAndColspan | Function | - | rowspan and colspan。Typescript:`TableRowspanAndColspanFunc` `type TableRowspanAndColspanFunc = (params: BaseTableCellParams) => RowspanColspan` `interface RowspanColspan { colspan?: number; rowspan?: number }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/table/type.ts) | N rowspanAndColspanInFooter | Function | - | rowspan and colspan for footer。Typescript:`TableRowspanAndColspanFunc` | N diff --git a/packages/products/tdesign-react/src/table/table.md b/packages/products/tdesign-react/src/table/table.md index 9d606532d..b326ffc77 100644 --- a/packages/products/tdesign-react/src/table/table.md +++ b/packages/products/tdesign-react/src/table/table.md @@ -42,7 +42,7 @@ pagination | Object | - | 分页配置,值为空则不显示。具体 API 参 paginationAffixedBottom | Boolean / Object | - | 分页吸底。基于 Affix 组件开发,透传全部 Affix 组件属性。TS 类型:`boolean \| Partial` | N resizable | Boolean | false | 是否允许调整列宽,设置 `tableLayout=fixed` 效果更友好,此时不允许通过 CSS 设置 `table`元素宽度,也不允许设置 `tableContentWidth`。一般不建议在列宽调整场景使用 `tableLayout: auto`。如果想要配置宽度可调整的最小值和最大值,请使用 `column.resize`,示例:`columns: [{ resize: { minWidth: 120, maxWidth: 300 } }]`。
默认规则:因列宽超出存在横向滚动条时,列宽调整仅影响当前列宽和总列宽;表格列较少没有横向滚动条时,列宽调整表现为自身宽度和相邻宽度变化 | N rowAttributes | Object / Array / Function | - | HTML 标签 `tr` 的属性。类型为 Function 时,参数说明:`params.row` 表示行数据;`params.rowIndex` 表示行下标;`params.type=body` 表示属性作用于 `tbody` 中的元素;`params.type=foot` 表示属性作用于 `tfoot` 中的元素。
示例一:{ draggable: true },
示例二:[{ draggable: true }, { title: '超出省略显示' }]。
示例三:() => [{ draggable: true }]。TS 类型:`TableRowAttributes` `type TableRowAttributes = HTMLElementAttributes \| ((params: { row: T; rowIndex: number; type: 'body' \| 'foot' }) => HTMLElementAttributes) \| Array>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/table/type.ts) | N -rowClassName | String / Object / Array / Function | - | 行类名,泛型 T 指表格数据类型。`params.row` 表示行数据;`params.rowIndex` 表示行下标;`params.type=body` 表示类名作用于 `tbody` 中的元素;`params.type= tfoot` 表示类名作用于 `tfoot` 中的元素。TS 类型:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; type?: 'body' \| 'foot' }`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/table/type.ts) | N +rowClassName | String / Object / Array / Function | - | 行类名,泛型 T 指表格数据类型。`params.row` 表示行数据;`params.rowIndex` 表示行下标;`params.type=body` 表示类名作用于 `tbody` 中的元素;`params.type= tfoot` 表示类名作用于 `tfoot` 中的元素。TS 类型:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; rowKey?: string; type?: 'body' \| 'foot' }`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/table/type.ts) | N rowKey | String | 'id' | 必需。唯一标识一行数据的字段名,来源于 `data` 中的字段。如果是字段嵌套多层,可以设置形如 `item.a.id` 的方法 | Y rowspanAndColspan | Function | - | 用于自定义合并单元格,泛型 T 指表格数据类型。示例:`({ row, col, rowIndex, colIndex }) => { rowspan: 2, colspan: 3 }`。TS 类型:`TableRowspanAndColspanFunc` `type TableRowspanAndColspanFunc = (params: BaseTableCellParams) => RowspanColspan` `interface RowspanColspan { colspan?: number; rowspan?: number }`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/table/type.ts) | N rowspanAndColspanInFooter | Function | - | 用于自定义表尾的合并单元格,泛型 T 指表格数据类型。示例:`({ row, col, rowIndex, colIndex }) => { rowspan: 2, colspan: 3 }`。TS 类型:`TableRowspanAndColspanFunc` | N diff --git a/packages/products/tdesign-react/src/table/type.ts b/packages/products/tdesign-react/src/table/type.ts index 0ee078df6..d651eb655 100644 --- a/packages/products/tdesign-react/src/table/type.ts +++ b/packages/products/tdesign-react/src/table/type.ts @@ -1000,6 +1000,7 @@ export type TableRowAttributes = export interface RowClassNameParams { row: T; rowIndex: number; + rowKey?: string; type?: 'body' | 'foot'; } diff --git a/packages/products/tdesign-vue-next/src/table/table.en-US.md b/packages/products/tdesign-vue-next/src/table/table.en-US.md index c8befa116..69b01c9c9 100644 --- a/packages/products/tdesign-vue-next/src/table/table.en-US.md +++ b/packages/products/tdesign-vue-next/src/table/table.en-US.md @@ -41,7 +41,7 @@ pagination | Object | - | you can use all props of pagination component with pag paginationAffixedBottom | Boolean / Object | - | affix props。Typescript:`boolean \| Partial` | N resizable | Boolean | false | allow to resize column width, set `tableLayout=fixed` would be better | N rowAttributes | Object / Array / Function | - | `tr` attributes。Typescript:`TableRowAttributes` `type TableRowAttributes = HTMLElementAttributes \| ((params: { row: T; rowIndex: number; type: 'body' \| 'foot' }) => HTMLElementAttributes) \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/table/type.ts) | N -rowClassName | String / Object / Array / Function | - | table `th` classname。Typescript:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; type?: 'body' \| 'foot' }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/table/type.ts) | N +rowClassName | String / Object / Array / Function | - | table `th` classname。Typescript:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; rowKey?: string; type?: 'body' \| 'foot' }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/table/type.ts) | N rowKey | String | 'id' | required。unique key for each row data | Y rowspanAndColspan | Function | - | rowspan and colspan。Typescript:`TableRowspanAndColspanFunc` `type TableRowspanAndColspanFunc = (params: BaseTableCellParams) => RowspanColspan` `interface RowspanColspan { colspan?: number; rowspan?: number }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/table/type.ts) | N rowspanAndColspanInFooter | Function | - | rowspan and colspan for footer。Typescript:`TableRowspanAndColspanFunc` | N diff --git a/packages/products/tdesign-vue-next/src/table/table.md b/packages/products/tdesign-vue-next/src/table/table.md index 1ad35f327..d835b0df6 100644 --- a/packages/products/tdesign-vue-next/src/table/table.md +++ b/packages/products/tdesign-vue-next/src/table/table.md @@ -41,7 +41,7 @@ pagination | Object | - | 分页配置,值为空则不显示。具体 API 参 paginationAffixedBottom | Boolean / Object | - | 分页吸底。基于 Affix 组件开发,透传全部 Affix 组件属性。TS 类型:`boolean \| Partial` | N resizable | Boolean | false | 是否允许调整列宽,设置 `tableLayout=fixed` 效果更友好,此时不允许通过 CSS 设置 `table`元素宽度,也不允许设置 `tableContentWidth`。一般不建议在列宽调整场景使用 `tableLayout: auto`。如果想要配置宽度可调整的最小值和最大值,请使用 `column.resize`,示例:`columns: [{ resize: { minWidth: 120, maxWidth: 300 } }]`。
默认规则:因列宽超出存在横向滚动条时,列宽调整仅影响当前列宽和总列宽;表格列较少没有横向滚动条时,列宽调整表现为自身宽度和相邻宽度变化 | N rowAttributes | Object / Array / Function | - | HTML 标签 `tr` 的属性。类型为 Function 时,参数说明:`params.row` 表示行数据;`params.rowIndex` 表示行下标;`params.type=body` 表示属性作用于 `tbody` 中的元素;`params.type=foot` 表示属性作用于 `tfoot` 中的元素。
示例一:{ draggable: true },
示例二:[{ draggable: true }, { title: '超出省略显示' }]。
示例三:() => [{ draggable: true }]。TS 类型:`TableRowAttributes` `type TableRowAttributes = HTMLElementAttributes \| ((params: { row: T; rowIndex: number; type: 'body' \| 'foot' }) => HTMLElementAttributes) \| Array>`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/table/type.ts) | N -rowClassName | String / Object / Array / Function | - | 行类名,泛型 T 指表格数据类型。`params.row` 表示行数据;`params.rowIndex` 表示行下标;`params.type=body` 表示类名作用于 `tbody` 中的元素;`params.type= tfoot` 表示类名作用于 `tfoot` 中的元素。TS 类型:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; type?: 'body' \| 'foot' }`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/table/type.ts) | N +rowClassName | String / Object / Array / Function | - | 行类名,泛型 T 指表格数据类型。`params.row` 表示行数据;`params.rowIndex` 表示行下标;`params.type=body` 表示类名作用于 `tbody` 中的元素;`params.type= tfoot` 表示类名作用于 `tfoot` 中的元素。TS 类型:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; rowKey?: string; type?: 'body' \| 'foot' }`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/table/type.ts) | N rowKey | String | 'id' | 必需。唯一标识一行数据的字段名,来源于 `data` 中的字段。如果是字段嵌套多层,可以设置形如 `item.a.id` 的方法 | Y rowspanAndColspan | Function | - | 用于自定义合并单元格,泛型 T 指表格数据类型。示例:`({ row, col, rowIndex, colIndex }) => { rowspan: 2, colspan: 3 }`。TS 类型:`TableRowspanAndColspanFunc` `type TableRowspanAndColspanFunc = (params: BaseTableCellParams) => RowspanColspan` `interface RowspanColspan { colspan?: number; rowspan?: number }`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/table/type.ts) | N rowspanAndColspanInFooter | Function | - | 用于自定义表尾的合并单元格,泛型 T 指表格数据类型。示例:`({ row, col, rowIndex, colIndex }) => { rowspan: 2, colspan: 3 }`。TS 类型:`TableRowspanAndColspanFunc` | N diff --git a/packages/products/tdesign-vue-next/src/table/type.ts b/packages/products/tdesign-vue-next/src/table/type.ts index 7f11f11cc..78a336918 100644 --- a/packages/products/tdesign-vue-next/src/table/type.ts +++ b/packages/products/tdesign-vue-next/src/table/type.ts @@ -998,6 +998,7 @@ export type TableRowAttributes = export interface RowClassNameParams { row: T; rowIndex: number; + rowKey?: string; type?: 'body' | 'foot'; } diff --git a/packages/products/tdesign-vue/src/table/table.en-US.md b/packages/products/tdesign-vue/src/table/table.en-US.md index 19f7baf23..2104fb44c 100644 --- a/packages/products/tdesign-vue/src/table/table.en-US.md +++ b/packages/products/tdesign-vue/src/table/table.en-US.md @@ -41,7 +41,7 @@ pagination | Object | - | you can use all props of pagination component with pag paginationAffixedBottom | Boolean / Object | - | affix props。Typescript:`boolean \| Partial` | N resizable | Boolean | false | allow to resize column width, set `tableLayout=fixed` would be better | N rowAttributes | Object / Array / Function | - | `tr` attributes。Typescript:`TableRowAttributes` `type TableRowAttributes = HTMLElementAttributes \| ((params: { row: T; rowIndex: number; type: 'body' \| 'foot' }) => HTMLElementAttributes) \| Array>`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N -rowClassName | String / Object / Array / Function | - | table `th` classname。Typescript:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; type?: 'body' \| 'foot' }`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N +rowClassName | String / Object / Array / Function | - | table `th` classname。Typescript:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; rowKey?: string; type?: 'body' \| 'foot' }`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N rowKey | String | 'id' | required。unique key for each row data | Y rowspanAndColspan | Function | - | rowspan and colspan。Typescript:`TableRowspanAndColspanFunc` `type TableRowspanAndColspanFunc = (params: BaseTableCellParams) => RowspanColspan` `interface RowspanColspan { colspan?: number; rowspan?: number }`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N rowspanAndColspanInFooter | Function | - | rowspan and colspan for footer。Typescript:`TableRowspanAndColspanFunc` | N diff --git a/packages/products/tdesign-vue/src/table/table.md b/packages/products/tdesign-vue/src/table/table.md index f5ab148f5..6047ef3cc 100644 --- a/packages/products/tdesign-vue/src/table/table.md +++ b/packages/products/tdesign-vue/src/table/table.md @@ -41,7 +41,7 @@ pagination | Object | - | 分页配置,值为空则不显示。具体 API 参 paginationAffixedBottom | Boolean / Object | - | 分页吸底。基于 Affix 组件开发,透传全部 Affix 组件属性。TS 类型:`boolean \| Partial` | N resizable | Boolean | false | 是否允许调整列宽,设置 `tableLayout=fixed` 效果更友好,此时不允许通过 CSS 设置 `table`元素宽度,也不允许设置 `tableContentWidth`。一般不建议在列宽调整场景使用 `tableLayout: auto`。如果想要配置宽度可调整的最小值和最大值,请使用 `column.resize`,示例:`columns: [{ resize: { minWidth: 120, maxWidth: 300 } }]`。
默认规则:因列宽超出存在横向滚动条时,列宽调整仅影响当前列宽和总列宽;表格列较少没有横向滚动条时,列宽调整表现为自身宽度和相邻宽度变化 | N rowAttributes | Object / Array / Function | - | HTML 标签 `tr` 的属性。类型为 Function 时,参数说明:`params.row` 表示行数据;`params.rowIndex` 表示行下标;`params.type=body` 表示属性作用于 `tbody` 中的元素;`params.type=foot` 表示属性作用于 `tfoot` 中的元素。
示例一:{ draggable: true },
示例二:[{ draggable: true }, { title: '超出省略显示' }]。
示例三:() => [{ draggable: true }]。TS 类型:`TableRowAttributes` `type TableRowAttributes = HTMLElementAttributes \| ((params: { row: T; rowIndex: number; type: 'body' \| 'foot' }) => HTMLElementAttributes) \| Array>`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N -rowClassName | String / Object / Array / Function | - | 行类名,泛型 T 指表格数据类型。`params.row` 表示行数据;`params.rowIndex` 表示行下标;`params.type=body` 表示类名作用于 `tbody` 中的元素;`params.type= tfoot` 表示类名作用于 `tfoot` 中的元素。TS 类型:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; type?: 'body' \| 'foot' }`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N +rowClassName | String / Object / Array / Function | - | 行类名,泛型 T 指表格数据类型。`params.row` 表示行数据;`params.rowIndex` 表示行下标;`params.type=body` 表示类名作用于 `tbody` 中的元素;`params.type= tfoot` 表示类名作用于 `tfoot` 中的元素。TS 类型:`ClassName \| ((params: RowClassNameParams) => ClassName)` `interface RowClassNameParams { row: T; rowIndex: number; rowKey?: string; type?: 'body' \| 'foot' }`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N rowKey | String | 'id' | 必需。唯一标识一行数据的字段名,来源于 `data` 中的字段。如果是字段嵌套多层,可以设置形如 `item.a.id` 的方法 | Y rowspanAndColspan | Function | - | 用于自定义合并单元格,泛型 T 指表格数据类型。示例:`({ row, col, rowIndex, colIndex }) => { rowspan: 2, colspan: 3 }`。TS 类型:`TableRowspanAndColspanFunc` `type TableRowspanAndColspanFunc = (params: BaseTableCellParams) => RowspanColspan` `interface RowspanColspan { colspan?: number; rowspan?: number }`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/table/type.ts) | N rowspanAndColspanInFooter | Function | - | 用于自定义表尾的合并单元格,泛型 T 指表格数据类型。示例:`({ row, col, rowIndex, colIndex }) => { rowspan: 2, colspan: 3 }`。TS 类型:`TableRowspanAndColspanFunc` | N diff --git a/packages/products/tdesign-vue/src/table/type.ts b/packages/products/tdesign-vue/src/table/type.ts index 7f11f11cc..78a336918 100644 --- a/packages/products/tdesign-vue/src/table/type.ts +++ b/packages/products/tdesign-vue/src/table/type.ts @@ -998,6 +998,7 @@ export type TableRowAttributes = export interface RowClassNameParams { row: T; rowIndex: number; + rowKey?: string; type?: 'body' | 'foot'; } diff --git a/packages/scripts/api.json b/packages/scripts/api.json index ce0196eef..b06c795de 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -10605,7 +10605,7 @@ "create_time": "2020-12-18 03:26:16", "update_time": "2022-03-04 14:57:28", "event_output": null, - "custom_field_type": "ClassName | ((params: RowClassNameParams) => ClassName)【interface RowClassNameParams { row: T; rowIndex: number; type?: 'body' | 'foot' }】", + "custom_field_type": "ClassName | ((params: RowClassNameParams) => ClassName)【interface RowClassNameParams { row: T; rowIndex: number; rowKey?: string; type?: 'body' | 'foot' }】", "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, From 41f482ad70e345d71745ddecb1756feaeedda77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?w=C5=AB=20y=C4=81ng?= Date: Sun, 22 Sep 2024 15:14:33 +0800 Subject: [PATCH 2/2] chore: revert deprecated change --- packages/products/tdesign-react/src/table/defaultProps.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/products/tdesign-react/src/table/defaultProps.ts b/packages/products/tdesign-react/src/table/defaultProps.ts index 1ab539e97..a6d46eecd 100644 --- a/packages/products/tdesign-react/src/table/defaultProps.ts +++ b/packages/products/tdesign-react/src/table/defaultProps.ts @@ -37,6 +37,7 @@ export const primaryTableDefaultProps: Pick< | 'reserveSelectedRowOnPaginate' | 'defaultSelectedRowKeys' | 'showSortColumnBgColor' + | 'sortOnRowDraggable' > = { columnControllerVisible: undefined, columns: [], @@ -46,6 +47,7 @@ export const primaryTableDefaultProps: Pick< reserveSelectedRowOnPaginate: true, defaultSelectedRowKeys: [], showSortColumnBgColor: false, + sortOnRowDraggable: false, }; export const enhancedTableDefaultProps: TdEnhancedTableProps = { defaultExpandedTreeNodes: [] };