@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.js CHANGED
@@ -1453,7 +1453,7 @@ var internalProps = {
1453
1453
  };
1454
1454
 
1455
1455
  // src/components/InfiniteTable/internalVars.css.ts
1456
- 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)" };
1456
+ 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)" };
1457
1457
 
1458
1458
  // src/components/InfiniteTable/vars.css.ts
1459
1459
  var CSS_LOADED_VALUE = "true";
@@ -1673,6 +1673,8 @@ var MatrixBrain = class extends Logger {
1673
1673
  this.horizontalTotalSize = 0;
1674
1674
  this.horizontalRenderCount = void 0;
1675
1675
  this.verticalRenderCount = void 0;
1676
+ this.maxHorizontalRenderCount = 0;
1677
+ this.maxVerticalRenderCount = 0;
1676
1678
  this.horizontalExtendRangeBy = DEFAULT_EXTEND_BY;
1677
1679
  this.verticalExtendRangeBy = DEFAULT_EXTEND_BY;
1678
1680
  this.horizontalRenderRange = {
@@ -2353,6 +2355,9 @@ var MatrixBrain = class extends Logger {
2353
2355
  }
2354
2356
  };
2355
2357
  this.getRenderRangeCellCount = getRenderRangeCellCount;
2358
+ this.getMaxCellCount = () => {
2359
+ return this.maxHorizontalRenderCount * this.maxVerticalRenderCount;
2360
+ };
2356
2361
  this.getExtraCells = () => {
2357
2362
  return this.extraSpanCells;
2358
2363
  };
@@ -2714,6 +2719,11 @@ var MatrixBrain = class extends Logger {
2714
2719
  renderCount = (itemSize ? Math.ceil(size / itemSize) : 0) + 1;
2715
2720
  }
2716
2721
  renderCount += fixedStart + fixedEnd;
2722
+ if (direction === "horizontal") {
2723
+ this.maxHorizontalRenderCount = renderCount;
2724
+ } else {
2725
+ this.maxVerticalRenderCount = renderCount;
2726
+ }
2717
2727
  renderCount = Math.min(count, renderCount);
2718
2728
  return renderCount;
2719
2729
  }
