@infinite-table/infinite-react 0.0.4 → 0.0.8

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.js CHANGED
@@ -216,6 +216,8 @@ var require_common = __commonJS({
216
216
  function createDebug(namespace) {
217
217
  let prevTime;
218
218
  let enableOverride = null;
219
+ let namespacesCache;
220
+ let enabledCache;
219
221
  function debug6(...args) {
220
222
  if (!debug6.enabled) {
221
223
  return;
@@ -258,7 +260,16 @@ var require_common = __commonJS({
258
260
  Object.defineProperty(debug6, "enabled", {
259
261
  enumerable: true,
260
262
  configurable: false,
261
- get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,
263
+ get: () => {
264
+ if (enableOverride !== null) {
265
+ return enableOverride;
266
+ }
267
+ if (namespacesCache !== createDebug.namespaces) {
268
+ namespacesCache = createDebug.namespaces;
269
+ enabledCache = createDebug.enabled(namespace);
270
+ }
271
+ return enabledCache;
272
+ },
262
273
  set: (v) => {
263
274
  enableOverride = v;
264
275
  }
@@ -275,6 +286,7 @@ var require_common = __commonJS({
275
286
  }
276
287
  function enable(namespaces) {
277
288
  createDebug.save(namespaces);
289
+ createDebug.namespaces = namespaces;
278
290
  createDebug.names = [];
279
291
  createDebug.skips = [];
280
292
  let i;
@@ -470,14 +482,14 @@ var require_browser = __commonJS({
470
482
  } else {
471
483
  exports.storage.removeItem("debug");
472
484
  }
473
- } catch (error3) {
485
+ } catch (error2) {
474
486
  }
475
487
  }
476
488
  function load() {
477
489
  let r;
478
490
  try {
479
491
  r = exports.storage.getItem("debug");
480
- } catch (error3) {
492
+ } catch (error2) {
481
493
  }
482
494
  if (!r && typeof process !== "undefined" && "env" in process) {
483
495
  r = process.env.DEBUG;
@@ -487,7 +499,7 @@ var require_browser = __commonJS({
487
499
  function localstorage() {
488
500
  try {
489
501
  return localStorage;
490
- } catch (error3) {
502
+ } catch (error2) {
491
503
  }
492
504
  }
493
505
  module2.exports = require_common()(exports);
@@ -495,13 +507,106 @@ var require_browser = __commonJS({
495
507
  formatters.j = function(v) {
496
508
  try {
497
509
  return JSON.stringify(v);
498
- } catch (error3) {
499
- return "[UnexpectedJSONParseError]: " + error3.message;
510
+ } catch (error2) {
511
+ return "[UnexpectedJSONParseError]: " + error2.message;
500
512
  }
501
513
  };
502
514
  }
503
515
  });
504
516
 
517
+ // node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.dev.js
518
+ var require_vanilla_extract_recipes_createRuntimeFn_cjs_dev = __commonJS({
519
+ "node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.dev.js"(exports) {
520
+ "use strict";
521
+ Object.defineProperty(exports, "__esModule", { value: true });
522
+ function _defineProperty(obj, key, value) {
523
+ if (key in obj) {
524
+ Object.defineProperty(obj, key, {
525
+ value,
526
+ enumerable: true,
527
+ configurable: true,
528
+ writable: true
529
+ });
530
+ } else {
531
+ obj[key] = value;
532
+ }
533
+ return obj;
534
+ }
535
+ function ownKeys(object, enumerableOnly) {
536
+ var keys = Object.keys(object);
537
+ if (Object.getOwnPropertySymbols) {
538
+ var symbols = Object.getOwnPropertySymbols(object);
539
+ if (enumerableOnly) {
540
+ symbols = symbols.filter(function(sym) {
541
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
542
+ });
543
+ }
544
+ keys.push.apply(keys, symbols);
545
+ }
546
+ return keys;
547
+ }
548
+ function _objectSpread2(target) {
549
+ for (var i = 1; i < arguments.length; i++) {
550
+ var source = arguments[i] != null ? arguments[i] : {};
551
+ if (i % 2) {
552
+ ownKeys(Object(source), true).forEach(function(key) {
553
+ _defineProperty(target, key, source[key]);
554
+ });
555
+ } else if (Object.getOwnPropertyDescriptors) {
556
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
557
+ } else {
558
+ ownKeys(Object(source)).forEach(function(key) {
559
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
560
+ });
561
+ }
562
+ }
563
+ return target;
564
+ }
565
+ var shouldApplyCompound = (compoundCheck, selections) => {
566
+ for (var key of Object.keys(compoundCheck)) {
567
+ if (compoundCheck[key] !== selections[key]) {
568
+ return false;
569
+ }
570
+ }
571
+ return true;
572
+ };
573
+ var createRuntimeFn = (config) => (options) => {
574
+ var className = config.defaultClassName;
575
+ var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
576
+ for (var variantName in selections) {
577
+ var _selections$variantNa;
578
+ var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
579
+ if (variantSelection != null) {
580
+ var selection = variantSelection;
581
+ if (typeof selection === "boolean") {
582
+ selection = selection === true ? "true" : "false";
583
+ }
584
+ className += " " + config.variantClassNames[variantName][selection];
585
+ }
586
+ }
587
+ for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
588
+ if (shouldApplyCompound(compoundCheck, selections)) {
589
+ className += " " + compoundClassName;
590
+ }
591
+ }
592
+ return className;
593
+ };
594
+ exports.createRuntimeFn = createRuntimeFn;
595
+ }
596
+ });
597
+
598
+ // node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.js
599
+ var require_vanilla_extract_recipes_createRuntimeFn_cjs = __commonJS({
600
+ "node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.js"(exports, module2) {
601
+ "use strict";
602
+ if (false) {
603
+ module2.exports = null;
604
+ } else {
605
+ module2.exports = require_vanilla_extract_recipes_createRuntimeFn_cjs_dev();
606
+ }
607
+ }
608
+ });
609
+
505
610
  // node_modules/binary-search/index.js
506
611
  var require_binary_search = __commonJS({
507
612
  "node_modules/binary-search/index.js"(exports, module2) {
@@ -563,7 +668,7 @@ var require_decamelize = __commonJS({
563
668
  if (preserveConsecutiveUppercase) {
564
669
  return handlePreserveConsecutiveUppercase(decamelized, separator);
565
670
  }
566
- return decamelized.replace(/(\p{Uppercase_Letter}+)(\p{Uppercase_Letter}\p{Lowercase_Letter}+)/gu, replacement).toLowerCase();
671
+ return decamelized.replace(/(\p{Uppercase_Letter})(\p{Uppercase_Letter}\p{Lowercase_Letter}+)/gu, replacement).toLowerCase();
567
672
  };
568
673
  }
569
674
  });
@@ -688,6 +793,15 @@ function computeColumnGroupsDepths(columnGroups) {
688
793
  }
689
794
 
690
795
  // src/components/InfiniteTable/state/getInitialState.ts
796
+ function toMap(mapOrObject) {
797
+ if (!mapOrObject) {
798
+ return new Map();
799
+ }
800
+ if (mapOrObject instanceof Map) {
801
+ return mapOrObject;
802
+ }
803
+ return new Map(Object.entries(mapOrObject));
804
+ }
691
805
  function initSetupState() {
692
806
  const columnsGeneratedForGrouping = new Map();
693
807
  return {
@@ -717,7 +831,10 @@ function initSetupState() {
717
831
  }
718
832
  var forwardProps = () => {
719
833
  return {
720
- columns: 1,
834
+ columns: (columns) => {
835
+ var _a;
836
+ return (_a = toMap(columns)) != null ? _a : new Map();
837
+ },
721
838
  components: 1,
722
839
  loadingText: 1,
723
840
  pivotColumns: 1,
@@ -743,15 +860,16 @@ var forwardProps = () => {
743
860
  pivotColumn: 1,
744
861
  pivotRowLabelsColumn: 1,
745
862
  pivotColumnGroups: 1,
863
+ viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
746
864
  activeIndex: (activeIndex) => activeIndex != null ? activeIndex : 0,
747
865
  columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
748
866
  columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 2e3,
749
- columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 300,
867
+ columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
750
868
  draggableColumns: (draggableColumns) => draggableColumns != null ? draggableColumns : true,
751
869
  sortable: (sortable) => sortable != null ? sortable : true,
752
870
  hideEmptyGroupColumns: (hideEmptyGroupColumns) => hideEmptyGroupColumns != null ? hideEmptyGroupColumns : false,
753
871
  pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
754
- licenseKey: (licenseKey) => licenseKey || globalThis.InfiniteTableLicenseKey || "",
872
+ licenseKey: (licenseKey) => licenseKey || "",
755
873
  columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
756
874
  header: (header) => header != null ? header : true,
757
875
  showZebraRows: (showZebraRows) => showZebraRows != null ? showZebraRows : true,
@@ -761,6 +879,14 @@ var forwardProps = () => {
761
879
  headerHeight: (headerHeight) => typeof headerHeight === "number" ? headerHeight : 0,
762
880
  columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility : new Map(),
763
881
  columnPinning: (columnPinning) => columnPinning != null ? columnPinning : new Map(),
882
+ columnSizing: (columnSizing) => {
883
+ var _a;
884
+ return (_a = toMap(columnSizing)) != null ? _a : new Map();
885
+ },
886
+ columnTypes: (columnTypes) => {
887
+ var _a;
888
+ return (_a = toMap(columnTypes)) != null ? _a : new Map();
889
+ },
764
890
  columnAggregations: (columnAggregations) => columnAggregations != null ? columnAggregations : new Map(),
765
891
  collapsedColumnGroups: (collapsedColumnGroups) => collapsedColumnGroups != null ? collapsedColumnGroups : new Map(),
766
892
  columnGroups: (columnGroups) => columnGroups != null ? columnGroups : new Map()
@@ -795,7 +921,7 @@ var mapPropsToState = (params) => {
795
921
  return {
796
922
  groupRenderStrategy,
797
923
  groupRowsBy,
798
- computedColumns: state.computedPivotColumns || state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || props.columns,
924
+ computedColumns: state.computedPivotColumns || state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns,
799
925
  virtualizeHeader,
800
926
  columnGroupsDepthsMap,
801
927
  columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
@@ -927,7 +1053,7 @@ var computeFlex = (params) => {
927
1053
  items.forEach((item, i) => {
928
1054
  var _a, _b, _c, _d, _e, _f;
929
1055
  let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
930
- let minSize = (_d = (_c = item.maxSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
1056
+ let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
931
1057
  if (item.size != null) {
932
1058
  if (maxSize != null && item.size > maxSize) {
933
1059
  item.size = maxSize;
@@ -955,7 +1081,7 @@ var computeFlex = (params) => {
955
1081
  if (item.flex != null) {
956
1082
  const approxFlexSize = sizePerFlex * item.flex;
957
1083
  let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
958
- let minSize = (_d = (_c = item.maxSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
1084
+ let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
959
1085
  let constrained = false;
960
1086
  let substractSize = 0;
961
1087
  if (maxSize != null && approxFlexSize > maxSize) {
@@ -1090,8 +1216,52 @@ var Logger = class {
1090
1216
  }
1091
1217
  };
1092
1218
 
1219
+ // src/utils/getGlobal.ts
1220
+ function getGlobal() {
1221
+ return globalThis;
1222
+ }
1223
+
1224
+ // src/components/utils/getScrollbarWidth.ts
1225
+ var scrollbarWidth;
1226
+ function getScrollbarWidth() {
1227
+ var _a, _b;
1228
+ if (scrollbarWidth != null) {
1229
+ return scrollbarWidth;
1230
+ }
1231
+ const doc = (_a = getGlobal().document) != null ? _a : null;
1232
+ if (!doc) {
1233
+ return 0;
1234
+ }
1235
+ const outer = doc.createElement("div");
1236
+ outer.style.visibility = "hidden";
1237
+ outer.style.overflow = "scroll";
1238
+ doc.body.appendChild(outer);
1239
+ const inner = doc.createElement("div");
1240
+ outer.appendChild(inner);
1241
+ scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
1242
+ (_b = outer.parentNode) == null ? void 0 : _b.removeChild(outer);
1243
+ return scrollbarWidth;
1244
+ }
1245
+
1246
+ // src/components/InfiniteTable/utils/getColumnComputedType.ts
1247
+ var emptyType = Object.freeze({});
1248
+ function getColumnComputedType(column, columnTypes) {
1249
+ const defaultType = columnTypes.get("default") || emptyType;
1250
+ if (column.type === void 0) {
1251
+ return defaultType;
1252
+ }
1253
+ if (column.type === null) {
1254
+ return emptyType;
1255
+ }
1256
+ if (typeof column.type === "string") {
1257
+ const type = columnTypes.get(column.type) || emptyType;
1258
+ return type;
1259
+ }
1260
+ return column.type.reduce((acc, columnType) => Object.assign(acc, columnTypes.get(columnType)), {});
1261
+ }
1262
+
1093
1263
  // src/components/InfiniteTable/utils/getComputedVisibleColumns.ts
1094
- var error = err("getComputedVisibleColumns");
1264
+ var logError = err("getComputedVisibleColumns");
1095
1265
  var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId) => {
1096
1266
  return !columnVisibility.has(colId) || columnVisibility.get(colId) !== false;
1097
1267
  };
@@ -1112,22 +1282,26 @@ var getComputedVisibleColumns = ({
1112
1282
  sortInfo,
1113
1283
  setSortInfo,
1114
1284
  multiSort,
1285
+ viewportReservedWidth,
1115
1286
  draggableColumns,
1116
1287
  columnOrder,
1117
1288
  columnPinning,
1289
+ columnSizing,
1290
+ columnTypes,
1118
1291
  columnVisibility,
1119
1292
  columnVisibilityAssumeVisible
1120
1293
  }) => {
1121
1294
  let computedOffset = 0;
1122
1295
  const normalizedColumnOrder = adjustColumnOrderForPinning(columnOrder === true ? [...columns.keys()] : columnOrder, columnPinning);
1123
- const visibleColumnOrder = normalizedColumnOrder.filter(isColumnVisible.bind(null, columnVisibility, columnVisibilityAssumeVisible));
1124
- const columnsArray = visibleColumnOrder.map((columnId) => {
1125
- let col = columns.get(columnId);
1296
+ const visibleColumnOrder = normalizedColumnOrder.filter((colId) => {
1297
+ let col = columns.get(colId);
1126
1298
  if (!col) {
1127
- error(`Column with id "${columnId}" specified in columnOrder array cannot be found in the columns map.`);
1299
+ logError(`Column with id "${colId}" specified in columnOrder array cannot be found in the columns map.`);
1300
+ return false;
1128
1301
  }
1129
- return col;
1130
- }).filter(Boolean);
1302
+ return isColumnVisible(columnVisibility, columnVisibilityAssumeVisible, colId);
1303
+ });
1304
+ const columnsArray = visibleColumnOrder.map((columnId) => columns.get(columnId)).filter(Boolean);
1131
1305
  const sortedMap = (sortInfo != null ? sortInfo : []).reduce((acc, info, index) => {
1132
1306
  if (info.id) {
1133
1307
  acc[info.id] = { sortInfo: info, index };
@@ -1141,20 +1315,39 @@ var getComputedVisibleColumns = ({
1141
1315
  return acc;
1142
1316
  }, {});
1143
1317
  const flexResult = computeFlex({
1144
- availableSize: bodySize.width,
1318
+ availableSize: Math.max(bodySize.width - (viewportReservedWidth != null ? viewportReservedWidth : 0) - getScrollbarWidth(), 0),
1145
1319
  maxSize: columnMaxWidth,
1146
1320
  minSize: columnMinWidth,
1147
- items: columnsArray.map((col) => {
1148
- var _a, _b;
1149
- let size = col.flex != null ? void 0 : (_a = col.width) != null ? _a : columnDefaultWidth;
1150
- if (!size && col.flex == null) {
1151
- size = (_b = col.minWidth) != null ? _b : columnMinWidth;
1321
+ items: visibleColumnOrder.map((colId) => {
1322
+ var _a, _b, _c, _d;
1323
+ const column = columns.get(colId);
1324
+ const colType = getColumnComputedType(column, columnTypes);
1325
+ const colTypeSizing = {
1326
+ minWidth: colType == null ? void 0 : colType.minWidth,
1327
+ maxWidth: colType == null ? void 0 : colType.maxWidth,
1328
+ width: colType == null ? void 0 : colType.width,
1329
+ flex: colType == null ? void 0 : colType.flex
1330
+ };
1331
+ let colSizing = columnSizing.get(colId) || {};
1332
+ if (colSizing.width != null) {
1333
+ delete colTypeSizing.flex;
1334
+ }
1335
+ if (colSizing.flex != null) {
1336
+ delete colTypeSizing.width;
1337
+ }
1338
+ colSizing = Object.assign(colTypeSizing, colSizing);
1339
+ let colFlex = (_a = colSizing.flex) != null ? _a : void 0;
1340
+ const colMinWidth = (_b = colSizing.minWidth) != null ? _b : columnMinWidth;
1341
+ const colMaxWidth = (_c = colSizing.maxWidth) != null ? _c : columnMaxWidth;
1342
+ let size = colFlex != void 0 ? void 0 : (_d = colSizing.width) != null ? _d : columnDefaultWidth;
1343
+ if (!size && colFlex == void 0) {
1344
+ size = colMinWidth;
1152
1345
  }
1153
1346
  return {
1154
1347
  size,
1155
- flex: col.flex,
1156
- minSize: col.minWidth,
1157
- maxSize: col.maxWidth
1348
+ flex: colFlex,
1349
+ minSize: colMinWidth,
1350
+ maxSize: colMaxWidth
1158
1351
  };
1159
1352
  })
1160
1353
  });
@@ -1189,6 +1382,7 @@ var getComputedVisibleColumns = ({
1189
1382
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
1190
1383
  const id = visibleColumnOrder[i];
1191
1384
  const nextColumnId = visibleColumnOrder[i + 1];
1385
+ const colType = getColumnComputedType(c, columnTypes);
1192
1386
  const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
1193
1387
  const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
1194
1388
  const computedSorted = !!computedSortInfo;
@@ -1244,8 +1438,10 @@ var getComputedVisibleColumns = ({
1244
1438
  const computedFirstInCategory = computedPinned !== prevPinned;
1245
1439
  const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
1246
1440
  const result2 = __spreadProps(__spreadValues({
1247
- align: "start",
1248
- verticalAlign: "center"
1441
+ align: colType.align,
1442
+ verticalAlign: colType.verticalAlign,
1443
+ renderValue: colType.renderValue,
1444
+ render: colType.render
1249
1445
  }, c), {
1250
1446
  computedWidth,
1251
1447
  computedAbsoluteOffset,
@@ -1407,11 +1603,16 @@ var useComputedVisibleColumns = ({
1407
1603
  setSortInfo,
1408
1604
  columnOrder,
1409
1605
  columnPinning,
1606
+ columnTypes,
1410
1607
  pinnedEndMaxWidth,
1411
1608
  pinnedStartMaxWidth,
1609
+ viewportReservedWidth,
1412
1610
  columnVisibility,
1413
- columnVisibilityAssumeVisible
1611
+ columnVisibilityAssumeVisible,
1612
+ columnSizing
1414
1613
  }) => {
1614
+ const columnsSizingRenderId = useRerenderOnKeyChange(columnSizing);
1615
+ const columnTypesRenderId = useRerenderOnKeyChange(columnTypes);
1415
1616
  const columnsRenderId = useRerenderOnKeyChange(columns);
1416
1617
  const visibilityRenderId = useRerenderOnKeyChange(columnVisibility);
1417
1618
  const pinningRenderId = useRerenderOnKeyChange(columnPinning);
@@ -1437,6 +1638,7 @@ var useComputedVisibleColumns = ({
1437
1638
  columnMinWidth,
1438
1639
  columnMaxWidth,
1439
1640
  columnDefaultWidth,
1641
+ viewportReservedWidth,
1440
1642
  sortable,
1441
1643
  sortInfo,
1442
1644
  setSortInfo,
@@ -1446,6 +1648,8 @@ var useComputedVisibleColumns = ({
1446
1648
  draggableColumns,
1447
1649
  columnOrder,
1448
1650
  columnPinning,
1651
+ columnSizing,
1652
+ columnTypes,
1449
1653
  columnVisibility,
1450
1654
  columnVisibilityAssumeVisible: columnVisibilityAssumeVisible != null ? columnVisibilityAssumeVisible : true
1451
1655
  });
@@ -1467,7 +1671,9 @@ var useComputedVisibleColumns = ({
1467
1671
  columnPinning,
1468
1672
  columnsRenderId,
1469
1673
  visibilityRenderId,
1470
- pinningRenderId
1674
+ columnsSizingRenderId,
1675
+ pinningRenderId,
1676
+ columnTypesRenderId
1471
1677
  ]);
1472
1678
  const result = {
1473
1679
  columns,
@@ -1953,43 +2159,10 @@ function ExpanderIcon(props) {
1953
2159
  }));
1954
2160
  }
1955
2161
 
1956
- // node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
1957
- var shouldApplyCompound = (compoundCheck, selections) => {
1958
- for (const key of Object.keys(compoundCheck)) {
1959
- if (compoundCheck[key] !== selections[key]) {
1960
- return false;
1961
- }
1962
- }
1963
- return true;
1964
- };
1965
- var createRuntimeFn = (config) => (options) => {
1966
- let className = config.defaultClassName;
1967
- const selections = {
1968
- ...config.defaultVariants,
1969
- ...options
1970
- };
1971
- for (const variantName in selections) {
1972
- var _selections$variantNa;
1973
- const variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
1974
- if (variantSelection != null) {
1975
- let selection = variantSelection;
1976
- if (typeof selection === "boolean") {
1977
- selection = selection === true ? "true" : "false";
1978
- }
1979
- className += " " + config.variantClassNames[variantName][selection];
1980
- }
1981
- }
1982
- for (const [compoundCheck, compoundClassName] of config.compoundVariants) {
1983
- if (shouldApplyCompound(compoundCheck, selections)) {
1984
- className += " " + compoundClassName;
1985
- }
1986
- }
1987
- return className;
1988
- };
1989
-
1990
2162
  // src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
2163
+ var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
1991
2164
  var GroupRowExpanderCls = "_7pupv0b";
1992
- var RowClsRecipe = 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: [] });
2165
+ var RowClsRecipe = (0, import_createRuntimeFn.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: [] });
1993
2166
  var RowHoverCls = "_7pupv01";
1994
2167
 
1995
2168
  // src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
@@ -2011,48 +2184,51 @@ function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params)
2011
2184
  return;
2012
2185
  }
2013
2186
  let column = __spreadValues({}, col);
2014
- if (pivotColumn) {
2015
- if (typeof pivotColumn === "function") {
2016
- column = __spreadValues(__spreadValues({}, column), pivotColumn({
2017
- column,
2018
- pivotBy,
2019
- groupRowsBy
2020
- }));
2021
- } else {
2022
- column = __spreadValues(__spreadValues({}, column), pivotColumn);
2023
- }
2024
- }
2025
2187
  const isPivotRowLabelsColumn = !column.pivotColumn && !column.pivotTotalColumn;
2026
- if (pivotRowLabelsColumn && isPivotRowLabelsColumn) {
2027
- if (typeof pivotRowLabelsColumn === "function") {
2028
- column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn({
2029
- column,
2030
- pivotBy,
2031
- groupRowsBy
2032
- }));
2033
- } else {
2034
- column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn);
2188
+ if (!isPivotRowLabelsColumn) {
2189
+ if (pivotColumn) {
2190
+ if (typeof pivotColumn === "function") {
2191
+ column = __spreadValues(__spreadValues({}, column), pivotColumn({
2192
+ column,
2193
+ pivotBy,
2194
+ groupRowsBy
2195
+ }));
2196
+ } else {
2197
+ column = __spreadValues(__spreadValues({}, column), pivotColumn);
2198
+ }
2035
2199
  }
2036
- }
2037
- if (isPivotRowLabelsColumn && !column.render) {
2038
- column.render = (renderOptions) => {
2039
- var _a;
2040
- let { value, rowInfo, column: column2, groupRowsBy: groupRowsBy2 } = renderOptions;
2041
- if (column2.renderValue) {
2042
- value = column2.renderValue(renderOptions);
2200
+ } else {
2201
+ if (pivotRowLabelsColumn) {
2202
+ if (typeof pivotRowLabelsColumn === "function") {
2203
+ column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn({
2204
+ column,
2205
+ pivotBy,
2206
+ groupRowsBy
2207
+ }));
2208
+ } else {
2209
+ column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn);
2043
2210
  }
2044
- const showExpanderIcon = (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < groupRowsBy2.length;
2045
- return /* @__PURE__ */ React7.createElement("div", {
2046
- className: join(display.flex, alignItems.center, GroupRowExpanderCls)
2047
- }, showExpanderIcon ? /* @__PURE__ */ React7.createElement(ExpanderIcon, {
2048
- expanded: !rowInfo.collapsed,
2049
- onChange: () => {
2050
- toggleGroupRow(rowInfo.groupKeys);
2211
+ }
2212
+ if (!column.render) {
2213
+ column.render = (renderOptions) => {
2214
+ var _a;
2215
+ let { value, rowInfo, column: column2, groupRowsBy: groupRowsBy2 } = renderOptions;
2216
+ if (column2.renderValue) {
2217
+ value = column2.renderValue(renderOptions);
2051
2218
  }
2052
- }) : null, /* @__PURE__ */ React7.createElement("div", {
2053
- className: cssEllipsisClassName
2054
- }, value != null ? value : null));
2055
- };
2219
+ const showExpanderIcon = (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < groupRowsBy2.length;
2220
+ return /* @__PURE__ */ React7.createElement("div", {
2221
+ className: join(display.flex, alignItems.center, GroupRowExpanderCls)
2222
+ }, showExpanderIcon ? /* @__PURE__ */ React7.createElement(ExpanderIcon, {
2223
+ expanded: !rowInfo.collapsed,
2224
+ onChange: () => {
2225
+ toggleGroupRow(rowInfo.groupKeys);
2226
+ }
2227
+ }) : null, /* @__PURE__ */ React7.createElement("div", {
2228
+ className: cssEllipsisClassName
2229
+ }, value != null ? value : null));
2230
+ };
2231
+ }
2056
2232
  }
2057
2233
  if (!column.render && column.renderValue) {
2058
2234
  column.render = (renderOptions) => {
@@ -2666,78 +2842,6 @@ function mapPropsToState2(params) {
2666
2842
  };
2667
2843
  }
2668
2844
 
2669
- // src/utils/multisort/sortTypes.ts
2670
- var sortTypes = {
2671
- number: function(first, second) {
2672
- return first - second;
2673
- },
2674
- string: function(first, second) {
2675
- first = `${first}`;
2676
- second = `${second}`;
2677
- return first.localeCompare(second);
2678
- }
2679
- };
2680
- var sortTypes_default = sortTypes;
2681
-
2682
- // src/utils/multisort/index.ts
2683
- var multisort = (sortInfo, array, get) => {
2684
- array.sort(getMultisortFunction(sortInfo, get));
2685
- return array;
2686
- };
2687
- multisort.knownTypes = sortTypes_default;
2688
- var getSingleSortFunction = (info) => {
2689
- if (!info) {
2690
- return;
2691
- }
2692
- const field = info.field;
2693
- var dir = info.dir < 0 ? -1 : info.dir > 0 ? 1 : 0;
2694
- if (!dir) {
2695
- return;
2696
- }
2697
- let fn = info.fn;
2698
- if (!fn && info.type) {
2699
- fn = multisort.knownTypes[info.type];
2700
- if (!fn) {
2701
- console.warn(`Unknown sort type "${info.type}" - please pass one of ${Object.keys(multisort.knownTypes).join(", ")}`);
2702
- }
2703
- }
2704
- if (!fn) {
2705
- fn = sortTypes_default.string;
2706
- }
2707
- return (first, second) => {
2708
- const a = field ? first[field] : first;
2709
- const b = field ? second[field] : second;
2710
- return dir * fn(a, b);
2711
- };
2712
- };
2713
- var getSortFunctions = (sortInfo) => {
2714
- return sortInfo.map(getSingleSortFunction).filter((fn) => fn instanceof Function);
2715
- };
2716
- var getMultisortFunction = (sortInfo, get) => {
2717
- const fns = getSortFunctions(sortInfo);
2718
- return (first, second) => {
2719
- if (get) {
2720
- first = get(first);
2721
- second = get(second);
2722
- }
2723
- let result = 0;
2724
- let i = 0;
2725
- let fn;
2726
- const len = fns.length;
2727
- for (; i < len; i++) {
2728
- fn = fns[i];
2729
- if (!fn) {
2730
- continue;
2731
- }
2732
- result = fn(first, second);
2733
- if (result !== 0) {
2734
- return result;
2735
- }
2736
- }
2737
- return result;
2738
- };
2739
- };
2740
-
2741
2845
  // src/utils/groupAndPivot/index.ts
2742
2846
  function DEFAULT_TO_KEY(value) {
2743
2847
  return value;
@@ -2967,6 +3071,82 @@ function enhancedFlatten(param) {
2967
3071
  data: result
2968
3072
  };
2969
3073
  }
3074
+
3075
+ // src/utils/multisort/sortTypes.ts
3076
+ var numberComparator = function(first, second) {
3077
+ return first - second;
3078
+ };
3079
+ var stringComparator = function(first, second) {
3080
+ first = `${first}`;
3081
+ second = `${second}`;
3082
+ return first.localeCompare(second);
3083
+ };
3084
+ var sortTypes = {
3085
+ number: numberComparator,
3086
+ string: stringComparator
3087
+ };
3088
+ var sortTypes_default = sortTypes;
3089
+
3090
+ // src/utils/multisort/index.ts
3091
+ var multisort = (sortInfo, array, get) => {
3092
+ array.sort(getMultisortFunction(sortInfo, get));
3093
+ return array;
3094
+ };
3095
+ multisort.knownTypes = sortTypes_default;
3096
+ var getSingleSortFunction = (info) => {
3097
+ if (!info) {
3098
+ return;
3099
+ }
3100
+ const field = info.field;
3101
+ var dir = info.dir < 0 ? -1 : info.dir > 0 ? 1 : 0;
3102
+ if (!dir) {
3103
+ return;
3104
+ }
3105
+ let fn = info.fn;
3106
+ if (!fn && info.type) {
3107
+ fn = multisort.knownTypes[info.type];
3108
+ if (!fn) {
3109
+ console.warn(`Unknown sort type "${info.type}" - please pass one of ${Object.keys(multisort.knownTypes).join(", ")}`);
3110
+ }
3111
+ }
3112
+ if (!fn) {
3113
+ fn = sortTypes_default.string;
3114
+ }
3115
+ return (first, second) => {
3116
+ const a = field ? first[field] : first;
3117
+ const b = field ? second[field] : second;
3118
+ return dir * fn(a, b);
3119
+ };
3120
+ };
3121
+ var getSortFunctions = (sortInfo) => {
3122
+ return sortInfo.map(getSingleSortFunction).filter((fn) => fn instanceof Function);
3123
+ };
3124
+ var getMultisortFunction = (sortInfo, get) => {
3125
+ const fns = getSortFunctions(sortInfo);
3126
+ return (first, second) => {
3127
+ if (get) {
3128
+ first = get(first);
3129
+ second = get(second);
3130
+ }
3131
+ let result = 0;
3132
+ let i = 0;
3133
+ let fn;
3134
+ const len = fns.length;
3135
+ for (; i < len; i++) {
3136
+ fn = fns[i];
3137
+ if (!fn) {
3138
+ continue;
3139
+ }
3140
+ result = fn(first, second);
3141
+ if (result !== 0) {
3142
+ return result;
3143
+ }
3144
+ }
3145
+ return result;
3146
+ };
3147
+ };
3148
+
3149
+ // src/utils/groupAndPivot/getPivotColumnsAndColumnGroups.ts
2970
3150
  function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPosition) {
2971
3151
  const pivotLength = pivotBy.length;
2972
3152
  const columns = new Map([
@@ -2991,10 +3171,14 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
2991
3171
  if (keys.length === pivotLength) {
2992
3172
  const parentKeys = keys.slice(0, -1);
2993
3173
  let columnGroupId = parentKeys.join("/");
2994
- columns.set(`${keys.join("/")}`, {
3174
+ const pivotByForColumn = pivotBy[keys.length - 1];
3175
+ let computedPivotColumn = __spreadValues({
2995
3176
  pivotBy,
2996
3177
  pivotColumn: true,
2997
3178
  pivotGroupKeys: keys,
3179
+ pivotGroupKeyForColumn: keys[keys.length - 1],
3180
+ pivotIndexForColumn: keys.length - 1,
3181
+ pivotByForColumn,
2998
3182
  sortable: false,
2999
3183
  columnGroup: parentKeys.length ? `${columnGroupId}` : void 0,
3000
3184
  header: keys[keys.length - 1],
@@ -3003,7 +3187,15 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
3003
3187
  const value = (_c = (_b = (_a = rowInfo.pivotValuesMap) == null ? void 0 : _a.get(keys)) == null ? void 0 : _b.reducerResults[0]) != null ? _c : null;
3004
3188
  return value;
3005
3189
  }
3006
- });
3190
+ }, pivotByForColumn.column);
3191
+ if (pivotByForColumn.column) {
3192
+ if (typeof pivotByForColumn.column === "function") {
3193
+ Object.assign(computedPivotColumn, pivotByForColumn.column({ column: computedPivotColumn }));
3194
+ } else {
3195
+ Object.assign(computedPivotColumn, pivotByForColumn.column);
3196
+ }
3197
+ }
3198
+ columns.set(`${keys.join("/")}`, computedPivotColumn);
3007
3199
  } else {
3008
3200
  const colGroupId = keys.join("/");
3009
3201
  const parentKeys = keys.slice(0, -1);
@@ -3012,11 +3204,15 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
3012
3204
  header: keys.join(" >> ")
3013
3205
  });
3014
3206
  if (pivotTotalColumnPosition !== false) {
3015
- columns.set(`${keys.join("/")}-total`, {
3207
+ const pivotByForColumn = pivotBy[keys.length - 1];
3208
+ let computedPivotColumn = __spreadValues({
3016
3209
  columnGroup: parentKeys.length ? parentKeys.join("/") : void 0,
3017
3210
  header: `${keys.join("/")} total `,
3018
3211
  pivotTotalColumn: true,
3019
3212
  pivotGroupKeys: keys,
3213
+ pivotGroupKeyForColumn: keys[keys.length - 1],
3214
+ pivotByForColumn,
3215
+ pivotIndexForColumn: keys.length - 1,
3020
3216
  pivotBy,
3021
3217
  sortable: false,
3022
3218
  valueGetter: ({ rowInfo }) => {
@@ -3024,7 +3220,15 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
3024
3220
  const value = (_c = (_b = (_a = rowInfo.pivotValuesMap) == null ? void 0 : _a.get(keys)) == null ? void 0 : _b.reducerResults[0]) != null ? _c : null;
3025
3221
  return value;
3026
3222
  }
3027
- });
3223
+ }, pivotByForColumn.column);
3224
+ if (pivotByForColumn.column) {
3225
+ if (typeof pivotByForColumn.column === "function") {
3226
+ Object.assign(computedPivotColumn, pivotByForColumn.column({ column: computedPivotColumn }));
3227
+ } else {
3228
+ Object.assign(computedPivotColumn, pivotByForColumn.column);
3229
+ }
3230
+ }
3231
+ columns.set(`${keys.join("/")}-total`, computedPivotColumn);
3028
3232
  }
3029
3233
  }
3030
3234
  if (pivotTotalColumnPosition === "start" || pivotTotalColumnPosition === false) {
@@ -3434,25 +3638,27 @@ function getColumnsWhenGrouping(params) {
3434
3638
  const computedColumns = new Map();
3435
3639
  if (groupRenderStrategy === "multi-column") {
3436
3640
  groupRowsBy.forEach((groupByForColumn, groupIndexForColumn, arr) => {
3437
- computedColumns.set(`group-by-${groupByForColumn.field}`, getColumnForGroupBy({
3641
+ const generatedGroupColumn = getColumnForGroupBy({
3438
3642
  groupByForColumn,
3439
3643
  groupRowsBy,
3440
3644
  groupIndexForColumn,
3441
3645
  groupCount: arr.length,
3442
3646
  groupRenderStrategy
3443
- }, toggleGroupRow, groupColumn));
3647
+ }, toggleGroupRow, groupColumn);
3648
+ computedColumns.set(generatedGroupColumn.id || `group-by-${groupByForColumn.field}`, generatedGroupColumn);
3444
3649
  });
3445
3650
  } else if (groupRenderStrategy === "single-column") {
3446
- computedColumns.set("group-by", getSingleGroupColumn({
3651
+ const singleGroupColumn = getSingleGroupColumn({
3447
3652
  groupCount: groupRowsBy.length,
3448
3653
  groupRowsBy,
3449
3654
  groupRenderStrategy
3450
- }, toggleGroupRow, groupColumn));
3655
+ }, toggleGroupRow, groupColumn);
3656
+ computedColumns.set(singleGroupColumn.id || "group-by", singleGroupColumn);
3451
3657
  }
3452
3658
  columns.forEach((col, colId) => {
3453
3659
  computedColumns.set(colId, col);
3454
3660
  });
3455
- return computedColumns;
3661
+ return computedColumns.size ? computedColumns : void 0;
3456
3662
  }
3457
3663
 
3458
3664
  // src/components/InfiniteTable/hooks/useComputed.ts
@@ -3463,7 +3669,14 @@ function useComputed() {
3463
3669
  componentActions: dataSourceActions,
3464
3670
  componentState: dataSourceState
3465
3671
  } = useDataSourceContextValue();
3466
- const { columnOrder, columnVisibility, columnPinning, bodySize } = componentState;
3672
+ const {
3673
+ columnOrder,
3674
+ columnVisibility,
3675
+ columnPinning,
3676
+ columnSizing,
3677
+ columnTypes,
3678
+ bodySize
3679
+ } = componentState;
3467
3680
  (0, import_react19.useState)(() => {
3468
3681
  componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
3469
3682
  if (rowHeight) {
@@ -3508,6 +3721,7 @@ function useComputed() {
3508
3721
  pinnedStartMaxWidth: componentState.pinnedStartMaxWidth,
3509
3722
  pinnedEndMaxWidth: componentState.pinnedEndMaxWidth,
3510
3723
  bodySize,
3724
+ viewportReservedWidth: componentState.viewportReservedWidth,
3511
3725
  sortable: componentState.sortable,
3512
3726
  draggableColumns: componentState.draggableColumns,
3513
3727
  sortInfo: (_a = dataSourceState.sortInfo) != null ? _a : void 0,
@@ -3516,7 +3730,9 @@ function useComputed() {
3516
3730
  columnOrder,
3517
3731
  columnVisibility,
3518
3732
  columnVisibilityAssumeVisible: true,
3519
- columnPinning
3733
+ columnPinning,
3734
+ columnSizing,
3735
+ columnTypes
3520
3736
  });
3521
3737
  const unpinnedColumnWidths = computedUnpinnedColumns.map((c) => c.computedWidth);
3522
3738
  let sortedUnpinnedColumnWidths = [...unpinnedColumnWidths].sort(sortAscending);
@@ -3587,33 +3803,6 @@ var InfiniteTableBody = React10.forwardRef(function InfiniteTableBody2(props, re
3587
3803
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
3588
3804
  var React22 = __toModule(require("react"));
3589
3805
 
3590
- // src/utils/getGlobal.ts
3591
- function getGlobal() {
3592
- return globalThis;
3593
- }
3594
-
3595
- // src/components/utils/getScrollbarWidth.ts
3596
- var scrollbarWidth;
3597
- function getScrollbarWidth() {
3598
- var _a, _b;
3599
- if (scrollbarWidth != null) {
3600
- return scrollbarWidth;
3601
- }
3602
- const doc = (_a = getGlobal().document) != null ? _a : null;
3603
- if (!doc) {
3604
- return 0;
3605
- }
3606
- const outer = doc.createElement("div");
3607
- outer.style.visibility = "hidden";
3608
- outer.style.overflow = "scroll";
3609
- doc.body.appendChild(outer);
3610
- const inner = doc.createElement("div");
3611
- outer.appendChild(inner);
3612
- scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
3613
- (_b = outer.parentNode) == null ? void 0 : _b.removeChild(outer);
3614
- return scrollbarWidth;
3615
- }
3616
-
3617
3806
  // src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
3618
3807
  var React11 = __toModule(require("react"));
3619
3808
  function HorizontalScrollbarPlaceholderFn(props) {
@@ -3650,10 +3839,11 @@ function VerticalScrollbarPlaceholderFn(props) {
3650
3839
  var VerticalScrollbarPlaceholder = React11.memo(VerticalScrollbarPlaceholderFn);
3651
3840
 
3652
3841
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
3842
+ var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
3653
3843
  var CellCls = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
3654
3844
  var HeaderCellProxy = "_12zfob10";
3655
- var HeaderCellRecipe = createRuntimeFn({ defaultClassName: "_12zfob1c", variantClassNames: { dragging: { true: "_12zfob1d", false: "_12zfob1e" }, first: { true: "_12zfob1f", false: "_12zfob1g" }, last: { true: "_12zfob1h", false: "_12zfob1i" }, groupByField: { true: "_12zfob1j", false: "_12zfob1k" }, firstInCategory: { true: "_12zfob1l", false: "_12zfob1m" }, lastInCategory: { true: "_12zfob1n", false: "_12zfob1o" }, pinned: { start: "_12zfob1p", end: "_12zfob1q", false: "_12zfob1r" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob1s"], [{ pinned: "end", firstInCategory: true }, "_12zfob1t"], [{ pinned: false, lastInCategory: true }, "_12zfob1u"]] });
3656
- var HeaderClsRecipe = createRuntimeFn({ defaultClassName: "_12zfob12 _16lm1iw10", variantClassNames: { pinned: { start: "_12zfob13", end: "_12zfob14", false: "_12zfob15" }, virtualized: { true: "_12zfob16", false: "_12zfob17" }, overflow: { true: "_12zfob18", false: "_12zfob19" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1a"], [{ overflow: true, pinned: "end" }, "_12zfob1b"]] });
3845
+ var HeaderCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob1c", variantClassNames: { dragging: { true: "_12zfob1d", false: "_12zfob1e" }, first: { true: "_12zfob1f", false: "_12zfob1g" }, last: { true: "_12zfob1h", false: "_12zfob1i" }, groupByField: { true: "_12zfob1j", false: "_12zfob1k" }, firstInCategory: { true: "_12zfob1l", false: "_12zfob1m" }, lastInCategory: { true: "_12zfob1n", false: "_12zfob1o" }, pinned: { start: "_12zfob1p", end: "_12zfob1q", false: "_12zfob1r" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob1s"], [{ pinned: "end", firstInCategory: true }, "_12zfob1t"], [{ pinned: false, lastInCategory: true }, "_12zfob1u"]] });
3846
+ var HeaderClsRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob12 _16lm1iw10", variantClassNames: { pinned: { start: "_12zfob13", end: "_12zfob14", false: "_12zfob15" }, virtualized: { true: "_12zfob16", false: "_12zfob17" }, overflow: { true: "_12zfob18", false: "_12zfob19" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1a"], [{ overflow: true, pinned: "end" }, "_12zfob1b"]] });
3657
3847
  var HeaderGroupCls = "_16lm1iwz _16lm1iwj";
3658
3848
  var HeaderGroup_Children = "_16lm1iwj _16lm1iw10 _16lm1iw12 _16lm1iwc";
3659
3849
  var HeaderGroup_Header = "_12zfob1x _16lm1iwj _16lm1iw10 _16lm1iw11";
@@ -3662,7 +3852,7 @@ var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
3662
3852
 
3663
3853
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
3664
3854
  var React18 = __toModule(require("react"));
3665
- var import_react26 = __toModule(require("react"));
3855
+ var import_react27 = __toModule(require("react"));
3666
3856
 
3667
3857
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
3668
3858
  var React14 = __toModule(require("react"));
@@ -3680,9 +3870,10 @@ var useInfiniteTableState = () => {
3680
3870
  };
3681
3871
 
3682
3872
  // src/components/InfiniteTable/components/cell.css.ts
3873
+ var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
3683
3874
  var CellCls2 = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
3684
3875
  var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
3685
- var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "_16lm1iw2 _16lm1iwo _16lm1iw7 _16lm1iwr", variantClassNames: { dragging: { false: "_1eexc2a7" }, first: { true: "_1eexc2a8", false: "_1eexc2a9" }, last: { true: "_1eexc2aa", false: "_1eexc2ab" }, groupByField: { true: "_1eexc2ac", false: "_1eexc2ad" }, firstInCategory: { true: "_1eexc2ae", false: "_1eexc2af" }, lastInCategory: { true: "_1eexc2ag", false: "_1eexc2ah" }, pinned: { start: "_1eexc2ai", end: "_1eexc2aj", false: "_1eexc2ak" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2al"], [{ pinned: "end", firstInCategory: true }, "_1eexc2am"]] });
3876
+ var ColumnCellRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "_16lm1iw2 _16lm1iwo _16lm1iw7 _16lm1iwr", variantClassNames: { dragging: { false: "_1eexc2a7" }, first: { true: "_1eexc2a8", false: "_1eexc2a9" }, last: { true: "_1eexc2aa", false: "_1eexc2ab" }, groupByField: { true: "_1eexc2ac", false: "_1eexc2ad" }, firstInCategory: { true: "_1eexc2ae", false: "_1eexc2af" }, lastInCategory: { true: "_1eexc2ag", false: "_1eexc2ah" }, pinned: { start: "_1eexc2ai", end: "_1eexc2aj", false: "_1eexc2ak" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2al"], [{ pinned: "end", firstInCategory: true }, "_1eexc2am"]] });
3686
3877
  var columnAlignCellStyle = { center: "_1eexc2a0", start: "_1eexc2a1", end: "_1eexc2a2" };
3687
3878
 
3688
3879
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
@@ -4095,6 +4286,24 @@ function InfiniteTableHeaderCell(props) {
4095
4286
 
4096
4287
  // src/components/RawList/index.tsx
4097
4288
  var React17 = __toModule(require("react"));
4289
+ var import_react26 = __toModule(require("react"));
4290
+
4291
+ // src/components/RawList/AvoidReactDiff.tsx
4292
+ var React15 = __toModule(require("react"));
4293
+ var import_react24 = __toModule(require("react"));
4294
+ function AvoidReactDiffFn(props) {
4295
+ const [children, setChildren] = (0, import_react24.useState)(props.updater.get());
4296
+ (0, import_react24.useLayoutEffect)(() => {
4297
+ const remove = props.updater.onChange((children2) => {
4298
+ setChildren(children2);
4299
+ });
4300
+ return remove;
4301
+ }, [props.updater]);
4302
+ return /* @__PURE__ */ React15.createElement(React15.Fragment, null, children);
4303
+ }
4304
+ var AvoidReactDiff = React15.memo(AvoidReactDiffFn);
4305
+
4306
+ // src/components/RawList/useVirtualRenderer.ts
4098
4307
  var import_react25 = __toModule(require("react"));
4099
4308
 
4100
4309
  // src/components/RawList/ReactVirtualRenderer.tsx
@@ -4193,6 +4402,9 @@ var MappedItems = class extends Logger {
4193
4402
  this.itemIndexToElementIndex = {};
4194
4403
  this.renderedElements = {};
4195
4404
  }
4405
+ reset() {
4406
+ this.init();
4407
+ }
4196
4408
  destroy() {
4197
4409
  this.init();
4198
4410
  }
@@ -4212,21 +4424,6 @@ var MappedItems = class extends Logger {
4212
4424
  }
4213
4425
  };
4214
4426
 
4215
- // src/components/RawList/AvoidReactDiff.tsx
4216
- var React15 = __toModule(require("react"));
4217
- var import_react24 = __toModule(require("react"));
4218
- function AvoidReactDiffFn(props) {
4219
- const [children, setChildren] = (0, import_react24.useState)(props.updater.get());
4220
- (0, import_react24.useLayoutEffect)(() => {
4221
- const remove = props.updater.onChange((children2) => {
4222
- setChildren(children2);
4223
- });
4224
- return remove;
4225
- }, [props.updater]);
4226
- return /* @__PURE__ */ React15.createElement(React15.Fragment, null, children);
4227
- }
4228
- var AvoidReactDiff = React15.memo(AvoidReactDiffFn);
4229
-
4230
4427
  // src/components/RawList/ReactVirtualRenderer.tsx
4231
4428
  var ITEM_POSITION_WITH_TRANSFORM = true;
4232
4429
  var ReactVirtualRenderer = class extends Logger {
@@ -4333,17 +4530,12 @@ var ReactVirtualRenderer = class extends Logger {
4333
4530
  }
4334
4531
  };
4335
4532
  this.destroy = () => {
4336
- if (true) {
4337
- return;
4338
- }
4339
4533
  this.destroyed = true;
4340
- this.mappedItems.destroy();
4341
- this.itemDOMElements = [];
4342
- this.itemDOMRefs = [];
4343
- this.updaters = [];
4534
+ this.reset();
4344
4535
  this.onRender = null;
4345
4536
  this.renderItem = null;
4346
4537
  this.brain = null;
4538
+ this.mappedItems = null;
4347
4539
  };
4348
4540
  if (onRender) {
4349
4541
  this.onRender = onRender;
@@ -4401,28 +4593,53 @@ var ReactVirtualRenderer = class extends Logger {
4401
4593
  itemUpdater(renderedNode);
4402
4594
  this.updateElementPosition(elementIndex);
4403
4595
  }
4596
+ reset() {
4597
+ this.itemDOMElements = {};
4598
+ this.itemDOMRefs = {};
4599
+ this.updaters = {};
4600
+ this.items = [];
4601
+ this.mappedItems.reset();
4602
+ }
4404
4603
  };
4405
4604
 
4605
+ // src/components/RawList/useVirtualRenderer.ts
4606
+ function createRenderer(brain) {
4607
+ const renderer = new ReactVirtualRenderer(brain, {});
4608
+ const onRenderUpdater = buildSubscriptionCallback();
4609
+ brain.onDestroy(() => {
4610
+ renderer.destroy();
4611
+ onRenderUpdater.destroy();
4612
+ });
4613
+ return {
4614
+ renderer,
4615
+ onRenderUpdater
4616
+ };
4617
+ }
4618
+ function useVirtualRenderer({
4619
+ brain
4620
+ }) {
4621
+ return (0, import_react25.useMemo)(() => {
4622
+ return createRenderer(brain);
4623
+ }, [brain]);
4624
+ }
4625
+
4406
4626
  // src/components/RawList/index.tsx
4407
4627
  function RawListFn(props) {
4408
4628
  const { renderItem, brain, debugChannel } = props;
4409
- const { onRenderUpdater, renderer } = (0, import_react25.useMemo)(() => {
4410
- const onRenderUpdater2 = buildSubscriptionCallback();
4411
- const renderer2 = new ReactVirtualRenderer(brain, {
4412
- channel: debugChannel
4413
- });
4414
- return { onRenderUpdater: onRenderUpdater2, renderer: renderer2 };
4415
- }, []);
4629
+ const { onRenderUpdater, renderer } = useVirtualRenderer({
4630
+ brain,
4631
+ debugChannel
4632
+ });
4416
4633
  const getRenderItem = useLatest(renderItem);
4417
- (0, import_react25.useEffect)(() => {
4634
+ (0, import_react26.useEffect)(() => {
4418
4635
  const renderRange = brain.getRenderRange();
4419
4636
  renderer.renderRange(renderRange, {
4420
4637
  renderItem,
4421
4638
  force: true,
4422
4639
  onRender: onRenderUpdater
4423
4640
  });
4424
- }, [renderItem, onRenderUpdater]);
4425
- (0, import_react25.useEffect)(() => {
4641
+ }, [brain, renderItem, onRenderUpdater]);
4642
+ (0, import_react26.useEffect)(() => {
4426
4643
  const remove = brain.onRenderRangeChange((renderRange) => {
4427
4644
  renderer.renderRange(renderRange, {
4428
4645
  force: false,
@@ -4432,12 +4649,6 @@ function RawListFn(props) {
4432
4649
  });
4433
4650
  return remove;
4434
4651
  }, [brain, onRenderUpdater]);
4435
- (0, import_react25.useEffect)(() => {
4436
- return () => {
4437
- renderer.destroy();
4438
- onRenderUpdater.destroy();
4439
- };
4440
- }, [renderer, onRenderUpdater]);
4441
4652
  return /* @__PURE__ */ React17.createElement(AvoidReactDiff, {
4442
4653
  updater: onRenderUpdater
4443
4654
  });
@@ -4455,7 +4666,7 @@ function InfiniteTableHeaderFn(props) {
4455
4666
  componentState: { headerHeight }
4456
4667
  } = useInfiniteTable();
4457
4668
  const { computedVisibleColumnsMap } = computed;
4458
- const renderColumn = (0, import_react26.useCallback)(({ domRef: domRef2, itemIndex: columnIndex }) => {
4669
+ const renderColumn = (0, import_react27.useCallback)(({ domRef: domRef2, itemIndex: columnIndex }) => {
4459
4670
  const column = columns[columnIndex];
4460
4671
  if (!column) {
4461
4672
  if (true) {
@@ -4470,14 +4681,14 @@ function InfiniteTableHeaderFn(props) {
4470
4681
  columns: computedVisibleColumnsMap
4471
4682
  });
4472
4683
  }, [computedVisibleColumnsMap, columns, repaintId, headerHeight]);
4473
- (0, import_react26.useEffect)(() => {
4684
+ (0, import_react27.useEffect)(() => {
4474
4685
  const onScroll = (scrollPosition) => {
4475
4686
  domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
4476
4687
  };
4477
4688
  const removeOnScroll = brain.onScroll(onScroll);
4478
4689
  return removeOnScroll;
4479
4690
  }, [brain]);
4480
- const domRef = (0, import_react26.useRef)(null);
4691
+ const domRef = (0, import_react27.useRef)(null);
4481
4692
  const headerCls = HeaderClsRecipe({
4482
4693
  pinned: pinning,
4483
4694
  overflow: false,
@@ -4669,7 +4880,7 @@ function renderColumnHeaderGroups(config) {
4669
4880
  }
4670
4881
 
4671
4882
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
4672
- var import_react27 = __toModule(require("react"));
4883
+ var import_react28 = __toModule(require("react"));
4673
4884
  var { rootClassName: rootClassName5 } = internalProps;
4674
4885
  var TableHeaderClassName2 = `${rootClassName5}Header`;
4675
4886
  var UPDATE_SCROLL = (node, scrollPosition) => {
@@ -4735,7 +4946,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
4735
4946
  if (totalWidth != null) {
4736
4947
  style.width = availableWidth;
4737
4948
  }
4738
- (0, import_react27.useEffect)(() => {
4949
+ (0, import_react28.useEffect)(() => {
4739
4950
  const scroller = brain || scrollListener;
4740
4951
  if (!scroller || !scrollable) {
4741
4952
  return;
@@ -4849,12 +5060,12 @@ function TableHeaderWrapper(props) {
4849
5060
 
4850
5061
  // src/components/VirtualScrollContainer/index.tsx
4851
5062
  var React23 = __toModule(require("react"));
4852
- var import_react29 = __toModule(require("react"));
5063
+ var import_react30 = __toModule(require("react"));
4853
5064
 
4854
5065
  // src/components/hooks/useOnScroll.ts
4855
- var import_react28 = __toModule(require("react"));
5066
+ var import_react29 = __toModule(require("react"));
4856
5067
  var useOnScroll = (domRef, onScroll) => {
4857
- (0, import_react28.useEffect)(() => {
5068
+ (0, import_react29.useEffect)(() => {
4858
5069
  const domNode = domRef == null ? void 0 : domRef.current;
4859
5070
  const scrollFn = (event) => {
4860
5071
  const node = event.target;
@@ -4900,7 +5111,7 @@ var VirtualScrollContainer = React23.forwardRef(function VirtualScrollContainer2
4900
5111
  className,
4901
5112
  style
4902
5113
  } = props;
4903
- const domRef = ref != null ? ref : (0, import_react29.useRef)(null);
5114
+ const domRef = ref != null ? ref : (0, import_react30.useRef)(null);
4904
5115
  useOnScroll(domRef, onContainerScroll);
4905
5116
  return /* @__PURE__ */ React23.createElement("div", {
4906
5117
  ref: domRef,
@@ -4931,18 +5142,18 @@ function SpacePlaceholderFn(props) {
4931
5142
  var SpacePlaceholder = React24.memo(SpacePlaceholderFn);
4932
5143
 
4933
5144
  // src/components/InfiniteTable/hooks/useListRendering.tsx
4934
- var import_react40 = __toModule(require("react"));
5145
+ var import_react41 = __toModule(require("react"));
4935
5146
 
4936
5147
  // src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
4937
5148
  var React30 = __toModule(require("react"));
4938
- var import_react33 = __toModule(require("react"));
5149
+ var import_react34 = __toModule(require("react"));
4939
5150
 
4940
5151
  // src/components/VirtualList/VirtualRowList.tsx
4941
5152
  var React26 = __toModule(require("react"));
4942
5153
 
4943
5154
  // src/components/VirtualList/VirtualList.tsx
4944
5155
  var React25 = __toModule(require("react"));
4945
- var import_react30 = __toModule(require("react"));
5156
+ var import_react31 = __toModule(require("react"));
4946
5157
 
4947
5158
  // src/components/VirtualList/VirtualList.css.ts
4948
5159
  var VirtualListCls = "mlx2t0 _16lm1iw0";
@@ -4985,11 +5196,11 @@ var VirtualList = (props) => {
4985
5196
  "onContainerScroll",
4986
5197
  "children"
4987
5198
  ]);
4988
- const domRef = (0, import_react30.useRef)(null);
5199
+ const domRef = (0, import_react31.useRef)(null);
4989
5200
  const [, rerender] = useRerender();
4990
- const [totalSize, setTotalSize] = (0, import_react30.useState)(0);
4991
- const renderCountRef = (0, import_react30.useRef)(0);
4992
- (0, import_react30.useEffect)(() => {
5201
+ const [totalSize, setTotalSize] = (0, import_react31.useState)(0);
5202
+ const renderCountRef = (0, import_react31.useRef)(0);
5203
+ (0, import_react31.useEffect)(() => {
4993
5204
  const removeOnRenderCount = virtualBrain.onRenderCountChange((renderCount) => {
4994
5205
  renderCountRef.current = renderCount;
4995
5206
  if (true) {
@@ -5008,7 +5219,7 @@ var VirtualList = (props) => {
5008
5219
  removeOnTotalSizeChange();
5009
5220
  };
5010
5221
  }, [virtualBrain]);
5011
- (0, import_react30.useEffect)(() => {
5222
+ (0, import_react31.useEffect)(() => {
5012
5223
  const onScroll = (scrollPosition) => {
5013
5224
  UPDATE_SCROLL2(domRef.current, scrollPosition);
5014
5225
  };
@@ -5034,7 +5245,7 @@ var VirtualList = (props) => {
5034
5245
  brain: virtualBrain,
5035
5246
  renderItem,
5036
5247
  repaintId,
5037
- debugChannel: "VirtualList"
5248
+ debugChannel: "VirtualList-" + mainAxis
5038
5249
  })), children, /* @__PURE__ */ React25.createElement(SpacePlaceholder, {
5039
5250
  count,
5040
5251
  width,
@@ -5062,7 +5273,7 @@ var VirtualRowList = (props) => {
5062
5273
 
5063
5274
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx
5064
5275
  var React28 = __toModule(require("react"));
5065
- var import_react32 = __toModule(require("react"));
5276
+ var import_react33 = __toModule(require("react"));
5066
5277
 
5067
5278
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
5068
5279
  var React27 = __toModule(require("react"));
@@ -5166,7 +5377,7 @@ function InfiniteTableColumnCellFn(props) {
5166
5377
  var InfiniteTableColumnCell = React27.memo(InfiniteTableColumnCellFn);
5167
5378
 
5168
5379
  // src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts
5169
- var import_react31 = __toModule(require("react"));
5380
+ var import_react32 = __toModule(require("react"));
5170
5381
 
5171
5382
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName.ts
5172
5383
  var { rootClassName: rootClassName9 } = internalProps;
@@ -5191,8 +5402,8 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
5191
5402
  domRef: domRefFromProps,
5192
5403
  rowInfo
5193
5404
  } = props;
5194
- const domRef = (0, import_react31.useRef)(null);
5195
- const rowDOMRef = (0, import_react31.useCallback)((node) => {
5405
+ const domRef = (0, import_react32.useRef)(null);
5406
+ const rowDOMRef = (0, import_react32.useCallback)((node) => {
5196
5407
  domRefFromProps(node);
5197
5408
  domRef.current = node;
5198
5409
  }, []);
@@ -5224,7 +5435,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
5224
5435
  }), `${InfiniteTableRowClassName}--${rowInfo.isGroupRow ? "group" : "normal"}-row`, inlineGroupRoot ? `${InfiniteTableRowClassName}--inline-group-row` : "", showZebraRows ? `${InfiniteTableRowClassName}--${odd ? "odd" : "even"}` : null, showHoverRows ? `${InfiniteTableRowClassName}--show-hover` : null, domProps == null ? void 0 : domProps.className, rowProps == null ? void 0 : rowProps.className, rowComputedClassName);
5225
5436
  const initialMouseEnter = rowProps == null ? void 0 : rowProps.onMouseEnter;
5226
5437
  const initialMouseLeave = rowProps == null ? void 0 : rowProps.onMouseLeave;
5227
- const onMouseEnter = (0, import_react31.useCallback)((event) => {
5438
+ const onMouseEnter = (0, import_react32.useCallback)((event) => {
5228
5439
  var _a;
5229
5440
  initialMouseEnter == null ? void 0 : initialMouseEnter(event);
5230
5441
  const rowIndex2 = ((_a = event.currentTarget) == null ? void 0 : _a.dataset.rowIndex) * 1;
@@ -5238,7 +5449,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
5238
5449
  const rows = parentNode.querySelectorAll(hoverSelector.join(","));
5239
5450
  rows.forEach((row) => row.classList.add(InfiniteTableRowClassName__hover, RowHoverCls));
5240
5451
  }, [initialMouseEnter, showHoverRows]);
5241
- const onMouseLeave = (0, import_react31.useCallback)((event) => {
5452
+ const onMouseLeave = (0, import_react32.useCallback)((event) => {
5242
5453
  var _a;
5243
5454
  initialMouseLeave == null ? void 0 : initialMouseLeave(event);
5244
5455
  const rowIndex2 = (_a = event.currentTarget) == null ? void 0 : _a.dataset.rowIndex;
@@ -5294,7 +5505,7 @@ function InfiniteTableRowFn(props) {
5294
5505
  width: rowWidth,
5295
5506
  height: rowHeight
5296
5507
  }, domProps.style);
5297
- const renderCellRef = (0, import_react32.useRef)(null);
5508
+ const renderCellRef = (0, import_react33.useRef)(null);
5298
5509
  const renderCell = React28.useCallback(({ domRef, itemIndex }) => {
5299
5510
  const column = columns[itemIndex];
5300
5511
  if (!column) {
@@ -5398,7 +5609,7 @@ function useUnpinnedRendering(params) {
5398
5609
  } = params;
5399
5610
  const { virtualizeColumns } = getState();
5400
5611
  const shouldVirtualizeColumns = typeof virtualizeColumns === "function" ? virtualizeColumns(computedUnpinnedColumns) : virtualizeColumns != null ? virtualizeColumns : true;
5401
- const renderRowUnpinned = (0, import_react33.useCallback)((rowParams) => {
5612
+ const renderRowUnpinned = (0, import_react34.useCallback)((rowParams) => {
5402
5613
  const dataArray = getData();
5403
5614
  const rowInfo = dataArray[rowParams.rowIndex];
5404
5615
  const { showZebraRows, showHoverRows } = getState();
@@ -5464,16 +5675,17 @@ function useUnpinnedRendering(params) {
5464
5675
  }
5465
5676
 
5466
5677
  // src/components/InfiniteTable/hooks/useOnContainerScroll.ts
5467
- var import_react34 = __toModule(require("react"));
5678
+ var import_react35 = __toModule(require("react"));
5468
5679
 
5469
5680
  // src/components/InfiniteTable/InfiniteCls.css.ts
5681
+ var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5470
5682
  var FooterCls = "_16lm1iw1";
5471
5683
  var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwj _16lm1iwz _16lm1iw0";
5472
- var InfiniteClsRecipe = 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: [] });
5684
+ 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: [] });
5473
5685
  var InfiniteClsScrolling = "_1yeub2v1";
5474
5686
  var InfiniteClsShiftingColumns = "_16lm1iwm";
5475
5687
  var PinnedRowsClsVariants = { pinnedStart: "_1yeub2ve", pinnedEnd: "_1yeub2vf", overflow: "_1yeub2vg" };
5476
- var PinnedRowsContainerClsVariants = createRuntimeFn({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vh", end: "_1yeub2vi", false: "_1yeub2vj" } }, defaultVariants: {}, compoundVariants: [] });
5688
+ var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vh", end: "_1yeub2vi", false: "_1yeub2vj" } }, defaultVariants: {}, compoundVariants: [] });
5477
5689
 
5478
5690
  // src/components/InfiniteTable/hooks/useOnContainerScroll.ts
5479
5691
  var DELAY = 200;
@@ -5495,14 +5707,14 @@ var useOnContainerScroll = ({
5495
5707
  bodySize
5496
5708
  }
5497
5709
  } = useInfiniteTable();
5498
- const timeoutIdRef = (0, import_react34.useRef)(0);
5499
- const scrollingRef = (0, import_react34.useRef)(false);
5500
- const scrollTopMaxRef = (0, import_react34.useRef)(0);
5501
- (0, import_react34.useEffect)(() => {
5710
+ const timeoutIdRef = (0, import_react35.useRef)(0);
5711
+ const scrollingRef = (0, import_react35.useRef)(false);
5712
+ const scrollTopMaxRef = (0, import_react35.useRef)(0);
5713
+ (0, import_react35.useEffect)(() => {
5502
5714
  const { current: node } = scrollerDOMRef;
5503
5715
  scrollTopMaxRef.current = node.scrollHeight - node.clientHeight;
5504
5716
  }, [reservedContentHeight, bodySize.height]);
5505
- const setScrolling = (0, import_react34.useCallback)((scrolling) => {
5717
+ const setScrolling = (0, import_react35.useCallback)((scrolling) => {
5506
5718
  var _a;
5507
5719
  const prevScrolling = scrollingRef.current;
5508
5720
  scrollingRef.current = scrolling;
@@ -5527,7 +5739,7 @@ var useOnContainerScroll = ({
5527
5739
  }
5528
5740
  }
5529
5741
  }, []);
5530
- const onContainerScroll = (0, import_react34.useCallback)((scrollInfo) => {
5742
+ const onContainerScroll = (0, import_react35.useCallback)((scrollInfo) => {
5531
5743
  verticalVirtualBrain.setScrollPosition(scrollInfo);
5532
5744
  horizontalVirtualBrain.setScrollPosition(scrollInfo);
5533
5745
  setScrolling(true);
@@ -5537,15 +5749,15 @@ var useOnContainerScroll = ({
5537
5749
  domRef.current,
5538
5750
  setScrolling
5539
5751
  ]);
5540
- const scrollPositionRef = (0, import_react34.useRef)({
5752
+ const scrollPositionRef = (0, import_react35.useRef)({
5541
5753
  scrollLeft: 0,
5542
5754
  scrollTop: 0
5543
5755
  });
5544
- const applyScrollHorizontal = (0, import_react34.useCallback)(({ scrollLeft }) => {
5756
+ const applyScrollHorizontal = (0, import_react35.useCallback)(({ scrollLeft }) => {
5545
5757
  scrollPositionRef.current.scrollLeft = scrollLeft;
5546
5758
  onContainerScroll(scrollPositionRef.current);
5547
5759
  }, [onContainerScroll]);
5548
- const applyScrollVertical = (0, import_react34.useCallback)(({ scrollTop }) => {
5760
+ const applyScrollVertical = (0, import_react35.useCallback)(({ scrollTop }) => {
5549
5761
  scrollPositionRef.current.scrollTop = scrollTop;
5550
5762
  onContainerScroll(scrollPositionRef.current);
5551
5763
  if (scrollTop === 0) {
@@ -5565,16 +5777,16 @@ var useOnContainerScroll = ({
5565
5777
 
5566
5778
  // src/components/InfiniteTable/hooks/usePinnedRendering.tsx
5567
5779
  var React32 = __toModule(require("react"));
5568
- var import_react37 = __toModule(require("react"));
5780
+ var import_react38 = __toModule(require("react"));
5569
5781
 
5570
5782
  // src/components/VirtualList/RowListWithExternalScrolling.tsx
5571
5783
  var React31 = __toModule(require("react"));
5572
- var import_react36 = __toModule(require("react"));
5784
+ var import_react37 = __toModule(require("react"));
5573
5785
 
5574
5786
  // src/components/hooks/useOnMount.ts
5575
- var import_react35 = __toModule(require("react"));
5787
+ var import_react36 = __toModule(require("react"));
5576
5788
  function useOnMount(domRef, props) {
5577
- (0, import_react35.useEffect)(() => {
5789
+ (0, import_react36.useEffect)(() => {
5578
5790
  const { onMount, onUnmount } = props;
5579
5791
  const node = domRef == null ? void 0 : domRef.current;
5580
5792
  onMount == null ? void 0 : onMount(node);
@@ -5605,8 +5817,8 @@ var RowListWithExternalScrolling = (props) => {
5605
5817
  onMount,
5606
5818
  onUnmount
5607
5819
  } = props;
5608
- const domRef = (0, import_react36.useRef)(null);
5609
- const renderItem = (0, import_react36.useCallback)((renderProps) => renderRow({
5820
+ const domRef = (0, import_react37.useRef)(null);
5821
+ const renderItem = (0, import_react37.useCallback)((renderProps) => renderRow({
5610
5822
  domRef: renderProps.domRef,
5611
5823
  rowHeight: renderProps.itemSize,
5612
5824
  rowIndex: renderProps.itemIndex
@@ -5615,7 +5827,7 @@ var RowListWithExternalScrolling = (props) => {
5615
5827
  onMount,
5616
5828
  onUnmount
5617
5829
  });
5618
- (0, import_react36.useEffect)(() => {
5830
+ (0, import_react37.useEffect)(() => {
5619
5831
  const onScroll = (scrollPosition) => {
5620
5832
  const node = domRef.current;
5621
5833
  if (node) {
@@ -5682,7 +5894,7 @@ function PinnedRowsContainer(props) {
5682
5894
  }
5683
5895
  return result;
5684
5896
  }, [height, rowWidth, pinning, hasOverflow]);
5685
- const updateScroll = (0, import_react37.useCallback)((node, scrollPosition) => {
5897
+ const updateScroll = (0, import_react38.useCallback)((node, scrollPosition) => {
5686
5898
  UPDATE_SCROLL3(node, scrollPosition, hasOverflow ? pinnedScrollListener.getScrollPosition() : void 0);
5687
5899
  }, [hasOverflow, pinnedScrollListener]);
5688
5900
  const rowListProps = {
@@ -5724,7 +5936,7 @@ function PinnedRowsContainer(props) {
5724
5936
  }
5725
5937
  function useRenderPinnedRow(params) {
5726
5938
  const { getData, getState, columnsWidth, columns, verticalBrain } = params;
5727
- const renderPinnedRow = (0, import_react37.useCallback)((rowParams) => {
5939
+ const renderPinnedRow = (0, import_react38.useCallback)((rowParams) => {
5728
5940
  const dataArray = getData();
5729
5941
  const rowInfo = dataArray[rowParams.rowIndex];
5730
5942
  const { showZebraRows, showHoverRows } = getState();
@@ -5838,7 +6050,7 @@ function usePinnedStartRendering(params) {
5838
6050
  }
5839
6051
 
5840
6052
  // src/components/InfiniteTable/hooks/useYourBrain.ts
5841
- var import_react39 = __toModule(require("react"));
6053
+ var import_react40 = __toModule(require("react"));
5842
6054
 
5843
6055
  // src/components/VirtualBrain/index.ts
5844
6056
  var import_binary_search2 = __toModule(require_binary_search());
@@ -5854,11 +6066,13 @@ var VirtualBrain = class extends Logger {
5854
6066
  super(`VirtualBrain:${options.mainAxis}`);
5855
6067
  this.scrollPosition = initialScrollPosition2;
5856
6068
  this.scrollPositionOnMainAxis = 0;
6069
+ this.destroyed = false;
5857
6070
  this.totalSize = 0;
5858
6071
  this.onScrollFns = [];
5859
6072
  this.onTotalSizeChangeFns = [];
5860
6073
  this.onRenderCountChangeFns = [];
5861
6074
  this.onRenderRangeChangeFns = [];
6075
+ this.onDestroyFns = [];
5862
6076
  this.renderCount = 0;
5863
6077
  this.renderRange = {
5864
6078
  renderStartIndex: -1,
@@ -5955,6 +6169,12 @@ var VirtualBrain = class extends Logger {
5955
6169
  this.onRenderRangeChangeFns = this.onRenderRangeChangeFns.filter((f) => f !== fn);
5956
6170
  };
5957
6171
  };
6172
+ this.onDestroy = (fn) => {
6173
+ this.onDestroyFns.push(fn);
6174
+ return () => {
6175
+ this.onDestroyFns = this.onDestroyFns.filter((f) => f !== fn);
6176
+ };
6177
+ };
5958
6178
  this.update = (newCount, newItemSize, newItemSpan) => {
5959
6179
  const { itemSize, count, itemSpan } = this.options;
5960
6180
  const countChange = count !== newCount;
@@ -6151,7 +6371,13 @@ var VirtualBrain = class extends Logger {
6151
6371
  return result;
6152
6372
  };
6153
6373
  this.destroy = () => {
6374
+ if (this.destroyed) {
6375
+ return;
6376
+ }
6377
+ this.notifyDestroy();
6154
6378
  this.reset();
6379
+ this.destroyed = true;
6380
+ this.onDestroyFns = [];
6155
6381
  this.onScrollFns = [];
6156
6382
  this.onTotalSizeChangeFns = [];
6157
6383
  this.onRenderCountChangeFns = [];
@@ -6187,6 +6413,12 @@ var VirtualBrain = class extends Logger {
6187
6413
  fns[i](scrollPosition);
6188
6414
  }
6189
6415
  }
6416
+ notifyDestroy() {
6417
+ const fns = this.onDestroyFns;
6418
+ for (let i = 0, len = fns.length; i < len; i++) {
6419
+ fns[i]();
6420
+ }
6421
+ }
6190
6422
  notifyTotalSizeChange() {
6191
6423
  const totalSize = this.getTotalSize();
6192
6424
  const fns = this.onTotalSizeChangeFns;
@@ -6256,9 +6488,9 @@ var VirtualBrain = class extends Logger {
6256
6488
  };
6257
6489
 
6258
6490
  // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
6259
- var import_react38 = __toModule(require("react"));
6491
+ var import_react39 = __toModule(require("react"));
6260
6492
  function useColumnSizeFn(computedUnpinnedColumns) {
6261
- const columnSize = (0, import_react38.useCallback)((index) => {
6493
+ const columnSize = (0, import_react39.useCallback)((index) => {
6262
6494
  const column = computedUnpinnedColumns[index];
6263
6495
  if (!column) {
6264
6496
  console.log("cannot find column at index", index, computedUnpinnedColumns);
@@ -6297,16 +6529,21 @@ function useYourBrain(param) {
6297
6529
  });
6298
6530
  return brain;
6299
6531
  });
6532
+ (0, import_react40.useEffect)(() => {
6533
+ return () => {
6534
+ horizontalVirtualBrain.destroy();
6535
+ verticalVirtualBrain.destroy();
6536
+ };
6537
+ }, []);
6300
6538
  horizontalVirtualBrain.update(computedUnpinnedColumns.length, columnSize);
6301
6539
  verticalVirtualBrain.update(dataArray.length, rowHeight, rowSpan);
6302
- globalThis.verticalVirtualBrain = verticalVirtualBrain;
6303
- (0, import_react39.useEffect)(() => {
6540
+ (0, import_react40.useEffect)(() => {
6304
6541
  verticalVirtualBrain.setAvailableSize({
6305
6542
  height: bodySize.height,
6306
6543
  width: 0
6307
6544
  });
6308
6545
  }, [bodySize, verticalVirtualBrain]);
6309
- (0, import_react39.useEffect)(() => {
6546
+ (0, import_react40.useEffect)(() => {
6310
6547
  horizontalVirtualBrain.setAvailableSize({
6311
6548
  height: 0,
6312
6549
  width: Math.max(bodySize.width - computedPinnedStartWidth - computedPinnedEndWidth, 0)
@@ -6367,12 +6604,12 @@ function useListRendering(param) {
6367
6604
  pinnedEndScrollListener
6368
6605
  } = componentState;
6369
6606
  const prevDataSourceTimestamp = usePrevious(dataSourceState.updatedAt);
6370
- const repaintIdRef = (0, import_react40.useRef)(0);
6607
+ const repaintIdRef = (0, import_react41.useRef)(0);
6371
6608
  if (!shallowEqualObjects(prevComputed, computed) || prevDataSourceTimestamp !== dataSourceState.updatedAt) {
6372
6609
  repaintIdRef.current++;
6373
6610
  }
6374
6611
  const repaintId = repaintIdRef.current;
6375
- const rowSpan = (0, import_react40.useMemo)(() => {
6612
+ const rowSpan = (0, import_react41.useMemo)(() => {
6376
6613
  const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
6377
6614
  return colsWithRowspan.length ? ({ itemIndex }) => {
6378
6615
  let maxSpan = 1;
@@ -6410,11 +6647,11 @@ function useListRendering(param) {
6410
6647
  const hasHorizontalScrollbar = computedUnpinnedColumnsWidth > bodySize.width - computedPinnedStartColumnsWidth - computedPinnedEndColumnsWidth;
6411
6648
  const reservedContentHeight = verticalVirtualBrain.getTotalSize() + (hasHorizontalScrollbar ? getScrollbarWidth() : 0);
6412
6649
  const hasVerticalScrollbar = bodySize.height < reservedContentHeight;
6413
- const scrollbars = (0, import_react40.useMemo)(() => ({
6650
+ const scrollbars = (0, import_react41.useMemo)(() => ({
6414
6651
  vertical: hasVerticalScrollbar,
6415
6652
  horizontal: hasHorizontalScrollbar
6416
6653
  }), [hasVerticalScrollbar, hasHorizontalScrollbar]);
6417
- (0, import_react40.useEffect)(() => {
6654
+ (0, import_react41.useEffect)(() => {
6418
6655
  if (!bodySize.height) {
6419
6656
  return;
6420
6657
  }
@@ -6440,7 +6677,7 @@ function useListRendering(param) {
6440
6677
  reservedContentHeight
6441
6678
  });
6442
6679
  const { componentActions: dataSourceActions } = useDataSourceContextValue();
6443
- const toggleGroupRow = (0, import_react40.useCallback)((groupKeys) => {
6680
+ const toggleGroupRow = (0, import_react41.useCallback)((groupKeys) => {
6444
6681
  const newState = new GroupRowsState(getDataSourceState().groupRowsState);
6445
6682
  newState.toggleGroupRow(groupKeys);
6446
6683
  dataSourceActions.groupRowsState = newState;
@@ -6475,7 +6712,7 @@ function useListRendering(param) {
6475
6712
  computedUnpinnedColumns
6476
6713
  });
6477
6714
  const [, rerender] = useRerender();
6478
- (0, import_react40.useEffect)(() => {
6715
+ (0, import_react41.useEffect)(() => {
6479
6716
  rerender();
6480
6717
  }, [dataSourceState]);
6481
6718
  const { pinnedStartList, pinnedStartScrollbarPlaceholder } = usePinnedStartRendering(pinnedRenderingParams);
@@ -6499,7 +6736,7 @@ function useListRendering(param) {
6499
6736
 
6500
6737
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
6501
6738
  var React33 = __toModule(require("react"));
6502
- var import_react41 = __toModule(require("react"));
6739
+ var import_react42 = __toModule(require("react"));
6503
6740
 
6504
6741
  // src/components/utils/decamelize.ts
6505
6742
  var import_decamelize = __toModule(require_decamelize());
@@ -6549,7 +6786,7 @@ var InfiniteTableLicenseFooter = React33.forwardRef(function InfiniteTableLicens
6549
6786
  ref.current = node;
6550
6787
  }
6551
6788
  }, []);
6552
- (0, import_react41.useEffect)(() => {
6789
+ (0, import_react42.useEffect)(() => {
6553
6790
  const forceStyle = () => {
6554
6791
  requestAnimationFrame(() => {
6555
6792
  var _a;
@@ -6577,7 +6814,7 @@ var InfiniteTableLicenseFooter = React33.forwardRef(function InfiniteTableLicens
6577
6814
  });
6578
6815
 
6579
6816
  // src/components/InfiniteTable/hooks/useLicense/useLicense.ts
6580
- var import_react42 = __toModule(require("react"));
6817
+ var import_react43 = __toModule(require("react"));
6581
6818
 
6582
6819
  // src/components/InfiniteTable/hooks/useLicense/crc32.ts
6583
6820
  var DEFAULT_ReversedPolynomial = 3988292384;
@@ -6726,11 +6963,11 @@ var SANDBOX_REGEX = /(https):\/\/\d+\-\d+\-\d\-(sandpack\.codesandbox\.io)/g;
6726
6963
  var origin = typeof window !== "undefined" ? window.location.origin : "";
6727
6964
  var [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
6728
6965
  var isInsideSandbox = protocol === "https" && sandboxUrl === "sandpack.codesandbox.io";
6729
- var useLicense = (licenseKey) => {
6730
- const valid = (0, import_react42.useMemo)(() => {
6966
+ var useLicense = (licenseKey = "") => {
6967
+ const valid = (0, import_react43.useMemo)(() => {
6731
6968
  let valid2 = isValidLicense(licenseKey, {
6732
6969
  publishedAt: 1624970570587,
6733
- version: "0.0.4"
6970
+ version: "0.0.8"
6734
6971
  });
6735
6972
  if (!licenseKey && !valid2 && isInsideSandbox) {
6736
6973
  return true;
@@ -6742,8 +6979,8 @@ var useLicense = (licenseKey) => {
6742
6979
 
6743
6980
  // src/components/CSSVariableWatch.tsx
6744
6981
  var React34 = __toModule(require("react"));
6745
- var import_react43 = __toModule(require("react"));
6746
- var error2 = err("CSSVariableWatch");
6982
+ var import_react44 = __toModule(require("react"));
6983
+ var error = err("CSSVariableWatch");
6747
6984
  var debug5 = dbg("CSSVariableWatch");
6748
6985
  var WRAPPER_STYLE = {
6749
6986
  position: "absolute",
@@ -6755,7 +6992,7 @@ var WRAPPER_STYLE = {
6755
6992
  overflow: "hidden"
6756
6993
  };
6757
6994
  var useCSSVariableWatch = (params) => {
6758
- const lastValueRef = (0, import_react43.useRef)(0);
6995
+ const lastValueRef = (0, import_react44.useRef)(0);
6759
6996
  const onResize = React34.useCallback(({ height }) => {
6760
6997
  if (height && height !== lastValueRef.current) {
6761
6998
  lastValueRef.current = height;
@@ -6770,12 +7007,12 @@ var useCSSVariableWatch = (params) => {
6770
7007
  debug5(`Variable ${params.varName} found and equals ${value}.`);
6771
7008
  params.onChange(value);
6772
7009
  } else {
6773
- error2(`Specified variable ${params.varName} not found or does not have a numeric value.`);
7010
+ error(`Specified variable ${params.varName} not found or does not have a numeric value.`);
6774
7011
  }
6775
7012
  }, []);
6776
7013
  };
6777
7014
  var CSSVariableWatch = (props) => {
6778
- const domRef = (0, import_react43.useRef)(null);
7015
+ const domRef = (0, import_react44.useRef)(null);
6779
7016
  useCSSVariableWatch(__spreadProps(__spreadValues({}, props), {
6780
7017
  ref: domRef
6781
7018
  }));