@infinite-table/infinite-react 0.3.8 → 0.3.11

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.
Files changed (4) hide show
  1. package/index.d.ts +8 -266
  2. package/index.esm.js +103 -40
  3. package/index.js +103 -40
  4. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -672,7 +672,7 @@ var Logger = class {
672
672
  constructor(channelName) {
673
673
  this.debug = emptyLogFn;
674
674
  this.error = emptyLogFn;
675
- if (true) {
675
+ if (false) {
676
676
  this.debug = dbg(channelName);
677
677
  this.error = err(channelName);
678
678
  }
@@ -892,8 +892,8 @@ function SpacePlaceholderFn(props) {
892
892
  };
893
893
  return /* @__PURE__ */ createElement3("div", {
894
894
  "data-count": count,
895
- "data-placeholder-width": true ? width : void 0,
896
- "data-placeholder-height": true ? height : void 0,
895
+ "data-placeholder-width": false ? width : void 0,
896
+ "data-placeholder-height": false ? height : void 0,
897
897
  "data-name": "SpacePlaceholder",
898
898
  style
899
899
  });
@@ -1174,7 +1174,7 @@ var MatrixBrain = class extends Logger {
1174
1174
  if (colWidthDefined) {
1175
1175
  this.colWidth = colWidth;
1176
1176
  }
1177
- if (true) {
1177
+ if (false) {
1178
1178
  if (widthChanged) {
1179
1179
  this.debug("New available width %d (size is %d,%d)", this.width, this.width, this.height);
1180
1180
  }
@@ -1254,12 +1254,18 @@ var MatrixBrain = class extends Logger {
1254
1254
  }
1255
1255
  };
1256
1256
  this.notifyScrollStart = () => {
1257
+ if (this.destroyed) {
1258
+ return;
1259
+ }
1257
1260
  const fns = this.onScrollStartFns;
1258
1261
  for (let i = 0, len = fns.length; i < len; i++) {
1259
1262
  fns[i]();
1260
1263
  }
1261
1264
  };
1262
1265
  this.notifyScrollStop = () => {
1266
+ if (this.destroyed) {
1267
+ return;
1268
+ }
1263
1269
  const fns = this.onScrollStopFns;
1264
1270
  const scrollPos = this.scrollPosition;
1265
1271
  const range = this.getRenderRange();
@@ -1282,37 +1288,61 @@ var MatrixBrain = class extends Logger {
1282
1288
  }
1283
1289
  };
1284
1290
  this.notifyAvailableSizeChange = () => {
1291
+ if (this.destroyed) {
1292
+ return;
1293
+ }
1285
1294
  const fns = this.onAvailableSizeChangeFns;
1286
1295
  const range = this.getAvailableSize();
1287
1296
  for (let i = 0, len = fns.length; i < len; i++) {
1288
1297
  raf2(() => {
1298
+ if (this.destroyed) {
1299
+ return;
1300
+ }
1289
1301
  fns[i](range);
1290
1302
  });
1291
1303
  }
1292
1304
  };
1293
1305
  this.notifyRenderRangeChange = () => {
1306
+ if (this.destroyed) {
1307
+ return;
1308
+ }
1294
1309
  const fns = this.onRenderRangeChangeFns;
1295
1310
  const range = this.getRenderRange();
1296
1311
  for (let i = 0, len = fns.length; i < len; i++) {
1297
1312
  raf2(() => {
1313
+ if (this.destroyed) {
1314
+ return;
1315
+ }
1298
1316
  fns[i](range);
1299
1317
  });
1300
1318
  }
1301
1319
  };
1302
1320
  this.notifyVerticalRenderRangeChange = () => {
1321
+ if (this.destroyed) {
1322
+ return;
1323
+ }
1303
1324
  const fns = this.onVerticalRenderRangeChangeFns;
1304
1325
  const range = this.verticalRenderRange;
1305
1326
  for (let i = 0, len = fns.length; i < len; i++) {
1306
1327
  raf2(() => {
1328
+ if (this.destroyed) {
1329
+ return;
1330
+ }
1307
1331
  fns[i]([range.startIndex, range.endIndex]);
1308
1332
  });
1309
1333
  }
1310
1334
  };
1311
1335
  this.notifyHorizontalRenderRangeChange = () => {
1336
+ if (this.destroyed) {
1337
+ return;
1338
+ }
1312
1339
  const fns = this.onHorizontalRenderRangeChangeFns;
1313
1340
  const range = this.horizontalRenderRange;
1314
1341
  for (let i = 0, len = fns.length; i < len; i++) {
1315
1342
  raf2(() => {
1343
+ if (this.destroyed) {
1344
+ return;
1345
+ }
1316
1346
  fns[i]([range.startIndex, range.endIndex]);
1317
1347
  });
1318
1348
  }
@@ -1668,7 +1698,7 @@ var MatrixBrain = class extends Logger {
1668
1698
  if (cache[i] === void 0) {
1669
1699
  cell[direction === "horizontal" ? "colIndex" : "rowIndex"] = i;
1670
1700
  let spanValue = itemSpan(cell);
1671
- if (spanValue < 1) {
1701
+ if (false) {
1672
1702
  this.debug(`${direction === "horizontal" ? "colspan" : "rowspan"} cannot be less than 1 - got %d for index %d`, spanValue, i);
1673
1703
  }
1674
1704
  cache[i] = i;
@@ -1971,7 +2001,7 @@ var MatrixBrain = class extends Logger {
1971
2001
  }
1972
2002
  this.width = width;
1973
2003
  this.height = height;
1974
- if (true) {
2004
+ if (false) {
1975
2005
  this.debug("New available size: width %d, height %d", this.width, this.height);
1976
2006
  }
1977
2007
  this.notifyAvailableSizeChange();
@@ -1989,6 +2019,9 @@ var MatrixBrain = class extends Logger {
1989
2019
  return totalSize.width - this.width;
1990
2020
  }
1991
2021
  notifyScrollChange() {
2022
+ if (this.destroyed) {
2023
+ return;
2024
+ }
1992
2025
  const { scrollPosition } = this;
1993
2026
  const fns = this.onScrollFns;
1994
2027
  for (let i = 0, len = fns.length; i < len; i++) {
@@ -2005,6 +2038,9 @@ var MatrixBrain = class extends Logger {
2005
2038
  return direction === "horizontal" ? this.getFixedEndColsWidth() : this.getFixedEndRowsHeight();
2006
2039
  }
2007
2040
  notifyRenderCountChange() {
2041
+ if (this.destroyed) {
2042
+ return;
2043
+ }
2008
2044
  const { horizontalRenderCount, verticalRenderCount } = this;
2009
2045
  const renderCount = {
2010
2046
  horizontal: horizontalRenderCount,
@@ -2013,6 +2049,9 @@ var MatrixBrain = class extends Logger {
2013
2049
  const fns = this.onRenderCountChangeFns;
2014
2050
  for (let i = 0, len = fns.length; i < len; i++) {
2015
2051
  raf2(() => {
2052
+ if (this.destroyed) {
2053
+ return;
2054
+ }
2016
2055
  fns[i](renderCount);
2017
2056
  });
2018
2057
  }
@@ -2438,7 +2477,7 @@ var MappedCells = class extends Logger {
2438
2477
  return elementIndex != null ? elementIndex : null;
2439
2478
  };
2440
2479
  this.renderCellAtElement = (rowIndex, colIndex, elementIndex, renderNode) => {
2441
- if (true) {
2480
+ if (false) {
2442
2481
  this.debug(`Render cell ${rowIndex},${colIndex} at element ${elementIndex}`);
2443
2482
  }
2444
2483
  const key = [rowIndex, colIndex];
@@ -2704,7 +2743,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
2704
2743
  return [];
2705
2744
  }
2706
2745
  const { start, end } = range;
2707
- if (true) {
2746
+ if (false) {
2708
2747
  this.debug(`Render range ${start}-${end}. Force ${force}`);
2709
2748
  }
2710
2749
  const { mappedCells } = this;
@@ -2723,7 +2762,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
2723
2762
  if (this.updaters[elementIndex]) {
2724
2763
  this.updaters[elementIndex].destroy();
2725
2764
  }
2726
- if (true) {
2765
+ if (false) {
2727
2766
  this.debug(`Discard element ${elementIndex}`);
2728
2767
  }
2729
2768
  });
@@ -2775,7 +2814,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
2775
2814
  }
2776
2815
  const elementIndex = cellRendered ? mappedCells.getElementIndexForCell(row, col) : mappedCells.getElementFromListForColumn(elementsOutsideItemRange, col);
2777
2816
  if (elementIndex == null) {
2778
- if (true) {
2817
+ if (false) {
2779
2818
  this.error(`Cannot find element to render cell ${row}:${col}`);
2780
2819
  }
2781
2820
  continue;
@@ -2794,7 +2833,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
2794
2833
  }
2795
2834
  const elementIndex = elementsOutsideItemRange.pop();
2796
2835
  if (elementIndex == null) {
2797
- if (true) {
2836
+ if (false) {
2798
2837
  this.error(`Cannot find element to render cell ${rowIndex}-${colIndex}`);
2799
2838
  }
2800
2839
  return;
@@ -2993,7 +3032,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
2993
3032
  const itemElement = this.itemDOMElements[elementIndex];
2994
3033
  const cell = this.mappedCells.getRenderedCellAtElement(elementIndex);
2995
3034
  if (cell == null) {
2996
- if (true) {
3035
+ if (false) {
2997
3036
  this.error(`Cannot find item for element ${elementIndex}`);
2998
3037
  }
2999
3038
  return;
@@ -3006,7 +3045,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
3006
3045
  const { x, y } = itemPosition;
3007
3046
  if (itemElement) {
3008
3047
  this.updateHoverClassNamesForRow(rowIndex);
3009
- if (true) {
3048
+ if (false) {
3010
3049
  itemElement.dataset.rowIndex = rowIndex;
3011
3050
  itemElement.dataset.colIndex = colIndex;
3012
3051
  }
@@ -3015,7 +3054,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
3015
3054
  itemElement.style.willChange = "transform";
3016
3055
  itemElement.style.backfaceVisibility = "hidden";
3017
3056
  const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
3018
- itemElement.style.zIndex = hidden ? "-1" : "auto";
3057
+ itemElement.style.zIndex = hidden ? "-1" : itemElement.dataset.zIndex || "auto";
3019
3058
  } else {
3020
3059
  itemElement.style.display = "";
3021
3060
  itemElement.style.left = `${x}px`;
@@ -3074,19 +3113,19 @@ var ReactHeadlessTableRenderer = class extends Logger {
3074
3113
  node.style.transform = `translate3d(${coords.x}px, ${fixedEndRowsOffsets[rowIndex]}px, 0)`;
3075
3114
  }
3076
3115
  function adjustColStartRowStart(_rowIndex, _colIndex, node, { x, y }, scrollPosition2) {
3077
- node.style.zIndex = `10000`;
3116
+ node.style.zIndex = `1000000`;
3078
3117
  node.style.transform = `translate3d(${x + scrollPosition2.scrollLeft}px, ${y + scrollPosition2.scrollTop}px, 0)`;
3079
3118
  }
3080
3119
  function adjustColStartRowEnd(_rowIndex, _colIndex, node, { x }, scrollPosition2) {
3081
- node.style.zIndex = `20000`;
3120
+ node.style.zIndex = `2000000`;
3082
3121
  node.style.transform = `translate3d(${x + scrollPosition2.scrollLeft}px, ${fixedEndRowsOffsets[_rowIndex]}px, 0)`;
3083
3122
  }
3084
3123
  function adjustColEndRowStart(_rowIndex, colIndex, node, coords) {
3085
- node.style.zIndex = `30000`;
3124
+ node.style.zIndex = `3000000`;
3086
3125
  node.style.transform = `translate3d(${fixedEndColsOffsets[colIndex]}px, ${coords.y + scrollPosition.scrollTop}px, 0)`;
3087
3126
  }
3088
3127
  function adjustColEndRowEnd(rowIndex, colIndex, node) {
3089
- node.style.zIndex = `40000`;
3128
+ node.style.zIndex = `4000000`;
3090
3129
  node.style.transform = `translate3d(${fixedEndColsOffsets[colIndex]}px, ${fixedEndRowsOffsets[rowIndex]}px, 0)`;
3091
3130
  }
3092
3131
  if (fixedColsStart || fixedColsEnd) {
@@ -3230,7 +3269,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
3230
3269
  return;
3231
3270
  }
3232
3271
  this.mappedCells.renderCellAtElement(rowIndex, colIndex, elementIndex, renderedNode);
3233
- if (true) {
3272
+ if (false) {
3234
3273
  this.debug(`Render cell ${rowIndex},${colIndex} at element ${elementIndex}`);
3235
3274
  }
3236
3275
  itemUpdater(renderedNode);
@@ -4524,7 +4563,11 @@ function InfiniteTableHeaderCell(props) {
4524
4563
  };
4525
4564
  const domRef = useRef12(null);
4526
4565
  const {
4527
- computed: { computedRemainingSpace, showColumnFilters },
4566
+ computed: {
4567
+ computedRemainingSpace,
4568
+ showColumnFilters,
4569
+ computedVisibleColumns
4570
+ },
4528
4571
  componentState: { portalDOMRef, columnHeaderHeight, filterEditors }
4529
4572
  } = useInfiniteTable();
4530
4573
  const {
@@ -4631,6 +4674,7 @@ function InfiniteTableHeaderCell(props) {
4631
4674
  ]);
4632
4675
  const filterType = column.computedFilterType;
4633
4676
  const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
4677
+ const resizeHandle = null;
4634
4678
  return /* @__PURE__ */ createElement15(ContextProvider, {
4635
4679
  value: renderParam
4636
4680
  }, /* @__PURE__ */ createElement15(InfiniteTableCell, {
@@ -4639,6 +4683,7 @@ function InfiniteTableHeaderCell(props) {
4639
4683
  column,
4640
4684
  "data-name": `HeaderCell`,
4641
4685
  "data-column-id": column.id,
4686
+ "data-z-index": computedVisibleColumns.length * 10 - column.computedVisibleIndex * 10,
4642
4687
  style,
4643
4688
  width,
4644
4689
  onPointerDown,
@@ -4647,7 +4692,7 @@ function InfiniteTableHeaderCell(props) {
4647
4692
  contentStyle: showColumnFilters ? { height: height / 2 } : void 0,
4648
4693
  className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, { dragging, zebra: false, rowActive: false }), CellCls),
4649
4694
  cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
4650
- afterChildren: showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ createElement15(InfiniteTableColumnHeaderFilter, {
4695
+ afterChildren: /* @__PURE__ */ createElement15(Fragment2, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ createElement15(InfiniteTableColumnHeaderFilter, {
4651
4696
  filterEditor: FilterEditor,
4652
4697
  filterTypes,
4653
4698
  onChange: debouncedOnFilterValueChange,
@@ -4655,7 +4700,7 @@ function InfiniteTableHeaderCell(props) {
4655
4700
  columnLabel: column.field || column.name || column.id,
4656
4701
  columnFilterValue: column.computedFilterValue,
4657
4702
  columnHeaderHeight
4658
- }) : /* @__PURE__ */ createElement15(InfiniteTableColumnHeaderFilterEmpty, null) : null,
4703
+ }) : /* @__PURE__ */ createElement15(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
4659
4704
  renderChildren
4660
4705
  }), draggingProxy);
4661
4706
  }
@@ -5029,9 +5074,8 @@ function decamelize(str, options) {
5029
5074
  }
5030
5075
 
5031
5076
  // src/components/InfiniteTable/theme.css.ts
5032
- var DarkTheme = { "var(--infinite-background)": "#101419", "var(--infinite-cell-border)": "1px solid #2a323d", "var(--infinite-header-color)": "#c3c3c3", "var(--infinite-header-cell-background)": "#1b2129", "var(--infinite-header-background)": "var(--infinite-header-cell-background)", "var(--infinite-row-hover-background)": "#3b4754", "var(--infinite-row-background)": "var(--infinite-background)", "var(--infinite-row-odd-background)": "#242a31", "var(--infinite-cell-color)": "#c3c3c3" };
5033
- var LightTheme = { "var(--infinite-space-0)": "0rem", "var(--infinite-space-1)": "0.125rem", "var(--infinite-space-2)": "0.25rem", "var(--infinite-space-3)": "0.5rem", "var(--infinite-space-4)": "0.75rem", "var(--infinite-space-5)": "1rem", "var(--infinite-space-6)": "1.25rem", "var(--infinite-space-7)": "1.5rem", "var(--infinite-space-8)": "2.25rem", "var(--infinite-space-9)": "3rem", "var(--infinite-space-10)": "4rem", "var(--infinite-font-size-0)": "0.5rem", "var(--infinite-font-size-1)": "0.625rem", "var(--infinite-font-size-2)": "0.75rem", "var(--infinite-font-size-3)": "0.875rem", "var(--infinite-font-size-4)": "1rem", "var(--infinite-font-size-5)": "1.25rem", "var(--infinite-font-size-6)": "1.5rem", "var(--infinite-font-size-7)": "2.25rem", "var(--infinite-font-family)": "inherit", "var(--infinite-color)": "#484848", "var(--infinite-accent-color)": "#ff7043", "var(--infinite-border-radius)": "var(--infinite-space-2)", "var(--infinite-background)": "white", "var(--infinite-min-height)": "100px", "var(--infinite-load-mask-text-background)": "rgba(255,255,255,0.8)", "var(--infinite-load-mask-overlay-background)": "gray", "var(--infinite-load-mask-overlay-opacity)": "0.3", "var(--infinite-load-mask-color)": "inherit", "var(--infinite-load-mask-padding)": "var(--infinite-space-5)", "var(--infinite-load-mask-border-radius)": "var(--infinite-border-radius)", "var(--infinite-header-cell-background)": "#ededed", "var(--infinite-header-cell-padding-x)": "var(--infinite-space-3)", "var(--infinite-header-cell-padding-y)": "var(--infinite-space-3)", "var(--infinite-header-cell-padding)": "var(--infinite-header-cell-padding-y) var(--infinite-header-cell-padding-x) ", "var(--infinite-header-cell-dragging-background)": "#d4d3d3", "var(--infinite-header-cell-icon-size)": "16px", "var(--infinite-header-cell-sort-icon-margin)": "16px", "var(--infinite-header-background)": "var(--infinite-header-cell-background)", "var(--infinite-header-color)": "#6f6f6f", "var(--infinite-column-header-height)": "30px", "var(--infinite-cell-color)": "currentColor", "var(--infinite-cell-border-width)": "1px", "var(--infinite-cell-padding)": "var(--infinite-space-2) var(--infinite-space-3)", "var(--infinite-cell-border)": "var(--infinite-cell-border-width) solid #c6c6c6", "var(--infinite-cell-border-invisible)": "none", "var(--infinite-cell-border-radius)": "var(--infinite-space-2)", "var(--infinite-active-cell-border-style)": "dashed", "var(--infinite-active-cell-border-width)": "1px", "var(--infinite-active-cell-border-color--r)": "77", "var(--infinite-active-cell-border-color--g)": "149", "var(--infinite-active-cell-border-color--b)": "215", "var(--infinite-active-cell-background-alpha)": "0.25", "var(--infinite-active-cell-background-alpha--table-unfocused)": "0.1", "var(--infinite-row-background)": "var(--infinite-background)", "var(--infinite-row-odd-background)": "#f6f6f6", "var(--infinite-group-row-background)": "#cbc5c5", "var(--infinite-group-row-column-nesting)": "30px", "var(--infinite-row-hover-background)": "#dbdbdb", "var(--infinite-row-pointer-events-while-scrolling)": "auto" };
5034
5077
  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)" } } };
5078
+ var columnHeaderHeightName = "column-header-height";
5035
5079
 
5036
5080
  // src/components/InfiniteTable/InfiniteCls.css.ts
5037
5081
  var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
@@ -5717,7 +5761,7 @@ function computeColumnGroupsDepths(columnGroups) {
5717
5761
  while (parentGroupId) {
5718
5762
  const parent = columnGroups.get(parentGroupId);
5719
5763
  if (!parent) {
5720
- if (true) {
5764
+ if (false) {
5721
5765
  console.warn(`Cannot find column group ${parentGroupId}`);
5722
5766
  }
5723
5767
  break;
@@ -5834,7 +5878,7 @@ var debug4 = dbg("useColumnSizeFn");
5834
5878
  function useColumnSizeFn(columns) {
5835
5879
  const columnSize = useCallback13((index) => {
5836
5880
  const column = columns[index];
5837
- if (!column) {
5881
+ if (false) {
5838
5882
  debug4("cannot find column at index", index, columns);
5839
5883
  }
5840
5884
  return column ? column.computedWidth : 0;
@@ -7951,7 +7995,7 @@ function concludeReducer(params) {
7951
7995
  }
7952
7996
  state.dataArray = rowInfoDataArray;
7953
7997
  state.reducedAt = now;
7954
- if (true) {
7998
+ if (false) {
7955
7999
  globalThis.state = state;
7956
8000
  }
7957
8001
  return state;
@@ -7989,7 +8033,7 @@ function DataSourceCmp({ children }) {
7989
8033
  componentActions,
7990
8034
  getState
7991
8035
  };
7992
- if (true) {
8036
+ if (false) {
7993
8037
  globalThis.getDataSourceState = getState;
7994
8038
  }
7995
8039
  useLoadData();
@@ -8440,10 +8484,14 @@ var computeFlex = (params) => {
8440
8484
  let totalFixedSize = 0;
8441
8485
  let totalFlex = 0;
8442
8486
  let totalFlexCount = 0;
8487
+ const minSizes = [];
8488
+ const maxSizes = [];
8443
8489
  items.forEach((item, i) => {
8444
8490
  var _a, _b, _c, _d, _e, _f;
8445
8491
  let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
8446
8492
  let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
8493
+ minSizes.push(minSize);
8494
+ maxSizes.push(maxSize);
8447
8495
  if (item.size != null) {
8448
8496
  if (maxSize != null && item.size > maxSize) {
8449
8497
  item.size = maxSize;
@@ -8553,6 +8601,8 @@ var computeFlex = (params) => {
8553
8601
  return {
8554
8602
  items: resultItems,
8555
8603
  flexSizes,
8604
+ minSizes,
8605
+ maxSizes,
8556
8606
  computedSizes,
8557
8607
  remainingSize: Math.round(availableSize - totalTakenSize)
8558
8608
  };
@@ -8625,6 +8675,7 @@ var getComputedVisibleColumns = ({
8625
8675
  setSortInfo,
8626
8676
  multiSort,
8627
8677
  viewportReservedWidth,
8678
+ resizableColumns,
8628
8679
  draggableColumns,
8629
8680
  columnOrder,
8630
8681
  columnPinning,
@@ -8709,7 +8760,7 @@ var getComputedVisibleColumns = ({
8709
8760
  };
8710
8761
  })
8711
8762
  });
8712
- const { computedSizes } = flexResult;
8763
+ const { computedSizes, flexSizes, minSizes, maxSizes } = flexResult;
8713
8764
  const computedPinnedStartColumns = [];
8714
8765
  const computedPinnedEndColumns = [];
8715
8766
  const computedUnpinnedColumns = [];
@@ -8737,7 +8788,7 @@ var getComputedVisibleColumns = ({
8737
8788
  });
8738
8789
  const firstPinnedEndAbsoluteOffset = bodySize.width - totalPinnedEndWidth;
8739
8790
  columnsArray.forEach((c, i) => {
8740
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
8791
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
8741
8792
  const id = visibleColumnOrder[i];
8742
8793
  const nextColumnId = visibleColumnOrder[i + 1];
8743
8794
  const colType = getColumnComputedType(c, columnTypes);
@@ -8748,6 +8799,9 @@ var getComputedVisibleColumns = ({
8748
8799
  const computedSortedDesc = computedSorted && !computedSortedAsc;
8749
8800
  const computedSortIndex = (_c = sortingInfo == null ? void 0 : sortingInfo.index) != null ? _c : -1;
8750
8801
  const computedWidth = computedSizes[i];
8802
+ const computedFlex = flexSizes[i] || null;
8803
+ const computedMinWidth = minSizes[i] || null;
8804
+ const computedMaxWidth = maxSizes[i] || null;
8751
8805
  const computedPinned = getComputedPinned(id, columnPinning);
8752
8806
  const computedLast = i === visibleColumnOrder.length - 1;
8753
8807
  const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
@@ -8781,8 +8835,13 @@ var getComputedVisibleColumns = ({
8781
8835
  render: colType.render,
8782
8836
  style: colType.style,
8783
8837
  components: colType.components,
8838
+ columnGroup: colType.columnGroup,
8784
8839
  field
8785
8840
  }, c), {
8841
+ computedResizable: (_s = (_r = (_q = c.resizable) != null ? _q : colType.resizable) != null ? _r : resizableColumns) != null ? _s : true,
8842
+ computedMinWidth,
8843
+ computedMaxWidth,
8844
+ computedFlex,
8786
8845
  computedDataType,
8787
8846
  computedSortType,
8788
8847
  computedFilterType,
@@ -8804,7 +8863,7 @@ var getComputedVisibleColumns = ({
8804
8863
  computedSortedDesc,
8805
8864
  computedVisibleIndex: i,
8806
8865
  computedPinned,
8807
- computedDraggable: (_r = (_q = c.draggable) != null ? _q : draggableColumns) != null ? _r : true,
8866
+ computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
8808
8867
  computedFirstInCategory,
8809
8868
  computedLastInCategory,
8810
8869
  computedFirst: i === 0,
@@ -8854,7 +8913,7 @@ var getComputedVisibleColumns = ({
8854
8913
  setSortInfo(finalSortInfo);
8855
8914
  },
8856
8915
  id,
8857
- header: (_u = (_t = (_s = c.header) != null ? _s : colType.header) != null ? _t : c.name) != null ? _u : c.field
8916
+ header: (_x = (_w = (_v = c.header) != null ? _v : colType.header) != null ? _w : c.name) != null ? _x : c.field
8858
8917
  });
8859
8918
  computedOffset += computedWidth;
8860
8919
  computedVisibleColumnsMap.set(result2.id, result2);
@@ -8930,6 +8989,7 @@ var useComputedVisibleColumns = ({
8930
8989
  pinnedEndMaxWidth,
8931
8990
  pinnedStartMaxWidth,
8932
8991
  viewportReservedWidth,
8992
+ resizableColumns,
8933
8993
  columnVisibility,
8934
8994
  columnVisibilityAssumeVisible,
8935
8995
  columnSizing
@@ -8961,6 +9021,7 @@ var useComputedVisibleColumns = ({
8961
9021
  columnCssEllipsis,
8962
9022
  columnHeaderCssEllipsis,
8963
9023
  viewportReservedWidth,
9024
+ resizableColumns,
8964
9025
  filterValue,
8965
9026
  sortable,
8966
9027
  sortInfo,
@@ -9118,6 +9179,7 @@ function useComputed() {
9118
9179
  pinnedEndMaxWidth: componentState.pinnedEndMaxWidth,
9119
9180
  bodySize,
9120
9181
  viewportReservedWidth: componentState.viewportReservedWidth,
9182
+ resizableColumns: componentState.resizableColumns,
9121
9183
  sortable: componentState.sortable,
9122
9184
  draggableColumns: componentState.draggableColumns,
9123
9185
  sortInfo: (_a = dataSourceState.sortInfo) != null ? _a : void 0,
@@ -9406,7 +9468,7 @@ var useLicense = (licenseKey = "") => {
9406
9468
  const valid = useMemo12(() => {
9407
9469
  let valid2 = isValidLicense(licenseKey, {
9408
9470
  publishedAt: 1624970570587,
9409
- version: "0.3.8"
9471
+ version: "0.3.11"
9410
9472
  });
9411
9473
  if (!licenseKey && !valid2 && isInsidePlayground) {
9412
9474
  return true;
@@ -9629,14 +9691,14 @@ function initSetupState2() {
9629
9691
  scrollTop: 0
9630
9692
  });
9631
9693
  });
9632
- if (true) {
9694
+ if (false) {
9633
9695
  globalThis.brain = brain;
9634
9696
  }
9635
9697
  const { renderer, onRenderUpdater } = createRenderer2(brain);
9636
9698
  brain.onAvailableSizeChange((size) => {
9637
9699
  headerBrain.setAvailableSize({ width: size.width });
9638
9700
  });
9639
- if (true) {
9701
+ if (false) {
9640
9702
  globalThis.renderer = renderer;
9641
9703
  }
9642
9704
  return {
@@ -9702,6 +9764,7 @@ var forwardProps3 = (setupState) => {
9702
9764
  scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
9703
9765
  filterEditors: (filterEditors) => __spreadValues(__spreadValues({}, defaultFilterEditors), filterEditors),
9704
9766
  viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
9767
+ resizableColumns: (resizableColumns) => resizableColumns != null ? resizableColumns : true,
9705
9768
  columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
9706
9769
  columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 2e3,
9707
9770
  columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
@@ -9775,6 +9838,9 @@ var mapPropsToState2 = (params) => {
9775
9838
  };
9776
9839
  };
9777
9840
 
9841
+ // src/components/InfiniteTable/utils/toCSSVarName.ts
9842
+ var toCSSVarName = (value) => `--infinite-${value}`;
9843
+
9778
9844
  // src/components/InfiniteTable/index.tsx
9779
9845
  var InfiniteTableClassName = internalProps.rootClassName;
9780
9846
  var HOVERED_CLASS_NAMES = [RowHoverCls, "InfiniteColumnCell--hovered"];
@@ -9917,7 +9983,7 @@ function InfiniteTableContextProvider() {
9917
9983
  const computed = useComputed();
9918
9984
  const getComputed = useLatest(computed);
9919
9985
  const getState = useLatest(componentState);
9920
- if (true) {
9986
+ if (false) {
9921
9987
  globalThis.getState = getState;
9922
9988
  globalThis.getComputed = getComputed;
9923
9989
  }
@@ -9959,20 +10025,17 @@ function InfiniteTable(props) {
9959
10025
  }
9960
10026
  InfiniteTable.defaultProps = {
9961
10027
  rowHeight: 40,
9962
- columnHeaderHeight: ThemeVars.components.Header.columnHeaderHeight
10028
+ columnHeaderHeight: toCSSVarName(columnHeaderHeightName)
9963
10029
  };
9964
10030
  export {
9965
- DarkTheme,
9966
10031
  DataSource,
9967
10032
  DataSourceActionType,
9968
10033
  GroupRowsState,
9969
10034
  InfiniteTable,
9970
10035
  InfiniteTableClassName,
9971
10036
  InfiniteTableComponent,
9972
- LightTheme,
9973
10037
  NumberFilterEditor,
9974
10038
  StringFilterEditor,
9975
- ThemeVars,
9976
10039
  debounce,
9977
10040
  defaultFilterEditors,
9978
10041
  defaultFilterTypes,