@arim-aisdc/public-components 2.3.50 → 2.3.51

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.
@@ -50,9 +50,9 @@ export var Total = function Total(_ref2) {
50
50
  };
51
51
  var cellWrapperStyle = {
52
52
  boxSizing: 'border-box',
53
+ height: "".concat(rowHeight, "px"),
53
54
  borderTop: '1px solid var(--tableColor2)',
54
- borderBottom: '1px solid var(--tableColor2)',
55
- height: "100%"
55
+ borderBottom: '1px solid var(--tableColor2)'
56
56
  };
57
57
 
58
58
  // 统一的单元格渲染函数
@@ -18,7 +18,6 @@ export var ColGroup = function ColGroup(_ref) {
18
18
  };
19
19
  var _useVirtualConfig = useVirtualConfig(),
20
20
  openVirtualColumns = _useVirtualConfig.openVirtualColumns;
21
- console.log(scrollableColumns, rightPinnedColumns, virtualColumns, virtualPaddingLeft, virtualPaddingRight, 'leftPinnedColumns');
22
21
  return /*#__PURE__*/_jsxs("colgroup", {
23
22
  children: [leftPinnedColumns === null || leftPinnedColumns === void 0 ? void 0 : leftPinnedColumns.map(renderColumn), !openVirtualColumns ? scrollableColumns.map(renderColumn) : /*#__PURE__*/_jsxs(_Fragment, {
24
23
  children: [Number(virtualPaddingLeft) > 0 && /*#__PURE__*/_jsx("col", {
@@ -206,7 +206,7 @@ var TableMax = function TableMax(_ref) {
206
206
  _ref$openVirtualColum = _ref.openVirtualColumns,
207
207
  openVirtualColumns = _ref$openVirtualColum === void 0 ? false : _ref$openVirtualColum,
208
208
  _ref$openVirtualRows = _ref.openVirtualRows,
209
- openVirtualRows = _ref$openVirtualRows === void 0 ? true : _ref$openVirtualRows;
209
+ openVirtualRows = _ref$openVirtualRows === void 0 ? false : _ref$openVirtualRows;
210
210
  var tableMaxRef = useRef(null);
211
211
  // 表格元素
212
212
  var tableContentRef = useRef(null);
@@ -528,6 +528,7 @@ var TableMax = function TableMax(_ref) {
528
528
  setheaderRowNum(cacheHeaderRowNum);
529
529
  }
530
530
  setCompactMode(cacheCompactMode === true);
531
+ setRowHeight(cacheCompactMode === true ? compactModeRowHeight : propsRowHeight);
531
532
  var newColumnVisibleConfig = _objectSpread(_objectSpread({}, columnVisibleConfig), cacheColumnVisibility);
532
533
  setColumnVisibility(newColumnVisibleConfig);
533
534
 
@@ -1114,10 +1115,8 @@ var TableMax = function TableMax(_ref) {
1114
1115
  };
1115
1116
  var changeCompactMode = function changeCompactMode() {
1116
1117
  setCompactMode(!compactMode);
1118
+ setRowHeight(!compactMode ? compactModeRowHeight : propsRowHeight);
1117
1119
  };
1118
- useUpdateEffect(function () {
1119
- setRowHeight(compactMode ? compactModeRowHeight : propsRowHeight);
1120
- }, [propsRowHeight, compactMode]);
1121
1120
  var virtualConfig = useMemo(function () {
1122
1121
  return {
1123
1122
  openVirtualColumns: openVirtualColumns,
@@ -1306,15 +1305,13 @@ var TableMax = function TableMax(_ref) {
1306
1305
  ref: tableContentRef
1307
1306
  // style={{ maxHeight: !autoHeight ? defaultScrollY : 'fit-content' }}
1308
1307
  ,
1309
- children: [/*#__PURE__*/_jsxs("div", {
1308
+ children: [/*#__PURE__*/_jsx("div", {
1310
1309
  className: "table-header-wrapper",
1311
- children: [/*#__PURE__*/_jsx("div", {
1310
+ children: /*#__PURE__*/_jsx("div", {
1312
1311
  ref: tableHeaderRef,
1313
1312
  className: "table-header",
1314
1313
  children: /*#__PURE__*/_jsx(TableHeader, _objectSpread({}, tableHeaderProps))
1315
- }), /*#__PURE__*/_jsx("div", {
1316
- className: "table-header-scroll"
1317
- })]
1314
+ })
1318
1315
  }), /*#__PURE__*/_jsx("div", {
1319
1316
  ref: tableBodyRef,
1320
1317
  className: "table-body"
@@ -16,18 +16,19 @@ export var useVirtualCalculations = function useVirtualCalculations(table, confi
16
16
  // 列虚拟化配置
17
17
  var columnVirtualizerConfig = useMemo(function () {
18
18
  if (!config.openVirtualColumns) return null;
19
+ console.log('columnVirtualizerConfig');
19
20
  return {
20
21
  count: scrollableColumns.length,
21
22
  estimateSize: function estimateSize(index) {
22
23
  return scrollableColumns[index].getSize();
23
24
  },
24
25
  getScrollElement: function getScrollElement() {
25
- return tableBodyRef.current;
26
+ return tableHeaderRef.current;
26
27
  },
27
28
  horizontal: true,
28
29
  overscan: config.columnOverscan || 3
29
30
  };
30
- }, [config.openVirtualColumns, scrollableColumns.length, config.columnOverscan, tableBodyRef.current]);
31
+ }, [config.openVirtualColumns, scrollableColumns.length, config.columnOverscan, tableHeaderRef.current]);
31
32
  var columnVirtualizer = columnVirtualizerConfig ? useVirtualizer(columnVirtualizerConfig) : null;
32
33
  var virtualColumns = config.openVirtualColumns ? (columnVirtualizer === null || columnVirtualizer === void 0 ? void 0 : columnVirtualizer.getVirtualItems()) || [] : [];
33
34
  var _useMemo2 = useMemo(function () {
@@ -83,14 +84,6 @@ export var useVirtualCalculations = function useVirtualCalculations(table, confi
83
84
  };
84
85
  };
85
86
  export var separateColumns = function separateColumns(table, openVirtualColumns) {
86
- // if (!openVirtualColumns) {
87
- // return {
88
- // leftPinnedColumns: [],
89
- // rightPinnedColumns: [],
90
- // scrollableColumns: visibleColumns,
91
- // };
92
- // }
93
-
94
87
  return {
95
88
  leftPinnedColumns: table.getLeftVisibleLeafColumns(),
96
89
  rightPinnedColumns: table.getRightVisibleLeafColumns(),
@@ -134,11 +134,11 @@
134
134
  overflow: hidden;
135
135
  box-sizing: border-box;
136
136
  height: fit-content;
137
- width: calc(100% - 10px);
137
+ // width: calc(100% - 10px);
138
138
  margin: 0;
139
139
  // flex: 1;
140
140
  justify-content: space-between;
141
- // overflow-y: scroll;
141
+ overflow-y: scroll;
142
142
  .cell-wapper {
143
143
  line-height: @global-table-max-header-cell-wapper-line-height;
144
144
  }
@@ -290,7 +290,7 @@
290
290
  line-height: 30px !important;
291
291
 
292
292
  .table-max-cell-wrapper {
293
- padding: 0 2px;
293
+ padding: 1px 2px;
294
294
  line-height: 28px;
295
295
  }
296
296
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arim-aisdc/public-components",
3
- "version": "2.3.50",
3
+ "version": "2.3.51",
4
4
  "description": "前端组件库",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",