@hi-ui/table 4.1.3-alpha.0 → 4.2.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.
@@ -249,14 +249,6 @@ var useTable = function useTable(_a) {
249
249
  }, [setFixedToColumn]);
250
250
 
251
251
  var _React$useMemo = React__default["default"].useMemo(function () {
252
- if (!leftFreezeColumn && !rightFreezeColumn) {
253
- return {
254
- leftFrozenColKeys: [],
255
- rightFrozenColKeys: [],
256
- columns: mergedColumns2
257
- };
258
- }
259
-
260
252
  var leftFrozenColKey = leftFreezeColumn;
261
253
  var rightFrozenKey = rightFreezeColumn; // 获取左右冻结列的下标
262
254
  // 获取左右冻结列的下标
@@ -475,18 +467,16 @@ var useTable = function useTable(_a) {
475
467
  return !typeAssertion.isArrayNonEmpty(col.children);
476
468
  });
477
469
  }, [mergedColumns1]);
478
- var groupedColumns = React__default["default"].useMemo(function () {
479
- return mergedColumns1.reduce(function (acc, cur) {
480
- var depth = cur.depth;
470
+ var groupedColumns = mergedColumns1.reduce(function (acc, cur) {
471
+ var depth = cur.depth;
481
472
 
482
- if (!acc[depth]) {
483
- acc[depth] = [];
484
- }
473
+ if (!acc[depth]) {
474
+ acc[depth] = [];
475
+ }
485
476
 
486
- acc[depth].push(cur);
487
- return acc;
488
- }, []);
489
- }, [mergedColumns1]);
477
+ acc[depth].push(cur);
478
+ return acc;
479
+ }, []);
490
480
  var getStickyColProps = useLatest.useLatestCallback(function (column) {
491
481
  var rightStickyWidth = column.rightStickyWidth,
492
482
  leftStickyWidth = column.leftStickyWidth,
@@ -8,7 +8,7 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
  import { __rest } from 'tslib';
11
- import React__default, { forwardRef, useMemo } from 'react';
11
+ import React__default, { forwardRef } from 'react';
12
12
  import { getPrefixCls, cx } from '@hi-ui/classname';
13
13
  import { __DEV__ } from '@hi-ui/env';
14
14
  import { useLocaleContext } from '@hi-ui/core';
@@ -22,9 +22,6 @@ import { TableProvider } from './context.js';
22
22
  import { uuid, checkNeedTotalOrEvg, getTotalOrEvgRowData } from './utils/index.js';
23
23
  import { useTable } from './use-table.js';
24
24
  import { useEmbedExpand } from './hooks/use-embed-expand.js';
25
- import { TheadContent } from './TheadContent.js';
26
- import { ColGroupContent } from './ColGroupContent.js';
27
- import { TbodyContent } from './TbodyContent.js';
28
25
  var _role = 'table';
29
26
 
30
27
  var _prefix = getPrefixCls('table');
@@ -33,6 +30,7 @@ var EMBED_DATA_KEY = "TABLE_EMBED_DATA_KEY_" + uuid();
33
30
  var DEFAULT_COLUMNS = [];
34
31
  var DEFAULT_DATA = [];
35
32
  var BaseTable = /*#__PURE__*/forwardRef(function (_a, ref) {
33
+ // ********************** 内嵌式面板 *********************** //
36
34
  var _a$prefixCls = _a.prefixCls,
37
35
  prefixCls = _a$prefixCls === void 0 ? _prefix : _a$prefixCls,
38
36
  _a$role = _a.role,
@@ -50,7 +48,8 @@ var BaseTable = /*#__PURE__*/forwardRef(function (_a, ref) {
50
48
  expandedEmbedRowKeys = _a.expandedEmbedRowKeys,
51
49
  onEmbedExpand = _a.onEmbedExpand,
52
50
  expandedRender = _a.expandedRender,
53
- size = _a.size,
51
+ _a$size = _a.size,
52
+ size = _a$size === void 0 ? 'md' : _a$size,
54
53
  extra = _a.extra,
55
54
  onRow = _a.onRow,
56
55
  stickyFooter = _a.stickyFooter,
@@ -60,9 +59,7 @@ var BaseTable = /*#__PURE__*/forwardRef(function (_a, ref) {
60
59
  fixedColumnTrigger = _a$fixedColumnTrigger === void 0 ? 'auto' : _a$fixedColumnTrigger,
61
60
  emptyContent = _a.emptyContent,
62
61
  virtual = _a.virtual,
63
- needDoubleTable = _a.needDoubleTable,
64
- rest = __rest(_a, ["prefixCls", "role", "className", "columns", "data", "striped", "bordered", "rowExpandable", "defaultExpandedEmbedRowKeys", "expandedEmbedRowKeys", "onEmbedExpand", "expandedRender", "size", "extra", "onRow", "onHeaderRow", "stickyFooter", "stickyFooterBottom", "fixedColumnTrigger", "emptyContent", "virtual", "needDoubleTable"]); // ********************** 内嵌式面板 *********************** //
65
-
62
+ rest = __rest(_a, ["prefixCls", "role", "className", "columns", "data", "striped", "bordered", "rowExpandable", "defaultExpandedEmbedRowKeys", "expandedEmbedRowKeys", "onEmbedExpand", "expandedRender", "size", "extra", "onRow", "onHeaderRow", "stickyFooter", "stickyFooterBottom", "fixedColumnTrigger", "emptyContent", "virtual"]);
66
63
 
67
64
  var _useEmbedExpand = useEmbedExpand({
68
65
  defaultExpandedEmbedRowKeys: defaultExpandedEmbedRowKeys,
@@ -118,70 +115,48 @@ var BaseTable = /*#__PURE__*/forwardRef(function (_a, ref) {
118
115
 
119
116
  return columns;
120
117
  }, [embedExpandable, getEmbedPanelColumn, columns]);
121
- var i18n = useLocaleContext();
122
-
123
- var _useMemo = useMemo(function () {
124
- // 确保包含 avg 属性,且值为数字类型的字符串
125
- var avgRow = {
126
- id: 'avg',
127
- raw: {
128
- key: 'avg'
129
- }
130
- };
131
- var hasAvgColumn = false;
132
- columns.forEach(function (column, index) {
133
- if (index === 0) {
134
- // @ts-ignore
135
- avgRow.raw[column.dataKey] = i18n.get('table.average');
136
- }
118
+ var i18n = useLocaleContext(); // 确保包含 avg 属性,且值为数字类型的字符串
137
119
 
138
- if (checkNeedTotalOrEvg(data, column, 'avg')) {
139
- hasAvgColumn = true; // @ts-ignore
140
- // @ts-ignore
120
+ var avgRow = {
121
+ id: 'avg',
122
+ raw: {
123
+ key: 'avg'
124
+ }
125
+ };
126
+ var hasAvgColumn = false;
127
+ columns.forEach(function (column, index) {
128
+ if (index === 0) {
129
+ // @ts-ignore
130
+ avgRow.raw[column.dataKey] = i18n.get('table.average');
131
+ }
141
132
 
142
- avgRow.raw[column.dataKey] = getTotalOrEvgRowData(data, column, true);
143
- }
144
- });
145
- return {
146
- avgRow: avgRow,
147
- hasAvgColumn: hasAvgColumn
148
- };
149
- }, [columns, data, i18n]),
150
- avgRow = _useMemo.avgRow,
151
- hasAvgColumn = _useMemo.hasAvgColumn;
133
+ if (checkNeedTotalOrEvg(data, column, 'avg')) {
134
+ hasAvgColumn = true; // @ts-ignore
152
135
 
153
- var _useMemo2 = useMemo(function () {
154
- // 确保包含total属性,且值为数字类型的字符串
155
- var sumRow = {
156
- id: 'sum',
157
- raw: {
158
- key: 'sum'
159
- }
160
- };
161
- var hasSumColumn = false;
162
- columns.forEach(function (column, index) {
163
- if (index === 0) {
164
- // @ts-ignore
165
- sumRow.raw[column.dataKey] = i18n.get('table.total');
166
- }
136
+ avgRow.raw[column.dataKey] = getTotalOrEvgRowData(data, column, true);
137
+ }
138
+ }); // 确保包含total属性,且值为数字类型的字符串
167
139
 
168
- if (checkNeedTotalOrEvg(data, column, 'total')) {
169
- hasSumColumn = true; // 获取当前数据最大小数点个数,并设置最后总和值小数点
170
- // @ts-ignore
171
- // 获取当前数据最大小数点个数,并设置最后总和值小数点
172
- // @ts-ignore
140
+ var sumRow = {
141
+ id: 'sum',
142
+ raw: {
143
+ key: 'sum'
144
+ }
145
+ };
146
+ var hasSumColumn = false;
147
+ columns.forEach(function (column, index) {
148
+ if (index === 0) {
149
+ // @ts-ignore
150
+ sumRow.raw[column.dataKey] = i18n.get('table.total');
151
+ }
173
152
 
174
- sumRow.raw[column.dataKey] = getTotalOrEvgRowData(data, column, false);
175
- }
176
- });
177
- return {
178
- sumRow: sumRow,
179
- hasSumColumn: hasSumColumn
180
- };
181
- }, [columns, data, i18n]),
182
- sumRow = _useMemo2.sumRow,
183
- hasSumColumn = _useMemo2.hasSumColumn;
153
+ if (checkNeedTotalOrEvg(data, column, 'total')) {
154
+ hasSumColumn = true; // 获取当前数据最大小数点个数,并设置最后总和值小数点
155
+ // @ts-ignore
184
156
 
157
+ sumRow.raw[column.dataKey] = getTotalOrEvgRowData(data, column, false);
158
+ }
159
+ });
185
160
  var providedValue = useTable(Object.assign(Object.assign({}, rest), {
186
161
  columns: mergedColumns,
187
162
  data: data,
@@ -194,67 +169,11 @@ var BaseTable = /*#__PURE__*/forwardRef(function (_a, ref) {
194
169
  leftFixedColumnsWidth = providedValue.leftFixedColumnsWidth,
195
170
  rightFixedColumnsWidth = providedValue.rightFixedColumnsWidth,
196
171
  scrollSize = providedValue.scrollSize,
197
- getTableHeaderProps = providedValue.getTableHeaderProps,
198
- scrollBodyElementRef = providedValue.scrollBodyElementRef,
199
- onTableBodyScroll = providedValue.onTableBodyScroll,
200
- canScroll = providedValue.canScroll,
201
- bodyTableRef = providedValue.bodyTableRef,
202
- scrollWidth = providedValue.scrollWidth;
172
+ getTableHeaderProps = providedValue.getTableHeaderProps;
203
173
  var hasBorder = borderedProp !== null && borderedProp !== void 0 ? borderedProp : bordered;
204
174
  var extraHeader = extra && extra.header;
205
175
  var extraFooter = extra && extra.footer;
206
176
  var alwaysFixedColumn = fixedColumnTrigger === 'always';
207
-
208
- var renderTable = function renderTable() {
209
- return needDoubleTable ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", Object.assign({}, getTableHeaderProps()), /*#__PURE__*/React__default.createElement(TableHeader, null), extraHeader ? /*#__PURE__*/React__default.createElement("div", {
210
- style: {
211
- position: 'absolute',
212
- right: 0,
213
- zIndex: 11,
214
- bottom: 0,
215
- top: 0
216
- }
217
- }, extraHeader) : null), /*#__PURE__*/React__default.createElement(TableBody, {
218
- emptyContent: emptyContent
219
- })) : /*#__PURE__*/React__default.createElement("div", {
220
- ref: scrollBodyElementRef,
221
- className: prefixCls + "-content",
222
- onScroll: onTableBodyScroll,
223
- style: {
224
- // 表格宽度大于div宽度才出现横向滚动条
225
- overflowX: canScroll ? 'scroll' : undefined
226
- }
227
- }, /*#__PURE__*/React__default.createElement("table", {
228
- ref: bodyTableRef,
229
- style: {
230
- width: canScroll && scrollWidth !== undefined ? scrollWidth : '100%'
231
- }
232
- }, /*#__PURE__*/React__default.createElement(ColGroupContent, null), /*#__PURE__*/React__default.createElement(TheadContent, null), /*#__PURE__*/React__default.createElement(TbodyContent, {
233
- emptyContent: emptyContent
234
- })));
235
- };
236
-
237
- var renderFreezeShadow = function renderFreezeShadow() {
238
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, (alwaysFixedColumn || scrollSize.scrollLeft > 0) && leftFrozenColKeys.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
239
- className: prefixCls + "-freeze-shadow " + prefixCls + "-freeze-shadow--left",
240
- style: {
241
- width: leftFixedColumnsWidth + 'px'
242
- }
243
- }) : null, (alwaysFixedColumn || scrollSize.scrollRight > 0) && rightFrozenColKeys.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
244
- className: prefixCls + "-freeze-shadow " + prefixCls + "-freeze-shadow--right",
245
- style: {
246
- width: rightFixedColumnsWidth + 'px'
247
- }
248
- }) : null);
249
- };
250
-
251
- var tableFooter = /*#__PURE__*/React__default.createElement("div", {
252
- className: prefixCls + "-footer",
253
- style: stickyFooter ? {
254
- position: 'sticky',
255
- bottom: stickyFooterBottom
256
- } : undefined
257
- }, extraFooter);
258
177
  var cls = cx(prefixCls, className, hasBorder && prefixCls + "--bordered", striped && prefixCls + "--striped", size && prefixCls + "--size-" + size, virtual && prefixCls + "--virtual");
259
178
  return /*#__PURE__*/React__default.createElement("div", Object.assign({
260
179
  ref: ref,
@@ -278,7 +197,37 @@ var BaseTable = /*#__PURE__*/forwardRef(function (_a, ref) {
278
197
  hasSumColumn: hasSumColumn,
279
198
  virtual: virtual
280
199
  })
281
- }, renderTable()), renderFreezeShadow()), tableFooter);
200
+ }, /*#__PURE__*/React__default.createElement("div", Object.assign({}, getTableHeaderProps()), /*#__PURE__*/React__default.createElement(TableHeader, {
201
+ prefixCls: prefixCls + "-header"
202
+ }), extraHeader ? /*#__PURE__*/React__default.createElement("div", {
203
+ style: {
204
+ position: 'absolute',
205
+ right: 0,
206
+ zIndex: 11,
207
+ bottom: 0,
208
+ top: 0
209
+ }
210
+ }, extraHeader) : null), /*#__PURE__*/React__default.createElement(TableBody, {
211
+ prefixCls: prefixCls,
212
+ emptyContent: emptyContent
213
+ })), (alwaysFixedColumn || scrollSize.scrollLeft > 0) && leftFrozenColKeys.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
214
+ className: prefixCls + "-freeze-shadow " + prefixCls + "-freeze-shadow--left",
215
+ style: {
216
+ width: leftFixedColumnsWidth + 'px'
217
+ }
218
+ }) : null, (alwaysFixedColumn || scrollSize.scrollRight > 0) && rightFrozenColKeys.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
219
+ className: prefixCls + "-freeze-shadow " + prefixCls + "-freeze-shadow--right",
220
+ style: {
221
+ width: rightFixedColumnsWidth + 'px'
222
+ }
223
+ }) : null), /*#__PURE__*/React__default.createElement("div", {
224
+ className: prefixCls + "-footer",
225
+ style: stickyFooter ? {
226
+ position: 'sticky',
227
+ bottom: stickyFooterBottom // boxShadow: '0 5px 15px 0 rgba(0, 0, 0, 0.1)'
228
+
229
+ } : undefined
230
+ }, extraFooter));
282
231
  });