@@ -2882,6 +2892,7 @@ var emptyFn = () => {
2882
2892
  var GridCellForReact = class {
2883
2893
  constructor(debugId, cellInfo) {
2884
2894
  this.element = null;
2895
+ this.mounted = false;
2885
2896
  this.mountSubscription = buildSubscriptionCallback();
2886
2897
  const count = CELL_COUNT_BY_DEBUG_ID.get(debugId) ?? 0;
2887
2898
  const key = `${debugId}:GridCellReact:${count}`;
@@ -2893,10 +2904,16 @@ var GridCellForReact = class {
2893
2904
  this.ref = (htmlElement) => {
2894
2905
  this.element = htmlElement;
2895
2906
  if (htmlElement) {
2907
+ this.mounted = true;
2896
2908
  this.mountSubscription(this);
2909
+ } else {
2910
+ this.mounted = false;
2897
2911
  }
2898
2912
  };
2899
2913
  }
2914
+ isMounted() {
2915
+ return this.mounted;
2916
+ }
2900
2917
  onMount(callback) {
2901
2918
  const off = this.mountSubscription.onChange((cell) => {
2902
2919
  if (cell != null) {
@@ -2927,10 +2944,12 @@ var GridCellForReact = class {
2927
2944
  }
2928
2945
  };
2929
2946
  var _GridCellPoolForReact = class extends Logger {
2947
+ // 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
2930
2948
  constructor(debugId) {
2931
2949
  super(`${debugId}:GridCellPoolForReact`);
2932
2950
  this.debugId = debugId;
2933
2951
  this.cellRemoveSubscription = buildSubscriptionCallback();
2952
+ this.cellAttachmentChangeSubscription = buildSubscriptionCallback();
2934
2953
  this.attachedCells = /* @__PURE__ */ new Set();
2935
2954
  this.detachedCells = /* @__PURE__ */ new Set();
2936
2955
  this.allCellsOrdered = /* @__PURE__ */ new Set();
@@ -2946,11 +2965,22 @@ var _GridCellPoolForReact = class extends Logger {
2946
2965
  });
2947
2966
  return off;
2948
2967
  }
2968
+ onCellAttachmentChange(callback) {
2969
+ const off = this.cellAttachmentChangeSubscription.onChange((res) => {
2970
+ if (res == null) {
2971
+ return;
2972
+ }
2973
+ const { cell, attached } = res;
2974
+ callback(cell, attached);
2975
+ });
2976
+ return off;
2977
+ }
2949
2978
  reset() {
2950
2979
  this.attachedCells.clear();
2951
2980
  this.detachedCells.clear();
2952
2981
  this.allCellsOrdered.clear();
2953
2982
  this.cellRemoveSubscription.destroy();
2983
+ this.cellAttachmentChangeSubscription.destroy();
2954
2984
  }
2955
2985
  getAttachedCells() {
2956
2986
  return this.attachedCells;
@@ -2995,16 +3025,31 @@ var _GridCellPoolForReact = class extends Logger {
2995
3025
  * If a cell is provided, it's moved to the attached set as well.
2996
3026
  */
2997
3027
  attachCell(cell) {
3028
+ if (cell && this.attachedCells.has(cell)) {
3029
+ return cell;
3030
+ }
2998
3031
  if (!cell) {
2999
3032
  cell = this.getDetachedCell();
3000
3033
  }
3001
3034
  this.detachedCells.delete(cell);
3002
3035
  this.attachedCells.add(cell);
3036
+ this.cellAttachmentChangeSubscription({
3037
+ cell,
3038
+ attached: true
3039
+ });
3003
3040
  return cell;
3004
3041
  }
3005
3042
  detachCell(cell) {
3043
+ if (this.detachedCells.has(cell)) {
3044
+ return false;
3045
+ }
3006
3046
  this.attachedCells.delete(cell);
3007
3047
  this.detachedCells.add(cell);
3048
+ this.cellAttachmentChangeSubscription({
3049
+ cell,
3050
+ attached: false
3051
+ });
3052
+ return true;
3008
3053
  }
3009
3054
  /**
3010
3055
  * This gets a detached cell from the pool.
@@ -3061,14 +3106,16 @@ var _GridCellPoolForReact = class extends Logger {
3061
3106
  };
3062
3107
  var GridCellPoolForReact = _GridCellPoolForReact;
3063
3108
  // we'll grow the pool by this amount at a time
3064
- GridCellPoolForReact.POOL_SIZE_INCREMENT = 5;
3109
+ GridCellPoolForReact.POOL_SIZE_INCREMENT = 1;
3065
3110
 
3066
3111
  // src/components/HeadlessTable/GridCellManager.ts
3112
+ var ASC_SORT = (a, b) => a - b;
3067
3113
  var GridCellManager = class extends Logger {
3068
3114
  constructor(debugId) {
3069
3115
  super(`${debugId}:GridCellManager`);
3070
3116
  this.matrix = new DeepMap();
3071
- this.matrixWithHistory = new DeepMap();
3117
+ this.rowsWithCellsHistory = /* @__PURE__ */ new Map();
3118
+ this.columnsWithCellsHistory = /* @__PURE__ */ new Map();
3072
3119
  this.cellToMatrixPosition = /* @__PURE__ */ new WeakMap();
3073
3120
  this.getCellsOutsideRenderRange = (range) => {
3074
3121
  const { start, end } = range;
@@ -3103,11 +3150,9 @@ var GridCellManager = class extends Logger {
3103
3150
  if (!cellPos) {
3104
3151
  return;
3105
3152
  }
3106
- this.matrix.delete(cellPos);
3107
- let cellsAtPos = this.matrixWithHistory.get(cellPos);
3108
- if (cellsAtPos) {
3109
- cellsAtPos.delete(cell);
3110
- }
3153
+ this.clearCellFromMatrix(cell, cellPos, {
3154
+ skipHistory: false
3155
+ });
3111
3156
  }
3112
3157
  set poolSize(cellCount) {
3113
3158
  this.pool.poolSize = cellCount;
@@ -3116,47 +3161,73 @@ var GridCellManager = class extends Logger {
3116
3161
  return this.pool.poolSize;
3117
3162
  }
3118
3163
  getDetachedCell() {
3119
- console.warn("getting detached cell");
3120
3164
  return this.pool.getDetachedCell();
3121
3165
  }
3166
+ clearCellFromMatrix(cell, cellPos, config) {
3167
+ this.matrix.delete(cellPos);
3168
+ if (config.skipHistory) {
3169
+ return;
3170
+ }
3171
+ const [rowIndex, colIndex] = cellPos;
3172
+ const cellsAtRow = this.rowsWithCellsHistory.get(rowIndex);
3173
+ const cellsAtCol = this.columnsWithCellsHistory.get(colIndex);
3174
+ if (cellsAtRow) {
3175
+ cellsAtRow.delete(cell);
3176
+ if (cellsAtRow.size === 0) {
3177
+ this.rowsWithCellsHistory.delete(rowIndex);
3178
+ }
3179
+ }
3180
+ if (cellsAtCol) {
3181
+ cellsAtCol.delete(cell);
3182
+ if (cellsAtCol.size === 0) {
3183
+ this.columnsWithCellsHistory.delete(colIndex);
3184
+ }
3185
+ }
3186
+ }
3187
+ addCellToMatrix(cell, cellPos) {
3188
+ const [rowIndex, colIndex] = cellPos;
3189
+ this.matrix.set(cellPos, cell);
3190
+ this.cellToMatrixPosition.set(cell, cellPos);
3191
+ let cellsAtRow = this.rowsWithCellsHistory.get(rowIndex);
3192
+ let cellsAtColumn = this.columnsWithCellsHistory.get(colIndex);
3193
+ if (!cellsAtRow) {
3194
+ cellsAtRow = /* @__PURE__ */ new Set();
3195
+ cellsAtRow.add(cell);
3196
+ this.rowsWithCellsHistory.set(rowIndex, cellsAtRow);
3197
+ } else {
3198
+ cellsAtRow.add(cell);
3199
+ }
3200
+ if (!cellsAtColumn) {
3201
+ cellsAtColumn = /* @__PURE__ */ new Set();
3202
+ cellsAtColumn.add(cell);
3203
+ this.columnsWithCellsHistory.set(colIndex, cellsAtColumn);
3204
+ } else {
3205
+ cellsAtColumn.add(cell);
3206
+ }
3207
+ }
3122
3208
  setCellPositionInMatrix(cell, cellPos) {
3209
+ const currentCellPos = this.cellToMatrixPosition.get(cell);
3123
3210
  if (cellPos == null) {
3124
- const currentCellPos = this.cellToMatrixPosition.get(cell);
3125
3211
  if (currentCellPos) {
3126
- this.matrix.delete(currentCellPos);
3127
- }
3128
- } else {
3129
- let prevCellPos = this.cellToMatrixPosition.get(cell);
3130
- const samePos = prevCellPos && prevCellPos[0] === cellPos[0] && prevCellPos[1] === cellPos[1];
3131
- this.matrix.set(cellPos, cell);
3132
- this.cellToMatrixPosition.set(cell, cellPos);
3133
- let cellsAtPos = this.matrixWithHistory.get(cellPos);
3134
- if (!cellsAtPos) {
3135
- cellsAtPos = /* @__PURE__ */ new Set();
3136
- cellsAtPos.add(cell);
3137
- this.matrixWithHistory.set(cellPos, cellsAtPos);
3138
- } else {
3139
- cellsAtPos.add(cell);
3140
- }
3141
- if (prevCellPos && !samePos) {
3142
- this.matrix.delete(prevCellPos);
3143
- let cellsAtPrevPos = this.matrixWithHistory.get(prevCellPos);
3144
- if (cellsAtPrevPos) {
3145
- cellsAtPrevPos.delete(cell);
3146
- }
3212
+ this.clearCellFromMatrix(cell, currentCellPos, {
3213
+ skipHistory: true
3214
+ });
3147
3215
  }
3216
+ return;
3217
+ }
3218
+ const [rowIndex, colIndex] = cellPos;
3219
+ const samePos = currentCellPos && currentCellPos[0] === rowIndex && currentCellPos[1] === colIndex;
3220
+ if (currentCellPos && !samePos) {
3221
+ this.clearCellFromMatrix(cell, currentCellPos, {
3222
+ skipHistory: false
3223
+ });
3148
3224
  }
3225
+ this.addCellToMatrix(cell, cellPos);
3149
3226
  }
3150
3227
  renderNodeAtCell(node, cell, cellPos, additionalInfo) {
3151
3228
  const currentCellAtPos = this.getCellAt(cellPos);
3152
- if (currentCellAtPos) {
3153
- if (currentCellAtPos !== cell) {
3154
- this.detachCellAt(cellPos);
3155
- this.detachCell(cell);
3156
- } else {
3157
- }
3158
- } else {
3159
- this.detachCell(cell);
3229
+ if (currentCellAtPos && currentCellAtPos !== cell) {
3230
+ this.detachCellAt(cellPos);
3160
3231
  }
3161
3232
  this.pool.attachCell(cell);
3162
3233
  this.setCellPositionInMatrix(cell, cellPos);
@@ -3198,34 +3269,16 @@ var GridCellManager = class extends Logger {
3198
3269
  }
3199
3270
  const [rowIndex, colIndex] = cellPos;
3200
3271
  if (optimise === "row") {
3201
- this.matrixWithHistory.visitSome((cellsForPos, [row], __, next) => {
3202
- if (cell) {
3203
- return true;
3204
- }
3205
- if (row === rowIndex) {
3206
- cell = setFind(cellsForPos, (c) => !this.isCellAttached(c));
3207
- if (cell) {
3208
- return true;
3209
- }
3210
- }
3211
- next?.();
3212
- return false;
3213
- });
3272
+ const cellsAtRow = this.rowsWithCellsHistory.get(rowIndex);
3273
+ if (cellsAtRow) {
3274
+ cell = setFind(cellsAtRow, (c) => !this.isCellAttached(c));
3275
+ }
3214
3276
  }
3215
3277
  if (optimise === "column") {
3216
- this.matrixWithHistory.visitSome((cellsForPos, [_row, col], __, next) => {
3217
- if (cell) {
3218
- return true;
3219
- }
3220
- if (col === colIndex) {
3221
- cell = setFind(cellsForPos, (c) => !this.isCellAttached(c));
3222
- if (cell) {
3223
- return true;
3224
- }
3225
- }
3226
- next?.();
3227
- return false;
3228
- });
3278
+ const cellsAtColumn = this.columnsWithCellsHistory.get(colIndex);
3279
+ if (cellsAtColumn) {
3280
+ cell = setFind(cellsAtColumn, (c) => !this.isCellAttached(c));
3281
+ }
3229
3282
  }
3230
3283
  return cell ?? this.getDetachedCell();
3231
3284
  }
@@ -3266,12 +3319,12 @@ var GridCellManager = class extends Logger {
3266
3319
  return cell;
3267
3320
  }
3268
3321
  getRowsWithCells() {
3269
- return this.matrix.rawKeysAt([]).sort();
3322
+ return this.matrix.rawKeysAt([]).sort(ASC_SORT);
3270
3323
  }
3271
3324
  getColumnsWithCells() {
3272
3325
  const positions = this.matrix.getUnnestedKeysStartingWith([], true);
3273
3326
  const columns = new Set(positions.map((pos) => pos[1]));
3274
- return [...columns.values()].sort();
3327
+ return [...columns.values()].sort(ASC_SORT);
3275
3328
  }
3276
3329
  isRowAttached(rowIndex) {
3277
3330
  return this.getRowsWithCells().includes(rowIndex);
@@ -3293,17 +3346,20 @@ var GridCellManager = class extends Logger {
3293
3346
  });
3294
3347
  }
3295
3348
  detachCell(cell) {
3296
- const cellPos = this.getCellPosition(cell);
3297
- if (cellPos) {
3298
- this.detachCellAt(cellPos);
3349
+ if (!cell) {
3350
+ return false;
3351
+ }
3352
+ if (this.pool.detachCell(cell)) {
3353
+ this.setCellPositionInMatrix(cell, null);
3299
3354
  }
3355
+ return true;
3300
3356
  }
3301
3357
  detachCells(cells) {
3302
3358
  cells.forEach((cell) => this.detachCell(cell));
3303
3359
  }
3304
3360
  detachRowsStartingWith(rowIndex) {
3305
3361
  const rows = this.getRowsWithCells().sort();
3306
- let idx = (0, import_binary_search2.default)(rows, rowIndex, (a, b) => a - b);
3362
+ let idx = (0, import_binary_search2.default)(rows, rowIndex, ASC_SORT);
3307
3363
  if (idx < 0) {
3308
3364
  idx = ~idx;
3309
3365
  }
@@ -3312,7 +3368,7 @@ var GridCellManager = class extends Logger {
3312
3368
  }
3313
3369
  detachColsStartingWith(colIndex) {
3314
3370
  const cols = this.getColumnsWithCells().sort();
3315
- let idx = (0, import_binary_search2.default)(cols, colIndex, (a, b) => a - b);
3371
+ let idx = (0, import_binary_search2.default)(cols, colIndex, ASC_SORT);
3316
3372
  if (idx < 0) {
3317
3373
  idx = ~idx;
3318
3374
  }
@@ -3331,9 +3387,12 @@ var GridCellManager = class extends Logger {
3331
3387
  detachCellAt(cellPos) {
3332
3388
  const cell = this.getCellAt(cellPos);
3333
3389
  if (cell) {
3334
- this.setCellPositionInMatrix(cell, null);
3335
- this.pool.detachCell(cell);
3390
+ return this.detachCell(cell);
3336
3391
  }
3392
+ return false;
3393
+ }
3394
+ onCellAttachmentChange(callback) {
3395
+ return this.pool.onCellAttachmentChange(callback);
3337
3396
  }
3338
3397
  getCellFromListForRow(cells, rowIndex) {
3339
3398
  return setFind(cells, (cell) => {
@@ -3354,7 +3413,8 @@ var GridCellManager = class extends Logger {
3354
3413
  reset() {
3355
3414
  this.pool.reset();
3356
3415
  this.matrix.clear();
3357
- this.matrixWithHistory.clear();
3416
+ this.rowsWithCellsHistory.clear();
3417
+ this.columnsWithCellsHistory.clear();
3358
3418
  this.offRemoveCell();
3359
3419
  this.offRemoveCell = () => {
3360
3420
  };
@@ -3364,6 +3424,9 @@ var GridCellManager = class extends Logger {
3364
3424
  cell.update(null);
3365
3425
  });
3366
3426
  }
3427
+ withDetachedCells(fn) {
3428
+ this.pool.getDetachedCells().forEach(fn);
3429
+ }
3367
3430
  };
3368
3431
 
3369
3432
  // src/components/HeadlessTable/ListRowManager.ts
@@ -3377,6 +3440,7 @@ var emptyFn2 = () => {
3377
3440
  var ListRowForReact = class {
3378
3441
  constructor(debugId) {
3379
3442
  this.element = null;
3443
+ this.mounted = false;
3380
3444
  this.mountSubscription = buildSubscriptionCallback();
3381
3445
  const count = ROW_COUNT_BY_DEBUG_ID.get(debugId) ?? 0;
3382
3446
  const key = `${debugId}:ListRowReact:${count}`;
@@ -3394,10 +3458,16 @@ var ListRowForReact = class {
3394
3458
  this.ref = (htmlElement) => {
3395
3459
  this.element = htmlElement;
3396
3460
  if (htmlElement) {
3461
+ this.mounted = true;
3397
3462
  this.mountSubscription(this);
3463
+ } else {
3464
+ this.mounted = false;
3398
3465
  }
3399
3466
  };
3400
3467
  }
3468
+ isMounted() {
3469
+ return this.mounted;
3470
+ }
3401
3471
  onMount(callback) {
3402
3472
  const off = this.mountSubscription.onChange((row) => {
3403
3473
  if (row != null) {
@@ -3428,6 +3498,7 @@ var _ListRowPoolForReact = class extends Logger {
3428
3498
  super(`${debugId}:ListRowPoolForReact`);
3429
3499
  this.debugId = debugId;
3430
3500
  this.rowRemoveSubscription = buildSubscriptionCallback();
3501
+ this.rowAttachmentChangeSubscription = buildSubscriptionCallback();
3431
3502
  this.attachedRows = /* @__PURE__ */ new Set();
3432
3503
  this.detachedRows = /* @__PURE__ */ new Set();
3433
3504
  this.allRowsOrdered = /* @__PURE__ */ new Set();
@@ -3443,11 +3514,22 @@ var _ListRowPoolForReact = class extends Logger {
3443
3514
  });
3444
3515
  return off;
3445
3516
  }
3517
+ onRowAttachmentChange(callback) {
3518
+ const off = this.rowAttachmentChangeSubscription.onChange((res) => {
3519
+ if (res == null) {
3520
+ return;
3521
+ }
3522
+ const { row, attached } = res;
3523
+ callback(row, attached);
3524
+ });
3525
+ return off;
3526
+ }
3446
3527
  reset() {
3447
3528
  this.attachedRows.clear();
3448
3529
  this.detachedRows.clear();
3449
3530
  this.allRowsOrdered.clear();
3450
3531
  this.rowRemoveSubscription.destroy();
3532
+ this.rowAttachmentChangeSubscription.destroy();
3451
3533
  }
3452
3534
  getAttachedRows() {
3453
3535
  return this.attachedRows;
@@ -3492,16 +3574,31 @@ var _ListRowPoolForReact = class extends Logger {
3492
3574
  * If a row is provided, it's moved to the attached set as well.
3493
3575
  */
3494
3576
  attachRow(row) {
3577
+ if (row && this.attachedRows.has(row)) {
3578
+ return row;
3579
+ }
3495
3580
  if (!row) {
3496
3581
  row = this.getDetachedRow();
3497
3582
  }
3498
3583
  this.detachedRows.delete(row);
3499
3584
  this.attachedRows.add(row);
3585
+ this.rowAttachmentChangeSubscription({
3586
+ row,
3587
+ attached: true
3588
+ });
3500
3589
  return row;
3501
3590
  }
3502
3591
  detachRow(row) {
3592
+ if (this.detachedRows.has(row)) {
3593
+ return false;
3594
+ }
3503
3595
  this.attachedRows.delete(row);
3504
3596
  this.detachedRows.add(row);
3597
+ this.rowAttachmentChangeSubscription({
3598
+ row,
3599
+ attached: false
3600
+ });
3601
+ return true;
3505
3602
  }
3506
3603
  /**
3507
3604
  * This gets a detached row from the pool.
@@ -3558,7 +3655,7 @@ var _ListRowPoolForReact = class extends Logger {
3558
3655
  };
3559
3656
  var ListRowPoolForReact = _ListRowPoolForReact;
3560
3657
  // we'll grow the pool by this amount at a time
3561
- ListRowPoolForReact.POOL_SIZE_INCREMENT = 5;
3658
+ ListRowPoolForReact.POOL_SIZE_INCREMENT = 1;
3562
3659
 
3563
3660
  // src/components/HeadlessTable/ListRowManager.ts
3564
3661
  var ListRowManager = class extends Logger {
@@ -3672,14 +3769,8 @@ var ListRowManager = class extends Logger {
3672
3769
  }
3673
3770
  renderNodeAtRow(node, row, rowIndex) {
3674
3771
  const currentRowAtPos = this.getRowAt(rowIndex);
3675
- if (currentRowAtPos) {
3676
- if (currentRowAtPos !== row) {
3677
- this.detachRowAt(rowIndex);
3678
- this.detachRow(row);
3679
- } else {
3680
- }
3681
- } else {
3682
- this.detachRow(row);
3772
+ if (currentRowAtPos && currentRowAtPos !== row) {
3773
+ this.detachRowAt(rowIndex);
3683
3774
  }
3684
3775
  this.pool.attachRow(row);
3685
3776
  this.setRowIndexInList(row, rowIndex);
@@ -3691,6 +3782,12 @@ var ListRowManager = class extends Logger {
3691
3782
  row.update(null);
3692
3783
  });
3693
3784
  }
3785
+ onRowAttachmentChange(callback) {
3786
+ return this.pool.onRowAttachmentChange(callback);
3787
+ }
3788
+ withDetachedRows(fn) {
3789
+ this.pool.getDetachedRows().forEach(fn);
3790
+ }
3694
3791
  destroy() {
3695
3792
  this.reset();
3696
3793
  }
@@ -3719,6 +3816,7 @@ var GridRenderer = class extends Logger {
3719
3816
  this.destroyed = false;
3720
3817
  this.scrolling = false;
3721
3818
  this.cellHoverClassNames = [];
3819
+ this.cellDetachedClassNames = [];
3722
3820
  this.lastEnteredRow = -1;
3723
3821
  this.lastExitedRow = -1;
3724
3822
  this.hoverRowUpdatesInProgress = /* @__PURE__ */ new Map();
@@ -4519,7 +4617,21 @@ var GridRenderer = class extends Logger {
4519
4617
  this.brain = brain;
4520
4618
  this.debugId = debugId;
4521
4619
  this.cellManager = new GridCellManager(debugId);
4620
+ this.cellManager.onCellAttachmentChange((cell, attached) => {
4621
+ if (attached) {
4622
+ this.onCellAttached(cell);
4623
+ } else {
4624
+ this.onCellDetached(cell);
4625
+ }
4626
+ });
4522
4627
  this.rowManager = new ListRowManager(debugId);
4628
+ this.rowManager.onRowAttachmentChange((row, attached) => {
4629
+ if (attached) {
4630
+ this.onRowAttached(row);
4631
+ } else {
4632
+ this.onRowDetached(row);
4633
+ }
4634
+ });
4523
4635
  this.renderRange = this.renderRange.bind(this);
4524
4636
  const removeOnScroll = brain.onScroll(this.adjustFixedElementsOnScroll);
4525
4637
  const removeOnSizeChange = brain.onAvailableSizeChange(() => {
@@ -4546,6 +4658,46 @@ var GridRenderer = class extends Logger {
4546
4658
  }
4547
4659
  return this.infiniteNode;
4548
4660
  }
4661
+ onCellAttached(cell) {
4662
+ if (this.cellDetachedClassNames.length) {
4663
+ const el = cell.getElement();
4664
+ if (el) {
4665
+ this.cellDetachedClassNames.forEach((className) => {
4666
+ el.classList.remove(className);
4667
+ });
4668
+ }
4669
+ }
4670
+ }
4671
+ onCellDetached(cell) {
4672
+ if (this.cellDetachedClassNames.length) {
4673
+ const el = cell.getElement();
4674
+ if (el) {
4675
+ this.cellDetachedClassNames.forEach((className) => {
4676
+ el.classList.add(className);
4677
+ });
4678
+ }
4679
+ }
4680
+ }
4681
+ onRowAttached(row) {
4682
+ if (this.cellDetachedClassNames.length) {
4683
+ const el = row.getElement();
4684
+ if (el) {
4685
+ this.cellDetachedClassNames.forEach((className) => {
4686
+ el.classList.remove(className);
4687
+ });
4688
+ }
4689
+ }
4690
+ }
4691
+ onRowDetached(row) {
4692
+ if (this.cellDetachedClassNames.length) {
4693
+ const el = row.getElement();
4694
+ if (el) {
4695
+ this.cellDetachedClassNames.forEach((className) => {
4696
+ el.classList.add(className);
4697
+ });
4698
+ }
4699
+ }
4700
+ }
4549
4701
  isCellRenderedAndMappedCorrectly(row, col) {
4550
4702
  const rendered = !!this.cellManager.getCellAt([row, col]);
4551
4703
  return {
@@ -4591,13 +4743,10 @@ var GridRenderer = class extends Logger {
4591
4743
  0
4592
4744
  );
4593
4745
  const renderRowCount = renderDetailRow ? ranges.reduce((sum2, range2) => sum2 + getRenderRangeRowCount(range2), 0) : 0;
4594
- cellManager.detachCellsStartingAt([
4595
- this.brain.getRowCount(),
4596
- this.brain.getColCount()
4597
- ]);
4598
- if (cellManager.poolSize > renderCount) {
4599
- cellManager.poolSize = renderCount;
4600
- }
4746
+ const rowCount = this.brain.getRowCount();
4747
+ const colCount = this.brain.getColCount();
4748
+ cellManager.detachCellsStartingAt([rowCount, colCount]);
4749
+ const maxCount = Math.min(rowCount * colCount, renderCount);
4601
4750
  if (renderDetailRow) {
4602
4751
  rowManager.detachStartingWith(this.brain.getRowCount());
4603
4752
  if (rowManager.poolSize > renderRowCount) {
@@ -4615,7 +4764,7 @@ var GridRenderer = class extends Logger {
4615
4764
  return true;
4616
4765
  });
4617
4766
  cellManager.detachCells(cellsOutsideRanges);
4618
- cellManager.poolSize = renderCount;
4767
+ cellManager.poolSize = maxCount;
4619
4768
  const visitedCells = /* @__PURE__ */ new Map();
4620
4769
  const visitedRows = /* @__PURE__ */ new Map();
4621
4770
  ranges.forEach((range2) => {
@@ -4700,9 +4849,7 @@ var GridRenderer = class extends Logger {
4700
4849
  }
4701
4850
  this.renderCellAt(rowIndex, colIndex, cell, renderCell);
4702
4851
  });
4703
- cellManager.makeDetachedCellsEmpty();
4704
4852
  if (renderDetailRow) {
4705
- rowManager.makeDetachedRowsEmpty();
4706
4853
  }
4707
4854
  let result = cellManager.getAllCells().map((cell) => cell.getNode());
4708
4855
  if (renderDetailRow) {
@@ -4735,14 +4882,20 @@ var GridRenderer = class extends Logger {
4735
4882
  },
4736
4883
  domRef: row.ref
4737
4884
  });
4738
- row.onMount((row2) => {
4739
- const element = row2.getElement();
4740
- if (element) {
4741
- element.style.position = "absolute";
4742
- element.style.left = "0px";
4743
- }
4744
- this.updateDetailElementPosition(row2);
4745
- });
4885
+ if (!row.isMounted()) {
4886
+ row.onMount((row2) => {
4887
+ const element = row2.getElement();
4888
+ if (element) {
4889
+ element.style.position = "absolute";
4890
+ element.style.left = "0px";
4891
+ }
4892
+ this.updateDetailElementPosition(row2);
4893
+ });
4894
+ }
4895
+ if (!renderedDetailNode) {
4896
+ this.rowManager.detachRow(row);
4897
+ return;
4898
+ }
4746
4899
  this.rowManager.renderNodeAtRow(renderedDetailNode, row, rowIndex);
4747
4900
  this.updateDetailElementPosition(row);
4748
4901
  return;
@@ -4786,19 +4939,29 @@ var GridRenderer = class extends Logger {
4786
4939
  onMouseLeave: this.onMouseLeave.bind(null, rowIndex),
4787
4940
  domRef: cell.ref
4788
4941
  });
4789
- cell.onMount((cell2) => {
4790
- const element = cell2.getElement();
4791
- if (element) {
4792
- element.style.position = "absolute";
4793
- element.style.left = "0px";
4794
- element.style.top = "0px";
4795
- }
4796
- this.updateElementPosition(cell2);
4797
- });
4942
+ if (!cell.isMounted()) {
4943
+ cell.onMount((cell2) => {
4944
+ const element = cell2.getElement();
4945
+ if (element) {
4946
+ element.style.position = "absolute";
4947
+ element.style.left = "0px";
4948
+ element.style.top = "0px";
4949
+ }
4950
+ this.updateElementPosition(cell2);
4951
+ });
4952
+ }
4798
4953
  const cellAdditionalInfo = this.brain.isHorizontalLayoutBrain ? {
4799
4954
  renderRowIndex,
4800
4955
  renderColIndex
4801
4956
  } : void 0;
4957
+ if (!renderedNode) {
4958
+ if (this.brain.isHorizontalLayoutBrain) {
4959
+ this.cellManager.detachCell(cell);
4960
+ } else {
4961
+ this.cellManager.detachCell(cell);
4962
+ }
4963
+ return;
4964
+ }
4802
4965
  this.cellManager.renderNodeAtCell(
4803
4966
  renderedNode,
4804
4967
  cell,
@@ -4911,6 +5074,9 @@ function RawTableFn(props) {
4911
5074
  (0, import_react6.useEffect)(() => {
4912
5075
  renderer.cellHoverClassNames = props.cellHoverClassNames || [];
4913
5076
  }, [renderer, props.cellHoverClassNames]);
5077
+ (0, import_react6.useEffect)(() => {
5078
+ renderer.cellDetachedClassNames = props.cellDetachedClassNames || [];
5079
+ }, [renderer, props.cellDetachedClassNames]);
4914
5080
  (0, import_react6.useLayoutEffect)(() => {
4915
5081
  const renderRange = brain.getRenderRange();
4916
5082
  renderer.renderRange(renderRange, {
@@ -5226,7 +5392,23 @@ var ActiveCellIndicator = React13.memo(
5226
5392
  ActiveCellIndicatorFn
5227
5393
  );
5228
5394
 
5395
+ // src/components/InfiniteTable/components/cell.css.ts
5396
+ var ColumnCellCls = "cell_ColumnCellCls__1eexc2a7 cell_CellCls__1eexc2a6";
5397
+ 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"]] });
5398
+ 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: [] });
5399
+ var DetachedCellCls = "cell_DetachedCellCls__1eexc2a5";
5400
+ 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: [] });
5401
+ var SelectionCheckboxCls = "cell_SelectionCheckboxCls__1eexc2a8";
5402
+
5403
+ // src/components/InfiniteTable/components/cellDetachedCls.ts
5404
+ var CELL_DETACHED_CLASSNAMES = [
5405
+ DetachedCellCls,
5406
+ `${rootClassName2}DetachedCell`
5407
+ ];
5408
+
5229
5409
  // src/components/HeadlessTable/index.tsx
5410
+ var virtualScrollLeftOffset = stripVar(InternalVars.virtualScrollLeftOffset);
5411
+ var virtualScrollTopOffset = stripVar(InternalVars.virtualScrollTopOffset);
5230
5412
  function useMatrixBrain(brain, brainOptions, fixedCellsInfo) {
5231
5413
  if (fixedCellsInfo && (fixedCellsInfo.fixedColsStart || fixedCellsInfo.fixedColsEnd || fixedCellsInfo.fixedRowsStart || fixedCellsInfo.fixedRowsEnd)) {
5232
5414
  brain.updateFixedCells({
@@ -5266,6 +5448,7 @@ function HeadlessTable(props) {
5266
5448
  onRenderUpdater,
5267
5449
  wrapRowsHorizontally,
5268
5450
  forceRerenderTimestamp,
5451
+ scrollVarHostRef,
5269
5452
  ...domProps
5270
5453
  } = props;
5271
5454
  const { autoFocus } = domProps;
@@ -5298,7 +5481,24 @@ function HeadlessTable(props) {
5298
5481
  return remove;
5299
5482
  }, [wrapRowsHorizontally, brain]);
5300
5483
  const updateDOMTransform = (0, import_react10.useCallback)((scrollPos) => {
5301
- domRef.current.style.transform = `translate3d(${-scrollPos.scrollLeft}px, ${-scrollPos.scrollTop}px, 0px)`;
5484
+ requestAnimationFrame(() => {
5485
+ const scrollVarHost = scrollVarHostRef?.current;
5486
+ if (!scrollVarHost) {
5487
+ domRef.current.style.setProperty(
5488
+ "transform",
5489
+ `translate3d(${-scrollPos.scrollLeft}px, ${-scrollPos.scrollTop}px, 0px)`
5490
+ );
5491
+ return;
5492
+ }
5493
+ scrollVarHost.style.setProperty(
5494
+ virtualScrollLeftOffset,
5495
+ `-${scrollPos.scrollLeft}px`
5496
+ );
5497
+ scrollVarHost.style.setProperty(
5498
+ virtualScrollTopOffset,
5499
+ `-${scrollPos.scrollTop}px`
5500
+ );
5501
+ });
5302
5502
  }, []);
5303
5503
  const onContainerScroll = (0, import_react10.useCallback)(
5304
5504
  (scrollPos) => {
@@ -5339,7 +5539,8 @@ function HeadlessTable(props) {
5339
5539
  renderCell,
5340
5540
  renderDetailRow,
5341
5541
  brain,
5342
- cellHoverClassNames
5542
+ cellHoverClassNames,
5543
+ cellDetachedClassNames: CELL_DETACHED_CLASSNAMES
5343
5544
  }
5344
5545
  ),
5345
5546
  activeCellIndex != null ? /* @__PURE__ */ React14.createElement(
@@ -5948,10 +6149,10 @@ var React27 = __toESM(require("react"));
5948
6149
  var import_react18 = require("react");
5949
6150
 
5950
6151
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
5951
- 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";
6152
+ var CellCls = "cell_CellCls__1eexc2a6";
5952
6153
  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: [] });
5953
6154
  var HeaderCellProxy = "header_HeaderCellProxy__12zfob1n utilities_whiteSpace_nowrap__16lm1iw24 utilities_textOverflow_ellipsis__16lm1iw25 utilities_overflow_hidden__16lm1iw1y";
5954
- 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"]] });
6155
+ 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"]] });
5955
6156
  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"]] });
5956
6157
  var HeaderFilterEditorCls = "header_HeaderFilterEditorCls__12zfob12r utilities_width_100%__16lm1iw1c utilities_height_100%__16lm1iw19";
5957
6158
  var HeaderFilterIconIndexCls = "header_HeaderFilterIconIndexCls__12zfob17";
@@ -8808,13 +9009,6 @@ function objectValuesExcept(obj, exceptList) {
8808
9009
  return result;
8809
9010
  }
8810
9011
 
8811
- // src/components/InfiniteTable/components/cell.css.ts
8812
- 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";
8813
- 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"]] });
8814
- 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: [] });
8815
- 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: [] });
8816
- var SelectionCheckboxCls = "cell_SelectionCheckboxCls__1eexc2a7";
8817
-
8818
9012
  // src/components/InfiniteTable/components/CheckBox.tsx
8819
9013
  var React34 = __toESM(require("react"));
8820
9014
  var import_react23 = require("react");
@@ -11321,11 +11515,14 @@ function InfiniteTableHeaderGroup(props) {
11321
11515
 
11322
11516
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
11323
11517
  var { rootClassName: rootClassName9 } = internalProps;
11518
+ var EMPTY_ARR = [];
11324
11519
  var TableHeaderClassName = `${rootClassName9}Header`;
11520
+ var headerCls = HeaderClsRecipe({
11521
+ overflow: false
11522
+ });
11325
11523
  function InfiniteTableHeaderFn(props) {
11326
11524
  const {
11327
11525
  bodyBrain,
11328
- headerBrain: brain,
11329
11526
  columns,
11330
11527
  style: style2,
11331
11528
  className,
@@ -11340,21 +11537,6 @@ function InfiniteTableHeaderFn(props) {
11340
11537
  } = useInfiniteTable();
11341
11538
  const { computedColumnsMap } = computed;
11342
11539
  const domRef = (0, import_react32.useRef)(null);
11343
- const updateDOMTransform = (0, import_react32.useCallback)((scrollPosition) => {
11344
- if (domRef.current) {
11345
- domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
11346
- }
11347
- }, []);
11348
- (0, import_react32.useEffect)(() => {
11349
- const removeOnScroll = brain.onScroll(updateDOMTransform);
11350
- updateDOMTransform(
11351
- brain.getScrollPosition() || { scrollLeft: 0, scrollTop: 0 }
11352
- );
11353
- return removeOnScroll;
11354
- }, [brain]);
11355
- const headerCls = HeaderClsRecipe({
11356
- overflow: false
11357
- });
11358
11540
  const domProps = {
11359
11541
  ref: domRef,
11360
11542
  className: join(
@@ -11440,7 +11622,8 @@ function InfiniteTableHeaderFn(props) {
11440
11622
  name: "header",
11441
11623
  renderCell,
11442
11624
  brain: headerBrain,
11443
- cellHoverClassNames: []
11625
+ cellHoverClassNames: EMPTY_ARR,
11626
+ cellDetachedClassNames: CELL_DETACHED_CLASSNAMES
11444
11627
  }
11445
11628
  ));
11446
11629
  }
@@ -19380,57 +19563,428 @@ function getRowDetailApi(param) {
19380
19563
  return rowDetailApi;
19381
19564
  }
19382
19565
 
19383
- // src/components/InfiniteTable/api/getImperativeApi.ts
19384
- function isSortInfoForColumn(sortInfo, col) {
19385
- if (sortInfo.id) {
19386
- if (sortInfo.id === col.id) {
19387
- return true;
19566
+ // src/components/utils/clamp.ts
19567
+ function clamp(value, min, max) {
19568
+ return Math.min(Math.max(value, min), max);
19569
+ }
19570
+
19571
+ // src/components/InfiniteTable/eventHandlers/keyboardNavigation.ts
19572
+ function getNextEnabledRowIndex(getDataSourceState, activeRowIndex, direction) {
19573
+ const dataArray = getDataSourceState().dataArray;
19574
+ const min = 0;
19575
+ const max = dataArray.length - 1;
19576
+ let i = activeRowIndex;
19577
+ do {
19578
+ i += direction;
19579
+ const rowInfo = dataArray[i];
19580
+ if (!rowInfo) {
19581
+ return i < min ? min : max;
19388
19582
  }
19389
- return false;
19390
- }
19391
- if (sortInfo.field) {
19392
- if (sortInfo.field === col.field) {
19393
- return true;
19583
+ if (!rowInfo.rowDisabled) {
19584
+ return i;
19394
19585
  }
19395
- }
19396
- return false;
19586
+ } while (i >= min && i <= max);
19587
+ return clamp(i, min, max);
19397
19588
  }
19398
- var InfiniteTableApiImpl = class {
19399
- constructor(context) {
19400
- this.hideFilterOperatorMenu = () => {
19401
- this.actions.filterOperatorMenuVisibleForColumnId = null;
19402
- };
19403
- this.getColumnOrder = () => {
19404
- return this.getComputed().computedColumnOrder;
19405
- };
19406
- this.getComputedColumnById = (columnId) => {
19407
- return this.getComputed().computedColumnsMap.get(columnId);
19408
- };
19409
- this.getVisibleColumnOrder = () => {
19410
- const order2 = this.getColumnOrder();
19411
- const visibleColumns = this.getComputed().computedVisibleColumnsMap;
19412
- return order2.filter((id) => visibleColumns.has(id));
19413
- };
19414
- this.persistEdit = async (arg) => {
19415
- arg = arg ?? {};
19416
- const { editingCell, editingValueRef } = this.getState();
19417
- if (!editingCell) {
19418
- return Promise.resolve(new Error("no edit in progress"));
19419
- }
19420
- await new Promise((resolve) => requestAnimationFrame(resolve));
19421
- const column = this.getComputed().computedColumnsMap.get(
19422
- editingCell.columnId
19589
+ function handleRowNavigation(options, event) {
19590
+ const { getState, getDataSourceState, actions, api, dataSourceApi } = options;
19591
+ const { key } = event;
19592
+ const dataArray = getDataSourceState().dataArray;
19593
+ const arrLength = dataArray.length;
19594
+ const state = getState();
19595
+ const { brain } = state;
19596
+ let { activeRowIndex } = state;
19597
+ if (activeRowIndex == null) {
19598
+ return false;
19599
+ }
19600
+ const {
19601
+ start: [startRow],
19602
+ end: [endRow]
19603
+ } = brain.getRenderRange();
19604
+ const initialActiveRowIndex = activeRowIndex;
19605
+ const renderRowCount = endRow - startRow - 1;
19606
+ const min = 0;
19607
+ const max = arrLength - 1;
19608
+ const KeyToFunction = {
19609
+ ArrowDown: () => {
19610
+ activeRowIndex = getNextEnabledRowIndex(
19611
+ getDataSourceState,
19612
+ activeRowIndex,
19613
+ 1
19423
19614
  );
19424
- const value = arg.value ?? editingCell.value;
19425
- if (!editingCell.active && editingCell.waiting !== "persist") {
19426
- this.actions.editingCell = {
19427
- ...editingCell,
19428
- active: false,
19429
- waiting: "persist"
19430
- };
19431
- }
19432
- const params = {
19433
- ...getCellContext({
19615
+ },
19616
+ ArrowUp: () => {
19617
+ activeRowIndex = getNextEnabledRowIndex(
19618
+ getDataSourceState,
19619
+ activeRowIndex,
19620
+ -1
19621
+ );
19622
+ },
19623
+ ArrowLeft: () => {
19624
+ const rowInfo = dataArray[activeRowIndex];
19625
+ if (brain.isHorizontalLayoutBrain) {
19626
+ const rowsPerPage = brain.rowsPerPage;
19627
+ if (activeRowIndex - rowsPerPage >= min) {
19628
+ activeRowIndex = activeRowIndex - rowsPerPage;
19629
+ } else {
19630
+ KeyToFunction.ArrowUp();
19631
+ }
19632
+ return;
19633
+ }
19634
+ if (rowInfo && rowInfo.isGroupRow) {
19635
+ return api.collapseGroupRow(rowInfo.groupKeys);
19636
+ }
19637
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
19638
+ return api.rowDetailApi.collapseRowDetail(rowInfo.id);
19639
+ }
19640
+ return false;
19641
+ },
19642
+ ArrowRight: () => {
19643
+ const rowInfo = dataArray[activeRowIndex];
19644
+ if (brain.isHorizontalLayoutBrain) {
19645
+ const rowsPerPage = brain.rowsPerPage;
19646
+ if (activeRowIndex + rowsPerPage <= max) {
19647
+ activeRowIndex = activeRowIndex + rowsPerPage;
19648
+ } else {
19649
+ KeyToFunction.ArrowDown();
19650
+ }
19651
+ return;
19652
+ }
19653
+ if (rowInfo && rowInfo.isGroupRow) {
19654
+ return api.expandGroupRow(rowInfo.groupKeys);
19655
+ }
19656
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
19657
+ return api.rowDetailApi.expandRowDetail(rowInfo.id);
19658
+ }
19659
+ return false;
19660
+ },
19661
+ Enter: () => {
19662
+ const rowInfo = dataArray[activeRowIndex];
19663
+ if (rowInfo && rowInfo.isGroupRow) {
19664
+ return api.toggleGroupRow(rowInfo.groupKeys);
19665
+ }
19666
+ if (rowInfo && rowInfo.isTreeNode && rowInfo.isParentNode) {
19667
+ return dataSourceApi.treeApi.toggleNode(rowInfo.nodePath);
19668
+ }
19669
+ const hasRowDetail = api.rowDetailApi.isRowDetailEnabledForRow(
19670
+ rowInfo.id
19671
+ );
19672
+ if (hasRowDetail) {
19673
+ return api.rowDetailApi.toggleRowDetail(rowInfo.id);
19674
+ }
19675
+ return false;
19676
+ },
19677
+ PageDown: () => {
19678
+ activeRowIndex = Math.min(
19679
+ activeRowIndex + renderRowCount,
19680
+ arrLength - 1
19681
+ );
19682
+ },
19683
+ PageUp: () => {
19684
+ activeRowIndex = Math.max(activeRowIndex - renderRowCount, min);
19685
+ },
19686
+ End: () => {
19687
+ activeRowIndex = max;
19688
+ },
19689
+ Home: () => {
19690
+ activeRowIndex = min;
19691
+ }
19692
+ };
19693
+ const Fn = KeyToFunction[key];
19694
+ if (!Fn) {
19695
+ return false;
19696
+ }
19697
+ Fn();
19698
+ if (initialActiveRowIndex !== activeRowIndex) {
19699
+ actions.activeRowIndex = activeRowIndex;
19700
+ return true;
19701
+ }
19702
+ return false;
19703
+ }
19704
+ function computeNextActiveCellIndex(options, event) {
19705
+ const {
19706
+ api,
19707
+ getState,
19708
+ getComputed,
19709
+ getDataSourceState,
19710
+ dataSourceApi
19711
+ } = options;
19712
+ const { key, shiftKey } = event;
19713
+ const dataArray = getDataSourceState().dataArray;
19714
+ const state = getState();
19715
+ const { activeCellIndex, brain } = state;
19716
+ if (!activeCellIndex) {
19717
+ return false;
19718
+ }
19719
+ let [rowIndex, colIndex] = activeCellIndex;
19720
+ const {
19721
+ start: [startRow, startCol],
19722
+ end: [endRow, endCol]
19723
+ } = brain.getRenderRange();
19724
+ const renderRowCount = endRow - startRow - 1;
19725
+ const renderColCount = endCol - startCol - 1;
19726
+ const maxRow = getDataSourceState().dataArray.length - 1;
19727
+ const maxCol = getComputed().computedVisibleColumns.length - 1;
19728
+ const minRow = 0;
19729
+ const minCol = 0;
19730
+ rowIndex = clamp(rowIndex, 0, maxRow);
19731
+ colIndex = clamp(colIndex, 0, maxCol);
19732
+ const KeyToFunction = {
19733
+ ArrowDown: () => {
19734
+ rowIndex = clamp(rowIndex + 1, minRow, maxRow);
19735
+ },
19736
+ ArrowUp: () => {
19737
+ rowIndex = clamp(rowIndex - 1, minRow, maxRow);
19738
+ },
19739
+ ArrowLeft: () => {
19740
+ if (colIndex === minCol) {
19741
+ if (rowIndex !== minRow) {
19742
+ colIndex = maxCol;
19743
+ }
19744
+ if (brain.isHorizontalLayoutBrain) {
19745
+ const rowsPerPage = brain.rowsPerPage;
19746
+ if (rowIndex - rowsPerPage >= minRow) {
19747
+ rowIndex = rowIndex - rowsPerPage;
19748
+ } else {
19749
+ KeyToFunction.ArrowUp();
19750
+ }
19751
+ } else {
19752
+ KeyToFunction.ArrowUp();
19753
+ }
19754
+ } else {
19755
+ colIndex = clamp(colIndex - 1, minCol, maxCol);
19756
+ }
19757
+ },
19758
+ ArrowRight: () => {
19759
+ if (colIndex === maxCol) {
19760
+ if (rowIndex !== maxRow) {
19761
+ colIndex = minCol;
19762
+ }
19763
+ if (brain.isHorizontalLayoutBrain) {
19764
+ const rowsPerPage = brain.rowsPerPage;
19765
+ if (rowIndex + rowsPerPage <= maxRow) {
19766
+ rowIndex = rowIndex + rowsPerPage;
19767
+ } else {
19768
+ KeyToFunction.ArrowDown();
19769
+ }
19770
+ } else {
19771
+ KeyToFunction.ArrowDown();
19772
+ }
19773
+ } else {
19774
+ colIndex = clamp(colIndex + 1, minCol, maxCol);
19775
+ }
19776
+ },
19777
+ Enter: () => {
19778
+ const rowInfo = dataArray[rowIndex];
19779
+ if (rowInfo && rowInfo.isGroupRow) {
19780
+ return api.toggleGroupRow(rowInfo.groupKeys);
19781
+ }
19782
+ if (rowInfo && rowInfo.isTreeNode && rowInfo.isParentNode) {
19783
+ return dataSourceApi.treeApi.toggleNode(rowInfo.nodePath);
19784
+ }
19785
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
19786
+ return api.rowDetailApi.toggleRowDetail(rowInfo.id);
19787
+ }
19788
+ return false;
19789
+ },
19790
+ PageDown: () => {
19791
+ if (!shiftKey) {
19792
+ rowIndex = Math.min(rowIndex + renderRowCount, maxRow);
19793
+ } else {
19794
+ colIndex = Math.min(colIndex + renderColCount, maxCol);
19795
+ }
19796
+ },
19797
+ PageUp: () => {
19798
+ if (!shiftKey) {
19799
+ rowIndex = Math.max(rowIndex - renderRowCount, minRow);
19800
+ } else {
19801
+ colIndex = Math.max(colIndex - renderColCount, minCol);
19802
+ }
19803
+ },
19804
+ End: () => {
19805
+ if (!shiftKey) {
19806
+ rowIndex = maxRow;
19807
+ } else {
19808
+ colIndex = maxCol;
19809
+ }
19810
+ },
19811
+ Home: () => {
19812
+ if (!shiftKey) {
19813
+ rowIndex = minRow;
19814
+ } else {
19815
+ colIndex = minCol;
19816
+ }
19817
+ }
19818
+ };
19819
+ const Fn = KeyToFunction[key];
19820
+ if (!Fn) {
19821
+ return false;
19822
+ }
19823
+ Fn();
19824
+ return [rowIndex, colIndex];
19825
+ }
19826
+ function handleCellNavigation(options, event) {
19827
+ const result = computeNextActiveCellIndex(
19828
+ options,
19829
+ event
19830
+ );
19831
+ if (result) {
19832
+ options.actions.activeCellIndex = result;
19833
+ return true;
19834
+ }
19835
+ return false;
19836
+ }
19837
+ var validKeys = {
19838
+ ArrowUp: true,
19839
+ ArrowDown: true,
19840
+ ArrowLeft: true,
19841
+ ArrowRight: true,
19842
+ PageUp: true,
19843
+ PageDown: true,
19844
+ Home: true,
19845
+ End: true,
19846
+ Enter: true,
19847
+ " ": true
19848
+ };
19849
+ function handleKeyboardNavigation(options, event) {
19850
+ const { key } = event;
19851
+ const { getState } = options;
19852
+ const state = getState();
19853
+ const {
19854
+ activeRowIndex,
19855
+ activeCellIndex,
19856
+ keyboardNavigation,
19857
+ cellContextMenuVisibleFor,
19858
+ contextMenuVisibleFor
19859
+ } = state;
19860
+ if (cellContextMenuVisibleFor || contextMenuVisibleFor) {
19861
+ return false;
19862
+ }
19863
+ if (!validKeys[key]) {
19864
+ return false;
19865
+ }
19866
+ if (activeRowIndex != null && keyboardNavigation === "row") {
19867
+ return handleRowNavigation(options, event);
19868
+ }
19869
+ if (activeCellIndex != null && keyboardNavigation === "cell") {
19870
+ return handleCellNavigation(options, event);
19871
+ }
19872
+ return false;
19873
+ }
19874
+
19875
+ // src/components/InfiniteTable/api/getKeyboardNavigationApi.ts
19876
+ var KeyboardNavigationApi = class {
19877
+ constructor(param) {
19878
+ this.param = param;
19879
+ }
19880
+ setKeyboardNavigation(keyboardNavigation) {
19881
+ this.param.actions.keyboardNavigation = keyboardNavigation;
19882
+ }
19883
+ setActiveCellIndex(activeCellIndex) {
19884
+ this.param.actions.activeCellIndex = activeCellIndex;
19885
+ }
19886
+ setActiveRowIndex(activeRowIndex) {
19887
+ this.param.actions.activeRowIndex = activeRowIndex;
19888
+ }
19889
+ gotoRowWithDirection(direction) {
19890
+ const { getDataSourceState, getState } = this.param;
19891
+ const { activeRowIndex, keyboardNavigation } = getState();
19892
+ if (keyboardNavigation !== "row") {
19893
+ console.error("Keyboard navigation is not enabled for rows");
19894
+ return false;
19895
+ }
19896
+ if (activeRowIndex == null) {
19897
+ return false;
19898
+ }
19899
+ const newActiveRowIndex = getNextEnabledRowIndex(
19900
+ getDataSourceState,
19901
+ activeRowIndex,
19902
+ direction
19903
+ );
19904
+ if (newActiveRowIndex !== activeRowIndex) {
19905
+ this.param.actions.activeRowIndex = newActiveRowIndex;
19906
+ return newActiveRowIndex;
19907
+ }
19908
+ return false;
19909
+ }
19910
+ gotoRow(direction) {
19911
+ return this.gotoRowWithDirection(direction);
19912
+ }
19913
+ gotoNextRow() {
19914
+ return this.gotoRow(1);
19915
+ }
19916
+ gotoPreviousRow() {
19917
+ return this.gotoRow(-1);
19918
+ }
19919
+ gotoCell(config) {
19920
+ const { direction } = config;
19921
+ const key = direction == "top" ? "ArrowUp" : direction == "bottom" ? "ArrowDown" : direction == "left" ? "ArrowLeft" : "ArrowRight";
19922
+ const activeCellIndex = computeNextActiveCellIndex(this.param, {
19923
+ key,
19924
+ shiftKey: false
19925
+ });
19926
+ if (activeCellIndex === false) {
19927
+ return false;
19928
+ }
19929
+ this.param.actions.activeCellIndex = activeCellIndex;
19930
+ return activeCellIndex;
19931
+ }
19932
+ };
19933
+ function getKeyboardNavigationApi(param) {
19934
+ return new KeyboardNavigationApi(param);
19935
+ }
19936
+
19937
+ // src/components/InfiniteTable/api/getImperativeApi.ts
19938
+ function isSortInfoForColumn(sortInfo, col) {
19939
+ if (sortInfo.id) {
19940
+ if (sortInfo.id === col.id) {
19941
+ return true;
19942
+ }
19943
+ return false;
19944
+ }
19945
+ if (sortInfo.field) {
19946
+ if (sortInfo.field === col.field) {
19947
+ return true;
19948
+ }
19949
+ }
19950
+ return false;
19951
+ }
19952
+ var InfiniteTableApiImpl = class {
19953
+ constructor(context) {
19954
+ this.hideFilterOperatorMenu = () => {
19955
+ this.actions.filterOperatorMenuVisibleForColumnId = null;
19956
+ };
19957
+ this.getColumnOrder = () => {
19958
+ return this.getComputed().computedColumnOrder;
19959
+ };
19960
+ this.getComputedColumnById = (columnId) => {
19961
+ return this.getComputed().computedColumnsMap.get(columnId);
19962
+ };
19963
+ this.getVisibleColumnOrder = () => {
19964
+ const order2 = this.getColumnOrder();
19965
+ const visibleColumns = this.getComputed().computedVisibleColumnsMap;
19966
+ return order2.filter((id) => visibleColumns.has(id));
19967
+ };
19968
+ this.persistEdit = async (arg) => {
19969
+ arg = arg ?? {};
19970
+ const { editingCell, editingValueRef } = this.getState();
19971
+ if (!editingCell) {
19972
+ return Promise.resolve(new Error("no edit in progress"));
19973
+ }
19974
+ await new Promise((resolve) => requestAnimationFrame(resolve));
19975
+ const column = this.getComputed().computedColumnsMap.get(
19976
+ editingCell.columnId
19977
+ );
19978
+ const value = arg.value ?? editingCell.value;
19979
+ if (!editingCell.active && editingCell.waiting !== "persist") {
19980
+ this.actions.editingCell = {
19981
+ ...editingCell,
19982
+ active: false,
19983
+ waiting: "persist"
19984
+ };
19985
+ }
19986
+ const params = {
19987
+ ...getCellContext({
19434
19988
  rowIndex: editingCell.rowIndex,
19435
19989
  columnId: editingCell.columnId,
19436
19990
  ...this.context,
@@ -19814,6 +20368,14 @@ var InfiniteTableApiImpl = class {
19814
20368
  dataSourceActions: context.dataSourceActions,
19815
20369
  getDataSourceState: context.getDataSourceState
19816
20370
  });
20371
+ this.keyboardNavigationApi = getKeyboardNavigationApi({
20372
+ getState: context.getState,
20373
+ getDataSourceState: context.getDataSourceState,
20374
+ actions: context.actions,
20375
+ getComputed: context.getComputed,
20376
+ api: this,
20377
+ dataSourceApi: context.dataSourceApi
20378
+ });
19817
20379
  this.rowDetailApi = getRowDetailApi({
19818
20380
  getState: context.getState,
19819
20381
  actions: context.actions,
@@ -21286,6 +21848,11 @@ var HorizontalLayoutMatrixBrain = class extends MatrixBrain {
21286
21848
  remainingSize,
21287
21849
  sizes.concat(sizes)
21288
21850
  );
21851
+ if (direction === "horizontal") {
21852
+ this.maxHorizontalRenderCount = renderCount;
21853
+ } else {
21854
+ this.maxVerticalRenderCount = renderCount;
21855
+ }
21289
21856
  renderCount = Math.min(count, renderCount);
21290
21857
  return renderCount;
21291
21858
  }
@@ -23026,7 +23593,7 @@ var useLicense = (licenseKey = "") => {
23026
23593
  }
23027
23594
  let valid2 = isValidLicense(licenseKey, {
23028
23595
  publishedAt: 1624970570587,
23029
- version: "6.1.0"
23596
+ version: "6.1.1"
23030
23597
  });
23031
23598
  if (!licenseKey && !valid2 && isInsidePlayground) {
23032
23599
  return true;
@@ -23134,431 +23701,130 @@ function onCellDoubleClick(context, event) {
23134
23701
  };
23135
23702
  if (onCellDoubleClick2) {
23136
23703
  const result = onCellDoubleClick2(context, event);
23137
- if (result && typeof result === "object") {
23138
- dblClickResult = { ...dblClickResult, ...result };
23139
- }
23140
- }
23141
- if (dblClickResult.preventEdit) {
23142
- return;
23143
- }
23144
- const computed = context.getComputed();
23145
- const column = computed.computedVisibleColumns[context.colIndex];
23146
- context.api.startEdit({
23147
- rowIndex: context.rowIndex,
23148
- columnId: column.id
23149
- });
23150
- }
23151
- function updateCellSelectionOnCellClick(context, event) {
23152
- const {
23153
- getDataSourceState,
23154
- getState,
23155
- getComputed,
23156
- rowIndex,
23157
- colIndex,
23158
- dataSourceActions
23159
- } = context;
23160
- const dataSourceState = getDataSourceState();
23161
- const { selectionMode, cellSelection: existingCellSelection } = dataSourceState;
23162
- if (!existingCellSelection) {
23163
- return;
23164
- }
23165
- if (selectionMode !== "multi-cell") {
23166
- return;
23167
- }
23168
- const { multiCellSelector, computedVisibleColumns } = getComputed();
23169
- const { brain } = getState();
23170
- const { rowsPerPage } = brain;
23171
- const columnsPerSet = computedVisibleColumns.length;
23172
- const cellSelection = new CellSelectionState(existingCellSelection);
23173
- multiCellSelector.cellSelectionState = cellSelection;
23174
- const position2 = {
23175
- rowIndex,
23176
- colIndex
23177
- };
23178
- if (event.metaKey || event.ctrlKey) {
23179
- multiCellSelector.singleAddClick(position2);
23180
- } else if (event.shiftKey) {
23181
- const horizontalLayout = !!getState().wrapRowsHorizontally;
23182
- multiCellSelector.multiSelectClick(
23183
- position2,
23184
- horizontalLayout ? {
23185
- horizontalLayout,
23186
- rowsPerPage,
23187
- columnsPerSet
23188
- } : {
23189
- horizontalLayout
23190
- }
23191
- );
23192
- } else {
23193
- multiCellSelector.resetClick(position2);
23194
- }
23195
- dataSourceActions.cellSelection = cellSelection;
23196
- }
23197
- function updateRowSelectionOnCellClick(context, event) {
23198
- const {
23199
- rowIndex,
23200
- getDataSourceState,
23201
- getComputed,
23202
- dataSourceActions,
23203
- api,
23204
- cloneRowSelection: cloneRowSelection2
23205
- } = context;
23206
- const { multiRowSelector, renderSelectionCheckBox } = getComputed();
23207
- const dataSourceState = getDataSourceState();
23208
- const { selectionMode, groupBy, dataArray, isTree } = dataSourceState;
23209
- if (groupBy.length) {
23210
- return false;
23211
- }
23212
- if (isTree) {
23213
- return false;
23214
- }
23215
- const rowInfo = dataArray[rowIndex];
23216
- if (rowInfo?.rowDisabled) {
23217
- return false;
23218
- }
23219
- if (selectionMode === "multi-row") {
23220
- if (renderSelectionCheckBox && !event.key) {
23221
- return false;
23222
- }
23223
- let { rowSelection: rowSelectionState } = dataSourceState;
23224
- rowSelectionState = cloneRowSelection2(
23225
- rowSelectionState
23226
- );
23227
- multiRowSelector.rowSelectionState = rowSelectionState;
23228
- if (rowSelectionState && typeof rowSelectionState === "object") {
23229
- if (event.shiftKey) {
23230
- multiRowSelector.multiSelectClick(rowIndex);
23231
- } else if (event.metaKey || event.ctrlKey) {
23232
- multiRowSelector.singleAddClick(rowIndex);
23233
- } else {
23234
- multiRowSelector.resetClick(rowIndex);
23235
- }
23236
- dataSourceActions.rowSelection = rowSelectionState;
23237
- return true;
23238
- }
23239
- } else if (selectionMode === "single-row") {
23240
- const rowInfo2 = dataArray[rowIndex];
23241
- const id = rowInfo2.id;
23242
- if (event.metaKey || event.ctrlKey) {
23243
- api.rowSelectionApi.toggleRowSelection(id);
23244
- } else {
23245
- api.rowSelectionApi.selectRow(id);
23246
- }
23247
- }
23248
- return false;
23249
- }
23250
-
23251
- // src/components/InfiniteTable/eventHandlers/onCellMouseDown.ts
23252
- function onCellMouseDown(context, event) {
23253
- if (event.detail === 2) {
23254
- return;
23255
- }
23256
- updateCellSelectionOnCellMouseDown(context);
23257
- }
23258
- function updateCellSelectionOnCellMouseDown(_context) {
23259
- }
23260
-
23261
- // src/components/utils/clamp.ts
23262
- function clamp(value, min, max) {
23263
- return Math.min(Math.max(value, min), max);
23264
- }
23265
-
23266
- // src/components/InfiniteTable/eventHandlers/keyboardNavigation.ts
23267
- function getNextEnabledRowIndex(getDataSourceState, activeRowIndex, direction) {
23268
- const dataArray = getDataSourceState().dataArray;
23269
- const min = 0;
23270
- const max = dataArray.length - 1;
23271
- let i = activeRowIndex;
23272
- do {
23273
- i += direction;
23274
- const rowInfo = dataArray[i];
23275
- if (!rowInfo) {
23276
- return i < min ? min : max;
23277
- }
23278
- if (!rowInfo.rowDisabled) {
23279
- return i;
23280
- }
23281
- } while (i >= min && i <= max);
23282
- return clamp(i, min, max);
23283
- }
23284
- function handleRowNavigation(options, event) {
23285
- const { getState, getDataSourceState, actions, api, dataSourceApi } = options;
23286
- const { key } = event;
23287
- const dataArray = getDataSourceState().dataArray;
23288
- const arrLength = dataArray.length;
23289
- const state = getState();
23290
- const { brain } = state;
23291
- let { activeRowIndex } = state;
23292
- if (activeRowIndex == null) {
23293
- return false;
23294
- }
23295
- const {
23296
- start: [startRow],
23297
- end: [endRow]
23298
- } = brain.getRenderRange();
23299
- const initialActiveRowIndex = activeRowIndex;
23300
- const renderRowCount = endRow - startRow - 1;
23301
- const min = 0;
23302
- const max = arrLength - 1;
23303
- const KeyToFunction = {
23304
- ArrowDown: () => {
23305
- activeRowIndex = getNextEnabledRowIndex(
23306
- getDataSourceState,
23307
- activeRowIndex,
23308
- 1
23309
- );
23310
- },
23311
- ArrowUp: () => {
23312
- activeRowIndex = getNextEnabledRowIndex(
23313
- getDataSourceState,
23314
- activeRowIndex,
23315
- -1
23316
- );
23317
- },
23318
- ArrowLeft: () => {
23319
- const rowInfo = dataArray[activeRowIndex];
23320
- if (brain.isHorizontalLayoutBrain) {
23321
- const rowsPerPage = brain.rowsPerPage;
23322
- if (activeRowIndex - rowsPerPage >= min) {
23323
- activeRowIndex = activeRowIndex - rowsPerPage;
23324
- } else {
23325
- KeyToFunction.ArrowUp();
23326
- }
23327
- return;
23328
- }
23329
- if (rowInfo && rowInfo.isGroupRow) {
23330
- return api.collapseGroupRow(rowInfo.groupKeys);
23331
- }
23332
- if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
23333
- return api.rowDetailApi.collapseRowDetail(rowInfo.id);
23334
- }
23335
- return false;
23336
- },
23337
- ArrowRight: () => {
23338
- const rowInfo = dataArray[activeRowIndex];
23339
- if (brain.isHorizontalLayoutBrain) {
23340
- const rowsPerPage = brain.rowsPerPage;
23341
- if (activeRowIndex + rowsPerPage <= max) {
23342
- activeRowIndex = activeRowIndex + rowsPerPage;
23343
- } else {
23344
- KeyToFunction.ArrowDown();
23345
- }
23346
- return;
23347
- }
23348
- if (rowInfo && rowInfo.isGroupRow) {
23349
- return api.expandGroupRow(rowInfo.groupKeys);
23350
- }
23351
- if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
23352
- return api.rowDetailApi.expandRowDetail(rowInfo.id);
23353
- }
23354
- return false;
23355
- },
23356
- Enter: () => {
23357
- const rowInfo = dataArray[activeRowIndex];
23358
- if (rowInfo && rowInfo.isGroupRow) {
23359
- return api.toggleGroupRow(rowInfo.groupKeys);
23360
- }
23361
- if (rowInfo && rowInfo.isTreeNode && rowInfo.isParentNode) {
23362
- return dataSourceApi.treeApi.toggleNode(rowInfo.nodePath);
23363
- }
23364
- const hasRowDetail = api.rowDetailApi.isRowDetailEnabledForRow(
23365
- rowInfo.id
23366
- );
23367
- if (hasRowDetail) {
23368
- return api.rowDetailApi.toggleRowDetail(rowInfo.id);
23369
- }
23370
- return false;
23371
- },
23372
- PageDown: () => {
23373
- activeRowIndex = Math.min(
23374
- activeRowIndex + renderRowCount,
23375
- arrLength - 1
23376
- );
23377
- },
23378
- PageUp: () => {
23379
- activeRowIndex = Math.max(activeRowIndex - renderRowCount, min);
23380
- },
23381
- End: () => {
23382
- activeRowIndex = max;
23383
- },
23384
- Home: () => {
23385
- activeRowIndex = min;
23386
- }
23387
- };
23388
- const Fn = KeyToFunction[key];
23389
- if (!Fn) {
23390
- return false;
23704
+ if (result && typeof result === "object") {
23705
+ dblClickResult = { ...dblClickResult, ...result };
23706
+ }
23391
23707
  }
23392
- Fn();
23393
- if (initialActiveRowIndex !== activeRowIndex) {
23394
- actions.activeRowIndex = activeRowIndex;
23395
- return true;
23708
+ if (dblClickResult.preventEdit) {
23709
+ return;
23396
23710
  }
23397
- return false;
23711
+ const computed = context.getComputed();
23712
+ const column = computed.computedVisibleColumns[context.colIndex];
23713
+ context.api.startEdit({
23714
+ rowIndex: context.rowIndex,
23715
+ columnId: column.id
23716
+ });
23398
23717
  }
23399
- function handleCellNavigation(options, event) {
23718
+ function updateCellSelectionOnCellClick(context, event) {
23400
23719
  const {
23401
- api,
23720
+ getDataSourceState,
23402
23721
  getState,
23403
23722
  getComputed,
23404
- getDataSourceState,
23405
- dataSourceApi,
23406
- actions
23407
- } = options;
23408
- const { key, shiftKey } = event;
23409
- const dataArray = getDataSourceState().dataArray;
23410
- const state = getState();
23411
- const { activeCellIndex, brain } = state;
23412
- if (!activeCellIndex) {
23413
- return false;
23723
+ rowIndex,
23724
+ colIndex,
23725
+ dataSourceActions
23726
+ } = context;
23727
+ const dataSourceState = getDataSourceState();
23728
+ const { selectionMode, cellSelection: existingCellSelection } = dataSourceState;
23729
+ if (!existingCellSelection) {
23730
+ return;
23414
23731
  }
23415
- let [rowIndex, colIndex] = activeCellIndex;
23416
- const {
23417
- start: [startRow, startCol],
23418
- end: [endRow, endCol]
23419
- } = brain.getRenderRange();
23420
- const renderRowCount = endRow - startRow - 1;
23421
- const renderColCount = endCol - startCol - 1;
23422
- const maxRow = getDataSourceState().dataArray.length - 1;
23423
- const maxCol = getComputed().computedVisibleColumns.length - 1;
23424
- const minRow = 0;
23425
- const minCol = 0;
23426
- rowIndex = clamp(rowIndex, 0, maxRow);
23427
- colIndex = clamp(colIndex, 0, maxCol);
23428
- actions.activeCellIndex = [rowIndex, colIndex];
23429
- const KeyToFunction = {
23430
- ArrowDown: () => {
23431
- rowIndex = clamp(rowIndex + 1, minRow, maxRow);
23432
- },
23433
- ArrowUp: () => {
23434
- rowIndex = clamp(rowIndex - 1, minRow, maxRow);
23435
- },
23436
- ArrowLeft: () => {
23437
- if (colIndex === minCol) {
23438
- if (rowIndex !== minRow) {
23439
- colIndex = maxCol;
23440
- }
23441
- if (brain.isHorizontalLayoutBrain) {
23442
- const rowsPerPage = brain.rowsPerPage;
23443
- if (rowIndex - rowsPerPage >= minRow) {
23444
- rowIndex = rowIndex - rowsPerPage;
23445
- } else {
23446
- KeyToFunction.ArrowUp();
23447
- }
23448
- } else {
23449
- KeyToFunction.ArrowUp();
23450
- }
23451
- } else {
23452
- colIndex = clamp(colIndex - 1, minCol, maxCol);
23453
- }
23454
- },
23455
- ArrowRight: () => {
23456
- if (colIndex === maxCol) {
23457
- if (rowIndex !== maxRow) {
23458
- colIndex = minCol;
23459
- }
23460
- if (brain.isHorizontalLayoutBrain) {
23461
- const rowsPerPage = brain.rowsPerPage;
23462
- if (rowIndex + rowsPerPage <= maxRow) {
23463
- rowIndex = rowIndex + rowsPerPage;
23464
- } else {
23465
- KeyToFunction.ArrowDown();
23466
- }
23467
- } else {
23468
- KeyToFunction.ArrowDown();
23469
- }
23470
- } else {
23471
- colIndex = clamp(colIndex + 1, minCol, maxCol);
23472
- }
23473
- },
23474
- Enter: () => {
23475
- const rowInfo = dataArray[rowIndex];
23476
- if (rowInfo && rowInfo.isGroupRow) {
23477
- return api.toggleGroupRow(rowInfo.groupKeys);
23478
- }
23479
- if (rowInfo && rowInfo.isTreeNode && rowInfo.isParentNode) {
23480
- return dataSourceApi.treeApi.toggleNode(rowInfo.nodePath);
23481
- }
23482
- if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
23483
- return api.rowDetailApi.toggleRowDetail(rowInfo.id);
23484
- }
23485
- return false;
23486
- },
23487
- PageDown: () => {
23488
- if (!shiftKey) {
23489
- rowIndex = Math.min(rowIndex + renderRowCount, maxRow);
23490
- } else {
23491
- colIndex = Math.min(colIndex + renderColCount, maxCol);
23492
- }
23493
- },
23494
- PageUp: () => {
23495
- if (!shiftKey) {
23496
- rowIndex = Math.max(rowIndex - renderRowCount, minRow);
23497
- } else {
23498
- colIndex = Math.max(colIndex - renderColCount, minCol);
23499
- }
23500
- },
23501
- End: () => {
23502
- if (!shiftKey) {
23503
- rowIndex = maxRow;
23504
- } else {
23505
- colIndex = maxCol;
23506
- }
23507
- },
23508
- Home: () => {
23509
- if (!shiftKey) {
23510
- rowIndex = minRow;
23511
- } else {
23512
- colIndex = minCol;
23513
- }
23514
- }
23732
+ if (selectionMode !== "multi-cell") {
23733
+ return;
23734
+ }
23735
+ const { multiCellSelector, computedVisibleColumns } = getComputed();
23736
+ const { brain } = getState();
23737
+ const { rowsPerPage } = brain;
23738
+ const columnsPerSet = computedVisibleColumns.length;
23739
+ const cellSelection = new CellSelectionState(existingCellSelection);
23740
+ multiCellSelector.cellSelectionState = cellSelection;
23741
+ const position2 = {
23742
+ rowIndex,
23743
+ colIndex
23515
23744
  };
23516
- const Fn = KeyToFunction[key];
23517
- if (!Fn) {
23518
- return false;
23745
+ if (event.metaKey || event.ctrlKey) {
23746
+ multiCellSelector.singleAddClick(position2);
23747
+ } else if (event.shiftKey) {
23748
+ const horizontalLayout = !!getState().wrapRowsHorizontally;
23749
+ multiCellSelector.multiSelectClick(
23750
+ position2,
23751
+ horizontalLayout ? {
23752
+ horizontalLayout,
23753
+ rowsPerPage,
23754
+ columnsPerSet
23755
+ } : {
23756
+ horizontalLayout
23757
+ }
23758
+ );
23759
+ } else {
23760
+ multiCellSelector.resetClick(position2);
23519
23761
  }
23520
- Fn();
23521
- actions.activeCellIndex = [rowIndex, colIndex];
23522
- return true;
23762
+ dataSourceActions.cellSelection = cellSelection;
23523
23763
  }
23524
- var validKeys = {
23525
- ArrowUp: true,
23526
- ArrowDown: true,
23527
- ArrowLeft: true,
23528
- ArrowRight: true,
23529
- PageUp: true,
23530
- PageDown: true,
23531
- Home: true,
23532
- End: true,
23533
- Enter: true,
23534
- " ": true
23535
- };
23536
- function handleKeyboardNavigation(options, event) {
23537
- const { key } = event;
23538
- const { getState } = options;
23539
- const state = getState();
23764
+ function updateRowSelectionOnCellClick(context, event) {
23540
23765
  const {
23541
- activeRowIndex,
23542
- activeCellIndex,
23543
- keyboardNavigation,
23544
- cellContextMenuVisibleFor,
23545
- contextMenuVisibleFor
23546
- } = state;
23547
- if (cellContextMenuVisibleFor || contextMenuVisibleFor) {
23766
+ rowIndex,
23767
+ getDataSourceState,
23768
+ getComputed,
23769
+ dataSourceActions,
23770
+ api,
23771
+ cloneRowSelection: cloneRowSelection2
23772
+ } = context;
23773
+ const { multiRowSelector, renderSelectionCheckBox } = getComputed();
23774
+ const dataSourceState = getDataSourceState();
23775
+ const { selectionMode, groupBy, dataArray, isTree } = dataSourceState;
23776
+ if (groupBy.length) {
23548
23777
  return false;
23549
23778
  }
23550
- if (!validKeys[key]) {
23779
+ if (isTree) {
23551
23780
  return false;
23552
23781
  }
23553
- if (activeRowIndex != null && keyboardNavigation === "row") {
23554
- return handleRowNavigation(options, event);
23782
+ const rowInfo = dataArray[rowIndex];
23783
+ if (rowInfo?.rowDisabled) {
23784
+ return false;
23555
23785
  }
23556
- if (activeCellIndex != null && keyboardNavigation === "cell") {
23557
- return handleCellNavigation(options, event);
23786
+ if (selectionMode === "multi-row") {
23787
+ if (renderSelectionCheckBox && !event.key) {
23788
+ return false;
23789
+ }
23790
+ let { rowSelection: rowSelectionState } = dataSourceState;
23791
+ rowSelectionState = cloneRowSelection2(
23792
+ rowSelectionState
23793
+ );
23794
+ multiRowSelector.rowSelectionState = rowSelectionState;
23795
+ if (rowSelectionState && typeof rowSelectionState === "object") {
23796
+ if (event.shiftKey) {
23797
+ multiRowSelector.multiSelectClick(rowIndex);
23798
+ } else if (event.metaKey || event.ctrlKey) {
23799
+ multiRowSelector.singleAddClick(rowIndex);
23800
+ } else {
23801
+ multiRowSelector.resetClick(rowIndex);
23802
+ }
23803
+ dataSourceActions.rowSelection = rowSelectionState;
23804
+ return true;
23805
+ }
23806
+ } else if (selectionMode === "single-row") {
23807
+ const rowInfo2 = dataArray[rowIndex];
23808
+ const id = rowInfo2.id;
23809
+ if (event.metaKey || event.ctrlKey) {
23810
+ api.rowSelectionApi.toggleRowSelection(id);
23811
+ } else {
23812
+ api.rowSelectionApi.selectRow(id);
23813
+ }
23558
23814
  }
23559
23815
  return false;
23560
23816
  }
23561
23817
 
23818
+ // src/components/InfiniteTable/eventHandlers/onCellMouseDown.ts
23819
+ function onCellMouseDown(context, event) {
23820
+ if (event.detail === 2) {
23821
+ return;
23822
+ }
23823
+ updateCellSelectionOnCellMouseDown(context);
23824
+ }
23825
+ function updateCellSelectionOnCellMouseDown(_context) {
23826
+ }
23827
+
23562
23828
  // src/components/InfiniteTable/eventHandlers/keyboardSelection.ts
23563
23829
  var validKeys2 = {
23564
23830
  Enter: true,
@@ -26996,7 +27262,8 @@ function InfiniteTableBody() {
26996
27262
  rowDetailRenderer,
26997
27263
  showHoverRows,
26998
27264
  wrapRowsHorizontally,
26999
- domProps
27265
+ domProps,
27266
+ domRef
27000
27267
  } = componentState;
27001
27268
  const LoadMaskCmp = components2?.LoadMask ?? LoadMask;
27002
27269
  const computed = getComputed();
@@ -27045,7 +27312,7 @@ function InfiniteTableBody() {
27045
27312
  const { renderCell, renderDetailRow } = useCellRendering({
27046
27313
  imperativeApi: api,
27047
27314
  getComputed,
27048
- domRef: componentState.domRef,
27315
+ domRef,
27049
27316
  bodySize,
27050
27317
  computed
27051
27318
  });
@@ -27070,7 +27337,8 @@ function InfiniteTableBody() {
27070
27337
  renderCell,
27071
27338
  renderDetailRow: rowDetailRenderer ? renderDetailRow : void 0,
27072
27339
  cellHoverClassNames: showHoverRows ? HOVERED_CLASS_NAMES : void 0,
27073
- scrollerDOMRef
27340
+ scrollerDOMRef,
27341
+ scrollVarHostRef: domRef
27074
27342
  }
27075
27343
  ), /* @__PURE__ */ React71.createElement(LoadMaskCmp, { visible: loading }, loadingText));
27076
27344
  }