@infinite-table/infinite-react 0.3.12 → 0.3.13

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,56 @@ 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
- });
3441
3537
  const domRef = useRef6(null);
3442
- const stateRef = useRef6(state);
3443
3538
  const active = props.activeCellIndex != null && brain.getRowCount() > props.activeCellIndex[0];
3444
3539
  useLayoutEffect4(() => {
3445
3540
  if (props.activeCellIndex == null) {
3446
3541
  return;
3447
3542
  }
3448
3543
  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]);
3544
+ const activeCellRowHeight = brain.getRowHeight(rowIndex);
3545
+ const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
3546
+ const node = domRef.current;
3547
+ const scrollPosition = brain.getScrollPosition();
3548
+ setInfiniteVarsOnNode({
3549
+ scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
3550
+ scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`,
3551
+ activeCellRowHeight: `${activeCellRowHeight}px`,
3552
+ activeCellRowOffset: `${activeCellRowOffset}px`
3553
+ }, node);
3554
+ }, [props.activeCellIndex]);
3456
3555
  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)`;
3462
- });
3463
- const removeOnRenderCountChange = brain.onRenderCountChange(() => {
3464
- rerender();
3465
- });
3466
- const removeOnAvailableSizeChange = brain.onAvailableSizeChange(() => {
3467
- rerender();
3556
+ const removeOnSCroll = brain.onScroll((scrollPosition) => {
3557
+ setInfiniteVarsOnNode({
3558
+ scrollTopForActiveCell: `${-scrollPosition.scrollTop}px`,
3559
+ scrollLeftForActiveCell: `${-scrollPosition.scrollLeft}px`
3560
+ }, domRef.current);
3468
3561
  });
3469
3562
  return () => {
3470
- removeOnAvailableSizeChange();
3471
- removeOnRenderCountChange();
3472
3563
  removeOnSCroll();
3473
3564
  };
3474
3565
  }, [brain]);
3475
- const scrollPosition = brain.getScrollPosition();
3476
3566
  return /* @__PURE__ */ createElement7("div", {
3567
+ className: ActiveIndicatorWrapperCls,
3568
+ "data-name": "active-cell"
3569
+ }, /* @__PURE__ */ createElement7("div", {
3477
3570
  ref: domRef,
3478
3571
  "data-name": "active-cell-indicator",
3479
3572
  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
- });
3573
+ style: active ? ActiveStyle : void 0
3574
+ }));
3486
3575
  };
3487
3576
  var ActiveCellIndicator = memo5(ActiveCellIndicatorFn);
3488
3577
 
@@ -3530,7 +3619,7 @@ function HeadlessTable(props) {
3530
3619
  "onRenderUpdater"
3531
3620
  ]);
3532
3621
  const domRef = useRef7(null);
3533
- const [scrollSize, setTotalScrollSize] = useState5({
3622
+ const [scrollSize, setTotalScrollSize] = useState4({
3534
3623
  width: 0,
3535
3624
  height: 0
3536
3625
  });
@@ -3552,7 +3641,7 @@ function HeadlessTable(props) {
3552
3641
  };
3553
3642
  brain.update(size);
3554
3643
  };
3555
- const remove = setupResizeObserver(node, onResize);
3644
+ const remove = setupResizeObserver(node, onResize, { debounce: 50 });
3556
3645
  return remove;
3557
3646
  }, []);
