@infinite-table/infinite-react 10.2.0 → 10.2.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.
package/index.dev.js CHANGED
@@ -15552,6 +15552,7 @@ var ListRowManager = class extends Logger {
15552
15552
  var ITEM_POSITION_WITH_TRANSFORM = true;
15553
15553
  var currentTransformY = stripVar(InternalVars.y);
15554
15554
  var scrollTopCSSVar = stripVar(InternalVars.scrollTop);
15555
+ var scrollLeftCSSVar2 = stripVar(InternalVars.scrollLeft);
15555
15556
  var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
15556
15557
  var columnOffsetAtIndexWhileReordering2 = stripVar(
15557
15558
  InternalVars.columnOffsetAtIndexWhileReordering
@@ -15565,6 +15566,16 @@ var GridRenderer = class extends Logger {
15565
15566
  this.scrolling = false;
15566
15567
  this.cellHoverClassNames = [];
15567
15568
  this.cellDetachedClassNames = [];
15569
+ /**
15570
+ * Inside InfiniteTable, the table owns the CSS vars that position the
15571
+ * cells horizontally (one offset var per column, plus the scroll position
15572
+ * vars used by pinned cells) and sets them on its root node.
15573
+ *
15574
+ * A HeadlessTable used on its own has nobody to set them. With this on,
15575
+ * the renderer writes each cell's x from the brain, and sets the scroll
15576
+ * position vars itself, on the parent node of the cells.
15577
+ */
15578
+ this.ownsPositionVars = false;
15568
15579
  this.lastEnteredRow = -1;
15569
15580
  this.lastExitedRow = -1;
15570
15581
  this.hoverRowUpdatesInProgress = /* @__PURE__ */ new Map();
@@ -15584,26 +15595,30 @@ var GridRenderer = class extends Logger {
15584
15595
  element.style.transform = `translate3d(${scrollLeft2 || 0}px, var(${currentTransformY}), 0)`;
15585
15596
  };
15586
15597
  this.setTransform = (element, _rowIndex, colIndex, {
15587
- //@ts-ignore
15588
15598
  x,
15589
15599
  y,
15590
- //@ts-ignore
15591
15600
  scrollLeft: scrollLeft2,
15592
15601
  scrollTop: scrollTop2
15593
15602
  }, zIndex2) => {
15594
15603
  const columnOffsetX = InternalVarUtils.columnOffsets.get(colIndex);
15595
15604
  const columnOffsetXWhileReordering = `${columnOffsetAtIndexWhileReordering2}-${colIndex}`;
15596
- const currentTransformYValue = scrollTop2 ? `calc( ${y}px + var(${scrollTopCSSVar}) )` : `${y - this.brain.getScrollOrigin().scrollTop}px`;
15605
+ const currentTransformYValue = scrollTop2 ? `calc( ${y}px + var(${scrollTopCSSVar}, 0px) )` : `${y - this.brain.getScrollOrigin().scrollTop}px`;
15597
15606
  if (element.__currentTransformY !== currentTransformYValue) {
15598
15607
  element.__currentTransformY = currentTransformYValue;
15599
15608
  element.style.setProperty(currentTransformY, currentTransformYValue);
15600
15609
  }
15601
- const transformValue = `translate3d(var(${columnOffsetXWhileReordering}, ${columnOffsetX}), var(${currentTransformY}), 0)`;
15610
+ const transformX2 = this.ownsPositionVars ? scrollLeft2 ? `calc( ${x}px + var(${scrollLeftCSSVar2}, 0px) )` : `${x - this.brain.getScrollOrigin().scrollLeft}px` : `var(${columnOffsetXWhileReordering}, ${columnOffsetX})`;
15611
+ const transformValue = `translate3d(${transformX2}, var(${currentTransformY}), 0)`;
15602
15612
  if (element.__transformValue !== transformValue) {
15603
15613
  element.__transformValue = transformValue;
15604
15614
  element.style.transform = transformValue;
15605
15615
  }
15606
- if (zIndex2 != null) {
15616
+ if (zIndex2 != null && this.ownsPositionVars) {
15617
+ const zIndexValue = `${zIndex2}`;
15618
+ if (element.__zIndex !== zIndexValue) {
15619
+ element.__zIndex = zIndexValue;
15620
+ element.style.zIndex = zIndexValue;
15621
+ }
15607
15622
  }
15608
15623
  };
15609
15624
  /**
@@ -15624,6 +15639,17 @@ var GridRenderer = class extends Logger {
15624
15639
  });
15625
15640
  this.adjustFixedElementsOnScroll();
15626
15641
  };
15642
+ /**
15643
+ * While a render pass is in progress, the cells it detaches are collected
15644
+ * here and only get the detached class names when the pass ends - if they
15645
+ * are still detached by then.
15646
+ *
15647
+ * Most of the cells detached by a render pass (while scrolling, all of
15648
+ * them) are re-attached at another position by the same pass, so they
15649
+ * would get the class names added and then removed, with no visible effect
15650
+ * - only the cost of the DOM writes and of the style invalidations.
15651
+ */
15652
+ this.cellsDetachedInRenderPass = null;
15627
15653
  this.getFullyVisibleRowsRange = () => {
15628
15654
  let {
15629
15655
  start: [startRow],
@@ -16113,11 +16139,18 @@ var GridRenderer = class extends Logger {
16113
16139
  itemElement.dataset.rowIndex = realCoords.rowIndex;
16114
16140
  itemElement.dataset.colIndex = realCoords.colIndex;
16115
16141
  if (ITEM_POSITION_WITH_TRANSFORM) {
16116
- this.setTransform(itemElement, rowIndex, colIndex, { x, y }, null);
16142
+ const fixedPlacement = this.ownsPositionVars ? this.getFixedCellPlacement(rowIndex, colIndex, { x, y }) : null;
16143
+ this.setTransform(
16144
+ itemElement,
16145
+ rowIndex,
16146
+ colIndex,
16147
+ fixedPlacement ?? { x, y },
16148
+ null
16149
+ );
16117
16150
  itemElement.style.willChange = "transform";
16118
16151
  itemElement.style.backfaceVisibility = "hidden";
16119
16152
  const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
16120
- const zIndex2 = hidden ? "-1" : (
16153
+ const zIndex2 = hidden ? "-1" : fixedPlacement ? `${fixedPlacement.zIndex}` : (
16121
16154
  // #updatezindex - we need to allow elements use their own zIndex, so we
16122
16155
  // resort to allowing them to have it as a data-z-index attribute
16123
16156
  itemElement.dataset.zIndex || "auto"
@@ -16220,126 +16253,51 @@ var GridRenderer = class extends Logger {
16220
16253
  // fixed cells are positioned with these, inside the scroll layer
16221
16254
  // which is translated relative to the scroll origin
16222
16255
  brain.getDOMScrollPosition(scrollPosition),
16223
- this.getInfiniteNode(attachedCell.getElement())
16256
+ this.ownsPositionVars ? (
16257
+ // null on the first render pass, before the cells are in the DOM:
16258
+ // the cells fall back to a scroll position of 0 - see setTransform
16259
+ attachedCell.getElement()?.parentElement ?? null
16260
+ ) : this.getInfiniteNode(attachedCell.getElement())
16224
16261
  );
16225
16262
  }
16226
- const fixedEndColsOffsets = this.brain.getFixedEndColsOffsets({
16227
- skipScroll: true
16228
- });
16229
- const fixedEndRowsOffsets = this.brain.getFixedEndRowsOffsets({
16230
- skipScroll: true
16231
- });
16263
+ const fixedEndOffsets = {
16264
+ cols: this.brain.getFixedEndColsOffsets({ skipScroll: true }),
16265
+ rows: this.brain.getFixedEndRowsOffsets({ skipScroll: true })
16266
+ };
16232
16267
  const { start, end } = this.brain.getRenderRange();
16233
16268
  const [startRow, startCol] = start;
16234
16269
  const [endRow, endCol] = end;
16235
- function adjustElementPosition(rowIndex, colIndex, fn) {
16236
- const cell = cellManager.getCellAt([rowIndex, colIndex]);
16237
- if (cell == null) {
16270
+ const adjust = (rowIndex, colIndex) => {
16271
+ const node = cellManager.getCellAt([rowIndex, colIndex])?.getElement();
16272
+ const itemPosition = node ? brain.getCellOffset(rowIndex, colIndex) : null;
16273
+ if (!node || !itemPosition) {
16238
16274
  return;
16239
16275
  }
16240
- const itemPosition = brain.getCellOffset(rowIndex, colIndex);
16241
- const node = cell.getElement();
16242
- if (node && itemPosition) {
16243
- fn(rowIndex, colIndex, node, itemPosition);
16244
- }
16245
- }
16246
- const adjustColStart = (_rowIndex, colIndex, node, { x, y }) => {
16247
- this.setTransform(
16248
- node,
16249
- _rowIndex,
16250
- colIndex,
16251
- { x, y, scrollLeft: true },
16252
- fixedColsStart - colIndex
16253
- );
16254
- };
16255
- const adjustRowStart = (rowIndex, _colIndex, node, coords) => {
16256
- this.setTransform(
16257
- node,
16276
+ const placement = this.getFixedCellPlacement(
16258
16277
  rowIndex,
16259
- _colIndex,
16260
- { x: coords.x, y: coords.y, scrollTop: true },
16261
- fixedRowsStart - rowIndex
16262
- );
16263
- };
16264
- const adjustColEnd = (_rowIndex, colIndex, node, { y }) => {
16265
- const val = fixedEndColsOffsets[colIndex];
16266
- this.setTransform(
16267
- node,
16268
- _rowIndex,
16269
16278
  colIndex,
16270
- { x: val, y, scrollLeft: true },
16271
- cols - colIndex
16272
- );
16273
- };
16274
- const adjustRowEnd = (rowIndex, _colIndex, node, coords) => {
16275
- this.setTransform(
16276
- node,
16277
- rowIndex,
16278
- _colIndex,
16279
- { x: coords.x, y: fixedEndRowsOffsets[rowIndex], scrollTop: true },
16280
- rows - rowIndex
16281
- );
16282
- };
16283
- const adjustColStartRowStart = (_rowIndex, _colIndex, node, { x, y }) => {
16284
- this.setTransform(
16285
- node,
16286
- _rowIndex,
16287
- _colIndex,
16288
- { x, scrollLeft: true, y, scrollTop: true },
16289
- 1e5
16290
- );
16291
- };
16292
- const adjustColStartRowEnd = (_rowIndex, _colIndex, node, { x }) => {
16293
- this.setTransform(
16294
- node,
16295
- _rowIndex,
16296
- _colIndex,
16297
- {
16298
- x,
16299
- scrollLeft: true,
16300
- y: fixedEndRowsOffsets[_rowIndex],
16301
- scrollTop: true
16302
- },
16303
- 2e5
16304
- );
16305
- };
16306
- const adjustColEndRowStart = (_rowIndex, colIndex, node, coords) => {
16307
- this.setTransform(
16308
- node,
16309
- _rowIndex,
16310
- colIndex,
16311
- {
16312
- x: fixedEndColsOffsets[colIndex],
16313
- y: coords.y,
16314
- scrollLeft: true,
16315
- scrollTop: true
16316
- },
16317
- 3e5
16318
- );
16319
- };
16320
- const adjustColEndRowEnd = (rowIndex, colIndex, node) => {
16321
- this.setTransform(
16322
- node,
16323
- rowIndex,
16324
- colIndex,
16325
- {
16326
- x: fixedEndColsOffsets[colIndex],
16327
- y: fixedEndRowsOffsets[rowIndex],
16328
- scrollLeft: true,
16329
- scrollTop: true
16330
- },
16331
- 4e5
16279
+ itemPosition,
16280
+ fixedEndOffsets
16332
16281
  );
16282
+ if (placement) {
16283
+ this.setTransform(
16284
+ node,
16285
+ rowIndex,
16286
+ colIndex,
16287
+ placement,
16288
+ placement.zIndex
16289
+ );
16290
+ }
16333
16291
  };
16334
16292
  if (fixedColsStart || fixedColsEnd) {
16335
16293
  for (let rowIndex = startRow; rowIndex < endRow; rowIndex++) {
16336
16294
  for (let colIndex = 0; colIndex < fixedColsStart; colIndex++) {
16337
- adjustElementPosition(rowIndex, colIndex, adjustColStart);
16295
+ adjust(rowIndex, colIndex);
16338
16296
  }
16339
16297
  if (fixedColsEnd) {
16340
16298
  const firstColFixedEnd = cols - fixedColsEnd;
16341
16299
  for (let colIndex = firstColFixedEnd; colIndex < cols; colIndex++) {
16342
- adjustElementPosition(rowIndex, colIndex, adjustColEnd);
16300
+ adjust(rowIndex, colIndex);
16343
16301
  }
16344
16302
  }
16345
16303
  }
@@ -16347,12 +16305,12 @@ var GridRenderer = class extends Logger {
16347
16305
  if (fixedRowsStart || fixedRowsEnd) {
16348
16306
  for (let colIndex = startCol; colIndex < endCol; colIndex++) {
16349
16307
  for (let rowIndex = 0; rowIndex < fixedRowsStart; rowIndex++) {
16350
- adjustElementPosition(rowIndex, colIndex, adjustRowStart);
16308
+ adjust(rowIndex, colIndex);
16351
16309
  }
16352
16310
  if (fixedRowsEnd) {
16353
16311
  const firstRowFixedEnd = rows - fixedRowsEnd;
16354
16312
  for (let rowIndex = firstRowFixedEnd; rowIndex < rows; rowIndex++) {
16355
- adjustElementPosition(rowIndex, colIndex, adjustRowEnd);
16313
+ adjust(rowIndex, colIndex);
16356
16314
  }
16357
16315
  }
16358
16316
  }
@@ -16360,7 +16318,7 @@ var GridRenderer = class extends Logger {
16360
16318
  if (fixedColsStart && fixedRowsStart) {
16361
16319
  for (let rowIndex = 0; rowIndex < fixedRowsStart; rowIndex++) {
16362
16320
  for (let colIndex = 0; colIndex < fixedColsStart; colIndex++) {
16363
- adjustElementPosition(rowIndex, colIndex, adjustColStartRowStart);
16321
+ adjust(rowIndex, colIndex);
16364
16322
  }
16365
16323
  }
16366
16324
  }
@@ -16368,7 +16326,7 @@ var GridRenderer = class extends Logger {
16368
16326
  const firstRowFixedEnd = rows - fixedRowsEnd;
16369
16327
  for (let rowIndex = firstRowFixedEnd; rowIndex < rows; rowIndex++) {
16370
16328
  for (let colIndex = 0; colIndex < fixedColsStart; colIndex++) {
16371
- adjustElementPosition(rowIndex, colIndex, adjustColStartRowEnd);
16329
+ adjust(rowIndex, colIndex);
16372
16330
  }
16373
16331
  }
16374
16332
  }
@@ -16376,7 +16334,7 @@ var GridRenderer = class extends Logger {
16376
16334
  const firstColFixedEnd = cols - fixedColsEnd;
16377
16335
  for (let rowIndex = 0; rowIndex < fixedRowsStart; rowIndex++) {
16378
16336
  for (let colIndex = firstColFixedEnd; colIndex < cols; colIndex++) {
16379
- adjustElementPosition(rowIndex, colIndex, adjustColEndRowStart);
16337
+ adjust(rowIndex, colIndex);
16380
16338
  }
16381
16339
  }
16382
16340
  }
@@ -16385,7 +16343,7 @@ var GridRenderer = class extends Logger {
16385
16343
  const firstColFixedEnd = cols - fixedColsEnd;
16386
16344
  for (let rowIndex = firstRowFixedEnd; rowIndex < rows; rowIndex++) {
16387
16345
  for (let colIndex = firstColFixedEnd; colIndex < cols; colIndex++) {
16388
- adjustElementPosition(rowIndex, colIndex, adjustColEndRowEnd);
16346
+ adjust(rowIndex, colIndex);
16389
16347
  }
16390
16348
  }
16391
16349
  }
@@ -16459,6 +16417,9 @@ var GridRenderer = class extends Logger {
16459
16417
  return this.infiniteNode;
16460
16418
  }
16461
16419
  onCellAttached(cell) {
16420
+ if (this.cellsDetachedInRenderPass?.delete(cell)) {
16421
+ return;
16422
+ }
16462
16423
  if (this.cellDetachedClassNames.length) {
16463
16424
  const el = cell.getElement();
16464
16425
  if (el) {
@@ -16469,6 +16430,13 @@ var GridRenderer = class extends Logger {
16469
16430
  }
16470
16431
  }
16471
16432
  onCellDetached(cell) {
16433
+ if (this.cellsDetachedInRenderPass) {
16434
+ this.cellsDetachedInRenderPass.add(cell);
16435
+ return;
16436
+ }
16437
+ this.addDetachedClassNames(cell);
16438
+ }
16439
+ addDetachedClassNames(cell) {
16472
16440
  if (this.cellDetachedClassNames.length) {
16473
16441
  const el = cell.getElement();
16474
16442
  if (el) {
@@ -16505,10 +16473,22 @@ var GridRenderer = class extends Logger {
16505
16473
  mapped: rendered
16506
16474
  };
16507
16475
  }
16508
- renderRange(range, { renderCell, renderDetailRow, force, onRender }) {
16476
+ renderRange(range, options) {
16509
16477
  if (this.destroyed) {
16510
16478
  return [];
16511
16479
  }
16480
+ if (this.cellsDetachedInRenderPass) {
16481
+ return this.renderRangeInternal(range, options);
16482
+ }
16483
+ const detachedCells = this.cellsDetachedInRenderPass = /* @__PURE__ */ new Set();
16484
+ try {
16485
+ return this.renderRangeInternal(range, options);
16486
+ } finally {
16487
+ this.cellsDetachedInRenderPass = null;
16488
+ detachedCells.forEach((cell) => this.addDetachedClassNames(cell));
16489
+ }
16490
+ }
16491
+ renderRangeInternal(range, { renderCell, renderDetailRow, force, onRender }) {
16512
16492
  const { start, end } = range;
16513
16493
  const horizontalLayout = this.brain.isHorizontalLayoutBrain;
16514
16494
  if (false) {
@@ -16783,6 +16763,34 @@ var GridRenderer = class extends Logger {
16783
16763
  this.updateElementPosition(cell, { hidden, rowspan, colspan });
16784
16764
  return;
16785
16765
  }
16766
+ /**
16767
+ * Where a fixed (pinned) cell goes: its x and/or y relative to the viewport
16768
+ * (`scrollLeft` / `scrollTop: true` - see setTransform), and its z-index:
16769
+ * the corners above the pinned rows and columns, those above the cells
16770
+ * scrolling under them. null for a cell that is not fixed.
16771
+ */
16772
+ getFixedCellPlacement(rowIndex, colIndex, { x, y }, fixedEndOffsets) {
16773
+ const { fixedRowsStart, fixedRowsEnd, fixedColsStart, fixedColsEnd } = this.brain.getFixedCellInfo();
16774
+ const cols = this.brain.getColCount();
16775
+ const rows = this.brain.getRowCount();
16776
+ const colStart = colIndex < fixedColsStart;
16777
+ const colEnd = !colStart && !!fixedColsEnd && colIndex >= cols - fixedColsEnd;
16778
+ const rowStart = rowIndex < fixedRowsStart;
16779
+ const rowEnd = !rowStart && !!fixedRowsEnd && rowIndex >= rows - fixedRowsEnd;
16780
+ const colFixed = colStart || colEnd;
16781
+ const rowFixed = rowStart || rowEnd;
16782
+ if (!colFixed && !rowFixed) {
16783
+ return null;
16784
+ }
16785
+ if (colEnd) {
16786
+ x = (fixedEndOffsets?.cols ?? this.brain.getFixedEndColsOffsets({ skipScroll: true }))[colIndex];
16787
+ }
16788
+ if (rowEnd) {
16789
+ y = (fixedEndOffsets?.rows ?? this.brain.getFixedEndRowsOffsets({ skipScroll: true }))[rowIndex];
16790
+ }
16791
+ const zIndex2 = colFixed && rowFixed ? colStart ? rowStart ? 1e5 : 2e5 : rowStart ? 3e5 : 4e5 : colStart ? fixedColsStart - colIndex : colEnd ? cols - colIndex : rowStart ? fixedRowsStart - rowIndex : rows - rowIndex;
16792
+ return { x, y, scrollLeft: colFixed, scrollTop: rowFixed, zIndex: zIndex2 };
16793
+ }
16786
16794
  reset() {
16787
16795
  this.cellManager.reset();
16788
16796
  this.rowManager.reset();
@@ -17374,13 +17382,18 @@ function createRenderer(brain) {
17374
17382
  }
17375
17383
 
17376
17384
  // src/components/HeadlessTable/RawTable.tsx
17385
+ function createOwnRenderer(brain) {
17386
+ const result = createRenderer(brain);
17387
+ result.renderer.ownsPositionVars = true;
17388
+ return result;
17389
+ }
17377
17390
  function RawTableFn(props) {
17378
17391
  const { brain, renderCell, renderDetailRow, forceRerenderTimestamp } = props;
17379
17392
  const { renderer, onRenderUpdater } = (0, import_react29.useMemo)(() => {
17380
17393
  return props.onRenderUpdater && props.renderer ? {
17381
17394
  renderer: props.renderer,
17382
17395
  onRenderUpdater: props.onRenderUpdater
17383
- } : createRenderer(brain);
17396
+ } : createOwnRenderer(brain);
17384
17397
  }, [brain, props.onRenderUpdater, props.renderer]);
17385
17398
  (0, import_react29.useLayoutEffect)(() => {
17386
17399
  renderer.cellHoverClassNames = props.cellHoverClassNames || [];
@@ -22506,6 +22519,80 @@ function treeTraverse(treeParams, traverseOptions, data) {
22506
22519
  }
22507
22520
  }
22508
22521
 
22522
+ // src/utils/multisort/sortByNumber.ts
22523
+ var SORT_BY_NUMBER_MIN_LENGTH = 1e3;
22524
+ var IS_LITTLE_ENDIAN = new Uint8Array(new Uint32Array([1]).buffer)[0] === 1;
22525
+ function sortByNumber(array, getValue, dir) {
22526
+ const len = array.length;
22527
+ const keys = new Float64Array(len);
22528
+ for (let i = 0; i < len; i++) {
22529
+ const value = getValue(array[i]);
22530
+ if (typeof value !== "number" || value !== value) {
22531
+ return false;
22532
+ }
22533
+ keys[i] = (dir < 0 ? -value : value) + 0;
22534
+ }
22535
+ if (len < 2) {
22536
+ return true;
22537
+ }
22538
+ const words = new Uint32Array(keys.buffer);
22539
+ const LOW = IS_LITTLE_ENDIAN ? 0 : 1;
22540
+ const HIGH = IS_LITTLE_ENDIAN ? 1 : 0;
22541
+ const counts = new Uint32Array(8 * 256);
22542
+ for (let i = 0; i < len; i++) {
22543
+ let low = words[2 * i + LOW];
22544
+ let high = words[2 * i + HIGH];
22545
+ if (high & 2147483648) {
22546
+ high = ~high >>> 0;
22547
+ low = ~low >>> 0;
22548
+ words[2 * i + LOW] = low;
22549
+ } else {
22550
+ high = (high | 2147483648) >>> 0;
22551
+ }
22552
+ words[2 * i + HIGH] = high;
22553
+ counts[low & 255]++;
22554
+ counts[256 + (low >>> 8 & 255)]++;
22555
+ counts[512 + (low >>> 16 & 255)]++;
22556
+ counts[768 + (low >>> 24)]++;
22557
+ counts[1024 + (high & 255)]++;
22558
+ counts[1280 + (high >>> 8 & 255)]++;
22559
+ counts[1536 + (high >>> 16 & 255)]++;
22560
+ counts[1792 + (high >>> 24)]++;
22561
+ }
22562
+ let indexes = new Uint32Array(len);
22563
+ let nextIndexes = new Uint32Array(len);
22564
+ for (let i = 0; i < len; i++) {
22565
+ indexes[i] = i;
22566
+ }
22567
+ for (let digitIndex = 0; digitIndex < 8; digitIndex++) {
22568
+ const word = digitIndex < 4 ? LOW : HIGH;
22569
+ const shift = digitIndex % 4 * 8;
22570
+ const countsOffset = digitIndex * 256;
22571
+ if (counts[countsOffset + (words[word] >>> shift & 255)] === len) {
22572
+ continue;
22573
+ }
22574
+ let position2 = 0;
22575
+ for (let digit = 0; digit < 256; digit++) {
22576
+ const count = counts[countsOffset + digit];
22577
+ counts[countsOffset + digit] = position2;
22578
+ position2 += count;
22579
+ }
22580
+ for (let i = 0; i < len; i++) {
22581
+ const index = indexes[i];
22582
+ const digit = words[2 * index + word] >>> shift & 255;
22583
+ nextIndexes[counts[countsOffset + digit]++] = index;
22584
+ }
22585
+ const previousIndexes = indexes;
22586
+ indexes = nextIndexes;
22587
+ nextIndexes = previousIndexes;
22588
+ }
22589
+ const items = array.slice();
22590
+ for (let i = 0; i < len; i++) {
22591
+ array[i] = items[indexes[i]];
22592
+ }
22593
+ return true;
22594
+ }
22595
+
22509
22596
  // src/utils/multisort/sortTypes.ts
22510
22597
  var numberComparator = function(first, second) {
22511
22598
  return first - second;
@@ -22591,7 +22678,10 @@ var multisort = (sortInfo, array, options) => {
22591
22678
  if (marker) {
22592
22679
  marker.start();
22593
22680
  }
22594
- array.sort(getMultisortFunction(toPlainSortInfo(sortInfo), get));
22681
+ const plainSortInfo = toPlainSortInfo(sortInfo);
22682
+ if (!sortByNumberIfPossible(plainSortInfo, array, get)) {
22683
+ array.sort(getMultisortFunction(plainSortInfo, get));
22684
+ }
22595
22685
  if (marker) {
22596
22686
  marker.end();
22597
22687
  }
@@ -22657,6 +22747,30 @@ var multisortNested = (sortInfo, array, options) => {
22657
22747
  return array;
22658
22748
  };
22659
22749
  multisort.knownTypes = sortTypes_default;
22750
+ function sortByNumberIfPossible(sortInfo, array, get) {
22751
+ if (sortInfo.length !== 1 || array.length < SORT_BY_NUMBER_MIN_LENGTH) {
22752
+ return false;
22753
+ }
22754
+ const info = sortInfo[0];
22755
+ if (!info || info.fn || !info.type || info.dir !== 1 && info.dir !== -1) {
22756
+ return false;
22757
+ }
22758
+ const type = Array.isArray(info.type) ? info.type[0] : info.type;
22759
+ if (multisort.knownTypes[type] !== numberComparator) {
22760
+ return false;
22761
+ }
22762
+ const { field, valueGetter } = info;
22763
+ return sortByNumber(
22764
+ array,
22765
+ (item) => {
22766
+ if (get) {
22767
+ item = get(item);
22768
+ }
22769
+ return valueGetter ? valueGetter(item) : field ? item[field] : item;
22770
+ },
22771
+ info.dir
22772
+ );
22773
+ }
22660
22774
  var getSingleSortFunction = (info) => {
22661
22775
  if (!info) {
22662
22776
  return;
@@ -29491,8 +29605,8 @@ function getLicenseStatus(licenseKey = "", options) {
29491
29605
  return "valid";
29492
29606
  }
29493
29607
  const result = checkLicense(licenseKey, {
29494
- publishedAt: 1794927344373,
29495
- version: "10.2.0"
29608
+ publishedAt: 1795523603652,
29609
+ version: "10.2.1"
29496
29610
  });
29497
29611
  if (result === "invalid" && !licenseKey) {
29498
29612
  return "missing";