@infinite-table/infinite-react 6.1.0 → 6.1.1

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 (7) hide show
  1. package/index.css +59 -42
  2. package/index.d.ts +1285 -1254
  3. package/index.dev.js +863 -595
  4. package/index.dev.mjs +902 -634
  5. package/index.js +863 -595
  6. package/index.mjs +902 -634
  7. package/package.json +2 -2
package/index.dev.mjs CHANGED
@@ -1394,7 +1394,7 @@ var internalProps = {
1394
1394
  };
1395
1395
 
1396
1396
  // src/components/InfiniteTable/internalVars.css.ts
1397
- var InternalVars = { currentColumnTransformX: "var(--currentColumnTransformX__16hkbkc0)", y: "var(--y__16hkbkc1)", currentFlashingBackground: "var(--currentFlashingBackground__16hkbkc2)", currentFlashingDuration: "var(--currentFlashingDuration__16hkbkc3)", activeCellRowOffset: "var(--activeCellRowOffset__16hkbkc4)", activeCellRowOffsetX: "var(--activeCellRowOffsetX__16hkbkc5)", activeCellRowHeight: "var(--activeCellRowHeight__16hkbkc6)", activeCellOffsetX: "var(--activeCellOffsetX__16hkbkc7)", activeCellOffsetY: "var(--activeCellOffsetY__16hkbkc8)", scrollTopForActiveRow: "var(--scrollTopForActiveRow__16hkbkc9)", scrollLeftForActiveRowWhenHorizontalLayout: "var(--scrollLeftForActiveRowWhenHorizontalLayout__16hkbkca)", activeCellColWidth: "var(--activeCellColWidth__16hkbkcb)", activeCellColOffset: "var(--activeCellColOffset__16hkbkcc)", columnReorderEffectDurationAtIndex: "var(--columnReorderEffectDurationAtIndex__16hkbkcd)", columnWidthAtIndex: "var(--columnWidthAtIndex__16hkbkce)", columnOffsetAtIndex: "var(--columnOffsetAtIndex__16hkbkcf)", columnOffsetAtIndexWhileReordering: "var(--columnOffsetAtIndexWhileReordering__16hkbkcg)", columnZIndexAtIndex: "var(--columnZIndexAtIndex__16hkbkch)", pinnedStartWidth: "var(--pinnedStartWidth__16hkbkci)", pinnedEndWidth: "var(--pinnedEndWidth__16hkbkcj)", pinnedEndOffset: "var(--pinnedEndOffset__16hkbkck)", computedVisibleColumnsCount: "var(--computedVisibleColumnsCount__16hkbkcl)", baseZIndexForCells: "var(--baseZIndexForCells__16hkbkcm)", bodyWidth: "var(--bodyWidth__16hkbkcn)", bodyHeight: "var(--bodyHeight__16hkbkco)", scrollbarWidthHorizontal: "var(--scrollbarWidthHorizontal__16hkbkcp)", scrollbarWidthVertical: "var(--scrollbarWidthVertical__16hkbkcq)", scrollLeft: "var(--scrollLeft__16hkbkcr)", scrollTop: "var(--scrollTop__16hkbkcs)" };
1397
+ var InternalVars = { currentColumnTransformX: "var(--currentColumnTransformX__16hkbkc0)", y: "var(--y__16hkbkc1)", currentFlashingBackground: "var(--currentFlashingBackground__16hkbkc2)", currentFlashingDuration: "var(--currentFlashingDuration__16hkbkc3)", activeCellRowOffset: "var(--activeCellRowOffset__16hkbkc4)", activeCellRowOffsetX: "var(--activeCellRowOffsetX__16hkbkc5)", activeCellRowHeight: "var(--activeCellRowHeight__16hkbkc6)", activeCellOffsetX: "var(--activeCellOffsetX__16hkbkc7)", activeCellOffsetY: "var(--activeCellOffsetY__16hkbkc8)", scrollTopForActiveRow: "var(--scrollTopForActiveRow__16hkbkc9)", scrollLeftForActiveRowWhenHorizontalLayout: "var(--scrollLeftForActiveRowWhenHorizontalLayout__16hkbkca)", activeCellColWidth: "var(--activeCellColWidth__16hkbkcb)", activeCellColOffset: "var(--activeCellColOffset__16hkbkcc)", columnReorderEffectDurationAtIndex: "var(--columnReorderEffectDurationAtIndex__16hkbkcd)", columnWidthAtIndex: "var(--columnWidthAtIndex__16hkbkce)", columnOffsetAtIndex: "var(--columnOffsetAtIndex__16hkbkcf)", columnOffsetAtIndexWhileReordering: "var(--columnOffsetAtIndexWhileReordering__16hkbkcg)", columnZIndexAtIndex: "var(--columnZIndexAtIndex__16hkbkch)", pinnedStartWidth: "var(--pinnedStartWidth__16hkbkci)", pinnedEndWidth: "var(--pinnedEndWidth__16hkbkcj)", pinnedEndOffset: "var(--pinnedEndOffset__16hkbkck)", computedVisibleColumnsCount: "var(--computedVisibleColumnsCount__16hkbkcl)", baseZIndexForCells: "var(--baseZIndexForCells__16hkbkcm)", bodyWidth: "var(--bodyWidth__16hkbkcn)", bodyHeight: "var(--bodyHeight__16hkbkco)", scrollbarWidthHorizontal: "var(--scrollbarWidthHorizontal__16hkbkcp)", scrollbarWidthVertical: "var(--scrollbarWidthVertical__16hkbkcq)", scrollLeft: "var(--scrollLeft__16hkbkcr)", scrollTop: "var(--scrollTop__16hkbkcs)", virtualScrollLeftOffset: "var(--virtualScrollLeftOffset__16hkbkct)", virtualScrollTopOffset: "var(--virtualScrollTopOffset__16hkbkcu)" };
1398
1398
 
1399
1399
  // src/components/InfiniteTable/vars.css.ts
1400
1400
  var CSS_LOADED_VALUE = "true";
@@ -1614,6 +1614,8 @@ var MatrixBrain = class extends Logger {
1614
1614
  this.horizontalTotalSize = 0;
1615
1615
  this.horizontalRenderCount = void 0;
1616
1616
  this.verticalRenderCount = void 0;
1617
+ this.maxHorizontalRenderCount = 0;
1618
+ this.maxVerticalRenderCount = 0;
1617
1619
  this.horizontalExtendRangeBy = DEFAULT_EXTEND_BY;
1618
1620
  this.verticalExtendRangeBy = DEFAULT_EXTEND_BY;
1619
1621
  this.horizontalRenderRange = {
@@ -2294,6 +2296,9 @@ var MatrixBrain = class extends Logger {
2294
2296
  }
2295
2297
  };
2296
2298
  this.getRenderRangeCellCount = getRenderRangeCellCount;
2299
+ this.getMaxCellCount = () => {
2300
+ return this.maxHorizontalRenderCount * this.maxVerticalRenderCount;
2301
+ };
2297
2302
  this.getExtraCells = () => {
2298
2303
  return this.extraSpanCells;
2299
2304
  };
@@ -2655,6 +2660,11 @@ var MatrixBrain = class extends Logger {
2655
2660
  renderCount = (itemSize ? Math.ceil(size / itemSize) : 0) + 1;
2656
2661
  }
2657
2662
  renderCount += fixedStart + fixedEnd;
2663
+ if (direction === "horizontal") {
2664
+ this.maxHorizontalRenderCount = renderCount;
2665
+ } else {
2666
+ this.maxVerticalRenderCount = renderCount;
2667
+ }
2658
2668
  renderCount = Math.min(count, renderCount);
2659
2669
  return renderCount;
2660
2670
  }