3558
3647
  const onContainerScroll = useCallback4((scrollPos) => {
@@ -3604,7 +3693,7 @@ import {
3604
3693
  createContext as createContext2,
3605
3694
  useMemo as useMemo3,
3606
3695
  useEffect as useEffect8,
3607
- useState as useState6,
3696
+ useState as useState5,
3608
3697
  useRef as useRef10
3609
3698
  } from "react";
3610
3699
 
@@ -3742,14 +3831,14 @@ function forwardProps(propsToForward, props) {
3742
3831
  function getComponentStateRoot(config) {
3743
3832
  return memo6(function ComponentStateRoot(props) {
3744
3833
  var _a, _b;
3745
- const [initialSetupState] = useState6(() => {
3834
+ const [initialSetupState] = useState5(() => {
3746
3835
  return config.initSetupState ? config.initSetupState() : {};
3747
3836
  });
3748
3837
  const propsToStateSetRef = useRef10(new Set());
3749
3838
  const propsToForward = useMemo3(() => config.forwardProps ? config.forwardProps(initialSetupState) : {}, [initialSetupState]);
3750
3839
  const parentState = (_b = (_a = config.getParentState) == null ? void 0 : _a.call(config)) != null ? _b : null;
3751
3840
  const getParentState = useLatest(parentState);
3752
- const [wholeState] = useState6(() => {
3841
+ const [wholeState] = useState5(() => {
3753
3842
  let mappedState = {};
3754
3843
  if (propsToForward) {
3755
3844
  mappedState = forwardProps(propsToForward, props);
@@ -3918,28 +4007,28 @@ var useInternalProps = () => {
3918
4007
  };
3919
4008
 
3920
4009
  // 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" };
4010
+ var alignItems = { center: "_16lm1iw15", stretch: "_16lm1iw16" };
4011
+ var cssEllipsisClassName = "_16lm1iw1e _16lm1iw1f _16lm1iw1a";
4012
+ var cursor = { pointer: "_16lm1iwd", colResize: "_16lm1iwe" };
4013
+ var display = { flex: "_16lm1iwn", block: "_16lm1iwo", inlineBlock: "_16lm1iwp" };
4014
+ var flex = { "1": "_16lm1iwg", none: "_16lm1iwh" };
4015
+ var flexFlow = { column: "_16lm1iw13", row: "_16lm1iw14" };
4016
+ var justifyContent = { center: "_16lm1iw17", start: "_16lm1iw18", end: "_16lm1iw19" };
4017
+ var left = { "0": "_16lm1iwx", "100%": "_16lm1iwy" };
4018
+ var overflow = { hidden: "_16lm1iw1a", auto: "_16lm1iw1b", visible: "_16lm1iw1c" };
3930
4019
  var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
3931
- var top = { "0": "_16lm1iwu", "100%": "_16lm1iwv" };
4020
+ var top = { "0": "_16lm1iwv", "100%": "_16lm1iww" };
3932
4021
  var transformTranslateZero = "_16lm1iwa";
3933
- var userSelect = { none: "_16lm1iwp" };
3934
- var zIndex = { "1": "_16lm1iwh", "10": "_16lm1iwi", "1000": "_16lm1iwj", "10000": "_16lm1iwk", "100000": "_16lm1iwl" };
4022
+ var userSelect = { none: "_16lm1iwq" };
4023
+ var zIndex = { "1": "_16lm1iwi", "10": "_16lm1iwj", "1000": "_16lm1iwk", "10000": "_16lm1iwl", "100000": "_16lm1iwm" };
3935
4024
 
3936
4025
  // src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
3937
4026
  var InfiniteTableBody = forwardRef2(function InfiniteTableBody2(props, ref) {
3938
- const { rootClassName: rootClassName11 } = useInternalProps();
4027
+ const { rootClassName: rootClassName13 } = useInternalProps();
3939
4028
  return /* @__PURE__ */ createElement10("div", __spreadProps(__spreadValues({
3940
4029
  ref
3941
4030
  }, props), {
3942
- className: join(`${rootClassName11}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
4031
+ className: join(`${rootClassName13}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
3943
4032
  }));
3944
4033
  });
3945
4034
 
@@ -3949,11 +4038,11 @@ import {
3949
4038
  forwardRef as forwardRef3
3950
4039
  } from "react";
3951
4040
  var InfiniteTableFooter = forwardRef3(function InfiniteTableFooter2(props, ref) {
3952
- const { rootClassName: rootClassName11 } = useInternalProps();
4041
+ const { rootClassName: rootClassName13 } = useInternalProps();
3953
4042
  return /* @__PURE__ */ createElement11("div", __spreadProps(__spreadValues({
3954
4043
  ref
3955
4044
  }, props), {
3956
- className: join(`${rootClassName11}Footer`, position.relative, display.flex, flexFlow.row, props.className)
4045
+ className: join(`${rootClassName13}Footer`, position.relative, display.flex, flexFlow.row, props.className)
3957
4046
  }));
3958
4047
  });
3959
4048
 
@@ -3961,10 +4050,10 @@ var InfiniteTableFooter = forwardRef3(function InfiniteTableFooter2(props, ref)
3961
4050
  import {
3962
4051
  Fragment as Fragment2,
3963
4052
  createContext as createContext4,
3964
- createElement as createElement15,
4053
+ createElement as createElement16,
3965
4054
  useMemo as useMemo5
3966
4055
  } from "react";
3967
- import { useCallback as useCallback7, useContext as useContext5, useEffect as useEffect11, useRef as useRef12 } from "react";
4056
+ import { useCallback as useCallback8, useContext as useContext5, useEffect as useEffect11, useRef as useRef13 } from "react";
3968
4057
  import { createPortal } from "react-dom";
3969
4058
 
3970
4059
  // src/components/DataSource/defaultFilterTypes.ts
@@ -4072,7 +4161,7 @@ import {
4072
4161
  useCallback as useCallback6,
4073
4162
  useMemo as useMemo4,
4074
4163
  useRef as useRef11,
4075
- useState as useState7
4164
+ useState as useState6
4076
4165
  } from "react";
4077
4166
 
4078
4167
  // src/components/InfiniteTable/hooks/useInfiniteTable.ts
@@ -4126,10 +4215,9 @@ var useColumnPointerEvents = ({
4126
4215
  columns,
4127
4216
  computedRemainingSpace
4128
4217
  }) => {
4129
- const [draggingDiff, setDraggingDiff] = useState7(null);
4130
- const [proxyOffset, setProxyOffset] = useState7(null);
4218
+ const [draggingDiff, setDraggingDiff] = useState6(null);
4219
+ const [proxyOffset, setProxyOffset] = useState6(null);
4131
4220
  const breakpointsRef = useRef11([]);
4132
- const pointerMoveRef = useRef11(null);
4133
4221
  const didDragRef = useRef11(false);
4134
4222
  const initialClientPos = useRef11(null);
4135
4223
  const currentDropIndexRef = useRef11(null);
@@ -4205,35 +4293,40 @@ var useColumnPointerEvents = ({
4205
4293
  }
4206
4294
  setDraggingDiff({ left: diffX, top: diffY });
4207
4295
  };
4208
- pointerMoveRef.current = onPointerMove;
4296
+ const onPointerUp = (e2) => {
4297
+ const target2 = domRef.current;
4298
+ target2.style.cursor = cursorRef.current;
4299
+ target2.releasePointerCapture(e2.pointerId);
4300
+ target2.removeEventListener("pointermove", onPointerMove);
4301
+ target2.removeEventListener("pointerup", onPointerUp);
4302
+ setDraggingDiff(null);
4303
+ componentActions.columnShifts = null;
4304
+ componentActions.draggingColumnId = null;
4305
+ if (!didDragRef.current && column.computedSortable) {
4306
+ column.toggleSort();
4307
+ }
4308
+ const dropIndex = currentDropIndexRef.current;
4309
+ if (dropIndex != null && dropIndex !== columnIndex) {
4310
+ const newOrder = moveXatY(computedColumnOrder, columnIndex, dropIndex > columnIndex ? dropIndex - 1 : dropIndex);
4311
+ componentActions.columnOrder = newOrder;
4312
+ }
4313
+ breakpointsRef.current = [];
4314
+ didDragRef.current = false;
4315
+ initialClientPos.current = null;
4316
+ currentDropIndexRef.current = null;
4317
+ };
4209
4318
  target.addEventListener("pointermove", onPointerMove);
4319
+ target.addEventListener("pointerup", onPointerUp);
4210
4320
  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]);
4321
+ }, [
4322
+ columns,
4323
+ column,
4324
+ columnIndex,
4325
+ columnsArray,
4326
+ computedRemainingSpace,
4327
+ computedColumnOrder
4328
+ ]);
4234
4329
  return {
4235
- onPointerUp: column.computedDraggable ? onPointerUp : () => {
4236
- },
4237
4330
  onPointerDown: column.computedDraggable ? onPointerDown : () => {
4238
4331
  },
4239
4332
  dragging,
@@ -4288,23 +4381,23 @@ function NumberFilterEditor(props) {
4288
4381
  import {
4289
4382
  createElement as createElement12
4290
4383
  } from "react";
4291
- import { useEffect as useEffect9, useState as useState8 } from "react";
4384
+ import { useEffect as useEffect9, useState as useState7 } from "react";
4292
4385
 
4293
4386
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
4294
4387
  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: [] });
4388
+ var CellCls = "_1eexc2a5 _16lm1iwn _16lm1iw14 _16lm1iw15 _16lm1iw2 _16lm1iw1d _16lm1iw1e";
4389
+ var HeaderCellContentRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob117 _16lm1iws _16lm1iwu _16lm1iwn _16lm1iw14 _16lm1iw15", variantClassNames: { filtered: { false: "_12zfob118", true: "_12zfob119" } }, defaultVariants: {}, compoundVariants: [] });
4297
4390
  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";
4391
+ 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"]] });
4392
+ 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"]] });
4393
+ var HeaderFilterCls = "_12zfob11c _16lm1iwn _16lm1iw14 _16lm1iw15 _16lm1iw1";
4394
+ var HeaderFilterEditorCls = "_16lm1iwu _16lm1iws";
4395
+ var HeaderGroupCls = "_12zfob11b _16lm1iwn _16lm1iw14 _16lm1iw15";
4303
4396
  var HeaderScrollbarPlaceholderCls = "_12zfob16 _16lm1iw2";
4304
4397
  var HeaderSortIconCls = "_16lm1iw1";
4305
4398
  var HeaderSortIconIndexCls = "_12zfob15";
4306
4399
  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";
4400
+ var HeaderWrapperCls = "_12zfob11a _16lm1iw1a _16lm1iw1 _16lm1iwn _16lm1iw14";
4308
4401
 
4309
4402
  // src/components/InfiniteTable/components/icons/SortIcon.tsx
4310
4403
  var defaultLineStyle = {
@@ -4315,8 +4408,8 @@ var defaultLineStyle = {
4315
4408
  var InfiniteTableIconClassName = "InfiniteTableIcon";
4316
4409
  function SortIcon(props) {
4317
4410
  var _a;
4318
- const [rendered, setRendered] = useState8(true);
4319
- const [opacity, setOpacity] = useState8(0);
4411
+ const [rendered, setRendered] = useState7(true);
4412
+ const [opacity, setOpacity] = useState7(0);
4320
4413
  const { direction, lineWidth = 1, style, className, index } = props;
4321
4414
  const showIndex = index != null && index > 0;
4322
4415
  const size = (_a = props.size) != null ? _a : 16;
@@ -4395,20 +4488,20 @@ var useInfiniteTableState = () => {
4395
4488
  // src/components/InfiniteTable/components/cell.css.ts
4396
4489
  var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
4397
4490
  var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
4398
- var ColumnCellCls = "_1eexc2a5 _16lm1iwm _16lm1iw13 _16lm1iw14 _16lm1iw2 _16lm1iw1c _16lm1iw1d";
4491
+ var ColumnCellCls = "_1eexc2a5 _16lm1iwn _16lm1iw14 _16lm1iw15 _16lm1iw2 _16lm1iw1d _16lm1iw1e";
4399
4492
  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
4493
 
4401
4494
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
4402
4495
  var { rootClassName: rootClassName5 } = internalProps;
4403
4496
  var InfiniteTableCellClassName = `${rootClassName5}Cell`;
4404
4497
  var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
4498
+ var columnWidthAtIndex2 = stripVar(InternalVars.columnWidthAtIndex);
4405
4499
  function InfiniteTableCellFn(props) {
4406
4500
  var _b, _c, _d;
4407
4501
  const _a = props, {
4408
4502
  cssEllipsis = true,
4409
4503
  virtualized = true,
4410
4504
  skipColumnShifting = false,
4411
- offsetProperty = "left",
4412
4505
  contentStyle,
4413
4506
  column,
4414
4507
  domRef,
@@ -4416,7 +4509,6 @@ function InfiniteTableCellFn(props) {
4416
4509
  contentClassName,
4417
4510
  afterChildren,
4418
4511
  beforeChildren,
4419
- offset,
4420
4512
  cellType,
4421
4513
  cssPosition: _cssPosition,
4422
4514
  renderChildren
@@ -4424,7 +4516,6 @@ function InfiniteTableCellFn(props) {
4424
4516
  "cssEllipsis",
4425
4517
  "virtualized",
4426
4518
  "skipColumnShifting",
4427
- "offsetProperty",
4428
4519
  "contentStyle",
4429
4520
  "column",
4430
4521
  "domRef",
@@ -4432,7 +4523,6 @@ function InfiniteTableCellFn(props) {
4432
4523
  "contentClassName",
4433
4524
  "afterChildren",
4434
4525
  "beforeChildren",
4435
- "offset",
4436
4526
  "cellType",
4437
4527
  "cssPosition",
4438
4528
  "renderChildren"
@@ -4441,10 +4531,10 @@ function InfiniteTableCellFn(props) {
4441
4531
  const { columnShifts } = useInfiniteTableState();
4442
4532
  const shifting = !!columnShifts;
4443
4533
  const style = __spreadValues({
4444
- width
4534
+ width: `var(${columnWidthAtIndex2}-${column.computedVisibleIndex})`
4445
4535
  }, domProps.style);
4446
4536
  if (!skipColumnShifting && columnShifts && columnShifts[column.computedVisibleIndex]) {
4447
- const shiftLeft = columnShifts[column.computedVisibleIndex] + (offset != null ? offset : 0);
4537
+ const shiftLeft = columnShifts[column.computedVisibleIndex];
4448
4538
  if (virtualized) {
4449
4539
  style.left = shiftLeft;
4450
4540
  } else {
@@ -4474,13 +4564,13 @@ var InfiniteTableCell = memo7(InfiniteTableCellFn);
4474
4564
  import {
4475
4565
  createElement as createElement14
4476
4566
  } from "react";
4477
- import { useEffect as useEffect10, useState as useState9 } from "react";
4567
+ import { useEffect as useEffect10, useState as useState8 } from "react";
4478
4568
  var { rootClassName: rootClassName6 } = internalProps;
4479
4569
  var InfiniteTableColumnHeaderFilterClassName = `${rootClassName6}HeaderCell__filter`;
4480
4570
  var stopPropagation = (e) => e.stopPropagation();
4481
4571
  function InfiniteTableColumnHeaderFilter(props) {
4482
4572
  var _a, _b, _c, _d;
4483
- const [theValue, setTheValue] = useState9((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
4573
+ const [theValue, setTheValue] = useState8((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
4484
4574
  const onInputChange = (filterValue) => {
4485
4575
  setTheValue(filterValue);
4486
4576
  props.onChange(filterValue);
@@ -4528,10 +4618,544 @@ function InfiniteTableColumnHeaderFilterEmpty() {
4528
4618
  });
4529
4619
  }
4530
4620
 
4621
+ // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
4622
+ import {
4623
+ createElement as createElement15
4624
+ } from "react";
4625
+ import { useCallback as useCallback7 } from "react";
4626
+
4627
+ // src/components/flexbox/index.ts
4628
+ var computeFlex = (params) => {
4629
+ const {
4630
+ availableSize,
4631
+ items,
4632
+ minSize: defaultMinSize,
4633
+ maxSize: defaultMaxSize
4634
+ } = params;
4635
+ if (availableSize < 0) {
4636
+ throw "The provided availableSize cannot be negative!";
4637
+ }
4638
+ let totalFixedSize = 0;
4639
+ let totalFlex = 0;
4640
+ let totalFlexCount = 0;
4641
+ const minSizes = [];
4642
+ const maxSizes = [];
4643
+ items.forEach((item, i) => {
4644
+ var _a, _b, _c, _d, _e;
4645
+ let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
4646
+ let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
4647
+ minSizes.push(minSize);
4648
+ maxSizes.push(maxSize);
4649
+ if (item.size != null) {
4650
+ if (maxSize != null && item.size > maxSize) {
4651
+ item.size = maxSize;
4652
+ }
4653
+ if (minSize != null && item.size < minSize) {
4654
+ item.size = minSize;
4655
+ }
4656
+ }
4657
+ const itemFlex = item.flex == 0 ? null : item.flex;
4658
+ if (item.size == null && itemFlex == null) {
4659
+ throw `Items must specify either a size or a flex property. Item at index ${i} doesn't have either of those.`;
4660
+ }
4661
+ if (itemFlex != null) {
4662
+ totalFlexCount += 1;
4663
+ }
4664
+ totalFlex += itemFlex != null ? itemFlex : 0;
4665
+ totalFixedSize += (_e = item.size) != null ? _e : 0;
4666
+ });
4667
+ let availableSizeForFlex = Math.max(availableSize - totalFixedSize, 0);
4668
+ let sizePerFlex = availableSizeForFlex / totalFlex;
4669
+ let maxxedFlexItems = {};
4670
+ let minnedFlexItems = {};
4671
+ let constrainedCount = 0;
4672
+ items.forEach((item, index) => {
4673
+ var _a, _b, _c, _d;
4674
+ if (item.flex != null) {
4675
+ const approxFlexSize = sizePerFlex * item.flex;
4676
+ let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
4677
+ let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
4678
+ let constrained = false;
4679
+ let substractSize = 0;
4680
+ if (maxSize != null && approxFlexSize > maxSize) {
4681
+ maxxedFlexItems[index] = true;
4682
+ constrained = true;
4683
+ substractSize = maxSize;
4684
+ }
4685
+ if (minSize != null && approxFlexSize < minSize) {
4686
+ minnedFlexItems[index] = true;
4687
+ constrained = true;
4688
+ substractSize = minSize;
4689
+ }
4690
+ if (constrained) {
4691
+ constrainedCount += 1;
4692
+ totalFlexCount -= 1;
4693
+ totalFlex -= item.flex;
4694
+ availableSizeForFlex -= substractSize;
4695
+ }
4696
+ }
4697
+ });
4698
+ if (constrainedCount) {
4699
+ sizePerFlex = availableSizeForFlex / totalFlex;
4700
+ }
4701
+ let flexSizes = [];
4702
+ let currentFlexCount = 0;
4703
+ let remainingSizeForFlex = availableSizeForFlex;
4704
+ let remainingFlex = totalFlex;
4705
+ let totalTakenSize = 0;
4706
+ let flexSizeSum = 0;
4707
+ const computedSizes = [];
4708
+ const resultItems = items.map((item, index) => {
4709
+ var _a, _b, _c, _d, _e;
4710
+ const sizedItem = __spreadValues({}, item);
4711
+ let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
4712
+ let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
4713
+ let flexSize = 0;
4714
+ const maxxed = maxxedFlexItems[index];
4715
+ const minned = minnedFlexItems[index];
4716
+ const constrained = maxxed || minned;
4717
+ let computedSize = (_e = item.size) != null ? _e : 0;
4718
+ if (item.flex != null) {
4719
+ if (constrained) {
4720
+ if (minned) {
4721
+ flexSize = minSize;
4722
+ }
4723
+ if (maxxed) {
4724
+ flexSize = maxSize;
4725
+ }
4726
+ } else {
4727
+ currentFlexCount += 1;
4728
+ const constrain = (size) => {
4729
+ if (maxSize != null && size > maxSize) {
4730
+ size = maxSize;
4731
+ }
4732
+ if (minSize != null && size < minSize) {
4733
+ size = minSize;
4734
+ }
4735
+ return size;
4736
+ };
4737
+ if (currentFlexCount === totalFlexCount) {
4738
+ flexSize = constrain(remainingSizeForFlex);
4739
+ } else {
4740
+ flexSize = constrain(Math.round(item.flex * sizePerFlex));
4741
+ flexSizeSum += flexSize;
4742
+ remainingSizeForFlex = availableSizeForFlex - flexSizeSum;
4743
+ remainingFlex -= item.flex;
4744
+ sizePerFlex = remainingSizeForFlex / remainingFlex;
4745
+ }
4746
+ }
4747
+ computedSize = flexSize;
4748
+ sizedItem.flexSize = flexSize;
4749
+ }
4750
+ flexSizes.push(flexSize);
4751
+ computedSizes.push(computedSize);
4752
+ sizedItem.computedSize = computedSize;
4753
+ totalTakenSize += computedSize;
4754
+ return sizedItem;
4755
+ });
4756
+ return {
4757
+ items: resultItems,
4758
+ flexSizes,
4759
+ minSizes,
4760
+ maxSizes,
4761
+ computedSizes,
4762
+ remainingSize: Math.round(availableSize - totalTakenSize)
4763
+ };
4764
+ };
4765
+ function resizeClamp(value, min, max, direction) {
4766
+ if (min != null && value <= min) {
4767
+ return { value: min, clamped: "min", diff: (value - min) * direction };
4768
+ }
4769
+ if (max != null && value >= max) {
4770
+ return { value: max, clamped: "max", diff: (max - value) * direction };
4771
+ }
4772
+ return { value, clamped: false, diff: 0 };
4773
+ }
4774
+ var computeResize = (params) => {
4775
+ const { availableSize, reservedWidth = 0 } = params;
4776
+ const columnSizing = Object.keys(params.columnSizing).reduce((acc, key) => {
4777
+ acc[key] = __spreadValues({}, params.columnSizing[key]);
4778
+ return acc;
4779
+ }, {});
4780
+ if (availableSize < 0) {
4781
+ throw "The provided availableSize cannot be negative!";
4782
+ }
4783
+ let dragHandleOffset = params.dragHandleOffset;
4784
+ const firstIndex = params.dragHandlePositionAfter;
4785
+ const secondIndex = params.dragHandlePositionAfter + 1;
4786
+ const firstItem = params.items[firstIndex];
4787
+ const secondItem = params.items[secondIndex];
4788
+ const firstId = firstItem.id;
4789
+ const secondId = secondItem == null ? void 0 : secondItem.id;
4790
+ const firstSize = firstItem.computedWidth;
4791
+ const firstMinSize = firstItem.computedMinWidth;
4792
+ const firstMaxSize = firstItem.computedMaxWidth;
4793
+ const firstPropertyToAdjust = firstItem.computedFlex ? "flex" : "width";
4794
+ const secondSize = secondItem == null ? void 0 : secondItem.computedWidth;
4795
+ const secondMinSize = secondItem == null ? void 0 : secondItem.computedMinWidth;
4796
+ const secondMaxSize = secondItem == null ? void 0 : secondItem.computedMaxWidth;
4797
+ const secondPropertyToAdjust = (secondItem == null ? void 0 : secondItem.computedFlex) ? "flex" : "width";
4798
+ let maxReached = false;
4799
+ let minReached = false;
4800
+ const direction = dragHandleOffset > 0 ? 1 : -1;
4801
+ let {
4802
+ value: firstAdjustedSize,
4803
+ clamped: firstClamped,
4804
+ diff: firstDiff
4805
+ } = resizeClamp(firstSize + dragHandleOffset, firstMinSize, firstMaxSize, direction);
4806
+ if (params.shareSpaceOnResize) {
4807
+ if (secondItem == null) {
4808
+ columnSizing[firstId] = __spreadProps(__spreadValues({}, columnSizing[firstId]), {
4809
+ [firstPropertyToAdjust]: firstAdjustedSize
4810
+ });
4811
+ minReached = firstClamped === "min";
4812
+ maxReached = firstClamped === "max";
4813
+ const adjustedDiff2 = firstAdjustedSize - firstSize;
4814
+ return {
4815
+ adjustedDiff: adjustedDiff2,
4816
+ reservedWidth,
4817
+ columnSizing,
4818
+ minReached,
4819
+ maxReached,
4820
+ constrained: minReached || maxReached
4821
+ };
4822
+ }
4823
+ let {
4824
+ value: secondAdjustedSize,
4825
+ clamped: secondClamped,
4826
+ diff: secondDiff
4827
+ } = resizeClamp(secondSize - dragHandleOffset, secondMinSize, secondMaxSize, direction);
4828
+ if (firstClamped && secondClamped) {
4829
+ if (Math.abs(firstDiff) > Math.abs(secondDiff)) {
4830
+ secondClamped = false;
4831
+ } else {
4832
+ firstClamped = false;
4833
+ }
4834
+ }
4835
+ if (!firstClamped && !secondClamped) {
4836
+ } else if (firstClamped) {
4837
+ const clampResultForSecond = resizeClamp(secondSize - dragHandleOffset - firstDiff, secondMinSize, secondMaxSize, direction);
4838
+ secondAdjustedSize = clampResultForSecond.value;
4839
+ secondClamped = clampResultForSecond.clamped;
4840
+ secondDiff = clampResultForSecond.diff;
4841
+ } else if (secondClamped) {
4842
+ const clampResultForFirst = resizeClamp(firstSize + dragHandleOffset + secondDiff, firstMinSize, firstMaxSize, direction);
4843
+ firstAdjustedSize = clampResultForFirst.value;
4844
+ firstClamped = clampResultForFirst.clamped;
4845
+ firstDiff = clampResultForFirst.diff;
4846
+ }
4847
+ columnSizing[firstId] = __spreadProps(__spreadValues({}, columnSizing[firstId]), {
4848
+ [firstPropertyToAdjust]: firstAdjustedSize
4849
+ });
4850
+ columnSizing[secondId] = __spreadProps(__spreadValues({}, columnSizing[secondId]), {
4851
+ [secondPropertyToAdjust]: secondAdjustedSize
4852
+ });
4853
+ minReached = firstClamped === "min" || secondClamped === "min";
4854
+ maxReached = firstClamped === "max" || secondClamped === "max";
4855
+ } else {
4856
+ columnSizing[firstId] = __spreadProps(__spreadValues({}, columnSizing[firstId]), {
4857
+ [firstPropertyToAdjust]: firstAdjustedSize
4858
+ });
4859
+ minReached = firstClamped === "min";
4860
+ maxReached = firstClamped === "max";
4861
+ }
4862
+ const adjustedDiff = firstAdjustedSize - firstSize;
4863
+ return {
4864
+ adjustedDiff,
4865
+ reservedWidth: !params.shareSpaceOnResize ? reservedWidth - adjustedDiff : reservedWidth,
4866
+ columnSizing,
4867
+ minReached,
4868
+ maxReached,
4869
+ constrained: minReached || maxReached
4870
+ };
4871
+ };
4872
+ function sum(a, b) {
4873
+ return a + b;
4874
+ }
4875
+ function cloneColumnSizing(columnSizing) {
4876
+ const newColumnSizing = Object.keys(columnSizing).reduce((acc, key) => {
4877
+ acc[key] = __spreadValues({}, columnSizing[key]);
4878
+ return acc;
4879
+ }, {});
4880
+ return newColumnSizing;
4881
+ }
4882
+ var computeGroupResize = (params) => {
4883
+ const { availableSize, reservedWidth = 0 } = params;
4884
+ const columnSizing = Object.keys(params.columnSizing).reduce((acc, key) => {
4885
+ acc[key] = __spreadValues({}, params.columnSizing[key]);
4886
+ return acc;
4887
+ }, {});
4888
+ if (availableSize < 0) {
4889
+ throw "The provided availableSize cannot be negative!";
4890
+ }
4891
+ let dragHandleOffset = params.dragHandleOffset;
4892
+ const beforeIndexes = [...new Array(params.columnGroupSize)].map((_, index) => params.dragHandlePositionAfter - index).reverse();
4893
+ const beforeItems = beforeIndexes.map((i) => params.items[i]);
4894
+ const beforeSizes = beforeItems.map((item) => item.computedWidth);
4895
+ const beforePropertiesToAdjust = beforeItems.map((item) => item.computedFlex ? "flex" : "width");
4896
+ let unresizableWidth = 0;
4897
+ const { computedSizes } = computeFlex({
4898
+ items: beforeItems.map((item) => {
4899
+ if (item.resizable === false) {
4900
+ unresizableWidth += item.computedWidth;
4901
+ }
4902
+ return {
4903
+ flex: item.resizable ? item.computedWidth : null,
4904
+ size: 0
4905
+ };
4906
+ }),
4907
+ availableSize: Math.max(beforeSizes.reduce(sum, 0) + dragHandleOffset - unresizableWidth, 0)
4908
+ });
4909
+ const diffsForEachItem = beforeItems.map((item, index) => {
4910
+ return computedSizes[index] - item.computedWidth;
4911
+ });
4912
+ let groupMinReached = true;
4913
+ let groupMaxReached = true;
4914
+ let groupConstrained = true;
4915
+ const adjustedDiffs = [];
4916
+ diffsForEachItem.forEach((diff, i) => {
4917
+ const item = beforeItems[i];
4918
+ if (!item.resizable) {
4919
+ adjustedDiffs.push(0);
4920
+ return;
4921
+ }
4922
+ const propertyToAdjust = beforePropertiesToAdjust[i];
4923
+ const itemSize = beforeSizes[i];
4924
+ const currentColumnSizing = cloneColumnSizing(columnSizing);
4925
+ const { maxReached, minReached, constrained, adjustedDiff: adjustedDiff2 } = computeResize({
4926
+ availableSize: params.availableSize,
4927
+ reservedWidth: params.reservedWidth,
4928
+ dragHandleOffset: diff,
4929
+ dragHandlePositionAfter: beforeIndexes[i],
4930
+ shareSpaceOnResize: false,
4931
+ items: params.items,
4932
+ columnSizing: currentColumnSizing
4933
+ });
4934
+ columnSizing[item.id] = __spreadProps(__spreadValues({}, currentColumnSizing[item.id]), {
4935
+ [propertyToAdjust]: itemSize + adjustedDiff2
4936
+ });
4937
+ adjustedDiffs.push(adjustedDiff2);
4938
+ if (!maxReached) {
4939
+ groupMaxReached = false;
4940
+ }
4941
+ if (!minReached) {
4942
+ groupMinReached = false;
4943
+ }
4944
+ if (!constrained) {
4945
+ groupConstrained = false;
4946
+ }
4947
+ });
4948
+ const adjustedDiff = adjustedDiffs.reduce(sum, 0);
4949
+ return {
4950
+ minReached: groupMinReached,
4951
+ maxReached: groupMaxReached,
4952
+ constrained: groupConstrained,
4953
+ adjustedDiffs,
4954
+ adjustedDiff,
4955
+ columnSizing,
4956
+ reservedWidth: reservedWidth - adjustedDiff
4957
+ };
4958
+ };
4959
+
4960
+ // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
4961
+ import React20, { useRef as useRef12, useState as useState9 } from "react";
4962
+
4963
+ // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts
4964
+ function getColumnResizer(colIndex, {
4965
+ columns,
4966
+ shareSpaceOnResize,
4967
+ domRef
4968
+ }) {
4969
+ const column = columns[colIndex];
4970
+ return {
4971
+ resize(diff) {
4972
+ setInfiniteColumnWidth(colIndex, column.computedWidth + diff, domRef.current);
4973
+ const nextColIndex = colIndex + 1;
4974
+ if (shareSpaceOnResize) {
4975
+ const nextColumn = columns[nextColIndex];
4976
+ if (!nextColumn) {
4977
+ return;
4978
+ }
4979
+ setInfiniteColumnWidth(nextColIndex, nextColumn.computedWidth - diff, domRef.current);
4980
+ setInfiniteColumnOffset(nextColIndex, nextColumn.computedOffset + diff, domRef.current);
4981
+ return;
4982
+ }
4983
+ for (let i = nextColIndex, len = columns.length; i < len; i++) {
4984
+ setInfiniteColumnOffset(i, columns[i].computedOffset + diff, domRef.current);
4985
+ }
4986
+ }
4987
+ };
4988
+ }
4989
+ function getColumnGroupResizer(colIndexes, config) {
4990
+ const lastColIndex = colIndexes[colIndexes.length - 1];
4991
+ return {
4992
+ resize(diffs) {
4993
+ const { columns, domRef } = config;
4994
+ let offset = columns[colIndexes[0]].computedOffset;
4995
+ let diffSum = 0;
4996
+ const node = domRef.current;
4997
+ diffs.forEach((diff, i) => {
4998
+ diffSum += diff;
4999
+ const colIndex = colIndexes[i];
5000
+ const column = columns[colIndex];
5001
+ const newWidth = column.computedWidth + diff;
5002
+ setInfiniteColumnWidth(colIndex, newWidth, node);
5003
+ if (offset) {
5004
+ setInfiniteColumnOffset(colIndex, offset, node);
5005
+ }
5006
+ offset += newWidth;
5007
+ });
5008
+ for (let i = lastColIndex + 1; i < columns.length; i++) {
5009
+ setInfiniteColumnOffset(i, columns[i].computedOffset + diffSum, node);
5010
+ }
5011
+ }
5012
+ };
5013
+ }
5014
+
5015
+ // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
5016
+ var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5017
+ var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iwv _16lm1iw11 _16lm1iwz _16lm1iwe";
5018
+ var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "zneyzh1 _16lm1iw2 _16lm1iwv _16lm1iwz", variantClassNames: { constrained: { false: "zneyzh2", true: "zneyzh3" } }, defaultVariants: {}, compoundVariants: [] });
5019
+
5020
+ // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
5021
+ var { rootClassName: rootClassName7 } = internalProps;
5022
+ var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName7}HeaderCell_ResizeHandle`;
5023
+ function ResizeHandleFn(props) {
5024
+ const domRef = useRef12(null);
5025
+ const [constrained, setConstrained] = useState9(false);
5026
+ const constrainedRef = useRef12(constrained);
5027
+ constrainedRef.current = constrained;
5028
+ const onPointerDown = (e) => {
5029
+ e.stopPropagation();
5030
+ const shareSpaceOnResize = !!e.shiftKey;
5031
+ const pointerId = e.pointerId;
5032
+ const initialX = e.clientX;
5033
+ const target = e.target;
5034
+ target.setPointerCapture(pointerId);
5035
+ const resizer = getColumnResizer(props.columnIndex, {
5036
+ columns: props.columns,
5037
+ shareSpaceOnResize,
5038
+ domRef
5039
+ });
5040
+ const resizeDiff = (diff) => {
5041
+ const { adjustedDiff, constrained: constrained2 } = props.computeResize({
5042
+ diff,
5043
+ shareSpaceOnResize
5044
+ });
5045
+ if (constrainedRef.current !== constrained2) {
5046
+ setConstrained(constrained2);
5047
+ }
5048
+ resizer.resize(adjustedDiff);
5049
+ return adjustedDiff;
5050
+ };
5051
+ const onPointerMove = (e2) => {
5052
+ resizeDiff(Math.round(e2.clientX - initialX));
5053
+ };
5054
+ const onPointerUp = (e2) => {
5055
+ target.releasePointerCapture(pointerId);
5056
+ target.removeEventListener("pointermove", onPointerMove);
5057
+ target.removeEventListener("pointerup", onPointerUp);
5058
+ const diff = Math.round(e2.clientX - initialX);
5059
+ const adjustedDiff = resizeDiff(diff);
5060
+ props.onResize({ diff: adjustedDiff, shareSpaceOnResize });
5061
+ };
5062
+ target.addEventListener("pointermove", onPointerMove);
5063
+ target.addEventListener("pointerup", onPointerUp);
5064
+ };
5065
+ return /* @__PURE__ */ React20.createElement("div", {
5066
+ ref: domRef,
5067
+ className: `${InfiniteTableHeaderCellResizeHandleCls} ${ResizeHandleCls}`,
5068
+ onPointerDown
5069
+ }, /* @__PURE__ */ React20.createElement("div", {
5070
+ className: ResizeHandleDraggerClsRecipe({
5071
+ constrained
5072
+ })
5073
+ }));
5074
+ }
5075
+ var ResizeHandle = React20.memo(ResizeHandleFn);
5076
+
5077
+ // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
5078
+ function useColumnResizeHandle(column) {
5079
+ const {
5080
+ computed: { computedVisibleColumns },
5081
+ componentState: { domRef },
5082
+ getState,
5083
+ getComputed,
5084
+ componentActions
5085
+ } = useInfiniteTable();
5086
+ const computeResizeForDiff = useCallback7(({
5087
+ diff,
5088
+ shareSpaceOnResize
5089
+ }) => {
5090
+ const state = getState();
5091
+ const { columnSizing, viewportReservedWidth, bodySize, activeCellIndex } = state;
5092
+ const columns = getComputed().computedVisibleColumns;
5093
+ let atLeastOneFlex = false;
5094
+ const columnSizingWithFlex = columns.reduce((acc, col) => {
5095
+ if (col.computedFlex) {
5096
+ acc[col.id] = { flex: col.computedWidth };
5097
+ atLeastOneFlex = true;
5098
+ }
5099
+ return acc;
5100
+ }, {});
5101
+ const columnSizingForResize = atLeastOneFlex ? __spreadValues(__spreadValues({}, columnSizing), columnSizingWithFlex) : columnSizing;
5102
+ const result = computeResize({
5103
+ shareSpaceOnResize,
5104
+ availableSize: bodySize.width,
5105
+ reservedWidth: viewportReservedWidth || 0,
5106
+ dragHandleOffset: diff,
5107
+ dragHandlePositionAfter: column.computedVisibleIndex,
5108
+ columnSizing: columnSizingForResize,
5109
+ items: columns.map((c) => {
5110
+ return {
5111
+ id: c.id,
5112
+ computedFlex: c.computedFlex,
5113
+ computedWidth: c.computedWidth,
5114
+ computedMinWidth: c.computedMinWidth,
5115
+ computedMaxWidth: c.computedMaxWidth
5116
+ };
5117
+ })
5118
+ });
5119
+ if (activeCellIndex && activeCellIndex[1] >= column.computedVisibleIndex) {
5120
+ const activeColumn = columns[activeCellIndex[1]];
5121
+ const currentColumn = columns[column.computedVisibleIndex];
5122
+ if (activeCellIndex[1] === currentColumn.computedVisibleIndex) {
5123
+ setInfiniteColumnWidth(currentColumn.computedVisibleIndex, currentColumn.computedWidth + result.adjustedDiff, domRef.current);
5124
+ } else if (activeColumn) {
5125
+ setInfiniteColumnOffset(activeColumn.computedVisibleIndex, activeColumn.computedOffset + result.adjustedDiff, domRef.current);
5126
+ }
5127
+ if (shareSpaceOnResize && activeCellIndex[1] === currentColumn.computedVisibleIndex + 1 && activeColumn) {
5128
+ setInfiniteColumnWidth(activeColumn.computedVisibleIndex, activeColumn.computedWidth - result.adjustedDiff, domRef.current);
5129
+ }
5130
+ }
5131
+ return result;
5132
+ }, []);
5133
+ const onColumnResize = useCallback7(({
5134
+ diff,
5135
+ shareSpaceOnResize
5136
+ }) => {
5137
+ const { columnSizing, reservedWidth } = computeResizeForDiff({
5138
+ diff,
5139
+ shareSpaceOnResize
5140
+ });
5141
+ if (!shareSpaceOnResize) {
5142
+ componentActions.viewportReservedWidth = reservedWidth;
5143
+ }
5144
+ componentActions.columnSizing = columnSizing;
5145
+ }, []);
5146
+ const resizeHandle = column.computedResizable ? /* @__PURE__ */ createElement15(ResizeHandle, {
5147
+ columns: computedVisibleColumns,
5148
+ columnIndex: column.computedVisibleIndex,
5149
+ computeResize: computeResizeForDiff,
5150
+ onResize: onColumnResize
5151
+ }) : null;
5152
+ return resizeHandle;
5153
+ }
5154
+
4531
5155
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
4532
5156
  var InfiniteTableHeaderCellContext = createContext4(null);
4533
- var { rootClassName: rootClassName7 } = internalProps;
4534
- var InfiniteTableHeaderCellClassName = `${rootClassName7}HeaderCell`;
5157
+ var { rootClassName: rootClassName8 } = internalProps;
5158
+ var InfiniteTableHeaderCellClassName = `${rootClassName8}HeaderCell`;
4535
5159
  function InfiniteTableHeaderCell(props) {
4536
5160
  var _a, _b, _c, _d, _e;
4537
5161
  const column = props.column;
@@ -4539,13 +5163,13 @@ function InfiniteTableHeaderCell(props) {
4539
5163
  const { onResize, height, width, headerOptions } = props;
4540
5164
  const sortInfo = column.computedSortInfo;
4541
5165
  let header = column.header;
4542
- const ref = useCallback7((node) => {
5166
+ const ref = useCallback8((node) => {
4543
5167
  var _a2;
4544
5168
  domRef.current = node;
4545
5169
  (_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
4546
5170
  }, [props.domRef]);
4547
5171
  const alwaysShow = headerOptions.alwaysReserveSpaceForSortIcon;
4548
- const sortTool = column.computedSorted || alwaysShow ? /* @__PURE__ */ createElement15(SortIcon, {
5172
+ const sortTool = column.computedSorted || alwaysShow ? /* @__PURE__ */ createElement16(SortIcon, {
4549
5173
  index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
4550
5174
  className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls} ${HeaderSortIconRecipe({
4551
5175
  align: column.align || "start"
@@ -4562,15 +5186,15 @@ function InfiniteTableHeaderCell(props) {
4562
5186
  const align = column.align || "start";
4563
5187
  const renderChildren = () => {
4564
5188
  if (header instanceof Function) {
4565
- header = /* @__PURE__ */ createElement15(RenderHookComponent, {
5189
+ header = /* @__PURE__ */ createElement16(RenderHookComponent, {
4566
5190
  render: header,
4567
5191
  renderParam
4568
5192
  });
4569
5193
  }
4570
5194
  header = header != null ? header : column.name;
4571
- return /* @__PURE__ */ createElement15(Fragment2, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
5195
+ return /* @__PURE__ */ createElement16(Fragment2, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
4572
5196
  };
4573
- const domRef = useRef12(null);
5197
+ const domRef = useRef13(null);
4574
5198
  const {
4575
5199
  computed: {
4576
5200
  computedRemainingSpace,
@@ -4597,7 +5221,7 @@ function InfiniteTableHeaderCell(props) {
4597
5221
  const style = {
4598
5222
  height
4599
5223
  };
4600
- const { onPointerDown, onPointerUp, dragging, draggingDiff, proxyOffset } = useColumnPointerEvents({
5224
+ const { onPointerDown, dragging, draggingDiff, proxyOffset } = useColumnPointerEvents({
4601
5225
  computedRemainingSpace,
4602
5226
  columnId: column.id,
4603
5227
  domRef,
@@ -4605,7 +5229,7 @@ function InfiniteTableHeaderCell(props) {
4605
5229
  });
4606
5230
  let draggingProxy = null;
4607
5231
  if (dragging) {
4608
- draggingProxy = /* @__PURE__ */ createElement15("div", {
5232
+ draggingProxy = /* @__PURE__ */ createElement16("div", {
4609
5233
  className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
4610
5234
  style: {
4611
5235
  position: "absolute",
@@ -4622,7 +5246,7 @@ function InfiniteTableHeaderCell(props) {
4622
5246
  const contentRecipeVariants = {
4623
5247
  filtered: column.computedFiltered
4624
5248
  };
4625
- const setFilterValue = useCallback7((filterValue) => {
5249
+ const setFilterValue = useCallback8((filterValue) => {
4626
5250
  var _a2;
4627
5251
  const state = getDataSourceState();
4628
5252
  let newFilterValue = (_a2 = state.filterValue) != null ? _a2 : [];
@@ -4683,10 +5307,10 @@ function InfiniteTableHeaderCell(props) {
4683
5307
  ]);
4684
5308
  const filterType = column.computedFilterType;
4685
5309
  const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
4686
- const resizeHandle = null;
4687
- return /* @__PURE__ */ createElement15(ContextProvider, {
5310
+ const resizeHandle = useColumnResizeHandle(column);
5311
+ return /* @__PURE__ */ createElement16(ContextProvider, {
4688
5312
  value: renderParam
4689
- }, /* @__PURE__ */ createElement15(InfiniteTableCell, {
5313
+ }, /* @__PURE__ */ createElement16(InfiniteTableCell, {
4690
5314
  domRef: ref,
4691
5315
  cellType: "header",
4692
5316
  column,
@@ -4696,12 +5320,11 @@ function InfiniteTableHeaderCell(props) {
4696
5320
  style,
4697
5321
  width,
4698
5322
  onPointerDown,
4699
- onPointerUp,
4700
5323
  contentClassName: join(HeaderCellContentRecipe(contentRecipeVariants), justifyContent[(_c = column.align) != null ? _c : "start"]),
4701
5324
  contentStyle: showColumnFilters ? { height: height / 2 } : void 0,
4702
5325
  className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, { dragging, zebra: false, rowActive: false }), CellCls),
4703
5326
  cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
4704
- afterChildren: /* @__PURE__ */ createElement15(Fragment2, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ createElement15(InfiniteTableColumnHeaderFilter, {
5327
+ afterChildren: /* @__PURE__ */ createElement16(Fragment2, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ createElement16(InfiniteTableColumnHeaderFilter, {
4705
5328
  filterEditor: FilterEditor,
4706
5329
  filterTypes,
4707
5330
  onChange: debouncedOnFilterValueChange,
@@ -4709,7 +5332,7 @@ function InfiniteTableHeaderCell(props) {
4709
5332
  columnLabel: column.field || column.name || column.id,
4710
5333
  columnFilterValue: column.computedFilterValue,
4711
5334
  columnHeaderHeight
4712
- }) : /* @__PURE__ */ createElement15(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
5335
+ }) : /* @__PURE__ */ createElement16(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
4713
5336
  renderChildren
4714
5337
  }), draggingProxy);
4715
5338
  }
@@ -4720,8 +5343,8 @@ function useInfiniteHeaderCell() {
4720
5343
 
4721
5344
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
4722
5345
  import {
4723
- createElement as createElement18,
4724
- useCallback as useCallback9,
5346
+ createElement as createElement20,
5347
+ useCallback as useCallback11,
4725
5348
  useMemo as useMemo6
4726
5349
  } from "react";
4727
5350
 
@@ -4809,7 +5432,7 @@ function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap, c
4809
5432
  let groupOffset = 0;
4810
5433
  map2.forEach((item) => {
4811
5434
  if (!item.ref.columnGroup) {
4812
- const itemWidth = item.type === "column" ? item.ref.computedWidth : item.columnItems.reduce((sum, col) => sum + col.ref.computedWidth, 0);
5435
+ const itemWidth = item.type === "column" ? item.ref.computedWidth : item.columnItems.reduce((sum2, col) => sum2 + col.ref.computedWidth, 0);
4813
5436
  item.groupOffset = groupOffset;
4814
5437
  item.computedWidth = itemWidth;
4815
5438
  if (item.type === "group") {
@@ -4834,7 +5457,7 @@ function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap, c
4834
5457
  }
4835
5458
  function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
4836
5459
  items.forEach((item) => {
4837
- const itemWidth = item.type === "column" ? item.ref.computedWidth : item.columnItems.reduce((sum, col) => sum + col.ref.computedWidth, 0);
5460
+ const itemWidth = item.type === "column" ? item.ref.computedWidth : item.columnItems.reduce((sum2, col) => sum2 + col.ref.computedWidth, 0);
4838
5461
  item.computedWidth = itemWidth;
4839
5462
  item.groupOffset = groupOffset;
4840
5463
  if (item.type === "group") {
@@ -4846,40 +5469,192 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
4846
5469
 
4847
5470
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
4848
5471
  import {
4849
- createElement as createElement17,
5472
+ createElement as createElement19,
4850
5473
  memo as memo8
4851
5474
  } from "react";
4852
- import { useCallback as useCallback8, useEffect as useEffect12, useRef as useRef13 } from "react";
5475
+ import { useCallback as useCallback10, useEffect as useEffect12, useRef as useRef15 } from "react";
4853
5476
 
4854
5477
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
4855
5478
  import {
4856
- createElement as createElement16
5479
+ createElement as createElement18
5480
+ } from "react";
5481
+
5482
+ // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
5483
+ import {
5484
+ createElement as createElement17
4857
5485
  } from "react";
5486
+ import { useCallback as useCallback9 } from "react";
5487
+
5488
+ // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
5489
+ import React23, { useRef as useRef14, useState as useState10 } from "react";
5490
+ var { rootClassName: rootClassName9 } = internalProps;
5491
+ var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName9}HeaderCell_ResizeHandle`;
5492
+ function GroupResizeHandleFn(props) {
5493
+ const domRef = useRef14(null);
5494
+ const [constrained, setConstrained] = useState10(false);
5495
+ const constrainedRef = useRef14(constrained);
5496
+ constrainedRef.current = constrained;
5497
+ const onPointerDown = (e) => {
5498
+ e.stopPropagation();
5499
+ const pointerId = e.pointerId;
5500
+ const initialX = e.clientX;
5501
+ const target = e.target;
5502
+ target.setPointerCapture(pointerId);
5503
+ let initialMove = true;
5504
+ const resizer = getColumnGroupResizer(props.groupColumns.map((c) => c.computedVisibleIndex), {
5505
+ columns: props.columns,
5506
+ domRef
5507
+ });
5508
+ const resizeDiff = (diff) => {
5509
+ const { constrained: constrained2, adjustedDiffs, adjustedDiff } = props.computeResize(diff);
5510
+ if (constrainedRef.current !== constrained2) {
5511
+ setConstrained(constrained2);
5512
+ }
5513
+ resizer.resize(adjustedDiffs);
5514
+ return adjustedDiff;
5515
+ };
5516
+ const onPointerMove = (e2) => {
5517
+ if (initialMove) {
5518
+ const maxDiff = props.groupColumns.reduce((diff, col) => {
5519
+ return diff + col.computedWidth - col.computedMinWidth;
5520
+ }, 0);
5521
+ const currentSize = props.brain.getAvailableSize();
5522
+ const newSize = {
5523
+ width: currentSize.width + maxDiff,
5524
+ height: currentSize.height
5525
+ };
5526
+ props.brain.setAvailableSize(newSize);
5527
+ initialMove = false;
5528
+ }
5529
+ resizeDiff(Math.round(e2.clientX - initialX));
5530
+ };
5531
+ const onPointerUp = (e2) => {
5532
+ target.releasePointerCapture(pointerId);
5533
+ target.removeEventListener("pointermove", onPointerMove);
5534
+ target.removeEventListener("pointerup", onPointerUp);
5535
+ const diff = Math.round(e2.clientX - initialX);
5536
+ const adjustedDiffs = resizeDiff(diff);
5537
+ props.onResize(adjustedDiffs);
5538
+ };
5539
+ target.addEventListener("pointermove", onPointerMove);
5540
+ target.addEventListener("pointerup", onPointerUp);
5541
+ };
5542
+ return /* @__PURE__ */ React23.createElement("div", {
5543
+ ref: domRef,
5544
+ className: `${InfiniteTableHeaderCellResizeHandleCls2} ${ResizeHandleCls}`,
5545
+ onPointerDown
5546
+ }, /* @__PURE__ */ React23.createElement("div", {
5547
+ style: props.style,
5548
+ className: ResizeHandleDraggerClsRecipe({
5549
+ constrained
5550
+ })
5551
+ }));
5552
+ }
5553
+ var GroupResizeHandle = React23.memo(GroupResizeHandleFn);
5554
+
5555
+ // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
5556
+ function useColumnGroupResizeHandle(groupColumns, config) {
5557
+ const { bodyBrain, groupHeight, columnGroup, columnGroupsMaxDepth } = config;
5558
+ const {
5559
+ computed: { computedVisibleColumns },
5560
+ getState,
5561
+ getComputed,
5562
+ componentActions
5563
+ } = useInfiniteTable();
5564
+ const lastColumnInGroup = groupColumns[groupColumns.length - 1];
5565
+ const computeResizeForDiff = useCallback9((diff) => {
5566
+ const state = getState();
5567
+ const { columnSizing, viewportReservedWidth, bodySize } = state;
5568
+ const columns = getComputed().computedVisibleColumns;
5569
+ let atLeastOneFlex = false;
5570
+ const columnSizingWithFlex = columns.reduce((acc, col) => {
5571
+ if (col.computedFlex) {
5572
+ acc[col.id] = { flex: col.computedWidth };
5573
+ atLeastOneFlex = true;
5574
+ }
5575
+ return acc;
5576
+ }, {});
5577
+ const columnSizingForResize = atLeastOneFlex ? __spreadValues(__spreadValues({}, columnSizing), columnSizingWithFlex) : columnSizing;
5578
+ const result = computeGroupResize({
5579
+ availableSize: bodySize.width,
5580
+ reservedWidth: viewportReservedWidth || 0,
5581
+ dragHandleOffset: diff,
5582
+ dragHandlePositionAfter: lastColumnInGroup.computedVisibleIndex,
5583
+ columnSizing: columnSizingForResize,
5584
+ columnGroupSize: groupColumns.length,
5585
+ items: columns.map((c) => {
5586
+ return {
5587
+ id: c.id,
5588
+ resizable: c.computedResizable,
5589
+ computedFlex: c.computedFlex,
5590
+ computedWidth: c.computedWidth,
5591
+ computedMinWidth: c.computedMinWidth,
5592
+ computedMaxWidth: c.computedMaxWidth
5593
+ };
5594
+ })
5595
+ });
5596
+ return result;
5597
+ }, []);
5598
+ const onColumnResize = useCallback9((diff) => {
5599
+ const { columnSizing, reservedWidth } = computeResizeForDiff(diff);
5600
+ componentActions.viewportReservedWidth = reservedWidth;
5601
+ componentActions.columnSizing = columnSizing;
5602
+ }, []);
5603
+ const groupResizable = groupColumns.some((c) => c.computedResizable);
5604
+ const resizeHandle = groupResizable ? /* @__PURE__ */ createElement17(GroupResizeHandle, {
5605
+ brain: bodyBrain,
5606
+ style: {
5607
+ height: groupHeight * (columnGroupsMaxDepth - columnGroup.depth + 2)
5608
+ },
5609
+ columns: computedVisibleColumns,
5610
+ groupColumns,
5611
+ computeResize: computeResizeForDiff,
5612
+ onResize: onColumnResize
5613
+ }) : null;
5614
+ return resizeHandle;
5615
+ }
5616
+
5617
+ // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
4858
5618
  var TableHeaderGroupClassName = `${rootClassName2}HeaderGroup`;
5619
+ var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
4859
5620
  function InfiniteTableHeaderGroup(props) {
4860
- const { columnGroup, height, width } = props;
5621
+ const {
5622
+ computed: { computedVisibleColumns }
5623
+ } = useInfiniteTable();
5624
+ const { columnGroup, height, columns, bodyBrain, columnGroupsMaxDepth } = props;
4861
5625
  let { header } = columnGroup;
4862
5626
  if (header instanceof Function) {
4863
5627
  header = header({
4864
5628
  columnGroup
4865
5629
  });
4866
5630
  }
4867
- return /* @__PURE__ */ createElement16("div", {
5631
+ const handle = useColumnGroupResizeHandle(columns, {
5632
+ bodyBrain,
5633
+ groupHeight: height,
5634
+ columnGroup,
5635
+ columnGroupsMaxDepth
5636
+ });
5637
+ const firstColumn = columns[0];
5638
+ const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex3}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex3}-${firstColumn.computedVisibleIndex})`;
5639
+ const zIndex2 = computedVisibleColumns.length * 10 - firstColumn.computedVisibleIndex * 10 + height * (columnGroupsMaxDepth - columnGroup.depth + 2);
5640
+ return /* @__PURE__ */ createElement18("div", {
4868
5641
  ref: props.domRef,
4869
5642
  "data-group-id": columnGroup.uniqueGroupId,
4870
5643
  className: join(HeaderGroupCls, TableHeaderGroupClassName),
4871
- style: { width, height }
4872
- }, /* @__PURE__ */ createElement16("div", {
5644
+ style: { width, height },
5645
+ "data-z-index": zIndex2
5646
+ }, /* @__PURE__ */ createElement18("div", {
4873
5647
  className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
4874
- }, header));
5648
+ }, header), handle);
4875
5649
  }
4876
5650
 
4877
5651
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
4878
- var { rootClassName: rootClassName8 } = internalProps;
4879
- var TableHeaderClassName = `${rootClassName8}Header`;
5652
+ var { rootClassName: rootClassName10 } = internalProps;
5653
+ var TableHeaderClassName = `${rootClassName10}Header`;
4880
5654
  function InfiniteTableHeaderFn(props) {
4881
5655
  const {
4882
- brain,
5656
+ bodyBrain,
5657
+ headerBrain: brain,
4883
5658
  columns,
4884
5659
  style,
4885
5660
  className,
@@ -4901,7 +5676,7 @@ function InfiniteTableHeaderFn(props) {
4901
5676
  const removeOnScroll = brain.onScroll(onScroll);
4902
5677
  return removeOnScroll;
4903
5678
  }, [brain]);
4904
- const domRef = useRef13(null);
5679
+ const domRef = useRef15(null);
4905
5680
  const headerCls = HeaderClsRecipe({
4906
5681
  overflow: false,
4907
5682
  virtualized: true
@@ -4911,7 +5686,7 @@ function InfiniteTableHeaderFn(props) {
4911
5686
  className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
4912
5687
  style: __spreadProps(__spreadValues({}, style), { height: columnHeaderHeight })
4913
5688
  };
4914
- const renderCell = useCallback8((params) => {
5689
+ const renderCell = useCallback10((params) => {
4915
5690
  const {
4916
5691
  rowIndex,
4917
5692
  colIndex,
@@ -4936,7 +5711,9 @@ function InfiniteTableHeaderFn(props) {
4936
5711
  computedWidth: colGroupItem.computedWidth,
4937
5712
  groupOffset: colGroupItem.groupOffset
4938
5713
  });
4939
- return /* @__PURE__ */ createElement17(InfiniteTableHeaderGroup, {
5714
+ return /* @__PURE__ */ createElement19(InfiniteTableHeaderGroup, {
5715
+ bodyBrain,
5716
+ columnGroupsMaxDepth,
4940
5717
  domRef: domRef2,
4941
5718
  columns: columns2,
4942
5719
  width: widthWithColspan,
@@ -4944,7 +5721,7 @@ function InfiniteTableHeaderFn(props) {
4944
5721
  columnGroup: computedColumnGroup
4945
5722
  });
4946
5723
  }
4947
- return /* @__PURE__ */ createElement17(InfiniteTableHeaderCell, {
5724
+ return /* @__PURE__ */ createElement19(InfiniteTableHeaderCell, {
4948
5725
  domRef: domRef2,
4949
5726
  column,
4950
5727
  headerOptions,
@@ -4960,7 +5737,8 @@ function InfiniteTableHeaderFn(props) {
4960
5737
  columnGroupsMaxDepth,
4961
5738
  showColumnFilters
4962
5739
  ]);
4963
- return /* @__PURE__ */ createElement17("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement17(RawTable, {
5740
+ return /* @__PURE__ */ createElement19("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement19(RawTable, {
5741
+ name: "header",
4964
5742
  renderCell,
4965
5743
  brain: headerBrain,
4966
5744
  cellHoverClassNames: []
@@ -4970,7 +5748,7 @@ var InfiniteTableHeader = memo8(InfiniteTableHeaderFn);
4970
5748
 
4971
5749
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
4972
5750
  function TableHeaderWrapper(props) {
4973
- const { brain, scrollbars } = props;
5751
+ const { headerBrain, bodyBrain, scrollbars } = props;
4974
5752
  const tableContextValue = useInfiniteTable();
4975
5753
  const {
4976
5754
  computedPinnedStartColumns,
@@ -4995,7 +5773,7 @@ function TableHeaderWrapper(props) {
4995
5773
  }
4996
5774
  return buildColumnAndGroupTree(computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap, columnGroupsMaxDepth);
4997
5775
  }, [computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap]);
4998
- const cellspan = useCallback9(({ rowIndex, colIndex }) => {
5776
+ const cellspan = useCallback11(({ rowIndex, colIndex }) => {
4999
5777
  const column = computedVisibleColumns[colIndex];
5000
5778
  const rowspan2 = 1;
5001
5779
  const colspan2 = 1;
@@ -5028,12 +5806,12 @@ function TableHeaderWrapper(props) {
5028
5806
  rows,
5029
5807
  columnGroupsDepthsMap
5030
5808
  ]);
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) => {
5809
+ const rowspan = useCallback11(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).rowspan, [cellspan]);
5810
+ const colspan = useCallback11(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).colspan, [cellspan]);
5811
+ const rowHeight = useCallback11((index) => {
5034
5812
  return showColumnFilters ? index < rows - 1 ? columnHeaderHeight : 2 * columnHeaderHeight : columnHeaderHeight;
5035
5813
  }, [rows, showColumnFilters, columnHeaderHeight]);
5036
- useMatrixBrain(brain, {
5814
+ useMatrixBrain(headerBrain, {
5037
5815
  colWidth: columnSize,
5038
5816
  rowHeight,
5039
5817
  rows,
@@ -5045,21 +5823,22 @@ function TableHeaderWrapper(props) {
5045
5823
  fixedColsEnd: computedPinnedEndColumns.length,
5046
5824
  fixedColsStart: computedPinnedStartColumns.length
5047
5825
  });
5048
- const header = /* @__PURE__ */ createElement18(InfiniteTableHeader, {
5826
+ const header = /* @__PURE__ */ createElement20(InfiniteTableHeader, {
5049
5827
  columns: computedVisibleColumns,
5050
- brain,
5828
+ headerBrain,
5829
+ bodyBrain,
5051
5830
  columnHeaderHeight: height,
5052
5831
  columnGroupsMaxDepth,
5053
5832
  columnAndGroupTreeInfo
5054
5833
  });
5055
- const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ createElement18("div", {
5834
+ const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ createElement20("div", {
5056
5835
  className: HeaderScrollbarPlaceholderCls,
5057
5836
  style: {
5058
5837
  zIndex: 1e3,
5059
5838
  width: getScrollbarWidth()
5060
5839
  }
5061
5840
  }) : null;
5062
- return /* @__PURE__ */ createElement18("div", {
5841
+ return /* @__PURE__ */ createElement20("div", {
5063
5842
  className: HeaderWrapperCls,
5064
5843
  style: {
5065
5844
  height
@@ -5069,10 +5848,10 @@ function TableHeaderWrapper(props) {
5069
5848
 
5070
5849
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
5071
5850
  import {
5072
- createElement as createElement19,
5851
+ createElement as createElement21,
5073
5852
  forwardRef as forwardRef4,
5074
- useCallback as useCallback10,
5075
- useRef as useRef14
5853
+ useCallback as useCallback12,
5854
+ useRef as useRef16
5076
5855
  } from "react";
5077
5856
  import { useEffect as useEffect13 } from "react";
5078
5857
 
@@ -5082,17 +5861,13 @@ function decamelize(str, options) {
5082
5861
  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
5862
  }
5084
5863
 
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
5864
  // src/components/InfiniteTable/InfiniteCls.css.ts
5090
- var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5865
+ var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5091
5866
  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: [] });
5867
+ var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwn _16lm1iw13 _16lm1iw0";
5868
+ 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"]] });
5869
+ var InfiniteClsShiftingColumns = "_16lm1iwq";
5870
+ var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
5096
5871
 
5097
5872
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
5098
5873
  var defaultStyle = {
@@ -5122,9 +5897,9 @@ var enforceStyle = (node, style) => {
5122
5897
  }
5123
5898
  };
5124
5899
  var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter2(props, ref) {
5125
- const { rootClassName: rootClassName11 } = useInternalProps();
5126
- const domRef = useRef14(null);
5127
- const domCallback = useCallback10((node) => {
5900
+ const { rootClassName: rootClassName13 } = useInternalProps();
5901
+ const domRef = useRef16(null);
5902
+ const domCallback = useCallback12((node) => {
5128
5903
  domRef.current = node;
5129
5904
  if (!ref) {
5130
5905
  return;
@@ -5149,12 +5924,12 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
5149
5924
  clearInterval(intervalId);
5150
5925
  };
5151
5926
  }, []);
5152
- return /* @__PURE__ */ createElement19("div", __spreadProps(__spreadValues({
5927
+ return /* @__PURE__ */ createElement21("div", __spreadProps(__spreadValues({
5153
5928
  ref: domCallback
5154
5929
  }, props), {
5155
- className: join(`${rootClassName11}-Footer`, FooterCls, props.className),
5930
+ className: join(`${rootClassName13}-Footer`, FooterCls, props.className),
5156
5931
  style: defaultStyle
5157
- }), "Powered by", " ", /* @__PURE__ */ createElement19("a", {
5932
+ }), "Powered by", " ", /* @__PURE__ */ createElement21("a", {
5158
5933
  href: "https://infinite-table.com",
5159
5934
  rel: "noopener noreferrer",
5160
5935
  role: "link",
@@ -5165,13 +5940,13 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
5165
5940
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
5166
5941
  import {
5167
5942
  createContext as createContext5,
5168
- createElement as createElement20,
5943
+ createElement as createElement22,
5169
5944
  memo as memo9
5170
5945
  } from "react";
5171
- import { useCallback as useCallback11, useContext as useContext6, useMemo as useMemo7 } from "react";
5172
- var { rootClassName: rootClassName9 } = internalProps;
5946
+ import { useCallback as useCallback13, useContext as useContext6, useMemo as useMemo7 } from "react";
5947
+ var { rootClassName: rootClassName11 } = internalProps;
5173
5948
  var InfiniteTableColumnCellContext = createContext5(null);
5174
- var InfiniteTableColumnCellClassName = `${rootClassName9}ColumnCell`;
5949
+ var InfiniteTableColumnCellClassName = `${rootClassName11}ColumnCell`;
5175
5950
  function isColumnWithField(c) {
5176
5951
  return typeof c.field === "string";
5177
5952
  }
@@ -5185,9 +5960,7 @@ function InfiniteTableColumnCellFn(props) {
5185
5960
  column,
5186
5961
  onMouseLeave,
5187
5962
  onMouseEnter,
5188
- offsetProperty,
5189
5963
  toggleGroupRow,
5190
- virtualized,
5191
5964
  rowIndex,
5192
5965
  rowHeight,
5193
5966
  domRef,
@@ -5195,7 +5968,7 @@ function InfiniteTableColumnCellFn(props) {
5195
5968
  showZebraRows
5196
5969
  } = props;
5197
5970
  if (!column) {
5198
- return /* @__PURE__ */ createElement20("div", {
5971
+ return /* @__PURE__ */ createElement22("div", {
5199
5972
  ref: domRef
5200
5973
  }, "no column");
5201
5974
  }
@@ -5228,7 +6001,7 @@ function InfiniteTableColumnCellFn(props) {
5228
6001
  value
5229
6002
  });
5230
6003
  }
5231
- const onClick = useCallback11(() => {
6004
+ const onClick = useCallback13(() => {
5232
6005
  if (keyboardNavigation === "row") {
5233
6006
  componentActions.activeRowIndex = rowIndex;
5234
6007
  return;
@@ -5268,7 +6041,7 @@ function InfiniteTableColumnCellFn(props) {
5268
6041
  isGroupRow,
5269
6042
  rowIndex,
5270
6043
  toggleGroupRow,
5271
- toggleCurrentGroupRow: useCallback11(() => {
6044
+ toggleCurrentGroupRow: useCallback13(() => {
5272
6045
  if (!rowInfo.isGroupRow) {
5273
6046
  return;
5274
6047
  }
@@ -5277,13 +6050,13 @@ function InfiniteTableColumnCellFn(props) {
5277
6050
  groupBy: computedDataSource.groupBy,
5278
6051
  pivotBy: computedDataSource.pivotBy
5279
6052
  });
5280
- const renderChildren = useCallback11(() => {
6053
+ const renderChildren = useCallback13(() => {
5281
6054
  if (hidden) {
5282
6055
  return null;
5283
6056
  }
5284
6057
  const renderFn = column.render || column.renderValue;
5285
6058
  if (renderFn) {
5286
- return /* @__PURE__ */ createElement20(RenderHookComponent, {
6059
+ return /* @__PURE__ */ createElement22(RenderHookComponent, {
5287
6060
  render: renderFn,
5288
6061
  renderParam
5289
6062
  });
@@ -5300,18 +6073,15 @@ function InfiniteTableColumnCellFn(props) {
5300
6073
  style = typeof rowStyle === "function" ? __spreadValues(__spreadValues({}, style), rowStyle(rowPropsAndStyleArgs)) : __spreadValues(__spreadValues({}, style), rowStyle);
5301
6074
  }
5302
6075
  style = column.style ? typeof column.style === "function" ? __spreadValues(__spreadValues({}, style), column.style(stylingRenderParam) || {}) : __spreadValues(__spreadValues({}, style), column.style) : style || {};
5303
- style.width = width;
5304
6076
  style.height = rowHeight;
5305
6077
  const memoizedStyle = useMemo7(() => style, [!style ? null : JSON.stringify(style)]);
5306
6078
  const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
5307
6079
  const zebra = showZebraRows ? odd ? "odd" : "even" : false;
5308
6080
  const cellProps = {
5309
6081
  domRef,
5310
- offsetProperty,
5311
6082
  cellType: "body",
5312
6083
  column,
5313
6084
  width,
5314
- offset: virtualized ? 0 : column.computedPinningOffset,
5315
6085
  style: memoizedStyle,
5316
6086
  onMouseLeave,
5317
6087
  onMouseEnter,
@@ -5321,9 +6091,9 @@ function InfiniteTableColumnCellFn(props) {
5321
6091
  renderChildren
5322
6092
  };
5323
6093
  const ContextProvider = InfiniteTableColumnCellContext.Provider;
5324
- return /* @__PURE__ */ createElement20(ContextProvider, {
6094
+ return /* @__PURE__ */ createElement22(ContextProvider, {
5325
6095
  value: renderParam
5326
- }, /* @__PURE__ */ createElement20(InfiniteTableCell, __spreadValues({}, cellProps)));
6096
+ }, /* @__PURE__ */ createElement22(InfiniteTableCell, __spreadValues({}, cellProps)));
5327
6097
  }
5328
6098
  var InfiniteTableColumnCell = memo9(InfiniteTableColumnCellFn);
5329
6099
  function useInfiniteColumnCell() {
@@ -5332,32 +6102,32 @@ function useInfiniteColumnCell() {
5332
6102
  }
5333
6103
 
5334
6104
  // src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
5335
- var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
6105
+ var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5336
6106
  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: [] });
6107
+ 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
6108
  var RowHoverCls = "_7pupv01";
5339
6109
 
5340
6110
  // src/components/InfiniteTable/components/LoadMask.tsx
5341
6111
  import {
5342
- createElement as createElement21,
6112
+ createElement as createElement23,
5343
6113
  memo as memo10
5344
6114
  } from "react";
5345
6115
 
5346
6116
  // 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";
6117
+ var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwv _16lm1iwx _16lm1iw11 _16lm1iwz", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwv _16lm1iwx _16lm1iw11 _16lm1iwz" };
6118
+ var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwv _16lm1iwx _16lm1iw11 _16lm1iwz";
5349
6119
  var LoadMaskTextCls = "qy58ya4";
5350
6120
 
5351
6121
  // src/components/InfiniteTable/components/LoadMask.tsx
5352
- var { rootClassName: rootClassName10 } = internalProps;
5353
- var baseCls3 = `${rootClassName10}-LoadMask`;
6122
+ var { rootClassName: rootClassName12 } = internalProps;
6123
+ var baseCls3 = `${rootClassName12}-LoadMask`;
5354
6124
  function LoadMaskFn(props) {
5355
6125
  const { visible, children = "Loading" } = props;
5356
- return /* @__PURE__ */ createElement21("div", {
6126
+ return /* @__PURE__ */ createElement23("div", {
5357
6127
  className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls3}`
5358
- }, /* @__PURE__ */ createElement21("div", {
6128
+ }, /* @__PURE__ */ createElement23("div", {
5359
6129
  className: `${LoadMaskOverlayCls} ${baseCls3}-Overlay`
5360
- }), /* @__PURE__ */ createElement21("div", {
6130
+ }), /* @__PURE__ */ createElement23("div", {
5361
6131
  className: `${LoadMaskTextCls} ${baseCls3}-Text`
5362
6132
  }, children));
5363
6133
  }
@@ -5428,8 +6198,8 @@ function getImperativeApi(getState, getComputed, getDataSourceState, componentAc
5428
6198
  // src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
5429
6199
  import {
5430
6200
  useEffect as useEffect14,
5431
- useRef as useRef15,
5432
- useState as useState10
6201
+ useRef as useRef17,
6202
+ useState as useState11
5433
6203
  } from "react";
5434
6204
  var OFFSET = 10;
5435
6205
  function getColumnContentMaxWidths(domRef, options) {
@@ -5466,9 +6236,15 @@ function getColumnContentMaxWidths(domRef, options) {
5466
6236
  cell.childNodes.forEach((child) => {
5467
6237
  if (child !== content) {
5468
6238
  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);
6239
+ let elWidth = Math.max(el.offsetWidth, parseInt(el.style.width, 10));
6240
+ if (isNaN(elWidth)) {
6241
+ elWidth = 0;
6242
+ }
6243
+ otherElementsLength += elWidth;
6244
+ if (elWidth > 0) {
6245
+ const style = getGlobal().getComputedStyle(el);
6246
+ otherElementsLength += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
6247
+ }
5472
6248
  }
5473
6249
  });
5474
6250
  measuredWidth += otherElementsLength;
@@ -5490,10 +6266,10 @@ function useAutoSizeColumns() {
5490
6266
  componentActions,
5491
6267
  componentState: { domRef, ready, autoSizeColumnsKey, brain }
5492
6268
  } = useComponentState();
5493
- const [refreshId, setRefreshId] = useState10(0);
6269
+ const [refreshId, setRefreshId] = useState11(0);
5494
6270
  const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
5495
6271
  const getTheKey = useLatest(theKey);
5496
- const lastExecutedIdentifierRef = useRef15(null);
6272
+ const lastExecutedIdentifierRef = useRef17(null);
5497
6273
  useEffect14(() => {
5498
6274
  const key = getTheKey();
5499
6275
  if (key == null) {
@@ -5552,8 +6328,8 @@ function useAutoSizeColumns() {
5552
6328
  }
5553
6329
 
5554
6330
  // src/components/InfiniteTable/hooks/useCellRendering.tsx
5555
- import { useCallback as useCallback12, useEffect as useEffect15, useRef as useRef16 } from "react";
5556
- import React27 from "react";
6331
+ import { useCallback as useCallback14, useEffect as useEffect15, useRef as useRef18 } from "react";
6332
+ import React31 from "react";
5557
6333
 
5558
6334
  // src/components/InfiniteTable/hooks/useYourBrain.ts
5559
6335
  function useYourBrain(param) {
@@ -5623,7 +6399,7 @@ function useCellRendering(param) {
5623
6399
  bodySize,
5624
6400
  rowspan
5625
6401
  });
5626
- const scrollTopMaxRef = useRef16(0);
6402
+ const scrollTopMaxRef = useRef18(0);
5627
6403
  useEffect15(() => {
5628
6404
  return brain.onRenderCountChange(() => {
5629
6405
  scrollTopMaxRef.current = brain.scrollTopMax;
@@ -5660,7 +6436,7 @@ function useCellRendering(param) {
5660
6436
  useEffect15(() => {
5661
6437
  rerender();
5662
6438
  }, [dataSourceState]);
5663
- const renderCell = useCallback12((params) => {
6439
+ const renderCell = useCallback14((params) => {
5664
6440
  const {
5665
6441
  rowIndex,
5666
6442
  colIndex,
@@ -5695,7 +6471,7 @@ function useCellRendering(param) {
5695
6471
  rowStyle,
5696
6472
  rowClassName
5697
6473
  };
5698
- return /* @__PURE__ */ React27.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
6474
+ return /* @__PURE__ */ React31.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
5699
6475
  }, [
5700
6476
  rowHeight,
5701
6477
  getData,
@@ -5713,7 +6489,7 @@ function useCellRendering(param) {
5713
6489
  }
5714
6490
 
5715
6491
  // src/components/InfiniteTable/hooks/useComputed.ts
5716
- import { useCallback as useCallback15, useEffect as useEffect25, useState as useState14 } from "react";
6492
+ import { useCallback as useCallback17, useEffect as useEffect25, useState as useState15 } from "react";
5717
6493
 
5718
6494
  // src/components/InfiniteTable/hooks/useColumnGroups.ts
5719
6495
  import { useEffect as useEffect17 } from "react";
@@ -5882,10 +6658,10 @@ function useColumnRowspan(computedVisibleColumns) {
5882
6658
  }
5883
6659
 
5884
6660
  // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
5885
- import { useCallback as useCallback13 } from "react";
6661
+ import { useCallback as useCallback15 } from "react";
5886
6662
  var debug4 = dbg("useColumnSizeFn");
5887
6663
  function useColumnSizeFn(columns) {
5888
- const columnSize = useCallback13((index) => {
6664
+ const columnSize = useCallback15((index) => {
5889
6665
  const column = columns[index];
5890
6666
  if (false) {
5891
6667
  debug4("cannot find column at index", index, columns);
@@ -5900,14 +6676,9 @@ import { useEffect as useEffect22, useMemo as useMemo10 } from "react";
5900
6676
 
5901
6677
  // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
5902
6678
  import {
5903
- createElement as createElement24
6679
+ createElement as createElement26
5904
6680
  } from "react";
5905
6681
 
5906
- // src/utils/stripVar.ts
5907
- function stripVar(cssVariableWithVarString) {
5908
- return cssVariableWithVarString.slice(4, -1);
5909
- }
5910
-
5911
6682
  // src/components/DataSource/state/rowInfoStatus.ts
5912
6683
  var showLoadingIcon = (rowInfo) => {
5913
6684
  if (rowInfo.dataSourceHasGrouping) {
@@ -5918,21 +6689,21 @@ var showLoadingIcon = (rowInfo) => {
5918
6689
 
5919
6690
  // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
5920
6691
  import {
5921
- createElement as createElement22,
6692
+ createElement as createElement24,
5922
6693
  useEffect as useEffect18
5923
6694
  } from "react";
5924
- import { useState as useState11 } from "react";
6695
+ import { useState as useState12 } from "react";
5925
6696
 
5926
6697
  // 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: [] });
6698
+ var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
6699
+ var ExpanderIconCls = "_16lm1iw6 _16lm1iwh _16lm1iwd";
6700
+ var ExpanderIconClsVariants = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "_16lm1iwc", false: "_198z9782" } }, defaultVariants: {}, compoundVariants: [] });
5930
6701
 
5931
6702
  // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
5932
6703
  function ExpanderIcon(props) {
5933
6704
  var _a;
5934
6705
  const { size = 24 } = props;
5935
- const [expanded, setExpanded] = useState11((_a = props.expanded) != null ? _a : props.defaultExpanded);
6706
+ const [expanded, setExpanded] = useState12((_a = props.expanded) != null ? _a : props.defaultExpanded);
5936
6707
  const onClick = () => {
5937
6708
  var _a2;
5938
6709
  (_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
@@ -5945,7 +6716,7 @@ function ExpanderIcon(props) {
5945
6716
  setExpanded(props.expanded);
5946
6717
  }
5947
6718
  }, [props.expanded]);
5948
- return /* @__PURE__ */ createElement22("svg", {
6719
+ return /* @__PURE__ */ createElement24("svg", {
5949
6720
  "data-name": "expander-icon",
5950
6721
  xmlns: "http://www.w3.org/2000/svg",
5951
6722
  height: `${size}px`,
@@ -5956,22 +6727,22 @@ function ExpanderIcon(props) {
5956
6727
  className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
5957
6728
  expanded
5958
6729
  }), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`)
5959
- }, /* @__PURE__ */ createElement22("path", {
6730
+ }, /* @__PURE__ */ createElement24("path", {
5960
6731
  d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
5961
6732
  }));
5962
6733
  }
5963
6734
 
5964
6735
  // src/components/InfiniteTable/components/icons/LoadingIcon.tsx
5965
6736
  import {
5966
- createElement as createElement23
6737
+ createElement as createElement25
5967
6738
  } from "react";
5968
6739
 
5969
6740
  // src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
5970
- var LoadingIconCls = "_16lm1iw8 _16lm1iwg _16lm1iwd";
6741
+ var LoadingIconCls = "_16lm1iw8 _16lm1iwh _16lm1iwd";
5971
6742
 
5972
6743
  // src/components/InfiniteTable/components/icons/LoadingIcon.tsx
5973
6744
  var LoadingIcon = (props) => {
5974
- return /* @__PURE__ */ createElement23("svg", {
6745
+ return /* @__PURE__ */ createElement25("svg", {
5975
6746
  xmlns: "http://www.w3.org/2000/svg",
5976
6747
  style: {
5977
6748
  margin: "auto",
@@ -5983,14 +6754,14 @@ var LoadingIcon = (props) => {
5983
6754
  viewBox: "0 0 100 100",
5984
6755
  preserveAspectRatio: "xMidYMid",
5985
6756
  className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
5986
- }, /* @__PURE__ */ createElement23("circle", {
6757
+ }, /* @__PURE__ */ createElement25("circle", {
5987
6758
  cx: "50",
5988
6759
  cy: "50",
5989
6760
  fill: "none",
5990
6761
  strokeWidth: "10",
5991
6762
  r: "35",
5992
6763
  strokeDasharray: "164.93361431346415 56.97787143782138"
5993
- }, /* @__PURE__ */ createElement23("animateTransform", {
6764
+ }, /* @__PURE__ */ createElement25("animateTransform", {
5994
6765
  attributeName: "transform",
5995
6766
  type: "rotate",
5996
6767
  repeatCount: "indefinite",
@@ -6010,7 +6781,7 @@ function getGroupColumnRender({
6010
6781
  var _a, _b, _c;
6011
6782
  let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
6012
6783
  if (column.renderValue) {
6013
- value = /* @__PURE__ */ createElement24(RenderHookComponent, {
6784
+ value = /* @__PURE__ */ createElement26(RenderHookComponent, {
6014
6785
  render: column.renderValue,
6015
6786
  renderParam: renderOptions
6016
6787
  });
@@ -6040,22 +6811,22 @@ function getGroupColumnRender({
6040
6811
  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
6812
  const isLoading = showLoadingIcon(groupRowInfo);
6042
6813
  if (isLoading) {
6043
- icon = /* @__PURE__ */ createElement24(LoadingIcon, null);
6814
+ icon = /* @__PURE__ */ createElement26(LoadingIcon, null);
6044
6815
  } else if (showExpanderIcon) {
6045
- const defaultIcon = /* @__PURE__ */ createElement24(ExpanderIcon, {
6816
+ const defaultIcon = /* @__PURE__ */ createElement26(ExpanderIcon, {
6046
6817
  expanded: !collapsed,
6047
6818
  onChange: () => {
6048
6819
  toggleGroupRow(groupKeys);
6049
6820
  }
6050
6821
  });
6051
- icon = column.renderGroupIcon ? /* @__PURE__ */ createElement24(RenderHookComponent, {
6822
+ icon = column.renderGroupIcon ? /* @__PURE__ */ createElement26(RenderHookComponent, {
6052
6823
  render: column.renderGroupIcon,
6053
6824
  renderParam: Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)
6054
6825
  }) : defaultIcon;
6055
6826
  }
6056
- return /* @__PURE__ */ createElement24("div", {
6827
+ return /* @__PURE__ */ createElement26("div", {
6057
6828
  className: join(display.flex, alignItems.center)
6058
- }, icon, /* @__PURE__ */ createElement24("div", {
6829
+ }, icon, /* @__PURE__ */ createElement26("div", {
6059
6830
  className: cssEllipsisClassName
6060
6831
  }, value != null ? value : null));
6061
6832
  };
@@ -6100,9 +6871,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
6100
6871
  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
6872
  const isLoading = showLoadingIcon(rowInfo);
6102
6873
  if (isLoading) {
6103
- icon = /* @__PURE__ */ createElement24(LoadingIcon, null);
6874
+ icon = /* @__PURE__ */ createElement26(LoadingIcon, null);
6104
6875
  } else if (showExpanderIcon) {
6105
- const defaultIcon = /* @__PURE__ */ createElement24(ExpanderIcon, {
6876
+ const defaultIcon = /* @__PURE__ */ createElement26(ExpanderIcon, {
6106
6877
  expanded: !collapsed,
6107
6878
  onChange: () => {
6108
6879
  if (!rowInfo.isGroupRow) {
@@ -6117,9 +6888,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
6117
6888
  icon = column.renderGroupIcon(renderParam);
6118
6889
  }
6119
6890
  }
6120
- return /* @__PURE__ */ createElement24("div", {
6891
+ return /* @__PURE__ */ createElement26("div", {
6121
6892
  className: join(display.flex, alignItems.center, GroupRowExpanderCls)
6122
- }, icon, /* @__PURE__ */ createElement24("div", {
6893
+ }, icon, /* @__PURE__ */ createElement26("div", {
6123
6894
  className: cssEllipsisClassName
6124
6895
  }, value != null ? value : null));
6125
6896
  }
@@ -6135,10 +6906,10 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
6135
6906
  }
6136
6907
 
6137
6908
  // src/components/InfiniteTable/hooks/useEffectWithRaf.ts
6138
- import { useEffect as useEffect19, useRef as useRef17 } from "react";
6909
+ import { useEffect as useEffect19, useRef as useRef19 } from "react";
6139
6910
  function useEffectWithRaf(fn, deps) {
6140
- const rafId = useRef17(0);
6141
- const removeFnRaf = useRef17();
6911
+ const rafId = useRef19(0);
6912
+ const removeFnRaf = useRef19();
6142
6913
  useEffect19(() => {
6143
6914
  rafId.current = requestAnimationFrame(() => {
6144
6915
  removeFnRaf.current = fn();
@@ -6156,7 +6927,7 @@ function useEffectWithRaf(fn, deps) {
6156
6927
  }
6157
6928
 
6158
6929
  // src/components/InfiniteTable/hooks/useToggleGroupRow.ts
6159
- import { useCallback as useCallback14 } from "react";
6930
+ import { useCallback as useCallback16 } from "react";
6160
6931
 
6161
6932
  // src/utils/groupAndPivot/index.ts
6162
6933
  var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
@@ -6611,7 +7382,7 @@ function enhancedFlatten(param) {
6611
7382
  // src/components/DataSource/index.tsx
6612
7383
  import {
6613
7384
  Fragment as Fragment3,
6614
- createElement as createElement25
7385
+ createElement as createElement27
6615
7386
  } from "react";
6616
7387
 
6617
7388
  // src/utils/multisort/sortTypes.ts
@@ -6800,15 +7571,15 @@ var GroupRowsState = class {
6800
7571
  };
6801
7572
 
6802
7573
  // src/components/DataSource/privateHooks/useLoadData.ts
6803
- import { useEffect as useEffect21, useMemo as useMemo9, useRef as useRef19, useState as useState12 } from "react";
7574
+ import { useEffect as useEffect21, useMemo as useMemo9, useRef as useRef21, useState as useState13 } from "react";
6804
7575
 
6805
7576
  // src/components/hooks/useEffectWithChanges.ts
6806
- import { useEffect as useEffect20, useRef as useRef18 } from "react";
7577
+ import { useEffect as useEffect20, useRef as useRef20 } from "react";
6807
7578
  function useEffectWithChanges(fn, deps) {
6808
- const prevRef = useRef18({});
6809
- const oldValuesRef = useRef18({});
7579
+ const prevRef = useRef20({});
7580
+ const oldValuesRef = useRef20({});
6810
7581
  const oldValues = oldValuesRef.current;
6811
- const changesRef = useRef18({});
7582
+ const changesRef = useRef20({});
6812
7583
  const changes = changesRef.current;
6813
7584
  const useEffectDeps = [];
6814
7585
  for (const k in deps) {
@@ -7089,11 +7860,11 @@ function useLoadData() {
7089
7860
  livePaginationCursor,
7090
7861
  cursorId: stateCursorId
7091
7862
  } = componentState;
7092
- const [scrollbars, setScrollbars] = useState12({
7863
+ const [scrollbars, setScrollbars] = useState13({
7093
7864
  vertical: false,
7094
7865
  horizontal: false
7095
7866
  });
7096
- const scrollbarsRef = useRef19(scrollbars);
7867
+ const scrollbarsRef = useRef21(scrollbars);
7097
7868
  useEffect21(() => {
7098
7869
  notifyScrollbarsChange.onChange((scrollbars2) => {
7099
7870
  if (!scrollbars2) {
@@ -7150,7 +7921,7 @@ function useLoadData() {
7150
7921
  filterValue,
7151
7922
  cursorId: livePagination ? stateCursorId : null
7152
7923
  };
7153
- const initialRef = useRef19(true);
7924
+ const initialRef = useRef21(true);
7154
7925
  useLazyLoadRange();
7155
7926
  useEffectWithChanges(() => {
7156
7927
  const componentState2 = getComponentState();
@@ -7191,7 +7962,7 @@ function useLazyLoadRange() {
7191
7962
  dataArray,
7192
7963
  scrollStopDelayUpdatedByTable
7193
7964
  } = componentState;
7194
- const latestRenderRangeRef = useRef19(null);
7965
+ const latestRenderRangeRef = useRef21(null);
7195
7966
  const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
7196
7967
  const componentState2 = getComponentState();
7197
7968
  renderRange = renderRange || latestRenderRangeRef.current;
@@ -8023,7 +8794,7 @@ function DataSourceWithContext(props) {
8023
8794
  if (typeof children === "function") {
8024
8795
  children = children(computedValues);
8025
8796
  }
8026
- return /* @__PURE__ */ createElement25(Fragment3, null, children);
8797
+ return /* @__PURE__ */ createElement27(Fragment3, null, children);
8027
8798
  }
8028
8799
  var DataSourceRoot = getComponentStateRoot({
8029
8800
  initSetupState,
@@ -8046,14 +8817,14 @@ function DataSourceCmp({ children }) {
8046
8817
  globalThis.getDataSourceState = getState;
8047
8818
  }
8048
8819
  useLoadData();
8049
- return /* @__PURE__ */ createElement25(DataSourceContext.Provider, {
8820
+ return /* @__PURE__ */ createElement27(DataSourceContext.Provider, {
8050
8821
  value: contextValue
8051
- }, /* @__PURE__ */ createElement25(DataSourceWithContext, {
8822
+ }, /* @__PURE__ */ createElement27(DataSourceWithContext, {
8052
8823
  children
8053
8824
  }));
8054
8825
  }
8055
8826
  function DataSource(props) {
8056
- return /* @__PURE__ */ createElement25(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ createElement25(DataSourceCmp, {
8827
+ return /* @__PURE__ */ createElement27(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ createElement27(DataSourceCmp, {
8057
8828
  children: props.children
8058
8829
  }));
8059
8830
  }
@@ -8061,7 +8832,7 @@ function DataSource(props) {
8061
8832
  // src/components/InfiniteTable/hooks/useToggleGroupRow.ts
8062
8833
  function useToggleGroupRow() {
8063
8834
  const { getState: getDataSourceState, componentActions: dataSourceActions } = useDataSourceContextValue();
8064
- const toggleGroupRow = useCallback14((groupKeys) => {
8835
+ const toggleGroupRow = useCallback16((groupKeys) => {
8065
8836
  const state = getDataSourceState();
8066
8837
  const newState = new GroupRowsState(state.groupRowsState);
8067
8838
  newState.toggleGroupRow(groupKeys);
@@ -8479,144 +9250,6 @@ function getColumnsWhenGrouping(params) {
8479
9250
  // src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
8480
9251
  import { useMemo as useMemo11 } from "react";
8481
9252
 
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
9253
  // src/components/InfiniteTable/utils/adjustColumnOrderForPinning.ts
8621
9254
  var order = ["start", void 0, "end"];
8622
9255
  var adjustColumnOrderForPinning = (columnOrder, columnPinning) => {
@@ -8809,8 +9442,8 @@ var getComputedVisibleColumns = ({
8809
9442
  const computedSortIndex = (_c = sortingInfo == null ? void 0 : sortingInfo.index) != null ? _c : -1;
8810
9443
  const computedWidth = computedSizes[i];
8811
9444
  const computedFlex = flexSizes[i] || null;
8812
- const computedMinWidth = minSizes[i] || null;
8813
- const computedMaxWidth = maxSizes[i] || null;
9445
+ const computedMinWidth = minSizes[i] || 0;
9446
+ const computedMaxWidth = maxSizes[i] || 1e4;
8814
9447
  const computedPinned = getComputedPinned(id, columnPinning);
8815
9448
  const computedLast = i === visibleColumnOrder.length - 1;
8816
9449
  const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
@@ -9052,6 +9685,7 @@ var useComputedVisibleColumns = ({
9052
9685
  columnMinWidth,
9053
9686
  columnMaxWidth,
9054
9687
  columnDefaultWidth,
9688
+ viewportReservedWidth,
9055
9689
  sortable,
9056
9690
  sortInfo,
9057
9691
  setSortInfo,
@@ -9089,7 +9723,7 @@ var useComputedVisibleColumns = ({
9089
9723
  };
9090
9724
 
9091
9725
  // src/components/InfiniteTable/hooks/useScrollbars.ts
9092
- import { useState as useState13, useEffect as useEffect24, useLayoutEffect as useLayoutEffect6 } from "react";
9726
+ import { useState as useState14, useEffect as useEffect24, useLayoutEffect as useLayoutEffect6 } from "react";
9093
9727
  var INITIAL_SCROLLBARS = {
9094
9728
  vertical: false,
9095
9729
  horizontal: false
@@ -9097,7 +9731,7 @@ var INITIAL_SCROLLBARS = {
9097
9731
  function useScrollbars(brain) {
9098
9732
  const { getComponentState: getInfiniteTableState } = useComponentState();
9099
9733
  const { getState: getDataSourceState } = useDataSourceContextValue();
9100
- const [scrollbars, setScrollbars] = useState13(INITIAL_SCROLLBARS);
9734
+ const [scrollbars, setScrollbars] = useState14(INITIAL_SCROLLBARS);
9101
9735
  useEffect24(() => {
9102
9736
  return brain.onRenderCountChange(() => {
9103
9737
  const { scrollTopMax, scrollLeftMax } = brain;
@@ -9138,7 +9772,7 @@ function useComputed() {
9138
9772
  bodySize,
9139
9773
  showSeparatePivotColumnForSingleAggregation
9140
9774
  } = componentState;
9141
- useState14(() => {
9775
+ useState15(() => {
9142
9776
  componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
9143
9777
  if (rowHeight) {
9144
9778
  componentActions.rowHeight = rowHeight;
@@ -9156,7 +9790,7 @@ function useComputed() {
9156
9790
  const { multiSort, filterValue } = dataSourceState;
9157
9791
  useColumnGroups();
9158
9792
  const { toggleGroupRow } = useColumnsWhen();
9159
- const setSortInfo = useCallback15((sortInfo) => {
9793
+ const setSortInfo = useCallback17((sortInfo) => {
9160
9794
  var _a2;
9161
9795
  const newSortInfo = getDataSourceState().multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
9162
9796
  dataSourceActions.sortInfo = newSortInfo;
@@ -9234,6 +9868,10 @@ function useComputed() {
9234
9868
  }
9235
9869
 
9236
9870
  // src/components/InfiniteTable/hooks/useDOMProps.ts
9871
+ var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
9872
+ var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
9873
+ var activeCellColWidth = stripVar(InternalVars.activeCellColWidth);
9874
+ var activeCellColOffset = stripVar(InternalVars.activeCellColOffset);
9237
9875
  function useDOMProps(initialDOMProps) {
9238
9876
  const { computed, componentState, componentActions } = useInfiniteTable();
9239
9877
  const {
@@ -9244,9 +9882,24 @@ function useDOMProps(initialDOMProps) {
9244
9882
  onBlurWithin,
9245
9883
  onFocusWithin,
9246
9884
  onSelfFocus,
9247
- onSelfBlur
9885
+ onSelfBlur,
9886
+ activeCellIndex
9248
9887
  } = componentState;
9249
- const { computedPinnedStartColumnsWidth, computedPinnedEndColumnsWidth } = computed;
9888
+ const {
9889
+ computedPinnedStartColumnsWidth,
9890
+ computedPinnedEndColumnsWidth,
9891
+ computedVisibleColumns
9892
+ } = computed;
9893
+ const cssVars = computedVisibleColumns.reduce((vars, col) => {
9894
+ const index = col.computedVisibleIndex;
9895
+ vars[`${columnWidthAtIndex4}-${index}`] = col.computedWidth + "px";
9896
+ vars[`${columnOffsetAtIndex2}-${index}`] = col.computedOffset + "px";
9897
+ return vars;
9898
+ }, {});
9899
+ if (activeCellIndex != null) {
9900
+ cssVars[activeCellColWidth] = `var(${getCSSVarNameForColWidth(activeCellIndex[1])})`;
9901
+ cssVars[activeCellColOffset] = `var(${getCSSVarNameForColOffset(activeCellIndex[1])})`;
9902
+ }
9250
9903
  const setFocused = rafFn((focused2) => {
9251
9904
  componentActions.focused = focused2;
9252
9905
  });
@@ -9301,7 +9954,7 @@ function useDOMProps(initialDOMProps) {
9301
9954
  focusedWithin
9302
9955
  }));
9303
9956
  domProps.className = className;
9304
- domProps.style = __spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style);
9957
+ domProps.style = __spreadValues(__spreadValues({}, initialDOMProps == null ? void 0 : initialDOMProps.style), cssVars);
9305
9958
  if (focused) {
9306
9959
  if (componentState.focusedStyle) {
9307
9960
  Object.assign(domProps.style, componentState.focusedStyle);
@@ -9477,7 +10130,7 @@ var useLicense = (licenseKey = "") => {
9477
10130
  const valid = useMemo12(() => {
9478
10131
  let valid2 = isValidLicense(licenseKey, {
9479
10132
  publishedAt: 1624970570587,
9480
- version: "0.3.12"
10133
+ version: "0.3.13"
9481
10134
  });
9482
10135
  if (!licenseKey && !valid2 && isInsidePlayground) {
9483
10136
  return true;
@@ -9608,10 +10261,23 @@ function handleCellNavigation(options) {
9608
10261
  actions.activeCellIndex = [rowIndex, colIndex];
9609
10262
  return true;
9610
10263
  }
10264
+ var validKeys = {
10265
+ ArrowUp: true,
10266
+ ArrowDown: true,
10267
+ ArrowLeft: true,
10268
+ ArrowRight: true,
10269
+ PageUp: true,
10270
+ PageDown: true,
10271
+ Home: true,
10272
+ End: true
10273
+ };
9611
10274
  function handleKeyboardNavigation(options) {
9612
10275
  const { getState } = options;
9613
10276
  const state = getState();
9614
10277
  const { activeRowIndex, activeCellIndex, keyboardNavigation } = state;
10278
+ if (!validKeys[options.key]) {
10279
+ return false;
10280
+ }
9615
10281
  if (activeRowIndex != null && keyboardNavigation === "row") {
9616
10282
  return handleRowNavigation(options);
9617
10283
  }
@@ -9702,6 +10368,7 @@ function initSetupState2() {
9702
10368
  });
9703
10369
  if (false) {
9704
10370
  globalThis.brain = brain;
10371
+ globalThis.headerBrain = headerBrain;
9705
10372
  }
9706
10373
  const { renderer, onRenderUpdater } = createRenderer2(brain);
9707
10374
  brain.onAvailableSizeChange((size) => {
@@ -9720,6 +10387,7 @@ function initSetupState2() {
9720
10387
  domRef: createRef(),
9721
10388
  scrollerDOMRef: createRef(),
9722
10389
  portalDOMRef: createRef(),
10390
+ activeCellIndicatorDOMRef: createRef(),
9723
10391
  onRowHeightCSSVarChange: buildSubscriptionCallback(),
9724
10392
  onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
9725
10393
  bodySize: {
@@ -9775,7 +10443,7 @@ var forwardProps3 = (setupState) => {
9775
10443
  viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
9776
10444
  resizableColumns: (resizableColumns) => resizableColumns != null ? resizableColumns : true,
9777
10445
  columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
9778
- columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 2e3,
10446
+ columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 5e3,
9779
10447
  columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
9780
10448
  columnCssEllipsis: (columnCssEllipsis) => columnCssEllipsis != null ? columnCssEllipsis : true,
9781
10449
  draggableColumns: (draggableColumns) => draggableColumns != null ? draggableColumns : true,
@@ -9892,7 +10560,7 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
9892
10560
  getState: getDataSourceState,
9893
10561
  componentActions: dataSourceActions
9894
10562
  } = useDataSourceContextValue();
9895
- const [imperativeApi] = useState15(() => {
10563
+ const [imperativeApi] = useState16(() => {
9896
10564
  return getImperativeApi(getState, getComputed, getDataSourceState, actions);
9897
10565
  });
9898
10566
  const {
@@ -9958,7 +10626,7 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
9958
10626
  dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
9959
10627
  }, [scrollStopDelay]);
9960
10628
  useAutoSizeColumns();
9961
- const onKeyDown = useCallback16((event) => {
10629
+ const onKeyDown = useCallback18((event) => {
9962
10630
  if (handleKeyboardNavigation({
9963
10631
  getState,
9964
10632
  actions,
@@ -9970,13 +10638,14 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
9970
10638
  event.preventDefault();
9971
10639
  }
9972
10640
  }, []);
9973
- return /* @__PURE__ */ createElement26("div", __spreadValues({
10641
+ return /* @__PURE__ */ createElement28("div", __spreadValues({
9974
10642
  onKeyDown,
9975
10643
  ref: domRef
9976
- }, domProps), header ? /* @__PURE__ */ createElement26(TableHeaderWrapper, {
9977
- brain: headerBrain,
10644
+ }, domProps), header ? /* @__PURE__ */ createElement28(TableHeaderWrapper, {
10645
+ bodyBrain: brain,
10646
+ headerBrain,
9978
10647
  scrollbars
9979
- }) : null, /* @__PURE__ */ createElement26(InfiniteTableBody, null, /* @__PURE__ */ createElement26(HeadlessTable, {
10648
+ }) : null, /* @__PURE__ */ createElement28(InfiniteTableBody, null, /* @__PURE__ */ createElement28(HeadlessTable, {
9980
10649
  tabIndex: 0,
9981
10650
  activeRowIndex: componentState.ready && keyboardNavigation === "row" ? activeRowIndex : null,
9982
10651
  activeCellIndex: componentState.ready && keyboardNavigation === "cell" ? activeCellIndex : null,
@@ -9987,18 +10656,18 @@ var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
9987
10656
  renderCell,
9988
10657
  cellHoverClassNames: HOVERED_CLASS_NAMES,
9989
10658
  scrollerDOMRef
9990
- }), /* @__PURE__ */ createElement26(LoadMaskCmp, {
10659
+ }), /* @__PURE__ */ createElement28(LoadMaskCmp, {
9991
10660
  visible: loading
9992
- }, loadingText)), /* @__PURE__ */ createElement26("div", {
10661
+ }, loadingText)), /* @__PURE__ */ createElement28("div", {
9993
10662
  ref: portalDOMRef,
9994
10663
  className: join(`${rootClassName2}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
9995
- }), rowHeightCSSVar ? /* @__PURE__ */ createElement26(CSSVariableWatch, {
10664
+ }), rowHeightCSSVar ? /* @__PURE__ */ createElement28(CSSVariableWatch, {
9996
10665
  varName: rowHeightCSSVar,
9997
10666
  onChange: onRowHeightCSSVarChange
9998
- }) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */ createElement26(CSSVariableWatch, {
10667
+ }) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */ createElement28(CSSVariableWatch, {
9999
10668
  varName: columnHeaderHeightCSSVar,
10000
10669
  onChange: onColumnHeaderHeightCSSVarChange
10001
- }) : null, /* @__PURE__ */ createElement26(InfiniteTableFooter, null), licenseValid ? null : /* @__PURE__ */ createElement26(InfiniteTableLicenseFooter, null));
10670
+ }) : null, /* @__PURE__ */ createElement28(InfiniteTableFooter, null), licenseValid ? null : /* @__PURE__ */ createElement28(InfiniteTableLicenseFooter, null));
10002
10671
  });
10003
10672
  function InfiniteTableContextProvider() {
10004
10673
  const { componentActions, componentState } = useComponentState();
@@ -10018,14 +10687,12 @@ function InfiniteTableContextProvider() {
10018
10687
  getState
10019
10688
  };
10020
10689
  useResizeObserver(scrollerDOMRef, (size) => {
10021
- var _a, _b;
10022
10690
  const bodySize = {
10023
10691
  width: size.width,
10024
10692
  height: size.height
10025
10693
  };
10026
- bodySize.width = (_b = (_a = scrollerDOMRef.current) == null ? void 0 : _a.scrollWidth) != null ? _b : bodySize.width;
10027
10694
  componentActions.bodySize = bodySize;
10028
- }, { earlyAttach: true });
10695
+ }, { earlyAttach: true, debounce: 50 });
10029
10696
  useEffect26(() => {
10030
10697
  return () => {
10031
10698
  componentState.onRowHeightCSSVarChange.destroy();
@@ -10038,13 +10705,16 @@ function InfiniteTableContextProvider() {
10038
10705
  }
10039
10706
  }, [scrollTopKey, scrollerDOMRef]);
10040
10707
  const TableContext2 = getInfiniteTableContext();
10041
- return /* @__PURE__ */ createElement26(TableContext2.Provider, {
10708
+ return /* @__PURE__ */ createElement28(TableContext2.Provider, {
10042
10709
  value: contextValue
10043
- }, /* @__PURE__ */ createElement26(InfiniteTableComponent, null));
10710
+ }, /* @__PURE__ */ createElement28(InfiniteTableComponent, null));
10044
10711
  }
10045
10712
  function InfiniteTable(props) {
10046
- const table = /* @__PURE__ */ createElement26(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ createElement26(InfiniteTableContextProvider, null));
10047
- return /* @__PURE__ */ createElement26(StrictMode, null, table);
10713
+ const table = /* @__PURE__ */ createElement28(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ createElement28(InfiniteTableContextProvider, null));
10714
+ if (false) {
10715
+ return /* @__PURE__ */ createElement28(StrictMode, null, table);
10716
+ }
10717
+ return table;
10048
10718
  }
10049
10719
  InfiniteTable.defaultProps = {
10050
10720
  rowHeight: 40,