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

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 ADDED
@@ -0,0 +1,272 @@
1
+ # @hi-ui/table
2
+
3
+ ## 4.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2760](https://github.com/XiaoMi/hiui/pull/2760) [`68afb78ed`](https://github.com/XiaoMi/hiui/commit/68afb78ed1fb8e42bc8eec68cfa5f1787ee052b0) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复 Safari 中设置 virtual 后只能表头滚动问题
8
+
9
+ - [#2759](https://github.com/XiaoMi/hiui/pull/2759) [`7437ca3b0`](https://github.com/XiaoMi/hiui/commit/7437ca3b07ce1fb66fe9fa3572b45c2928e64a73) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复 SettingDrawer 列更新问题
10
+
11
+ ## 4.5.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#2735](https://github.com/XiaoMi/hiui/pull/2735) [`a2b9df50b`](https://github.com/XiaoMi/hiui/commit/a2b9df50b454ae033a5dd0e5f6165ab2f6de07a5) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: 设置 rowSelection 后默认冻结该列
16
+
17
+ - [#2735](https://github.com/XiaoMi/hiui/pull/2735) [`81863f522`](https://github.com/XiaoMi/hiui/commit/81863f52200213ae7740f496c4fe8d73f607b66c) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: setting 增加 trigger 配置
18
+
19
+ ### Patch Changes
20
+
21
+ - [#2726](https://github.com/XiaoMi/hiui/pull/2726) [`459c7940c`](https://github.com/XiaoMi/hiui/commit/459c7940cc94b124e182754474424e13de9f120a) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复双表格结构下,无法设置空状态内容问题
22
+
23
+ - [#2735](https://github.com/XiaoMi/hiui/pull/2735) [`6ac546d3e`](https://github.com/XiaoMi/hiui/commit/6ac546d3e9c1b863fb30941dd365220fa138258a) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复虚拟表格设置 maxHeight 底部内容被遮挡问题
24
+
25
+ - [#2735](https://github.com/XiaoMi/hiui/pull/2735) [`b971c0b06`](https://github.com/XiaoMi/hiui/commit/b971c0b06b1c64dd72c79c23068c4fed684d97c3) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复同时设置 bordered 和 scrollbar 后滚动异常问题
26
+
27
+ - [#2735](https://github.com/XiaoMi/hiui/pull/2735) [`a2b9df50b`](https://github.com/XiaoMi/hiui/commit/a2b9df50b454ae033a5dd0e5f6165ab2f6de07a5) Thanks [@zyprepare](https://github.com/zyprepare)! - feat(table): 设置 rowSelection 后默认冻结该列
28
+
29
+ - [#2748](https://github.com/XiaoMi/hiui/pull/2748) [`ca008e4ae`](https://github.com/XiaoMi/hiui/commit/ca008e4ae9753bc1f11efcdcbf09121d1ef07b56) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复表头分组超过 2 列时冻结列交互异常问题
30
+
31
+ - [#2735](https://github.com/XiaoMi/hiui/pull/2735) [`528314e46`](https://github.com/XiaoMi/hiui/commit/528314e46173dd18cc0140e60e763cb84b52fa2c) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复设置 dataSource 组件首次会执行 2 次请求问题
32
+
33
+ - [#2747](https://github.com/XiaoMi/hiui/pull/2747) [`b5654408e`](https://github.com/XiaoMi/hiui/commit/b5654408ee33b6448b6e9f1297a2790a486d753f) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 监听列变化,更新列最小可调整宽度
34
+
35
+ - Updated dependencies [[`a9b9c93fc`](https://github.com/XiaoMi/hiui/commit/a9b9c93fc3a3fea60d14052a5afeef9daf7efa1b), [`ca008e4ae`](https://github.com/XiaoMi/hiui/commit/ca008e4ae9753bc1f11efcdcbf09121d1ef07b56)]:
36
+ - @hi-ui/select@4.3.0
37
+ - @hi-ui/tree-utils@4.1.6
38
+
39
+ ## 4.4.1
40
+
41
+ ### Patch Changes
42
+
43
+ - [#2722](https://github.com/XiaoMi/hiui/pull/2722) [`a25261a88`](https://github.com/XiaoMi/hiui/commit/a25261a884f9b3470924c29564b3c4758ebab6cf) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复空状态下横向滚动条问题
44
+
45
+ - Updated dependencies [[`a25261a88`](https://github.com/XiaoMi/hiui/commit/a25261a884f9b3470924c29564b3c4758ebab6cf)]:
46
+ - @hi-ui/checkbox@4.0.9
47
+
48
+ ## 4.4.0
49
+
50
+ ### Minor Changes
51
+
52
+ - [#2699](https://github.com/XiaoMi/hiui/pull/2699) [`6c5d9c7ed`](https://github.com/XiaoMi/hiui/commit/6c5d9c7ed21eaebc26638ba6ee54eb3bfe918af4) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: add fixed and rowClassName api
53
+ feat: SettingDrawer 增加 extraHeader showCheckAll itemRender api
54
+ fix: 修复边框模式下样式问题
55
+ feat: SettingDrawer 支持配置列是否禁止拖拽
56
+ fix: 修复 resize 模式下多选时宽度被重置问题
57
+ fix: 修复树形表格节点图标没有对齐问题
58
+ fix: 修复虚拟表格边框样式问题
59
+ fix: 修复虚拟表格下双滚动条问题
60
+ fix: 修复虚拟表格下 size 和 maxHeight 失效问题
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [[`4ec059bad`](https://github.com/XiaoMi/hiui/commit/4ec059badc67f3facc98288f3e7a67f51938e40f), [`ffd47b89a`](https://github.com/XiaoMi/hiui/commit/ffd47b89a5d7da54ea717fa827123e9c3b2b6d0f), [`cfc37dc37`](https://github.com/XiaoMi/hiui/commit/cfc37dc37c83ce737d88262644c07ca23cde0731), [`2fa5ee5b6`](https://github.com/XiaoMi/hiui/commit/2fa5ee5b6ecc7f95a5224fd91ccfcd263b41d932), [`9cf8e079f`](https://github.com/XiaoMi/hiui/commit/9cf8e079fd3f342d851d7abfecc1c0447c3ac40b)]:
65
+ - @hi-ui/loading@4.2.0
66
+ - @hi-ui/empty-state@4.1.0
67
+ - @hi-ui/tree-utils@4.1.5
68
+ - @hi-ui/scrollbar@4.1.0
69
+
70
+ ## 4.3.4
71
+
72
+ ### Patch Changes
73
+
74
+ - build: rollup2 构建
75
+ - Updated dependencies
76
+ - @hi-ui/core@4.0.8
77
+ - @hi-ui/use-cache@4.0.4
78
+ - @hi-ui/use-check@4.0.5
79
+ - @hi-ui/use-check-state@4.0.4
80
+ - @hi-ui/use-drag-sorter@4.0.4
81
+ - @hi-ui/use-latest@4.0.4
82
+ - @hi-ui/use-toggle@4.0.4
83
+ - @hi-ui/use-uncontrolled-state@4.0.4
84
+ - @hi-ui/use-update-effect@4.0.4
85
+ - @hi-ui/icons@4.0.18
86
+ - @hi-ui/button@4.0.9
87
+ - @hi-ui/checkbox@4.0.8
88
+ - @hi-ui/drawer@4.1.3
89
+ - @hi-ui/empty-state@4.0.7
90
+ - @hi-ui/icon-button@4.0.8
91
+ - @hi-ui/loading@4.1.3
92
+ - @hi-ui/pagination@4.0.14
93
+ - @hi-ui/popper@4.1.3
94
+ - @hi-ui/select@4.2.5
95
+ - @hi-ui/spinner@4.0.8
96
+ - @hi-ui/array-utils@4.0.4
97
+ - @hi-ui/classname@4.0.4
98
+ - @hi-ui/dom-utils@4.0.7
99
+ - @hi-ui/env@4.0.4
100
+ - @hi-ui/func-utils@4.0.4
101
+ - @hi-ui/object-utils@4.0.4
102
+ - @hi-ui/react-utils@4.0.4
103
+ - @hi-ui/times@4.0.4
104
+ - @hi-ui/tree-utils@4.1.4
105
+ - @hi-ui/type-assertion@4.0.4
106
+
107
+ ## 4.3.3
108
+
109
+ ### Patch Changes
110
+
111
+ - fix: 修复 rollup3 打包 cjs 模块问题
112
+ - Updated dependencies
113
+ - @hi-ui/env@4.0.3
114
+ - @hi-ui/core@4.0.7
115
+ - @hi-ui/use-cache@4.0.3
116
+ - @hi-ui/use-check@4.0.4
117
+ - @hi-ui/use-check-state@4.0.3
118
+ - @hi-ui/use-drag-sorter@4.0.3
119
+ - @hi-ui/use-latest@4.0.3
120
+ - @hi-ui/use-toggle@4.0.3
121
+ - @hi-ui/use-uncontrolled-state@4.0.3
122
+ - @hi-ui/use-update-effect@4.0.3
123
+ - @hi-ui/icons@4.0.17
124
+ - @hi-ui/button@4.0.8
125
+ - @hi-ui/checkbox@4.0.7
126
+ - @hi-ui/drawer@4.1.2
127
+ - @hi-ui/empty-state@4.0.6
128
+ - @hi-ui/icon-button@4.0.7
129
+ - @hi-ui/loading@4.1.2
130
+ - @hi-ui/pagination@4.0.13
131
+ - @hi-ui/popper@4.1.2
132
+ - @hi-ui/select@4.2.4
133
+ - @hi-ui/spinner@4.0.7
134
+ - @hi-ui/array-utils@4.0.3
135
+ - @hi-ui/classname@4.0.3
136
+ - @hi-ui/dom-utils@4.0.6
137
+ - @hi-ui/func-utils@4.0.3
138
+ - @hi-ui/object-utils@4.0.3
139
+ - @hi-ui/react-utils@4.0.3
140
+ - @hi-ui/times@4.0.3
141
+ - @hi-ui/tree-utils@4.1.3
142
+ - @hi-ui/type-assertion@4.0.3
143
+
144
+ ## 4.3.2
145
+
146
+ ### Patch Changes
147
+
148
+ - [#2672](https://github.com/XiaoMi/hiui/pull/2672) [`1ebe27830`](https://github.com/XiaoMi/hiui/commit/1ebe2783098b3a8cd980bd10076d67635463800e) Thanks [@zyprepare](https://github.com/zyprepare)! - build: 升级到 rollup3,重新构建发布组件
149
+
150
+ - [#2671](https://github.com/XiaoMi/hiui/pull/2671) [`6d7909444`](https://github.com/XiaoMi/hiui/commit/6d790944418f36689b34805f858a1268530864b9) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复组件参数类型错误
151
+
152
+ - Updated dependencies [[`1ebe27830`](https://github.com/XiaoMi/hiui/commit/1ebe2783098b3a8cd980bd10076d67635463800e)]:
153
+ - @hi-ui/core@4.0.6
154
+ - @hi-ui/use-cache@4.0.2
155
+ - @hi-ui/use-check@4.0.3
156
+ - @hi-ui/use-check-state@4.0.2
157
+ - @hi-ui/use-drag-sorter@4.0.2
158
+ - @hi-ui/use-latest@4.0.2
159
+ - @hi-ui/use-toggle@4.0.2
160
+ - @hi-ui/use-uncontrolled-state@4.0.2
161
+ - @hi-ui/use-update-effect@4.0.2
162
+ - @hi-ui/icons@4.0.16
163
+ - @hi-ui/button@4.0.7
164
+ - @hi-ui/checkbox@4.0.6
165
+ - @hi-ui/drawer@4.1.1
166
+ - @hi-ui/empty-state@4.0.5
167
+ - @hi-ui/icon-button@4.0.6
168
+ - @hi-ui/loading@4.1.1
169
+ - @hi-ui/pagination@4.0.12
170
+ - @hi-ui/popper@4.1.1
171
+ - @hi-ui/select@4.2.3
172
+ - @hi-ui/spinner@4.0.6
173
+ - @hi-ui/array-utils@4.0.2
174
+ - @hi-ui/classname@4.0.2
175
+ - @hi-ui/dom-utils@4.0.5
176
+ - @hi-ui/env@4.0.2
177
+ - @hi-ui/func-utils@4.0.2
178
+ - @hi-ui/object-utils@4.0.2
179
+ - @hi-ui/react-utils@4.0.2
180
+ - @hi-ui/times@4.0.2
181
+ - @hi-ui/tree-utils@4.1.2
182
+ - @hi-ui/type-assertion@4.0.2
183
+
184
+ ## 4.3.1
185
+
186
+ ### Patch Changes
187
+
188
+ - [#2654](https://github.com/XiaoMi/hiui/pull/2654) [`dc002a32a`](https://github.com/XiaoMi/hiui/commit/dc002a32a2c6f538b0df37c63d34f603647d9b70) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: 增加 scrollbar 参数,用于在 Windows 环境下优化滚动条样式
189
+
190
+ - Updated dependencies [[`b477d91db`](https://github.com/XiaoMi/hiui/commit/b477d91db15bbc92c8712a9a771af5b332779315)]:
191
+ - @hi-ui/button@4.0.6
192
+ - @hi-ui/icon-button@4.0.5
193
+ - @hi-ui/pagination@4.0.11
194
+
195
+ ## 4.3.0
196
+
197
+ ### Minor Changes
198
+
199
+ - [#2642](https://github.com/XiaoMi/hiui/pull/2642) [`74d8c5148`](https://github.com/XiaoMi/hiui/commit/74d8c51489ae7a88c90b1426e9da118125579b97) Thanks [@zyprepare](https://github.com/zyprepare)! - perf: 将之前的双表格结构优化成单表格,冻结列和表头吸顶等场景依然采用双表格结构
200
+
201
+ - [#2647](https://github.com/XiaoMi/hiui/pull/2647) [`8767c9470`](https://github.com/XiaoMi/hiui/commit/8767c94702fdc697207001f639508907e20fc6a5) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: add footerRender api
202
+
203
+ ### Patch Changes
204
+
205
+ - [#2648](https://github.com/XiaoMi/hiui/pull/2648) [`54387a81e`](https://github.com/XiaoMi/hiui/commit/54387a81e1c6add77e791af8d849a6518077afd5) Thanks [@zyprepare](https://github.com/zyprepare)! - perf: 优化 resizable 模式下可调整的最小宽度
206
+
207
+ - Updated dependencies [[`4f7c8c906`](https://github.com/XiaoMi/hiui/commit/4f7c8c9063d9b72068a2db5fa614eed130aafd0f)]:
208
+ - @hi-ui/select@4.2.2
209
+
210
+ ## 4.2.0
211
+
212
+ ### Minor Changes
213
+
214
+ - [#2597](https://github.com/XiaoMi/hiui/pull/2597) [`0ddf24960`](https://github.com/XiaoMi/hiui/commit/0ddf24960194fdd15653e34e0a6cef54b1586748) Thanks [@zyprepare](https://github.com/zyprepare)! - chore: axios 升级为 1.5.0
215
+
216
+ ### Patch Changes
217
+
218
+ - [#2608](https://github.com/XiaoMi/hiui/pull/2608) [`fb9b1281d`](https://github.com/XiaoMi/hiui/commit/fb9b1281d99ba0d21b5cb32c87b5e671272c1c8e) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复紧凑模式下多选项间距问题
219
+
220
+ - Updated dependencies [[`b3b36813a`](https://github.com/XiaoMi/hiui/commit/b3b36813a6968c5c96c39d1100935372e3aa5b4d)]:
221
+ - @hi-ui/select@4.2.0
222
+
223
+ ## 4.1.2
224
+
225
+ ### Patch Changes
226
+
227
+ - [#2572](https://github.com/XiaoMi/hiui/pull/2572) [`eee5e6d16`](https://github.com/XiaoMi/hiui/commit/eee5e6d1658685a6119b5aa40038c572145b3b4e) Thanks [@zyprepare](https://github.com/zyprepare)! - perf: 表格性能优化
228
+
229
+ - Updated dependencies [[`937052db3`](https://github.com/XiaoMi/hiui/commit/937052db36ecfa50fef53df13d159bee0d08fa41), [`ccb1eec12`](https://github.com/XiaoMi/hiui/commit/ccb1eec122a33466536b365d443f175d1e16dc86), [`eee5e6d16`](https://github.com/XiaoMi/hiui/commit/eee5e6d1658685a6119b5aa40038c572145b3b4e)]:
230
+ - @hi-ui/icons@4.0.14
231
+ - @hi-ui/popper@4.1.0
232
+ - @hi-ui/tree-utils@4.1.1
233
+
234
+ ## 4.1.1
235
+
236
+ ### Patch Changes
237
+
238
+ - [#2557](https://github.com/XiaoMi/hiui/pull/2557) [`ef7aae038`](https://github.com/XiaoMi/hiui/commit/ef7aae038362d3a7700611737c474c29d1ba07b4) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: maxHeight 支持表达式
239
+
240
+ - [#2558](https://github.com/XiaoMi/hiui/pull/2558) [`bdd913d71`](https://github.com/XiaoMi/hiui/commit/bdd913d7173de64952437014ab9ffd1947ed506c) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: 增加树形结构排序
241
+
242
+ - Updated dependencies [[`bdd913d71`](https://github.com/XiaoMi/hiui/commit/bdd913d7173de64952437014ab9ffd1947ed506c)]:
243
+ - @hi-ui/tree-utils@4.1.0
244
+
245
+ ## 4.1.0
246
+
247
+ ### Minor Changes
248
+
249
+ - [#2474](https://github.com/XiaoMi/hiui/pull/2474) [`e95268aa4`](https://github.com/XiaoMi/hiui/commit/e95268aa4af48edaaa9f6afcf5a262342a550cd1) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: rowSelection onChange 回调增加已选数据集合参数
250
+
251
+ - [#2474](https://github.com/XiaoMi/hiui/pull/2474) [`e95268aa4`](https://github.com/XiaoMi/hiui/commit/e95268aa4af48edaaa9f6afcf5a262342a550cd1) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: 增加虚拟滚动功能
252
+
253
+ - [#2474](https://github.com/XiaoMi/hiui/pull/2474) [`e95268aa4`](https://github.com/XiaoMi/hiui/commit/e95268aa4af48edaaa9f6afcf5a262342a550cd1) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: 增加 dataSource 功能
254
+
255
+ - [#2474](https://github.com/XiaoMi/hiui/pull/2474) [`e95268aa4`](https://github.com/XiaoMi/hiui/commit/e95268aa4af48edaaa9f6afcf5a262342a550cd1) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: 列设置增加 checkDisabledColKeys api,用于禁用列选择操作
256
+
257
+ - [#2474](https://github.com/XiaoMi/hiui/pull/2474) [`e95268aa4`](https://github.com/XiaoMi/hiui/commit/e95268aa4af48edaaa9f6afcf5a262342a550cd1) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: add SettingDrawer component
258
+
259
+ ### Patch Changes
260
+
261
+ - [#2474](https://github.com/XiaoMi/hiui/pull/2474) [`e95268aa4`](https://github.com/XiaoMi/hiui/commit/e95268aa4af48edaaa9f6afcf5a262342a550cd1) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 数据排序样式不对
262
+
263
+ - [#2473](https://github.com/XiaoMi/hiui/pull/2473) [`3d5f9ba15`](https://github.com/XiaoMi/hiui/commit/3d5f9ba15868ccdc385cdcdc8a3bbe2e55542b39) Thanks [@zyprepare](https://github.com/zyprepare)! - fix: 修复 sonarcloud 扫描的 Bugs
264
+
265
+ - Updated dependencies [[`e95268aa4`](https://github.com/XiaoMi/hiui/commit/e95268aa4af48edaaa9f6afcf5a262342a550cd1)]:
266
+ - @hi-ui/loading@4.1.0
267
+
268
+ ## 4.0.13
269
+
270
+ ### Patch Changes
271
+
272
+ - [#2315](https://github.com/XiaoMi/hiui/pull/2315) [`551ab0b73`](https://github.com/XiaoMi/hiui/commit/551ab0b734e00d1e0ca170c9a87f316aa4197762) Thanks [@zyprepare](https://github.com/zyprepare)! - 修复设置 size 后,空状态会出现滚动条问题
@@ -52,7 +52,8 @@ var TableBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
52
52
  colWidths = _useTableContext.colWidths,
53
53
  virtual = _useTableContext.virtual,
54
54
  measureRowElementRef = _useTableContext.measureRowElementRef,
55
- scrollbar = _useTableContext.scrollbar;
55
+ scrollbar = _useTableContext.scrollbar,
56
+ scrollLeft = _useTableContext.scrollLeft;
56
57
  var cls = classname.cx(prefixCls + "-body");
57
58
  var getRequiredProps = useLatest.useLatestCallback(function (id) {
58
59
  return {
@@ -66,9 +67,6 @@ var TableBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
66
67
  };
67
68
  });
68
69
 
69
- var _useState = React.useState(0),
70
- scrollLeft = _useState[0],
71
- setScrollLeft = _useState[1];
72
70
  var rowWidth = React.useMemo(function () {
73
71
  var tmpWidth = 0;
74
72
  colWidths.forEach(function (width) {
@@ -76,11 +74,6 @@ var TableBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
76
74
  });
77
75
  return tmpWidth;
78
76
  }, [colWidths]);
79
- var onVirtualContainerScroll = React.useCallback(function (evt) {
80
- var _a;
81
- setScrollLeft(((_a = scrollBodyElementRef === null || scrollBodyElementRef === void 0 ? void 0 : scrollBodyElementRef.current) === null || _a === void 0 ? void 0 : _a.scrollLeft) || 0);
82
- onTableBodyScroll(evt);
83
- }, [scrollBodyElementRef, onTableBodyScroll]);
84
77
  if (virtual) {
85
78
  // TODO: avg和summay row的逻辑
86
79
  var realHeight = (_a = scrollBodyElementRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
@@ -88,7 +81,7 @@ var TableBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
88
81
  return /*#__PURE__*/React__default["default"].createElement("div", {
89
82
  ref: scrollBodyElementRef,
90
83
  className: cls,
91
- onScroll: onVirtualContainerScroll,
84
+ onScroll: onTableBodyScroll,
92
85
  onWheel: onTableBodyScrollMock,
93
86
  style: {
94
87
  // 表格宽度大于div宽度才出现横向滚动条
@@ -105,7 +98,7 @@ var TableBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
105
98
  }), /*#__PURE__*/React__default["default"].createElement("div", {
106
99
  ref: bodyTableRef,
107
100
  style: {
108
- height: 1,
101
+ height: 2,
109
102
  marginTop: -1,
110
103
  background: 'transparent',
111
104
  width: rowWidth
@@ -7,7 +7,7 @@
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
- import React__default, { forwardRef, useState, useMemo, useCallback } from 'react';
10
+ import React__default, { forwardRef, useMemo } from 'react';
11
11
  import List from './node_modules/rc-virtual-list/es/List.js';
12
12
  import { getPrefixCls, cx } from '@hi-ui/classname';
13
13
  import { __DEV__ } from '@hi-ui/env';
@@ -39,7 +39,8 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
39
39
  colWidths = _useTableContext.colWidths,
40
40
  virtual = _useTableContext.virtual,
41
41
  measureRowElementRef = _useTableContext.measureRowElementRef,
42
- scrollbar = _useTableContext.scrollbar;
42
+ scrollbar = _useTableContext.scrollbar,
43
+ scrollLeft = _useTableContext.scrollLeft;
43
44
  var cls = cx(prefixCls + "-body");
44
45
  var getRequiredProps = useLatestCallback(function (id) {
45
46
  return {
@@ -53,9 +54,6 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
53
54
  };
54
55
  });
55
56
 
56
- var _useState = useState(0),
57
- scrollLeft = _useState[0],
58
- setScrollLeft = _useState[1];
59
57
  var rowWidth = useMemo(function () {
60
58
  var tmpWidth = 0;
61
59
  colWidths.forEach(function (width) {
@@ -63,11 +61,6 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
63
61
  });
64
62
  return tmpWidth;
65
63
  }, [colWidths]);
66
- var onVirtualContainerScroll = useCallback(function (evt) {
67
- var _a;
68
- setScrollLeft(((_a = scrollBodyElementRef === null || scrollBodyElementRef === void 0 ? void 0 : scrollBodyElementRef.current) === null || _a === void 0 ? void 0 : _a.scrollLeft) || 0);
69
- onTableBodyScroll(evt);
70
- }, [scrollBodyElementRef, onTableBodyScroll]);
71
64
  if (virtual) {
72
65
  // TODO: avg和summay row的逻辑
73
66
  var realHeight = (_a = scrollBodyElementRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
@@ -75,7 +68,7 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
75
68
  return /*#__PURE__*/React__default.createElement("div", {
76
69
  ref: scrollBodyElementRef,
77
70
  className: cls,
78
- onScroll: onVirtualContainerScroll,
71
+ onScroll: onTableBodyScroll,
79
72
  onWheel: onTableBodyScrollMock,
80
73
  style: {
81
74
  // 表格宽度大于div宽度才出现横向滚动条
@@ -92,7 +85,7 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
92
85
  }), /*#__PURE__*/React__default.createElement("div", {
93
86
  ref: bodyTableRef,
94
87
  style: {
95
- height: 1,
88
+ height: 2,
96
89
  marginTop: -1,
97
90
  background: 'transparent',
98
91
  width: rowWidth
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/table",
3
- "version": "4.5.1-alpha.0",
3
+ "version": "4.5.1",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HiUI <mi-hiui@xiaomi.com>",