@infinite-table/infinite-react 0.3.12 → 0.3.15

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/index.esm.js CHANGED
@@ -636,11 +636,11 @@ function debounce(fn, { wait }) {
636
636
  // src/components/InfiniteTable/index.tsx
637
637
  import {
638
638
  StrictMode,
639
- createElement as createElement26,
639
+ createElement as createElement28,
640
640
  memo as memo11,
641
641
  useEffect as useEffect26
642
642
  } from "react";
643
- import { useCallback as useCallback16, useEffect as useEffect27, useState as useState15 } from "react";
643
+ import { useCallback as useCallback18, useEffect as useEffect27, useState as useState16 } from "react";
644
644
 
645
645
  // src/utils/join.ts
646
646
  var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
@@ -690,13 +690,16 @@ import {
690
690
  useLayoutEffect,
691
691
  useCallback
692
692
  } from "react";
693
- var setupResizeObserver = (node, callback) => {
693
+ var setupResizeObserver = (node, callback, config = { debounce: 0 }) => {
694
+ var _a;
695
+ const debounceTime = (_a = config.debounce) != null ? _a : 0;
694
696
  const RO = window.ResizeObserver;
697
+ const onResizeCallback = debounceTime ? debounce(callback, { wait: debounceTime }) : callback;
695
698
  const observer = new RO((entries) => {
696
- var _a;
699
+ var _a2;
697
700
  const entry = entries[0];
698
701
  let { width, height } = entry.contentRect;
699
- if ((_a = entry.borderBoxSize) == null ? void 0 : _a[0]) {
702
+ if ((_a2 = entry.borderBoxSize) == null ? void 0 : _a2[0]) {
700
703
  height = entry.borderBoxSize[0].blockSize;
701
704
  width = entry.borderBoxSize[0].inlineSize;
702
705
  } else {
@@ -704,14 +707,17 @@ var setupResizeObserver = (node, callback) => {
704
707
  height = rect.height;
705
708
  width = rect.width;
706
709
  }
707
- callback({ width, height });
710
+ onResizeCallback({ width, height });
708
711
  });
709
712
  observer.observe(node);
710
713
  return () => {
711
714
  observer.disconnect();
712
715
  };
713
716
  };
714
- var useResizeObserver = (ref, callback, config = { earlyAttach: false }) => {
717
+ var useResizeObserver = (ref, callback, config = {
718
+ earlyAttach: false,
719
+ debounce: 0
720
+ }) => {
715
721
  const sizeRef = useRef({
716
722
  width: 0,
717
723
  height: 0
@@ -729,7 +735,7 @@ var useResizeObserver = (ref, callback, config = { earlyAttach: false }) => {
729
735
  sizeRef.current = size;
730
736
  callback2(size);
731
737
  }
732
- });
738
+ }, { debounce: config.debounce });
733
739
  }
734
740
  return () => {
735
741
  if (disconnect) {
@@ -743,7 +749,7 @@ var useResizeObserver = (ref, callback, config = { earlyAttach: false }) => {
743
749
  }
744
750
  return () => {
745
751
  };
746
- }, [ref.current, callback, config.earlyAttach]);
752
+ }, [ref.current, callback, config.earlyAttach, config.debounce]);
747
753
  useLayoutEffect(() => {
748
754
  if (config.earlyAttach) {
749
755
  return effectFn(callback);
@@ -872,7 +878,7 @@ import {
872
878
  useCallback as useCallback4,
873
879
  useEffect as useEffect7,
874
880
  useRef as useRef7,
875
- useState as useState5
881
+ useState as useState4
876
882
  } from "react";
877
883
 
878
884
  // src/components/VirtualList/SpacePlaceholder.tsx
@@ -1088,6 +1094,73 @@ var cancelRaf = getGlobal().cancelAnimationFrame || ((timeoutId) => {
1088
1094
  return clearTimeout(timeoutId);
1089
1095
  });
1090
1096
 
1097
+ // src/utils/stripVar.ts
1098
+ function stripVar(cssVariableWithVarString) {
1099
+ return cssVariableWithVarString.slice(4, -1);
1100
+ }
1101
+
1102
+ // src/components/InfiniteTable/theme.css.ts
1103
+ var InternalVars = { currentColumnWidth: "var(--_1slvgu90)", currentColumnTransformX: "var(--_1slvgu91)", currentColumnTransformY: "var(--_1slvgu92)", activeCellRowOffset: "var(--_1slvgu93)", activeCellRowHeight: "var(--_1slvgu94)", activeCellOffsetX: "var(--_1slvgu95)", activeCellOffsetY: "var(--_1slvgu96)", scrollLeftForActiveCell: "var(--_1slvgu97)", scrollTopForActiveCell: "var(--_1slvgu98)", activeCellColWidth: "var(--_1slvgu99)", activeCellColOffset: "var(--_1slvgu9a)", columnWidthAtIndex: "var(--_1slvgu9b)", columnOffsetAtIndex: "var(--_1slvgu9c)" };
1104
+ var ThemeVars = { color: { accent: "var(--infinite-accent-color)", error: "var(--infinite-error-color)", color: "var(--infinite-color)" }, spacing: { "0": "var(--infinite-space-0)", "1": "var(--infinite-space-1)", "2": "var(--infinite-space-2)", "3": "var(--infinite-space-3)", "4": "var(--infinite-space-4)", "5": "var(--infinite-space-5)", "6": "var(--infinite-space-6)", "7": "var(--infinite-space-7)", "8": "var(--infinite-space-8)", "9": "var(--infinite-space-9)", "10": "var(--infinite-space-10)" }, fontSize: { "0": "var(--infinite-font-size-0)", "1": "var(--infinite-font-size-1)", "2": "var(--infinite-font-size-2)", "3": "var(--infinite-font-size-3)", "4": "var(--infinite-font-size-4)", "5": "var(--infinite-font-size-5)", "6": "var(--infinite-font-size-6)", "7": "var(--infinite-font-size-7)" }, fontFamily: "var(--infinite-font-family)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", background: "var(--infinite-background)", components: { LoadMask: { padding: "var(--infinite-load-mask-padding)", color: "var(--infinite-load-mask-color)", textBackground: "var(--infinite-load-mask-text-background)", overlayBackground: "var(--infinite-load-mask-overlay-background)", overlayOpacity: "var(--infinite-load-mask-overlay-opacity)", borderRadius: "var(--infinite-load-mask-border-radius)" }, Header: { background: "var(--infinite-header-background)", color: "var(--infinite-header-color)", columnHeaderHeight: "var(--infinite-column-header-height)" }, HeaderCell: { draggingBackground: "var(--infinite-header-cell-dragging-background)", background: "var(--infinite-header-cell-background)", hoverBackground: "var(--infinite-header-cell-hover-background)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)", resizeHandleActiveAreaWidth: "var(--infinite-resize-handle-active-area-width)", resizeHandleWidth: "var(--infinite-resize-handle-width)", resizeHandleHoverBackground: "var(--infinite-resize-handle-hover-background)", resizeHandleConstrainedHoverBackground: "var(--infinite-resize-handle-constrained-hover-background)" }, Cell: { padding: "var(--infinite-cell-padding)", borderWidth: "var(--infinite-cell-border-width)", border: "var(--infinite-cell-border)", borderInvisible: "var(--infinite-cell-border-invisible)", borderRadius: "var(--infinite-cell-border-radius)", color: "var(--infinite-cell-color)", activeBorderColor_R: "var(--infinite-active-cell-border-color--r)", activeBorderColor_G: "var(--infinite-active-cell-border-color--g)", activeBorderColor_B: "var(--infinite-active-cell-border-color--b)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBorderColor: "var(--infinite-active-cell-border-color)", activeBorderWidth: "var(--infinite-active-cell-border-width)", activeBorderStyle: "var(--infinite-active-cell-border-style)", activeBorder: "var(--infinite-active-cell-border)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", activeBackground: "var(--infinite-active-row-background)", activeBorderColor: "var(--infinite-active-row-border-color)", activeBorderWidth: "var(--infinite-active-row-border-width)", activeBorderStyle: "var(--infinite-active-row-border-style)", activeBorder: "var(--infinite-active-row-border)", activeBackgroundAlpha: "var(--infinite-active-row-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-row-background-alpha--table-unfocused)", hoverBackground: "var(--infinite-row-hover-background)", groupRowBackground: "var(--infinite-group-row-background)", groupRowColumnNesting: "var(--infinite-group-row-column-nesting)", groupNesting: "var(--infinite-dont-override-group-row-nesting-length)", pointerEventsWhileScrolling: "var(--infinite-row-pointer-events-while-scrolling)" }, ColumnCell: { background: "var(--infinite-column-cell-bg-dont-override)" } } };
1105
+ var columnHeaderHeightName = "column-header-height";
1106
+
1107
+ // src/utils/selectParent.ts
1108
+ function selectParent(el, selector) {
1109
+ let node = el;
1110
+ if (node && node.matches(selector)) {
1111
+ return node;
1112
+ }
1113
+ while (node = node.parentElement) {
1114
+ if (node.matches(selector)) {
1115
+ return node;
1116
+ }
1117
+ }
1118
+ return null;
1119
+ }
1120
+
1121
+ // src/components/InfiniteTable/internalProps.ts
1122
+ var rootClassName2 = "Infinite";
1123
+ var internalProps = {
1124
+ rootClassName: rootClassName2
1125
+ };
1126
+
1127
+ // src/components/InfiniteTable/utils/infiniteDOMUtils.ts
1128
+ var InfiniteSelector = `.${internalProps.rootClassName}`;
1129
+ function getParentInfiniteNode(node) {
1130
+ return selectParent(node, InfiniteSelector);
1131
+ }
1132
+ var columnWidthAtIndex = stripVar(InternalVars.columnWidthAtIndex);
1133
+ var columnOffsetAtIndex = stripVar(InternalVars.columnOffsetAtIndex);
1134
+ function setInfiniteVarOnRoot(varName, varValue, node) {
1135
+ const infinite = node ? getParentInfiniteNode(node) : document.querySelector(InfiniteSelector);
1136
+ setInfiniteVarOnNode(varName, varValue, infinite);
1137
+ }
1138
+ function setInfiniteVarOnNode(varName, varValue, node) {
1139
+ if (node) {
1140
+ const prop = InternalVars[varName] ? stripVar(InternalVars[varName]) : varName;
1141
+ node.style.setProperty(prop, `${varValue}`);
1142
+ }
1143
+ }
1144
+ function setInfiniteVarsOnNode(vars, node) {
1145
+ if (node) {
1146
+ for (var varName in vars) {
1147
+ node.style.setProperty(InternalVars[varName] ? stripVar(InternalVars[varName]) : varName, `${vars[varName]}`);
1148
+ }
1149
+ }
1150
+ }
1151
+ function setInfiniteColumnWidth(colIndex, colWidth, node) {
1152
+ setInfiniteVarOnRoot(`${columnWidthAtIndex}-${colIndex}`, typeof colWidth === "number" ? colWidth + "px" : colWidth, node);
1153
+ }
1154
+ function setInfiniteColumnOffset(colIndex, colOffset, node) {
1155
+ setInfiniteVarOnRoot(`${columnOffsetAtIndex}-${colIndex}`, typeof colOffset === "number" ? colOffset + "px" : colOffset, node);
1156
+ }
1157
+ function getCSSVarNameForColWidth(colIndex) {
1158
+ return `${columnWidthAtIndex}-${colIndex}`;
1159
+ }
1160
+ function getCSSVarNameForColOffset(colIndex) {
1161
+ return `${columnOffsetAtIndex}-${colIndex}`;
1162
+ }
1163
+
1091
1164
  // src/components/VirtualBrain/MatrixBrain.ts
1092
1165
  var import_binary_search = __toModule(require_binary_search());
1093
1166
  var getRenderRangeCellCount = (range) => {
@@ -1123,13 +1196,13 @@ var MatrixBrain = class extends Logger {
1123
1196
  this.extraSpanCells = [];
1124
1197
  this.scrollPosition = { scrollLeft: 0, scrollTop: 0 };
1125
1198
  this.onScrollFns = [];
1126
- this.onRenderRangeChangeFns = [];
1127
- this.onVerticalRenderRangeChangeFns = [];
1128
- this.onHorizontalRenderRangeChangeFns = [];
1199
+ this.onRenderRangeChangeFns = new Set();
1200
+ this.onVerticalRenderRangeChangeFns = new Set();
1201
+ this.onHorizontalRenderRangeChangeFns = new Set();
1129
1202
  this.onDestroyFns = [];
1130
1203
  this.destroyed = false;
1131
- this.onRenderCountChangeFns = [];
1132
- this.onAvailableSizeChangeFns = [];
1204
+ this.onRenderCountChangeFns = new Set();
1205
+ this.onAvailableSizeChangeFns = new Set();
1133
1206
  this.onScrollStartFns = [];
1134
1207
  this.onScrollStopFns = [];
1135
1208
  this.scrollTimeoutId = 0;
@@ -1293,14 +1366,16 @@ var MatrixBrain = class extends Logger {
1293
1366
  }
1294
1367
  const fns = this.onAvailableSizeChangeFns;
1295
1368
  const range = this.getAvailableSize();
1296
- for (let i = 0, len = fns.length; i < len; i++) {
1369
+ fns.forEach((fn) => {
1297
1370
  raf2(() => {
1298
1371
  if (this.destroyed) {
1299
1372
  return;
1300
1373
  }
1301
- fns[i](range);
1374
+ if (fns.has(fn)) {
1375
+ fn(range);
1376
+ }
1302
1377
  });
1303
- }
1378
+ });
1304
1379
  };
1305
1380
  this.notifyRenderRangeChange = () => {
1306
1381
  if (this.destroyed) {
@@ -1308,14 +1383,16 @@ var MatrixBrain = class extends Logger {
1308
1383
  }
1309
1384
  const fns = this.onRenderRangeChangeFns;
1310
1385
  const range = this.getRenderRange();
1311
- for (let i = 0, len = fns.length; i < len; i++) {
1386
+ fns.forEach((fn) => {
1312
1387
  raf2(() => {
1313
1388
  if (this.destroyed) {
1314
1389
  return;
1315
1390
  }
1316
- fns[i](range);
1391
+ if (fns.has(fn)) {
1392
+ fn(range);
1393
+ }
1317
1394
  });
1318
- }
1395
+ });
1319
1396
  };
1320
1397
  this.notifyVerticalRenderRangeChange = () => {
1321
1398
  if (this.destroyed) {
@@ -1323,14 +1400,16 @@ var MatrixBrain = class extends Logger {
1323
1400
  }
1324
1401
  const fns = this.onVerticalRenderRangeChangeFns;
1325
1402
  const range = this.verticalRenderRange;
1326
- for (let i = 0, len = fns.length; i < len; i++) {
1403
+ fns.forEach((fn) => {
1327
1404
  raf2(() => {
1328
1405
  if (this.destroyed) {
1329
1406
  return;
1330
1407
  }
1331
- fns[i]([range.startIndex, range.endIndex]);
1408
+ if (fns.has(fn)) {
1409
+ fn([range.startIndex, range.endIndex]);
1410
+ }
1332
1411
  });
1333
- }
1412
+ });
1334
1413
  };
1335
1414
  this.notifyHorizontalRenderRangeChange = () => {
1336
1415
  if (this.destroyed) {
@@ -1338,14 +1417,16 @@ var MatrixBrain = class extends Logger {
1338
1417
  }
1339
1418
  const fns = this.onHorizontalRenderRangeChangeFns;
1340
1419
  const range = this.horizontalRenderRange;
1341
- for (let i = 0, len = fns.length; i < len; i++) {
1420
+ fns.forEach((fn) => {
1342
1421
  raf2(() => {
1343
1422
  if (this.destroyed) {
1344
1423
  return;
1345
1424
  }
1346
- fns[i]([range.startIndex, range.endIndex]);
1425
+ if (fns.has(fn)) {
1426
+ fn([range.startIndex, range.endIndex]);
1427
+ }
1347
1428
  });
1348
- }
1429
+ });
1349
1430
  };
1350
1431
  this.computeDirectionalRenderCount = (direction, itemSize, count, theSize) => {
1351
1432
  let renderCount = 0;
@@ -1357,11 +1438,11 @@ var MatrixBrain = class extends Logger {
1357
1438
  sizes.push(this.getItemSize(i, direction));
1358
1439
  }
1359
1440
  sizes.sort(SORT_ASC);
1360
- let sum = 0;
1441
+ let sum2 = 0;
1361
1442
  for (let i = 0; i < count; i++) {
1362
- sum += sizes[i];
1443
+ sum2 += sizes[i];
1363
1444
  renderCount++;
1364
- if (sum > size) {
1445
+ if (sum2 > size) {
1365
1446
  break;
1366
1447
  }
1367
1448
  }
@@ -1376,11 +1457,11 @@ var MatrixBrain = class extends Logger {
1376
1457
  if (!this.fixedColsEnd) {
1377
1458
  return 0;
1378
1459
  }
1379
- let sum = 0;
1460
+ let sum2 = 0;
1380
1461
  for (let i = this.cols - this.fixedColsEnd; i < this.cols; i++) {
1381
- sum += this.getColWidth(i);
1462
+ sum2 += this.getColWidth(i);
1382
1463
  }
1383
- return sum;
1464
+ return sum2;
1384
1465
  };
1385
1466
  this.getFixedEndColsOffsets = () => {
1386
1467
  if (!this.fixedColsEnd) {
@@ -1390,19 +1471,19 @@ var MatrixBrain = class extends Logger {
1390
1471
  const { width } = this.getAvailableSize();
1391
1472
  const offsets = [];
1392
1473
  const widths = [];
1393
- let sum = 0;
1474
+ let sum2 = 0;
1394
1475
  for (let colIndex = this.cols - this.fixedColsEnd; colIndex < this.cols; colIndex++) {
1395
1476
  const colWidth = this.getColWidth(colIndex);
1396
1477
  widths.push(colWidth);
1397
- sum += colWidth;
1478
+ sum2 += colWidth;
1398
1479
  }
1399
- const baseOffset = width - sum + scrollLeft;
1400
- sum = 0;
1480
+ const baseOffset = width - sum2 + scrollLeft;
1481
+ sum2 = 0;
1401
1482
  let index = 0;
1402
1483
  for (let colIndex = this.cols - this.fixedColsEnd; colIndex < this.cols; colIndex++) {
1403
- const offset = baseOffset + sum;
1484
+ const offset = baseOffset + sum2;
1404
1485
  offsets[colIndex] = offset;
1405
- sum += widths[index];
1486
+ sum2 += widths[index];
1406
1487
  index++;
1407
1488
  }
1408
1489
  return offsets;
@@ -1415,19 +1496,19 @@ var MatrixBrain = class extends Logger {
1415
1496
  const { height } = this.getAvailableSize();
1416
1497
  const offsets = [];
1417
1498
  const heights = [];
1418
- let sum = 0;
1499
+ let sum2 = 0;
1419
1500
  for (let rowIndex = this.rows - this.fixedRowsEnd; rowIndex < this.rows; rowIndex++) {
1420
1501
  const rowHeight = this.getRowHeight(rowIndex);
1421
1502
  heights.push(rowHeight);
1422
- sum += rowHeight;
1503
+ sum2 += rowHeight;
1423
1504
  }
1424
- const baseOffset = height - sum + scrollTop;
1425
- sum = 0;
1505
+ const baseOffset = height - sum2 + scrollTop;
1506
+ sum2 = 0;
1426
1507
  let index = 0;
1427
1508
  for (let rowIndex = this.rows - this.fixedRowsEnd; rowIndex < this.rows; rowIndex++) {
1428
- const offset = baseOffset + sum;
1509
+ const offset = baseOffset + sum2;
1429
1510
  offsets[rowIndex] = offset;
1430
- sum += heights[index];
1511
+ sum2 += heights[index];
1431
1512
  index++;
1432
1513
  }
1433
1514
  return offsets;
@@ -1436,31 +1517,31 @@ var MatrixBrain = class extends Logger {
1436
1517
  if (!this.fixedColsStart) {
1437
1518
  return 0;
1438
1519
  }
1439
- let sum = 0;
1520
+ let sum2 = 0;
1440
1521
  for (let i = 0; i < this.fixedColsStart; i++) {
1441
- sum += this.getColWidth(i);
1522
+ sum2 += this.getColWidth(i);
1442
1523
  }
1443
- return sum;
1524
+ return sum2;
1444
1525
  };
1445
1526
  this.getFixedEndRowsHeight = () => {
1446
1527
  if (!this.fixedRowsEnd) {
1447
1528
  return 0;
1448
1529
  }
1449
- let sum = 0;
1530
+ let sum2 = 0;
1450
1531
  for (let i = this.rows - this.fixedRowsEnd; i < this.rows; i++) {
1451
- sum += this.getRowHeight(i);
1532
+ sum2 += this.getRowHeight(i);
1452
1533
  }
1453
- return sum;
1534
+ return sum2;
1454
1535
  };
1455
1536
  this.getFixedStartRowsHeight = () => {
1456
1537
  if (!this.fixedRowsStart) {
1457
1538
  return 0;
1458
1539
  }
1459
- let sum = 0;
1540
+ let sum2 = 0;
1460
1541
  for (let i = 0; i < this.fixedRowsStart; i++) {
1461
- sum += this.getRowHeight(i);
1542
+ sum2 += this.getRowHeight(i);
1462
1543
  }
1463
- return sum;
1544
+ return sum2;
1464
1545
  };
1465
1546
  this.computeRenderCount = (which = ALL_DIRECTIONS) => {
1466
1547
  const recomputeHorizontal = which.horizontal;
@@ -1891,33 +1972,33 @@ var MatrixBrain = class extends Logger {
1891
1972
  };
1892
1973
  };
1893
1974
  this.onRenderRangeChange = (fn) => {
1894
- this.onRenderRangeChangeFns.push(fn);
1975
+ this.onRenderRangeChangeFns.add(fn);
1895
1976
  return () => {
1896
- this.onRenderRangeChangeFns = this.onRenderRangeChangeFns.filter((f) => f !== fn);
1977
+ this.onRenderRangeChangeFns.delete(fn);
1897
1978
  };
1898
1979
  };
1899
1980
  this.onVerticalRenderRangeChange = (fn) => {
1900
- this.onVerticalRenderRangeChangeFns.push(fn);
1981
+ this.onVerticalRenderRangeChangeFns.add(fn);
1901
1982
  return () => {
1902
- this.onVerticalRenderRangeChangeFns = this.onVerticalRenderRangeChangeFns.filter((f) => f !== fn);
1983
+ this.onVerticalRenderRangeChangeFns.delete(fn);
1903
1984
  };
1904
1985
  };
1905
1986
  this.onHorizontalRenderRangeChange = (fn) => {
1906
- this.onHorizontalRenderRangeChangeFns.push(fn);
1987
+ this.onHorizontalRenderRangeChangeFns.add(fn);
1907
1988
  return () => {
1908
- this.onHorizontalRenderRangeChangeFns = this.onHorizontalRenderRangeChangeFns.filter((f) => f !== fn);
1989
+ this.onHorizontalRenderRangeChangeFns.delete(fn);
1909
1990
  };
1910
1991
  };
1911
1992
  this.onRenderCountChange = (fn) => {
1912
- this.onRenderCountChangeFns.push(fn);
1993
+ this.onRenderCountChangeFns.add(fn);
1913
1994
  return () => {
1914
- this.onRenderCountChangeFns = this.onRenderCountChangeFns.filter((f) => f !== fn);
1995
+ this.onRenderCountChangeFns.delete(fn);
1915
1996
  };
1916
1997
  };
1917
1998
  this.onAvailableSizeChange = (fn) => {
1918
- this.onAvailableSizeChangeFns.push(fn);
1999
+ this.onAvailableSizeChangeFns.add(fn);
1919
2000
  return () => {
1920
- this.onAvailableSizeChangeFns = this.onAvailableSizeChangeFns.filter((f) => f !== fn);
2001
+ this.onAvailableSizeChangeFns.delete(fn);
1921
2002
  };
1922
2003
  };
1923
2004
  this.onDestroy = (fn) => {
@@ -1945,10 +2026,10 @@ var MatrixBrain = class extends Logger {
1945
2026
  this.onScrollFns = [];
1946
2027
  this.onScrollStartFns = [];
1947
2028
  this.onScrollStopFns = [];
1948
- this.onRenderCountChangeFns = [];
1949
- this.onRenderRangeChangeFns = [];
1950
- this.onVerticalRenderRangeChangeFns = [];
1951
- this.onHorizontalRenderRangeChangeFns = [];
2029
+ this.onRenderCountChangeFns = new Set();
2030
+ this.onRenderRangeChangeFns = new Set();
2031
+ this.onVerticalRenderRangeChangeFns = new Set();
2032
+ this.onHorizontalRenderRangeChangeFns = new Set();
1952
2033
  };
1953
2034
  this.reset();
1954
2035
  }
@@ -1994,8 +2075,8 @@ var MatrixBrain = class extends Logger {
1994
2075
  let { width, height } = size;
1995
2076
  width = width != null ? width : this.width;
1996
2077
  height = height != null ? height : this.height;
1997
- const widthSame = size.width === this.width;
1998
- const heightSame = size.height === this.height;
2078
+ const widthSame = width === this.width;
2079
+ const heightSame = height === this.height;
1999
2080
  if (widthSame && heightSame) {
2000
2081
  return;
2001
2082
  }
@@ -2047,14 +2128,16 @@ var MatrixBrain = class extends Logger {
2047
2128
  vertical: verticalRenderCount
2048
2129
  };
2049
2130
  const fns = this.onRenderCountChangeFns;
2050
- for (let i = 0, len = fns.length; i < len; i++) {
2131
+ fns.forEach((fn) => {
2051
2132
  raf2(() => {
2052
2133
  if (this.destroyed) {
2053
2134
  return;
2054
2135
  }
2055
- fns[i](renderCount);
2136
+ if (fns.has(fn)) {
2137
+ fn(renderCount);
2138
+ }
2056
2139
  });
2057
- }
2140
+ });
2058
2141
  }
2059
2142
  getItemSizeCacheFor(itemIndex, direction) {
2060
2143
  return (direction === "horizontal" ? this.colWidthCache : this.rowHeightCache)[itemIndex];
@@ -2548,18 +2631,31 @@ var MappedCells = class extends Logger {
2548
2631
 
2549
2632
  // src/components/HeadlessTable/ReactHeadlessTableRenderer.tsx
2550
2633
  var ITEM_POSITION_WITH_TRANSFORM = true;
2634
+ var currentColumnTransformY = stripVar(InternalVars.currentColumnTransformY);
2635
+ var columnTransformX = stripVar(InternalVars.columnOffsetAtIndex);
2551
2636
  var ReactHeadlessTableRenderer = class extends Logger {
2552
2637
  constructor(brain) {
2553
2638
  super("ReactHeadlessTableRenderer");
2554
2639
  this.destroyed = false;
2555
2640
  this.scrolling = false;
2556
2641
  this.cellHoverClassNames = [];
2642
+ this.name = "";
2557
2643
  this.itemDOMElements = [];
2558
2644
  this.itemDOMRefs = [];
2559
2645
  this.updaters = [];
2560
2646
  this.items = [];
2561
2647
  this.currentHoveredRow = -1;
2562
2648
  this.hoverRowUpdatesInProgress = new Map();
2649
+ this.infiniteNode = null;
2650
+ this.setTransform = (element, _rowIndex, colIndex, x, y) => {
2651
+ const transformXVar = `${columnTransformX}-${colIndex}`;
2652
+ if (!this.infiniteNode) {
2653
+ this.infiniteNode = getParentInfiniteNode(element);
2654
+ }
2655
+ this.infiniteNode.style.setProperty(transformXVar, `${x}px`);
2656
+ element.style.setProperty(currentColumnTransformY, `${y}px`);
2657
+ element.style.transform = `translate3d(var(${transformXVar}), ${InternalVars.currentColumnTransformY}, 0)`;
2658
+ };
2563
2659
  this.getFullyVisibleRowsRange = () => {
2564
2660
  let {
2565
2661
  start: [startRow],
@@ -2756,7 +2852,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
2756
2852
  extraCellsMap.set(`${rowIndex}:${colIndex}`, true);
2757
2853
  });
2758
2854
  }
2759
- const renderCount = ranges.reduce((sum, range2) => sum + getRenderRangeCellCount(range2), 0);
2855
+ const renderCount = ranges.reduce((sum2, range2) => sum2 + getRenderRangeCellCount(range2), 0);
2760
2856
  if (this.itemDOMElements.length >= renderCount) {
2761
2857
  mappedCells.discardElementsStartingWith(renderCount, (elementIndex) => {
2762
2858
  if (this.updaters[elementIndex]) {
@@ -3010,6 +3106,9 @@ var ReactHeadlessTableRenderer = class extends Logger {
3010
3106
  if (this.scrolling) {
3011
3107
  return;
3012
3108
  }
3109
+ if (false) {
3110
+ return;
3111
+ }
3013
3112
  if (this.hoverRowUpdatesInProgress.has(rowIndex)) {
3014
3113
  return;
3015
3114
  }
@@ -3025,6 +3124,9 @@ var ReactHeadlessTableRenderer = class extends Logger {
3025
3124
  };
3026
3125
  raf(() => {
3027
3126
  checkHoverClass();
3127
+ if (false) {
3128
+ return;
3129
+ }
3028
3130
  this.hoverRowUpdatesInProgress.delete(rowIndex);
3029
3131
  });
3030
3132
  };
@@ -3045,12 +3147,10 @@ var ReactHeadlessTableRenderer = class extends Logger {
3045
3147
  const { x, y } = itemPosition;
3046
3148
  if (itemElement) {
3047
3149
  this.updateHoverClassNamesForRow(rowIndex);
3048
- if (false) {
3049
- itemElement.dataset.rowIndex = rowIndex;
3050
- itemElement.dataset.colIndex = colIndex;
3051
- }
3150
+ itemElement.dataset.rowIndex = rowIndex;
3151
+ itemElement.dataset.colIndex = colIndex;
3052
3152
  if (ITEM_POSITION_WITH_TRANSFORM) {
3053
- itemElement.style.transform = `translate3d(${x}px, ${y}px, 0)`;
3153
+ this.setTransform(itemElement, rowIndex, colIndex, x, y);
3054
3154
  itemElement.style.willChange = "transform";
3055
3155
  itemElement.style.backfaceVisibility = "hidden";
3056
3156
  const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
@@ -3095,39 +3195,39 @@ var ReactHeadlessTableRenderer = class extends Logger {
3095
3195
  fn(rowIndex, colIndex, node, itemPosition, scrollPosition);
3096
3196
  }
3097
3197
  }
3098
- function adjustColStart(_rowIndex, colIndex, node, { x, y }, { scrollLeft }) {
3198
+ const adjustColStart = (_rowIndex, colIndex, node, { x, y }, { scrollLeft }) => {
3099
3199
  node.style.zIndex = `${fixedColsStart - colIndex}`;
3100
- node.style.transform = `translate3d(${x + scrollLeft}px, ${y}px, 0)`;
3101
- }
3102
- function adjustRowStart(rowIndex, _colIndex, node, coords, scrollPosition2) {
3200
+ this.setTransform(node, _rowIndex, colIndex, x + scrollLeft, y);
3201
+ };
3202
+ const adjustRowStart = (rowIndex, _colIndex, node, coords, scrollPosition2) => {
3103
3203
  node.style.zIndex = `${fixedRowsStart - rowIndex}`;
3104
- node.style.transform = `translate3d(${coords.x}px, ${coords.y + scrollPosition2.scrollTop}px, 0)`;
3105
- }
3106
- function adjustColEnd(_rowIndex, colIndex, node, { y }) {
3204
+ this.setTransform(node, rowIndex, _colIndex, coords.x, coords.y + scrollPosition2.scrollTop);
3205
+ };
3206
+ const adjustColEnd = (_rowIndex, colIndex, node, { y }) => {
3107
3207
  node.style.zIndex = `${cols - colIndex}`;
3108
3208
  const val = fixedEndColsOffsets[colIndex];
3109
- node.style.transform = `translate3d(${val}px, ${y}px, 0)`;
3110
- }
3111
- function adjustRowEnd(rowIndex, _colIndex, node, coords) {
3209
+ this.setTransform(node, _rowIndex, colIndex, val, y);
3210
+ };
3211
+ const adjustRowEnd = (rowIndex, _colIndex, node, coords) => {
3112
3212
  node.style.zIndex = `${rows - rowIndex}`;
3113
- node.style.transform = `translate3d(${coords.x}px, ${fixedEndRowsOffsets[rowIndex]}px, 0)`;
3114
- }
3115
- function adjustColStartRowStart(_rowIndex, _colIndex, node, { x, y }, scrollPosition2) {
3213
+ this.setTransform(node, rowIndex, _colIndex, coords.x, fixedEndRowsOffsets[rowIndex]);
3214
+ };
3215
+ const adjustColStartRowStart = (_rowIndex, _colIndex, node, { x, y }, scrollPosition2) => {
3116
3216
  node.style.zIndex = `1000000`;
3117
- node.style.transform = `translate3d(${x + scrollPosition2.scrollLeft}px, ${y + scrollPosition2.scrollTop}px, 0)`;
3118
- }
3119
- function adjustColStartRowEnd(_rowIndex, _colIndex, node, { x }, scrollPosition2) {
3217
+ this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, y + scrollPosition2.scrollTop);
3218
+ };
3219
+ const adjustColStartRowEnd = (_rowIndex, _colIndex, node, { x }, scrollPosition2) => {
3120
3220
  node.style.zIndex = `2000000`;
3121
- node.style.transform = `translate3d(${x + scrollPosition2.scrollLeft}px, ${fixedEndRowsOffsets[_rowIndex]}px, 0)`;
3122
- }
3123
- function adjustColEndRowStart(_rowIndex, colIndex, node, coords) {
3221
+ this.setTransform(node, _rowIndex, _colIndex, x + scrollPosition2.scrollLeft, fixedEndRowsOffsets[_rowIndex]);
3222
+ };
3223
+ const adjustColEndRowStart = (_rowIndex, colIndex, node, coords) => {
3124
3224
  node.style.zIndex = `3000000`;
3125
- node.style.transform = `translate3d(${fixedEndColsOffsets[colIndex]}px, ${coords.y + scrollPosition.scrollTop}px, 0)`;
3126
- }
3127
- function adjustColEndRowEnd(rowIndex, colIndex, node) {
3225
+ this.setTransform(node, _rowIndex, colIndex, fixedEndColsOffsets[colIndex], coords.y + scrollPosition.scrollTop);
3226
+ };
3227
+ const adjustColEndRowEnd = (rowIndex, colIndex, node) => {
3128
3228
  node.style.zIndex = `4000000`;
3129
- node.style.transform = `translate3d(${fixedEndColsOffsets[colIndex]}px, ${fixedEndRowsOffsets[rowIndex]}px, 0)`;
3130
- }
3229
+ this.setTransform(node, rowIndex, colIndex, fixedEndColsOffsets[colIndex], fixedEndRowsOffsets[rowIndex]);
3230
+ };
3131
3231
  if (fixedColsStart || fixedColsEnd) {
3132
3232
  for (let rowIndex = startRow; rowIndex < endRow; rowIndex++) {
3133
3233
  for (let colIndex = 0; colIndex < fixedColsStart; colIndex++) {
@@ -3361,14 +3461,12 @@ var useRerender = () => {
3361
3461
  ];
3362
3462
  };
3363
3463
 
3364
- // src/components/InfiniteTable/internalProps.ts
3365
- var rootClassName2 = "Infinite";
3366
- var internalProps = {
3367
- rootClassName: rootClassName2
3368
- };
3464
+ // src/components/InfiniteTable/components/ActiveCellIndicator.css.ts
3465
+ var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwx _16lm1iwv", hidden: "nxbq1c3 nxbq1c1 _16lm1iwf _16lm1iw3 _16lm1iwx _16lm1iwv" };
3466
+ var ActiveIndicatorWrapperCls = "_16lm1iwf _16lm1iw3 _16lm1iwx _16lm1iwv _16lm1iwr";
3369
3467
 
3370
3468
  // src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
3371
- var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwe _16lm1iw3 _16lm1iwt _16lm1iwu _16lm1iww", hidden: "j26lrx2 j26lrx0 _16lm1iwe _16lm1iw3 _16lm1iwt _16lm1iwu _16lm1iww" };
3469
+ var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iwu _16lm1iwv _16lm1iwx", hidden: "j26lrx2 j26lrx0 _16lm1iwf _16lm1iw3 _16lm1iwu _16lm1iwv _16lm1iwx" };
3372
3470
 
3373
3471
  // src/components/InfiniteTable/components/ActiveRowIndicator.tsx
3374
3472
  var { rootClassName: rootClassName3 } = internalProps;
@@ -3405,6 +3503,9 @@ var ActiveRowIndicatorFn = (props) => {
3405
3503
  };
3406
3504
  }, [brain]);
3407
3505
  return /* @__PURE__ */ createElement6("div", {
3506
+ className: ActiveIndicatorWrapperCls,
3507
+ "data-name": "active-row"
3508
+ }, /* @__PURE__ */ createElement6("div", {
3408
3509
  ref: domRef,
3409
3510
  "data-name": "active-row-indicator",
3410
3511
  className: `${baseCls} ${active ? ActiveRowIndicatorCls.visible : ActiveRowIndicatorCls.hidden}`,
@@ -3412,7 +3513,7 @@ var ActiveRowIndicatorFn = (props) => {
3412
3513
  transform: `translate3d(0px, ${-brain.getScrollPosition().scrollTop + state.top}px,0)`,
3413
3514
  height: state.rowHeight
3414
3515
  } : void 0
3415
- });
3516
+ }));
3416
3517
  };
3417
3518
  var ActiveRowIndicator = memo4(ActiveRowIndicatorFn);
3418
3519
 
@@ -3421,68 +3522,61 @@ import {
3421
3522
  createElement as createElement7,
3422
3523
  memo as memo5
3423
3524
  } from "react";
3424
- import { useEffect as useEffect6, useLayoutEffect as useLayoutEffect4, useRef as useRef6, useState as useState4 } from "react";
3425
-
3426
- // src/components/InfiniteTable/components/ActiveCellIndicator.css.ts
3427
- var ActiveCellIndicatorCls = { visible: "nxbq1c1 nxbq1c0 _16lm1iwe _16lm1iw3 _16lm1iww _16lm1iwu", hidden: "nxbq1c2 nxbq1c0 _16lm1iwe _16lm1iw3 _16lm1iww _16lm1iwu" };
3428
-
3429
- // src/components/InfiniteTable/components/ActiveCellIndicator.tsx
3525
+ import { useEffect as useEffect6, useLayoutEffect as useLayoutEffect4, useRef as useRef6 } from "react";
3430
3526
  var { rootClassName: rootClassName4 } = internalProps;
3431
3527
  var baseCls2 = `${rootClassName4}-ActiveCellIndicator`;
3528
+ var ActiveStyle = {
3529
+ [stripVar(InternalVars.activeCellOffsetX)]: `calc( ${InternalVars.scrollLeftForActiveCell} + ${InternalVars.activeCellColOffset} )`,
3530
+ [stripVar(InternalVars.activeCellOffsetY)]: `calc( ${InternalVars.scrollTopForActiveCell} + ${InternalVars.activeCellRowOffset} )`,
3531
+ transform: `translate3d(${InternalVars.activeCellOffsetX}, ${InternalVars.activeCellOffsetY}, 0px)`,
3532
+ width: InternalVars.activeCellColWidth,
3533
+ height: InternalVars.activeCellRowHeight
3534
+ };
3432
3535
  var ActiveCellIndicatorFn = (props) => {
3433
3536
  const { brain } = props;
3434
- const [rerenderId, rerender] = useRerender();
3435
- const [state, setState] = useState4({
3436
- top: 0,
3437
- rowHeight: 0,
3438
- colWidth: 0,
3439
- left: 0
3440
- });
3537
+ const [_rerenderId, rerender] = useRerender();
3441
3538
  const domRef = useRef6(null);
3442
- const stateRef = useRef6(state);
3443
3539
  const active = props.activeCellIndex != null && brain.getRowCount() > props.activeCellIndex[0];
3444
3540
  useLayoutEffect4(() => {
3445
3541
  if (props.activeCellIndex == null) {
3446
3542
  return;
3447
3543
  }
3448
3544
  const rowIndex = props.activeCellIndex[0];
3449
- setState(stateRef.current = {
3450
- top: brain.getItemOffsetFor(rowIndex, "vertical"),
3451
- rowHeight: brain.getRowHeight(rowIndex),
3452
- left: brain.getItemOffsetFor(props.activeCellIndex[1], "horizontal"),
3453
- colWidth: brain.getColWidth(props.activeCellIndex[1])
3454
- });
3455
- }, [props.activeCellIndex, rerenderId]);
3545
+ const activeCellRowHeight = brain.getRowHeight(rowIndex);
3546
+ const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
3547
+ const node = domRef.current;
3548
+ const scrollPosition = brain.getScrollPosition();
3549
+ setInfiniteVarsOnNode({
3550
+ scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
3551
+ scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`,
3552
+ activeCellRowHeight: `${activeCellRowHeight}px`,
3553
+ activeCellRowOffset: `${activeCellRowOffset}px`
3554
+ }, node);
3555
+ }, [props.activeCellIndex]);
3456
3556
  useEffect6(() => {
3457
- const removeOnSCroll = brain.onScroll((scrollPos) => {
3458
- const node = domRef.current;
3459
- const topOffset = stateRef.current.top;
3460
- const leftOffset = stateRef.current.left;
3461
- node.style.transform = `translate3d(${-scrollPos.scrollLeft + leftOffset}px, ${-scrollPos.scrollTop + topOffset}px, 0px)`;
3557
+ const removeOnSCroll = brain.onScroll((scrollPosition) => {
3558
+ setInfiniteVarsOnNode({
3559
+ scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
3560
+ scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`
3561
+ }, domRef.current);
3462
3562
  });
3463
3563
  const removeOnRenderCountChange = brain.onRenderCountChange(() => {
3464
3564
  rerender();
3465
3565
  });
3466
- const removeOnAvailableSizeChange = brain.onAvailableSizeChange(() => {
3467
- rerender();
3468
- });
3469
3566
  return () => {
3470
- removeOnAvailableSizeChange();
3471
3567
  removeOnRenderCountChange();
3472
3568
  removeOnSCroll();
3473
3569
  };
3474
3570
  }, [brain]);
3475
- const scrollPosition = brain.getScrollPosition();
3476
3571
  return /* @__PURE__ */ createElement7("div", {
3572
+ className: ActiveIndicatorWrapperCls,
3573
+ "data-name": "active-cell"
3574
+ }, /* @__PURE__ */ createElement7("div", {
3477
3575
  ref: domRef,
3478
3576
  "data-name": "active-cell-indicator",
3479
3577
  className: `${baseCls2} ${active ? ActiveCellIndicatorCls.visible : ActiveCellIndicatorCls.hidden}`,
3480
- style: active ? {
3481
- transform: `translate3d(${-scrollPosition.scrollLeft + state.left}px, ${-scrollPosition.scrollTop + state.top}px,0)`,
3482
- width: state.colWidth,
3483
- height: state.rowHeight
3484
- } : void 0
3485
- });
3578
+ style: active ? ActiveStyle : void 0
3579
+ }));
3486
3580
  };
3487
3581
  var ActiveCellIndicator = memo5(ActiveCellIndicatorFn);
3488
3582
 
@@ -3530,7 +3624,7 @@ function HeadlessTable(props) {
3530
3624
  "onRenderUpdater"
3531
3625
  ]);
3532
3626
  const domRef = useRef7(null);
3533
- const [scrollSize, setTotalScrollSize] = useState5({
3627
+ const [scrollSize, setTotalScrollSize] = useState4({
3534
3628
  width: 0,
3535
3629
  height: 0
3536
3630
  });
@@ -3552,7 +3646,7 @@ function HeadlessTable(props) {
3552
3646
  };
3553
3647
  brain.update(size);
3554
3648
  };
3555
- const remove = setupResizeObserver(node, onResize);
3649
+ const remove = setupResizeObserver(node, onResize, { debounce: 50 });
3556
3650
  return remove;
3557
3651
  }, []);
3558
3652
  const onContainerScroll = useCallback4((scrollPos) => {
@@ -3604,7 +3698,7 @@ import {
3604
3698
  createContext as createContext2,
3605
3699
  useMemo as useMemo3,
3606
3700
  useEffect as useEffect8,
3607
- useState as useState6,
3701
+ useState as useState5,
3608
3702
  useRef as useRef10
3609
3703
  } from "react";
3610
3704
 
@@ -3742,14 +3836,14 @@ function forwardProps(propsToForward, props) {
3742
3836
  function getComponentStateRoot(config) {
3743
3837
  return memo6(function ComponentStateRoot(props) {
3744
3838
  var _a, _b;
3745
- const [initialSetupState] = useState6(() => {
3839
+ const [initialSetupState] = useState5(() => {
3746
3840
  return config.initSetupState ? config.initSetupState() : {};
3747
3841
  });
3748
3842
  const propsToStateSetRef = useRef10(new Set());
3749
3843
  const propsToForward = useMemo3(() => config.forwardProps ? config.forwardProps(initialSetupState) : {}, [initialSetupState]);
3750
3844
  const parentState = (_b = (_a = config.getParentState) == null ? void 0 : _a.call(config)) != null ? _b : null;
3751
3845
  const getParentState = useLatest(parentState);
3752
- const [wholeState] = useState6(() => {
3846
+ const [wholeState] = useState5(() => {
3753
3847
  let mappedState = {};
3754
3848
  if (propsToForward) {
3755
3849
  mappedState = forwardProps(propsToForward, props);
@@ -3918,28 +4012,28 @@ var useInternalProps = () => {
3918
4012
  };
3919
4013
 
3920
4014
  // src/components/InfiniteTable/utilities.css.ts
3921
- var alignItems = { center: "_16lm1iw14", stretch: "_16lm1iw15" };
3922
- var cssEllipsisClassName = "_16lm1iw1d _16lm1iw1e _16lm1iw19";
3923
- var cursor = { pointer: "_16lm1iwd" };
3924
- var display = { flex: "_16lm1iwm", block: "_16lm1iwn", inlineBlock: "_16lm1iwo" };
3925
- var flex = { "1": "_16lm1iwf", none: "_16lm1iwg" };
3926
- var flexFlow = { column: "_16lm1iw12", row: "_16lm1iw13" };
3927
- var justifyContent = { center: "_16lm1iw16", start: "_16lm1iw17", end: "_16lm1iw18" };
3928
- var left = { "0": "_16lm1iww", "100%": "_16lm1iwx" };
3929
- var overflow = { hidden: "_16lm1iw19", auto: "_16lm1iw1a", visible: "_16lm1iw1b" };
4015
+ var alignItems = { center: "_16lm1iw15", stretch: "_16lm1iw16" };
4016
+ var cssEllipsisClassName = "_16lm1iw1e _16lm1iw1f _16lm1iw1a";
4017
+ var cursor = { pointer: "_16lm1iwd", colResize: "_16lm1iwe" };
4018
+ var display = { flex: "_16lm1iwn", block: "_16lm1iwo", inlineBlock: "_16lm1iwp" };
4019
+ var flex = { "1": "_16lm1iwg", none: "_16lm1iwh" };
4020
+ var flexFlow = { column: "_16lm1iw13", row: "_16lm1iw14" };
4021
+ var justifyContent = { center: "_16lm1iw17", start: "_16lm1iw18", end: "_16lm1iw19" };
4022
+ var left = { "0": "_16lm1iwx", "100%": "_16lm1iwy" };
4023
+ var overflow = { hidden: "_16lm1iw1a", auto: "_16lm1iw1b", visible: "_16lm1iw1c" };
3930
4024
  var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
3931
- var top = { "0": "_16lm1iwu", "100%": "_16lm1iwv" };
4025
+ var top = { "0": "_16lm1iwv", "100%": "_16lm1iww" };
3932
4026
  var transformTranslateZero = "_16lm1iwa";
3933
- var userSelect = { none: "_16lm1iwp" };
3934
- var zIndex = { "1": "_16lm1iwh", "10": "_16lm1iwi", "1000": "_16lm1iwj", "10000": "_16lm1iwk", "100000": "_16lm1iwl" };
4027
+ var userSelect = { none: "_16lm1iwq" };
4028
+ var zIndex = { "1": "_16lm1iwi", "10": "_16lm1iwj", "1000": "_16lm1iwk", "10000": "_16lm1iwl", "100000": "_16lm1iwm" };
3935
4029
 
3936
4030
  // src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
3937
4031
  var InfiniteTableBody = forwardRef2(function InfiniteTableBody2(props, ref) {
3938
- const { rootClassName: rootClassName11 } = useInternalProps();
4032
+ const { rootClassName: rootClassName13 } = useInternalProps();
3939
4033
  return /* @__PURE__ */ createElement10("div", __spreadProps(__spreadValues({
3940
4034
  ref
3941
4035
  }, props), {
3942
- className: join(`${rootClassName11}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
4036
+ className: join(`${rootClassName13}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
3943
4037
  }));
3944
4038
  });
3945
4039
 
@@ -3949,11 +4043,11 @@ import {
3949
4043
  forwardRef as forwardRef3
3950
4044
  } from "react";
3951
4045
  var InfiniteTableFooter = forwardRef3(function InfiniteTableFooter2(props, ref) {
3952
- const { rootClassName: rootClassName11 } = useInternalProps();
4046
+ const { rootClassName: rootClassName13 } = useInternalProps();
3953
4047
  return /* @__PURE__ */ createElement11("div", __spreadProps(__spreadValues({
3954
4048
  ref
3955
4049
  }, props), {
3956
- className: join(`${rootClassName11}Footer`, position.relative, display.flex, flexFlow.row, props.className)
4050
+ className: join(`${rootClassName13}Footer`, position.relative, display.flex, flexFlow.row, props.className)
3957
4051
  }));
3958
4052
  });
3959
4053
 
@@ -3961,10 +4055,10 @@ var InfiniteTableFooter = forwardRef3(function InfiniteTableFooter2(props, ref)
3961
4055
  import {
3962
4056
  Fragment as Fragment2,
3963
4057
  createContext as createContext4,
3964
- createElement as createElement15,
4058
+ createElement as createElement16,
3965
4059
  useMemo as useMemo5
3966
4060
  } from "react";
3967
- import { useCallback as useCallback7, useContext as useContext5, useEffect as useEffect11, useRef as useRef12 } from "react";
4061
+ import { useCallback as useCallback8, useContext as useContext5, useEffect as useEffect11, useRef as useRef13 } from "react";
3968
4062
  import { createPortal } from "react-dom";
3969
4063
 
3970
4064
  // src/components/DataSource/defaultFilterTypes.ts
@@ -4072,7 +4166,7 @@ import {
4072
4166
  useCallback as useCallback6,
4073
4167
  useMemo as useMemo4,
4074
4168
  useRef as useRef11,
4075
- useState as useState7
4169
+ useState as useState6
4076
4170
  } from "react";
4077
4171
 
4078
4172
  // src/components/InfiniteTable/hooks/useInfiniteTable.ts
@@ -4126,10 +4220,9 @@ var useColumnPointerEvents = ({
4126
4220
  columns,
4127
4221
  computedRemainingSpace
4128
4222
  }) => {
4129
- const [draggingDiff, setDraggingDiff] = useState7(null);
4130
- const [proxyOffset, setProxyOffset] = useState7(null);
4223
+ const [draggingDiff, setDraggingDiff] = useState6(null);
4224
+ const [proxyOffset, setProxyOffset] = useState6(null);
4131
4225
  const breakpointsRef = useRef11([]);
4132
- const pointerMoveRef = useRef11(null);
4133
4226
  const didDragRef = useRef11(false);
4134
4227
  const initialClientPos = useRef11(null);
4135
4228
  const currentDropIndexRef = useRef11(null);
@@ -4205,35 +4298,40 @@ var useColumnPointerEvents = ({
4205
4298
  }
4206
4299
  setDraggingDiff({ left: diffX, top: diffY });
4207
4300
  };
4208
- pointerMoveRef.current = onPointerMove;
4301
+ const onPointerUp = (e2) => {
4302
+ const target2 = domRef.current;
4303
+ target2.style.cursor = cursorRef.current;
4304
+ target2.releasePointerCapture(e2.pointerId);
4305
+ target2.removeEventListener("pointermove", onPointerMove);
4306
+ target2.removeEventListener("pointerup", onPointerUp);
4307
+ setDraggingDiff(null);
4308
+ componentActions.columnShifts = null;
4309
+ componentActions.draggingColumnId = null;
4310
+ if (!didDragRef.current && column.computedSortable) {
4311
+ column.toggleSort();
4312
+ }
4313
+ const dropIndex = currentDropIndexRef.current;
4314
+ if (dropIndex != null && dropIndex !== columnIndex) {
4315
+ const newOrder = moveXatY(computedColumnOrder, columnIndex, dropIndex > columnIndex ? dropIndex - 1 : dropIndex);
4316
+ componentActions.columnOrder = newOrder;
4317
+ }
4318
+ breakpointsRef.current = [];
4319
+ didDragRef.current = false;
4320
+ initialClientPos.current = null;
4321
+ currentDropIndexRef.current = null;
4322
+ };
4209
4323
  target.addEventListener("pointermove", onPointerMove);
4324
+ target.addEventListener("pointerup", onPointerUp);
4210
4325
  target.setPointerCapture(e.pointerId);
4211
- }, [columns, column, columnIndex, columnsArray, computedRemainingSpace]);
4212
- const onPointerUp = useCallback6((e) => {
4213
- const target = domRef.current;
4214
- target.style.cursor = cursorRef.current;
4215
- target.releasePointerCapture(e.pointerId);
4216
- target.removeEventListener("pointermove", pointerMoveRef.current);
4217
- setDraggingDiff(null);
4218
- componentActions.columnShifts = null;
4219
- componentActions.draggingColumnId = null;
4220
- if (!didDragRef.current && column.computedSortable) {
4221
- column.toggleSort();
4222
- }
4223
- const dropIndex = currentDropIndexRef.current;
4224
- if (dropIndex != null && dropIndex !== columnIndex) {
4225
- const newOrder = moveXatY(computedColumnOrder, columnIndex, dropIndex > columnIndex ? dropIndex - 1 : dropIndex);
4226
- componentActions.columnOrder = newOrder;
4227
- }
4228
- breakpointsRef.current = [];
4229
- pointerMoveRef.current = null;
4230
- didDragRef.current = false;
4231
- initialClientPos.current = null;
4232
- currentDropIndexRef.current = null;
4233
- }, [column, columnIndex, componentActions, computedColumnOrder]);
4326
+ }, [
4327
+ columns,
4328
+ column,
4329
+ columnIndex,
4330
+ columnsArray,
4331
+ computedRemainingSpace,
4332
+ computedColumnOrder
4333
+ ]);
4234
4334
  return {
4235
- onPointerUp: column.computedDraggable ? onPointerUp : () => {
4236
- },
4237
4335
  onPointerDown: column.computedDraggable ? onPointerDown : () => {
4238
4336
  },
4239
4337
  dragging,
@@ -4288,23 +4386,23 @@ function NumberFilterEditor(props) {
4288
4386
  import {
4289
4387
  createElement as createElement12
4290
4388
  } from "react";
4291
- import { useEffect as useEffect9, useState as useState8 } from "react";
4389
+ import { useEffect as useEffect9, useState as useState7 } from "react";
4292
4390
 
4293
4391
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
4294
4392
  var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
4295
- var CellCls = "_1eexc2a5 _16lm1iwm _16lm1iw13 _16lm1iw14 _16lm1iw2 _16lm1iw1c _16lm1iw1d";
4296
- var HeaderCellContentRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob117 _16lm1iwr _16lm1iwt _16lm1iwm _16lm1iw13 _16lm1iw14", variantClassNames: { filtered: { false: "_12zfob118", true: "_12zfob119" } }, defaultVariants: {}, compoundVariants: [] });
4393
+ var CellCls = "_1eexc2a5 _16lm1iwn _16lm1iw14 _16lm1iw15 _16lm1iw2 _16lm1iw1d _16lm1iw1e";
4394
+ var HeaderCellContentRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob117 _16lm1iws _16lm1iwu _16lm1iwn _16lm1iw14 _16lm1iw15", variantClassNames: { filtered: { false: "_12zfob118", true: "_12zfob119" } }, defaultVariants: {}, compoundVariants: [] });
4297
4395
  var HeaderCellProxy = "_12zfob10";
4298
- var HeaderCellRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob1h _16lm1iwn", variantClassNames: { rowActive: { false: "_12zfob1i", true: "_12zfob1j" }, zebra: { false: "_12zfob1k", even: "_12zfob1l", odd: "_12zfob1m" }, dragging: { true: "_12zfob1n", false: "_12zfob1o" }, first: { true: "_12zfob1p", false: "_12zfob1q" }, last: { true: "_12zfob1r", false: "_12zfob1s" }, groupByField: { true: "_12zfob1t", false: "_12zfob1u" }, firstInCategory: { true: "_12zfob1v", false: "_12zfob1w" }, lastInCategory: { true: "_12zfob1x", false: "_12zfob1y" }, pinned: { start: "_12zfob1z", end: "_12zfob110", false: "_12zfob111" }, filtered: { true: "_12zfob112", false: "_12zfob113" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob114"], [{ pinned: "end", firstInCategory: true }, "_12zfob115"], [{ pinned: false, lastInCategory: true }, "_12zfob116"]] });
4299
- var HeaderClsRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob17 _16lm1iwn _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob18", end: "_12zfob19", false: "_12zfob1a" }, virtualized: { true: "_12zfob1b", false: "_12zfob1c" }, overflow: { true: "_12zfob1d", false: "_12zfob1e" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1f"], [{ overflow: true, pinned: "end" }, "_12zfob1g"]] });
4300
- var HeaderFilterCls = "_12zfob11c _16lm1iwm _16lm1iw13 _16lm1iw14 _16lm1iw1";
4301
- var HeaderFilterEditorCls = "_16lm1iwt _16lm1iwr";
4302
- var HeaderGroupCls = "_12zfob11b _16lm1iwm _16lm1iw13 _16lm1iw14";
4396
+ var HeaderCellRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob1h _16lm1iwo", variantClassNames: { rowActive: { false: "_12zfob1i", true: "_12zfob1j" }, zebra: { false: "_12zfob1k", even: "_12zfob1l", odd: "_12zfob1m" }, dragging: { true: "_12zfob1n", false: "_12zfob1o" }, first: { true: "_12zfob1p", false: "_12zfob1q" }, last: { true: "_12zfob1r", false: "_12zfob1s" }, groupByField: { true: "_12zfob1t", false: "_12zfob1u" }, firstInCategory: { true: "_12zfob1v", false: "_12zfob1w" }, lastInCategory: { true: "_12zfob1x", false: "_12zfob1y" }, pinned: { start: "_12zfob1z", end: "_12zfob110", false: "_12zfob111" }, filtered: { true: "_12zfob112", false: "_12zfob113" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob114"], [{ pinned: "end", firstInCategory: true }, "_12zfob115"], [{ pinned: false, lastInCategory: true }, "_12zfob116"]] });
4397
+ var HeaderClsRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob17 _16lm1iwo _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob18", end: "_12zfob19", false: "_12zfob1a" }, virtualized: { true: "_12zfob1b", false: "_12zfob1c" }, overflow: { true: "_12zfob1d", false: "_12zfob1e" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1f"], [{ overflow: true, pinned: "end" }, "_12zfob1g"]] });
4398
+ var HeaderFilterCls = "_12zfob11c _16lm1iwn _16lm1iw14 _16lm1iw15 _16lm1iw1";
4399
+ var HeaderFilterEditorCls = "_16lm1iwu _16lm1iws";
4400
+ var HeaderGroupCls = "_12zfob11b _16lm1iwn _16lm1iw14 _16lm1iw15";
4303
4401
  var HeaderScrollbarPlaceholderCls = "_12zfob16 _16lm1iw2";
4304
4402
  var HeaderSortIconCls = "_16lm1iw1";
4305
4403
  var HeaderSortIconIndexCls = "_12zfob15";
4306
4404
  var HeaderSortIconRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob12", center: "_12zfob13", end: "_12zfob14" } }, defaultVariants: {}, compoundVariants: [] });
4307
- var HeaderWrapperCls = "_12zfob11a _16lm1iw19 _16lm1iw1 _16lm1iwm _16lm1iw13";
4405
+ var HeaderWrapperCls = "_12zfob11a _16lm1iw1a _16lm1iw1 _16lm1iwn _16lm1iw14";
4308
4406
 
4309
4407
  // src/components/InfiniteTable/components/icons/SortIcon.tsx
4310
4408
  var defaultLineStyle = {
@@ -4315,8 +4413,8 @@ var defaultLineStyle = {
4315
4413
  var InfiniteTableIconClassName = "InfiniteTableIcon";
4316
4414
  function SortIcon(props) {
4317
4415
  var _a;
4318
- const [rendered, setRendered] = useState8(true);
4319
- const [opacity, setOpacity] = useState8(0);
4416
+ const [rendered, setRendered] = useState7(true);
4417
+ const [opacity, setOpacity] = useState7(0);
4320
4418
  const { direction, lineWidth = 1, style, className, index } = props;
4321
4419
  const showIndex = index != null && index > 0;
4322
4420
  const size = (_a = props.size) != null ? _a : 16;
@@ -4395,20 +4493,20 @@ var useInfiniteTableState = () => {
4395
4493
  // src/components/InfiniteTable/components/cell.css.ts
4396
4494
  var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
4397
4495
  var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
4398
- var ColumnCellCls = "_1eexc2a5 _16lm1iwm _16lm1iw13 _16lm1iw14 _16lm1iw2 _16lm1iw1c _16lm1iw1d";
4496
+ var ColumnCellCls = "_1eexc2a5 _16lm1iwn _16lm1iw14 _16lm1iw15 _16lm1iw2 _16lm1iw1d _16lm1iw1e";
4399
4497
  var ColumnCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_1eexc2a7", variantClassNames: { dragging: { false: "_1eexc2a8", true: "_1eexc2a9" }, rowActive: { false: "_1eexc2aa", true: "_1eexc2ab" }, zebra: { false: "_1eexc2ac", even: "_1eexc2ad", odd: "_1eexc2ae" }, first: { true: "_1eexc2af", false: "_1eexc2ag" }, last: { true: "_1eexc2ah", false: "_1eexc2ai" }, groupByField: { true: "_1eexc2aj", false: "_1eexc2ak" }, firstInCategory: { true: "_1eexc2al", false: "_1eexc2am" }, lastInCategory: { true: "_1eexc2an", false: "_1eexc2ao" }, pinned: { start: "_1eexc2ap", end: "_1eexc2aq", false: "_1eexc2ar" }, filtered: { true: "_1eexc2as", false: "_1eexc2at" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2au"], [{ pinned: "end", firstInCategory: true }, "_1eexc2av"]] });
4400
4498
 
4401
4499
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
4402
4500
  var { rootClassName: rootClassName5 } = internalProps;
4403
4501
  var InfiniteTableCellClassName = `${rootClassName5}Cell`;
4404
4502
  var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
4503
+ var columnWidthAtIndex2 = stripVar(InternalVars.columnWidthAtIndex);
4405
4504
  function InfiniteTableCellFn(props) {
4406
4505
  var _b, _c, _d;
4407
4506
  const _a = props, {
4408
4507
  cssEllipsis = true,
4409
4508
  virtualized = true,
4410
4509
  skipColumnShifting = false,
4411
- offsetProperty = "left",
4412
4510
  contentStyle,
4413
4511
  column,
4414
4512
  domRef,
@@ -4416,7 +4514,6 @@ function InfiniteTableCellFn(props) {
4416
4514
  contentClassName,
4417
4515
  afterChildren,
4418
4516
  beforeChildren,
4419
- offset,
4420
4517
  cellType,
4421
4518
  cssPosition: _cssPosition,
4422
4519
  renderChildren
@@ -4424,7 +4521,6 @@ function InfiniteTableCellFn(props) {
4424
4521
  "cssEllipsis",
4425
4522
  "virtualized",
4426
4523
  "skipColumnShifting",
4427
- "offsetProperty",
4428
4524
  "contentStyle",
4429
4525
  "column",
4430
4526
  "domRef",
@@ -4432,7 +4528,6 @@ function InfiniteTableCellFn(props) {
4432
4528
  "contentClassName",
4433
4529
  "afterChildren",
4434
4530
  "beforeChildren",
4435
- "offset",
4436
4531
  "cellType",
4437
4532
  "cssPosition",
4438
4533
  "renderChildren"
@@ -4441,10 +4536,10 @@ function InfiniteTableCellFn(props) {
4441
4536
  const { columnShifts } = useInfiniteTableState();
4442
4537
  const shifting = !!columnShifts;
4443
4538
  const style = __spreadValues({
4444
- width
4539
+ width: `var(${columnWidthAtIndex2}-${column.computedVisibleIndex})`
4445
4540
  }, domProps.style);
4446
4541
  if (!skipColumnShifting && columnShifts && columnShifts[column.computedVisibleIndex]) {
4447
- const shiftLeft = columnShifts[column.computedVisibleIndex] + (offset != null ? offset : 0);
4542
+ const shiftLeft = columnShifts[column.computedVisibleIndex];
4448
4543
  if (virtualized) {
4449
4544
  style.left = shiftLeft;
4450
4545
  } else {
@@ -4474,13 +4569,13 @@ var InfiniteTableCell = memo7(InfiniteTableCellFn);
4474
4569
  import {
4475
4570
  createElement as createElement14
4476
4571
  } from "react";
4477
- import { useEffect as useEffect10, useState as useState9 } from "react";
4572
+ import { useEffect as useEffect10, useState as useState8 } from "react";
4478
4573
  var { rootClassName: rootClassName6 } = internalProps;
4479
4574
  var InfiniteTableColumnHeaderFilterClassName = `${rootClassName6}HeaderCell__filter`;
4480
4575
  var stopPropagation = (e) => e.stopPropagation();
4481
4576
  function InfiniteTableColumnHeaderFilter(props) {
4482
4577
  var _a, _b, _c, _d;
4483
- const [theValue, setTheValue] = useState9((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
4578
+ const [theValue, setTheValue] = useState8((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
4484
4579
  const onInputChange = (filterValue) => {
4485
4580
  setTheValue(filterValue);
4486
4581
  props.onChange(filterValue);
@@ -4528,10 +4623,547 @@ function InfiniteTableColumnHeaderFilterEmpty() {
4528
4623
  });
4529
4624
  }
4530
4625
 
4626
+ // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
4627
+ import {
4628
+ createElement as createElement15
4629
+ } from "react";
4630
+ import { useCallback as useCallback7 } from "react";
4631
+
4632
+ // src/components/flexbox/index.ts
4633
+ var computeFlex = (params) => {
4634
+ const {
4635
+ availableSize,
4636
+ items,
4637
+ minSize: defaultMinSize,
4638
+ maxSize: defaultMaxSize
4639
+ } = params;
4640
+ if (availableSize < 0) {
4641
+ throw "The provided availableSize cannot be negative!";
4642
+ }
4643
+ let totalFixedSize = 0;
4644
+ let totalFlex = 0;
4645
+ let totalFlexCount = 0;
4646
+ const minSizes = [];
4647
+ const maxSizes = [];
4648
+ items.forEach((item, i) => {
4649
+ var _a, _b, _c, _d, _e;
4650
+ let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
4651
+ let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
4652
+ minSizes.push(minSize);
4653
+ maxSizes.push(maxSize);
4654
+ if (item.size != null) {
4655
+ if (maxSize != null && item.size > maxSize) {
4656
+ item.size = maxSize;
4657
+ }
4658
+ if (minSize != null && item.size < minSize) {
4659
+ item.size = minSize;
4660
+ }
4661
+ }
4662
+ const itemFlex = item.flex == 0 ? null : item.flex;
4663
+ if (item.size == null && itemFlex == null) {
4664
+ throw `Items must specify either a size or a flex property. Item at index ${i} doesn't have either of those.`;
4665
+ }
4666
+ if (itemFlex != null) {
4667
+ totalFlexCount += 1;
4668
+ }
4669
+ totalFlex += itemFlex != null ? itemFlex : 0;
4670
+ totalFixedSize += (_e = item.size) != null ? _e : 0;
4671
+ });
4672
+ let availableSizeForFlex = params.computeSpecialSpaceDistribution ? Math.max(availableSize, 0) : Math.max(availableSize - totalFixedSize, 0);
4673
+ let sizePerFlex = availableSizeForFlex / totalFlex;
4674
+ let maxxedFlexItems = {};
4675
+ let minnedFlexItems = {};
4676
+ let constrainedCount = 0;
4677
+ items.forEach((item, index) => {
4678
+ var _a, _b, _c, _d;
4679
+ if (item.flex != null) {
4680
+ const approxFlexSize = sizePerFlex * item.flex;
4681
+ let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
4682
+ let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
4683
+ let constrained = false;
4684
+ let substractSize = 0;
4685
+ if (maxSize != null && approxFlexSize > maxSize) {
4686
+ maxxedFlexItems[index] = true;
4687
+ constrained = true;
4688
+ substractSize = maxSize;
4689
+ }
4690
+ if (minSize != null && approxFlexSize < minSize) {
4691
+ minnedFlexItems[index] = true;
4692
+ constrained = true;
4693
+ substractSize = minSize;
4694
+ }
4695
+ if (constrained) {
4696
+ constrainedCount += 1;
4697
+ totalFlexCount -= 1;
4698
+ totalFlex -= item.flex;
4699
+ availableSizeForFlex -= substractSize;
4700
+ }
4701
+ }
4702
+ });
4703
+ if (constrainedCount) {
4704
+ sizePerFlex = availableSizeForFlex / totalFlex;
4705
+ }
4706
+ let flexSizes = [];
4707
+ let currentFlexCount = 0;
4708
+ let remainingSizeForFlex = availableSizeForFlex;
4709
+ let remainingFlex = totalFlex;
4710
+ let totalTakenSize = 0;
4711
+ let flexSizeSum = 0;
4712
+ const computedSizes = [];
4713
+ const resultItems = items.map((item, index) => {
4714
+ var _a, _b, _c, _d, _e;
4715
+ const sizedItem = __spreadValues({}, item);
4716
+ let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
4717
+ let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
4718
+ let flexSize = 0;
4719
+ const maxxed = maxxedFlexItems[index];
4720
+ const minned = minnedFlexItems[index];
4721
+ const constrained = maxxed || minned;
4722
+ let computedSize = (_e = item.size) != null ? _e : 0;
4723
+ if (item.flex != null) {
4724
+ if (constrained) {
4725
+ if (minned) {
4726
+ flexSize = minSize;
4727
+ }
4728
+ if (maxxed) {
4729
+ flexSize = maxSize;
4730
+ }
4731
+ } else {
4732
+ currentFlexCount += 1;
4733
+ const constrain = (size) => {
4734
+ if (maxSize != null && size > maxSize) {
4735
+ size = maxSize;
4736
+ }
4737
+ if (minSize != null && size < minSize) {
4738
+ size = minSize;
4739
+ }
4740
+ return size;
4741
+ };
4742
+ if (currentFlexCount === totalFlexCount) {
4743
+ flexSize = constrain(remainingSizeForFlex);
4744
+ } else {
4745
+ flexSize = constrain(Math.round(item.flex * sizePerFlex));
4746
+ flexSizeSum += flexSize;
4747
+ remainingSizeForFlex = availableSizeForFlex - flexSizeSum;
4748
+ remainingFlex -= item.flex;
4749
+ sizePerFlex = remainingSizeForFlex / remainingFlex;
4750
+ }
4751
+ }
4752
+ computedSize = flexSize;
4753
+ sizedItem.flexSize = flexSize;
4754
+ }
4755
+ flexSizes.push(flexSize);
4756
+ computedSizes.push(computedSize);
4757
+ sizedItem.computedSize = computedSize;
4758
+ totalTakenSize += computedSize;
4759
+ return sizedItem;
4760
+ });
4761
+ return {
4762
+ items: resultItems,
4763
+ flexSizes,
4764
+ minSizes,
4765
+ maxSizes,
4766
+ computedSizes,
4767
+ remainingSize: Math.round(availableSize - totalTakenSize)
4768
+ };
4769
+ };
4770
+ function resizeClamp(value, min, max, direction) {
4771
+ if (min != null && value <= min) {
4772
+ return { value: min, clamped: "min", diff: (value - min) * direction };
4773
+ }
4774
+ if (max != null && value >= max) {
4775
+ return { value: max, clamped: "max", diff: (max - value) * direction };
4776
+ }
4777
+ return { value, clamped: false, diff: 0 };
4778
+ }
4779
+ var computeResize = (params) => {
4780
+ const { availableSize, reservedWidth = 0 } = params;
4781
+ const columnSizing = Object.keys(params.columnSizing).reduce((acc, key) => {
4782
+ acc[key] = __spreadValues({}, params.columnSizing[key]);
4783
+ return acc;
4784
+ }, {});
4785
+ if (availableSize < 0) {
4786
+ throw "The provided availableSize cannot be negative!";
4787
+ }
4788
+ let dragHandleOffset = params.dragHandleOffset;
4789
+ const firstIndex = params.dragHandlePositionAfter;
4790
+ const secondIndex = params.dragHandlePositionAfter + 1;
4791
+ const firstItem = params.items[firstIndex];
4792
+ const secondItem = params.items[secondIndex];
4793
+ const firstId = firstItem.id;
4794
+ const secondId = secondItem == null ? void 0 : secondItem.id;
4795
+ const firstSize = firstItem.computedWidth;
4796
+ const firstMinSize = firstItem.computedMinWidth;
4797
+ const firstMaxSize = firstItem.computedMaxWidth;
4798
+ const firstPropertyToAdjust = firstItem.computedFlex ? "flex" : "width";
4799
+ const secondSize = secondItem == null ? void 0 : secondItem.computedWidth;
4800
+ const secondMinSize = secondItem == null ? void 0 : secondItem.computedMinWidth;
4801
+ const secondMaxSize = secondItem == null ? void 0 : secondItem.computedMaxWidth;
4802
+ const secondPropertyToAdjust = (secondItem == null ? void 0 : secondItem.computedFlex) ? "flex" : "width";
4803
+ let maxReached = false;
4804
+ let minReached = false;
4805
+ const direction = dragHandleOffset > 0 ? 1 : -1;
4806
+ let {
4807
+ value: firstAdjustedSize,
4808
+ clamped: firstClamped,
4809
+ diff: firstDiff
4810
+ } = resizeClamp(firstSize + dragHandleOffset, firstMinSize, firstMaxSize, direction);
4811
+ if (params.shareSpaceOnResize) {
4812
+ if (secondItem == null) {
4813
+ columnSizing[firstId] = __spreadProps(__spreadValues({}, columnSizing[firstId]), {
4814
+ [firstPropertyToAdjust]: firstAdjustedSize
4815
+ });
4816
+ minReached = firstClamped === "min";
4817
+ maxReached = firstClamped === "max";
4818
+ const adjustedDiff2 = firstAdjustedSize - firstSize;
4819
+ return {
4820
+ adjustedDiff: adjustedDiff2,
4821
+ reservedWidth,
4822
+ columnSizing,
4823
+ minReached,
4824
+ maxReached,
4825
+ constrained: minReached || maxReached
4826
+ };
4827
+ }
4828
+ let {
4829
+ value: secondAdjustedSize,
4830
+ clamped: secondClamped,
4831
+ diff: secondDiff
4832
+ } = resizeClamp(secondSize - dragHandleOffset, secondMinSize, secondMaxSize, direction);
4833
+ if (firstClamped && secondClamped) {
4834
+ if (Math.abs(firstDiff) > Math.abs(secondDiff)) {
4835
+ secondClamped = false;
4836
+ } else {
4837
+ firstClamped = false;
4838
+ }
4839
+ }
4840
+ if (!firstClamped && !secondClamped) {
4841
+ } else if (firstClamped) {
4842
+ const clampResultForSecond = resizeClamp(secondSize - dragHandleOffset - firstDiff, secondMinSize, secondMaxSize, direction);
4843
+ secondAdjustedSize = clampResultForSecond.value;
4844
+ secondClamped = clampResultForSecond.clamped;
4845
+ secondDiff = clampResultForSecond.diff;
4846
+ } else if (secondClamped) {
4847
+ const clampResultForFirst = resizeClamp(firstSize + dragHandleOffset + secondDiff, firstMinSize, firstMaxSize, direction);
4848
+ firstAdjustedSize = clampResultForFirst.value;
4849
+ firstClamped = clampResultForFirst.clamped;
4850
+ firstDiff = clampResultForFirst.diff;
4851
+ }
4852
+ columnSizing[firstId] = __spreadProps(__spreadValues({}, columnSizing[firstId]), {
4853
+ [firstPropertyToAdjust]: firstAdjustedSize
4854
+ });
4855
+ columnSizing[secondId] = __spreadProps(__spreadValues({}, columnSizing[secondId]), {
4856
+ [secondPropertyToAdjust]: secondAdjustedSize
4857
+ });
4858
+ minReached = firstClamped === "min" || secondClamped === "min";
4859
+ maxReached = firstClamped === "max" || secondClamped === "max";
4860
+ } else {
4861
+ columnSizing[firstId] = __spreadProps(__spreadValues({}, columnSizing[firstId]), {
4862
+ [firstPropertyToAdjust]: firstAdjustedSize
4863
+ });
4864
+ minReached = firstClamped === "min";
4865
+ maxReached = firstClamped === "max";
4866
+ }
4867
+ const adjustedDiff = firstAdjustedSize - firstSize;
4868
+ return {
4869
+ adjustedDiff,
4870
+ reservedWidth: !params.shareSpaceOnResize ? reservedWidth - adjustedDiff : reservedWidth,
4871
+ columnSizing,
4872
+ minReached,
4873
+ maxReached,
4874
+ constrained: minReached || maxReached
4875
+ };
4876
+ };
4877
+ function sum(a, b) {
4878
+ return a + b;
4879
+ }
4880
+ function cloneColumnSizing(columnSizing) {
4881
+ const newColumnSizing = Object.keys(columnSizing).reduce((acc, key) => {
4882
+ acc[key] = __spreadValues({}, columnSizing[key]);
4883
+ return acc;
4884
+ }, {});
4885
+ return newColumnSizing;
4886
+ }
4887
+ var computeGroupResize = (params) => {
4888
+ const { availableSize, reservedWidth = 0 } = params;
4889
+ const columnSizing = Object.keys(params.columnSizing).reduce((acc, key) => {
4890
+ acc[key] = __spreadValues({}, params.columnSizing[key]);
4891
+ return acc;
4892
+ }, {});
4893
+ if (availableSize < 0) {
4894
+ throw "The provided availableSize cannot be negative!";
4895
+ }
4896
+ let dragHandleOffset = params.dragHandleOffset;
4897
+ const beforeIndexes = [...new Array(params.columnGroupSize)].map((_, index) => params.dragHandlePositionAfter - index).reverse();
4898
+ const beforeItems = beforeIndexes.map((i) => params.items[i]);
4899
+ const beforeSizes = beforeItems.map((item) => item.computedWidth);
4900
+ const beforePropertiesToAdjust = beforeItems.map((item) => item.computedFlex ? "flex" : "width");
4901
+ let unresizableWidth = 0;
4902
+ const { computedSizes } = computeFlex({
4903
+ items: beforeItems.map((item) => {
4904
+ if (item.resizable === false) {
4905
+ unresizableWidth += item.computedWidth;
4906
+ }
4907
+ return {
4908
+ maxSize: item.computedMaxWidth,
4909
+ minSize: item.computedMinWidth,
4910
+ flex: item.resizable ? item.computedWidth : null,
4911
+ size: 0
4912
+ };
4913
+ }),
4914
+ computeSpecialSpaceDistribution: true,
4915
+ availableSize: Math.max(beforeSizes.reduce(sum, 0) + dragHandleOffset - unresizableWidth, 0)
4916
+ });
4917
+ const diffsForEachItem = beforeItems.map((item, index) => {
4918
+ return computedSizes[index] - item.computedWidth;
4919
+ });
4920
+ let groupMinReached = true;
4921
+ let groupMaxReached = true;
4922
+ let groupConstrained = true;
4923
+ const adjustedDiffs = [];
4924
+ diffsForEachItem.forEach((diff, i) => {
4925
+ const item = beforeItems[i];
4926
+ if (!item.resizable) {
4927
+ adjustedDiffs.push(0);
4928
+ return;
4929
+ }
4930
+ const propertyToAdjust = beforePropertiesToAdjust[i];
4931
+ const itemSize = beforeSizes[i];
4932
+ const currentColumnSizing = cloneColumnSizing(columnSizing);
4933
+ const { maxReached, minReached, constrained, adjustedDiff: adjustedDiff2 } = computeResize({
4934
+ availableSize: params.availableSize,
4935
+ reservedWidth: params.reservedWidth,
4936
+ dragHandleOffset: diff,
4937
+ dragHandlePositionAfter: beforeIndexes[i],
4938
+ shareSpaceOnResize: false,
4939
+ items: params.items,
4940
+ columnSizing: currentColumnSizing
4941
+ });
4942
+ columnSizing[item.id] = __spreadProps(__spreadValues({}, currentColumnSizing[item.id]), {
4943
+ [propertyToAdjust]: itemSize + adjustedDiff2
4944
+ });
4945
+ adjustedDiffs.push(adjustedDiff2);
4946
+ if (!maxReached) {
4947
+ groupMaxReached = false;
4948
+ }
4949
+ if (!minReached) {
4950
+ groupMinReached = false;
4951
+ }
4952
+ if (!constrained) {
4953
+ groupConstrained = false;
4954
+ }
4955
+ });
4956
+ const adjustedDiff = adjustedDiffs.reduce(sum, 0);
4957
+ return {
4958
+ minReached: groupMinReached,
4959
+ maxReached: groupMaxReached,
4960
+ constrained: groupConstrained,
4961
+ adjustedDiffs,
4962
+ adjustedDiff,
4963
+ columnSizing,
4964
+ reservedWidth: reservedWidth - adjustedDiff
4965
+ };
4966
+ };
4967
+
4968
+ // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
4969
+ import React20, { useRef as useRef12, useState as useState9 } from "react";
4970
+
4971
+ // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts
4972
+ function getColumnResizer(colIndex, {
4973
+ columns,
4974
+ shareSpaceOnResize,
4975
+ domRef
4976
+ }) {
4977
+ const column = columns[colIndex];
4978
+ return {
4979
+ resize(diff) {
4980
+ setInfiniteColumnWidth(colIndex, column.computedWidth + diff, domRef.current);
4981
+ const nextColIndex = colIndex + 1;
4982
+ if (shareSpaceOnResize) {
4983
+ const nextColumn = columns[nextColIndex];
4984
+ if (!nextColumn) {
4985
+ return;
4986
+ }
4987
+ setInfiniteColumnWidth(nextColIndex, nextColumn.computedWidth - diff, domRef.current);
4988
+ setInfiniteColumnOffset(nextColIndex, nextColumn.computedOffset + diff, domRef.current);
4989
+ return;
4990
+ }
4991
+ for (let i = nextColIndex, len = columns.length; i < len; i++) {
4992
+ setInfiniteColumnOffset(i, columns[i].computedOffset + diff, domRef.current);
4993
+ }
4994
+ }
4995
+ };
4996
+ }
4997
+ function getColumnGroupResizer(colIndexes, config) {
4998
+ const lastColIndex = colIndexes[colIndexes.length - 1];
4999
+ return {
5000
+ resize(diffs) {
5001
+ const { columns, domRef } = config;
5002
+ let offset = columns[colIndexes[0]].computedOffset;
5003
+ let diffSum = 0;
5004
+ const node = domRef.current;
5005
+ diffs.forEach((diff, i) => {
5006
+ diffSum += diff;
5007
+ const colIndex = colIndexes[i];
5008
+ const column = columns[colIndex];
5009
+ const newWidth = column.computedWidth + diff;
5010
+ setInfiniteColumnWidth(colIndex, newWidth, node);
5011
+ if (offset) {
5012
+ setInfiniteColumnOffset(colIndex, offset, node);
5013
+ }
5014
+ offset += newWidth;
5015
+ });
5016
+ for (let i = lastColIndex + 1; i < columns.length; i++) {
5017
+ setInfiniteColumnOffset(i, columns[i].computedOffset + diffSum, node);
5018
+ }
5019
+ }
5020
+ };
5021
+ }
5022
+
5023
+ // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
5024
+ var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5025
+ var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iwv _16lm1iw11 _16lm1iwz _16lm1iwe";
5026
+ var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "zneyzh1 _16lm1iw2 _16lm1iwv _16lm1iwz", variantClassNames: { constrained: { false: "zneyzh2", true: "zneyzh3" } }, defaultVariants: {}, compoundVariants: [] });
5027
+
5028
+ // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
5029
+ var { rootClassName: rootClassName7 } = internalProps;
5030
+ var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName7}HeaderCell_ResizeHandle`;
5031
+ function ResizeHandleFn(props) {
5032
+ const domRef = useRef12(null);
5033
+ const [constrained, setConstrained] = useState9(false);
5034
+ const constrainedRef = useRef12(constrained);
5035
+ constrainedRef.current = constrained;
5036
+ const onPointerDown = (e) => {
5037
+ e.stopPropagation();
5038
+ const shareSpaceOnResize = !!e.shiftKey;
5039
+ const pointerId = e.pointerId;
5040
+ const initialX = e.clientX;
5041
+ const target = e.target;
5042
+ target.setPointerCapture(pointerId);
5043
+ const resizer = getColumnResizer(props.columnIndex, {
5044
+ columns: props.columns,
5045
+ shareSpaceOnResize,
5046
+ domRef
5047
+ });
5048
+ const resizeDiff = (diff) => {
5049
+ const { adjustedDiff, constrained: constrained2 } = props.computeResize({
5050
+ diff,
5051
+ shareSpaceOnResize
5052
+ });
5053
+ if (constrainedRef.current !== constrained2) {
5054
+ setConstrained(constrained2);
5055
+ }
5056
+ resizer.resize(adjustedDiff);
5057
+ return adjustedDiff;
5058
+ };
5059
+ const onPointerMove = (e2) => {
5060
+ resizeDiff(Math.round(e2.clientX - initialX));
5061
+ };
5062
+ const onPointerUp = (e2) => {
5063
+ target.releasePointerCapture(pointerId);
5064
+ target.removeEventListener("pointermove", onPointerMove);
5065
+ target.removeEventListener("pointerup", onPointerUp);
5066
+ const diff = Math.round(e2.clientX - initialX);
5067
+ const adjustedDiff = resizeDiff(diff);
5068
+ props.onResize({ diff: adjustedDiff, shareSpaceOnResize });
5069
+ };
5070
+ target.addEventListener("pointermove", onPointerMove);
5071
+ target.addEventListener("pointerup", onPointerUp);
5072
+ };
5073
+ return /* @__PURE__ */ React20.createElement("div", {
5074
+ ref: domRef,
5075
+ className: `${InfiniteTableHeaderCellResizeHandleCls} ${ResizeHandleCls}`,
5076
+ onPointerDown
5077
+ }, /* @__PURE__ */ React20.createElement("div", {
5078
+ className: ResizeHandleDraggerClsRecipe({
5079
+ constrained
5080
+ })
5081
+ }));
5082
+ }
5083
+ var ResizeHandle = React20.memo(ResizeHandleFn);
5084
+
5085
+ // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
5086
+ function useColumnResizeHandle(column) {
5087
+ const {
5088
+ computed: { computedVisibleColumns },
5089
+ componentState: { domRef },
5090
+ getState,
5091
+ getComputed,
5092
+ componentActions
5093
+ } = useInfiniteTable();
5094
+ const computeResizeForDiff = useCallback7(({
5095
+ diff,
5096
+ shareSpaceOnResize
5097
+ }) => {
5098
+ const state = getState();
5099
+ const { columnSizing, viewportReservedWidth, bodySize, activeCellIndex } = state;
5100
+ const columns = getComputed().computedVisibleColumns;
5101
+ let atLeastOneFlex = false;
5102
+ const columnSizingWithFlex = columns.reduce((acc, col) => {
5103
+ if (col.computedFlex) {
5104
+ acc[col.id] = __spreadProps(__spreadValues({}, columnSizing[col.id]), { flex: col.computedWidth });
5105
+ atLeastOneFlex = true;
5106
+ }
5107
+ return acc;
5108
+ }, {});
5109
+ const columnSizingForResize = atLeastOneFlex ? __spreadValues(__spreadValues({}, columnSizing), columnSizingWithFlex) : columnSizing;
5110
+ const result = computeResize({
5111
+ shareSpaceOnResize,
5112
+ availableSize: bodySize.width,
5113
+ reservedWidth: viewportReservedWidth || 0,
5114
+ dragHandleOffset: diff,
5115
+ dragHandlePositionAfter: column.computedVisibleIndex,
5116
+ columnSizing: columnSizingForResize,
5117
+ items: columns.map((c) => {
5118
+ return {
5119
+ id: c.id,
5120
+ computedFlex: c.computedFlex,
5121
+ computedWidth: c.computedWidth,
5122
+ computedMinWidth: c.computedMinWidth,
5123
+ computedMaxWidth: c.computedMaxWidth
5124
+ };
5125
+ })
5126
+ });
5127
+ if (activeCellIndex && activeCellIndex[1] >= column.computedVisibleIndex) {
5128
+ const activeColumn = columns[activeCellIndex[1]];
5129
+ const currentColumn = columns[column.computedVisibleIndex];
5130
+ if (activeCellIndex[1] === currentColumn.computedVisibleIndex) {
5131
+ setInfiniteColumnWidth(currentColumn.computedVisibleIndex, currentColumn.computedWidth + result.adjustedDiff, domRef.current);
5132
+ } else if (activeColumn) {
5133
+ setInfiniteColumnOffset(activeColumn.computedVisibleIndex, activeColumn.computedOffset + result.adjustedDiff, domRef.current);
5134
+ }
5135
+ if (shareSpaceOnResize && activeCellIndex[1] === currentColumn.computedVisibleIndex + 1 && activeColumn) {
5136
+ setInfiniteColumnWidth(activeColumn.computedVisibleIndex, activeColumn.computedWidth - result.adjustedDiff, domRef.current);
5137
+ }
5138
+ }
5139
+ return result;
5140
+ }, []);
5141
+ const onColumnResize = useCallback7(({
5142
+ diff,
5143
+ shareSpaceOnResize
5144
+ }) => {
5145
+ const { columnSizing, reservedWidth } = computeResizeForDiff({
5146
+ diff,
5147
+ shareSpaceOnResize
5148
+ });
5149
+ if (!shareSpaceOnResize) {
5150
+ componentActions.viewportReservedWidth = reservedWidth;
5151
+ }
5152
+ componentActions.columnSizing = columnSizing;
5153
+ }, []);
5154
+ const resizeHandle = column.computedResizable ? /* @__PURE__ */ createElement15(ResizeHandle, {
5155
+ columns: computedVisibleColumns,
5156
+ columnIndex: column.computedVisibleIndex,
5157
+ computeResize: computeResizeForDiff,
5158
+ onResize: onColumnResize
5159
+ }) : null;
5160
+ return resizeHandle;
5161
+ }
5162
+
4531
5163
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
4532
5164
  var InfiniteTableHeaderCellContext = createContext4(null);
4533
- var { rootClassName: rootClassName7 } = internalProps;
4534
- var InfiniteTableHeaderCellClassName = `${rootClassName7}HeaderCell`;
5165
+ var { rootClassName: rootClassName8 } = internalProps;
5166
+ var InfiniteTableHeaderCellClassName = `${rootClassName8}HeaderCell`;
4535
5167
  function InfiniteTableHeaderCell(props) {
4536
5168
  var _a, _b, _c, _d, _e;
4537
5169
  const column = props.column;
@@ -4539,13 +5171,13 @@ function InfiniteTableHeaderCell(props) {
4539
5171
  const { onResize, height, width, headerOptions } = props;
4540
5172
  const sortInfo = column.computedSortInfo;
4541
5173
  let header = column.header;
4542
- const ref = useCallback7((node) => {
5174
+ const ref = useCallback8((node) => {
4543
5175
  var _a2;
4544
5176
  domRef.current = node;
4545
5177
  (_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
4546
5178
  }, [props.domRef]);
4547
5179
  const alwaysShow = headerOptions.alwaysReserveSpaceForSortIcon;
4548
- const sortTool = column.computedSorted || alwaysShow ? /* @__PURE__ */ createElement15(SortIcon, {
5180
+ const sortTool = column.computedSorted || alwaysShow ? /* @__PURE__ */ createElement16(SortIcon, {
4549
5181
  index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
4550
5182
  className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls} ${HeaderSortIconRecipe({
4551
5183
  align: column.align || "start"
@@ -4562,15 +5194,15 @@ function InfiniteTableHeaderCell(props) {
4562
5194
  const align = column.align || "start";
4563
5195
  const renderChildren = () => {
4564
5196
  if (header instanceof Function) {
4565
- header = /* @__PURE__ */ createElement15(RenderHookComponent, {
5197
+ header = /* @__PURE__ */ createElement16(RenderHookComponent, {
4566
5198
  render: header,
4567
5199
  renderParam
4568
5200
  });
4569
5201
  }
4570
5202
  header = header != null ? header : column.name;
4571
- return /* @__PURE__ */ createElement15(Fragment2, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
5203
+ return /* @__PURE__ */ createElement16(Fragment2, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
4572
5204
  };
4573
- const domRef = useRef12(null);
5205
+ const domRef = useRef13(null);
4574
5206
  const {
4575
5207
  computed: {
4576
5208
  computedRemainingSpace,
@@ -4597,7 +5229,7 @@ function InfiniteTableHeaderCell(props) {
4597
5229
  const style = {
4598
5230
  height
4599
5231
  };
4600
- const { onPointerDown, onPointerUp, dragging, draggingDiff, proxyOffset } = useColumnPointerEvents({
5232
+ const { onPointerDown, dragging, draggingDiff, proxyOffset } = useColumnPointerEvents({
4601
5233
  computedRemainingSpace,
4602
5234
  columnId: column.id,
4603
5235
  domRef,
@@ -4605,7 +5237,7 @@ function InfiniteTableHeaderCell(props) {
4605
5237
  });
4606
5238
  let draggingProxy = null;
4607
5239
  if (dragging) {
4608
- draggingProxy = /* @__PURE__ */ createElement15("div", {
5240
+ draggingProxy = /* @__PURE__ */ createElement16("div", {
4609
5241
  className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
4610
5242
  style: {
4611
5243
  position: "absolute",
@@ -4622,7 +5254,7 @@ function InfiniteTableHeaderCell(props) {
4622
5254
  const contentRecipeVariants = {
4623
5255
  filtered: column.computedFiltered
4624
5256
  };
4625
- const setFilterValue = useCallback7((filterValue) => {
5257
+ const setFilterValue = useCallback8((filterValue) => {
4626
5258
  var _a2;
4627
5259
  const state = getDataSourceState();
4628
5260
  let newFilterValue = (_a2 = state.filterValue) != null ? _a2 : [];
@@ -4683,10 +5315,10 @@ function InfiniteTableHeaderCell(props) {
4683
5315
  ]);
4684
5316
  const filterType = column.computedFilterType;
4685
5317
  const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
4686
- const resizeHandle = null;
4687
- return /* @__PURE__ */ createElement15(ContextProvider, {
5318
+ const resizeHandle = useColumnResizeHandle(column);
5319
+ return /* @__PURE__ */ createElement16(ContextProvider, {
4688
5320
  value: renderParam
4689
- }, /* @__PURE__ */ createElement15(InfiniteTableCell, {
5321
+ }, /* @__PURE__ */ createElement16(InfiniteTableCell, {
4690
5322
  domRef: ref,
4691
5323
  cellType: "header",
4692
5324
  column,
@@ -4696,12 +5328,11 @@ function InfiniteTableHeaderCell(props) {
4696
5328
  style,
4697
5329
  width,
4698
5330
  onPointerDown,
4699
- onPointerUp,
4700
5331
  contentClassName: join(HeaderCellContentRecipe(contentRecipeVariants), justifyContent[(_c = column.align) != null ? _c : "start"]),
4701
5332
  contentStyle: showColumnFilters ? { height: height / 2 } : void 0,
4702
5333
  className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, { dragging, zebra: false, rowActive: false }), CellCls),
4703
5334
  cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
4704
- afterChildren: /* @__PURE__ */ createElement15(Fragment2, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ createElement15(InfiniteTableColumnHeaderFilter, {
5335
+ afterChildren: /* @__PURE__ */ createElement16(Fragment2, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ createElement16(InfiniteTableColumnHeaderFilter, {
4705
5336
  filterEditor: FilterEditor,
4706
5337
  filterTypes,
4707
5338
  onChange: debouncedOnFilterValueChange,
@@ -4709,7 +5340,7 @@ function InfiniteTableHeaderCell(props) {
4709
5340
  columnLabel: column.field || column.name || column.id,
4710
5341
  columnFilterValue: column.computedFilterValue,
4711
5342
  columnHeaderHeight
4712
- }) : /* @__PURE__ */ createElement15(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
5343
+ }) : /* @__PURE__ */ createElement16(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
4713
5344
  renderChildren
4714
5345
  }), draggingProxy);
4715
5346
  }
@@ -4720,8 +5351,8 @@ function useInfiniteHeaderCell() {
4720
5351
 
4721
5352
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
4722
5353
  import {
4723
- createElement as createElement18,
4724
- useCallback as useCallback9,
5354
+ createElement as createElement20,
5355
+ useCallback as useCallback11,
4725
5356
  useMemo as useMemo6
4726
5357
  } from "react";
4727
5358
 
@@ -4809,7 +5440,7 @@ function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap, c
4809
5440
  let groupOffset = 0;
4810
5441
  map2.forEach((item) => {
4811
5442
  if (!item.ref.columnGroup) {
4812
- const itemWidth = item.type === "column" ? item.ref.computedWidth : item.columnItems.reduce((sum, col) => sum + col.ref.computedWidth, 0);
5443
+ const itemWidth = item.type === "column" ? item.ref.computedWidth : item.columnItems.reduce((sum2, col) => sum2 + col.ref.computedWidth, 0);
4813
5444
  item.groupOffset = groupOffset;
4814
5445
  item.computedWidth = itemWidth;
4815
5446
  if (item.type === "group") {
@@ -4834,7 +5465,7 @@ function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap, c
4834
5465
  }
4835
5466
  function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
4836
5467
  items.forEach((item) => {
4837
- const itemWidth = item.type === "column" ? item.ref.computedWidth : item.columnItems.reduce((sum, col) => sum + col.ref.computedWidth, 0);
5468
+ const itemWidth = item.type === "column" ? item.ref.computedWidth : item.columnItems.reduce((sum2, col) => sum2 + col.ref.computedWidth, 0);
4838
5469
  item.computedWidth = itemWidth;
4839
5470
  item.groupOffset = groupOffset;
4840
5471
  if (item.type === "group") {
@@ -4846,40 +5477,192 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
4846
5477
 
4847
5478
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
4848
5479
  import {
4849
- createElement as createElement17,
5480
+ createElement as createElement19,
4850
5481
  memo as memo8
4851
5482
  } from "react";
4852
- import { useCallback as useCallback8, useEffect as useEffect12, useRef as useRef13 } from "react";
5483
+ import { useCallback as useCallback10, useEffect as useEffect12, useRef as useRef15 } from "react";
4853
5484
 
4854
5485
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
4855
5486
  import {
4856
- createElement as createElement16
5487
+ createElement as createElement18
5488
+ } from "react";
5489
+
5490
+ // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
5491
+ import {
5492
+ createElement as createElement17
4857
5493
  } from "react";
5494
+ import { useCallback as useCallback9 } from "react";
5495
+
5496
+ // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
5497
+ import React23, { useRef as useRef14, useState as useState10 } from "react";
5498
+ var { rootClassName: rootClassName9 } = internalProps;
5499
+ var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName9}HeaderCell_ResizeHandle`;
5500
+ function GroupResizeHandleFn(props) {
5501
+ const domRef = useRef14(null);
5502
+ const [constrained, setConstrained] = useState10(false);
5503
+ const constrainedRef = useRef14(constrained);
5504
+ constrainedRef.current = constrained;
5505
+ const onPointerDown = (e) => {
5506
+ e.stopPropagation();
5507
+ const pointerId = e.pointerId;
5508
+ const initialX = e.clientX;
5509
+ const target = e.target;
5510
+ target.setPointerCapture(pointerId);
5511
+ let initialMove = true;
5512
+ const resizer = getColumnGroupResizer(props.groupColumns.map((c) => c.computedVisibleIndex), {
5513
+ columns: props.columns,
5514
+ domRef
5515
+ });
5516
+ const resizeDiff = (diff) => {
5517
+ const { constrained: constrained2, adjustedDiffs, adjustedDiff } = props.computeResize(diff);
5518
+ if (constrainedRef.current !== constrained2) {
5519
+ setConstrained(constrained2);
5520
+ }
5521
+ resizer.resize(adjustedDiffs);
5522
+ return adjustedDiff;
5523
+ };
5524
+ const onPointerMove = (e2) => {
5525
+ if (initialMove) {
5526
+ const maxDiff = props.groupColumns.reduce((diff, col) => {
5527
+ return diff + col.computedWidth - col.computedMinWidth;
5528
+ }, 0);
5529
+ const currentSize = props.brain.getAvailableSize();
5530
+ const newSize = {
5531
+ width: currentSize.width + maxDiff,
5532
+ height: currentSize.height
5533
+ };
5534
+ props.brain.setAvailableSize(newSize);
5535
+ initialMove = false;
5536
+ }
5537
+ resizeDiff(Math.round(e2.clientX - initialX));
5538
+ };
5539
+ const onPointerUp = (e2) => {
5540
+ target.releasePointerCapture(pointerId);
5541
+ target.removeEventListener("pointermove", onPointerMove);
5542
+ target.removeEventListener("pointerup", onPointerUp);
5543
+ const diff = Math.round(e2.clientX - initialX);
5544
+ const adjustedDiffs = resizeDiff(diff);
5545
+ props.onResize(adjustedDiffs);
5546
+ };
5547
+ target.addEventListener("pointermove", onPointerMove);
5548
+ target.addEventListener("pointerup", onPointerUp);
5549
+ };
5550
+ return /* @__PURE__ */ React23.createElement("div", {
5551
+ ref: domRef,
5552
+ className: `${InfiniteTableHeaderCellResizeHandleCls2} ${ResizeHandleCls}`,
5553
+ onPointerDown
5554
+ }, /* @__PURE__ */ React23.createElement("div", {
5555
+ style: props.style,
5556
+ className: ResizeHandleDraggerClsRecipe({
5557
+ constrained
5558
+ })
5559
+ }));
5560
+ }
5561
+ var GroupResizeHandle = React23.memo(GroupResizeHandleFn);
5562
+
5563
+ // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
5564
+ function useColumnGroupResizeHandle(groupColumns, config) {
5565
+ const { bodyBrain, groupHeight, columnGroup, columnGroupsMaxDepth } = config;
5566
+ const {
5567
+ computed: { computedVisibleColumns },
5568
+ getState,
5569
+ getComputed,
5570
+ componentActions
5571
+ } = useInfiniteTable();
5572
+ const lastColumnInGroup = groupColumns[groupColumns.length - 1];
5573
+ const computeResizeForDiff = useCallback9((diff) => {
5574
+ const state = getState();
5575
+ const { columnSizing, viewportReservedWidth, bodySize } = state;
5576
+ const columns = getComputed().computedVisibleColumns;
5577
+ let atLeastOneFlex = false;
5578
+ const columnSizingWithFlex = columns.reduce((acc, col) => {
5579
+ if (col.computedFlex) {
5580
+ acc[col.id] = __spreadProps(__spreadValues({}, columnSizing[col.id]), { flex: col.computedWidth });
5581
+ atLeastOneFlex = true;
5582
+ }
5583
+ return acc;
5584
+ }, {});
5585
+ const columnSizingForResize = atLeastOneFlex ? __spreadValues(__spreadValues({}, columnSizing), columnSizingWithFlex) : columnSizing;
5586
+ const result = computeGroupResize({
5587
+ availableSize: bodySize.width,
5588
+ reservedWidth: viewportReservedWidth || 0,
5589
+ dragHandleOffset: diff,
5590
+ dragHandlePositionAfter: lastColumnInGroup.computedVisibleIndex,
5591
+ columnSizing: columnSizingForResize,
5592
+ columnGroupSize: groupColumns.length,
5593
+ items: columns.map((c) => {
5594
+ return {
5595
+ id: c.id,
5596
+ resizable: c.computedResizable,
5597
+ computedFlex: c.computedFlex,
5598
+ computedWidth: c.computedWidth,
5599
+ computedMinWidth: c.computedMinWidth,
5600
+ computedMaxWidth: c.computedMaxWidth
5601
+ };
5602
+ })
5603
+ });
5604
+ return result;
5605
+ }, []);
5606
+ const onColumnResize = useCallback9((diff) => {
5607
+ const { columnSizing, reservedWidth } = computeResizeForDiff(diff);
5608
+ componentActions.viewportReservedWidth = reservedWidth;
5609
+ componentActions.columnSizing = columnSizing;
5610
+ }, []);
5611
+ const groupResizable = groupColumns.some((c) => c.computedResizable);
5612
+ const resizeHandle = groupResizable ? /* @__PURE__ */ createElement17(GroupResizeHandle, {
5613
+ brain: bodyBrain,
5614
+ style: {
5615
+ height: groupHeight * (columnGroupsMaxDepth - columnGroup.depth + 2)
5616
+ },
5617
+ columns: computedVisibleColumns,
5618
+ groupColumns,
5619
+ computeResize: computeResizeForDiff,
5620
+ onResize: onColumnResize
5621
+ }) : null;
5622
+ return resizeHandle;
5623
+ }
5624
+
5625
+ // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
4858
5626
  var TableHeaderGroupClassName = `${rootClassName2}HeaderGroup`;
5627
+ var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
4859
5628
  function InfiniteTableHeaderGroup(props) {
4860
- const { columnGroup, height, width } = props;
5629
+ const {
5630
+ computed: { computedVisibleColumns }
5631
+ } = useInfiniteTable();
5632
+ const { columnGroup, height, columns, bodyBrain, columnGroupsMaxDepth } = props;
4861
5633
  let { header } = columnGroup;
4862
5634
  if (header instanceof Function) {
4863
5635
  header = header({
4864
5636
  columnGroup
4865
5637
  });
4866
5638
  }
4867
- return /* @__PURE__ */ createElement16("div", {
5639
+ const handle = useColumnGroupResizeHandle(columns, {
5640
+ bodyBrain,
5641
+ groupHeight: height,
5642
+ columnGroup,
5643
+ columnGroupsMaxDepth
5644
+ });
5645
+ const firstColumn = columns[0];
5646
+ const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex3}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex3}-${firstColumn.computedVisibleIndex})`;
5647
+ const zIndex2 = computedVisibleColumns.length * 10 - firstColumn.computedVisibleIndex * 10 + height * (columnGroupsMaxDepth - columnGroup.depth + 2);
5648
+ return /* @__PURE__ */ createElement18("div", {
4868
5649
  ref: props.domRef,
4869
5650
  "data-group-id": columnGroup.uniqueGroupId,
4870
5651
  className: join(HeaderGroupCls, TableHeaderGroupClassName),
4871
- style: { width, height }
4872
- }, /* @__PURE__ */ createElement16("div", {
5652
+ style: { width, height },
5653
+ "data-z-index": zIndex2
5654
+ }, /* @__PURE__ */ createElement18("div", {
4873
5655
  className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
4874
- }, header));
5656
+ }, header), handle);
4875
5657
  }
4876
5658
 
4877
5659
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
4878
- var { rootClassName: rootClassName8 } = internalProps;
4879
- var TableHeaderClassName = `${rootClassName8}Header`;
5660
+ var { rootClassName: rootClassName10 } = internalProps;
5661
+ var TableHeaderClassName = `${rootClassName10}Header`;
4880
5662
  function InfiniteTableHeaderFn(props) {
4881
5663
  const {
4882
- brain,
5664
+ bodyBrain,
5665
+ headerBrain: brain,
4883
5666
  columns,
4884
5667
  style,
4885
5668
  className,
@@ -4901,7 +5684,7 @@ function InfiniteTableHeaderFn(props) {
4901
5684
  const removeOnScroll = brain.onScroll(onScroll);
4902
5685
  return removeOnScroll;
4903
5686
  }, [brain]);
4904
- const domRef = useRef13(null);
5687
+ const domRef = useRef15(null);
4905
5688
  const headerCls = HeaderClsRecipe({
4906
5689
  overflow: false,
4907
5690
  virtualized: true
@@ -4911,7 +5694,7 @@ function InfiniteTableHeaderFn(props) {
4911
5694
  className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
4912
5695
  style: __spreadProps(__spreadValues({}, style), { height: columnHeaderHeight })
4913
5696
  };
4914
- const renderCell = useCallback8((params) => {
5697
+ const renderCell = useCallback10((params) => {
4915
5698
  const {
4916
5699
  rowIndex,
4917
5700
  colIndex,
@@ -4936,7 +5719,9 @@ function InfiniteTableHeaderFn(props) {
4936
5719
  computedWidth: colGroupItem.computedWidth,
4937
5720
  groupOffset: colGroupItem.groupOffset
4938
5721
  });
4939
- return /* @__PURE__ */ createElement17(InfiniteTableHeaderGroup, {
5722
+ return /* @__PURE__ */ createElement19(InfiniteTableHeaderGroup, {
5723
+ bodyBrain,
5724
+ columnGroupsMaxDepth,
4940
5725
  domRef: domRef2,
4941
5726
  columns: columns2,
4942
5727
  width: widthWithColspan,
@@ -4944,7 +5729,7 @@ function InfiniteTableHeaderFn(props) {
4944
5729
  columnGroup: computedColumnGroup
4945
5730
  });
4946
5731
  }
4947
- return /* @__PURE__ */ createElement17(InfiniteTableHeaderCell, {
5732
+ return /* @__PURE__ */ createElement19(InfiniteTableHeaderCell, {
4948
5733
  domRef: domRef2,
4949
5734
  column,
4950
5735
  headerOptions,
@@ -4960,7 +5745,8 @@ function InfiniteTableHeaderFn(props) {
4960
5745
  columnGroupsMaxDepth,
4961
5746
  showColumnFilters
4962
5747
  ]);
4963
- return /* @__PURE__ */ createElement17("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement17(RawTable, {
5748
+ return /* @__PURE__ */ createElement19("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement19(RawTable, {
5749
+ name: "header",
4964
5750
  renderCell,
4965
5751
  brain: headerBrain,
4966
5752
  cellHoverClassNames: []
@@ -4970,7 +5756,7 @@ var InfiniteTableHeader = memo8(InfiniteTableHeaderFn);
4970
5756
 
4971
5757
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
4972
5758
  function TableHeaderWrapper(props) {
4973
- const { brain, scrollbars } = props;
5759
+ const { headerBrain, bodyBrain, scrollbars } = props;
4974
5760
  const tableContextValue = useInfiniteTable();
4975
5761
  const {
4976
5762
  computedPinnedStartColumns,
@@ -4995,7 +5781,7 @@ function TableHeaderWrapper(props) {
4995
5781
  }
4996
5782
  return buildColumnAndGroupTree(computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap, columnGroupsMaxDepth);
4997
5783
  }, [computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap]);
4998
- const cellspan = useCallback9(({ rowIndex, colIndex }) => {
5784
+ const cellspan = useCallback11(({ rowIndex, colIndex }) => {
4999
5785
  const column = computedVisibleColumns[colIndex];
5000
5786
  const rowspan2 = 1;
5001
5787
  const colspan2 = 1;
@@ -5028,12 +5814,12 @@ function TableHeaderWrapper(props) {
5028
5814
  rows,
5029
5815
  columnGroupsDepthsMap
5030
5816
  ]);
5031
- const rowspan = useCallback9(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).rowspan, [cellspan]);
5032
- const colspan = useCallback9(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).colspan, [cellspan]);
5033
- const rowHeight = useCallback9((index) => {
5817
+ const rowspan = useCallback11(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).rowspan, [cellspan]);
5818
+ const colspan = useCallback11(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).colspan, [cellspan]);
5819
+ const rowHeight = useCallback11((index) => {
5034
5820
  return showColumnFilters ? index < rows - 1 ? columnHeaderHeight : 2 * columnHeaderHeight : columnHeaderHeight;
5035
5821
  }, [rows, showColumnFilters, columnHeaderHeight]);
5036
- useMatrixBrain(brain, {
5822
+ useMatrixBrain(headerBrain, {
5037
5823
  colWidth: columnSize,
5038
5824
  rowHeight,
5039
5825
  rows,
@@ -5045,21 +5831,22 @@ function TableHeaderWrapper(props) {
5045
5831
  fixedColsEnd: computedPinnedEndColumns.length,
5046
5832
  fixedColsStart: computedPinnedStartColumns.length
5047
5833
  });
5048
- const header = /* @__PURE__ */ createElement18(InfiniteTableHeader, {
5834
+ const header = /* @__PURE__ */ createElement20(InfiniteTableHeader, {
5049
5835
  columns: computedVisibleColumns,
5050
- brain,
5836
+ headerBrain,
5837
+ bodyBrain,
5051
5838
  columnHeaderHeight: height,
5052
5839
  columnGroupsMaxDepth,
5053
5840
  columnAndGroupTreeInfo
5054
5841
  });
5055
- const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ createElement18("div", {
5842
+ const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ createElement20("div", {
5056
5843
  className: HeaderScrollbarPlaceholderCls,
5057
5844
  style: {
5058
5845
  zIndex: 1e3,
5059
5846
  width: getScrollbarWidth()
5060
5847
  }
5061
5848
  }) : null;
5062
- return /* @__PURE__ */ createElement18("div", {
5849
+ return /* @__PURE__ */ createElement20("div", {
5063
5850
  className: HeaderWrapperCls,
5064
5851
  style: {
5065
5852
  height
@@ -5069,10 +5856,10 @@ function TableHeaderWrapper(props) {
5069
5856
 
5070
5857
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
5071
5858
  import {
5072
- createElement as createElement19,
5859
+ createElement as createElement21,
5073
5860
  forwardRef as forwardRef4,
5074
- useCallback as useCallback10,
5075
- useRef as useRef14
5861
+ useCallback as useCallback12,
5862
+ useRef as useRef16
5076
5863
  } from "react";
5077
5864
  import { useEffect as useEffect13 } from "react";
5078
5865
 
@@ -5082,17 +5869,13 @@ function decamelize(str, options) {
5082
5869
  return str.replace(/([a-z\d])([A-Z])/g, "$1" + separator + "$2").replace(new RegExp("(" + separator + "[A-Z])([A-Z])", "g"), "$1" + separator + "$2").toLowerCase();
5083
5870
  }
5084
5871
 
5085
- // src/components/InfiniteTable/theme.css.ts
5086
- var ThemeVars = { color: { accent: "var(--infinite-accent-color)", color: "var(--infinite-color)" }, spacing: { "0": "var(--infinite-space-0)", "1": "var(--infinite-space-1)", "2": "var(--infinite-space-2)", "3": "var(--infinite-space-3)", "4": "var(--infinite-space-4)", "5": "var(--infinite-space-5)", "6": "var(--infinite-space-6)", "7": "var(--infinite-space-7)", "8": "var(--infinite-space-8)", "9": "var(--infinite-space-9)", "10": "var(--infinite-space-10)" }, fontSize: { "0": "var(--infinite-font-size-0)", "1": "var(--infinite-font-size-1)", "2": "var(--infinite-font-size-2)", "3": "var(--infinite-font-size-3)", "4": "var(--infinite-font-size-4)", "5": "var(--infinite-font-size-5)", "6": "var(--infinite-font-size-6)", "7": "var(--infinite-font-size-7)" }, fontFamily: "var(--infinite-font-family)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", background: "var(--infinite-background)", components: { LoadMask: { padding: "var(--infinite-load-mask-padding)", color: "var(--infinite-load-mask-color)", textBackground: "var(--infinite-load-mask-text-background)", overlayBackground: "var(--infinite-load-mask-overlay-background)", overlayOpacity: "var(--infinite-load-mask-overlay-opacity)", borderRadius: "var(--infinite-load-mask-border-radius)" }, Header: { background: "var(--infinite-header-background)", color: "var(--infinite-header-color)", columnHeaderHeight: "var(--infinite-column-header-height)" }, HeaderCell: { draggingBackground: "var(--infinite-header-cell-dragging-background)", background: "var(--infinite-header-cell-background)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)" }, Cell: { padding: "var(--infinite-cell-padding)", borderWidth: "var(--infinite-cell-border-width)", border: "var(--infinite-cell-border)", borderInvisible: "var(--infinite-cell-border-invisible)", borderRadius: "var(--infinite-cell-border-radius)", color: "var(--infinite-cell-color)", activeBorderColor_R: "var(--infinite-active-cell-border-color--r)", activeBorderColor_G: "var(--infinite-active-cell-border-color--g)", activeBorderColor_B: "var(--infinite-active-cell-border-color--b)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBorderColor: "var(--infinite-active-cell-border-color)", activeBorderWidth: "var(--infinite-active-cell-border-width)", activeBorderStyle: "var(--infinite-active-cell-border-style)", activeBorder: "var(--infinite-active-cell-border)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", activeBackground: "var(--infinite-active-row-background)", activeBorderColor: "var(--infinite-active-row-border-color)", activeBorderWidth: "var(--infinite-active-row-border-width)", activeBorderStyle: "var(--infinite-active-row-border-style)", activeBorder: "var(--infinite-active-row-border)", activeBackgroundAlpha: "var(--infinite-active-row-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-row-background-alpha--table-unfocused)", hoverBackground: "var(--infinite-row-hover-background)", groupRowBackground: "var(--infinite-group-row-background)", groupRowColumnNesting: "var(--infinite-group-row-column-nesting)", groupNesting: "var(--infinite-dont-override-group-row-nesting-length)", pointerEventsWhileScrolling: "var(--infinite-row-pointer-events-while-scrolling)" }, ColumnCell: { background: "var(--infinite-column-cell-bg-dont-override)" } } };
5087
- var columnHeaderHeightName = "column-header-height";
5088
-
5089
5872
  // src/components/InfiniteTable/InfiniteCls.css.ts
5090
- var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5873
+ var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5091
5874
  var FooterCls = "_16lm1iw1";
5092
- var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwm _16lm1iw12 _16lm1iw0";
5093
- var InfiniteClsRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [[{ focused: false, focusedWithin: false }, "_1yeub2ve"]] });
5094
- var InfiniteClsShiftingColumns = "_16lm1iwp";
5095
- var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
5875
+ var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwn _16lm1iw13 _16lm1iw0";
5876
+ var InfiniteClsRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [[{ focused: false, focusedWithin: false }, "_1yeub2ve"]] });
5877
+ var InfiniteClsShiftingColumns = "_16lm1iwq";
5878
+ var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
5096
5879
 
5097
5880
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
5098
5881
  var defaultStyle = {
@@ -5122,9 +5905,9 @@ var enforceStyle = (node, style) => {
5122
5905
  }
5123
5906
  };
5124
5907
  var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter2(props, ref) {
5125
- const { rootClassName: rootClassName11 } = useInternalProps();
5126
- const domRef = useRef14(null);
5127
- const domCallback = useCallback10((node) => {
5908
+ const { rootClassName: rootClassName13 } = useInternalProps();
5909
+ const domRef = useRef16(null);
5910
+ const domCallback = useCallback12((node) => {
5128
5911
  domRef.current = node;
5129
5912
  if (!ref) {
5130
5913
  return;
@@ -5149,12 +5932,12 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
5149
5932
  clearInterval(intervalId);
5150
5933
  };
5151
5934
  }, []);
5152
- return /* @__PURE__ */ createElement19("div", __spreadProps(__spreadValues({
5935
+ return /* @__PURE__ */ createElement21("div", __spreadProps(__spreadValues({
5153
5936
  ref: domCallback
5154
5937
  }, props), {
5155
- className: join(`${rootClassName11}-Footer`, FooterCls, props.className),
5938
+ className: join(`${rootClassName13}-Footer`, FooterCls, props.className),
5156
5939
  style: defaultStyle
5157
- }), "Powered by", " ", /* @__PURE__ */ createElement19("a", {
5940
+ }), "Powered by", " ", /* @__PURE__ */ createElement21("a", {
5158
5941
  href: "https://infinite-table.com",
5159
5942
  rel: "noopener noreferrer",
5160
5943
  role: "link",
@@ -5165,13 +5948,13 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
5165
5948
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
5166
5949
  import {
5167
5950
  createContext as createContext5,
5168
- createElement as createElement20,
5951
+ createElement as createElement22,
5169
5952
  memo as memo9
5170
5953
  } from "react";
5171
- import { useCallback as useCallback11, useContext as useContext6, useMemo as useMemo7 } from "react";
5172
- var { rootClassName: rootClassName9 } = internalProps;
5954
+ import { useCallback as useCallback13, useContext as useContext6, useMemo as useMemo7 } from "react";
5955
+ var { rootClassName: rootClassName11 } = internalProps;
5173
5956
  var InfiniteTableColumnCellContext = createContext5(null);
5174
- var InfiniteTableColumnCellClassName = `${rootClassName9}ColumnCell`;
5957
+ var InfiniteTableColumnCellClassName = `${rootClassName11}ColumnCell`;
5175
5958
  function isColumnWithField(c) {
5176
5959
  return typeof c.field === "string";
5177
5960
  }
@@ -5185,9 +5968,7 @@ function InfiniteTableColumnCellFn(props) {
5185
5968
  column,
5186
5969
  onMouseLeave,
5187
5970
  onMouseEnter,
5188
- offsetProperty,
5189
5971
  toggleGroupRow,
5190
- virtualized,
5191
5972
  rowIndex,
5192
5973
  rowHeight,
5193
5974
  domRef,
@@ -5195,7 +5976,7 @@ function InfiniteTableColumnCellFn(props) {
5195
5976
  showZebraRows
5196
5977
  } = props;
5197
5978
  if (!column) {
5198
- return /* @__PURE__ */ createElement20("div", {
5979
+ return /* @__PURE__ */ createElement22("div", {
5199
5980
  ref: domRef
5200
5981
  }, "no column");
5201
5982
  }
@@ -5228,7 +6009,7 @@ function InfiniteTableColumnCellFn(props) {
5228
6009
  value
5229
6010
  });
5230
6011
  }
5231
- const onClick = useCallback11(() => {
6012
+ const onClick = useCallback13(() => {
5232
6013
  if (keyboardNavigation === "row") {
5233
6014
  componentActions.activeRowIndex = rowIndex;
5234
6015
  return;
@@ -5268,7 +6049,7 @@ function InfiniteTableColumnCellFn(props) {
5268
6049
  isGroupRow,
5269
6050
  rowIndex,
5270
6051
  toggleGroupRow,
5271
- toggleCurrentGroupRow: useCallback11(() => {
6052
+ toggleCurrentGroupRow: useCallback13(() => {
5272
6053
  if (!rowInfo.isGroupRow) {
5273
6054
  return;
5274
6055
  }
@@ -5277,13 +6058,13 @@ function InfiniteTableColumnCellFn(props) {
5277
6058
  groupBy: computedDataSource.groupBy,
5278
6059
  pivotBy: computedDataSource.pivotBy
5279
6060
  });
5280
- const renderChildren = useCallback11(() => {
6061
+ const renderChildren = useCallback13(() => {
5281
6062
  if (hidden) {
5282
6063
  return null;
5283
6064
  }
5284
6065
  const renderFn = column.render || column.renderValue;
5285
6066
  if (renderFn) {
5286
- return /* @__PURE__ */ createElement20(RenderHookComponent, {
6067
+ return /* @__PURE__ */ createElement22(RenderHookComponent, {
5287
6068
  render: renderFn,
5288
6069
  renderParam
5289
6070
  });
@@ -5300,18 +6081,15 @@ function InfiniteTableColumnCellFn(props) {
5300
6081
  style = typeof rowStyle === "function" ? __spreadValues(__spreadValues({}, style), rowStyle(rowPropsAndStyleArgs)) : __spreadValues(__spreadValues({}, style), rowStyle);
5301
6082
  }
5302
6083
  style = column.style ? typeof column.style === "function" ? __spreadValues(__spreadValues({}, style), column.style(stylingRenderParam) || {}) : __spreadValues(__spreadValues({}, style), column.style) : style || {};
5303
- style.width = width;
5304
6084
  style.height = rowHeight;
5305
6085
  const memoizedStyle = useMemo7(() => style, [!style ? null : JSON.stringify(style)]);
5306
6086
  const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
5307
6087
  const zebra = showZebraRows ? odd ? "odd" : "even" : false;
5308
6088
  const cellProps = {
5309
6089
  domRef,
5310
- offsetProperty,
5311
6090
  cellType: "body",
5312
6091
  column,
5313
6092
  width,
5314
- offset: virtualized ? 0 : column.computedPinningOffset,
5315
6093
  style: memoizedStyle,
5316
6094
  onMouseLeave,
5317
6095
  onMouseEnter,
@@ -5321,9 +6099,9 @@ function InfiniteTableColumnCellFn(props) {
5321
6099
  renderChildren
5322
6100
  };
5323
6101
  const ContextProvider = InfiniteTableColumnCellContext.Provider;
5324
- return /* @__PURE__ */ createElement20(ContextProvider, {
6102
+ return /* @__PURE__ */ createElement22(ContextProvider, {
5325
6103
  value: renderParam
5326
- }, /* @__PURE__ */ createElement20(InfiniteTableCell, __spreadValues({}, cellProps)));
6104
+ }, /* @__PURE__ */ createElement22(InfiniteTableCell, __spreadValues({}, cellProps)));
5327
6105
  }
5328
6106
  var InfiniteTableColumnCell = memo9(InfiniteTableColumnCellFn);
5329
6107
  function useInfiniteColumnCell() {
@@ -5332,32 +6110,32 @@ function useInfiniteColumnCell() {
5332
6110
  }
5333
6111
 
5334
6112
  // src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
5335
- var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
6113
+ var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5336
6114
  var GroupRowExpanderCls = "_7pupv0b";
5337
- var RowClsRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "_7pupv00", variantClassNames: { zebra: { false: "_7pupv02", even: "_7pupv03", odd: "_7pupv04" }, groupRow: { true: "_7pupv05", false: "_7pupv06" }, inlineGroupRow: { true: "_7pupv07", false: "_7pupv08" }, showHoverRows: { true: "_7pupv09", false: "_7pupv0a" } }, defaultVariants: {}, compoundVariants: [] });
6115
+ var RowClsRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_7pupv00", variantClassNames: { zebra: { false: "_7pupv02", even: "_7pupv03", odd: "_7pupv04" }, groupRow: { true: "_7pupv05", false: "_7pupv06" }, inlineGroupRow: { true: "_7pupv07", false: "_7pupv08" }, showHoverRows: { true: "_7pupv09", false: "_7pupv0a" } }, defaultVariants: {}, compoundVariants: [] });
5338
6116
  var RowHoverCls = "_7pupv01";
5339
6117
 
5340
6118
  // src/components/InfiniteTable/components/LoadMask.tsx
5341
6119
  import {
5342
- createElement as createElement21,
6120
+ createElement as createElement23,
5343
6121
  memo as memo10
5344
6122
  } from "react";
5345
6123
 
5346
6124
  // src/components/InfiniteTable/components/LoadMask.css.ts
5347
- var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwu _16lm1iww _16lm1iw10 _16lm1iwy", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwu _16lm1iww _16lm1iw10 _16lm1iwy" };
5348
- var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwu _16lm1iww _16lm1iw10 _16lm1iwy";
6125
+ var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwv _16lm1iwx _16lm1iw11 _16lm1iwz", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwv _16lm1iwx _16lm1iw11 _16lm1iwz" };
6126
+ var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwv _16lm1iwx _16lm1iw11 _16lm1iwz";
5349
6127
  var LoadMaskTextCls = "qy58ya4";
5350
6128
 
5351
6129
  // src/components/InfiniteTable/components/LoadMask.tsx
5352
- var { rootClassName: rootClassName10 } = internalProps;
5353
- var baseCls3 = `${rootClassName10}-LoadMask`;
6130
+ var { rootClassName: rootClassName12 } = internalProps;
6131
+ var baseCls3 = `${rootClassName12}-LoadMask`;
5354
6132
  function LoadMaskFn(props) {
5355
6133
  const { visible, children = "Loading" } = props;
5356
- return /* @__PURE__ */ createElement21("div", {
6134
+ return /* @__PURE__ */ createElement23("div", {
5357
6135
  className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls3}`
5358
- }, /* @__PURE__ */ createElement21("div", {
6136
+ }, /* @__PURE__ */ createElement23("div", {
5359
6137
  className: `${LoadMaskOverlayCls} ${baseCls3}-Overlay`
5360
- }), /* @__PURE__ */ createElement21("div", {
6138
+ }), /* @__PURE__ */ createElement23("div", {
5361
6139
  className: `${LoadMaskTextCls} ${baseCls3}-Text`
5362
6140
  }, children));
5363
6141
  }
@@ -5428,8 +6206,8 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
5428
6206
  // src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
5429
6207
  import {
5430
6208
  useEffect as useEffect14,
5431
- useRef as useRef15,
5432
- useState as useState10
6209
+ useRef as useRef17,
6210
+ useState as useState11
5433
6211
  } from "react";
5434
6212
  var OFFSET = 10;
5435
6213
  function getColumnContentMaxWidths(domRef, options) {
@@ -5466,9 +6244,15 @@ function getColumnContentMaxWidths(domRef, options) {
5466
6244
  cell.childNodes.forEach((child) => {
5467
6245
  if (child !== content) {
5468
6246
  const el = child;
5469
- otherElementsLength += Math.max(el.offsetWidth, parseInt(el.style.width, 10));
5470
- const style = getGlobal().getComputedStyle(el);
5471
- otherElementsLength += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
6247
+ let elWidth = Math.max(el.offsetWidth, parseInt(el.style.width, 10));
6248
+ if (isNaN(elWidth)) {
6249
+ elWidth = 0;
6250
+ }
6251
+ otherElementsLength += elWidth;
6252
+ if (elWidth > 0) {
6253
+ const style = getGlobal().getComputedStyle(el);
6254
+ otherElementsLength += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
6255
+ }
5472
6256
  }
5473
6257
  });
5474
6258
  measuredWidth += otherElementsLength;
@@ -5490,10 +6274,10 @@ function useAutoSizeColumns() {
5490
6274
  componentActions,
5491
6275
  componentState: { domRef, ready, autoSizeColumnsKey, brain }
5492
6276
  } = useComponentState();
5493
- const [refreshId, setRefreshId] = useState10(0);
6277
+ const [refreshId, setRefreshId] = useState11(0);
5494
6278
  const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
5495
6279
  const getTheKey = useLatest(theKey);
5496
- const lastExecutedIdentifierRef = useRef15(null);
6280
+ const lastExecutedIdentifierRef = useRef17(null);
5497
6281
  useEffect14(() => {
5498
6282
  const key = getTheKey();
5499
6283
  if (key == null) {
@@ -5552,8 +6336,8 @@ function useAutoSizeColumns() {
5552
6336
  }
5553
6337
 
5554
6338
  // src/components/InfiniteTable/hooks/useCellRendering.tsx
5555
- import { useCallback as useCallback12, useEffect as useEffect15, useRef as useRef16 } from "react";
5556
- import React27 from "react";
6339
+ import { useCallback as useCallback14, useEffect as useEffect15, useRef as useRef18 } from "react";
6340
+ import React31 from "react";
5557
6341
 
5558
6342
  // src/components/InfiniteTable/hooks/useYourBrain.ts
5559
6343
  function useYourBrain(param) {
@@ -5623,7 +6407,7 @@ function useCellRendering(param) {
5623
6407
  bodySize,
5624
6408
  rowspan
5625
6409
  });
5626
- const scrollTopMaxRef = useRef16(0);
6410
+ const scrollTopMaxRef = useRef18(0);
5627
6411
  useEffect15(() => {
5628
6412
  return brain.onRenderCountChange(() => {
5629
6413
  scrollTopMaxRef.current = brain.scrollTopMax;
@@ -5660,7 +6444,7 @@ function useCellRendering(param) {
5660
6444
  useEffect15(() => {
5661
6445
  rerender();
5662
6446
  }, [dataSourceState]);
5663
- const renderCell = useCallback12((params) => {
6447
+ const renderCell = useCallback14((params) => {
5664
6448
  const {
5665
6449
  rowIndex,
5666
6450
  colIndex,
@@ -5695,7 +6479,7 @@ function useCellRendering(param) {
5695
6479
  rowStyle,
5696
6480
  rowClassName
5697
6481
  };
5698
- return /* @__PURE__ */ React27.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
6482
+ return /* @__PURE__ */ React31.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
5699
6483
  }, [
5700
6484
  rowHeight,
5701
6485
  getData,
@@ -5713,7 +6497,7 @@ function useCellRendering(param) {
5713
6497
  }
5714
6498
 
5715
6499
  // src/components/InfiniteTable/hooks/useComputed.ts
5716
- import { useCallback as useCallback15, useEffect as useEffect25, useState as useState14 } from "react";
6500
+ import { useCallback as useCallback17, useEffect as useEffect25, useState as useState15 } from "react";
5717
6501
 
5718
6502
  // src/components/InfiniteTable/hooks/useColumnGroups.ts
5719
6503
  import { useEffect as useEffect17 } from "react";
@@ -5882,10 +6666,10 @@ function useColumnRowspan(computedVisibleColumns) {
5882
6666
  }
5883
6667
 
5884
6668
  // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
5885
- import { useCallback as useCallback13 } from "react";
6669
+ import { useCallback as useCallback15 } from "react";
5886
6670
  var debug4 = dbg("useColumnSizeFn");
5887
6671
  function useColumnSizeFn(columns) {
5888
- const columnSize = useCallback13((index) => {
6672
+ const columnSize = useCallback15((index) => {
5889
6673
  const column = columns[index];
5890
6674
  if (false) {
5891
6675
  debug4("cannot find column at index", index, columns);
@@ -5900,14 +6684,9 @@ import { useEffect as useEffect22, useMemo as useMemo10 } from "react";
5900
6684
 
5901
6685
  // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
5902
6686
  import {
5903
- createElement as createElement24
6687
+ createElement as createElement26
5904
6688
  } from "react";
5905
6689
 
5906
- // src/utils/stripVar.ts
5907
- function stripVar(cssVariableWithVarString) {
5908
- return cssVariableWithVarString.slice(4, -1);
5909
- }
5910
-
5911
6690
  // src/components/DataSource/state/rowInfoStatus.ts
5912
6691
  var showLoadingIcon = (rowInfo) => {
5913
6692
  if (rowInfo.dataSourceHasGrouping) {
@@ -5918,21 +6697,21 @@ var showLoadingIcon = (rowInfo) => {
5918
6697
 
5919
6698
  // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
5920
6699
  import {
5921
- createElement as createElement22,
6700
+ createElement as createElement24,
5922
6701
  useEffect as useEffect18
5923
6702
  } from "react";
5924
- import { useState as useState11 } from "react";
6703
+ import { useState as useState12 } from "react";
5925
6704
 
5926
6705
  // src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
5927
- var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5928
- var ExpanderIconCls = "_16lm1iw6 _16lm1iwg _16lm1iwd";
5929
- var ExpanderIconClsVariants = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "_16lm1iwc", false: "_198z9782" } }, defaultVariants: {}, compoundVariants: [] });
6706
+ var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
6707
+ var ExpanderIconCls = "_16lm1iw6 _16lm1iwh _16lm1iwd";
6708
+ var ExpanderIconClsVariants = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "_16lm1iwc", false: "_198z9782" } }, defaultVariants: {}, compoundVariants: [] });
5930
6709
 
5931
6710
  // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
5932
6711
  function ExpanderIcon(props) {
5933
6712
  var _a;
5934
6713
  const { size = 24 } = props;
5935
- const [expanded, setExpanded] = useState11((_a = props.expanded) != null ? _a : props.defaultExpanded);
6714
+ const [expanded, setExpanded] = useState12((_a = props.expanded) != null ? _a : props.defaultExpanded);
5936
6715
  const onClick = () => {
5937
6716
  var _a2;
5938
6717
  (_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
@@ -5945,7 +6724,7 @@ function ExpanderIcon(props) {
5945
6724
  setExpanded(props.expanded);
5946
6725
  }
5947
6726
  }, [props.expanded]);
5948
- return /* @__PURE__ */ createElement22("svg", {
6727
+ return /* @__PURE__ */ createElement24("svg", {
5949
6728
  "data-name": "expander-icon",
5950
6729
  xmlns: "http://www.w3.org/2000/svg",
5951
6730
  height: `${size}px`,
@@ -5956,22 +6735,22 @@ function ExpanderIcon(props) {
5956
6735
  className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
5957
6736
  expanded
5958
6737
  }), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`)
5959
- }, /* @__PURE__ */ createElement22("path", {
6738
+ }, /* @__PURE__ */ createElement24("path", {
5960
6739
  d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
5961
6740
  }));
5962
6741
  }
5963
6742
 
5964
6743
  // src/components/InfiniteTable/components/icons/LoadingIcon.tsx
5965
6744
  import {
5966
- createElement as createElement23
6745
+ createElement as createElement25
5967
6746
  } from "react";
5968
6747
 
5969
6748
  // src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
5970
- var LoadingIconCls = "_16lm1iw8 _16lm1iwg _16lm1iwd";
6749
+ var LoadingIconCls = "_16lm1iw8 _16lm1iwh _16lm1iwd";
5971
6750
 
5972
6751
  // src/components/InfiniteTable/components/icons/LoadingIcon.tsx
5973
6752
  var LoadingIcon = (props) => {
5974
- return /* @__PURE__ */ createElement23("svg", {
6753
+ return /* @__PURE__ */ createElement25("svg", {
5975
6754
  xmlns: "http://www.w3.org/2000/svg",
5976
6755
  style: {
5977
6756
  margin: "auto",
@@ -5983,14 +6762,14 @@ var LoadingIcon = (props) => {
5983
6762
  viewBox: "0 0 100 100",
5984
6763
  preserveAspectRatio: "xMidYMid",
5985
6764
  className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
5986
- }, /* @__PURE__ */ createElement23("circle", {
6765
+ }, /* @__PURE__ */ createElement25("circle", {
5987
6766
  cx: "50",
5988
6767
  cy: "50",
5989
6768
  fill: "none",
5990
6769
  strokeWidth: "10",
5991
6770
  r: "35",
5992
6771
  strokeDasharray: "164.93361431346415 56.97787143782138"
5993
- }, /* @__PURE__ */ createElement23("animateTransform", {
6772
+ }, /* @__PURE__ */ createElement25("animateTransform", {
5994
6773
  attributeName: "transform",
5995
6774
  type: "rotate",
5996
6775
  repeatCount: "indefinite",
@@ -6010,7 +6789,7 @@ function getGroupColumnRender({
6010
6789
  var _a, _b, _c;
6011
6790
  let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
6012
6791
  if (column.renderValue) {
6013
- value = /* @__PURE__ */ createElement24(RenderHookComponent, {
6792
+ value = /* @__PURE__ */ createElement26(RenderHookComponent, {
6014
6793
  render: column.renderValue,
6015
6794
  renderParam: renderOptions
6016
6795
  });
@@ -6040,22 +6819,22 @@ function getGroupColumnRender({
6040
6819
  const showExpanderIcon = pivotBy ? (((_b = groupRowInfo.groupKeys) == null ? void 0 : _b.length) || 0) < (groupBy == null ? void 0 : groupBy.length) : (((_c = groupRowInfo.groupKeys) == null ? void 0 : _c.length) || 0) <= (groupBy == null ? void 0 : groupBy.length);
6041
6820
  const isLoading = showLoadingIcon(groupRowInfo);
6042
6821
  if (isLoading) {
6043
- icon = /* @__PURE__ */ createElement24(LoadingIcon, null);
6822
+ icon = /* @__PURE__ */ createElement26(LoadingIcon, null);
6044
6823
  } else if (showExpanderIcon) {
6045
- const defaultIcon = /* @__PURE__ */ createElement24(ExpanderIcon, {
6824
+ const defaultIcon = /* @__PURE__ */ createElement26(ExpanderIcon, {
6046
6825
  expanded: !collapsed,
6047
6826
  onChange: () => {
6048
6827
  toggleGroupRow(groupKeys);
6049
6828
  }
6050
6829
  });
6051
- icon = column.renderGroupIcon ? /* @__PURE__ */ createElement24(RenderHookComponent, {
6830
+ icon = column.renderGroupIcon ? /* @__PURE__ */ createElement26(RenderHookComponent, {
6052
6831
  render: column.renderGroupIcon,
6053
6832
  renderParam: Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)
6054
6833
  }) : defaultIcon;
6055
6834
  }
6056
- return /* @__PURE__ */ createElement24("div", {
6835
+ return /* @__PURE__ */ createElement26("div", {
6057
6836
  className: join(display.flex, alignItems.center)
6058
- }, icon, /* @__PURE__ */ createElement24("div", {
6837
+ }, icon, /* @__PURE__ */ createElement26("div", {
6059
6838
  className: cssEllipsisClassName
6060
6839
  }, value != null ? value : null));
6061
6840
  };
@@ -6100,9 +6879,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
6100
6879
  const showExpanderIcon = rowInfo.isGroupRow ? pivotBy ? (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < (groupBy == null ? void 0 : groupBy.length) : (((_b = rowInfo.groupKeys) == null ? void 0 : _b.length) || 0) <= (groupBy == null ? void 0 : groupBy.length) : false;
6101
6880
  const isLoading = showLoadingIcon(rowInfo);
6102
6881
  if (isLoading) {
6103
- icon = /* @__PURE__ */ createElement24(LoadingIcon, null);
6882
+ icon = /* @__PURE__ */ createElement26(LoadingIcon, null);
6104
6883
  } else if (showExpanderIcon) {
6105
- const defaultIcon = /* @__PURE__ */ createElement24(ExpanderIcon, {
6884
+ const defaultIcon = /* @__PURE__ */ createElement26(ExpanderIcon, {
6106
6885
  expanded: !collapsed,
6107
6886
  onChange: () => {
6108
6887
  if (!rowInfo.isGroupRow) {
@@ -6117,9 +6896,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
6117
6896
  icon = column.renderGroupIcon(renderParam);
6118
6897
  }
6119
6898
  }
6120
- return /* @__PURE__ */ createElement24("div", {
6899
+ return /* @__PURE__ */ createElement26("div", {
6121
6900
  className: join(display.flex, alignItems.center, GroupRowExpanderCls)
6122
- }, icon, /* @__PURE__ */ createElement24("div", {
6901
+ }, icon, /* @__PURE__ */ createElement26("div", {
6123
6902
  className: cssEllipsisClassName
6124
6903
  }, value != null ? value : null));
6125
6904
  }
@@ -6135,10 +6914,10 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
6135
6914
  }
6136
6915
 
6137
6916
  // src/components/InfiniteTable/hooks/useEffectWithRaf.ts
6138
- import { useEffect as useEffect19, useRef as useRef17 } from "react";
6917
+ import { useEffect as useEffect19, useRef as useRef19 } from "react";
6139
6918
  function useEffectWithRaf(fn, deps) {
6140
- const rafId = useRef17(0);
6141
- const removeFnRaf = useRef17();
6919
+ const rafId = useRef19(0);
6920
+ const removeFnRaf = useRef19();
6142
6921
  useEffect19(() => {
6143
6922
  rafId.current = requestAnimationFrame(() => {
6144
6923
  removeFnRaf.current = fn();
@@ -6156,7 +6935,7 @@ function useEffectWithRaf(fn, deps) {
6156
6935
  }
6157
6936
 
6158
6937
  // src/components/InfiniteTable/hooks/useToggleGroupRow.ts
6159
- import { useCallback as useCallback14 } from "react";
6938
+ import { useCallback as useCallback16 } from "react";
6160
6939
 
6161
6940
  // src/utils/groupAndPivot/index.ts
6162
6941
  var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
@@ -6611,7 +7390,7 @@ function enhancedFlatten(param) {
6611
7390
  // src/components/DataSource/index.tsx
6612
7391
  import {
6613
7392
  Fragment as Fragment3,
6614
- createElement as createElement25
7393
+ createElement as createElement27
6615
7394
  } from "react";
6616
7395
 
6617
7396
  // src/utils/multisort/sortTypes.ts
@@ -6800,15 +7579,15 @@ var GroupRowsState = class {
6800
7579
  };
6801
7580
 
6802
7581
  // src/components/DataSource/privateHooks/useLoadData.ts
6803
- import { useEffect as useEffect21, useMemo as useMemo9, useRef as useRef19, useState as useState12 } from "react";
7582
+ import { useEffect as useEffect21, useMemo as useMemo9, useRef as useRef21, useState as useState13 } from "react";
6804
7583
 
6805
7584
  // src/components/hooks/useEffectWithChanges.ts
6806
- import { useEffect as useEffect20, useRef as useRef18 } from "react";
7585
+ import { useEffect as useEffect20, useRef as useRef20 } from "react";
6807
7586
  function useEffectWithChanges(fn, deps) {
6808
- const prevRef = useRef18({});
6809
- const oldValuesRef = useRef18({});
7587
+ const prevRef = useRef20({});
7588
+ const oldValuesRef = useRef20({});
6810
7589
  const oldValues = oldValuesRef.current;
6811
- const changesRef = useRef18({});
7590
+ const changesRef = useRef20({});
6812
7591
  const changes = changesRef.current;
6813
7592
  const useEffectDeps = [];
6814
7593
  for (const k in deps) {
@@ -7089,11 +7868,11 @@ function useLoadData() {
7089
7868
  livePaginationCursor,
7090
7869
  cursorId: stateCursorId
7091
7870
  } = componentState;
7092
- const [scrollbars, setScrollbars] = useState12({
7871
+ const [scrollbars, setScrollbars] = useState13({
7093
7872
  vertical: false,
7094
7873
  horizontal: false
7095
7874
  });
7096
- const scrollbarsRef = useRef19(scrollbars);
7875
+ const scrollbarsRef = useRef21(scrollbars);
7097
7876
  useEffect21(() => {
7098
7877
  notifyScrollbarsChange.onChange((scrollbars2) => {
7099
7878
  if (!scrollbars2) {
@@ -7150,7 +7929,7 @@ function useLoadData() {
7150
7929
  filterValue,
7151
7930
  cursorId: livePagination ? stateCursorId : null
7152
7931
  };
7153
- const initialRef = useRef19(true);
7932
+ const initialRef = useRef21(true);
7154
7933
  useLazyLoadRange();
7155
7934
  useEffectWithChanges(() => {
7156
7935
  const componentState2 = getComponentState();
@@ -7191,7 +7970,7 @@ function useLazyLoadRange() {
7191
7970
  dataArray,
7192
7971
  scrollStopDelayUpdatedByTable
7193
7972
  } = componentState;
7194
- const latestRenderRangeRef = useRef19(null);
7973
+ const latestRenderRangeRef = useRef21(null);
7195
7974
  const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
7196
7975
  const componentState2 = getComponentState();
7197
7976
  renderRange = renderRange || latestRenderRangeRef.current;
@@ -8023,7 +8802,7 @@ function DataSourceWithContext(props) {
8023
8802
  if (typeof children === "function") {
8024
8803
  children = children(computedValues);
8025
8804
  }
8026
- return /* @__PURE__ */ createElement25(Fragment3, null, children);
8805
+ return /* @__PURE__ */ createElement27(Fragment3, null, children);
8027
8806
  }
8028
8807
  var DataSourceRoot = getComponentStateRoot({
8029
8808
  initSetupState,
@@ -8046,14 +8825,14 @@ function DataSourceCmp({ children }) {
8046
8825
  globalThis.getDataSourceState = getState;
8047
8826
  }
8048
8827
  useLoadData();
8049
- return /* @__PURE__ */ createElement25(DataSourceContext.Provider, {
8828
+ return /* @__PURE__ */ createElement27(DataSourceContext.Provider, {
8050
8829
  value: contextValue
8051
- }, /* @__PURE__ */ createElement25(DataSourceWithContext, {
8830
+ }, /* @__PURE__ */ createElement27(DataSourceWithContext, {
8052
8831
  children
8053
8832
  }));
8054
8833
  }
8055
8834
  function DataSource(props) {
8056
- return /* @__PURE__ */ createElement25(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ createElement25(DataSourceCmp, {
8835
+ return /* @__PURE__ */ createElement27(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ createElement27(DataSourceCmp, {
8057
8836
  children: props.children
8058
8837
  }));
8059
8838
  }
@@ -8061,7 +8840,7 @@ function DataSource(props) {
8061
8840
  // src/components/InfiniteTable/hooks/useToggleGroupRow.ts
8062
8841
  function useToggleGroupRow() {
8063
8842
  const { getState: getDataSourceState, componentActions: dataSourceActions } = useDataSourceContextValue();
8064
- const toggleGroupRow = useCallback14((groupKeys) => {
8843
+ const toggleGroupRow = useCallback16((groupKeys) => {
8065
8844
  const state = getDataSourceState();
8066
8845
  const newState = new GroupRowsState(state.groupRowsState);
8067
8846
  newState.toggleGroupRow(groupKeys);
@@ -8479,144 +9258,6 @@ function getColumnsWhenGrouping(params) {
8479
9258
  // src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
8480
9259
  import { useMemo as useMemo11 } from "react";
8481
9260
 
8482
- // src/components/flexbox/index.ts
8483
- var computeFlex = (params) => {
8484
- const {
8485
- availableSize,
8486
- items,
8487
- minSize: defaultMinSize,
8488
- maxSize: defaultMaxSize
8489
- } = params;
8490
- if (availableSize < 0) {
8491
- throw "The provided availableSize cannot be negative!";
8492
- }
8493
- let totalFixedSize = 0;
8494
- let totalFlex = 0;
8495
- let totalFlexCount = 0;
8496
- const minSizes = [];
8497
- const maxSizes = [];
8498
- items.forEach((item, i) => {
8499
- var _a, _b, _c, _d, _e, _f;
8500
- let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
8501
- let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
8502
- minSizes.push(minSize);
8503
- maxSizes.push(maxSize);
8504
- if (item.size != null) {
8505
- if (maxSize != null && item.size > maxSize) {
8506
- item.size = maxSize;
8507
- }
8508
- if (minSize != null && item.size < minSize) {
8509
- item.size = minSize;
8510
- }
8511
- }
8512
- if (item.size == null && item.flex == null) {
8513
- throw `Items must specify either a size or a flex property. Item at index ${i} doesn't have either of those.`;
8514
- }
8515
- if (item.flex != null) {
8516
- totalFlexCount += 1;
8517
- }
8518
- totalFlex += (_e = item.flex) != null ? _e : 0;
8519
- totalFixedSize += (_f = item.size) != null ? _f : 0;
8520
- });
8521
- let availableSizeForFlex = Math.max(availableSize - totalFixedSize, 0);
8522
- let sizePerFlex = availableSizeForFlex / totalFlex;
8523
- let maxxedFlexItems = {};
8524
- let minnedFlexItems = {};
8525
- let constrainedCount = 0;
8526
- items.forEach((item, index) => {
8527
- var _a, _b, _c, _d;
8528
- if (item.flex != null) {
8529
- const approxFlexSize = sizePerFlex * item.flex;
8530
- let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
8531
- let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
8532
- let constrained = false;
8533
- let substractSize = 0;
8534
- if (maxSize != null && approxFlexSize > maxSize) {
8535
- maxxedFlexItems[index] = true;
8536
- constrained = true;
8537
- substractSize = maxSize;
8538
- }
8539
- if (minSize != null && approxFlexSize < minSize) {
8540
- minnedFlexItems[index] = true;
8541
- constrained = true;
8542
- substractSize = minSize;
8543
- }
8544
- if (constrained) {
8545
- constrainedCount += 1;
8546
- totalFlexCount -= 1;
8547
- totalFlex -= item.flex;
8548
- availableSizeForFlex -= substractSize;
8549
- }
8550
- }
8551
- });
8552
- if (constrainedCount) {
8553
- sizePerFlex = availableSizeForFlex / totalFlex;
8554
- }
8555
- let flexSizes = [];
8556
- let currentFlexCount = 0;
8557
- let remainingSizeForFlex = availableSizeForFlex;
8558
- let remainingFlex = totalFlex;
8559
- let totalTakenSize = 0;
8560
- let flexSizeSum = 0;
8561
- const computedSizes = [];
8562
- const resultItems = items.map((item, index) => {
8563
- var _a, _b, _c, _d, _e;
8564
- const sizedItem = __spreadValues({}, item);
8565
- let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
8566
- let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
8567
- let flexSize = 0;
8568
- const maxxed = maxxedFlexItems[index];
8569
- const minned = minnedFlexItems[index];
8570
- const constrained = maxxed || minned;
8571
- let computedSize = (_e = item.size) != null ? _e : 0;
8572
- if (item.flex != null) {
8573
- if (constrained) {
8574
- if (minned) {
8575
- flexSize = minSize;
8576
- }
8577
- if (maxxed) {
8578
- flexSize = maxSize;
8579
- }
8580
- } else {
8581
- currentFlexCount += 1;
8582
- const constrain = (size) => {
8583
- if (maxSize != null && size > maxSize) {
8584
- size = maxSize;
8585
- }
8586
- if (minSize != null && size < minSize) {
8587
- size = minSize;
8588
- }
8589
- return size;
8590
- };
8591
- if (currentFlexCount === totalFlexCount) {
8592
- flexSize = constrain(remainingSizeForFlex);
8593
- } else {
8594
- flexSize = constrain(Math.round(item.flex * sizePerFlex));
8595
- flexSizeSum += flexSize;
8596
- remainingSizeForFlex = availableSizeForFlex - flexSizeSum;
8597
- remainingFlex -= item.flex;
8598
- sizePerFlex = remainingSizeForFlex / remainingFlex;
8599
- }
8600
- }
8601
- computedSize = flexSize;
8602
- sizedItem.flexSize = flexSize;
8603
- }
8604
- flexSizes.push(flexSize);
8605
- computedSizes.push(computedSize);
8606
- sizedItem.computedSize = computedSize;
8607
- totalTakenSize += computedSize;
8608
- return sizedItem;
8609
- });
8610
- return {
8611
- items: resultItems,
8612
- flexSizes,
8613
- minSizes,
8614
- maxSizes,
8615
- computedSizes,
8616
- remainingSize: Math.round(availableSize - totalTakenSize)
8617
- };
8618
- };
8619
-
8620
9261
  // src/components/InfiniteTable/utils/adjustColumnOrderForPinning.ts
8621
9262
  var order = ["start", void 0, "end"];
8622
9263
  var adjustColumnOrderForPinning = (columnOrder, columnPinning) => {
@@ -8809,8 +9450,8 @@ var getComputedVisibleColumns = ({
8809
9450
  const computedSortIndex = (_c = sortingInfo == null ? void 0 : sortingInfo.index) != null ? _c : -1;
8810
9451
  const computedWidth = computedSizes[i];
8811
9452
  const computedFlex = flexSizes[i] || null;
8812
- const computedMinWidth = minSizes[i] || null;
8813
- const computedMaxWidth = maxSizes[i] || null;
9453
+ const computedMinWidth = minSizes[i] || 0;
9454
+ const computedMaxWidth = maxSizes[i] || 1e4;
8814
9455
  const computedPinned = getComputedPinned(id, columnPinning);
8815
9456
  const computedLast = i === visibleColumnOrder.length - 1;
8816
9457
  const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
@@ -9052,6 +9693,7 @@ var useComputedVisibleColumns = ({
9052
9693
  columnMinWidth,
9053
9694
  columnMaxWidth,
9054
9695
  columnDefaultWidth,
9696
+ viewportReservedWidth,
9055
9697
  sortable,
9056
9698
  sortInfo,
9057
9699
  setSortInfo,
@@ -9060,6 +9702,7 @@ var useComputedVisibleColumns = ({
9060
9702
  columnOrder,
9061
9703
  columnVisibility,
9062
9704
  columnVisibilityAssumeVisible,
9705
+ resizableColumns,
9063
9706
  pinnedEndMaxWidth,
9064
9707
  pinnedStartMaxWidth,
9065
9708
  columnSizing,
@@ -9089,7 +9732,7 @@ var useComputedVisibleColumns = ({
9089
9732
  };
9090
9733
 
9091
9734
  // src/components/InfiniteTable/hooks/useScrollbars.ts
9092
- import { useState as useState13, useEffect as useEffect24, useLayoutEffect as useLayoutEffect6 } from "react";
9735
+ import { useState as useState14, useEffect as useEffect24, useLayoutEffect as useLayoutEffect6 } from "react";
9093
9736
  var INITIAL_SCROLLBARS = {
9094
9737
  vertical: false,
9095
9738
  horizontal: false
@@ -9097,7 +9740,7 @@ var INITIAL_SCROLLBARS = {
9097
9740
  function useScrollbars(brain) {
9098
9741
  const { getComponentState: getInfiniteTableState } = useComponentState();
9099
9742
  const { getState: getDataSourceState } = useDataSourceContextValue();
9100
- const [scrollbars, setScrollbars] = useState13(INITIAL_SCROLLBARS);
9743
+ const [scrollbars, setScrollbars] = useState14(INITIAL_SCROLLBARS);
9101
9744
  useEffect24(() => {
9102
9745
  return brain.onRenderCountChange(() => {
9103
9746
  const { scrollTopMax, scrollLeftMax } = brain;
@@ -9138,7 +9781,7 @@ function useComputed() {
9138
9781
  bodySize,
9139
9782
  showSeparatePivotColumnForSingleAggregation
9140
9783
  } = componentState;
9141
- useState14(() => {
9784
+ useState15(() => {
9142
9785
  componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
9143
9786
  if (rowHeight) {
9144
9787
  componentActions.rowHeight = rowHeight;
@@ -9156,7 +9799,7 @@ function useComputed() {
9156
9799
  const { multiSort, filterValue } = dataSourceState;
9157
9800
  useColumnGroups();
9158
9801
  const { toggleGroupRow } = useColumnsWhen();
9159
- const setSortInfo = useCallback15((sortInfo) => {
9802
+ const setSortInfo = useCallback17((sortInfo) => {
9160
9803
  var _a2;
9161
9804
  const newSortInfo = getDataSourceState().multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
9162
9805
  dataSourceActions.sortInfo = newSortInfo;
@@ -9234,6 +9877,10 @@ function useComputed() {
9234
9877
  }
9235
9878
 
9236
9879
  // src/components/InfiniteTable/hooks/useDOMProps.ts
9880
+ var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
9881
+ var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
9882
+ var activeCellColWidth = stripVar(InternalVars.activeCellColWidth);
9883
+ var activeCellColOffset = stripVar(InternalVars.activeCellColOffset);
9237
9884
  function useDOMProps(initialDOMProps) {
9238
9885
  const { computed, componentState, componentActions } = useInfiniteTable();
9239
9886
  const {
@@ -9244,9 +9891,24 @@ function useDOMProps(initialDOMProps) {
9244
9891
  onBlurWithin,
9245
9892
  onFocusWithin,
9246
9893
  onSelfFocus,
9247
- onSelfBlur
9894
+ onSelfBlur,
9895
+ activeCellIndex
9248
9896
  } = componentState;
9249
- const { computedPinnedStartColumnsWidth, computedPinnedEndColumnsWidth } = computed;
9897
+ const {
9898
+ computedPinnedStartColumnsWidth,
9899
+ computedPinnedEndColumnsWidth,
9900
+ computedVisibleColumns
9901
+ } = computed;
9902
+ const cssVars = computedVisibleColumns.reduce((vars, col) => {
9903
+ const index = col.computedVisibleIndex;
9904
+ vars[`${columnWidthAtIndex4}-${index}`] = col.computedWidth + "px";
9905
+ vars[`${columnOffsetAtIndex2}-${index}`] = col.computedOffset + "px";
9906
+ return vars;
9907
+ }, {});
9908
+ if (activeCellIndex != null) {
9909
+ cssVars[activeCellColWidth] = `var(${getCSSVarNameForColWidth(activeCellIndex[1])})`;
9910
+ cssVars[activeCellColOffset] = `var(${getCSSVarNameForColOffset(activeCellIndex[1])})`;
9911
+ }
9250
9912
  const setFocused = rafFn((focused2) => {
9251
9913
  componentActions.focused = focused2;
9252
9914
  });
@@ -9301,7 +9963,7 @@ function useDOMProps(initialDOMProps) {
9301
9963
  focusedWithin
9302
9964
  }));
9303
9965
  domProps.className = className;
9304
- domProps.style = __spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style);
9966
+ domProps.style = __spreadValues(__spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style), cssVars);
9305
9967
  if (focused) {
9306
9968
  if (componentState.focusedStyle) {
9307
9969
  Object.assign(domProps.style, componentState.focusedStyle);
@@ -9477,7 +10139,7 @@ var useLicense = (licenseKey = "") => {
9477
10139
  const valid = useMemo12(() => {
9478
10140
  let valid2 = isValidLicense(licenseKey, {
9479
10141
  publishedAt: 1624970570587,
9480
- version: "0.3.12"
10142
+ version: "0.3.15"
9481
10143
  });
9482
10144
  if (!licenseKey && !valid2 && isInsidePlayground) {
9483
10145
  return true;
@@ -9608,10 +10270,23 @@ function handleCellNavigation(options) {
9608
10270
  actions.activeCellIndex = [rowIndex, colIndex];
9609
10271
  return true;
9610
10272
  }
10273
+ var validKeys = {
10274
+ ArrowUp: true,
10275
+ ArrowDown: true,
10276
+ ArrowLeft: true,
10277
+ ArrowRight: true,
10278
+ PageUp: true,
10279
+ PageDown: true,
10280
+ Home: true,
10281
+ End: true
10282
+ };
9611
10283
  function handleKeyboardNavigation(options) {
9612
10284
  const { getState } = options;
9613
10285
  const state = getState();
9614
10286
  const { activeRowIndex, activeCellIndex, keyboardNavigation } = state;
10287
+ if (!validKeys[options.key]) {
10288
+ return false;
10289
+ }
9615
10290
  if (activeRowIndex != null && keyboardNavigation === "row") {
9616
10291
  return handleRowNavigation(options);
9617
10292
  }
@@ -9702,6 +10377,7 @@ function initSetupState2() {
9702
10377
  });
9703
10378
  if (false) {
9704
10379
  globalThis.brain = brain;
10380
+ globalThis.headerBrain = headerBrain;
9705
10381
  }
9706
10382
  const { renderer, onRenderUpdater } = createRenderer2(brain);
9707
10383
  brain.onAvailableSizeChange((size) => {
@@ -9720,6 +10396,7 @@ function initSetupState2() {
9720
10396
  domRef: createRef(),
9721
10397
  scrollerDOMRef: createRef(),
9722
10398
  portalDOMRef: createRef(),
10399
+ activeCellIndicatorDOMRef: createRef(),
9723
10400
  onRowHeightCSSVarChange: buildSubscriptionCallback(),
9724
10401
  onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
9725
10402
  bodySize: {
@@ -9775,7 +10452,7 @@ var forwardProps3 = (setupState) => {
9775
10452
  viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
9776
10453
  resizableColumns: (resizableColumns) => resizableColumns != null ? resizableColumns : true,
9777
10454
  columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
9778
- columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 2e3,
10455
+ columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 5e3,
9779
10456
  columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
9780
10457
  columnCssEllipsis: (columnCssEllipsis) => columnCssEllipsis != null ? columnCssEllipsis : true,
9781
10458
  draggableColumns: (draggableColumns) => draggableColumns != null ? draggableColumns : true,
@@ -9892,7 +10569,7 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
9892
10569
  getState: getDataSourceState,
9893
10570
  componentActions: dataSourceActions
9894
10571
  } = useDataSourceContextValue();
9895
- const [imperativeApi] = useState15(() => {
10572
+ const [imperativeApi] = useState16(() => {
9896
10573
  return getImperativeApi(getState, getComputed, getDataSourceState, actions);
9897
10574
  });
9898
10575
  const {
@@ -9958,7 +10635,7 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
9958
10635
  dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
9959
10636
  }, [scrollStopDelay]);
9960
10637
  useAutoSizeColumns();
9961
- const onKeyDown = useCallback16((event) => {
10638
+ const onKeyDown = useCallback18((event) => {
9962
10639
  if (handleKeyboardNavigation({
9963
10640
  getState,
9964
10641
  actions,
@@ -9970,13 +10647,14 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
9970
10647
  event.preventDefault();
9971
10648
  }
9972
10649
  }, []);
9973
- return /* @__PURE__ */ createElement26("div", __spreadValues({
10650
+ return /* @__PURE__ */ createElement28("div", __spreadValues({
9974
10651
  onKeyDown,
9975
10652
  ref: domRef
9976
- }, domProps), header ? /* @__PURE__ */ createElement26(TableHeaderWrapper, {
9977
- brain: headerBrain,
10653
+ }, domProps), header ? /* @__PURE__ */ createElement28(TableHeaderWrapper, {
10654
+ bodyBrain: brain,
10655
+ headerBrain,
9978
10656
  scrollbars
9979
- }) : null, /* @__PURE__ */ createElement26(InfiniteTableBody, null, /* @__PURE__ */ createElement26(HeadlessTable, {
10657
+ }) : null, /* @__PURE__ */ createElement28(InfiniteTableBody, null, /* @__PURE__ */ createElement28(HeadlessTable, {
9980
10658
  tabIndex: 0,
9981
10659
  activeRowIndex: componentState.ready && keyboardNavigation === "row" ? activeRowIndex : null,
9982
10660
  activeCellIndex: componentState.ready && keyboardNavigation === "cell" ? activeCellIndex : null,
@@ -9987,18 +10665,18 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
9987
10665
  renderCell,
9988
10666
  cellHoverClassNames: HOVERED_CLASS_NAMES,
9989
10667
  scrollerDOMRef
9990
- }), /* @__PURE__ */ createElement26(LoadMaskCmp, {
10668
+ }), /* @__PURE__ */ createElement28(LoadMaskCmp, {
9991
10669
  visible: loading
9992
- }, loadingText)), /* @__PURE__ */ createElement26("div", {
10670
+ }, loadingText)), /* @__PURE__ */ createElement28("div", {
9993
10671
  ref: portalDOMRef,
9994
10672
  className: join(`${rootClassName2}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
9995
- }), rowHeightCSSVar ? /* @__PURE__ */ createElement26(CSSVariableWatch, {
10673
+ }), rowHeightCSSVar ? /* @__PURE__ */ createElement28(CSSVariableWatch, {
9996
10674
  varName: rowHeightCSSVar,
9997
10675
  onChange: onRowHeightCSSVarChange
9998
- }) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */ createElement26(CSSVariableWatch, {
10676
+ }) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */ createElement28(CSSVariableWatch, {
9999
10677
  varName: columnHeaderHeightCSSVar,
10000
10678
  onChange: onColumnHeaderHeightCSSVarChange
10001
- }) : null, /* @__PURE__ */ createElement26(InfiniteTableFooter, null), licenseValid ? null : /* @__PURE__ */ createElement26(InfiniteTableLicenseFooter, null));
10679
+ }) : null, /* @__PURE__ */ createElement28(InfiniteTableFooter, null), licenseValid ? null : /* @__PURE__ */ createElement28(InfiniteTableLicenseFooter, null));
10002
10680
  });
10003
10681
  function InfiniteTableContextProvider() {
10004
10682
  const { componentActions, componentState } = useComponentState();
@@ -10018,14 +10696,12 @@ function InfiniteTableContextProvider() {
10018
10696
  getState
10019
10697
  };
10020
10698
  useResizeObserver(scrollerDOMRef, (size) => {
10021
- var _a, _b;
10022
10699
  const bodySize = {
10023
10700
  width: size.width,
10024
10701
  height: size.height
10025
10702
  };
10026
- bodySize.width = (_b = (_a = scrollerDOMRef.current) == null ? void 0 : _a.scrollWidth) != null ? _b : bodySize.width;
10027
10703
  componentActions.bodySize = bodySize;
10028
- }, { earlyAttach: true });
10704
+ }, { earlyAttach: true, debounce: 50 });
10029
10705
  useEffect26(() => {
10030
10706
  return () => {
10031
10707
  componentState.onRowHeightCSSVarChange.destroy();
@@ -10038,13 +10714,16 @@ function InfiniteTableContextProvider() {
10038
10714
  }
10039
10715
  }, [scrollTopKey, scrollerDOMRef]);
10040
10716
  const TableContext2 = getInfiniteTableContext();
10041
- return /* @__PURE__ */ createElement26(TableContext2.Provider, {
10717
+ return /* @__PURE__ */ createElement28(TableContext2.Provider, {
10042
10718
  value: contextValue
10043
- }, /* @__PURE__ */ createElement26(InfiniteTableComponent, null));
10719
+ }, /* @__PURE__ */ createElement28(InfiniteTableComponent, null));
10044
10720
  }
10045
10721
  function InfiniteTable(props) {
10046
- const table = /* @__PURE__ */ createElement26(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ createElement26(InfiniteTableContextProvider, null));
10047
- return /* @__PURE__ */ createElement26(StrictMode, null, table);
10722
+ const table = /* @__PURE__ */ createElement28(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ createElement28(InfiniteTableContextProvider, null));
10723
+ if (false) {
10724
+ return /* @__PURE__ */ createElement28(StrictMode, null, table);
10725
+ }
10726
+ return table;
10048
10727
  }
10049
10728
  InfiniteTable.defaultProps = {
10050
10729
  rowHeight: 40,