283
232
 
284
233
  if (__DEV__) {
package/lib/esm/Table.js CHANGED
@@ -27,13 +27,7 @@ import { uuid } from './utils/index.js';
27
27
  import { useColSet } from './hooks/use-col-set.js';
28
28
 
29
29
  var _prefix = getPrefixCls('table');
30
- /**
31
- * 需要使用双表格的场景对应的 API
32
- * 这些场景下的功能无法通过单表格实现,故而设计成双表格,即表头和表体分别用一个 table 实现
33
- */
34
-
35
30
 
36
- var DOUBLE_TABLE_SCENE = ['maxHeight', 'sticky', 'stickyTop', 'setting', 'virtual'];
37
31
  var STANDARD_PRESET = {
38
32
  striped: true,
39
33
  bordered: true,
@@ -52,6 +46,7 @@ var DEFAULT_PAGINATION = {
52
46
  */
53
47
 
54
48
  var Table = /*#__PURE__*/forwardRef(function (_a, ref) {
49
+ // ************************ 预置标准模式 ************************ //
55
50
  var _a$prefixCls = _a.prefixCls,
56
51
  prefixCls = _a$prefixCls === void 0 ? _prefix : _a$prefixCls,
57
52
  _a$standard = _a.standard,
@@ -74,13 +69,8 @@ var Table = /*#__PURE__*/forwardRef(function (_a, ref) {
74
69
  extra = _a.extra,
75
70
  _a$data = _a.data,
76
71
  data = _a$data === void 0 ? DEFAULT_DATA : _a$data,
77
- rest = __rest(_a, ["prefixCls", "standard", "loading", "dataSource", "pagination", "uniqueId", "columns", "hiddenColKeys", "onHiddenColKeysChange", "sortedColKeys", "onSortedColKeysChange", "checkDisabledColKeys", "onSetColKeysChange", "rowSelection", "fieldKey", "extra", "data"]); // 是否需要双表格
78
-
79
-
80
- var needDoubleTable = DOUBLE_TABLE_SCENE.some(function (prop) {
81
- return !!rest[prop];
82
- });
83
- var virtual = rest.virtual; // ************************ 预置标准模式 ************************ //
72
+ virtual = _a.virtual,
73
+ rest = __rest(_a, ["prefixCls", "standard", "loading", "dataSource", "pagination", "uniqueId", "columns", "hiddenColKeys", "onHiddenColKeysChange", "sortedColKeys", "onSortedColKeysChange", "checkDisabledColKeys", "onSetColKeysChange", "rowSelection", "fieldKey", "extra", "data", "virtual"]);
84
74
 
85
75
  var tableProps = withDefaultProps(rest, standard ? STANDARD_PRESET : undefined);
86
76
 
@@ -292,7 +282,6 @@ var Table = /*#__PURE__*/forwardRef(function (_a, ref) {
292
282
  data: mergedData,
293
283
  fieldKey: fieldKey,
294
284
  virtual: virtual,
295
- needDoubleTable: needDoubleTable,
296
285
  extra: Object.assign({
297
286
  header: setting ? /*#__PURE__*/React__default.createElement(TableSettingMenu, {
298
287
  prefixCls: prefixCls + "-setting",
@@ -13,10 +13,9 @@ import { getPrefixCls, cx } from '@hi-ui/classname';
13
13
  import { __DEV__ } from '@hi-ui/env';
14
14
  import { useLatestCallback } from '@hi-ui/use-latest';
15
15
  import { isArrayNonEmpty } from '@hi-ui/type-assertion';
16
+ import { EmptyState } from '@hi-ui/empty-state';
16
17
  import { TableRow } from './TableRow.js';
17
18
  import { useTableContext } from './context.js';
18
- import { ColGroupContent } from './ColGroupContent.js';
19
- import { renderEmptyContent, TbodyContent } from './TbodyContent.js';
20
19
  var _role = 'table';
21
20
 
22
21
  var _prefix = getPrefixCls(_role);
@@ -30,8 +29,10 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
30
29
 
31
30
  var _useTableContext = useTableContext(),
32
31
  columns = _useTableContext.columns,
32
+ leafColumns = _useTableContext.leafColumns,
33
33
  isExpandTreeRows = _useTableContext.isExpandTreeRows,
34
34
  transitionData = _useTableContext.transitionData,
35
+ getColgroupProps = _useTableContext.getColgroupProps,
35
36
  bodyTableRef = _useTableContext.bodyTableRef,
36
37
  scrollBodyElementRef = _useTableContext.scrollBodyElementRef,
37
38
  onTableBodyScroll = _useTableContext.onTableBodyScroll,
@@ -39,6 +40,10 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
39
40
  maxHeight = _useTableContext.maxHeight,
40
41
  canScroll = _useTableContext.canScroll,
41
42
  scrollWidth = _useTableContext.scrollWidth,
43
+ hasAvgColumn = _useTableContext.hasAvgColumn,
44
+ avgRow = _useTableContext.avgRow,
45
+ hasSumColumn = _useTableContext.hasSumColumn,
46
+ sumRow = _useTableContext.sumRow,
42
47
  colWidths = _useTableContext.colWidths,
43
48
  virtual = _useTableContext.virtual,
44
49
  measureRowElementRef = _useTableContext.measureRowElementRef;
@@ -151,11 +156,65 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
151
156
  style: {
152
157
  width: canScroll && scrollWidth !== undefined ? scrollWidth : '100%'
153
158
  }
154
- }, /*#__PURE__*/React__default.createElement(ColGroupContent, null), /*#__PURE__*/React__default.createElement(TbodyContent, null)));
159
+ }, /*#__PURE__*/React__default.createElement("colgroup", null, leafColumns.map(function (col, idx) {
160
+ return /*#__PURE__*/React__default.createElement("col", Object.assign({
161
+ key: idx,
162
+ className: prefixCls + "-col"
163
+ }, getColgroupProps(col, idx)));
164
+ })), /*#__PURE__*/React__default.createElement("tbody", null, isArrayNonEmpty(transitionData) ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, transitionData.map(function (row, index) {
165
+ return /*#__PURE__*/React__default.createElement(TableRow, Object.assign({
166
+ ref: index === 0 ? measureRowElementRef : null,
167
+ // key={depth + index}
168
+ key: row.id,
169
+ // @ts-ignore
170
+ rowIndex: index,
171
+ rowData: row
172
+ }, getRequiredProps(row.id)));
173
+ }), hasSumColumn ? /*#__PURE__*/React__default.createElement(TableRow, {
174
+ key: sumRow.id,
175
+ rowIndex: transitionData.length,
176
+ rowData: sumRow,
177
+ isSumRow: true
178
+ }) : null, hasAvgColumn ? /*#__PURE__*/React__default.createElement(TableRow, {
179
+ key: avgRow.id,
180
+ rowIndex: transitionData.length + 1,
181
+ rowData: avgRow,
182
+ isAvgRow: true
183
+ }) : null) : // 空状态,colSpan 占满表格整行
184
+ renderEmptyContent(Object.assign({
185
+ className: prefixCls + "-empty-content",
186
+ colSpan: columns.length,
187
+ emptyContent: emptyContent
188
+ }, scrollBodyElementRef.current ? {
189
+ scrollBodyWidth: window.getComputedStyle(scrollBodyElementRef.current).getPropertyValue('width')
190
+ } : {})))));
155
191
  });
156
192
 
157
193
  if (__DEV__) {
158
194
  TableBody.displayName = 'TableBody';
159
195
  }
196
+ /**
197
+ * 负责空状态渲染
198
+ */
199
+
200
+
201
+ var renderEmptyContent = function renderEmptyContent(_ref2) {
202
+ var className = _ref2.className,
203
+ colSpan = _ref2.colSpan,
204
+ emptyContent = _ref2.emptyContent,
205
+ scrollBodyWidth = _ref2.scrollBodyWidth;
206
+ return /*#__PURE__*/React__default.createElement("tr", {
207
+ className: className
208
+ }, /*#__PURE__*/React__default.createElement("td", {
209
+ colSpan: colSpan
210
+ }, /*#__PURE__*/React__default.createElement("div", {
211
+ style: {
212
+ position: 'sticky',
213
+ left: 0,
214
+ width: scrollBodyWidth !== null && scrollBodyWidth !== void 0 ? scrollBodyWidth : '100%',
215
+ overflow: 'hidden'
216
+ }
217
+ }, emptyContent || /*#__PURE__*/React__default.createElement(EmptyState, null))));
218
+ };
160
219
 
161
220
  export { TableBody };
@@ -8,11 +8,13 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
  import React__default, { forwardRef } from 'react';
11
+ import { Resizable } from 'react-resizable';
11
12
  import { getPrefixCls, cx } from '@hi-ui/classname';
12
13
  import { __DEV__ } from '@hi-ui/env';
14
+ import { isFunction } from '@hi-ui/type-assertion';
13
15
  import { useTableContext } from './context.js';
14
- import { ColGroupContent } from './ColGroupContent.js';
15
- import { TheadContent } from './TheadContent.js';
16
+ import { renderFilter } from './TableAdvancedFilter.js';
17
+ import { useCheckState } from '@hi-ui/use-check-state';
16
18
 
17
19
  var _prefix = getPrefixCls('table-header');
18
20
 
@@ -22,10 +24,21 @@ var TableHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
22
24
  className = _ref.className;
23
25
 
24
26
  var _useTableContext = useTableContext(),
27
+ groupedColumns = _useTableContext.groupedColumns,
28
+ resizable = _useTableContext.resizable,
29
+ colWidths = _useTableContext.colWidths,
30
+ isHoveredHighlightCol = _useTableContext.isHoveredHighlightCol,
31
+ isHighlightedCol = _useTableContext.isHighlightedCol,
32
+ getColgroupProps = _useTableContext.getColgroupProps,
33
+ onColumnResizable = _useTableContext.onColumnResizable,
34
+ getStickyColProps = _useTableContext.getStickyColProps,
25
35
  onTableBodyScrollMock = _useTableContext.onTableBodyScrollMock,
26
36
  scrollHeaderElementRef = _useTableContext.scrollHeaderElementRef,
27
- getTableHeaderProps = _useTableContext.getTableHeaderProps;
37
+ leafColumns = _useTableContext.leafColumns,
38
+ getTableHeaderProps = _useTableContext.getTableHeaderProps,
39
+ showColMenu = _useTableContext.showColMenu;
28
40
 
41
+ var activeColumnKeysAction = useCheckState();
29
42
  var cls = cx(prefixCls, className);
30
43
  return /*#__PURE__*/React__default.createElement("div", Object.assign({
31
44
  className: cls,
@@ -35,9 +48,60 @@ var TableHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
35
48
  width: '100%',
36
49
  position: 'relative'
37
50
  }
38
- }, /*#__PURE__*/React__default.createElement(ColGroupContent, null), /*#__PURE__*/React__default.createElement(TheadContent, {
51
+ }, /*#__PURE__*/React__default.createElement("colgroup", null, leafColumns.map(function (col, idx) {
52
+ return /*#__PURE__*/React__default.createElement("col", Object.assign({
53
+ key: idx,
54
+ className: prefixCls + "-col"
55
+ }, getColgroupProps(col, idx)));
56
+ })), /*#__PURE__*/React__default.createElement("thead", {
39
57
  onWheel: onTableBodyScrollMock
40
- })));
58
+ }, groupedColumns.map(function (cols, colsIndex) {
59
+ return /*#__PURE__*/React__default.createElement("tr", {
60
+ key: colsIndex
61
+ }, cols.map(function (col, colIndex) {
62
+ var _ref2 = col || {},
63
+ dataKey = _ref2.dataKey,
64
+ title = _ref2.title,
65
+ raw = _ref2.raw;
66
+
67
+ var titleContent = isFunction(title) ? title(col) : title;
68
+ var cell = /*#__PURE__*/React__default.createElement("th", Object.assign({
69
+ key: dataKey
70
+ }, getStickyColProps(col), {
71
+ className: cx(prefixCls + "-cell", raw.className, isHighlightedCol(dataKey) && prefixCls + "-cell__col--highlight", isHoveredHighlightCol(dataKey) && prefixCls + "-cell__col--hovered-highlight", activeColumnKeysAction.has(dataKey) && prefixCls + "-cell__col--active"),
72
+ // @ts-ignore
73
+ colSpan: col.colSpan,
74
+ // @ts-ignore
75
+ rowSpan: col.rowSpan
76
+ }), titleContent, renderFilter({
77
+ prefixCls: prefixCls + "-filter",
78
+ columnKey: dataKey,
79
+ showColMenu: showColMenu,
80
+ column: col,
81
+ onOpen: function onOpen() {
82
+ return activeColumnKeysAction.add(dataKey);
83
+ },
84
+ onClose: function onClose() {
85
+ return activeColumnKeysAction.remove(dataKey);
86
+ }
87
+ }));
88
+ return resizable && colIndex !== colWidths.length - 1 ? /*#__PURE__*/React__default.createElement(Resizable, {
89
+ key: colIndex,
90
+ className: prefixCls + "__resizable",
91
+ draggableOpts: {
92
+ enableUserSelectHack: false
93
+ },
94
+ handle: /*#__PURE__*/React__default.createElement("span", {
95
+ className: prefixCls + "__resizable-handle"
96
+ }),
97
+ height: 0,
98
+ width: colWidths[colIndex],
99
+ onResize: function onResize(evt, options) {
100
+ onColumnResizable(evt, options, colIndex);
101
+ }
102
+ }, cell) : cell;
103
+ }));
104
+ }))));
41
105
  });