@@ -2823,6 +2833,7 @@ var emptyFn = () => {
2823
2833
  var GridCellForReact = class {
2824
2834
  constructor(debugId, cellInfo) {
2825
2835
  this.element = null;
2836
+ this.mounted = false;
2826
2837
  this.mountSubscription = buildSubscriptionCallback();
2827
2838
  const count = CELL_COUNT_BY_DEBUG_ID.get(debugId) ?? 0;
2828
2839
  const key = `${debugId}:GridCellReact:${count}`;
@@ -2834,10 +2845,16 @@ var GridCellForReact = class {
2834
2845
  this.ref = (htmlElement) => {
2835
2846
  this.element = htmlElement;
2836
2847
  if (htmlElement) {
2848
+ this.mounted = true;
2837
2849
  this.mountSubscription(this);
2850
+ } else {
2851
+ this.mounted = false;
2838
2852
  }
2839
2853
  };
2840
2854
  }
2855
+ isMounted() {
2856
+ return this.mounted;
2857
+ }
2841
2858
  onMount(callback) {
2842
2859
  const off = this.mountSubscription.onChange((cell) => {
2843
2860
  if (cell != null) {
@@ -2868,10 +2885,12 @@ var GridCellForReact = class {
2868
2885
  }
2869
2886
  };
2870
2887
  var _GridCellPoolForReact = class extends Logger {
2888
+ // for now, making this larger will create the cells, but on fast scrolling, those extra cells can tend to lag behind the scroll position as they are not updated
2871
2889
  constructor(debugId) {
2872
2890
  super(`${debugId}:GridCellPoolForReact`);
2873
2891
  this.debugId = debugId;
2874
2892
  this.cellRemoveSubscription = buildSubscriptionCallback();
2893
+ this.cellAttachmentChangeSubscription = buildSubscriptionCallback();
2875
2894
  this.attachedCells = /* @__PURE__ */ new Set();
2876
2895
  this.detachedCells = /* @__PURE__ */ new Set();
2877
2896
  this.allCellsOrdered = /* @__PURE__ */ new Set();
@@ -2887,11 +2906,22 @@ var _GridCellPoolForReact = class extends Logger {
2887
2906
  });
2888
2907
  return off;
2889
2908
  }
2909
+ onCellAttachmentChange(callback) {
2910
+ const off = this.cellAttachmentChangeSubscription.onChange((res) => {
2911
+ if (res == null) {
2912
+ return;
2913
+ }
2914
+ const { cell, attached } = res;
2915
+ callback(cell, attached);
2916
+ });
2917
+ return off;
2918
+ }
2890
2919
  reset() {
2891
2920
  this.attachedCells.clear();
2892
2921
  this.detachedCells.clear();
2893
2922
  this.allCellsOrdered.clear();
2894
2923
  this.cellRemoveSubscription.destroy();
2924
+ this.cellAttachmentChangeSubscription.destroy();
2895
2925
  }
2896
2926
  getAttachedCells() {
2897
2927
  return this.attachedCells;
@@ -2936,16 +2966,31 @@ var _GridCellPoolForReact = class extends Logger {
2936
2966
  * If a cell is provided, it's moved to the attached set as well.
2937
2967
  */
2938
2968
  attachCell(cell) {
2969
+ if (cell && this.attachedCells.has(cell)) {
2970
+ return cell;
2971
+ }
2939
2972
  if (!cell) {
2940
2973
  cell = this.getDetachedCell();
2941
2974
  }
2942
2975
  this.detachedCells.delete(cell);
2943
2976
  this.attachedCells.add(cell);
2977
+ this.cellAttachmentChangeSubscription({
2978
+ cell,
2979
+ attached: true
2980
+ });
2944
2981
  return cell;
2945
2982
  }
2946
2983
  detachCell(cell) {
2984
+ if (this.detachedCells.has(cell)) {
2985
+ return false;
2986
+ }
2947
2987
  this.attachedCells.delete(cell);
2948
2988
  this.detachedCells.add(cell);
2989
+ this.cellAttachmentChangeSubscription({
2990
+ cell,
2991
+ attached: false
2992
+ });
2993
+ return true;
2949
2994
  }
2950
2995
  /**
2951
2996
  * This gets a detached cell from the pool.
@@ -3002,14 +3047,16 @@ var _GridCellPoolForReact = class extends Logger {
3002
3047
  };
3003
3048
  var GridCellPoolForReact = _GridCellPoolForReact;
3004
3049
  // we'll grow the pool by this amount at a time
3005
- GridCellPoolForReact.POOL_SIZE_INCREMENT = 5;
3050
+ GridCellPoolForReact.POOL_SIZE_INCREMENT = 1;
3006
3051
 
3007
3052
  // src/components/HeadlessTable/GridCellManager.ts
3053
+ var ASC_SORT = (a, b) => a - b;
3008
3054
  var GridCellManager = class extends Logger {
3009
3055
  constructor(debugId) {
3010
3056
  super(`${debugId}:GridCellManager`);
3011
3057
  this.matrix = new DeepMap();
3012
- this.matrixWithHistory = new DeepMap();
3058
+ this.rowsWithCellsHistory = /* @__PURE__ */ new Map();
3059
+ this.columnsWithCellsHistory = /* @__PURE__ */ new Map();
3013
3060
  this.cellToMatrixPosition = /* @__PURE__ */ new WeakMap();
3014
3061
  this.getCellsOutsideRenderRange = (range) => {
3015
3062
  const { start, end } = range;
@@ -3044,11 +3091,9 @@ var GridCellManager = class extends Logger {
3044
3091
  if (!cellPos) {
3045
3092
  return;
3046
3093
  }
3047
- this.matrix.delete(cellPos);
3048
- let cellsAtPos = this.matrixWithHistory.get(cellPos);
3049
- if (cellsAtPos) {
3050
- cellsAtPos.delete(cell);
3051
- }
3094
+ this.clearCellFromMatrix(cell, cellPos, {
3095
+ skipHistory: false
3096
+ });
3052
3097
  }
3053
3098
  set poolSize(cellCount) {
3054
3099
  this.pool.poolSize = cellCount;
@@ -3057,47 +3102,73 @@ var GridCellManager = class extends Logger {
3057
3102
  return this.pool.poolSize;
3058
3103
  }
3059
3104
  getDetachedCell() {
3060
- console.warn("getting detached cell");
3061
3105
  return this.pool.getDetachedCell();
3062
3106
  }
3107
+ clearCellFromMatrix(cell, cellPos, config) {
3108
+ this.matrix.delete(cellPos);
3109
+ if (config.skipHistory) {
3110
+ return;
3111
+ }
3112
+ const [rowIndex, colIndex] = cellPos;
3113
+ const cellsAtRow = this.rowsWithCellsHistory.get(rowIndex);
3114
+ const cellsAtCol = this.columnsWithCellsHistory.get(colIndex);
3115
+ if (cellsAtRow) {
3116
+ cellsAtRow.delete(cell);
3117
+ if (cellsAtRow.size === 0) {
3118
+ this.rowsWithCellsHistory.delete(rowIndex);
3119
+ }
3120
+ }
3121
+ if (cellsAtCol) {
3122
+ cellsAtCol.delete(cell);
3123
+ if (cellsAtCol.size === 0) {
3124
+ this.columnsWithCellsHistory.delete(colIndex);
3125
+ }
3126
+ }
3127
+ }
3128
+ addCellToMatrix(cell, cellPos) {
3129
+ const [rowIndex, colIndex] = cellPos;
3130
+ this.matrix.set(cellPos, cell);
3131
+ this.cellToMatrixPosition.set(cell, cellPos);
3132
+ let cellsAtRow = this.rowsWithCellsHistory.get(rowIndex);
3133
+ let cellsAtColumn = this.columnsWithCellsHistory.get(colIndex);
3134
+ if (!cellsAtRow) {
3135
+ cellsAtRow = /* @__PURE__ */ new Set();
3136
+ cellsAtRow.add(cell);
3137
+ this.rowsWithCellsHistory.set(rowIndex, cellsAtRow);
3138
+ } else {
3139
+ cellsAtRow.add(cell);
3140
+ }
3141
+ if (!cellsAtColumn) {
3142
+ cellsAtColumn = /* @__PURE__ */ new Set();
3143
+ cellsAtColumn.add(cell);
3144
+ this.columnsWithCellsHistory.set(colIndex, cellsAtColumn);
3145
+ } else {
3146
+ cellsAtColumn.add(cell);
3147
+ }
3148
+ }
3063
3149
  setCellPositionInMatrix(cell, cellPos) {
3150
+ const currentCellPos = this.cellToMatrixPosition.get(cell);
3064
3151
  if (cellPos == null) {
3065
- const currentCellPos = this.cellToMatrixPosition.get(cell);
3066
3152
  if (currentCellPos) {
3067
- this.matrix.delete(currentCellPos);
3068
- }
3069
- } else {
3070
- let prevCellPos = this.cellToMatrixPosition.get(cell);
3071
- const samePos = prevCellPos && prevCellPos[0] === cellPos[0] && prevCellPos[1] === cellPos[1];
3072
- this.matrix.set(cellPos, cell);
3073
- this.cellToMatrixPosition.set(cell, cellPos);
3074
- let cellsAtPos = this.matrixWithHistory.get(cellPos);
3075
- if (!cellsAtPos) {
3076
- cellsAtPos = /* @__PURE__ */ new Set();
3077
- cellsAtPos.add(cell);
3078
- this.matrixWithHistory.set(cellPos, cellsAtPos);
3079
- } else {
3080
- cellsAtPos.add(cell);
3081
- }
3082
- if (prevCellPos && !samePos) {
3083
- this.matrix.delete(prevCellPos);
3084
- let cellsAtPrevPos = this.matrixWithHistory.get(prevCellPos);
3085
- if (cellsAtPrevPos) {
3086
- cellsAtPrevPos.delete(cell);
3087
- }
3153
+ this.clearCellFromMatrix(cell, currentCellPos, {
3154
+ skipHistory: true
3155
+ });
3088
3156
  }
3157
+ return;
3158
+ }
3159
+ const [rowIndex, colIndex] = cellPos;
3160
+ const samePos = currentCellPos && currentCellPos[0] === rowIndex && currentCellPos[1] === colIndex;
3161
+ if (currentCellPos && !samePos) {
3162
+ this.clearCellFromMatrix(cell, currentCellPos, {
3163
+ skipHistory: false
3164
+ });
3089
3165
  }
3166
+ this.addCellToMatrix(cell, cellPos);
3090
3167
  }
3091
3168
  renderNodeAtCell(node, cell, cellPos, additionalInfo) {
3092
3169
  const currentCellAtPos = this.getCellAt(cellPos);
3093
- if (currentCellAtPos) {
3094
- if (currentCellAtPos !== cell) {
3095
- this.detachCellAt(cellPos);
3096
- this.detachCell(cell);
3097
- } else {
3098
- }
3099
- } else {
3100
- this.detachCell(cell);
3170
+ if (currentCellAtPos && currentCellAtPos !== cell) {
3171
+ this.detachCellAt(cellPos);
3101
3172
  }
3102
3173
  this.pool.attachCell(cell);
3103
3174
  this.setCellPositionInMatrix(cell, cellPos);
@@ -3139,34 +3210,16 @@ var GridCellManager = class extends Logger {
3139
3210
  }
3140
3211
  const [rowIndex, colIndex] = cellPos;
3141
3212
  if (optimise === "row") {
3142
- this.matrixWithHistory.visitSome((cellsForPos, [row], __, next) => {
3143
- if (cell) {
3144
- return true;
3145
- }
3146
- if (row === rowIndex) {
3147
- cell = setFind(cellsForPos, (c) => !this.isCellAttached(c));
3148
- if (cell) {
3149
- return true;
3150
- }
3151
- }
3152
- next?.();
3153
- return false;
3154
- });
3213
+ const cellsAtRow = this.rowsWithCellsHistory.get(rowIndex);
3214
+ if (cellsAtRow) {
3215
+ cell = setFind(cellsAtRow, (c) => !this.isCellAttached(c));
3216
+ }
3155
3217
  }
3156
3218
  if (optimise === "column") {
3157
- this.matrixWithHistory.visitSome((cellsForPos, [_row, col], __, next) => {
3158
- if (cell) {
3159
- return true;
3160
- }
3161
- if (col === colIndex) {
3162
- cell = setFind(cellsForPos, (c) => !this.isCellAttached(c));
3163
- if (cell) {
3164
- return true;
3165
- }
3166
- }
3167
- next?.();
3168
- return false;
3169
- });
3219
+ const cellsAtColumn = this.columnsWithCellsHistory.get(colIndex);
3220
+ if (cellsAtColumn) {
3221
+ cell = setFind(cellsAtColumn, (c) => !this.isCellAttached(c));
3222
+ }
3170
3223
  }
3171
3224
  return cell ?? this.getDetachedCell();
3172
3225
  }
@@ -3207,12 +3260,12 @@ var GridCellManager = class extends Logger {
3207
3260
  return cell;
3208
3261
  }
3209
3262
  getRowsWithCells() {
3210
- return this.matrix.rawKeysAt([]).sort();
3263
+ return this.matrix.rawKeysAt([]).sort(ASC_SORT);
3211
3264
  }
3212
3265
  getColumnsWithCells() {
3213
3266
  const positions = this.matrix.getUnnestedKeysStartingWith([], true);
3214
3267
  const columns = new Set(positions.map((pos) => pos[1]));
3215
- return [...columns.values()].sort();
3268
+ return [...columns.values()].sort(ASC_SORT);
3216
3269
  }
3217
3270
  isRowAttached(rowIndex) {
3218
3271
  return this.getRowsWithCells().includes(rowIndex);
@@ -3234,17 +3287,20 @@ var GridCellManager = class extends Logger {
3234
3287
  });
3235
3288
  }
3236
3289
  detachCell(cell) {
3237
- const cellPos = this.getCellPosition(cell);
3238
- if (cellPos) {
3239
- this.detachCellAt(cellPos);
3290
+ if (!cell) {
3291
+ return false;
3292
+ }
3293
+ if (this.pool.detachCell(cell)) {
3294
+ this.setCellPositionInMatrix(cell, null);
3240
3295
  }
3296
+ return true;
3241
3297
  }
3242
3298
  detachCells(cells) {
3243
3299
  cells.forEach((cell) => this.detachCell(cell));
3244
3300
  }
3245
3301
  detachRowsStartingWith(rowIndex) {
3246
3302
  const rows = this.getRowsWithCells().sort();
3247
- let idx = (0, import_binary_search2.default)(rows, rowIndex, (a, b) => a - b);
3303
+ let idx = (0, import_binary_search2.default)(rows, rowIndex, ASC_SORT);
3248
3304
  if (idx < 0) {
3249
3305
  idx = ~idx;
3250
3306
  }
@@ -3253,7 +3309,7 @@ var GridCellManager = class extends Logger {
3253
3309
  }
3254
3310
  detachColsStartingWith(colIndex) {
3255
3311
  const cols = this.getColumnsWithCells().sort();
3256
- let idx = (0, import_binary_search2.default)(cols, colIndex, (a, b) => a - b);
3312
+ let idx = (0, import_binary_search2.default)(cols, colIndex, ASC_SORT);
3257
3313
  if (idx < 0) {
3258
3314
  idx = ~idx;
3259
3315
  }
@@ -3272,9 +3328,12 @@ var GridCellManager = class extends Logger {
3272
3328
  detachCellAt(cellPos) {
3273
3329
  const cell = this.getCellAt(cellPos);
3274
3330
  if (cell) {
3275
- this.setCellPositionInMatrix(cell, null);
3276
- this.pool.detachCell(cell);
3331
+ return this.detachCell(cell);
3277
3332
  }
3333
+ return false;
3334
+ }
3335
+ onCellAttachmentChange(callback) {
3336
+ return this.pool.onCellAttachmentChange(callback);
3278
3337
  }
3279
3338
  getCellFromListForRow(cells, rowIndex) {
3280
3339
  return setFind(cells, (cell) => {
@@ -3295,7 +3354,8 @@ var GridCellManager = class extends Logger {
3295
3354
  reset() {
3296
3355
  this.pool.reset();
3297
3356
  this.matrix.clear();
3298
- this.matrixWithHistory.clear();
3357
+ this.rowsWithCellsHistory.clear();
3358
+ this.columnsWithCellsHistory.clear();
3299
3359
  this.offRemoveCell();
3300
3360
  this.offRemoveCell = () => {
3301
3361
  };
@@ -3305,6 +3365,9 @@ var GridCellManager = class extends Logger {
3305
3365
  cell.update(null);
3306
3366
  });
3307
3367
  }
3368
+ withDetachedCells(fn) {
3369
+ this.pool.getDetachedCells().forEach(fn);
3370
+ }
3308
3371
  };
3309
3372
 
3310
3373
  // src/components/HeadlessTable/ListRowManager.ts
@@ -3318,6 +3381,7 @@ var emptyFn2 = () => {
3318
3381
  var ListRowForReact = class {
3319
3382
  constructor(debugId) {
3320
3383
  this.element = null;
3384
+ this.mounted = false;
3321
3385
  this.mountSubscription = buildSubscriptionCallback();
3322
3386
  const count = ROW_COUNT_BY_DEBUG_ID.get(debugId) ?? 0;
3323
3387
  const key = `${debugId}:ListRowReact:${count}`;
@@ -3335,10 +3399,16 @@ var ListRowForReact = class {
3335
3399
  this.ref = (htmlElement) => {
3336
3400
  this.element = htmlElement;
3337
3401
  if (htmlElement) {
3402
+ this.mounted = true;
3338
3403
  this.mountSubscription(this);
3404
+ } else {
3405
+ this.mounted = false;
3339
3406
  }
3340
3407
  };
3341
3408
  }
3409
+ isMounted() {
3410
+ return this.mounted;
3411
+ }
3342
3412
  onMount(callback) {
3343
3413
  const off = this.mountSubscription.onChange((row) => {
3344
3414
  if (row != null) {
@@ -3369,6 +3439,7 @@ var _ListRowPoolForReact = class extends Logger {
3369
3439
  super(`${debugId}:ListRowPoolForReact`);
3370
3440
  this.debugId = debugId;
3371
3441
  this.rowRemoveSubscription = buildSubscriptionCallback();
3442
+ this.rowAttachmentChangeSubscription = buildSubscriptionCallback();
3372
3443
  this.attachedRows = /* @__PURE__ */ new Set();
3373
3444
  this.detachedRows = /* @__PURE__ */ new Set();
3374
3445
  this.allRowsOrdered = /* @__PURE__ */ new Set();
@@ -3384,11 +3455,22 @@ var _ListRowPoolForReact = class extends Logger {
3384
3455
  });
3385
3456
  return off;
3386
3457
  }
3458
+ onRowAttachmentChange(callback) {
3459
+ const off = this.rowAttachmentChangeSubscription.onChange((res) => {
3460
+ if (res == null) {
3461
+ return;
3462
+ }
3463
+ const { row, attached } = res;
3464
+ callback(row, attached);
3465
+ });
3466
+ return off;
3467
+ }
3387
3468
  reset() {
3388
3469
  this.attachedRows.clear();
3389
3470
  this.detachedRows.clear();
3390
3471
  this.allRowsOrdered.clear();
3391
3472
  this.rowRemoveSubscription.destroy();
3473
+ this.rowAttachmentChangeSubscription.destroy();
3392
3474
  }
3393
3475
  getAttachedRows() {
3394
3476
  return this.attachedRows;
@@ -3433,16 +3515,31 @@ var _ListRowPoolForReact = class extends Logger {
3433
3515
  * If a row is provided, it's moved to the attached set as well.
3434
3516
  */
3435
3517
  attachRow(row) {
3518
+ if (row && this.attachedRows.has(row)) {
3519
+ return row;
3520
+ }
3436
3521
  if (!row) {
3437
3522
  row = this.getDetachedRow();
3438
3523
  }
3439
3524
  this.detachedRows.delete(row);
3440
3525
  this.attachedRows.add(row);
3526
+ this.rowAttachmentChangeSubscription({
3527
+ row,
3528
+ attached: true
3529
+ });
3441
3530
  return row;
3442
3531
  }
3443
3532
  detachRow(row) {
3533
+ if (this.detachedRows.has(row)) {
3534
+ return false;
3535
+ }
3444
3536
  this.attachedRows.delete(row);
3445
3537
  this.detachedRows.add(row);
3538
+ this.rowAttachmentChangeSubscription({
3539
+ row,
3540
+ attached: false
3541
+ });
3542
+ return true;
3446
3543
  }
3447
3544
  /**
3448
3545
  * This gets a detached row from the pool.
@@ -3499,7 +3596,7 @@ var _ListRowPoolForReact = class extends Logger {
3499
3596
  };
3500
3597
  var ListRowPoolForReact = _ListRowPoolForReact;
3501
3598
  // we'll grow the pool by this amount at a time
3502
- ListRowPoolForReact.POOL_SIZE_INCREMENT = 5;
3599
+ ListRowPoolForReact.POOL_SIZE_INCREMENT = 1;
3503
3600
 
3504
3601
  // src/components/HeadlessTable/ListRowManager.ts
3505
3602
  var ListRowManager = class extends Logger {
@@ -3613,14 +3710,8 @@ var ListRowManager = class extends Logger {
3613
3710
  }
3614
3711
  renderNodeAtRow(node, row, rowIndex) {
3615
3712
  const currentRowAtPos = this.getRowAt(rowIndex);
3616
- if (currentRowAtPos) {
3617
- if (currentRowAtPos !== row) {
3618
- this.detachRowAt(rowIndex);
3619
- this.detachRow(row);
3620
- } else {
3621
- }
3622
- } else {
3623
- this.detachRow(row);
3713
+ if (currentRowAtPos && currentRowAtPos !== row) {
3714
+ this.detachRowAt(rowIndex);
3624
3715
  }
3625
3716
  this.pool.attachRow(row);
3626
3717
  this.setRowIndexInList(row, rowIndex);
@@ -3632,6 +3723,12 @@ var ListRowManager = class extends Logger {
3632
3723
  row.update(null);
3633
3724
  });
3634
3725
  }
3726
+ onRowAttachmentChange(callback) {
3727
+ return this.pool.onRowAttachmentChange(callback);
3728
+ }
3729
+ withDetachedRows(fn) {
3730
+ this.pool.getDetachedRows().forEach(fn);
3731
+ }
3635
3732
  destroy() {
3636
3733
  this.reset();
3637
3734
  }
@@ -3660,6 +3757,7 @@ var GridRenderer = class extends Logger {
3660
3757
  this.destroyed = false;
3661
3758
  this.scrolling = false;
3662
3759
  this.cellHoverClassNames = [];
3760
+ this.cellDetachedClassNames = [];
3663
3761
  this.lastEnteredRow = -1;
3664
3762
  this.lastExitedRow = -1;
3665
3763
  this.hoverRowUpdatesInProgress = /* @__PURE__ */ new Map();
@@ -4460,7 +4558,21 @@ var GridRenderer = class extends Logger {
4460
4558
  this.brain = brain;
4461
4559
  this.debugId = debugId;
4462
4560
  this.cellManager = new GridCellManager(debugId);
4561
+ this.cellManager.onCellAttachmentChange((cell, attached) => {
4562
+ if (attached) {
4563
+ this.onCellAttached(cell);
4564
+ } else {
4565
+ this.onCellDetached(cell);
4566
+ }
4567
+ });
4463
4568
  this.rowManager = new ListRowManager(debugId);
4569
+ this.rowManager.onRowAttachmentChange((row, attached) => {
4570
+ if (attached) {
4571
+ this.onRowAttached(row);
4572
+ } else {
4573
+ this.onRowDetached(row);
4574
+ }
4575
+ });
4464
4576
  this.renderRange = this.renderRange.bind(this);
4465
4577
  const removeOnScroll = brain.onScroll(this.adjustFixedElementsOnScroll);
4466
4578
  const removeOnSizeChange = brain.onAvailableSizeChange(() => {
@@ -4487,6 +4599,46 @@ var GridRenderer = class extends Logger {
4487
4599
  }
4488
4600
  return this.infiniteNode;
4489
4601
  }
4602
+ onCellAttached(cell) {
4603
+ if (this.cellDetachedClassNames.length) {
4604
+ const el = cell.getElement();
4605
+ if (el) {
4606
+ this.cellDetachedClassNames.forEach((className) => {
4607
+ el.classList.remove(className);
4608
+ });
4609
+ }
4610
+ }
4611
+ }
4612
+ onCellDetached(cell) {
4613
+ if (this.cellDetachedClassNames.length) {
4614
+ const el = cell.getElement();
4615
+ if (el) {
4616
+ this.cellDetachedClassNames.forEach((className) => {
4617
+ el.classList.add(className);
4618
+ });
4619
+ }
4620
+ }
4621
+ }
4622
+ onRowAttached(row) {
4623
+ if (this.cellDetachedClassNames.length) {
4624
+ const el = row.getElement();
4625
+ if (el) {
4626
+ this.cellDetachedClassNames.forEach((className) => {
4627
+ el.classList.remove(className);
4628
+ });
4629
+ }
4630
+ }
4631
+ }
4632
+ onRowDetached(row) {
4633
+ if (this.cellDetachedClassNames.length) {
4634
+ const el = row.getElement();
4635
+ if (el) {
4636
+ this.cellDetachedClassNames.forEach((className) => {
4637
+ el.classList.add(className);
4638
+ });
4639
+ }
4640
+ }
4641
+ }
4490
4642
  isCellRenderedAndMappedCorrectly(row, col) {
4491
4643
  const rendered = !!this.cellManager.getCellAt([row, col]);
4492
4644
  return {
@@ -4532,13 +4684,10 @@ var GridRenderer = class extends Logger {
4532
4684
  0
4533
4685
  );
4534
4686
  const renderRowCount = renderDetailRow ? ranges.reduce((sum2, range2) => sum2 + getRenderRangeRowCount(range2), 0) : 0;
4535
- cellManager.detachCellsStartingAt([
4536
- this.brain.getRowCount(),
4537
- this.brain.getColCount()
4538
- ]);
4539
- if (cellManager.poolSize > renderCount) {
4540
- cellManager.poolSize = renderCount;
4541
- }
4687
+ const rowCount = this.brain.getRowCount();
4688
+ const colCount = this.brain.getColCount();
4689
+ cellManager.detachCellsStartingAt([rowCount, colCount]);
4690
+ const maxCount = Math.min(rowCount * colCount, renderCount);
4542
4691
  if (renderDetailRow) {
4543
4692
  rowManager.detachStartingWith(this.brain.getRowCount());
4544
4693
  if (rowManager.poolSize > renderRowCount) {
@@ -4556,7 +4705,7 @@ var GridRenderer = class extends Logger {
4556
4705
  return true;
4557
4706
  });
4558
4707
  cellManager.detachCells(cellsOutsideRanges);
4559
- cellManager.poolSize = renderCount;
4708
+ cellManager.poolSize = maxCount;
4560
4709
  const visitedCells = /* @__PURE__ */ new Map();
4561
4710
  const visitedRows = /* @__PURE__ */ new Map();
4562
4711
  ranges.forEach((range2) => {
@@ -4641,9 +4790,7 @@ var GridRenderer = class extends Logger {
4641
4790
  }
4642
4791
  this.renderCellAt(rowIndex, colIndex, cell, renderCell);
4643
4792
  });
4644
- cellManager.makeDetachedCellsEmpty();
4645
4793
  if (renderDetailRow) {
4646
- rowManager.makeDetachedRowsEmpty();
4647
4794
  }
4648
4795
  let result = cellManager.getAllCells().map((cell) => cell.getNode());
4649
4796
  if (renderDetailRow) {
@@ -4676,14 +4823,20 @@ var GridRenderer = class extends Logger {
4676
4823
  },
4677
4824
  domRef: row.ref
4678
4825
  });
4679
- row.onMount((row2) => {
4680
- const element = row2.getElement();
4681
- if (element) {
4682
- element.style.position = "absolute";
4683
- element.style.left = "0px";
4684
- }
4685
- this.updateDetailElementPosition(row2);
4686
- });
4826
+ if (!row.isMounted()) {
4827
+ row.onMount((row2) => {
4828
+ const element = row2.getElement();
4829
+ if (element) {
4830
+ element.style.position = "absolute";
4831
+ element.style.left = "0px";
4832
+ }
4833
+ this.updateDetailElementPosition(row2);
4834
+ });
4835
+ }
4836
+ if (!renderedDetailNode) {
4837
+ this.rowManager.detachRow(row);
4838
+ return;
4839
+ }
4687
4840
  this.rowManager.renderNodeAtRow(renderedDetailNode, row, rowIndex);
4688
4841
  this.updateDetailElementPosition(row);
4689
4842
  return;
@@ -4727,19 +4880,29 @@ var GridRenderer = class extends Logger {
4727
4880
  onMouseLeave: this.onMouseLeave.bind(null, rowIndex),
4728
4881
  domRef: cell.ref
4729
4882
  });
4730
- cell.onMount((cell2) => {
4731
- const element = cell2.getElement();
4732
- if (element) {
4733
- element.style.position = "absolute";
4734
- element.style.left = "0px";
4735
- element.style.top = "0px";
4736
- }
4737
- this.updateElementPosition(cell2);
4738
- });
4883
+ if (!cell.isMounted()) {
4884
+ cell.onMount((cell2) => {
4885
+ const element = cell2.getElement();
4886
+ if (element) {
4887
+ element.style.position = "absolute";
4888
+ element.style.left = "0px";
4889
+ element.style.top = "0px";
4890
+ }
4891
+ this.updateElementPosition(cell2);
4892
+ });
4893
+ }
4739
4894
  const cellAdditionalInfo = this.brain.isHorizontalLayoutBrain ? {
4740
4895
  renderRowIndex,
4741
4896
  renderColIndex
4742
4897
  } : void 0;
4898
+ if (!renderedNode) {
4899
+ if (this.brain.isHorizontalLayoutBrain) {
4900
+ this.cellManager.detachCell(cell);
4901
+ } else {
4902
+ this.cellManager.detachCell(cell);
4903
+ }
4904
+ return;
4905
+ }
4743
4906
  this.cellManager.renderNodeAtCell(
4744
4907
  renderedNode,
4745
4908
  cell,
@@ -4852,6 +5015,9 @@ function RawTableFn(props) {
4852
5015
  useEffect4(() => {
4853
5016
  renderer.cellHoverClassNames = props.cellHoverClassNames || [];
4854
5017
  }, [renderer, props.cellHoverClassNames]);
5018
+ useEffect4(() => {
5019
+ renderer.cellDetachedClassNames = props.cellDetachedClassNames || [];
5020
+ }, [renderer, props.cellDetachedClassNames]);
4855
5021
  useLayoutEffect3(() => {
4856
5022
  const renderRange = brain.getRenderRange();
4857
5023
  renderer.renderRange(renderRange, {
@@ -5167,7 +5333,23 @@ var ActiveCellIndicator = React13.memo(
5167
5333
  ActiveCellIndicatorFn
5168
5334
  );
5169
5335
 
5336
+ // src/components/InfiniteTable/components/cell.css.ts
5337
+ var ColumnCellCls = "cell_ColumnCellCls__1eexc2a7 cell_CellCls__1eexc2a6";
5338
+ var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "cell_ColumnCellRecipe__1eexc2an", variantClassNames: { dragging: { false: "cell_ColumnCellRecipe_dragging_false__1eexc2ao", true: "cell_ColumnCellRecipe_dragging_true__1eexc2ap" }, insideDisabledDraggingPage: { true: "cell_ColumnCellRecipe_insideDisabledDraggingPage_true__1eexc2aq", false: "cell_ColumnCellRecipe_insideDisabledDraggingPage_false__1eexc2ar" }, cellSelected: { false: "cell_ColumnCellRecipe_cellSelected_false__1eexc2as", true: "cell_ColumnCellRecipe_cellSelected_true__1eexc2at" }, treeNode: { parent: "cell_ColumnCellRecipe_treeNode_parent__1eexc2au", leaf: "cell_ColumnCellRecipe_treeNode_leaf__1eexc2av", false: "cell_ColumnCellRecipe_treeNode_false__1eexc2aw" }, align: { start: "cell_ColumnCellRecipe_align_start__1eexc2ax", end: "cell_ColumnCellRecipe_align_end__1eexc2ay", center: "cell_ColumnCellRecipe_align_center__1eexc2az" }, verticalAlign: { start: "cell_ColumnCellRecipe_verticalAlign_start__1eexc2a10", end: "cell_ColumnCellRecipe_verticalAlign_end__1eexc2a11", center: "cell_ColumnCellRecipe_verticalAlign_center__1eexc2a12" }, rowActive: { false: "cell_ColumnCellRecipe_rowActive_false__1eexc2a13", true: "cell_ColumnCellRecipe_rowActive_true__1eexc2a14" }, groupRow: { false: "cell_ColumnCellRecipe_groupRow_false__1eexc2a15", true: "cell_ColumnCellRecipe_groupRow_true__1eexc2a16" }, groupCell: { false: "cell_ColumnCellRecipe_groupCell_false__1eexc2a17", true: "cell_ColumnCellRecipe_groupCell_true__1eexc2a18" }, rowDisabled: { false: "cell_ColumnCellRecipe_rowDisabled_false__1eexc2a19", true: "cell_ColumnCellRecipe_rowDisabled_true__1eexc2a1a" }, zebra: { false: "cell_ColumnCellRecipe_zebra_false__1eexc2a1b", even: "cell_ColumnCellRecipe_zebra_even__1eexc2a1c", odd: "cell_ColumnCellRecipe_zebra_odd__1eexc2a1d" }, rowSelected: { true: "cell_ColumnCellRecipe_rowSelected_true__1eexc2a1e", false: "cell_ColumnCellRecipe_rowSelected_false__1eexc2a1f", null: "cell_ColumnCellRecipe_rowSelected_null__1eexc2a1g" }, first: { true: "cell_ColumnCellRecipe_first_true__1eexc2a1h", false: "cell_ColumnCellRecipe_first_false__1eexc2a1i" }, last: { true: "cell_ColumnCellRecipe_last_true__1eexc2a1j", false: "cell_ColumnCellRecipe_last_false__1eexc2a1k" }, groupByField: { true: "cell_ColumnCellRecipe_groupByField_true__1eexc2a1l", false: "cell_ColumnCellRecipe_groupByField_false__1eexc2a1m" }, firstInCategory: { true: "cell_ColumnCellRecipe_firstInCategory_true__1eexc2a1n", false: "cell_ColumnCellRecipe_firstInCategory_false__1eexc2a1o" }, firstRow: { true: "cell_ColumnCellRecipe_firstRow_true__1eexc2a1p", false: "cell_ColumnCellRecipe_firstRow_false__1eexc2a1q" }, firstRowInHorizontalLayoutPage: { true: "cell_ColumnCellRecipe_firstRowInHorizontalLayoutPage_true__1eexc2a1r", false: "cell_ColumnCellRecipe_firstRowInHorizontalLayoutPage_false__1eexc2a1s" }, lastInCategory: { true: "cell_ColumnCellRecipe_lastInCategory_true__1eexc2a1t", false: "cell_ColumnCellRecipe_lastInCategory_false__1eexc2a1u" }, pinned: { start: "cell_ColumnCellRecipe_pinned_start__1eexc2a1v", end: "cell_ColumnCellRecipe_pinned_end__1eexc2a1w", false: "cell_ColumnCellRecipe_pinned_false__1eexc2a1x" }, filtered: { true: "cell_ColumnCellRecipe_filtered_true__1eexc2a1y", false: "cell_ColumnCellRecipe_filtered_false__1eexc2a1z" } }, defaultVariants: {}, compoundVariants: [[{ firstRowInHorizontalLayoutPage: true, firstRow: false }, "cell_ColumnCellRecipe_compound_0__1eexc2a20"], [{ pinned: "start", lastInCategory: true }, "cell_ColumnCellRecipe_compound_1__1eexc2a21"], [{ pinned: "start", firstInCategory: true }, "cell_ColumnCellRecipe_compound_2__1eexc2a22"], [{ pinned: "end", firstInCategory: true }, "cell_ColumnCellRecipe_compound_3__1eexc2a23"], [{ pinned: "end", lastInCategory: true }, "cell_ColumnCellRecipe_compound_4__1eexc2a24"], [{ align: "center", groupCell: false }, "cell_ColumnCellRecipe_compound_5__1eexc2a25"], [{ rowDisabled: true, zebra: "odd" }, "cell_ColumnCellRecipe_compound_6__1eexc2a26"]] });
5339
+ var ColumnCellSelectionIndicatorRecipe = createRuntimeFn({ defaultClassName: "cell_ColumnCellSelectionIndicatorRecipe__1eexc2ae", variantClassNames: { right: { true: "cell_ColumnCellSelectionIndicatorRecipe_right_true__1eexc2af", false: "cell_ColumnCellSelectionIndicatorRecipe_right_false__1eexc2ag" }, left: { true: "cell_ColumnCellSelectionIndicatorRecipe_left_true__1eexc2ah", false: "cell_ColumnCellSelectionIndicatorRecipe_left_false__1eexc2ai" }, top: { true: "cell_ColumnCellSelectionIndicatorRecipe_top_true__1eexc2aj", false: "cell_ColumnCellSelectionIndicatorRecipe_top_false__1eexc2ak" }, bottom: { true: "cell_ColumnCellSelectionIndicatorRecipe_bottom_true__1eexc2al", false: "cell_ColumnCellSelectionIndicatorRecipe_bottom_false__1eexc2am" } }, defaultVariants: {}, compoundVariants: [] });
5340
+ var DetachedCellCls = "cell_DetachedCellCls__1eexc2a5";
5341
+ var FlashingColumnCellRecipe = createRuntimeFn({ defaultClassName: "cell_FlashingColumnCellRecipe__1eexc2aa", variantClassNames: { direction: { up: "cell_FlashingColumnCellRecipe_direction_up__1eexc2ab", down: "cell_FlashingColumnCellRecipe_direction_down__1eexc2ac", neutral: "cell_FlashingColumnCellRecipe_direction_neutral__1eexc2ad" } }, defaultVariants: {}, compoundVariants: [] });
5342
+ var SelectionCheckboxCls = "cell_SelectionCheckboxCls__1eexc2a8";
5343
+
5344
+ // src/components/InfiniteTable/components/cellDetachedCls.ts
5345
+ var CELL_DETACHED_CLASSNAMES = [
5346
+ DetachedCellCls,
5347
+ `${rootClassName2}DetachedCell`
5348
+ ];
5349
+
5170
5350
  // src/components/HeadlessTable/index.tsx
5351
+ var virtualScrollLeftOffset = stripVar(InternalVars.virtualScrollLeftOffset);
5352
+ var virtualScrollTopOffset = stripVar(InternalVars.virtualScrollTopOffset);
5171
5353
  function useMatrixBrain(brain, brainOptions, fixedCellsInfo) {
5172
5354
  if (fixedCellsInfo && (fixedCellsInfo.fixedColsStart || fixedCellsInfo.fixedColsEnd || fixedCellsInfo.fixedRowsStart || fixedCellsInfo.fixedRowsEnd)) {
5173
5355
  brain.updateFixedCells({
@@ -5207,6 +5389,7 @@ function HeadlessTable(props) {
5207
5389
  onRenderUpdater,
5208
5390
  wrapRowsHorizontally,
5209
5391
  forceRerenderTimestamp,
5392
+ scrollVarHostRef,
5210
5393
  ...domProps
5211
5394
  } = props;
5212
5395
  const { autoFocus } = domProps;
@@ -5239,7 +5422,24 @@ function HeadlessTable(props) {
5239
5422
  return remove;
5240
5423
  }, [wrapRowsHorizontally, brain]);
5241
5424
  const updateDOMTransform = useCallback4((scrollPos) => {
5242
- domRef.current.style.transform = `translate3d(${-scrollPos.scrollLeft}px, ${-scrollPos.scrollTop}px, 0px)`;
5425
+ requestAnimationFrame(() => {
5426
+ const scrollVarHost = scrollVarHostRef?.current;
5427
+ if (!scrollVarHost) {
5428
+ domRef.current.style.setProperty(
5429
+ "transform",
5430
+ `translate3d(${-scrollPos.scrollLeft}px, ${-scrollPos.scrollTop}px, 0px)`
5431
+ );
5432
+ return;
5433
+ }
5434
+ scrollVarHost.style.setProperty(
5435
+ virtualScrollLeftOffset,
5436
+ `-${scrollPos.scrollLeft}px`
5437
+ );
5438
+ scrollVarHost.style.setProperty(
5439
+ virtualScrollTopOffset,
5440
+ `-${scrollPos.scrollTop}px`
5441
+ );
5442
+ });
5243
5443
  }, []);
5244
5444
  const onContainerScroll = useCallback4(
5245
5445
  (scrollPos) => {
@@ -5280,7 +5480,8 @@ function HeadlessTable(props) {
5280
5480
  renderCell,
5281
5481
  renderDetailRow,
5282
5482
  brain,
5283
- cellHoverClassNames
5483
+ cellHoverClassNames,
5484
+ cellDetachedClassNames: CELL_DETACHED_CLASSNAMES
5284
5485
  }
5285
5486
  ),
5286
5487
  activeCellIndex != null ? /* @__PURE__ */ React14.createElement(
@@ -5897,10 +6098,10 @@ import * as React27 from "react";
5897
6098
  import { useEffect as useEffect10, useLayoutEffect as useLayoutEffect8, useState as useState5 } from "react";
5898
6099
 
5899
6100
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
5900
- var CellCls = "cell_CellCls__1eexc2a5 utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1p utilities_alignItems_center__16lm1iw1r utilities_position_absolute__16lm1iw2 utilities_willChange_transform__16lm1iw23 utilities_whiteSpace_nowrap__16lm1iw24 utilities_userSelect_none__16lm1iw17";
6101
+ var CellCls = "cell_CellCls__1eexc2a6";
5901
6102
  var HeaderCellContentRecipe = createRuntimeFn({ defaultClassName: "header_HeaderCellContentRecipe__12zfob129 utilities_height_100%__16lm1iw19 utilities_width_100%__16lm1iw1c utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1p utilities_alignItems_center__16lm1iw1r utilities_justifyContent_start__16lm1iw1w", variantClassNames: { filtered: { false: "header_HeaderCellContentRecipe_filtered_false__12zfob12a", true: "header_HeaderCellContentRecipe_filtered_true__12zfob12b" }, verticalAlign: { start: "header_HeaderCellContentRecipe_verticalAlign_start__12zfob12c", end: "header_HeaderCellContentRecipe_verticalAlign_end__12zfob12d", center: "header_HeaderCellContentRecipe_verticalAlign_center__12zfob12e" }, align: { start: "header_HeaderCellContentRecipe_align_start__12zfob12f", end: "header_HeaderCellContentRecipe_align_end__12zfob12g", center: "header_HeaderCellContentRecipe_align_center__12zfob12h" } }, defaultVariants: {}, compoundVariants: [] });
5902
6103
  var HeaderCellProxy = "header_HeaderCellProxy__12zfob1n utilities_whiteSpace_nowrap__16lm1iw24 utilities_textOverflow_ellipsis__16lm1iw25 utilities_overflow_hidden__16lm1iw1y";
5903
- var HeaderCellRecipe = createRuntimeFn({ defaultClassName: "header_HeaderCellRecipe__12zfob1o utilities_display_block__16lm1iw12", variantClassNames: { rowActive: { false: "header_HeaderCellRecipe_rowActive_false__12zfob1p", true: "header_HeaderCellRecipe_rowActive_true__12zfob1q" }, cellSelected: { false: "header_HeaderCellRecipe_cellSelected_false__12zfob1r", true: "header_HeaderCellRecipe_cellSelected_true__12zfob1s" }, rowSelected: { false: "header_HeaderCellRecipe_rowSelected_false__12zfob1t", true: "header_HeaderCellRecipe_rowSelected_true__12zfob1u", null: "header_HeaderCellRecipe_rowSelected_null__12zfob1v" }, rowDisabled: { false: "header_HeaderCellRecipe_rowDisabled_false__12zfob1w", true: "header_HeaderCellRecipe_rowDisabled_true__12zfob1x" }, firstRow: { false: "header_HeaderCellRecipe_firstRow_false__12zfob1y", true: "header_HeaderCellRecipe_firstRow_true__12zfob1z" }, treeNode: { parent: "header_HeaderCellRecipe_treeNode_parent__12zfob110", leaf: "header_HeaderCellRecipe_treeNode_leaf__12zfob111", false: "header_HeaderCellRecipe_treeNode_false__12zfob112" }, firstRowInHorizontalLayoutPage: { false: "header_HeaderCellRecipe_firstRowInHorizontalLayoutPage_false__12zfob113", true: "header_HeaderCellRecipe_firstRowInHorizontalLayoutPage_true__12zfob114" }, groupRow: { false: "header_HeaderCellRecipe_groupRow_false__12zfob115", true: "header_HeaderCellRecipe_groupRow_true__12zfob116" }, groupCell: { false: "header_HeaderCellRecipe_groupCell_false__12zfob117", true: "header_HeaderCellRecipe_groupCell_true__12zfob118" }, align: { start: "header_HeaderCellRecipe_align_start__12zfob119", end: "header_HeaderCellRecipe_align_end__12zfob11a", center: "header_HeaderCellRecipe_align_center__12zfob11b" }, verticalAlign: { start: "header_HeaderCellRecipe_verticalAlign_start__12zfob11c", end: "header_HeaderCellRecipe_verticalAlign_end__12zfob11d", center: "header_HeaderCellRecipe_verticalAlign_center__12zfob11e" }, zebra: { false: "header_HeaderCellRecipe_zebra_false__12zfob11f", even: "header_HeaderCellRecipe_zebra_even__12zfob11g", odd: "header_HeaderCellRecipe_zebra_odd__12zfob11h" }, dragging: { true: "header_HeaderCellRecipe_dragging_true__12zfob11i", false: "header_HeaderCellRecipe_dragging_false__12zfob11j" }, insideDisabledDraggingPage: { true: "header_HeaderCellRecipe_insideDisabledDraggingPage_true__12zfob11k", false: "header_HeaderCellRecipe_insideDisabledDraggingPage_false__12zfob11l" }, first: { true: "header_HeaderCellRecipe_first_true__12zfob11m", false: "header_HeaderCellRecipe_first_false__12zfob11n" }, last: { true: "header_HeaderCellRecipe_last_true__12zfob11o", false: "header_HeaderCellRecipe_last_false__12zfob11p" }, groupByField: { true: "header_HeaderCellRecipe_groupByField_true__12zfob11q", false: "header_HeaderCellRecipe_groupByField_false__12zfob11r" }, firstInCategory: { true: "header_HeaderCellRecipe_firstInCategory_true__12zfob11s", false: "header_HeaderCellRecipe_firstInCategory_false__12zfob11t" }, lastInCategory: { true: "header_HeaderCellRecipe_lastInCategory_true__12zfob11u", false: "header_HeaderCellRecipe_lastInCategory_false__12zfob11v" }, pinned: { start: "header_HeaderCellRecipe_pinned_start__12zfob11w", end: "header_HeaderCellRecipe_pinned_end__12zfob11x", false: "header_HeaderCellRecipe_pinned_false__12zfob11y" }, filtered: { true: "header_HeaderCellRecipe_filtered_true__12zfob11z", false: "header_HeaderCellRecipe_filtered_false__12zfob120" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "header_HeaderCellRecipe_compound_0__12zfob121"], [{ pinned: "end", firstInCategory: true }, "header_HeaderCellRecipe_compound_1__12zfob122"], [{ pinned: false, lastInCategory: true }, "header_HeaderCellRecipe_compound_2__12zfob123"]] });
6104
+ var HeaderCellRecipe = createRuntimeFn({ defaultClassName: "header_HeaderCellRecipe__12zfob1o", variantClassNames: { rowActive: { false: "header_HeaderCellRecipe_rowActive_false__12zfob1p", true: "header_HeaderCellRecipe_rowActive_true__12zfob1q" }, cellSelected: { false: "header_HeaderCellRecipe_cellSelected_false__12zfob1r", true: "header_HeaderCellRecipe_cellSelected_true__12zfob1s" }, rowSelected: { false: "header_HeaderCellRecipe_rowSelected_false__12zfob1t", true: "header_HeaderCellRecipe_rowSelected_true__12zfob1u", null: "header_HeaderCellRecipe_rowSelected_null__12zfob1v" }, rowDisabled: { false: "header_HeaderCellRecipe_rowDisabled_false__12zfob1w", true: "header_HeaderCellRecipe_rowDisabled_true__12zfob1x" }, firstRow: { false: "header_HeaderCellRecipe_firstRow_false__12zfob1y", true: "header_HeaderCellRecipe_firstRow_true__12zfob1z" }, treeNode: { parent: "header_HeaderCellRecipe_treeNode_parent__12zfob110", leaf: "header_HeaderCellRecipe_treeNode_leaf__12zfob111", false: "header_HeaderCellRecipe_treeNode_false__12zfob112" }, firstRowInHorizontalLayoutPage: { false: "header_HeaderCellRecipe_firstRowInHorizontalLayoutPage_false__12zfob113", true: "header_HeaderCellRecipe_firstRowInHorizontalLayoutPage_true__12zfob114" }, groupRow: { false: "header_HeaderCellRecipe_groupRow_false__12zfob115", true: "header_HeaderCellRecipe_groupRow_true__12zfob116" }, groupCell: { false: "header_HeaderCellRecipe_groupCell_false__12zfob117", true: "header_HeaderCellRecipe_groupCell_true__12zfob118" }, align: { start: "header_HeaderCellRecipe_align_start__12zfob119", end: "header_HeaderCellRecipe_align_end__12zfob11a", center: "header_HeaderCellRecipe_align_center__12zfob11b" }, verticalAlign: { start: "header_HeaderCellRecipe_verticalAlign_start__12zfob11c", end: "header_HeaderCellRecipe_verticalAlign_end__12zfob11d", center: "header_HeaderCellRecipe_verticalAlign_center__12zfob11e" }, zebra: { false: "header_HeaderCellRecipe_zebra_false__12zfob11f", even: "header_HeaderCellRecipe_zebra_even__12zfob11g", odd: "header_HeaderCellRecipe_zebra_odd__12zfob11h" }, dragging: { true: "header_HeaderCellRecipe_dragging_true__12zfob11i", false: "header_HeaderCellRecipe_dragging_false__12zfob11j" }, insideDisabledDraggingPage: { true: "header_HeaderCellRecipe_insideDisabledDraggingPage_true__12zfob11k", false: "header_HeaderCellRecipe_insideDisabledDraggingPage_false__12zfob11l" }, first: { true: "header_HeaderCellRecipe_first_true__12zfob11m", false: "header_HeaderCellRecipe_first_false__12zfob11n" }, last: { true: "header_HeaderCellRecipe_last_true__12zfob11o", false: "header_HeaderCellRecipe_last_false__12zfob11p" }, groupByField: { true: "header_HeaderCellRecipe_groupByField_true__12zfob11q", false: "header_HeaderCellRecipe_groupByField_false__12zfob11r" }, firstInCategory: { true: "header_HeaderCellRecipe_firstInCategory_true__12zfob11s", false: "header_HeaderCellRecipe_firstInCategory_false__12zfob11t" }, lastInCategory: { true: "header_HeaderCellRecipe_lastInCategory_true__12zfob11u", false: "header_HeaderCellRecipe_lastInCategory_false__12zfob11v" }, pinned: { start: "header_HeaderCellRecipe_pinned_start__12zfob11w", end: "header_HeaderCellRecipe_pinned_end__12zfob11x", false: "header_HeaderCellRecipe_pinned_false__12zfob11y" }, filtered: { true: "header_HeaderCellRecipe_filtered_true__12zfob11z", false: "header_HeaderCellRecipe_filtered_false__12zfob120" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "header_HeaderCellRecipe_compound_0__12zfob121"], [{ pinned: "end", firstInCategory: true }, "header_HeaderCellRecipe_compound_1__12zfob122"], [{ pinned: false, lastInCategory: true }, "header_HeaderCellRecipe_compound_2__12zfob123"]] });
5904
6105
  var HeaderClsRecipe = createRuntimeFn({ defaultClassName: "header_HeaderClsRecipe__12zfob19 utilities_display_block__16lm1iw12 utilities_position_absolute__16lm1iw2", variantClassNames: { pinned: { start: "header_HeaderClsRecipe_pinned_start__12zfob1a", end: "header_HeaderClsRecipe_pinned_end__12zfob1b", false: "header_HeaderClsRecipe_pinned_false__12zfob1c" }, firstInCategory: { true: "header_HeaderClsRecipe_firstInCategory_true__12zfob1d", false: "header_HeaderClsRecipe_firstInCategory_false__12zfob1e" }, lastInCategory: { true: "header_HeaderClsRecipe_lastInCategory_true__12zfob1f", false: "header_HeaderClsRecipe_lastInCategory_false__12zfob1g" }, overflow: { true: "header_HeaderClsRecipe_overflow_true__12zfob1h", false: "header_HeaderClsRecipe_overflow_false__12zfob1i" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "header_HeaderClsRecipe_compound_0__12zfob1j"], [{ pinned: "start", firstInCategory: true }, "header_HeaderClsRecipe_compound_1__12zfob1k"], [{ overflow: true, pinned: "end" }, "header_HeaderClsRecipe_compound_2__12zfob1l"], [{ pinned: "end", lastInCategory: true }, "header_HeaderClsRecipe_compound_3__12zfob1m"]] });
5905
6106
  var HeaderFilterEditorCls = "header_HeaderFilterEditorCls__12zfob12r utilities_width_100%__16lm1iw1c utilities_height_100%__16lm1iw19";
5906
6107
  var HeaderFilterIconIndexCls = "header_HeaderFilterIconIndexCls__12zfob17";
@@ -8757,13 +8958,6 @@ function objectValuesExcept(obj, exceptList) {
8757
8958
  return result;
8758
8959
  }
8759
8960
 
8760
- // src/components/InfiniteTable/components/cell.css.ts
8761
- var ColumnCellCls = "cell_ColumnCellCls__1eexc2a6 cell_CellCls__1eexc2a5 utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1p utilities_alignItems_center__16lm1iw1r utilities_position_absolute__16lm1iw2 utilities_willChange_transform__16lm1iw23 utilities_whiteSpace_nowrap__16lm1iw24 utilities_userSelect_none__16lm1iw17";
8762
- var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "cell_ColumnCellRecipe__1eexc2am", variantClassNames: { dragging: { false: "cell_ColumnCellRecipe_dragging_false__1eexc2an", true: "cell_ColumnCellRecipe_dragging_true__1eexc2ao" }, insideDisabledDraggingPage: { true: "cell_ColumnCellRecipe_insideDisabledDraggingPage_true__1eexc2ap", false: "cell_ColumnCellRecipe_insideDisabledDraggingPage_false__1eexc2aq" }, cellSelected: { false: "cell_ColumnCellRecipe_cellSelected_false__1eexc2ar", true: "cell_ColumnCellRecipe_cellSelected_true__1eexc2as" }, treeNode: { parent: "cell_ColumnCellRecipe_treeNode_parent__1eexc2at", leaf: "cell_ColumnCellRecipe_treeNode_leaf__1eexc2au", false: "cell_ColumnCellRecipe_treeNode_false__1eexc2av" }, align: { start: "cell_ColumnCellRecipe_align_start__1eexc2aw", end: "cell_ColumnCellRecipe_align_end__1eexc2ax", center: "cell_ColumnCellRecipe_align_center__1eexc2ay" }, verticalAlign: { start: "cell_ColumnCellRecipe_verticalAlign_start__1eexc2az", end: "cell_ColumnCellRecipe_verticalAlign_end__1eexc2a10", center: "cell_ColumnCellRecipe_verticalAlign_center__1eexc2a11" }, rowActive: { false: "cell_ColumnCellRecipe_rowActive_false__1eexc2a12", true: "cell_ColumnCellRecipe_rowActive_true__1eexc2a13" }, groupRow: { false: "cell_ColumnCellRecipe_groupRow_false__1eexc2a14", true: "cell_ColumnCellRecipe_groupRow_true__1eexc2a15" }, groupCell: { false: "cell_ColumnCellRecipe_groupCell_false__1eexc2a16", true: "cell_ColumnCellRecipe_groupCell_true__1eexc2a17" }, rowDisabled: { false: "cell_ColumnCellRecipe_rowDisabled_false__1eexc2a18", true: "cell_ColumnCellRecipe_rowDisabled_true__1eexc2a19" }, zebra: { false: "cell_ColumnCellRecipe_zebra_false__1eexc2a1a", even: "cell_ColumnCellRecipe_zebra_even__1eexc2a1b", odd: "cell_ColumnCellRecipe_zebra_odd__1eexc2a1c" }, rowSelected: { true: "cell_ColumnCellRecipe_rowSelected_true__1eexc2a1d", false: "cell_ColumnCellRecipe_rowSelected_false__1eexc2a1e", null: "cell_ColumnCellRecipe_rowSelected_null__1eexc2a1f" }, first: { true: "cell_ColumnCellRecipe_first_true__1eexc2a1g", false: "cell_ColumnCellRecipe_first_false__1eexc2a1h" }, last: { true: "cell_ColumnCellRecipe_last_true__1eexc2a1i", false: "cell_ColumnCellRecipe_last_false__1eexc2a1j" }, groupByField: { true: "cell_ColumnCellRecipe_groupByField_true__1eexc2a1k", false: "cell_ColumnCellRecipe_groupByField_false__1eexc2a1l" }, firstInCategory: { true: "cell_ColumnCellRecipe_firstInCategory_true__1eexc2a1m", false: "cell_ColumnCellRecipe_firstInCategory_false__1eexc2a1n" }, firstRow: { true: "cell_ColumnCellRecipe_firstRow_true__1eexc2a1o", false: "cell_ColumnCellRecipe_firstRow_false__1eexc2a1p" }, firstRowInHorizontalLayoutPage: { true: "cell_ColumnCellRecipe_firstRowInHorizontalLayoutPage_true__1eexc2a1q", false: "cell_ColumnCellRecipe_firstRowInHorizontalLayoutPage_false__1eexc2a1r" }, lastInCategory: { true: "cell_ColumnCellRecipe_lastInCategory_true__1eexc2a1s", false: "cell_ColumnCellRecipe_lastInCategory_false__1eexc2a1t" }, pinned: { start: "cell_ColumnCellRecipe_pinned_start__1eexc2a1u", end: "cell_ColumnCellRecipe_pinned_end__1eexc2a1v", false: "cell_ColumnCellRecipe_pinned_false__1eexc2a1w" }, filtered: { true: "cell_ColumnCellRecipe_filtered_true__1eexc2a1x", false: "cell_ColumnCellRecipe_filtered_false__1eexc2a1y" } }, defaultVariants: {}, compoundVariants: [[{ firstRowInHorizontalLayoutPage: true, firstRow: false }, "cell_ColumnCellRecipe_compound_0__1eexc2a1z"], [{ pinned: "start", lastInCategory: true }, "cell_ColumnCellRecipe_compound_1__1eexc2a20"], [{ pinned: "start", firstInCategory: true }, "cell_ColumnCellRecipe_compound_2__1eexc2a21"], [{ pinned: "end", firstInCategory: true }, "cell_ColumnCellRecipe_compound_3__1eexc2a22"], [{ pinned: "end", lastInCategory: true }, "cell_ColumnCellRecipe_compound_4__1eexc2a23"], [{ align: "center", groupCell: false }, "cell_ColumnCellRecipe_compound_5__1eexc2a24"], [{ rowDisabled: true, zebra: "odd" }, "cell_ColumnCellRecipe_compound_6__1eexc2a25"]] });
8763
- var ColumnCellSelectionIndicatorRecipe = createRuntimeFn({ defaultClassName: "cell_ColumnCellSelectionIndicatorRecipe__1eexc2ad", variantClassNames: { right: { true: "cell_ColumnCellSelectionIndicatorRecipe_right_true__1eexc2ae", false: "cell_ColumnCellSelectionIndicatorRecipe_right_false__1eexc2af" }, left: { true: "cell_ColumnCellSelectionIndicatorRecipe_left_true__1eexc2ag", false: "cell_ColumnCellSelectionIndicatorRecipe_left_false__1eexc2ah" }, top: { true: "cell_ColumnCellSelectionIndicatorRecipe_top_true__1eexc2ai", false: "cell_ColumnCellSelectionIndicatorRecipe_top_false__1eexc2aj" }, bottom: { true: "cell_ColumnCellSelectionIndicatorRecipe_bottom_true__1eexc2ak", false: "cell_ColumnCellSelectionIndicatorRecipe_bottom_false__1eexc2al" } }, defaultVariants: {}, compoundVariants: [] });
8764
- var FlashingColumnCellRecipe = createRuntimeFn({ defaultClassName: "cell_FlashingColumnCellRecipe__1eexc2a9", variantClassNames: { direction: { up: "cell_FlashingColumnCellRecipe_direction_up__1eexc2aa", down: "cell_FlashingColumnCellRecipe_direction_down__1eexc2ab", neutral: "cell_FlashingColumnCellRecipe_direction_neutral__1eexc2ac" } }, defaultVariants: {}, compoundVariants: [] });
8765
- var SelectionCheckboxCls = "cell_SelectionCheckboxCls__1eexc2a7";
8766
-
8767
8961
  // src/components/InfiniteTable/components/CheckBox.tsx
8768
8962
  import * as React34 from "react";
8769
8963
  import { useEffect as useEffect13, useRef as useRef12 } from "react";
@@ -11028,7 +11222,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
11028
11222
 
11029
11223
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
11030
11224
  import * as React47 from "react";
11031
- import { useCallback as useCallback16, useEffect as useEffect16, useRef as useRef18 } from "react";
11225
+ import { useCallback as useCallback16, useRef as useRef18 } from "react";
11032
11226
 
11033
11227
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
11034
11228
  import * as React46 from "react";
@@ -11270,11 +11464,14 @@ function InfiniteTableHeaderGroup(props) {
11270
11464
 
11271
11465
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
11272
11466
  var { rootClassName: rootClassName9 } = internalProps;
11467
+ var EMPTY_ARR = [];
11273
11468
  var TableHeaderClassName = `${rootClassName9}Header`;
11469
+ var headerCls = HeaderClsRecipe({
11470
+ overflow: false
11471
+ });
11274
11472
  function InfiniteTableHeaderFn(props) {
11275
11473
  const {
11276
11474
  bodyBrain,
11277
- headerBrain: brain,
11278
11475
  columns,
11279
11476
  style: style2,
11280
11477
  className,
@@ -11289,21 +11486,6 @@ function InfiniteTableHeaderFn(props) {
11289
11486
  } = useInfiniteTable();
11290
11487
  const { computedColumnsMap } = computed;
11291
11488
  const domRef = useRef18(null);
11292
- const updateDOMTransform = useCallback16((scrollPosition) => {
11293
- if (domRef.current) {
11294
- domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
11295
- }
11296
- }, []);
11297
- useEffect16(() => {
11298
- const removeOnScroll = brain.onScroll(updateDOMTransform);
11299
- updateDOMTransform(
11300
- brain.getScrollPosition() || { scrollLeft: 0, scrollTop: 0 }
11301
- );
11302
- return removeOnScroll;
11303
- }, [brain]);
11304
- const headerCls = HeaderClsRecipe({
11305
- overflow: false
11306
- });
11307
11489
  const domProps = {
11308
11490
  ref: domRef,
11309
11491
  className: join(
@@ -11389,7 +11571,8 @@ function InfiniteTableHeaderFn(props) {
11389
11571
  name: "header",
11390
11572
  renderCell,
11391
11573
  brain: headerBrain,
11392
- cellHoverClassNames: []
11574
+ cellHoverClassNames: EMPTY_ARR,
11575
+ cellDetachedClassNames: CELL_DETACHED_CLASSNAMES
11393
11576
  }
11394
11577
  ));
11395
11578
  }
@@ -11533,7 +11716,7 @@ function TableHeaderWrapper(props) {
11533
11716
 
11534
11717
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
11535
11718
  import * as React49 from "react";
11536
- import { useEffect as useEffect17 } from "react";
11719
+ import { useEffect as useEffect16 } from "react";
11537
11720
 
11538
11721
  // src/components/utils/decamelize.ts
11539
11722
  function decamelize(str, options) {
@@ -11590,7 +11773,7 @@ var InfiniteTableLicenseFooter = React49.forwardRef(
11590
11773
  ref.current = node;
11591
11774
  }
11592
11775
  }, []);
11593
- useEffect17(() => {
11776
+ useEffect16(() => {
11594
11777
  const forceStyle = () => {
11595
11778
  setTimeout(() => {
11596
11779
  enforceStyle(domRef.current, defaultStyle);
@@ -14418,10 +14601,10 @@ var Indexer = class {
14418
14601
  };
14419
14602
 
14420
14603
  // src/components/DataSource/privateHooks/useLoadData.ts
14421
- import { useEffect as useEffect19, useMemo as useMemo7, useRef as useRef21, useState as useState13 } from "react";
14604
+ import { useEffect as useEffect18, useMemo as useMemo7, useRef as useRef21, useState as useState13 } from "react";
14422
14605
 
14423
14606
  // src/components/hooks/useEffectWithChanges.ts
14424
- import { useEffect as useEffect18, useRef as useRef20 } from "react";
14607
+ import { useEffect as useEffect17, useRef as useRef20 } from "react";
14425
14608
  function useEffectWithChanges(fn, deps) {
14426
14609
  const prevRef = useRef20({});
14427
14610
  const oldValuesRef = useRef20({});
@@ -14439,7 +14622,7 @@ function useEffectWithChanges(fn, deps) {
14439
14622
  }
14440
14623
  }
14441
14624
  prevRef.current = deps;
14442
- useEffect18(() => {
14625
+ useEffect17(() => {
14443
14626
  const changes2 = changesRef.current;
14444
14627
  let result = void 0;
14445
14628
  if (Object.keys(changes2).length !== 0) {
@@ -14457,7 +14640,7 @@ function useEffectWithObject(fn, deps) {
14457
14640
  useEffectDeps.push(deps[k]);
14458
14641
  }
14459
14642
  }
14460
- useEffect18(fn, useEffectDeps);
14643
+ useEffect17(fn, useEffectDeps);
14461
14644
  }
14462
14645
 
14463
14646
  // src/utils/composeFunctions.ts
@@ -17555,7 +17738,7 @@ function useLoadData(options) {
17555
17738
  horizontal: false
17556
17739
  });
17557
17740
  const scrollbarsRef = useRef21(scrollbars);
17558
- useEffect19(() => {
17741
+ useEffect18(() => {
17559
17742
  notifyScrollbarsChange.onChange((scrollbars2) => {
17560
17743
  if (!scrollbars2) {
17561
17744
  return;
@@ -17565,7 +17748,7 @@ function useLoadData(options) {
17565
17748
  });
17566
17749
  return () => notifyScrollbarsChange.destroy();
17567
17750
  }, [notifyScrollbarsChange]);
17568
- useEffect19(() => {
17751
+ useEffect18(() => {
17569
17752
  if (!livePagination) {
17570
17753
  return;
17571
17754
  }
@@ -17578,7 +17761,7 @@ function useLoadData(options) {
17578
17761
  });
17579
17762
  return () => cancelAnimationFrame(frameId);
17580
17763
  }, [livePaginationCursor]);
17581
- useEffect19(() => {
17764
+ useEffect18(() => {
17582
17765
  if (!livePagination || livePaginationCursor !== void 0) {
17583
17766
  return;
17584
17767
  }
@@ -17591,7 +17774,7 @@ function useLoadData(options) {
17591
17774
  });
17592
17775
  return () => cancelAnimationFrame(frameId);
17593
17776
  }, [dataArray.length, livePaginationCursor]);
17594
- useEffect19(() => {
17777
+ useEffect18(() => {
17595
17778
  const state = getComponentState();
17596
17779
  const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
17597
17780
  if (!scrollbars.vertical && livePagination2) {
@@ -17722,7 +17905,7 @@ function useLazyLoadRange(options, dependencies) {
17722
17905
  componentActions: actions,
17723
17906
  componentState
17724
17907
  } = options;
17725
- useEffect19(() => {
17908
+ useEffect18(() => {
17726
17909
  actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
17727
17910
  }, [componentState.data, componentState.dataParams]);
17728
17911
  const {
@@ -17803,7 +17986,7 @@ function useLazyLoadRange(options, dependencies) {
17803
17986
  groupRowsState
17804
17987
  }
17805
17988
  );
17806
- useEffect19(() => {
17989
+ useEffect18(() => {
17807
17990
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
17808
17991
  debouncedLoadRange();
17809
17992
  }
@@ -18610,7 +18793,7 @@ function getDataSourceStateRestoreForDetails(state) {
18610
18793
  // src/components/DataSource/privateHooks/useDataSource.tsx
18611
18794
  import React51, {
18612
18795
  useCallback as useCallback19,
18613
- useEffect as useEffect20,
18796
+ useEffect as useEffect19,
18614
18797
  useLayoutEffect as useLayoutEffect10,
18615
18798
  useState as useState14
18616
18799
  } from "react";
@@ -18682,7 +18865,7 @@ function useDataSourceInternal(props) {
18682
18865
  componentActions,
18683
18866
  getComponentState: getState
18684
18867
  });
18685
- useEffect20(() => {
18868
+ useEffect19(() => {
18686
18869
  componentState.onDataArrayChange?.(
18687
18870
  componentState.originalDataArray,
18688
18871
  componentState.originalDataArrayChangedInfo
@@ -18704,7 +18887,7 @@ function useDataSourceInternal(props) {
18704
18887
  });
18705
18888
  }
18706
18889
  }, [componentState.originalDataArrayChangedInfo]);
18707
- useEffect20(() => {
18890
+ useEffect19(() => {
18708
18891
  componentState.onReady?.(api);
18709
18892
  }, []);
18710
18893
  return {
@@ -19334,63 +19517,434 @@ function getRowDetailApi(param) {
19334
19517
  return rowDetailApi;
19335
19518
  }
19336
19519
 
19337
- // src/components/InfiniteTable/api/getImperativeApi.ts
19338
- function isSortInfoForColumn(sortInfo, col) {
19339
- if (sortInfo.id) {
19340
- if (sortInfo.id === col.id) {
19341
- return true;
19520
+ // src/components/utils/clamp.ts
19521
+ function clamp(value, min, max) {
19522
+ return Math.min(Math.max(value, min), max);
19523
+ }
19524
+
19525
+ // src/components/InfiniteTable/eventHandlers/keyboardNavigation.ts
19526
+ function getNextEnabledRowIndex(getDataSourceState, activeRowIndex, direction) {
19527
+ const dataArray = getDataSourceState().dataArray;
19528
+ const min = 0;
19529
+ const max = dataArray.length - 1;
19530
+ let i = activeRowIndex;
19531
+ do {
19532
+ i += direction;
19533
+ const rowInfo = dataArray[i];
19534
+ if (!rowInfo) {
19535
+ return i < min ? min : max;
19342
19536
  }
19343
- return false;
19344
- }
19345
- if (sortInfo.field) {
19346
- if (sortInfo.field === col.field) {
19347
- return true;
19537
+ if (!rowInfo.rowDisabled) {
19538
+ return i;
19348
19539
  }
19349
- }
19350
- return false;
19540
+ } while (i >= min && i <= max);
19541
+ return clamp(i, min, max);
19351
19542
  }
19352
- var InfiniteTableApiImpl = class {
19353
- constructor(context) {
19354
- this.hideFilterOperatorMenu = () => {
19355
- this.actions.filterOperatorMenuVisibleForColumnId = null;
19356
- };
19357
- this.getColumnOrder = () => {
19358
- return this.getComputed().computedColumnOrder;
19359
- };
19360
- this.getComputedColumnById = (columnId) => {
19361
- return this.getComputed().computedColumnsMap.get(columnId);
19362
- };
19363
- this.getVisibleColumnOrder = () => {
19364
- const order2 = this.getColumnOrder();
19365
- const visibleColumns = this.getComputed().computedVisibleColumnsMap;
19366
- return order2.filter((id) => visibleColumns.has(id));
19367
- };
19368
- this.persistEdit = async (arg) => {
19369
- arg = arg ?? {};
19370
- const { editingCell, editingValueRef } = this.getState();
19371
- if (!editingCell) {
19372
- return Promise.resolve(new Error("no edit in progress"));
19373
- }
19374
- await new Promise((resolve) => requestAnimationFrame(resolve));
19375
- const column = this.getComputed().computedColumnsMap.get(
19376
- editingCell.columnId
19377
- );
19378
- const value = arg.value ?? editingCell.value;
19379
- if (!editingCell.active && editingCell.waiting !== "persist") {
19380
- this.actions.editingCell = {
19381
- ...editingCell,
19382
- active: false,
19383
- waiting: "persist"
19384
- };
19385
- }
19386
- const params = {
19387
- ...getCellContext({
19388
- rowIndex: editingCell.rowIndex,
19389
- columnId: editingCell.columnId,
19390
- ...this.context,
19391
- api: this
19392
- }),
19393
- value,
19543
+ function handleRowNavigation(options, event) {
19544
+ const { getState, getDataSourceState, actions, api, dataSourceApi } = options;
19545
+ const { key } = event;
19546
+ const dataArray = getDataSourceState().dataArray;
19547
+ const arrLength = dataArray.length;
19548
+ const state = getState();
19549
+ const { brain } = state;
19550
+ let { activeRowIndex } = state;
19551
+ if (activeRowIndex == null) {
19552
+ return false;
19553
+ }
19554
+ const {
19555
+ start: [startRow],
19556
+ end: [endRow]
19557
+ } = brain.getRenderRange();
19558
+ const initialActiveRowIndex = activeRowIndex;
19559
+ const renderRowCount = endRow - startRow - 1;
19560
+ const min = 0;
19561
+ const max = arrLength - 1;
19562
+ const KeyToFunction = {
19563
+ ArrowDown: () => {
19564
+ activeRowIndex = getNextEnabledRowIndex(
19565
+ getDataSourceState,
19566
+ activeRowIndex,
19567
+ 1
19568
+ );
19569
+ },
19570
+ ArrowUp: () => {
19571
+ activeRowIndex = getNextEnabledRowIndex(
19572
+ getDataSourceState,
19573
+ activeRowIndex,
19574
+ -1
19575
+ );
19576
+ },
19577
+ ArrowLeft: () => {
19578
+ const rowInfo = dataArray[activeRowIndex];
19579
+ if (brain.isHorizontalLayoutBrain) {
19580
+ const rowsPerPage = brain.rowsPerPage;
19581
+ if (activeRowIndex - rowsPerPage >= min) {
19582
+ activeRowIndex = activeRowIndex - rowsPerPage;
19583
+ } else {
19584
+ KeyToFunction.ArrowUp();
19585
+ }
19586
+ return;
19587
+ }
19588
+ if (rowInfo && rowInfo.isGroupRow) {
19589
+ return api.collapseGroupRow(rowInfo.groupKeys);
19590
+ }
19591
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
19592
+ return api.rowDetailApi.collapseRowDetail(rowInfo.id);
19593
+ }
19594
+ return false;
19595
+ },
19596
+ ArrowRight: () => {
19597
+ const rowInfo = dataArray[activeRowIndex];
19598
+ if (brain.isHorizontalLayoutBrain) {
19599
+ const rowsPerPage = brain.rowsPerPage;
19600
+ if (activeRowIndex + rowsPerPage <= max) {
19601
+ activeRowIndex = activeRowIndex + rowsPerPage;
19602
+ } else {
19603
+ KeyToFunction.ArrowDown();
19604
+ }
19605
+ return;
19606
+ }
19607
+ if (rowInfo && rowInfo.isGroupRow) {
19608
+ return api.expandGroupRow(rowInfo.groupKeys);
19609
+ }
19610
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
19611
+ return api.rowDetailApi.expandRowDetail(rowInfo.id);
19612
+ }
19613
+ return false;
19614
+ },
19615
+ Enter: () => {
19616
+ const rowInfo = dataArray[activeRowIndex];
19617
+ if (rowInfo && rowInfo.isGroupRow) {
19618
+ return api.toggleGroupRow(rowInfo.groupKeys);
19619
+ }
19620
+ if (rowInfo && rowInfo.isTreeNode && rowInfo.isParentNode) {
19621
+ return dataSourceApi.treeApi.toggleNode(rowInfo.nodePath);
19622
+ }
19623
+ const hasRowDetail = api.rowDetailApi.isRowDetailEnabledForRow(
19624
+ rowInfo.id
19625
+ );
19626
+ if (hasRowDetail) {
19627
+ return api.rowDetailApi.toggleRowDetail(rowInfo.id);
19628
+ }
19629
+ return false;
19630
+ },
19631
+ PageDown: () => {
19632
+ activeRowIndex = Math.min(
19633
+ activeRowIndex + renderRowCount,
19634
+ arrLength - 1
19635
+ );
19636
+ },
19637
+ PageUp: () => {
19638
+ activeRowIndex = Math.max(activeRowIndex - renderRowCount, min);
19639
+ },
19640
+ End: () => {
19641
+ activeRowIndex = max;
19642
+ },
19643
+ Home: () => {
19644
+ activeRowIndex = min;
19645
+ }
19646
+ };
19647
+ const Fn = KeyToFunction[key];
19648
+ if (!Fn) {
19649
+ return false;
19650
+ }
19651
+ Fn();
19652
+ if (initialActiveRowIndex !== activeRowIndex) {
19653
+ actions.activeRowIndex = activeRowIndex;
19654
+ return true;
19655
+ }
19656
+ return false;
19657
+ }
19658
+ function computeNextActiveCellIndex(options, event) {
19659
+ const {
19660
+ api,
19661
+ getState,
19662
+ getComputed,
19663
+ getDataSourceState,
19664
+ dataSourceApi
19665
+ } = options;
19666
+ const { key, shiftKey } = event;
19667
+ const dataArray = getDataSourceState().dataArray;
19668
+ const state = getState();
19669
+ const { activeCellIndex, brain } = state;
19670
+ if (!activeCellIndex) {
19671
+ return false;
19672
+ }
19673
+ let [rowIndex, colIndex] = activeCellIndex;
19674
+ const {
19675
+ start: [startRow, startCol],
19676
+ end: [endRow, endCol]
19677
+ } = brain.getRenderRange();
19678
+ const renderRowCount = endRow - startRow - 1;
19679
+ const renderColCount = endCol - startCol - 1;
19680
+ const maxRow = getDataSourceState().dataArray.length - 1;
19681
+ const maxCol = getComputed().computedVisibleColumns.length - 1;
19682
+ const minRow = 0;
19683
+ const minCol = 0;
19684
+ rowIndex = clamp(rowIndex, 0, maxRow);
19685
+ colIndex = clamp(colIndex, 0, maxCol);
19686
+ const KeyToFunction = {
19687
+ ArrowDown: () => {
19688
+ rowIndex = clamp(rowIndex + 1, minRow, maxRow);
19689
+ },
19690
+ ArrowUp: () => {
19691
+ rowIndex = clamp(rowIndex - 1, minRow, maxRow);
19692
+ },
19693
+ ArrowLeft: () => {
19694
+ if (colIndex === minCol) {
19695
+ if (rowIndex !== minRow) {
19696
+ colIndex = maxCol;
19697
+ }
19698
+ if (brain.isHorizontalLayoutBrain) {
19699
+ const rowsPerPage = brain.rowsPerPage;
19700
+ if (rowIndex - rowsPerPage >= minRow) {
19701
+ rowIndex = rowIndex - rowsPerPage;
19702
+ } else {
19703
+ KeyToFunction.ArrowUp();
19704
+ }
19705
+ } else {
19706
+ KeyToFunction.ArrowUp();
19707
+ }
19708
+ } else {
19709
+ colIndex = clamp(colIndex - 1, minCol, maxCol);
19710
+ }
19711
+ },
19712
+ ArrowRight: () => {
19713
+ if (colIndex === maxCol) {
19714
+ if (rowIndex !== maxRow) {
19715
+ colIndex = minCol;
19716
+ }
19717
+ if (brain.isHorizontalLayoutBrain) {
19718
+ const rowsPerPage = brain.rowsPerPage;
19719
+ if (rowIndex + rowsPerPage <= maxRow) {
19720
+ rowIndex = rowIndex + rowsPerPage;
19721
+ } else {
19722
+ KeyToFunction.ArrowDown();
19723
+ }
19724
+ } else {
19725
+ KeyToFunction.ArrowDown();
19726
+ }
19727
+ } else {
19728
+ colIndex = clamp(colIndex + 1, minCol, maxCol);
19729
+ }
19730
+ },
19731
+ Enter: () => {
19732
+ const rowInfo = dataArray[rowIndex];
19733
+ if (rowInfo && rowInfo.isGroupRow) {
19734
+ return api.toggleGroupRow(rowInfo.groupKeys);
19735
+ }
19736
+ if (rowInfo && rowInfo.isTreeNode && rowInfo.isParentNode) {
19737
+ return dataSourceApi.treeApi.toggleNode(rowInfo.nodePath);
19738
+ }
19739
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
19740
+ return api.rowDetailApi.toggleRowDetail(rowInfo.id);
19741
+ }
19742
+ return false;
19743
+ },
19744
+ PageDown: () => {
19745
+ if (!shiftKey) {
19746
+ rowIndex = Math.min(rowIndex + renderRowCount, maxRow);
19747
+ } else {
19748
+ colIndex = Math.min(colIndex + renderColCount, maxCol);
19749
+ }
19750
+ },
19751
+ PageUp: () => {
19752
+ if (!shiftKey) {
19753
+ rowIndex = Math.max(rowIndex - renderRowCount, minRow);
19754
+ } else {
19755
+ colIndex = Math.max(colIndex - renderColCount, minCol);
19756
+ }
19757
+ },
19758
+ End: () => {
19759
+ if (!shiftKey) {
19760
+ rowIndex = maxRow;
19761
+ } else {
19762
+ colIndex = maxCol;
19763
+ }
19764
+ },
19765
+ Home: () => {
19766
+ if (!shiftKey) {
19767
+ rowIndex = minRow;
19768
+ } else {
19769
+ colIndex = minCol;
19770
+ }
19771
+ }
19772
+ };
19773
+ const Fn = KeyToFunction[key];
19774
+ if (!Fn) {
19775
+ return false;
19776
+ }
19777
+ Fn();
19778
+ return [rowIndex, colIndex];
19779
+ }
19780
+ function handleCellNavigation(options, event) {
19781
+ const result = computeNextActiveCellIndex(
19782
+ options,
19783
+ event
19784
+ );
19785
+ if (result) {
19786
+ options.actions.activeCellIndex = result;
19787
+ return true;
19788
+ }
19789
+ return false;
19790
+ }
19791
+ var validKeys = {
19792
+ ArrowUp: true,
19793
+ ArrowDown: true,
19794
+ ArrowLeft: true,
19795
+ ArrowRight: true,
19796
+ PageUp: true,
19797
+ PageDown: true,
19798
+ Home: true,
19799
+ End: true,
19800
+ Enter: true,
19801
+ " ": true
19802
+ };
19803
+ function handleKeyboardNavigation(options, event) {
19804
+ const { key } = event;
19805
+ const { getState } = options;
19806
+ const state = getState();
19807
+ const {
19808
+ activeRowIndex,
19809
+ activeCellIndex,
19810
+ keyboardNavigation,
19811
+ cellContextMenuVisibleFor,
19812
+ contextMenuVisibleFor
19813
+ } = state;
19814
+ if (cellContextMenuVisibleFor || contextMenuVisibleFor) {
19815
+ return false;
19816
+ }
19817
+ if (!validKeys[key]) {
19818
+ return false;
19819
+ }
19820
+ if (activeRowIndex != null && keyboardNavigation === "row") {
19821
+ return handleRowNavigation(options, event);
19822
+ }
19823
+ if (activeCellIndex != null && keyboardNavigation === "cell") {
19824
+ return handleCellNavigation(options, event);
19825
+ }
19826
+ return false;
19827
+ }
19828
+
19829
+ // src/components/InfiniteTable/api/getKeyboardNavigationApi.ts
19830
+ var KeyboardNavigationApi = class {
19831
+ constructor(param) {
19832
+ this.param = param;
19833
+ }
19834
+ setKeyboardNavigation(keyboardNavigation) {
19835
+ this.param.actions.keyboardNavigation = keyboardNavigation;
19836
+ }
19837
+ setActiveCellIndex(activeCellIndex) {
19838
+ this.param.actions.activeCellIndex = activeCellIndex;
19839
+ }
19840
+ setActiveRowIndex(activeRowIndex) {
19841
+ this.param.actions.activeRowIndex = activeRowIndex;
19842
+ }
19843
+ gotoRowWithDirection(direction) {
19844
+ const { getDataSourceState, getState } = this.param;
19845
+ const { activeRowIndex, keyboardNavigation } = getState();
19846
+ if (keyboardNavigation !== "row") {
19847
+ console.error("Keyboard navigation is not enabled for rows");
19848
+ return false;
19849
+ }
19850
+ if (activeRowIndex == null) {
19851
+ return false;
19852
+ }
19853
+ const newActiveRowIndex = getNextEnabledRowIndex(
19854
+ getDataSourceState,
19855
+ activeRowIndex,
19856
+ direction
19857
+ );
19858
+ if (newActiveRowIndex !== activeRowIndex) {
19859
+ this.param.actions.activeRowIndex = newActiveRowIndex;
19860
+ return newActiveRowIndex;
19861
+ }
19862
+ return false;
19863
+ }
19864
+ gotoRow(direction) {
19865
+ return this.gotoRowWithDirection(direction);
19866
+ }
19867
+ gotoNextRow() {
19868
+ return this.gotoRow(1);
19869
+ }
19870
+ gotoPreviousRow() {
19871
+ return this.gotoRow(-1);
19872
+ }
19873
+ gotoCell(config) {
19874
+ const { direction } = config;
19875
+ const key = direction == "top" ? "ArrowUp" : direction == "bottom" ? "ArrowDown" : direction == "left" ? "ArrowLeft" : "ArrowRight";
19876
+ const activeCellIndex = computeNextActiveCellIndex(this.param, {
19877
+ key,
19878
+ shiftKey: false
19879
+ });
19880
+ if (activeCellIndex === false) {
19881
+ return false;
19882
+ }
19883
+ this.param.actions.activeCellIndex = activeCellIndex;
19884
+ return activeCellIndex;
19885
+ }
19886
+ };
19887
+ function getKeyboardNavigationApi(param) {
19888
+ return new KeyboardNavigationApi(param);
19889
+ }
19890
+
19891
+ // src/components/InfiniteTable/api/getImperativeApi.ts
19892
+ function isSortInfoForColumn(sortInfo, col) {
19893
+ if (sortInfo.id) {
19894
+ if (sortInfo.id === col.id) {
19895
+ return true;
19896
+ }
19897
+ return false;
19898
+ }
19899
+ if (sortInfo.field) {
19900
+ if (sortInfo.field === col.field) {
19901
+ return true;
19902
+ }
19903
+ }
19904
+ return false;
19905
+ }
19906
+ var InfiniteTableApiImpl = class {
19907
+ constructor(context) {
19908
+ this.hideFilterOperatorMenu = () => {
19909
+ this.actions.filterOperatorMenuVisibleForColumnId = null;
19910
+ };
19911
+ this.getColumnOrder = () => {
19912
+ return this.getComputed().computedColumnOrder;
19913
+ };
19914
+ this.getComputedColumnById = (columnId) => {
19915
+ return this.getComputed().computedColumnsMap.get(columnId);
19916
+ };
19917
+ this.getVisibleColumnOrder = () => {
19918
+ const order2 = this.getColumnOrder();
19919
+ const visibleColumns = this.getComputed().computedVisibleColumnsMap;
19920
+ return order2.filter((id) => visibleColumns.has(id));
19921
+ };
19922
+ this.persistEdit = async (arg) => {
19923
+ arg = arg ?? {};
19924
+ const { editingCell, editingValueRef } = this.getState();
19925
+ if (!editingCell) {
19926
+ return Promise.resolve(new Error("no edit in progress"));
19927
+ }
19928
+ await new Promise((resolve) => requestAnimationFrame(resolve));
19929
+ const column = this.getComputed().computedColumnsMap.get(
19930
+ editingCell.columnId
19931
+ );
19932
+ const value = arg.value ?? editingCell.value;
19933
+ if (!editingCell.active && editingCell.waiting !== "persist") {
19934
+ this.actions.editingCell = {
19935
+ ...editingCell,
19936
+ active: false,
19937
+ waiting: "persist"
19938
+ };
19939
+ }
19940
+ const params = {
19941
+ ...getCellContext({
19942
+ rowIndex: editingCell.rowIndex,
19943
+ columnId: editingCell.columnId,
19944
+ ...this.context,
19945
+ api: this
19946
+ }),
19947
+ value,
19394
19948
  initialValue: editingCell.initialValue
19395
19949
  };
19396
19950
  let valueToPersist = value;
@@ -19768,6 +20322,14 @@ var InfiniteTableApiImpl = class {
19768
20322
  dataSourceActions: context.dataSourceActions,
19769
20323
  getDataSourceState: context.getDataSourceState
19770
20324
  });
20325
+ this.keyboardNavigationApi = getKeyboardNavigationApi({
20326
+ getState: context.getState,
20327
+ getDataSourceState: context.getDataSourceState,
20328
+ actions: context.actions,
20329
+ getComputed: context.getComputed,
20330
+ api: this,
20331
+ dataSourceApi: context.dataSourceApi
20332
+ });
19771
20333
  this.rowDetailApi = getRowDetailApi({
19772
20334
  getState: context.getState,
19773
20335
  actions: context.actions,
@@ -20260,7 +20822,7 @@ function getImperativeApi(context) {
20260
20822
 
20261
20823
  // src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
20262
20824
  import {
20263
- useEffect as useEffect21,
20825
+ useEffect as useEffect20,
20264
20826
  useRef as useRef22,
20265
20827
  useState as useState15
20266
20828
  } from "react";
@@ -20338,7 +20900,7 @@ function useAutoSizeColumns() {
20338
20900
  const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
20339
20901
  const getTheKey = useLatest(theKey);
20340
20902
  const lastExecutedIdentifierRef = useRef22(null);
20341
- useEffect21(() => {
20903
+ useEffect20(() => {
20342
20904
  const key = getTheKey();
20343
20905
  if (key == null) {
20344
20906
  return;
@@ -20351,7 +20913,7 @@ function useAutoSizeColumns() {
20351
20913
  };
20352
20914
  return brain.onRenderRangeChange(onChange);
20353
20915
  }, [brain]);
20354
- useEffect21(() => {
20916
+ useEffect20(() => {
20355
20917
  if (theKey == null) {
20356
20918
  return;
20357
20919
  }
@@ -20397,7 +20959,7 @@ function useAutoSizeColumns() {
20397
20959
 
20398
20960
  // src/components/InfiniteTable/hooks/useCellRendering.tsx
20399
20961
  import { useMemo as useMemo9 } from "react";
20400
- import { useCallback as useCallback20, useEffect as useEffect22, useRef as useRef24 } from "react";
20962
+ import { useCallback as useCallback20, useEffect as useEffect21, useRef as useRef24 } from "react";
20401
20963
  import * as React54 from "react";
20402
20964
 
20403
20965
  // src/components/InfiniteTable/hooks/useYourBrain.ts
@@ -20652,17 +21214,17 @@ function useCellRendering(param) {
20652
21214
  rowspan
20653
21215
  });
20654
21216
  const scrollTopMaxRef = useRef24(0);
20655
- useEffect22(() => {
21217
+ useEffect21(() => {
20656
21218
  return brain.onRenderCountChange(() => {
20657
21219
  scrollTopMaxRef.current = brain.scrollTopMax;
20658
21220
  });
20659
21221
  }, [brain]);
20660
- useEffect22(() => {
21222
+ useEffect21(() => {
20661
21223
  return brain.onRenderRangeChange((range) => {
20662
21224
  getState().onRenderRangeChange?.(range);
20663
21225
  });
20664
21226
  }, [brain]);
20665
- useEffect22(() => {
21227
+ useEffect21(() => {
20666
21228
  return brain.onScrollStop((scrollPosition) => {
20667
21229
  const { scrollTop: scrollTop2, scrollLeft: scrollLeft2 } = scrollPosition;
20668
21230
  if (scrollTop2 === 0) {
@@ -20702,13 +21264,13 @@ function useCellRendering(param) {
20702
21264
  }
20703
21265
  });
20704
21266
  }, [brain, onScrollToTop, onScrollToBottom, onScrollStop]);
20705
- useEffect22(() => {
21267
+ useEffect21(() => {
20706
21268
  if (!bodySize.height) {
20707
21269
  return;
20708
21270
  }
20709
21271
  actions.ready = true;
20710
21272
  }, [!!bodySize.height]);
20711
- useEffect22(() => {
21273
+ useEffect21(() => {
20712
21274
  if (!ready) {
20713
21275
  }
20714
21276
  const { onReady } = getState();
@@ -20717,7 +21279,7 @@ function useCellRendering(param) {
20717
21279
  }
20718
21280
  }, [ready]);
20719
21281
  const [, rerender] = useRerender();
20720
- useEffect22(() => {
21282
+ useEffect21(() => {
20721
21283
  rerender();
20722
21284
  }, [dataSourceState]);
20723
21285
  const renderCell = useCallback20(
@@ -20838,7 +21400,7 @@ function useCellRendering(param) {
20838
21400
  }
20839
21401
 
20840
21402
  // src/components/InfiniteTable/hooks/useComputed.ts
20841
- import { useEffect as useEffect25, useState as useState17 } from "react";
21403
+ import { useEffect as useEffect24, useState as useState17 } from "react";
20842
21404
 
20843
21405
  // src/components/InfiniteTable/utils/MultiCellSelector.ts
20844
21406
  var MultiCellSelector = class {
@@ -21111,7 +21673,7 @@ function useColumnSizeFn(columns) {
21111
21673
  }
21112
21674
 
21113
21675
  // src/components/InfiniteTable/hooks/useColumnsWhen.ts
21114
- import { useEffect as useEffect23, useLayoutEffect as useLayoutEffect11, useMemo as useMemo11 } from "react";
21676
+ import { useEffect as useEffect22, useLayoutEffect as useLayoutEffect11, useMemo as useMemo11 } from "react";
21115
21677
 
21116
21678
  // src/components/InfiniteTable/state/getInitialState.ts
21117
21679
  import { createRef } from "react";
@@ -21244,6 +21806,11 @@ var HorizontalLayoutMatrixBrain = class extends MatrixBrain {
21244
21806
  remainingSize,
21245
21807
  sizes.concat(sizes)
21246
21808
  );
21809
+ if (direction === "horizontal") {
21810
+ this.maxHorizontalRenderCount = renderCount;
21811
+ } else {
21812
+ this.maxVerticalRenderCount = renderCount;
21813
+ }
21247
21814
  renderCount = Math.min(count, renderCount);
21248
21815
  return renderCount;
21249
21816
  }
@@ -21957,13 +22524,13 @@ function useColumnsWhen() {
21957
22524
  pivotGrandTotalColumnPosition
21958
22525
  }
21959
22526
  } = useManagedComponentState();
21960
- useEffect23(() => {
22527
+ useEffect22(() => {
21961
22528
  dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
21962
22529
  }, [groupRenderStrategy]);
21963
- useEffect23(() => {
22530
+ useEffect22(() => {
21964
22531
  dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
21965
22532
  }, [pivotTotalColumnPosition]);
21966
- useEffect23(() => {
22533
+ useEffect22(() => {
21967
22534
  if (pivotGrandTotalColumnPosition != void 0) {
21968
22535
  dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
21969
22536
  }
@@ -22046,7 +22613,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
22046
22613
  });
22047
22614
  return Object.keys(computedColumns).length === 0 ? void 0 : computedColumns;
22048
22615
  }
22049
- useEffect23(() => {
22616
+ useEffect22(() => {
22050
22617
  const update = () => {
22051
22618
  componentActions.columnsWhenInlineGroupRenderStrategy = isTree ? void 0 : computeColumnsWhenInlineGroupRenderStrategy(
22052
22619
  columns,
@@ -22077,7 +22644,7 @@ function useColumnsWhenGrouping() {
22077
22644
  getComponentState
22078
22645
  } = useManagedComponentState();
22079
22646
  const toggleGroupRow = useToggleGroupRow();
22080
- useEffect23(() => {
22647
+ useEffect22(() => {
22081
22648
  const update = () => {
22082
22649
  const { columns: columnsWhenGrouping, groupColumnIds } = getColumnsWhenGrouping({
22083
22650
  columns,
@@ -22181,7 +22748,7 @@ function useHideColumns(groupByMap) {
22181
22748
  hideEmptyGroupColumns ? groupRowsIndexesInDataArray : null,
22182
22749
  hideEmptyGroupColumns
22183
22750
  ]);
22184
- useEffect23(() => {
22751
+ useEffect22(() => {
22185
22752
  const isGrouped = groupBy.length > 0;
22186
22753
  const currentState = getComponentState();
22187
22754
  const {
@@ -22592,7 +23159,7 @@ function useComputedRowHeight(param) {
22592
23159
  }
22593
23160
 
22594
23161
  // src/components/InfiniteTable/hooks/useScrollbars.ts
22595
- import { useState as useState16, useEffect as useEffect24, useLayoutEffect as useLayoutEffect12 } from "react";
23162
+ import { useState as useState16, useEffect as useEffect23, useLayoutEffect as useLayoutEffect12 } from "react";
22596
23163
  var INITIAL_SCROLLBARS = {
22597
23164
  vertical: false,
22598
23165
  horizontal: false
@@ -22601,7 +23168,7 @@ function useScrollbars(brain) {
22601
23168
  const { getComponentState: getInfiniteTableState } = useManagedComponentState();
22602
23169
  const { getState: getDataSourceState } = useDataSourceContextValue();
22603
23170
  const [scrollbars, setScrollbars] = useState16(INITIAL_SCROLLBARS);
22604
- useEffect24(() => {
23171
+ useEffect23(() => {
22605
23172
  return brain.onRenderCountChange(() => {
22606
23173
  const { scrollTopMax, scrollLeftMax } = brain;
22607
23174
  setScrollbars({
@@ -22676,7 +23243,7 @@ function useComputed() {
22676
23243
  }
22677
23244
  );
22678
23245
  });
22679
- useEffect25(() => {
23246
+ useEffect24(() => {
22680
23247
  dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
22681
23248
  }, [showSeparatePivotColumnForSingleAggregation]);
22682
23249
  const { multiSort, filterValue, filterTypes } = dataSourceState;
@@ -22984,7 +23551,7 @@ var useLicense = (licenseKey = "") => {
22984
23551
  }
22985
23552
  let valid2 = isValidLicense(licenseKey, {
22986
23553
  publishedAt: 1624970570587,
22987
- version: "6.1.0"
23554
+ version: "6.1.1"
22988
23555
  });
22989
23556
  if (!licenseKey && !valid2 && isInsidePlayground) {
22990
23557
  return true;
@@ -22995,18 +23562,18 @@ var useLicense = (licenseKey = "") => {
22995
23562
  };
22996
23563
 
22997
23564
  // src/components/InfiniteTable/hooks/useScrollToActiveCell.ts
22998
- import { useRef as useRef25, useEffect as useEffect26 } from "react";
23565
+ import { useRef as useRef25, useEffect as useEffect25 } from "react";
22999
23566
  var RETRIES = 10;
23000
23567
  function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
23001
23568
  const didScrollRef = useRef25(false);
23002
23569
  const rafId = useRef25(null);
23003
- useEffect26(() => {
23570
+ useEffect25(() => {
23004
23571
  if (activeCellIndex != null) {
23005
23572
  didScrollRef.current = false;
23006
23573
  cancelRaf(rafId.current);
23007
23574
  }
23008
23575
  }, [activeCellIndex]);
23009
- useEffect26(() => {
23576
+ useEffect25(() => {
23010
23577
  if (activeCellIndex != null && !didScrollRef.current) {
23011
23578
  let tryScroll2 = function(times = 0) {
23012
23579
  times++;
@@ -23034,18 +23601,18 @@ function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
23034
23601
  }
23035
23602
 
23036
23603
  // src/components/InfiniteTable/hooks/useScrollToActiveRow.ts
23037
- import { useRef as useRef26, useEffect as useEffect27 } from "react";
23604
+ import { useRef as useRef26, useEffect as useEffect26 } from "react";
23038
23605
  var RETRIES2 = 10;
23039
23606
  function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
23040
23607
  const didScrollRef = useRef26(false);
23041
23608
  const rafId = useRef26(null);
23042
- useEffect27(() => {
23609
+ useEffect26(() => {
23043
23610
  if (activeRowIndex != null) {
23044
23611
  didScrollRef.current = false;
23045
23612
  cancelAnimationFrame(rafId.current);
23046
23613
  }
23047
23614
  }, [activeRowIndex]);
23048
- useEffect27(() => {
23615
+ useEffect26(() => {
23049
23616
  if (activeRowIndex != null && !didScrollRef.current) {
23050
23617
  let tryScroll2 = function(times = 0) {
23051
23618
  times++;
@@ -23074,7 +23641,7 @@ function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
23074
23641
  var toCSSVarName = (value) => `--infinite-${value}`;
23075
23642
 
23076
23643
  // src/components/InfiniteTable/eventHandlers/index.ts
23077
- import { useCallback as useCallback23, useMemo as useMemo15, useEffect as useEffect28 } from "react";
23644
+ import { useCallback as useCallback23, useMemo as useMemo15, useEffect as useEffect27 } from "react";
23078
23645
 
23079
23646
  // src/components/InfiniteTable/eventHandlers/onCellClick.ts
23080
23647
  function onCellClick(context, event) {
@@ -23142,379 +23709,78 @@ function updateCellSelectionOnCellClick(context, event) {
23142
23709
  horizontalLayout ? {
23143
23710
  horizontalLayout,
23144
23711
  rowsPerPage,
23145
- columnsPerSet
23146
- } : {
23147
- horizontalLayout
23148
- }
23149
- );
23150
- } else {
23151
- multiCellSelector.resetClick(position2);
23152
- }
23153
- dataSourceActions.cellSelection = cellSelection;
23154
- }
23155
- function updateRowSelectionOnCellClick(context, event) {
23156
- const {
23157
- rowIndex,
23158
- getDataSourceState,
23159
- getComputed,
23160
- dataSourceActions,
23161
- api,
23162
- cloneRowSelection: cloneRowSelection2
23163
- } = context;
23164
- const { multiRowSelector, renderSelectionCheckBox } = getComputed();
23165
- const dataSourceState = getDataSourceState();
23166
- const { selectionMode, groupBy, dataArray, isTree } = dataSourceState;
23167
- if (groupBy.length) {
23168
- return false;
23169
- }
23170
- if (isTree) {
23171
- return false;
23172
- }
23173
- const rowInfo = dataArray[rowIndex];
23174
- if (rowInfo?.rowDisabled) {
23175
- return false;
23176
- }
23177
- if (selectionMode === "multi-row") {
23178
- if (renderSelectionCheckBox && !event.key) {
23179
- return false;
23180
- }
23181
- let { rowSelection: rowSelectionState } = dataSourceState;
23182
- rowSelectionState = cloneRowSelection2(
23183
- rowSelectionState
23184
- );
23185
- multiRowSelector.rowSelectionState = rowSelectionState;
23186
- if (rowSelectionState && typeof rowSelectionState === "object") {
23187
- if (event.shiftKey) {
23188
- multiRowSelector.multiSelectClick(rowIndex);
23189
- } else if (event.metaKey || event.ctrlKey) {
23190
- multiRowSelector.singleAddClick(rowIndex);
23191
- } else {
23192
- multiRowSelector.resetClick(rowIndex);
23193
- }
23194
- dataSourceActions.rowSelection = rowSelectionState;
23195
- return true;
23196
- }
23197
- } else if (selectionMode === "single-row") {
23198
- const rowInfo2 = dataArray[rowIndex];
23199
- const id = rowInfo2.id;
23200
- if (event.metaKey || event.ctrlKey) {
23201
- api.rowSelectionApi.toggleRowSelection(id);
23202
- } else {
23203
- api.rowSelectionApi.selectRow(id);
23204
- }
23205
- }
23206
- return false;
23207
- }
23208
-
23209
- // src/components/InfiniteTable/eventHandlers/onCellMouseDown.ts
23210
- function onCellMouseDown(context, event) {
23211
- if (event.detail === 2) {
23212
- return;
23213
- }
23214
- updateCellSelectionOnCellMouseDown(context);
23215
- }
23216
- function updateCellSelectionOnCellMouseDown(_context) {
23217
- }
23218
-
23219
- // src/components/utils/clamp.ts
23220
- function clamp(value, min, max) {
23221
- return Math.min(Math.max(value, min), max);
23222
- }
23223
-
23224
- // src/components/InfiniteTable/eventHandlers/keyboardNavigation.ts
23225
- function getNextEnabledRowIndex(getDataSourceState, activeRowIndex, direction) {
23226
- const dataArray = getDataSourceState().dataArray;
23227
- const min = 0;
23228
- const max = dataArray.length - 1;
23229
- let i = activeRowIndex;
23230
- do {
23231
- i += direction;
23232
- const rowInfo = dataArray[i];
23233
- if (!rowInfo) {
23234
- return i < min ? min : max;
23235
- }
23236
- if (!rowInfo.rowDisabled) {
23237
- return i;
23238
- }
23239
- } while (i >= min && i <= max);
23240
- return clamp(i, min, max);
23241
- }
23242
- function handleRowNavigation(options, event) {
23243
- const { getState, getDataSourceState, actions, api, dataSourceApi } = options;
23244
- const { key } = event;
23245
- const dataArray = getDataSourceState().dataArray;
23246
- const arrLength = dataArray.length;
23247
- const state = getState();
23248
- const { brain } = state;
23249
- let { activeRowIndex } = state;
23250
- if (activeRowIndex == null) {
23251
- return false;
23252
- }
23253
- const {
23254
- start: [startRow],
23255
- end: [endRow]
23256
- } = brain.getRenderRange();
23257
- const initialActiveRowIndex = activeRowIndex;
23258
- const renderRowCount = endRow - startRow - 1;
23259
- const min = 0;
23260
- const max = arrLength - 1;
23261
- const KeyToFunction = {
23262
- ArrowDown: () => {
23263
- activeRowIndex = getNextEnabledRowIndex(
23264
- getDataSourceState,
23265
- activeRowIndex,
23266
- 1
23267
- );
23268
- },
23269
- ArrowUp: () => {
23270
- activeRowIndex = getNextEnabledRowIndex(
23271
- getDataSourceState,
23272
- activeRowIndex,
23273
- -1
23274
- );
23275
- },
23276
- ArrowLeft: () => {
23277
- const rowInfo = dataArray[activeRowIndex];
23278
- if (brain.isHorizontalLayoutBrain) {
23279
- const rowsPerPage = brain.rowsPerPage;
23280
- if (activeRowIndex - rowsPerPage >= min) {
23281
- activeRowIndex = activeRowIndex - rowsPerPage;
23282
- } else {
23283
- KeyToFunction.ArrowUp();
23284
- }
23285
- return;
23286
- }
23287
- if (rowInfo && rowInfo.isGroupRow) {
23288
- return api.collapseGroupRow(rowInfo.groupKeys);
23289
- }
23290
- if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
23291
- return api.rowDetailApi.collapseRowDetail(rowInfo.id);
23292
- }
23293
- return false;
23294
- },
23295
- ArrowRight: () => {
23296
- const rowInfo = dataArray[activeRowIndex];
23297
- if (brain.isHorizontalLayoutBrain) {
23298
- const rowsPerPage = brain.rowsPerPage;
23299
- if (activeRowIndex + rowsPerPage <= max) {
23300
- activeRowIndex = activeRowIndex + rowsPerPage;
23301
- } else {
23302
- KeyToFunction.ArrowDown();
23303
- }
23304
- return;
23305
- }
23306
- if (rowInfo && rowInfo.isGroupRow) {
23307
- return api.expandGroupRow(rowInfo.groupKeys);
23308
- }
23309
- if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
23310
- return api.rowDetailApi.expandRowDetail(rowInfo.id);
23311
- }
23312
- return false;
23313
- },
23314
- Enter: () => {
23315
- const rowInfo = dataArray[activeRowIndex];
23316
- if (rowInfo && rowInfo.isGroupRow) {
23317
- return api.toggleGroupRow(rowInfo.groupKeys);
23318
- }
23319
- if (rowInfo && rowInfo.isTreeNode && rowInfo.isParentNode) {
23320
- return dataSourceApi.treeApi.toggleNode(rowInfo.nodePath);
23321
- }
23322
- const hasRowDetail = api.rowDetailApi.isRowDetailEnabledForRow(
23323
- rowInfo.id
23324
- );
23325
- if (hasRowDetail) {
23326
- return api.rowDetailApi.toggleRowDetail(rowInfo.id);
23327
- }
23328
- return false;
23329
- },
23330
- PageDown: () => {
23331
- activeRowIndex = Math.min(
23332
- activeRowIndex + renderRowCount,
23333
- arrLength - 1
23334
- );
23335
- },
23336
- PageUp: () => {
23337
- activeRowIndex = Math.max(activeRowIndex - renderRowCount, min);
23338
- },
23339
- End: () => {
23340
- activeRowIndex = max;
23341
- },
23342
- Home: () => {
23343
- activeRowIndex = min;
23344
- }
23345
- };
23346
- const Fn = KeyToFunction[key];
23347
- if (!Fn) {
23348
- return false;
23349
- }
23350
- Fn();
23351
- if (initialActiveRowIndex !== activeRowIndex) {
23352
- actions.activeRowIndex = activeRowIndex;
23353
- return true;
23712
+ columnsPerSet
23713
+ } : {
23714
+ horizontalLayout
23715
+ }
23716
+ );
23717
+ } else {
23718
+ multiCellSelector.resetClick(position2);
23354
23719
  }
23355
- return false;
23720
+ dataSourceActions.cellSelection = cellSelection;
23356
23721
  }
23357
- function handleCellNavigation(options, event) {
23722
+ function updateRowSelectionOnCellClick(context, event) {
23358
23723
  const {
23359
- api,
23360
- getState,
23361
- getComputed,
23724
+ rowIndex,
23362
23725
  getDataSourceState,
23363
- dataSourceApi,
23364
- actions
23365
- } = options;
23366
- const { key, shiftKey } = event;
23367
- const dataArray = getDataSourceState().dataArray;
23368
- const state = getState();
23369
- const { activeCellIndex, brain } = state;
23370
- if (!activeCellIndex) {
23726
+ getComputed,
23727
+ dataSourceActions,
23728
+ api,
23729
+ cloneRowSelection: cloneRowSelection2
23730
+ } = context;
23731
+ const { multiRowSelector, renderSelectionCheckBox } = getComputed();
23732
+ const dataSourceState = getDataSourceState();
23733
+ const { selectionMode, groupBy, dataArray, isTree } = dataSourceState;
23734
+ if (groupBy.length) {
23371
23735
  return false;
23372
23736
  }
23373
- let [rowIndex, colIndex] = activeCellIndex;
23374
- const {
23375
- start: [startRow, startCol],
23376
- end: [endRow, endCol]
23377
- } = brain.getRenderRange();
23378
- const renderRowCount = endRow - startRow - 1;
23379
- const renderColCount = endCol - startCol - 1;
23380
- const maxRow = getDataSourceState().dataArray.length - 1;
23381
- const maxCol = getComputed().computedVisibleColumns.length - 1;
23382
- const minRow = 0;
23383
- const minCol = 0;
23384
- rowIndex = clamp(rowIndex, 0, maxRow);
23385
- colIndex = clamp(colIndex, 0, maxCol);
23386
- actions.activeCellIndex = [rowIndex, colIndex];
23387
- const KeyToFunction = {
23388
- ArrowDown: () => {
23389
- rowIndex = clamp(rowIndex + 1, minRow, maxRow);
23390
- },
23391
- ArrowUp: () => {
23392
- rowIndex = clamp(rowIndex - 1, minRow, maxRow);
23393
- },
23394
- ArrowLeft: () => {
23395
- if (colIndex === minCol) {
23396
- if (rowIndex !== minRow) {
23397
- colIndex = maxCol;
23398
- }
23399
- if (brain.isHorizontalLayoutBrain) {
23400
- const rowsPerPage = brain.rowsPerPage;
23401
- if (rowIndex - rowsPerPage >= minRow) {
23402
- rowIndex = rowIndex - rowsPerPage;
23403
- } else {
23404
- KeyToFunction.ArrowUp();
23405
- }
23406
- } else {
23407
- KeyToFunction.ArrowUp();
23408
- }
23409
- } else {
23410
- colIndex = clamp(colIndex - 1, minCol, maxCol);
23411
- }
23412
- },
23413
- ArrowRight: () => {
23414
- if (colIndex === maxCol) {
23415
- if (rowIndex !== maxRow) {
23416
- colIndex = minCol;
23417
- }
23418
- if (brain.isHorizontalLayoutBrain) {
23419
- const rowsPerPage = brain.rowsPerPage;
23420
- if (rowIndex + rowsPerPage <= maxRow) {
23421
- rowIndex = rowIndex + rowsPerPage;
23422
- } else {
23423
- KeyToFunction.ArrowDown();
23424
- }
23425
- } else {
23426
- KeyToFunction.ArrowDown();
23427
- }
23428
- } else {
23429
- colIndex = clamp(colIndex + 1, minCol, maxCol);
23430
- }
23431
- },
23432
- Enter: () => {
23433
- const rowInfo = dataArray[rowIndex];
23434
- if (rowInfo && rowInfo.isGroupRow) {
23435
- return api.toggleGroupRow(rowInfo.groupKeys);
23436
- }
23437
- if (rowInfo && rowInfo.isTreeNode && rowInfo.isParentNode) {
23438
- return dataSourceApi.treeApi.toggleNode(rowInfo.nodePath);
23439
- }
23440
- if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
23441
- return api.rowDetailApi.toggleRowDetail(rowInfo.id);
23442
- }
23737
+ if (isTree) {
23738
+ return false;
23739
+ }
23740
+ const rowInfo = dataArray[rowIndex];
23741
+ if (rowInfo?.rowDisabled) {
23742
+ return false;
23743
+ }
23744
+ if (selectionMode === "multi-row") {
23745
+ if (renderSelectionCheckBox && !event.key) {
23443
23746
  return false;
23444
- },
23445
- PageDown: () => {
23446
- if (!shiftKey) {
23447
- rowIndex = Math.min(rowIndex + renderRowCount, maxRow);
23448
- } else {
23449
- colIndex = Math.min(colIndex + renderColCount, maxCol);
23450
- }
23451
- },
23452
- PageUp: () => {
23453
- if (!shiftKey) {
23454
- rowIndex = Math.max(rowIndex - renderRowCount, minRow);
23455
- } else {
23456
- colIndex = Math.max(colIndex - renderColCount, minCol);
23457
- }
23458
- },
23459
- End: () => {
23460
- if (!shiftKey) {
23461
- rowIndex = maxRow;
23462
- } else {
23463
- colIndex = maxCol;
23464
- }
23465
- },
23466
- Home: () => {
23467
- if (!shiftKey) {
23468
- rowIndex = minRow;
23747
+ }
23748
+ let { rowSelection: rowSelectionState } = dataSourceState;
23749
+ rowSelectionState = cloneRowSelection2(
23750
+ rowSelectionState
23751
+ );
23752
+ multiRowSelector.rowSelectionState = rowSelectionState;
23753
+ if (rowSelectionState && typeof rowSelectionState === "object") {
23754
+ if (event.shiftKey) {
23755
+ multiRowSelector.multiSelectClick(rowIndex);
23756
+ } else if (event.metaKey || event.ctrlKey) {
23757
+ multiRowSelector.singleAddClick(rowIndex);
23469
23758
  } else {
23470
- colIndex = minCol;
23759
+ multiRowSelector.resetClick(rowIndex);
23471
23760
  }
23761
+ dataSourceActions.rowSelection = rowSelectionState;
23762
+ return true;
23763
+ }
23764
+ } else if (selectionMode === "single-row") {
23765
+ const rowInfo2 = dataArray[rowIndex];
23766
+ const id = rowInfo2.id;
23767
+ if (event.metaKey || event.ctrlKey) {
23768
+ api.rowSelectionApi.toggleRowSelection(id);
23769
+ } else {
23770
+ api.rowSelectionApi.selectRow(id);
23472
23771
  }
23473
- };
23474
- const Fn = KeyToFunction[key];
23475
- if (!Fn) {
23476
- return false;
23477
23772
  }
23478
- Fn();
23479
- actions.activeCellIndex = [rowIndex, colIndex];
23480
- return true;
23773
+ return false;
23481
23774
  }
23482
- var validKeys = {
23483
- ArrowUp: true,
23484
- ArrowDown: true,
23485
- ArrowLeft: true,
23486
- ArrowRight: true,
23487
- PageUp: true,
23488
- PageDown: true,
23489
- Home: true,
23490
- End: true,
23491
- Enter: true,
23492
- " ": true
23493
- };
23494
- function handleKeyboardNavigation(options, event) {
23495
- const { key } = event;
23496
- const { getState } = options;
23497
- const state = getState();
23498
- const {
23499
- activeRowIndex,
23500
- activeCellIndex,
23501
- keyboardNavigation,
23502
- cellContextMenuVisibleFor,
23503
- contextMenuVisibleFor
23504
- } = state;
23505
- if (cellContextMenuVisibleFor || contextMenuVisibleFor) {
23506
- return false;
23507
- }
23508
- if (!validKeys[key]) {
23509
- return false;
23510
- }
23511
- if (activeRowIndex != null && keyboardNavigation === "row") {
23512
- return handleRowNavigation(options, event);
23513
- }
23514
- if (activeCellIndex != null && keyboardNavigation === "cell") {
23515
- return handleCellNavigation(options, event);
23775
+
23776
+ // src/components/InfiniteTable/eventHandlers/onCellMouseDown.ts
23777
+ function onCellMouseDown(context, event) {
23778
+ if (event.detail === 2) {
23779
+ return;
23516
23780
  }
23517
- return false;
23781
+ updateCellSelectionOnCellMouseDown(context);
23782
+ }
23783
+ function updateCellSelectionOnCellMouseDown(_context) {
23518
23784
  }
23519
23785
 
23520
23786
  // src/components/InfiniteTable/eventHandlers/keyboardSelection.ts
@@ -24086,7 +24352,7 @@ function useEventHandlersContext() {
24086
24352
  }
24087
24353
  function handleDOMEvents() {
24088
24354
  const context = useEventHandlersContext();
24089
- useEffect28(() => {
24355
+ useEffect27(() => {
24090
24356
  const removeOnKeyDown = context.getState().keyDown.onChange((event) => {
24091
24357
  onKeyDown(context, event);
24092
24358
  });
@@ -24142,13 +24408,13 @@ function useDOMEventHandlers() {
24142
24408
  }
24143
24409
 
24144
24410
  // src/components/InfiniteTable/hooks/useColumnMenu.ts
24145
- import { useEffect as useEffect32 } from "react";
24411
+ import { useEffect as useEffect31 } from "react";
24146
24412
 
24147
24413
  // src/components/hooks/useOverlay/index.tsx
24148
24414
  import * as React56 from "react";
24149
24415
  import {
24150
24416
  useCallback as useCallback24,
24151
- useEffect as useEffect30,
24417
+ useEffect as useEffect29,
24152
24418
  useLayoutEffect as useLayoutEffect13,
24153
24419
  useState as useState18
24154
24420
  } from "react";
@@ -24539,7 +24805,7 @@ function DefaultOverlayPortal(props) {
24539
24805
  }
24540
24806
  function OverlayContent(props) {
24541
24807
  const nodeRef = React56.useRef(null);
24542
- useEffect30(() => {
24808
+ useEffect29(() => {
24543
24809
  return props.realign.onChange((handle) => {
24544
24810
  if (nodeRef.current && handle) {
24545
24811
  alignNode(nodeRef.current, handle);
@@ -25136,10 +25402,10 @@ function useMenuContext() {
25136
25402
  }
25137
25403
 
25138
25404
  // src/components/hooks/useMounted.ts
25139
- import { useCallback as useCallback25, useEffect as useEffect31, useRef as useRef28 } from "react";
25405
+ import { useCallback as useCallback25, useEffect as useEffect30, useRef as useRef28 } from "react";
25140
25406
  function useMounted() {
25141
25407
  let mountedRef = useRef28(true);
25142
- useEffect31(() => {
25408
+ useEffect30(() => {
25143
25409
  mountedRef.current = true;
25144
25410
  return () => {
25145
25411
  mountedRef.current = false;
@@ -25951,7 +26217,7 @@ function useColumnMenu() {
25951
26217
  } = useOverlay({
25952
26218
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
25953
26219
  });
25954
- useEffect32(() => {
26220
+ useEffect31(() => {
25955
26221
  const { actions: actions2, getState: getState2 } = context;
25956
26222
  const state = getState2();
25957
26223
  return state.onColumnMenuClick.onChange((info) => {
@@ -25966,7 +26232,7 @@ function useColumnMenu() {
25966
26232
  });
25967
26233
  }, []);
25968
26234
  const { columnMenuVisibleForColumnId, columnMenuVisibleKey } = getState();
25969
- useEffect32(() => {
26235
+ useEffect31(() => {
25970
26236
  const { columnMenuVisibleForColumnId: columnMenuVisibleForColumnId2, columnMenuTargetRef } = getState();
25971
26237
  if (columnMenuVisibleForColumnId2) {
25972
26238
  let handleMouseDown2 = function(event) {
@@ -26046,13 +26312,13 @@ function FocusDetect() {
26046
26312
  }
26047
26313
 
26048
26314
  // src/components/InfiniteTable/hooks/useEditingCallbackProps.ts
26049
- import { useEffect as useEffect33 } from "react";
26315
+ import { useEffect as useEffect32 } from "react";
26050
26316
  function useOnEditCancelled() {
26051
26317
  const context = useInfiniteTable();
26052
26318
  const { getState } = context;
26053
26319
  const { editingCell } = getState();
26054
26320
  const cancelled = editingCell && !editingCell.active ? editingCell.cancelled : void 0;
26055
- useEffect33(() => {
26321
+ useEffect32(() => {
26056
26322
  if (cancelled) {
26057
26323
  const { rowIndex, columnId, initialValue } = getState().editingCell;
26058
26324
  const { onEditCancelled } = getState();
@@ -26074,7 +26340,7 @@ function useOnEditRejected() {
26074
26340
  state: { editingCell }
26075
26341
  } = context;
26076
26342
  const rejected = editingCell && !editingCell.active && editingCell.accepted instanceof Error ? editingCell.accepted : void 0;
26077
- useEffect33(() => {
26343
+ useEffect32(() => {
26078
26344
  if (rejected) {
26079
26345
  const { rowIndex, columnId, value, initialValue } = getState().editingCell;
26080
26346
  const { onEditRejected } = getState();
@@ -26098,7 +26364,7 @@ function useFocusOnEditStop() {
26098
26364
  } = context;
26099
26365
  const active = editingCell?.active;
26100
26366
  const prevActive = usePrevious(active);
26101
- useEffect33(() => {
26367
+ useEffect32(() => {
26102
26368
  if (!active && prevActive) {
26103
26369
  context.api.focus();
26104
26370
  }
@@ -26111,7 +26377,7 @@ function useOnEditAccepted() {
26111
26377
  getState
26112
26378
  } = context;
26113
26379
  const accepted = editingCell && !editingCell.active && !editingCell.cancelled && editingCell.accepted === true;
26114
- useEffect33(() => {
26380
+ useEffect32(() => {
26115
26381
  if (accepted) {
26116
26382
  const { editingCell: editingCell2 } = getState();
26117
26383
  const { value, rowIndex, columnId, initialValue } = editingCell2;
@@ -26136,7 +26402,7 @@ function useOnEditPersisted() {
26136
26402
  getState
26137
26403
  } = context;
26138
26404
  const persisted = editingCell ? editingCell.persisted : void 0;
26139
- useEffect33(() => {
26405
+ useEffect32(() => {
26140
26406
  if (persisted) {
26141
26407
  const { editingCell: editingCell2, onEditPersistError, onEditPersistSuccess } = getState();
26142
26408
  if (!editingCell2) {
@@ -26169,7 +26435,7 @@ function useEditingCallbackProps() {
26169
26435
  }
26170
26436
 
26171
26437
  // src/components/InfiniteTable/hooks/useColumnFilterOperatorMenu.ts
26172
- import { useEffect as useEffect34 } from "react";
26438
+ import { useEffect as useEffect33 } from "react";
26173
26439
 
26174
26440
  // src/components/InfiniteTable/utils/getFilterOperatorMenuForColumn.tsx
26175
26441
  import * as React66 from "react";
@@ -26308,7 +26574,7 @@ function useColumnFilterOperatorMenu() {
26308
26574
  } = useOverlay({
26309
26575
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
26310
26576
  });
26311
- useEffect34(() => {
26577
+ useEffect33(() => {
26312
26578
  const { actions: actions2, getState: getState2 } = context;
26313
26579
  const state = getState2();
26314
26580
  return state.onFilterOperatorMenuClick.onChange((info) => {
@@ -26344,7 +26610,7 @@ function useColumnFilterOperatorMenu() {
26344
26610
  actions2.filterOperatorMenuVisibleForColumnId = column.id;
26345
26611
  });
26346
26612
  }, []);
26347
- useEffect34(() => {
26613
+ useEffect33(() => {
26348
26614
  const { filterOperatorMenuVisibleForColumnId } = getState();
26349
26615
  if (filterOperatorMenuVisibleForColumnId) {
26350
26616
  let handleMouseDown2 = function(event) {
@@ -26371,7 +26637,7 @@ function useColumnFilterOperatorMenu() {
26371
26637
  }
26372
26638
 
26373
26639
  // src/components/InfiniteTable/hooks/useContextMenu.ts
26374
- import { useEffect as useEffect35 } from "react";
26640
+ import { useEffect as useEffect34 } from "react";
26375
26641
 
26376
26642
  // src/components/InfiniteTable/utils/getCellContextMenu.tsx
26377
26643
  import * as React68 from "react";
@@ -26538,7 +26804,7 @@ function useCellContextMenu() {
26538
26804
  } = useOverlay({
26539
26805
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
26540
26806
  });
26541
- useEffect35(() => {
26807
+ useEffect34(() => {
26542
26808
  const { actions: actions2, getState: getState2, getDataSourceState } = context;
26543
26809
  const state = getState2();
26544
26810
  return state.cellContextMenu.onChange((info) => {
@@ -26589,7 +26855,7 @@ function useCellContextMenu() {
26589
26855
  }
26590
26856
  });
26591
26857
  }, []);
26592
- useEffect35(() => {
26858
+ useEffect34(() => {
26593
26859
  const { cellContextMenuVisibleFor } = getState();
26594
26860
  if (cellContextMenuVisibleFor) {
26595
26861
  let handleMouseDown2 = function(event) {
@@ -26625,7 +26891,7 @@ function useTableContextMenu() {
26625
26891
  } = useOverlay({
26626
26892
  portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
26627
26893
  });
26628
- useEffect35(() => {
26894
+ useEffect34(() => {
26629
26895
  const { actions: actions2, getState: getState2 } = context;
26630
26896
  const state = getState2();
26631
26897
  return state.contextMenu.onChange((info) => {
@@ -26674,7 +26940,7 @@ function useTableContextMenu() {
26674
26940
  }
26675
26941
  });
26676
26942
  }, []);
26677
- useEffect35(() => {
26943
+ useEffect34(() => {
26678
26944
  const { contextMenuVisibleFor } = getState();
26679
26945
  if (contextMenuVisibleFor) {
26680
26946
  let handleMouseDown2 = function(event) {
@@ -26705,13 +26971,13 @@ import { useRef as useRef30 } from "react";
26705
26971
  import * as React69 from "react";
26706
26972
 
26707
26973
  // src/components/InfiniteTable/hooks/useGridScroll.ts
26708
- import { useCallback as useCallback28, useEffect as useEffect36 } from "react";
26974
+ import { useCallback as useCallback28, useEffect as useEffect35 } from "react";
26709
26975
  function useGridScroll(onScroll, deps) {
26710
26976
  const {
26711
26977
  state: { brain }
26712
26978
  } = useInfiniteTable();
26713
26979
  const memoizedOnScroll = useCallback28(onScroll, deps);
26714
- useEffect36(() => {
26980
+ useEffect35(() => {
26715
26981
  const removeOnScroll = brain.onScroll(memoizedOnScroll);
26716
26982
  return removeOnScroll;
26717
26983
  }, [brain, memoizedOnScroll]);
@@ -26781,12 +27047,12 @@ function useVisibleColumnSizes() {
26781
27047
  var DEBUG_NAME = "InfiniteTable";
26782
27048
 
26783
27049
  // src/components/InfiniteTable/hooks/useToggleWrapRowsHorizontally.ts
26784
- import { useEffect as useEffect37 } from "react";
27050
+ import { useEffect as useEffect36 } from "react";
26785
27051
  function useToggleWrapRowsHorizontally() {
26786
27052
  const { state, getState, actions } = useInfiniteTable();
26787
27053
  const { wrapRowsHorizontally } = state;
26788
27054
  const oldWrapRowsHorizontally = usePrevious(wrapRowsHorizontally);
26789
- useEffect37(() => {
27055
+ useEffect36(() => {
26790
27056
  if (oldWrapRowsHorizontally !== wrapRowsHorizontally) {
26791
27057
  const { brain, headerBrain, renderer, onRenderUpdater } = getState();
26792
27058
  brain.destroy();
@@ -26803,12 +27069,12 @@ function useToggleWrapRowsHorizontally() {
26803
27069
  }
26804
27070
 
26805
27071
  // src/components/InfiniteTable/hooks/useHorizontalLayout.ts
26806
- import { useEffect as useEffect38 } from "react";
27072
+ import { useEffect as useEffect37 } from "react";
26807
27073
  function useHorizontalLayout() {
26808
27074
  const { getState, actions, dataSourceActions, getDataSourceState } = useInfiniteTable();
26809
27075
  const { groupBy, isTree } = getDataSourceState();
26810
27076
  const { brain, wrapRowsHorizontally, repeatWrappedGroupRows } = getState();
26811
- useEffect38(() => {
27077
+ useEffect37(() => {
26812
27078
  if (!wrapRowsHorizontally) {
26813
27079
  return;
26814
27080
  }
@@ -26964,7 +27230,8 @@ function InfiniteTableBody() {
26964
27230
  rowDetailRenderer,
26965
27231
  showHoverRows,
26966
27232
  wrapRowsHorizontally,
26967
- domProps
27233
+ domProps,
27234
+ domRef
26968
27235
  } = componentState;
26969
27236
  const LoadMaskCmp = components2?.LoadMask ?? LoadMask;
26970
27237
  const computed = getComputed();
@@ -27013,7 +27280,7 @@ function InfiniteTableBody() {
27013
27280
  const { renderCell, renderDetailRow } = useCellRendering({
27014
27281
  imperativeApi: api,
27015
27282
  getComputed,
27016
- domRef: componentState.domRef,
27283
+ domRef,
27017
27284
  bodySize,
27018
27285
  computed
27019
27286
  });
@@ -27038,7 +27305,8 @@ function InfiniteTableBody() {
27038
27305
  renderCell,
27039
27306
  renderDetailRow: rowDetailRenderer ? renderDetailRow : void 0,
27040
27307
  cellHoverClassNames: showHoverRows ? HOVERED_CLASS_NAMES : void 0,
27041
- scrollerDOMRef
27308
+ scrollerDOMRef,
27309
+ scrollVarHostRef: domRef
27042
27310
  }
27043
27311
  ), /* @__PURE__ */ React71.createElement(LoadMaskCmp, { visible: loading }, loadingText));
27044
27312
  }
@@ -27519,7 +27787,7 @@ var keyboardShortcuts = {
27519
27787
  };
27520
27788
 
27521
27789
  // src/components/hooks/useInterceptedMap.ts
27522
- import { useEffect as useEffect41 } from "react";
27790
+ import { useEffect as useEffect40 } from "react";
27523
27791
  function interceptMap(map2, fns) {
27524
27792
  const { set, delete: deleteKey, clear } = map2;
27525
27793
  if (fns.set) {
@@ -27681,7 +27949,7 @@ var WeakFixedSizeSet = _WeakFixedSizeSet;
27681
27949
  WeakFixedSizeSet.DEFAULT_SIZE = 10;
27682
27950
 
27683
27951
  // src/components/hooks/useEffectWhenSameDeps.ts
27684
- import { useEffect as useEffect42, useRef as useRef31 } from "react";
27952
+ import { useEffect as useEffect41, useRef as useRef31 } from "react";
27685
27953
  var isSameDeps = (deps, prevDeps) => {
27686
27954
  return deps.every((dep, index) => dep === prevDeps[index]);
27687
27955
  };
@@ -27695,7 +27963,7 @@ var useEffectWhenSameDeps = (callback, deps) => {
27695
27963
  effectDepsRef.current = effectDeps;
27696
27964
  const callbackRef = useRef31(callback);
27697
27965
  callbackRef.current = callback;
27698
- useEffect42(() => {
27966
+ useEffect41(() => {
27699
27967
  if (isInitialRef.current) {
27700
27968
  isInitialRef.current = false;
27701
27969
  return;
@@ -27705,7 +27973,7 @@ var useEffectWhenSameDeps = (callback, deps) => {
27705
27973
  };
27706
27974
 
27707
27975
  // src/components/hooks/useEffectWhen.ts
27708
- import { useEffect as useEffect43, useRef as useRef32 } from "react";
27976
+ import { useEffect as useEffect42, useRef as useRef32 } from "react";
27709
27977
  var isSameDeps2 = (deps, prevDeps, compare) => {
27710
27978
  return deps.every((dep, index) => {
27711
27979
  if (compare) {
@@ -27735,7 +28003,7 @@ var useEffectWhen = (callback, options) => {
27735
28003
  if (sameRespected && differentRespected) {
27736
28004
  isInitialRef.current = false;
27737
28005
  }
27738
- useEffect43(() => {
28006
+ useEffect42(() => {
27739
28007
  if (isInitialRef.current) {
27740
28008
  return;
27741
28009
  }