@hi-ui/table 4.10.0-alpha.0 → 4.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @hi-ui/table
2
2
 
3
+ ## 4.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#3093](https://github.com/XiaoMi/hiui/pull/3093) [`8192dc3c0`](https://github.com/XiaoMi/hiui/commit/8192dc3c06a5299165fcad1a05f291b994384e3f) Thanks [@zyprepare](https://github.com/zyprepare)! - feat(table): 列排序支持设置默认排序顺序和受控模式 (#3091)
8
+
9
+ ### Patch Changes
10
+
11
+ - [#3105](https://github.com/XiaoMi/hiui/pull/3105) [`af5207873`](https://github.com/XiaoMi/hiui/commit/af5207873a2e1187a95b00d2c5f64658eb210086) Thanks [@zyprepare](https://github.com/zyprepare)! - fix(table): 修复虚拟表格下自定义行和单元格样式无效问题 (#3100)
12
+
3
13
  ## 4.9.2
4
14
 
5
15
  ### Patch Changes
@@ -54,7 +54,8 @@ var TableBody = /*#__PURE__*/React.forwardRef(function (_ref) {
54
54
  measureRowElementRef = _useTableContext.measureRowElementRef,
55
55
  scrollbar = _useTableContext.scrollbar,
56
56
  scrollLeft = _useTableContext.scrollLeft,
57
- innerRef = _useTableContext.innerRef;
57
+ innerRef = _useTableContext.innerRef,
58
+ rowClassName = _useTableContext.rowClassName;
58
59
  var virtualListRef = React.useRef(null);
59
60
  var listRef = React.useRef(null);
60
61
  var cls = classname.cx(prefixCls + "-body");
@@ -146,7 +147,8 @@ var TableBody = /*#__PURE__*/React.forwardRef(function (_ref) {
146
147
  key: row.id,
147
148
  // @ts-ignore
148
149
  rowIndex: index,
149
- rowData: row
150
+ rowData: row,
151
+ className: rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(row, index)
150
152
  }, getRequiredProps(row.id))));
151
153
  }
152
154
  }))) : TbodyContent.renderEmptyContent(Object.assign({
@@ -176,6 +176,7 @@ var TableRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
176
176
  }), flattedColumnsWithoutChildren.map(function (column, idx) {
177
177
  return /*#__PURE__*/React__default["default"].createElement(TableCell.TableCell, {
178
178
  key: idx,
179
+ className: cellClassName === null || cellClassName === void 0 ? void 0 : cellClassName(rowDataProp, column, idx),
179
180
  column: column,
180
181
  isSwitcherCol: firstColumn ? firstColumn.id === column.id : false,
181
182
  rowData: rowDataProp,
@@ -41,7 +41,8 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref) {
41
41
  measureRowElementRef = _useTableContext.measureRowElementRef,
42
42
  scrollbar = _useTableContext.scrollbar,
43
43
  scrollLeft = _useTableContext.scrollLeft,
44
- innerRef = _useTableContext.innerRef;
44
+ innerRef = _useTableContext.innerRef,
45
+ rowClassName = _useTableContext.rowClassName;
45
46
  var virtualListRef = useRef(null);
46
47
  var listRef = useRef(null);
47
48
  var cls = cx(prefixCls + "-body");
@@ -133,7 +134,8 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref) {
133
134
  key: row.id,
134
135
  // @ts-ignore
135
136
  rowIndex: index,
136
- rowData: row
137
+ rowData: row,
138
+ className: rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(row, index)
137
139
  }, getRequiredProps(row.id))));
138
140
  }
139
141
  }))) : renderEmptyContent(Object.assign({
@@ -164,6 +164,7 @@ var TableRow = /*#__PURE__*/forwardRef(function (_ref, ref) {
164
164
  }), flattedColumnsWithoutChildren.map(function (column, idx) {
165
165
  return /*#__PURE__*/React__default.createElement(TableCell, {
166
166
  key: idx,
167
+ className: cellClassName === null || cellClassName === void 0 ? void 0 : cellClassName(rowDataProp, column, idx),
167
168
  column: column,
168
169
  isSwitcherCol: firstColumn ? firstColumn.id === column.id : false,
169
170
  rowData: rowDataProp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/table",
3
- "version": "4.10.0-alpha.0",
3
+ "version": "4.10.0",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HiUI <mi-hiui@xiaomi.com>",