42
106
 
43
107
  if (__DEV__) {
@@ -8,7 +8,7 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
  import __styleInject__ from 'style-inject';
11
- var css_248z = ".hi-v4-table {-webkit-box-sizing: border-box;box-sizing: border-box;font-size: 14px;position: relative; }.hi-v4-table table {width: 100%;text-align: left;background-color: var(--hi-v4-color-static-white, #fff);border-radius: 2px 2px 0 0;border-spacing: 0;border-collapse: separate;display: table;table-layout: fixed; }.hi-v4-table__wrapper {position: relative;z-index: 0; }.hi-v4-table__switcher.hi-v4-icon-button {color: var(--hi-v4-color-gray-500, #929aa6); }.hi-v4-table__switcher--expanded.hi-v4-icon-button {color: var(--hi-v4-color-primary-400, var(--hi-v4-color-brandblue-400, #4a9eff)); }.hi-v4-table--size-md table tbody > tr:not(.hi-v4-table-empty-content) > td {padding: var(--hi-v4-spacing-7, 14px); }.hi-v4-table--size-md table thead > tr > th {padding: var(--hi-v4-spacing-7, 14px); }.hi-v4-table--size-sm table tbody > tr:not(.hi-v4-table-empty-content) > td {padding: var(--hi-v4-spacing-5, 10px); }.hi-v4-table--size-sm table thead > tr > th {padding: var(--hi-v4-spacing-5, 10px); }.hi-v4-table--size-lg table tbody > tr:not(.hi-v4-table-empty-content) > td {padding: var(--hi-v4-spacing-9, 18px); }.hi-v4-table--size-lg table thead > tr > th {padding: var(--hi-v4-spacing-9, 18px); }.hi-v4-table--bordered table thead > tr > th {border-right: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }.hi-v4-table--bordered table td {border-right: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }.hi-v4-table--bordered .hi-v4-table-header {border-top: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }.hi-v4-table--bordered .hi-v4-table-body {border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0); }.hi-v4-table--sticky {position: -webkit-sticky;position: sticky;top: 0; }.hi-v4-table--virtual {width: 100%;overflow: hidden; }.hi-v4-table--virtual .hi-v4-table-cell {-webkit-box-sizing: border-box;box-sizing: border-box; }.hi-v4-table-header {position: relative;-webkit-box-sizing: border-box;box-sizing: border-box;overflow: hidden; }.hi-v4-table-header__resizable {position: relative;background-clip: padding-box; }.hi-v4-table-header__resizable-handle {-webkit-box-sizing: content-box;box-sizing: content-box;position: absolute;width: 2px;height: 100%;bottom: 0;right: 0;border-left: 2px solid var(--hi-v4-color-gray-50, #f5f7fa);cursor: col-resize;z-index: 1; }.hi-v4-table-header__resizable:hover .hi-v4-table-header__resizable-handle {background-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-table-header-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-header-cell.hi-v4-table-header-cell__col--highlight, .hi-v4-table-header-cell.hi-v4-table-header-cell__col--hovered-highlight, .hi-v4-table-header-cell.hi-v4-table-header-cell__col--active {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-table-header-cell.hi-v4-table-header-cell__col--highlight[data-sticky], .hi-v4-table-header-cell.hi-v4-table-header-cell__col--hovered-highlight[data-sticky], .hi-v4-table-header-cell.hi-v4-table-header-cell__col--active[data-sticky] {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-table-row--hover:hover > .hi-v4-table-cell {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-row--striped > .hi-v4-table-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-row--expanded > .hi-v4-table-cell {color: var(--hi-v4-color-gray-800, #1f2937); }.hi-v4-table-row--error > .hi-v4-table-cell {color: var(--hi-v4-color-danger-500, var(--hi-v4-color-red-500, #ff5959)); }.hi-v4-table-row--highlight > .hi-v4-table-cell {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-row--dragging > .hi-v4-table-cell {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-row--drag-top > .hi-v4-table-cell {border-top: 2px dashed var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-table-row--drag-bottom > .hi-v4-table-cell {border-bottom: 2px dashed var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-table-row--avg > .hi-v4-table-cell, .hi-v4-table-row--total > .hi-v4-table-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-row--avg:hover > .hi-v4-table-cell, .hi-v4-table-row--total:hover > .hi-v4-table-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-row--virtual {display: -webkit-box;display: -ms-flexbox;display: flex; }.hi-v4-table-header .hi-v4-table-header-col, .hi-v4-table-header .hi-v4-table-col {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-body .hi-v4-table-header-col[data-hover-highlight], .hi-v4-table-body .hi-v4-table-col[data-hover-highlight] {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-header .hi-v4-table-header-col[data-hover-highlight], .hi-v4-table-header .hi-v4-table-col[data-hover-highlight] {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-table-body, .hi-v4-table-content {position: relative;overflow: auto; }.hi-v4-table-header-cell {color: var(--hi-v4-color-gray-700, #1f2733);font-size: var(--hi-v4-text-size-md, 0.875rem);font-weight: var(--hi-v4-text-weight-medium, 500);line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-8, 16px);border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8); }.hi-v4-table-header-cell.hi-v4-table__embed-col, .hi-v4-table-header-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-5, 10px); }.hi-v4-table-cell {word-break: break-word;border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8);font-size: var(--hi-v4-text-size-md, 0.875rem);font-weight: var(--hi-v4-text-weight-normal, 400);color: var(--hi-v4-color-gray-700, #1f2733);line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-8, 16px);background-color: var(--hi-v4-color-static-white, #fff); }.hi-v4-table-cell__indent {display: inline-block;width: 14px;height: 100%;margin-right: var(--hi-v4-spacing-1, 2px); }.hi-v4-table-cell__switcher.hi-v4-icon-button {margin-right: var(--hi-v4-spacing-1, 2px);color: var(--hi-v4-color-gray-500, #929aa6); }.hi-v4-table-cell.hi-v4-table__embed-col, .hi-v4-table-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-5, 10px); }.hi-v4-table-cell.hi-v4-table-cell__col--highlight {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-cell.hi-v4-table-cell__col--hovered-highlight {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-freeze-shadow {position: absolute;top: 0;bottom: 0;z-index: 20;pointer-events: none;overflow: hidden;height: 100%;width: 200px; }.hi-v4-table-freeze-shadow--left {margin-right: 10px;left: 0;-webkit-box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.15);box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.15); }.hi-v4-table-freeze-shadow--right {margin-left: 10px;right: 0;-webkit-box-shadow: -6px 0 6px -4px rgba(0, 0, 0, 0.15);box-shadow: -6px 0 6px -4px rgba(0, 0, 0, 0.15); }.hi-v4-table-header-filter-dropdown__trigger.hi-v4-icon-button {margin-left: 4px; }.hi-v4-table-header-filter-dropdown__content {width: 124px;padding: var(--hi-v4-spacing-6, 12px) var(--hi-v4-spacing-4, 8px);font-weight: var(--hi-v4-text-weight-normal, 400); }.hi-v4-table-header-filter-dropdown__item {margin-top: var(--hi-v4-spacing-4, 8px);padding: var(--hi-v4-spacing-3, 6px) var(--hi-v4-spacing-4, 8px);border-radius: var(--hi-v4-border-radius-md, 4px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;-webkit-box-align: center;-ms-flex-align: center;align-items: center;cursor: pointer;color: var(--hi-v4-color-gray-700, #1f2733);font-size: var(--hi-v4-text-size-md, 0.875rem); }.hi-v4-table-header-filter-dropdown__item:first-child {margin-top: 0; }.hi-v4-table-header-filter-dropdown__item:hover {background-color: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-header-filter-dropdown__item--active {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-header-filter-dropdown__item--active:hover {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-header-filter-sorter {display: -webkit-inline-box;display: -ms-inline-flexbox;display: inline-flex;-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;height: 20px;vertical-align: middle;margin-left: 6px; }.hi-v4-table-header-filter-sorter__icon {display: inline-block;height: 8px;cursor: pointer;overflow: hidden;font-weight: var(--hi-v4-text-weight-normal, 400);color: var(--hi-v4-color-gray-500, #929aa6); }.hi-v4-table-header-filter-sorter__icon svg {position: relative;top: -5px; }.hi-v4-table-header-filter-sorter__icon--active {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-table-header-filter-custom__trigger {margin-left: 6px;color: var(--hi-v4-color-gray-500, #929aa6);cursor: pointer; }.hi-v4-table-header-filter-custom__content {padding: 12px 8px; }.hi-v4-table-embed-row {position: relative;z-index: 0; }.hi-v4-table-embed-row > td {background-color: var(--hi-v4-color-gray-200, #ebedf0);padding: var(--hi-v4-spacing-10, 20px); }.hi-v4-table-setting {position: absolute;height: 100%;z-index: 11;-webkit-box-sizing: border-box;box-sizing: border-box;right: 0;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8);border-bottom: none;border-top: none;color: var(--hi-v4-color-gray-500, #929aa6);cursor: pointer;font-size: var(--hi-v4-text-size-sm, 0.75rem);width: 18px;background: var(--hi-v4-color-gray-50, #f5f7fa); }.hi-v4-table-setting__btn-group {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: end;-ms-flex-pack: end;justify-content: flex-end; }.hi-v4-table-setting-item {position: relative;padding-top: var(--hi-v4-spacing-1, 2px);padding-bottom: var(--hi-v4-spacing-1, 2px);-webkit-box-sizing: border-box;box-sizing: border-box; }.hi-v4-table-setting-item__wrap {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;cursor: move;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-orient: horizontal;-webkit-box-direction: normal;-ms-flex-direction: row;flex-direction: row;padding: var(--hi-v4-spacing-3, 6px) var(--hi-v4-spacing-4, 8px);line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);border-radius: var(--hi-v4-border-radius-md, 4px); }.hi-v4-table-setting-item__wrap:hover {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-table-setting-item--dragging .hi-v4-table-setting-item__wrap {opacity: 0.6; }.hi-v4-table-setting-item::before {position: absolute;left: 0;z-index: 9999;display: none;-webkit-box-sizing: border-box;box-sizing: border-box;width: 8px;height: 8px;content: '';background-color: var(--hi-v4-color-static-white, #fff);border: 1px solid var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));border-radius: 100%; }.hi-v4-table-setting-item::after {position: absolute;content: '';z-index: 9998;display: block;-webkit-box-sizing: border-box;box-sizing: border-box;border-bottom-width: 0;border-bottom-style: solid;border-bottom-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));left: 0;width: 100%; }.hi-v4-table-setting-item::before, .hi-v4-table-setting-item::after {margin-left: -10px;margin-right: -10px; }.hi-v4-table-setting-item--direction-before::before {display: block;top: -0.5px;-webkit-transform: translateY(-4px);transform: translateY(-4px); }.hi-v4-table-setting-item--direction-before::after {top: -0.5px;border-bottom-width: 1px; }.hi-v4-table-setting-item--direction-after::before {display: block;bottom: 0.5px;-webkit-transform: translateY(4px);transform: translateY(4px); }.hi-v4-table-setting-item--direction-after::after {bottom: 0.5px;border-bottom-width: 1px; }.hi-v4-table-pagination {display: -webkit-box;display: -ms-flexbox;display: flex;-ms-flex-wrap: wrap;flex-wrap: wrap;row-gap: 8px;padding: var(--hi-v4-spacing-6, 12px) 0;background-color: var(--hi-v4-color-static-white, #fff); }.hi-v4-table-pagination--placement-left {-webkit-box-pack: start;-ms-flex-pack: start;justify-content: flex-start; }.hi-v4-table-pagination--placement-right {-webkit-box-pack: end;-ms-flex-pack: end;justify-content: flex-end; }.hi-v4-table-pagination--placement-middle {-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center; }.hi-v4-table-empty-content td {text-align: center;padding: var(--hi-v4-spacing-12, 24px) 0; }.hi-v4-table--bordered .hi-v4-table-empty-content td {border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8); }.hi-v4-setting-drawer .hi-v4-setting__btn-group {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: end;-ms-flex-pack: end;justify-content: flex-end; }.hi-v4-setting-item {position: relative;padding-top: var(--hi-v4-spacing-1, 2px);padding-bottom: var(--hi-v4-spacing-1, 2px);-webkit-box-sizing: border-box;box-sizing: border-box; }.hi-v4-setting-item__wrap {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;cursor: move;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-orient: horizontal;-webkit-box-direction: normal;-ms-flex-direction: row;flex-direction: row;padding: var(--hi-v4-spacing-3, 6px) var(--hi-v4-spacing-4, 8px);line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);border-radius: var(--hi-v4-border-radius-md, 4px); }.hi-v4-setting-item__wrap:hover {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-setting-item--dragging .hi-v4-setting-item__wrap {opacity: 0.6; }.hi-v4-setting-item::before {position: absolute;left: 0;z-index: 9999;display: none;-webkit-box-sizing: border-box;box-sizing: border-box;width: 8px;height: 8px;content: '';background-color: var(--hi-v4-color-static-white, #fff);border: 1px solid var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));border-radius: 100%; }.hi-v4-setting-item::after {position: absolute;content: '';z-index: 9998;display: block;-webkit-box-sizing: border-box;box-sizing: border-box;border-bottom-width: 0;border-bottom-style: solid;border-bottom-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));left: 0;width: 100%; }.hi-v4-setting-item::before, .hi-v4-setting-item::after {margin-left: -10px;margin-right: -10px; }.hi-v4-setting-item--direction-before::before {display: block;top: -0.5px;-webkit-transform: translateY(-4px);transform: translateY(-4px); }.hi-v4-setting-item--direction-before::after {top: -0.5px;border-bottom-width: 1px; }.hi-v4-setting-item--direction-after::before {display: block;bottom: 0.5px;-webkit-transform: translateY(4px);transform: translateY(4px); }.hi-v4-setting-item--direction-after::after {bottom: 0.5px;border-bottom-width: 1px; }";
11
+ var css_248z = ".hi-v4-table {-webkit-box-sizing: border-box;box-sizing: border-box;font-size: 14px;position: relative;}.hi-v4-table table {width: 100%;text-align: left;background-color: var(--hi-v4-color-static-white, #fff);border-radius: 2px 2px 0 0;border-spacing: 0;border-collapse: separate;display: table;table-layout: fixed;}.hi-v4-table__wrapper {position: relative;z-index: 0;}.hi-v4-table__switcher.hi-v4-icon-button {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-table__switcher--expanded.hi-v4-icon-button {color: var(--hi-v4-color-primary-400, var(--hi-v4-color-brandblue-400, #4a9eff));}.hi-v4-table--size-md table tbody > tr:not(.hi-v4-table-empty-content) > td {padding: var(--hi-v4-spacing-7, 14px);}.hi-v4-table--size-md table tbody > tr:not(.hi-v4-table-empty-content) > td.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-md table thead > tr > th {padding: var(--hi-v4-spacing-7, 14px);}.hi-v4-table--size-md table thead > tr > th.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-sm table tbody > tr:not(.hi-v4-table-empty-content) > td {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-sm table tbody > tr:not(.hi-v4-table-empty-content) > td.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-sm table thead > tr > th {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-sm table thead > tr > th.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-lg table tbody > tr:not(.hi-v4-table-empty-content) > td {padding: var(--hi-v4-spacing-9, 18px);}.hi-v4-table--size-lg table tbody > tr:not(.hi-v4-table-empty-content) > td.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-9, 18px) var(--hi-v4-spacing-5, 10px);}.hi-v4-table--size-lg table thead > tr > th {padding: var(--hi-v4-spacing-9, 18px);}.hi-v4-table--size-lg table thead > tr > th.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-9, 18px) var(--hi-v4-spacing-5, 10px);}.hi-v4-table--bordered table thead > tr > th {border-right: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table--bordered table td {border-right: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table--bordered .hi-v4-table-header {border-top: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table--bordered .hi-v4-table-body {border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-200, #ebedf0);}.hi-v4-table--sticky {position: -webkit-sticky;position: sticky;top: 0;}.hi-v4-table--virtual {width: 100%;overflow: hidden;}.hi-v4-table--virtual .hi-v4-table-cell {-webkit-box-sizing: border-box;box-sizing: border-box;}.hi-v4-table-header {position: relative;-webkit-box-sizing: border-box;box-sizing: border-box;overflow: hidden;}.hi-v4-table-header__resizable {position: relative;background-clip: padding-box;}.hi-v4-table-header__resizable-handle {-webkit-box-sizing: content-box;box-sizing: content-box;position: absolute;width: 2px;height: 100%;bottom: 0;right: 0;border-left: 2px solid var(--hi-v4-color-gray-50, #f5f7fa);cursor: col-resize;z-index: 1;}.hi-v4-table-header__resizable:hover .hi-v4-table-header__resizable-handle {background-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-table-header-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa);color: var(--hi-v4-color-gray-700, #1f2733);font-size: var(--hi-v4-text-size-md, 0.875rem);font-weight: var(--hi-v4-text-weight-medium, 500);line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-8, 16px);border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8);}.hi-v4-table-header-cell.hi-v4-table__embed-col, .hi-v4-table-header-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-5, 10px);}.hi-v4-table-header-cell.hi-v4-table-header-cell__col--highlight, .hi-v4-table-header-cell.hi-v4-table-header-cell__col--hovered-highlight, .hi-v4-table-header-cell.hi-v4-table-header-cell__col--active {background-color: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-table-header-cell.hi-v4-table-header-cell__col--highlight[data-sticky], .hi-v4-table-header-cell.hi-v4-table-header-cell__col--hovered-highlight[data-sticky], .hi-v4-table-header-cell.hi-v4-table-header-cell__col--active[data-sticky] {background-color: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-table-row--hover:hover > .hi-v4-table-cell {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-table-row--striped > .hi-v4-table-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa);}.hi-v4-table-row--expanded > .hi-v4-table-cell {color: var(--hi-v4-color-gray-800, #1f2937);}.hi-v4-table-row--error > .hi-v4-table-cell {color: var(--hi-v4-color-danger-500, var(--hi-v4-color-red-500, #ff5959));}.hi-v4-table-row--highlight > .hi-v4-table-cell {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-table-row--dragging > .hi-v4-table-cell {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-table-row--drag-top > .hi-v4-table-cell {border-top: 2px dashed var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-table-row--drag-bottom > .hi-v4-table-cell {border-bottom: 2px dashed var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-table-row--avg > .hi-v4-table-cell, .hi-v4-table-row--total > .hi-v4-table-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa);}.hi-v4-table-row--avg:hover > .hi-v4-table-cell, .hi-v4-table-row--total:hover > .hi-v4-table-cell {background-color: var(--hi-v4-color-gray-50, #f5f7fa);}.hi-v4-table-row--virtual {display: -webkit-box;display: -ms-flexbox;display: flex;}.hi-v4-table-header .hi-v4-table-header-col, .hi-v4-table-header .hi-v4-table-col {background-color: var(--hi-v4-color-gray-50, #f5f7fa);}.hi-v4-table-body .hi-v4-table-header-col[data-hover-highlight], .hi-v4-table-body .hi-v4-table-col[data-hover-highlight] {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-table-header .hi-v4-table-header-col[data-hover-highlight], .hi-v4-table-header .hi-v4-table-col[data-hover-highlight] {background-color: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-table-body {position: relative;overflow: auto;}.hi-v4-table-cell {word-break: break-word;border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8);font-size: var(--hi-v4-text-size-md, 0.875rem);font-weight: var(--hi-v4-text-weight-normal, 400);color: var(--hi-v4-color-gray-700, #1f2733);line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-8, 16px);background-color: var(--hi-v4-color-static-white, #fff);}.hi-v4-table-cell__indent {display: inline-block;width: 14px;height: 100%;margin-right: var(--hi-v4-spacing-1, 2px);}.hi-v4-table-cell__switcher.hi-v4-icon-button {margin-right: var(--hi-v4-spacing-1, 2px);color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-table-cell.hi-v4-table__embed-col, .hi-v4-table-cell.hi-v4-table__selection-col {padding: var(--hi-v4-spacing-7, 14px) var(--hi-v4-spacing-5, 10px);}.hi-v4-table-cell.hi-v4-table-cell__col--highlight {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-table-cell.hi-v4-table-cell__col--hovered-highlight {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-table-freeze-shadow {position: absolute;top: 0;bottom: 0;z-index: 20;pointer-events: none;overflow: hidden;height: 100%;width: 200px;}.hi-v4-table-freeze-shadow--left {margin-right: 10px;left: 0;-webkit-box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.15);box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.15);}.hi-v4-table-freeze-shadow--right {margin-left: 10px;right: 0;-webkit-box-shadow: -6px 0 6px -4px rgba(0, 0, 0, 0.15);box-shadow: -6px 0 6px -4px rgba(0, 0, 0, 0.15);}.hi-v4-table-header-filter-dropdown__trigger.hi-v4-icon-button {margin-left: 4px;}.hi-v4-table-header-filter-dropdown__content {width: 124px;padding: var(--hi-v4-spacing-6, 12px) var(--hi-v4-spacing-4, 8px);font-weight: var(--hi-v4-text-weight-normal, 400);}.hi-v4-table-header-filter-dropdown__item {margin-top: var(--hi-v4-spacing-4, 8px);padding: var(--hi-v4-spacing-3, 6px) var(--hi-v4-spacing-4, 8px);border-radius: var(--hi-v4-border-radius-md, 4px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;-webkit-box-align: center;-ms-flex-align: center;align-items: center;cursor: pointer;color: var(--hi-v4-color-gray-700, #1f2733);font-size: var(--hi-v4-text-size-md, 0.875rem);}.hi-v4-table-header-filter-dropdown__item:first-child {margin-top: 0;}.hi-v4-table-header-filter-dropdown__item:hover {background-color: var(--hi-v4-color-gray-50, #f5f7fa);}.hi-v4-table-header-filter-dropdown__item--active {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-table-header-filter-dropdown__item--active:hover {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-table-header-filter-sorter {display: -webkit-inline-box;display: -ms-inline-flexbox;display: inline-flex;-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;height: 20px;vertical-align: middle;margin-left: 6px;}.hi-v4-table-header-filter-sorter__icon {display: inline-block;height: 8px;cursor: pointer;overflow: hidden;font-weight: var(--hi-v4-text-weight-normal, 400);color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-table-header-filter-sorter__icon svg {position: relative;top: -5px;}.hi-v4-table-header-filter-sorter__icon--active {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-table-header-filter-custom__trigger {margin-left: 6px;color: var(--hi-v4-color-gray-500, #929aa6);cursor: pointer;}.hi-v4-table-header-filter-custom__content {padding: 12px 8px;}.hi-v4-table-embed-row {position: relative;z-index: 0;}.hi-v4-table-embed-row > td {background-color: var(--hi-v4-color-gray-200, #ebedf0);padding: var(--hi-v4-spacing-10, 20px);}.hi-v4-table-setting {position: absolute;height: 100%;z-index: 11;-webkit-box-sizing: border-box;box-sizing: border-box;right: 0;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;border-left: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8);border-bottom: none;border-top: none;color: var(--hi-v4-color-gray-500, #929aa6);cursor: pointer;font-size: var(--hi-v4-text-size-sm, 0.75rem);width: 18px;background: var(--hi-v4-color-gray-50, #f5f7fa);}.hi-v4-table-setting__btn-group {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: end;-ms-flex-pack: end;justify-content: flex-end;}.hi-v4-table-setting-item {position: relative;padding-top: var(--hi-v4-spacing-1, 2px);padding-bottom: var(--hi-v4-spacing-1, 2px);-webkit-box-sizing: border-box;box-sizing: border-box;}.hi-v4-table-setting-item__wrap {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;cursor: move;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-orient: horizontal;-webkit-box-direction: normal;-ms-flex-direction: row;flex-direction: row;padding: var(--hi-v4-spacing-3, 6px) var(--hi-v4-spacing-4, 8px);line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);border-radius: var(--hi-v4-border-radius-md, 4px);}.hi-v4-table-setting-item__wrap:hover {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-table-setting-item--dragging .hi-v4-table-setting-item__wrap {opacity: 0.6;}.hi-v4-table-setting-item::before {position: absolute;left: 0;z-index: 9999;display: none;-webkit-box-sizing: border-box;box-sizing: border-box;width: 8px;height: 8px;content: \"\";background-color: var(--hi-v4-color-static-white, #fff);border: 1px solid var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));border-radius: 100%;}.hi-v4-table-setting-item::after {position: absolute;content: \"\";z-index: 9998;display: block;-webkit-box-sizing: border-box;box-sizing: border-box;border-bottom-width: 0;border-bottom-style: solid;border-bottom-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));left: 0;width: 100%;}.hi-v4-table-setting-item::before, .hi-v4-table-setting-item::after {margin-left: -10px;margin-right: -10px;}.hi-v4-table-setting-item--direction-before::before {display: block;top: -0.5px;-webkit-transform: translateY(-4px);transform: translateY(-4px);}.hi-v4-table-setting-item--direction-before::after {top: -0.5px;border-bottom-width: 1px;}.hi-v4-table-setting-item--direction-after::before {display: block;bottom: 0.5px;-webkit-transform: translateY(4px);transform: translateY(4px);}.hi-v4-table-setting-item--direction-after::after {bottom: 0.5px;border-bottom-width: 1px;}.hi-v4-table-pagination {display: -webkit-box;display: -ms-flexbox;display: flex;-ms-flex-wrap: wrap;flex-wrap: wrap;row-gap: 8px;padding: var(--hi-v4-spacing-6, 12px) 0;background-color: var(--hi-v4-color-static-white, #fff);}.hi-v4-table-pagination--placement-left {-webkit-box-pack: start;-ms-flex-pack: start;justify-content: flex-start;}.hi-v4-table-pagination--placement-right {-webkit-box-pack: end;-ms-flex-pack: end;justify-content: flex-end;}.hi-v4-table-pagination--placement-middle {-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;}.hi-v4-table-empty-content td {text-align: center;padding: var(--hi-v4-spacing-12, 24px) 0;}.hi-v4-table--bordered .hi-v4-table-empty-content td {border-bottom: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-gray-300, #dfe2e8);}.hi-v4-setting-drawer .hi-v4-setting__btn-group {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: end;-ms-flex-pack: end;justify-content: flex-end;}.hi-v4-setting-item {position: relative;padding-top: var(--hi-v4-spacing-1, 2px);padding-bottom: var(--hi-v4-spacing-1, 2px);-webkit-box-sizing: border-box;box-sizing: border-box;}.hi-v4-setting-item__wrap {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;cursor: move;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-orient: horizontal;-webkit-box-direction: normal;-ms-flex-direction: row;flex-direction: row;padding: var(--hi-v4-spacing-3, 6px) var(--hi-v4-spacing-4, 8px);line-height: var(--hi-v4-text-lineheight-sm, 1.25rem);border-radius: var(--hi-v4-border-radius-md, 4px);}.hi-v4-setting-item__wrap:hover {background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));}.hi-v4-setting-item--dragging .hi-v4-setting-item__wrap {opacity: 0.6;}.hi-v4-setting-item::before {position: absolute;left: 0;z-index: 9999;display: none;-webkit-box-sizing: border-box;box-sizing: border-box;width: 8px;height: 8px;content: \"\";background-color: var(--hi-v4-color-static-white, #fff);border: 1px solid var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));border-radius: 100%;}.hi-v4-setting-item::after {position: absolute;content: \"\";z-index: 9998;display: block;-webkit-box-sizing: border-box;box-sizing: border-box;border-bottom-width: 0;border-bottom-style: solid;border-bottom-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));left: 0;width: 100%;}.hi-v4-setting-item::before, .hi-v4-setting-item::after {margin-left: -10px;margin-right: -10px;}.hi-v4-setting-item--direction-before::before {display: block;top: -0.5px;-webkit-transform: translateY(-4px);transform: translateY(-4px);}.hi-v4-setting-item--direction-before::after {top: -0.5px;border-bottom-width: 1px;}.hi-v4-setting-item--direction-after::before {display: block;bottom: 0.5px;-webkit-transform: translateY(4px);transform: translateY(4px);}.hi-v4-setting-item--direction-after::after {bottom: 0.5px;border-bottom-width: 1px;}";
12
12
 
13
13
  __styleInject__(css_248z);
14
14