@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.js CHANGED
@@ -626,17 +626,14 @@ var require_vanilla_extract_recipes_createRuntimeFn_cjs = __commonJS({
626
626
 
627
627
  // src/index.tsx
628
628
  __export(exports, {
629
- DarkTheme: () => DarkTheme,
630
629
  DataSource: () => DataSource,
631
630
  DataSourceActionType: () => DataSourceActionType,
632
631
  GroupRowsState: () => GroupRowsState,
633
632
  InfiniteTable: () => InfiniteTable,
634
633
  InfiniteTableClassName: () => InfiniteTableClassName,
635
634
  InfiniteTableComponent: () => InfiniteTableComponent,
636
- LightTheme: () => LightTheme,
637
635
  NumberFilterEditor: () => NumberFilterEditor,
638
636
  StringFilterEditor: () => StringFilterEditor,
639
- ThemeVars: () => ThemeVars,
640
637
  debounce: () => debounce,
641
638
  defaultFilterEditors: () => defaultFilterEditors,
642
639
  defaultFilterTypes: () => defaultFilterTypes,
@@ -697,7 +694,7 @@ var Logger = class {
697
694
  constructor(channelName) {
698
695
  this.debug = emptyLogFn;
699
696
  this.error = emptyLogFn;
700
- if (true) {
697
+ if (false) {
701
698
  this.debug = dbg(channelName);
702
699
  this.error = err(channelName);
703
700
  }
@@ -895,8 +892,8 @@ function SpacePlaceholderFn(props) {
895
892
  };
896
893
  return /* @__PURE__ */ React5.createElement("div", {
897
894
  "data-count": count,
898
- "data-placeholder-width": true ? width : void 0,
899
- "data-placeholder-height": true ? height : void 0,
895
+ "data-placeholder-width": false ? width : void 0,
896
+ "data-placeholder-height": false ? height : void 0,
900
897
  "data-name": "SpacePlaceholder",
901
898
  style
902
899
  });
@@ -1169,7 +1166,7 @@ var MatrixBrain = class extends Logger {
1169
1166
  if (colWidthDefined) {
1170
1167
  this.colWidth = colWidth;
1171
1168
  }
1172
- if (true) {
1169
+ if (false) {
1173
1170
  if (widthChanged) {
1174
1171
  this.debug("New available width %d (size is %d,%d)", this.width, this.width, this.height);
1175
1172
  }
@@ -1249,12 +1246,18 @@ var MatrixBrain = class extends Logger {
1249
1246
  }
1250
1247
  };
1251
1248
  this.notifyScrollStart = () => {
1249
+ if (this.destroyed) {
1250
+ return;
1251
+ }
1252
1252
  const fns = this.onScrollStartFns;
1253
1253
  for (let i = 0, len = fns.length; i < len; i++) {
1254
1254
  fns[i]();
1255
1255
  }
1256
1256
  };
1257
1257
  this.notifyScrollStop = () => {
1258
+ if (this.destroyed) {
1259
+ return;
1260
+ }
1258
1261
  const fns = this.onScrollStopFns;
1259
1262
  const scrollPos = this.scrollPosition;
1260
1263
  const range = this.getRenderRange();
@@ -1277,37 +1280,61 @@ var MatrixBrain = class extends Logger {
1277
1280
  }
1278
1281
  };
1279
1282
  this.notifyAvailableSizeChange = () => {
1283
+ if (this.destroyed) {
1284
+ return;
1285
+ }
1280
1286
  const fns = this.onAvailableSizeChangeFns;
1281
1287
  const range = this.getAvailableSize();
1282
1288
  for (let i = 0, len = fns.length; i < len; i++) {
1283
1289
  raf2(() => {
1290
+ if (this.destroyed) {
1291
+ return;
1292
+ }
1284
1293
  fns[i](range);
1285
1294
  });
1286
1295
  }
1287
1296
  };
1288
1297
  this.notifyRenderRangeChange = () => {
1298
+ if (this.destroyed) {
1299
+ return;
1300
+ }
1289
1301
  const fns = this.onRenderRangeChangeFns;
1290
1302
  const range = this.getRenderRange();
1291
1303
  for (let i = 0, len = fns.length; i < len; i++) {
1292
1304
  raf2(() => {
1305
+ if (this.destroyed) {
1306
+ return;
1307
+ }
1293
1308
  fns[i](range);
1294
1309
  });
1295
1310
  }
1296
1311
  };
1297
1312
  this.notifyVerticalRenderRangeChange = () => {
1313
+ if (this.destroyed) {
1314
+ return;
1315
+ }
1298
1316
  const fns = this.onVerticalRenderRangeChangeFns;
1299
1317
  const range = this.verticalRenderRange;
1300
1318
  for (let i = 0, len = fns.length; i < len; i++) {
1301
1319
  raf2(() => {
1320
+ if (this.destroyed) {
1321
+ return;
1322
+ }
1302
1323
  fns[i]([range.startIndex, range.endIndex]);
1303
1324
  });
1304
1325
  }
1305
1326
  };
1306
1327
  this.notifyHorizontalRenderRangeChange = () => {
1328
+ if (this.destroyed) {
1329
+ return;
1330
+ }
1307
1331
  const fns = this.onHorizontalRenderRangeChangeFns;
1308
1332
  const range = this.horizontalRenderRange;
1309
1333
  for (let i = 0, len = fns.length; i < len; i++) {
1310
1334
  raf2(() => {
1335
+ if (this.destroyed) {
1336
+ return;
1337
+ }
1311
1338
  fns[i]([range.startIndex, range.endIndex]);
1312
1339
  });
1313
1340
  }
@@ -1663,7 +1690,7 @@ var MatrixBrain = class extends Logger {
1663
1690
  if (cache[i] === void 0) {
1664
1691
  cell[direction === "horizontal" ? "colIndex" : "rowIndex"] = i;
1665
1692
  let spanValue = itemSpan(cell);
1666
- if (spanValue < 1) {
1693
+ if (false) {
1667
1694
  this.debug(`${direction === "horizontal" ? "colspan" : "rowspan"} cannot be less than 1 - got %d for index %d`, spanValue, i);
1668
1695
  }
1669
1696
  cache[i] = i;
@@ -1966,7 +1993,7 @@ var MatrixBrain = class extends Logger {
1966
1993
  }
1967
1994
  this.width = width;
1968
1995
  this.height = height;
1969
- if (true) {
1996
+ if (false) {
1970
1997
  this.debug("New available size: width %d, height %d", this.width, this.height);
1971
1998
  }
1972
1999
  this.notifyAvailableSizeChange();
@@ -1984,6 +2011,9 @@ var MatrixBrain = class extends Logger {
1984
2011
  return totalSize.width - this.width;
1985
2012
  }
1986
2013
  notifyScrollChange() {
2014
+ if (this.destroyed) {
2015
+ return;
2016
+ }
1987
2017
  const { scrollPosition } = this;
1988
2018
  const fns = this.onScrollFns;
1989
2019
  for (let i = 0, len = fns.length; i < len; i++) {
@@ -2000,6 +2030,9 @@ var MatrixBrain = class extends Logger {
2000
2030
  return direction === "horizontal" ? this.getFixedEndColsWidth() : this.getFixedEndRowsHeight();
2001
2031
  }
2002
2032
  notifyRenderCountChange() {
2033
+ if (this.destroyed) {
2034
+ return;
2035
+ }
2003
2036
  const { horizontalRenderCount, verticalRenderCount } = this;
2004
2037
  const renderCount = {
2005
2038
  horizontal: horizontalRenderCount,
@@ -2008,6 +2041,9 @@ var MatrixBrain = class extends Logger {
2008
2041
  const fns = this.onRenderCountChangeFns;
2009
2042
  for (let i = 0, len = fns.length; i < len; i++) {
2010
2043
  raf2(() => {
2044
+ if (this.destroyed) {
2045
+ return;
2046
+ }
2011
2047
  fns[i](renderCount);
2012
2048
  });
2013
2049
  }
@@ -2433,7 +2469,7 @@ var MappedCells = class extends Logger {
2433
2469
  return elementIndex != null ? elementIndex : null;
2434
2470
  };
2435
2471
  this.renderCellAtElement = (rowIndex, colIndex, elementIndex, renderNode) => {
2436
- if (true) {
2472
+ if (false) {
2437
2473
  this.debug(`Render cell ${rowIndex},${colIndex} at element ${elementIndex}`);
2438
2474
  }
2439
2475
  const key = [rowIndex, colIndex];
@@ -2699,7 +2735,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
2699
2735
  return [];
2700
2736
  }
2701
2737
  const { start, end } = range;
2702
- if (true) {
2738
+ if (false) {
2703
2739
  this.debug(`Render range ${start}-${end}. Force ${force}`);
2704
2740
  }
2705
2741
  const { mappedCells } = this;
@@ -2718,7 +2754,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
2718
2754
  if (this.updaters[elementIndex]) {
2719
2755
  this.updaters[elementIndex].destroy();
2720
2756
  }
2721
- if (true) {
2757
+ if (false) {
2722
2758
  this.debug(`Discard element ${elementIndex}`);
2723
2759
  }
2724
2760
  });
@@ -2770,7 +2806,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
2770
2806
  }
2771
2807
  const elementIndex = cellRendered ? mappedCells.getElementIndexForCell(row, col) : mappedCells.getElementFromListForColumn(elementsOutsideItemRange, col);
2772
2808
  if (elementIndex == null) {
2773
- if (true) {
2809
+ if (false) {
2774
2810
  this.error(`Cannot find element to render cell ${row}:${col}`);
2775
2811
  }
2776
2812
  continue;
@@ -2789,7 +2825,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
2789
2825
  }
2790
2826
  const elementIndex = elementsOutsideItemRange.pop();
2791
2827
  if (elementIndex == null) {
2792
- if (true) {
2828
+ if (false) {
2793
2829
  this.error(`Cannot find element to render cell ${rowIndex}-${colIndex}`);
2794
2830
  }
2795
2831
  return;
@@ -2988,7 +3024,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
2988
3024
  const itemElement = this.itemDOMElements[elementIndex];
2989
3025
  const cell = this.mappedCells.getRenderedCellAtElement(elementIndex);
2990
3026
  if (cell == null) {
2991
- if (true) {
3027
+ if (false) {
2992
3028
  this.error(`Cannot find item for element ${elementIndex}`);
2993
3029
  }
2994
3030
  return;
@@ -3001,7 +3037,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
3001
3037
  const { x, y } = itemPosition;
3002
3038
  if (itemElement) {
3003
3039
  this.updateHoverClassNamesForRow(rowIndex);
3004
- if (true) {
3040
+ if (false) {
3005
3041
  itemElement.dataset.rowIndex = rowIndex;
3006
3042
  itemElement.dataset.colIndex = colIndex;
3007
3043
  }
@@ -3010,7 +3046,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
3010
3046
  itemElement.style.willChange = "transform";
3011
3047
  itemElement.style.backfaceVisibility = "hidden";
3012
3048
  const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
3013
- itemElement.style.zIndex = hidden ? "-1" : "auto";
3049
+ itemElement.style.zIndex = hidden ? "-1" : itemElement.dataset.zIndex || "auto";
3014
3050
  } else {
3015
3051
  itemElement.style.display = "";
3016
3052
  itemElement.style.left = `${x}px`;
@@ -3069,19 +3105,19 @@ var ReactHeadlessTableRenderer = class extends Logger {
3069
3105
  node.style.transform = `translate3d(${coords.x}px, ${fixedEndRowsOffsets[rowIndex]}px, 0)`;
3070
3106
  }
3071
3107
  function adjustColStartRowStart(_rowIndex, _colIndex, node, { x, y }, scrollPosition2) {
3072
- node.style.zIndex = `10000`;
3108
+ node.style.zIndex = `1000000`;
3073
3109
  node.style.transform = `translate3d(${x + scrollPosition2.scrollLeft}px, ${y + scrollPosition2.scrollTop}px, 0)`;
3074
3110
  }
3075
3111
  function adjustColStartRowEnd(_rowIndex, _colIndex, node, { x }, scrollPosition2) {
3076
- node.style.zIndex = `20000`;
3112
+ node.style.zIndex = `2000000`;
3077
3113
  node.style.transform = `translate3d(${x + scrollPosition2.scrollLeft}px, ${fixedEndRowsOffsets[_rowIndex]}px, 0)`;
3078
3114
  }
3079
3115
  function adjustColEndRowStart(_rowIndex, colIndex, node, coords) {
3080
- node.style.zIndex = `30000`;
3116
+ node.style.zIndex = `3000000`;
3081
3117
  node.style.transform = `translate3d(${fixedEndColsOffsets[colIndex]}px, ${coords.y + scrollPosition.scrollTop}px, 0)`;
3082
3118
  }
3083
3119
  function adjustColEndRowEnd(rowIndex, colIndex, node) {
3084
- node.style.zIndex = `40000`;
3120
+ node.style.zIndex = `4000000`;
3085
3121
  node.style.transform = `translate3d(${fixedEndColsOffsets[colIndex]}px, ${fixedEndRowsOffsets[rowIndex]}px, 0)`;
3086
3122
  }
3087
3123
  if (fixedColsStart || fixedColsEnd) {
@@ -3225,7 +3261,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
3225
3261
  return;
3226
3262
  }
3227
3263
  this.mappedCells.renderCellAtElement(rowIndex, colIndex, elementIndex, renderedNode);
3228
- if (true) {
3264
+ if (false) {
3229
3265
  this.debug(`Render cell ${rowIndex},${colIndex} at element ${elementIndex}`);
3230
3266
  }
3231
3267
  itemUpdater(renderedNode);
@@ -4478,7 +4514,11 @@ function InfiniteTableHeaderCell(props) {
4478
4514
  };
4479
4515
  const domRef = (0, import_react22.useRef)(null);
4480
4516
  const {
4481
- computed: { computedRemainingSpace, showColumnFilters },
4517
+ computed: {
4518
+ computedRemainingSpace,
4519
+ showColumnFilters,
4520
+ computedVisibleColumns
4521
+ },
4482
4522
  componentState: { portalDOMRef, columnHeaderHeight, filterEditors }
4483
4523
  } = useInfiniteTable();
4484
4524
  const {
@@ -4585,6 +4625,7 @@ function InfiniteTableHeaderCell(props) {
4585
4625
  ]);
4586
4626
  const filterType = column.computedFilterType;
4587
4627
  const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
4628
+ const resizeHandle = null;
4588
4629
  return /* @__PURE__ */ React20.createElement(ContextProvider, {
4589
4630
  value: renderParam
4590
4631
  }, /* @__PURE__ */ React20.createElement(InfiniteTableCell, {
@@ -4593,6 +4634,7 @@ function InfiniteTableHeaderCell(props) {
4593
4634
  column,
4594
4635
  "data-name": `HeaderCell`,
4595
4636
  "data-column-id": column.id,
4637
+ "data-z-index": computedVisibleColumns.length * 10 - column.computedVisibleIndex * 10,
4596
4638
  style,
4597
4639
  width,
4598
4640
  onPointerDown,
@@ -4601,7 +4643,7 @@ function InfiniteTableHeaderCell(props) {
4601
4643
  contentStyle: showColumnFilters ? { height: height / 2 } : void 0,
4602
4644
  className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, { dragging, zebra: false, rowActive: false }), CellCls),
4603
4645
  cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
4604
- afterChildren: showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ React20.createElement(InfiniteTableColumnHeaderFilter, {
4646
+ afterChildren: /* @__PURE__ */ React20.createElement(React20.Fragment, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ React20.createElement(InfiniteTableColumnHeaderFilter, {
4605
4647
  filterEditor: FilterEditor,
4606
4648
  filterTypes,
4607
4649
  onChange: debouncedOnFilterValueChange,
@@ -4609,7 +4651,7 @@ function InfiniteTableHeaderCell(props) {
4609
4651
  columnLabel: column.field || column.name || column.id,
4610
4652
  columnFilterValue: column.computedFilterValue,
4611
4653
  columnHeaderHeight
4612
- }) : /* @__PURE__ */ React20.createElement(InfiniteTableColumnHeaderFilterEmpty, null) : null,
4654
+ }) : /* @__PURE__ */ React20.createElement(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
4613
4655
  renderChildren
4614
4656
  }), draggingProxy);
4615
4657
  }
@@ -4969,9 +5011,8 @@ function decamelize(str, options) {
4969
5011
  }
4970
5012
 
4971
5013
  // src/components/InfiniteTable/theme.css.ts
4972
- 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" };
4973
- 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" };
4974
5014
  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)" } } };
5015
+ var columnHeaderHeightName = "column-header-height";
4975
5016
 
4976
5017
  // src/components/InfiniteTable/InfiniteCls.css.ts
4977
5018
  var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
@@ -5646,7 +5687,7 @@ function computeColumnGroupsDepths(columnGroups) {
5646
5687
  while (parentGroupId) {
5647
5688
  const parent = columnGroups.get(parentGroupId);
5648
5689
  if (!parent) {
5649
- if (true) {
5690
+ if (false) {
5650
5691
  console.warn(`Cannot find column group ${parentGroupId}`);
5651
5692
  }
5652
5693
  break;
@@ -5763,7 +5804,7 @@ var debug4 = dbg("useColumnSizeFn");
5763
5804
  function useColumnSizeFn(columns) {
5764
5805
  const columnSize = (0, import_react32.useCallback)((index) => {
5765
5806
  const column = columns[index];
5766
- if (!column) {
5807
+ if (false) {
5767
5808
  debug4("cannot find column at index", index, columns);
5768
5809
  }
5769
5810
  return column ? column.computedWidth : 0;
@@ -7870,7 +7911,7 @@ function concludeReducer(params) {
7870
7911
  }
7871
7912
  state.dataArray = rowInfoDataArray;
7872
7913
  state.reducedAt = now;
7873
- if (true) {
7914
+ if (false) {
7874
7915
  globalThis.state = state;
7875
7916
  }
7876
7917
  return state;
@@ -7908,7 +7949,7 @@ function DataSourceCmp({ children }) {
7908
7949
  componentActions,
7909
7950
  getState
7910
7951
  };
7911
- if (true) {
7952
+ if (false) {
7912
7953
  globalThis.getDataSourceState = getState;
7913
7954
  }
7914
7955
  useLoadData();
@@ -8359,10 +8400,14 @@ var computeFlex = (params) => {
8359
8400
  let totalFixedSize = 0;
8360
8401
  let totalFlex = 0;
8361
8402
  let totalFlexCount = 0;
8403
+ const minSizes = [];
8404
+ const maxSizes = [];
8362
8405
  items.forEach((item, i) => {
8363
8406
  var _a, _b, _c, _d, _e, _f;
8364
8407
  let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
8365
8408
  let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
8409
+ minSizes.push(minSize);
8410
+ maxSizes.push(maxSize);
8366
8411
  if (item.size != null) {
8367
8412
  if (maxSize != null && item.size > maxSize) {
8368
8413
  item.size = maxSize;
@@ -8472,6 +8517,8 @@ var computeFlex = (params) => {
8472
8517
  return {
8473
8518
  items: resultItems,
8474
8519
  flexSizes,
8520
+ minSizes,
8521
+ maxSizes,
8475
8522
  computedSizes,
8476
8523
  remainingSize: Math.round(availableSize - totalTakenSize)
8477
8524
  };
@@ -8544,6 +8591,7 @@ var getComputedVisibleColumns = ({
8544
8591
  setSortInfo,
8545
8592
  multiSort,
8546
8593
  viewportReservedWidth,
8594
+ resizableColumns,
8547
8595
  draggableColumns,
8548
8596
  columnOrder,
8549
8597
  columnPinning,
@@ -8628,7 +8676,7 @@ var getComputedVisibleColumns = ({
8628
8676
  };
8629
8677
  })
8630
8678
  });
8631
- const { computedSizes } = flexResult;
8679
+ const { computedSizes, flexSizes, minSizes, maxSizes } = flexResult;
8632
8680
  const computedPinnedStartColumns = [];
8633
8681
  const computedPinnedEndColumns = [];
8634
8682
  const computedUnpinnedColumns = [];
@@ -8656,7 +8704,7 @@ var getComputedVisibleColumns = ({
8656
8704
  });
8657
8705
  const firstPinnedEndAbsoluteOffset = bodySize.width - totalPinnedEndWidth;
8658
8706
  columnsArray.forEach((c, i) => {
8659
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
8707
+ 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;
8660
8708
  const id = visibleColumnOrder[i];
8661
8709
  const nextColumnId = visibleColumnOrder[i + 1];
8662
8710
  const colType = getColumnComputedType(c, columnTypes);
@@ -8667,6 +8715,9 @@ var getComputedVisibleColumns = ({
8667
8715
  const computedSortedDesc = computedSorted && !computedSortedAsc;
8668
8716
  const computedSortIndex = (_c = sortingInfo == null ? void 0 : sortingInfo.index) != null ? _c : -1;
8669
8717
  const computedWidth = computedSizes[i];
8718
+ const computedFlex = flexSizes[i] || null;
8719
+ const computedMinWidth = minSizes[i] || null;
8720
+ const computedMaxWidth = maxSizes[i] || null;
8670
8721
  const computedPinned = getComputedPinned(id, columnPinning);
8671
8722
  const computedLast = i === visibleColumnOrder.length - 1;
8672
8723
  const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
@@ -8700,8 +8751,13 @@ var getComputedVisibleColumns = ({
8700
8751
  render: colType.render,
8701
8752
  style: colType.style,
8702
8753
  components: colType.components,
8754
+ columnGroup: colType.columnGroup,
8703
8755
  field
8704
8756
  }, c), {
8757
+ computedResizable: (_s = (_r = (_q = c.resizable) != null ? _q : colType.resizable) != null ? _r : resizableColumns) != null ? _s : true,
8758
+ computedMinWidth,
8759
+ computedMaxWidth,
8760
+ computedFlex,
8705
8761
  computedDataType,
8706
8762
  computedSortType,
8707
8763
  computedFilterType,
@@ -8723,7 +8779,7 @@ var getComputedVisibleColumns = ({
8723
8779
  computedSortedDesc,
8724
8780
  computedVisibleIndex: i,
8725
8781
  computedPinned,
8726
- computedDraggable: (_r = (_q = c.draggable) != null ? _q : draggableColumns) != null ? _r : true,
8782
+ computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
8727
8783
  computedFirstInCategory,
8728
8784
  computedLastInCategory,
8729
8785
  computedFirst: i === 0,
@@ -8773,7 +8829,7 @@ var getComputedVisibleColumns = ({
8773
8829
  setSortInfo(finalSortInfo);
8774
8830
  },
8775
8831
  id,
8776
- header: (_u = (_t = (_s = c.header) != null ? _s : colType.header) != null ? _t : c.name) != null ? _u : c.field
8832
+ header: (_x = (_w = (_v = c.header) != null ? _v : colType.header) != null ? _w : c.name) != null ? _x : c.field
8777
8833
  });
8778
8834
  computedOffset += computedWidth;
8779
8835
  computedVisibleColumnsMap.set(result2.id, result2);
@@ -8849,6 +8905,7 @@ var useComputedVisibleColumns = ({
8849
8905
  pinnedEndMaxWidth,
8850
8906
  pinnedStartMaxWidth,
8851
8907
  viewportReservedWidth,
8908
+ resizableColumns,
8852
8909
  columnVisibility,
8853
8910
  columnVisibilityAssumeVisible,
8854
8911
  columnSizing
@@ -8880,6 +8937,7 @@ var useComputedVisibleColumns = ({
8880
8937
  columnCssEllipsis,
8881
8938
  columnHeaderCssEllipsis,
8882
8939
  viewportReservedWidth,
8940
+ resizableColumns,
8883
8941
  filterValue,
8884
8942
  sortable,
8885
8943
  sortInfo,
@@ -9037,6 +9095,7 @@ function useComputed() {
9037
9095
  pinnedEndMaxWidth: componentState.pinnedEndMaxWidth,
9038
9096
  bodySize,
9039
9097
  viewportReservedWidth: componentState.viewportReservedWidth,
9098
+ resizableColumns: componentState.resizableColumns,
9040
9099
  sortable: componentState.sortable,
9041
9100
  draggableColumns: componentState.draggableColumns,
9042
9101
  sortInfo: (_a = dataSourceState.sortInfo) != null ? _a : void 0,
@@ -9325,7 +9384,7 @@ var useLicense = (licenseKey = "") => {
9325
9384
  const valid = (0, import_react43.useMemo)(() => {
9326
9385
  let valid2 = isValidLicense(licenseKey, {
9327
9386
  publishedAt: 1624970570587,
9328
- version: "0.3.8"
9387
+ version: "0.3.11"
9329
9388
  });
9330
9389
  if (!licenseKey && !valid2 && isInsidePlayground) {
9331
9390
  return true;
@@ -9548,14 +9607,14 @@ function initSetupState2() {
9548
9607
  scrollTop: 0
9549
9608
  });
9550
9609
  });
9551
- if (true) {
9610
+ if (false) {
9552
9611
  globalThis.brain = brain;
9553
9612
  }
9554
9613
  const { renderer, onRenderUpdater } = createRenderer2(brain);
9555
9614
  brain.onAvailableSizeChange((size) => {
9556
9615
  headerBrain.setAvailableSize({ width: size.width });
9557
9616
  });
9558
- if (true) {
9617
+ if (false) {
9559
9618
  globalThis.renderer = renderer;
9560
9619
  }
9561
9620
  return {
@@ -9621,6 +9680,7 @@ var forwardProps3 = (setupState) => {
9621
9680
  scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
9622
9681
  filterEditors: (filterEditors) => __spreadValues(__spreadValues({}, defaultFilterEditors), filterEditors),
9623
9682
  viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
9683
+ resizableColumns: (resizableColumns) => resizableColumns != null ? resizableColumns : true,
9624
9684
  columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
9625
9685
  columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 2e3,
9626
9686
  columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
@@ -9694,6 +9754,9 @@ var mapPropsToState2 = (params) => {
9694
9754
  };
9695
9755
  };
9696
9756
 
9757
+ // src/components/InfiniteTable/utils/toCSSVarName.ts
9758
+ var toCSSVarName = (value) => `--infinite-${value}`;
9759
+
9697
9760
  // src/components/InfiniteTable/index.tsx
9698
9761
  var InfiniteTableClassName = internalProps.rootClassName;
9699
9762
  var HOVERED_CLASS_NAMES = [RowHoverCls, "InfiniteColumnCell--hovered"];
@@ -9836,7 +9899,7 @@ function InfiniteTableContextProvider() {
9836
9899
  const computed = useComputed();
9837
9900
  const getComputed = useLatest(computed);
9838
9901
  const getState = useLatest(componentState);
9839
- if (true) {
9902
+ if (false) {
9840
9903
  globalThis.getState = getState;
9841
9904
  globalThis.getComputed = getComputed;
9842
9905
  }
@@ -9878,5 +9941,5 @@ function InfiniteTable(props) {
9878
9941
  }
9879
9942
  InfiniteTable.defaultProps = {
9880
9943
  rowHeight: 40,
9881
- columnHeaderHeight: ThemeVars.components.Header.columnHeaderHeight
9944
+ columnHeaderHeight: toCSSVarName(columnHeaderHeightName)
9882
9945
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infinite-table/infinite-react",
3
3
  "description": "Infinite Table for React",
4
- "version": "0.3.8",
4
+ "version": "0.3.11",
5
5
  "main": "index.js",
6
6
  "module": "index.esm.js",
7
7
  "typings": "index.d.ts",
@@ -14,5 +14,5 @@
14
14
  },
15
15
  "license": "Commercial & Open Source",
16
16
  "//": "will be updated at build time",
17
- "publishedAt": 1654613192511
17
+ "publishedAt": 1654702620822
18
18
  }