@infinite-table/infinite-react 10.1.3 → 10.1.4
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.d.ts +70 -0
- package/index.dev.js +478 -82
- package/index.dev.mjs +499 -97
- package/index.js +8 -8
- package/index.mjs +8 -8
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -5175,6 +5175,79 @@ var Rectangle = class _Rectangle extends PolyWithPoints {
|
|
|
5175
5175
|
}
|
|
5176
5176
|
};
|
|
5177
5177
|
|
|
5178
|
+
// src/components/VirtualBrain/largeContent.ts
|
|
5179
|
+
var LARGE_CONTENT_PROBE_THRESHOLD = 4e6;
|
|
5180
|
+
var SCROLL_ORIGIN_REBASE_DISTANCE = 1e6;
|
|
5181
|
+
var PROBE_START = 1e6;
|
|
5182
|
+
var PROBE_MAX = 64e6;
|
|
5183
|
+
var maxElementSize;
|
|
5184
|
+
function probeMaxElementSize() {
|
|
5185
|
+
if (typeof document === "undefined" || !document.body) {
|
|
5186
|
+
return Infinity;
|
|
5187
|
+
}
|
|
5188
|
+
const div = document.createElement("div");
|
|
5189
|
+
div.style.cssText = "position:absolute;top:0;left:0;width:1px;visibility:hidden;pointer-events:none";
|
|
5190
|
+
document.body.appendChild(div);
|
|
5191
|
+
const applies = (size2) => {
|
|
5192
|
+
div.style.height = `${size2}px`;
|
|
5193
|
+
return Math.abs(div.getBoundingClientRect().height - size2) < 1;
|
|
5194
|
+
};
|
|
5195
|
+
let size = PROBE_START;
|
|
5196
|
+
if (!applies(size)) {
|
|
5197
|
+
div.remove();
|
|
5198
|
+
return Infinity;
|
|
5199
|
+
}
|
|
5200
|
+
while (size < PROBE_MAX && applies(size * 2)) {
|
|
5201
|
+
size *= 2;
|
|
5202
|
+
}
|
|
5203
|
+
div.remove();
|
|
5204
|
+
return size;
|
|
5205
|
+
}
|
|
5206
|
+
function getMaxElementSize() {
|
|
5207
|
+
if (maxElementSize === void 0) {
|
|
5208
|
+
maxElementSize = probeMaxElementSize();
|
|
5209
|
+
}
|
|
5210
|
+
return maxElementSize;
|
|
5211
|
+
}
|
|
5212
|
+
function isLargeContentSize(contentSize) {
|
|
5213
|
+
if (contentSize <= LARGE_CONTENT_PROBE_THRESHOLD) {
|
|
5214
|
+
return false;
|
|
5215
|
+
}
|
|
5216
|
+
return contentSize > getMaxElementSize();
|
|
5217
|
+
}
|
|
5218
|
+
function computeScrollRatio(contentSize, viewportSize) {
|
|
5219
|
+
if (!isLargeContentSize(contentSize)) {
|
|
5220
|
+
return 1;
|
|
5221
|
+
}
|
|
5222
|
+
const nativeScrollMax = getMaxElementSize() - viewportSize;
|
|
5223
|
+
const contentScrollMax = contentSize - viewportSize;
|
|
5224
|
+
return nativeScrollMax > 0 && contentScrollMax > 0 ? contentScrollMax / nativeScrollMax : 1;
|
|
5225
|
+
}
|
|
5226
|
+
function createSteppedScrollPosition(options) {
|
|
5227
|
+
let requested = null;
|
|
5228
|
+
return {
|
|
5229
|
+
get value() {
|
|
5230
|
+
const actual = options.getScrollPosition();
|
|
5231
|
+
const ratio = options.getScrollRatio();
|
|
5232
|
+
if (ratio > 1 && requested !== null && Math.abs(requested - actual) <= ratio) {
|
|
5233
|
+
return requested;
|
|
5234
|
+
}
|
|
5235
|
+
requested = null;
|
|
5236
|
+
return actual;
|
|
5237
|
+
},
|
|
5238
|
+
set value(value) {
|
|
5239
|
+
requested = value;
|
|
5240
|
+
options.setScrollPosition(value);
|
|
5241
|
+
}
|
|
5242
|
+
};
|
|
5243
|
+
}
|
|
5244
|
+
function computeScrollOrigin(scroll, currentOrigin, align2 = Math.floor) {
|
|
5245
|
+
if (Math.abs(scroll - currentOrigin) <= SCROLL_ORIGIN_REBASE_DISTANCE) {
|
|
5246
|
+
return currentOrigin;
|
|
5247
|
+
}
|
|
5248
|
+
return align2(scroll);
|
|
5249
|
+
}
|
|
5250
|
+
|
|
5178
5251
|
// src/components/InfiniteTable/hooks/reorderColumnsOnDrag.ts
|
|
5179
5252
|
var PROXY_OFFSET = 10;
|
|
5180
5253
|
var pinnedStartWidthCSSVar2 = stripVar(InternalVars.pinnedStartWidth);
|
|
@@ -5472,6 +5545,13 @@ function reorderColumnsOnDrag(params) {
|
|
|
5472
5545
|
scrollOffsetStart: pinnedStartColsRight,
|
|
5473
5546
|
scrollOffsetEnd: pinnedEndColsLeft
|
|
5474
5547
|
});
|
|
5548
|
+
const autoScrollLeft = createSteppedScrollPosition({
|
|
5549
|
+
getScrollPosition: () => brain.getScrollPosition().scrollLeft,
|
|
5550
|
+
setScrollPosition: (value) => {
|
|
5551
|
+
imperativeApi.scrollLeft = value;
|
|
5552
|
+
},
|
|
5553
|
+
getScrollRatio: () => brain.getScrollRatio("horizontal")
|
|
5554
|
+
});
|
|
5475
5555
|
updatePositionAndDiff(initialMousePosition);
|
|
5476
5556
|
return {
|
|
5477
5557
|
speedScroller,
|
|
@@ -5491,10 +5571,10 @@ function reorderColumnsOnDrag(params) {
|
|
|
5491
5571
|
speedScroller.scroll({
|
|
5492
5572
|
mousePosition: currentMousePosition,
|
|
5493
5573
|
get scrollLeft() {
|
|
5494
|
-
return
|
|
5574
|
+
return autoScrollLeft.value;
|
|
5495
5575
|
},
|
|
5496
5576
|
set scrollLeft(value) {
|
|
5497
|
-
|
|
5577
|
+
autoScrollLeft.value = value;
|
|
5498
5578
|
}
|
|
5499
5579
|
});
|
|
5500
5580
|
const breakpoints = getBreakPoints(computedVisibleColumns, {
|
|
@@ -13419,6 +13499,18 @@ var MatrixBrain = class extends Logger {
|
|
|
13419
13499
|
};
|
|
13420
13500
|
this.extraSpanCells = [];
|
|
13421
13501
|
this.scrollPosition = { scrollLeft: 0, scrollTop: 0 };
|
|
13502
|
+
/**
|
|
13503
|
+
* Content larger than the browser can lay out - see largeContent.ts.
|
|
13504
|
+
* Recomputed when sizes change (updateRenderCount), not on scroll.
|
|
13505
|
+
*/
|
|
13506
|
+
this.largeContent = { vertical: false, horizontal: false };
|
|
13507
|
+
this.scrollRatio = { vertical: 1, horizontal: 1 };
|
|
13508
|
+
/**
|
|
13509
|
+
* DOM offsets are written relative to this (content px) - see
|
|
13510
|
+
* "scroll origin" in largeContent.ts. Always 0 unless the content is large.
|
|
13511
|
+
*/
|
|
13512
|
+
this.scrollOrigin = { scrollLeft: 0, scrollTop: 0 };
|
|
13513
|
+
this.onScrollOriginChangeFns = /* @__PURE__ */ new Set();
|
|
13422
13514
|
this.onScrollFns = [];
|
|
13423
13515
|
// private onTotalSizeChangeFns: OnSizeChangeFn[] = [];
|
|
13424
13516
|
this.onRenderRangeChangeFns = /* @__PURE__ */ new Set();
|
|
@@ -13457,6 +13549,13 @@ var MatrixBrain = class extends Logger {
|
|
|
13457
13549
|
this.getColCount = () => {
|
|
13458
13550
|
return this.cols;
|
|
13459
13551
|
};
|
|
13552
|
+
/**
|
|
13553
|
+
* Called (synchronously) when the scroll origin moves - every DOM offset
|
|
13554
|
+
* relative to it has to be written again (in the same frame).
|
|
13555
|
+
*/
|
|
13556
|
+
this.onScrollOriginChange = (fn) => {
|
|
13557
|
+
return this.onScrollOriginChangeForBrain(fn);
|
|
13558
|
+
};
|
|
13460
13559
|
this.setScrolling = (scrolling) => {
|
|
13461
13560
|
const prevScrolling = this.scrolling;
|
|
13462
13561
|
this.scrolling = scrolling;
|
|
@@ -14369,6 +14468,143 @@ var MatrixBrain = class extends Logger {
|
|
|
14369
14468
|
updateRenderCount(which = ALL_DIRECTIONS) {
|
|
14370
14469
|
this.reset(which);
|
|
14371
14470
|
this.doUpdateRenderCount(which);
|
|
14471
|
+
this.updateLargeContent();
|
|
14472
|
+
}
|
|
14473
|
+
// -------------------------------------------------------------------------
|
|
14474
|
+
// very large content - see largeContent.ts for the why and the how
|
|
14475
|
+
// -------------------------------------------------------------------------
|
|
14476
|
+
/**
|
|
14477
|
+
* The axes on which this brain handles content larger than the browser
|
|
14478
|
+
* can lay out. The normal layout: vertical (horizontal offsets come from
|
|
14479
|
+
* column CSS vars computed by the table, not from the brain).
|
|
14480
|
+
*/
|
|
14481
|
+
supportsLargeContent(direction) {
|
|
14482
|
+
return direction === "vertical";
|
|
14483
|
+
}
|
|
14484
|
+
/**
|
|
14485
|
+
* Where the origin can be placed - see HorizontalLayoutMatrixBrain, which
|
|
14486
|
+
* needs whole pages
|
|
14487
|
+
*/
|
|
14488
|
+
alignScrollOrigin(_direction, value) {
|
|
14489
|
+
return Math.floor(value);
|
|
14490
|
+
}
|
|
14491
|
+
updateLargeContent() {
|
|
14492
|
+
const size = this.getVirtualizedContentSize();
|
|
14493
|
+
const vertical = this.supportsLargeContent("vertical") && isLargeContentSize(size.height);
|
|
14494
|
+
const horizontal = this.supportsLargeContent("horizontal") && isLargeContentSize(size.width);
|
|
14495
|
+
this.largeContent = { vertical, horizontal };
|
|
14496
|
+
this.scrollRatio = {
|
|
14497
|
+
vertical: vertical ? computeScrollRatio(size.height, this.availableHeight) : 1,
|
|
14498
|
+
horizontal: horizontal ? computeScrollRatio(size.width, this.availableWidth) : 1
|
|
14499
|
+
};
|
|
14500
|
+
this.updateScrollOrigin();
|
|
14501
|
+
}
|
|
14502
|
+
isLargeContent(direction) {
|
|
14503
|
+
return this.largeContent[direction];
|
|
14504
|
+
}
|
|
14505
|
+
/**
|
|
14506
|
+
* native scroll px -> content px (1 when the content fits)
|
|
14507
|
+
*/
|
|
14508
|
+
getScrollRatio(direction) {
|
|
14509
|
+
return this.scrollRatio[direction];
|
|
14510
|
+
}
|
|
14511
|
+
/**
|
|
14512
|
+
* The size for the scroll spacer - the content size, capped at what the
|
|
14513
|
+
* browser supports on large axes.
|
|
14514
|
+
*/
|
|
14515
|
+
getNativeScrollSize() {
|
|
14516
|
+
const size = this.getVirtualizedContentSize();
|
|
14517
|
+
const { largeContent } = this;
|
|
14518
|
+
if (!largeContent.vertical && !largeContent.horizontal) {
|
|
14519
|
+
return size;
|
|
14520
|
+
}
|
|
14521
|
+
const max = getMaxElementSize();
|
|
14522
|
+
return {
|
|
14523
|
+
width: largeContent.horizontal ? max : size.width,
|
|
14524
|
+
height: largeContent.vertical ? max : size.height
|
|
14525
|
+
};
|
|
14526
|
+
}
|
|
14527
|
+
/**
|
|
14528
|
+
* The native scroll position of the scroll container -> the content scroll
|
|
14529
|
+
* position (what the brain and the API work with)
|
|
14530
|
+
*/
|
|
14531
|
+
toContentScrollPosition(nativeScrollPosition) {
|
|
14532
|
+
const { vertical, horizontal } = this.scrollRatio;
|
|
14533
|
+
if (vertical === 1 && horizontal === 1) {
|
|
14534
|
+
return nativeScrollPosition;
|
|
14535
|
+
}
|
|
14536
|
+
return {
|
|
14537
|
+
scrollTop: nativeScrollPosition.scrollTop * vertical,
|
|
14538
|
+
scrollLeft: nativeScrollPosition.scrollLeft * horizontal
|
|
14539
|
+
};
|
|
14540
|
+
}
|
|
14541
|
+
/**
|
|
14542
|
+
* Content scroll position -> what to set on the scroll container
|
|
14543
|
+
*/
|
|
14544
|
+
toNativeScrollPosition(contentScrollPosition) {
|
|
14545
|
+
const { vertical, horizontal } = this.scrollRatio;
|
|
14546
|
+
if (vertical === 1 && horizontal === 1) {
|
|
14547
|
+
return contentScrollPosition;
|
|
14548
|
+
}
|
|
14549
|
+
return {
|
|
14550
|
+
scrollTop: contentScrollPosition.scrollTop / vertical,
|
|
14551
|
+
scrollLeft: contentScrollPosition.scrollLeft / horizontal
|
|
14552
|
+
};
|
|
14553
|
+
}
|
|
14554
|
+
/**
|
|
14555
|
+
* DOM offsets (transforms, CSS vars) are relative to this. Always 0,0
|
|
14556
|
+
* unless the content is large.
|
|
14557
|
+
*/
|
|
14558
|
+
getScrollOrigin() {
|
|
14559
|
+
return this.scrollOrigin;
|
|
14560
|
+
}
|
|
14561
|
+
/**
|
|
14562
|
+
* The scroll position relative to the scroll origin - this is what
|
|
14563
|
+
* transforms that follow the scroll position should use.
|
|
14564
|
+
*/
|
|
14565
|
+
getDOMScrollPosition(scrollPosition = this.getScrollPosition()) {
|
|
14566
|
+
const origin2 = this.getScrollOrigin();
|
|
14567
|
+
if (!origin2.scrollTop && !origin2.scrollLeft) {
|
|
14568
|
+
return scrollPosition;
|
|
14569
|
+
}
|
|
14570
|
+
return {
|
|
14571
|
+
scrollTop: scrollPosition.scrollTop - origin2.scrollTop,
|
|
14572
|
+
scrollLeft: scrollPosition.scrollLeft - origin2.scrollLeft
|
|
14573
|
+
};
|
|
14574
|
+
}
|
|
14575
|
+
// a method (not an arrow property) so subclasses can call it via super
|
|
14576
|
+
onScrollOriginChangeForBrain(fn) {
|
|
14577
|
+
this.onScrollOriginChangeFns.add(fn);
|
|
14578
|
+
return () => {
|
|
14579
|
+
this.onScrollOriginChangeFns.delete(fn);
|
|
14580
|
+
};
|
|
14581
|
+
}
|
|
14582
|
+
updateScrollOrigin() {
|
|
14583
|
+
const { scrollPosition, largeContent, scrollOrigin } = this;
|
|
14584
|
+
const alignVertical = (value) => this.alignScrollOrigin("vertical", value);
|
|
14585
|
+
const alignHorizontal = (value) => this.alignScrollOrigin("horizontal", value);
|
|
14586
|
+
const scrollTop2 = largeContent.vertical ? computeScrollOrigin(
|
|
14587
|
+
scrollPosition.scrollTop,
|
|
14588
|
+
alignVertical(scrollOrigin.scrollTop),
|
|
14589
|
+
alignVertical
|
|
14590
|
+
) : 0;
|
|
14591
|
+
const scrollLeft2 = largeContent.horizontal ? computeScrollOrigin(
|
|
14592
|
+
scrollPosition.scrollLeft,
|
|
14593
|
+
alignHorizontal(scrollOrigin.scrollLeft),
|
|
14594
|
+
alignHorizontal
|
|
14595
|
+
) : 0;
|
|
14596
|
+
if (scrollTop2 === scrollOrigin.scrollTop && scrollLeft2 === scrollOrigin.scrollLeft) {
|
|
14597
|
+
return;
|
|
14598
|
+
}
|
|
14599
|
+
this.scrollOrigin = { scrollTop: scrollTop2, scrollLeft: scrollLeft2 };
|
|
14600
|
+
this.notifyScrollOriginChange();
|
|
14601
|
+
}
|
|
14602
|
+
notifyScrollOriginChange() {
|
|
14603
|
+
if (this.destroyed) {
|
|
14604
|
+
return;
|
|
14605
|
+
}
|
|
14606
|
+
const origin2 = this.getScrollOrigin();
|
|
14607
|
+
this.onScrollOriginChangeFns.forEach((fn) => fn(origin2));
|
|
14372
14608
|
}
|
|
14373
14609
|
doUpdateRenderCount(which = ALL_DIRECTIONS) {
|
|
14374
14610
|
if (!this.availableWidth || !this.availableHeight) {
|
|
@@ -14400,6 +14636,7 @@ var MatrixBrain = class extends Logger {
|
|
|
14400
14636
|
const changeVertical = scrollPosition.scrollTop !== this.scrollPosition.scrollTop;
|
|
14401
14637
|
this.scrollPosition = scrollPosition;
|
|
14402
14638
|
if (changeHorizontal || changeVertical) {
|
|
14639
|
+
this.updateScrollOrigin();
|
|
14403
14640
|
callback?.(scrollPosition);
|
|
14404
14641
|
this.updateRenderRange({
|
|
14405
14642
|
horizontal: changeHorizontal,
|
|
@@ -14589,6 +14826,7 @@ var MatrixBrain = class extends Logger {
|
|
|
14589
14826
|
this.onScrollStartFns = [];
|
|
14590
14827
|
this.onScrollStopFns = [];
|
|
14591
14828
|
this.onRenderCountChangeFns.clear();
|
|
14829
|
+
this.onScrollOriginChangeFns.clear();
|
|
14592
14830
|
this.onRenderRangeChangeFns.clear();
|
|
14593
14831
|
this.onVerticalRenderRangeChangeFns.clear();
|
|
14594
14832
|
this.onHorizontalRenderRangeChangeFns.clear();
|
|
@@ -15124,6 +15362,9 @@ var GridRenderer = class extends Logger {
|
|
|
15124
15362
|
scrollTop: scrollTop2,
|
|
15125
15363
|
scrollLeft: scrollLeft2
|
|
15126
15364
|
}) => {
|
|
15365
|
+
if (!scrollTop2) {
|
|
15366
|
+
y -= this.brain.getScrollOrigin().scrollTop;
|
|
15367
|
+
}
|
|
15127
15368
|
element.style.setProperty(
|
|
15128
15369
|
currentTransformY,
|
|
15129
15370
|
scrollTop2 ? `calc( ${y}px + var(${scrollTopCSSVar}) )` : `${y}px`
|
|
@@ -15140,7 +15381,7 @@ var GridRenderer = class extends Logger {
|
|
|
15140
15381
|
}, zIndex2) => {
|
|
15141
15382
|
const columnOffsetX = InternalVarUtils.columnOffsets.get(colIndex);
|
|
15142
15383
|
const columnOffsetXWhileReordering = `${columnOffsetAtIndexWhileReordering2}-${colIndex}`;
|
|
15143
|
-
const currentTransformYValue = scrollTop2 ? `calc( ${y}px + var(${scrollTopCSSVar}) )` : `${y}px`;
|
|
15384
|
+
const currentTransformYValue = scrollTop2 ? `calc( ${y}px + var(${scrollTopCSSVar}) )` : `${y - this.brain.getScrollOrigin().scrollTop}px`;
|
|
15144
15385
|
if (element.__currentTransformY !== currentTransformYValue) {
|
|
15145
15386
|
element.__currentTransformY = currentTransformYValue;
|
|
15146
15387
|
element.style.setProperty(currentTransformY, currentTransformYValue);
|
|
@@ -15153,6 +15394,24 @@ var GridRenderer = class extends Logger {
|
|
|
15153
15394
|
if (zIndex2 != null) {
|
|
15154
15395
|
}
|
|
15155
15396
|
};
|
|
15397
|
+
/**
|
|
15398
|
+
* The scroll origin moved (huge content only - see largeContent.ts): every
|
|
15399
|
+
* rendered cell / detail row is positioned relative to it, so they all
|
|
15400
|
+
* need to be repositioned now - synchronously, so it's in the same frame
|
|
15401
|
+
* as the scroll layer transform, which uses the new origin too.
|
|
15402
|
+
*/
|
|
15403
|
+
this.onScrollOriginChange = () => {
|
|
15404
|
+
if (this.destroyed) {
|
|
15405
|
+
return;
|
|
15406
|
+
}
|
|
15407
|
+
this.cellManager.getAllCells().forEach((cell) => {
|
|
15408
|
+
this.updateElementPosition(cell, void 0, { immediate: true });
|
|
15409
|
+
});
|
|
15410
|
+
this.rowManager.forEachAttachedRow((row) => {
|
|
15411
|
+
this.updateDetailElementPosition(row);
|
|
15412
|
+
});
|
|
15413
|
+
this.adjustFixedElementsOnScroll();
|
|
15414
|
+
};
|
|
15156
15415
|
this.getFullyVisibleRowsRange = () => {
|
|
15157
15416
|
let {
|
|
15158
15417
|
start: [startRow],
|
|
@@ -15620,7 +15879,7 @@ var GridRenderer = class extends Logger {
|
|
|
15620
15879
|
this.hoverRowUpdatesInProgress.delete(rowIndex);
|
|
15621
15880
|
});
|
|
15622
15881
|
};
|
|
15623
|
-
this.updateElementPosition = (cell, options) => {
|
|
15882
|
+
this.updateElementPosition = (cell, options, config) => {
|
|
15624
15883
|
if (this.destroyed) {
|
|
15625
15884
|
return;
|
|
15626
15885
|
}
|
|
@@ -15661,7 +15920,7 @@ var GridRenderer = class extends Logger {
|
|
|
15661
15920
|
itemElement.style.top = `${y}px`;
|
|
15662
15921
|
}
|
|
15663
15922
|
};
|
|
15664
|
-
if (this.scrolling && this.brain.isHorizontalLayoutBrain) {
|
|
15923
|
+
if (this.scrolling && this.brain.isHorizontalLayoutBrain && !config?.immediate) {
|
|
15665
15924
|
cell.setPendingAfterCommitWork(applyPosition);
|
|
15666
15925
|
} else {
|
|
15667
15926
|
applyPosition();
|
|
@@ -15690,7 +15949,7 @@ var GridRenderer = class extends Logger {
|
|
|
15690
15949
|
if (ITEM_POSITION_WITH_TRANSFORM) {
|
|
15691
15950
|
this.setDetailTransform(itemElement, rowIndex, {
|
|
15692
15951
|
y,
|
|
15693
|
-
scrollLeft: this.brain.
|
|
15952
|
+
scrollLeft: this.brain.getDOMScrollPosition().scrollLeft
|
|
15694
15953
|
});
|
|
15695
15954
|
itemElement.style.willChange = "transform";
|
|
15696
15955
|
itemElement.style.backfaceVisibility = "hidden";
|
|
@@ -15708,6 +15967,7 @@ var GridRenderer = class extends Logger {
|
|
|
15708
15967
|
};
|
|
15709
15968
|
this.onScrollStop = () => {
|
|
15710
15969
|
this.scrolling = false;
|
|
15970
|
+
this.flushPendingAfterCommitWork();
|
|
15711
15971
|
if (this.lastEnteredRow != -1) {
|
|
15712
15972
|
this.addHoverClass(this.lastEnteredRow);
|
|
15713
15973
|
}
|
|
@@ -15734,7 +15994,7 @@ var GridRenderer = class extends Logger {
|
|
|
15734
15994
|
}
|
|
15735
15995
|
this.setDetailTransform(node, rowIndex, {
|
|
15736
15996
|
y,
|
|
15737
|
-
scrollLeft: scrollPosition.scrollLeft
|
|
15997
|
+
scrollLeft: brain.getDOMScrollPosition(scrollPosition).scrollLeft
|
|
15738
15998
|
});
|
|
15739
15999
|
}
|
|
15740
16000
|
});
|
|
@@ -15745,7 +16005,9 @@ var GridRenderer = class extends Logger {
|
|
|
15745
16005
|
const attachedCell = this.cellManager.getOneAttachedCell();
|
|
15746
16006
|
if (attachedCell) {
|
|
15747
16007
|
setInfiniteScrollPosition(
|
|
15748
|
-
|
|
16008
|
+
// fixed cells are positioned with these, inside the scroll layer
|
|
16009
|
+
// which is translated relative to the scroll origin
|
|
16010
|
+
brain.getDOMScrollPosition(scrollPosition),
|
|
15749
16011
|
this.getInfiniteNode(attachedCell.getElement())
|
|
15750
16012
|
);
|
|
15751
16013
|
}
|
|
@@ -15967,7 +16229,11 @@ var GridRenderer = class extends Logger {
|
|
|
15967
16229
|
});
|
|
15968
16230
|
const removeOnScrollStart = brain.onScrollStart(this.onScrollStart);
|
|
15969
16231
|
const removeOnScrollStop = brain.onScrollStop(this.onScrollStop);
|
|
16232
|
+
const removeOnScrollOriginChange = brain.onScrollOriginChange(
|
|
16233
|
+
this.onScrollOriginChange
|
|
16234
|
+
);
|
|
15970
16235
|
this.onDestroy = () => {
|
|
16236
|
+
removeOnScrollOriginChange();
|
|
15971
16237
|
removeOnScroll();
|
|
15972
16238
|
removeOnSizeChange();
|
|
15973
16239
|
removeOnScrollStart();
|
|
@@ -16321,9 +16587,7 @@ var HorizontalLayoutTableRenderer = class extends GridRenderer {
|
|
|
16321
16587
|
colIndex
|
|
16322
16588
|
);
|
|
16323
16589
|
const { y } = options;
|
|
16324
|
-
const pageIndex = Math.floor(
|
|
16325
|
-
horizontalLayoutCoords.rowIndex / this.brain.rowsPerPage
|
|
16326
|
-
);
|
|
16590
|
+
const pageIndex = Math.floor(horizontalLayoutCoords.rowIndex / this.brain.rowsPerPage) - this.brain.getScrollOriginPageIndex();
|
|
16327
16591
|
const pageWidth = ThemeVars.runtime.totalVisibleColumnsWidthVar;
|
|
16328
16592
|
const pageOffset = pageIndex ? `calc(${pageWidth} * ${pageIndex})` : "0px";
|
|
16329
16593
|
const columnOffsetX = InternalVarUtils.columnOffsets.get(
|
|
@@ -16962,6 +17226,58 @@ var ActiveIndicatorWrapperCls = "nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw
|
|
|
16962
17226
|
// src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
|
|
16963
17227
|
var ActiveRowIndicatorRecipe = createRuntimeFn({ defaultClassName: "j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26", variantClassNames: { active: { true: "j26lrx2", false: "j26lrx3" } }, defaultVariants: {}, compoundVariants: [] });
|
|
16964
17228
|
|
|
17229
|
+
// src/components/InfiniteTable/components/activeIndicatorOffsets.ts
|
|
17230
|
+
function getPageOffsetX(brain, pageIndex) {
|
|
17231
|
+
const relativePageIndex = pageIndex - brain.getScrollOriginPageIndex();
|
|
17232
|
+
return relativePageIndex ? `calc(${ThemeVars.runtime.totalVisibleColumnsWidthVar} * ${relativePageIndex})` : null;
|
|
17233
|
+
}
|
|
17234
|
+
function getActiveRowIndicatorVars(brain, activeRowIndex) {
|
|
17235
|
+
let activeCellRowOffsetX = "0px";
|
|
17236
|
+
let rowIndex = activeRowIndex;
|
|
17237
|
+
if (brain.isHorizontalLayoutBrain && brain.rowsPerPage) {
|
|
17238
|
+
activeCellRowOffsetX = getPageOffsetX(brain, brain.getPageIndexForRow(rowIndex)) ?? "0px";
|
|
17239
|
+
rowIndex = rowIndex % brain.rowsPerPage;
|
|
17240
|
+
}
|
|
17241
|
+
const activeCellRowHeight = brain.getRowHeight(rowIndex);
|
|
17242
|
+
const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical") - brain.getScrollOrigin().scrollTop;
|
|
17243
|
+
return {
|
|
17244
|
+
activeCellRowHeight: `${activeCellRowHeight}px`,
|
|
17245
|
+
activeCellRowOffset: `${activeCellRowOffset}px`,
|
|
17246
|
+
activeCellRowOffsetX
|
|
17247
|
+
};
|
|
17248
|
+
}
|
|
17249
|
+
function getActiveRowIndicatorScrollVars(brain, scrollPosition) {
|
|
17250
|
+
const { scrollTop: scrollTop2, scrollLeft: scrollLeft2 } = brain.getDOMScrollPosition(scrollPosition);
|
|
17251
|
+
return {
|
|
17252
|
+
scrollTopForActiveRow: `${-scrollTop2}px`,
|
|
17253
|
+
scrollLeftForActiveRowWhenHorizontalLayout: brain.isHorizontalLayoutBrain ? `${-scrollLeft2}px` : "0px"
|
|
17254
|
+
};
|
|
17255
|
+
}
|
|
17256
|
+
function getActiveCellIndicatorVars(brain, activeCellIndex, rowHeight) {
|
|
17257
|
+
let [rowIndex] = activeCellIndex;
|
|
17258
|
+
const colIndex = activeCellIndex[1];
|
|
17259
|
+
let activeCellColOffset2;
|
|
17260
|
+
if (brain.isHorizontalLayoutBrain && brain.rowsPerPage) {
|
|
17261
|
+
const columnOffset = InternalVarUtils.columnOffsets.get(colIndex);
|
|
17262
|
+
const pageOffset = getPageOffsetX(
|
|
17263
|
+
brain,
|
|
17264
|
+
brain.getPageIndexForRow(rowIndex)
|
|
17265
|
+
);
|
|
17266
|
+
activeCellColOffset2 = pageOffset ? `calc( ${pageOffset} + ${columnOffset})` : columnOffset;
|
|
17267
|
+
rowIndex = rowIndex % brain.rowsPerPage;
|
|
17268
|
+
}
|
|
17269
|
+
const activeCellRowHeight = typeof rowHeight === "function" ? rowHeight(rowIndex) : rowHeight ?? brain.getRowHeight(rowIndex);
|
|
17270
|
+
const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical") - brain.getScrollOrigin().scrollTop;
|
|
17271
|
+
const vars = {
|
|
17272
|
+
activeCellRowHeight: `${activeCellRowHeight}px`,
|
|
17273
|
+
activeCellRowOffset: `${activeCellRowOffset}px`
|
|
17274
|
+
};
|
|
17275
|
+
if (activeCellColOffset2 !== void 0) {
|
|
17276
|
+
vars.activeCellColOffset = activeCellColOffset2;
|
|
17277
|
+
}
|
|
17278
|
+
return vars;
|
|
17279
|
+
}
|
|
17280
|
+
|
|
16965
17281
|
// src/components/InfiniteTable/components/ActiveRowIndicator.tsx
|
|
16966
17282
|
var { rootClassName: rootClassName6 } = internalProps;
|
|
16967
17283
|
var baseCls = `${rootClassName6}-ActiveRowIndicator`;
|
|
@@ -16979,43 +17295,32 @@ var ActiveRowIndicatorFn = (props) => {
|
|
|
16979
17295
|
const domRef = (0, import_react30.useRef)(null);
|
|
16980
17296
|
const active = props.activeRowIndex != null && brain.getInitialRows() > props.activeRowIndex;
|
|
16981
17297
|
const [_rerenderId, rerender] = useRerender();
|
|
16982
|
-
(0, import_react30.
|
|
16983
|
-
|
|
17298
|
+
const activeRowIndexRef = (0, import_react30.useRef)(props.activeRowIndex);
|
|
17299
|
+
activeRowIndexRef.current = props.activeRowIndex;
|
|
17300
|
+
const reposition2 = () => {
|
|
17301
|
+
const activeRowIndex = activeRowIndexRef.current;
|
|
17302
|
+
if (activeRowIndex == null || !domRef.current) {
|
|
16984
17303
|
return;
|
|
16985
17304
|
}
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
|
|
16991
|
-
|
|
16992
|
-
}
|
|
16993
|
-
rowIndex = rowIndex % brain.rowsPerPage;
|
|
16994
|
-
}
|
|
16995
|
-
const activeCellRowHeight = brain.getRowHeight(rowIndex);
|
|
16996
|
-
const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
|
|
16997
|
-
const node = domRef.current;
|
|
16998
|
-
const vars = {
|
|
16999
|
-
activeCellRowHeight: `${activeCellRowHeight}px`,
|
|
17000
|
-
activeCellRowOffset: `${activeCellRowOffset}px`,
|
|
17001
|
-
activeCellRowOffsetX
|
|
17002
|
-
};
|
|
17003
|
-
setInfiniteVarsOnNode(vars, node);
|
|
17004
|
-
}, [props.activeRowIndex, brain]);
|
|
17305
|
+
setInfiniteVarsOnNode(
|
|
17306
|
+
getActiveRowIndicatorVars(brain, activeRowIndex),
|
|
17307
|
+
domRef.current
|
|
17308
|
+
);
|
|
17309
|
+
};
|
|
17310
|
+
(0, import_react30.useLayoutEffect)(reposition2, [props.activeRowIndex, brain]);
|
|
17005
17311
|
(0, import_react30.useEffect)(() => {
|
|
17006
17312
|
const updateVars = (scrollPosition) => {
|
|
17007
17313
|
setInfiniteVarsOnNode(
|
|
17008
|
-
|
|
17009
|
-
scrollTopForActiveRow: `${-scrollPosition.scrollTop}px`,
|
|
17010
|
-
scrollLeftForActiveRowWhenHorizontalLayout: brain.isHorizontalLayoutBrain ? `${-scrollPosition.scrollLeft}px` : "0px"
|
|
17011
|
-
},
|
|
17314
|
+
getActiveRowIndicatorScrollVars(brain, scrollPosition),
|
|
17012
17315
|
domRef.current
|
|
17013
17316
|
);
|
|
17014
17317
|
};
|
|
17015
17318
|
updateVars(brain.getScrollPosition());
|
|
17016
17319
|
const removeOnScroll = brain.onScroll(updateVars);
|
|
17017
17320
|
const removeOnRenderCountChange = brain.onRenderCountChange(rerender);
|
|
17321
|
+
const removeOnScrollOriginChange = brain.onScrollOriginChange(reposition2);
|
|
17018
17322
|
return () => {
|
|
17323
|
+
removeOnScrollOriginChange();
|
|
17019
17324
|
removeOnRenderCountChange();
|
|
17020
17325
|
removeOnScroll();
|
|
17021
17326
|
};
|
|
@@ -17049,19 +17354,9 @@ var reposition = (brain, activeCellIndex, rowHeight, domRef) => {
|
|
|
17049
17354
|
if (activeCellIndex == null) {
|
|
17050
17355
|
return;
|
|
17051
17356
|
}
|
|
17052
|
-
let [rowIndex] = activeCellIndex;
|
|
17053
|
-
if (brain.isHorizontalLayoutBrain && brain.rowsPerPage) {
|
|
17054
|
-
rowIndex = rowIndex % brain.rowsPerPage;
|
|
17055
|
-
}
|
|
17056
|
-
const activeCellRowHeight = typeof rowHeight === "function" ? rowHeight(rowIndex) : rowHeight ?? brain.getRowHeight(rowIndex);
|
|
17057
|
-
const activeCellRowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
|
|
17058
|
-
const node = domRef.current;
|
|
17059
17357
|
setInfiniteVarsOnNode(
|
|
17060
|
-
|
|
17061
|
-
|
|
17062
|
-
activeCellRowOffset: `${activeCellRowOffset}px`
|
|
17063
|
-
},
|
|
17064
|
-
node
|
|
17358
|
+
getActiveCellIndicatorVars(brain, activeCellIndex, rowHeight),
|
|
17359
|
+
domRef.current
|
|
17065
17360
|
);
|
|
17066
17361
|
};
|
|
17067
17362
|
var ActiveCellIndicatorFn = (props) => {
|
|
@@ -17072,12 +17367,19 @@ var ActiveCellIndicatorFn = (props) => {
|
|
|
17072
17367
|
(0, import_react31.useLayoutEffect)(() => {
|
|
17073
17368
|
reposition(brain, props.activeCellIndex, props.rowHeight, domRef);
|
|
17074
17369
|
}, [props.activeCellIndex, props.rowHeight, brain]);
|
|
17370
|
+
const propsRef = (0, import_react31.useRef)(props);
|
|
17371
|
+
propsRef.current = props;
|
|
17075
17372
|
(0, import_react31.useEffect)(() => {
|
|
17076
17373
|
const removeOnRenderCountChange = brain.onRenderCountChange(() => {
|
|
17077
17374
|
rerender();
|
|
17078
17375
|
});
|
|
17376
|
+
const removeOnScrollOriginChange = brain.onScrollOriginChange(() => {
|
|
17377
|
+
const { activeCellIndex, rowHeight } = propsRef.current;
|
|
17378
|
+
reposition(brain, activeCellIndex, rowHeight, domRef);
|
|
17379
|
+
});
|
|
17079
17380
|
return () => {
|
|
17080
17381
|
removeOnRenderCountChange();
|
|
17382
|
+
removeOnScrollOriginChange();
|
|
17081
17383
|
};
|
|
17082
17384
|
}, [brain]);
|
|
17083
17385
|
return (
|
|
@@ -17186,34 +17488,61 @@ function HeadlessTable(props) {
|
|
|
17186
17488
|
const remove = setupResizeObserver(node, onResize, { debounce: 50 });
|
|
17187
17489
|
return remove;
|
|
17188
17490
|
}, [wrapRowsHorizontally, brain]);
|
|
17189
|
-
const updateDOMTransform = (0, import_react32.useCallback)(
|
|
17190
|
-
|
|
17191
|
-
|
|
17491
|
+
const updateDOMTransform = (0, import_react32.useCallback)(
|
|
17492
|
+
(contentScrollPos) => {
|
|
17493
|
+
const scrollPos = brain.getDOMScrollPosition(contentScrollPos);
|
|
17494
|
+
requestAnimationFrame(() => {
|
|
17495
|
+
if (!domRef.current) {
|
|
17496
|
+
return;
|
|
17497
|
+
}
|
|
17498
|
+
domRef.current.style.setProperty(
|
|
17499
|
+
"transform",
|
|
17500
|
+
`translate3d(${-scrollPos.scrollLeft}px, ${-scrollPos.scrollTop}px, 0px)`
|
|
17501
|
+
);
|
|
17192
17502
|
return;
|
|
17193
|
-
}
|
|
17194
|
-
|
|
17195
|
-
|
|
17196
|
-
|
|
17197
|
-
);
|
|
17198
|
-
return;
|
|
17199
|
-
});
|
|
17200
|
-
}, []);
|
|
17503
|
+
});
|
|
17504
|
+
},
|
|
17505
|
+
[brain]
|
|
17506
|
+
);
|
|
17201
17507
|
const onContainerScroll = (0, import_react32.useCallback)(
|
|
17202
|
-
(
|
|
17203
|
-
brain.setScrollPosition(
|
|
17508
|
+
(nativeScrollPos) => {
|
|
17509
|
+
brain.setScrollPosition(
|
|
17510
|
+
brain.toContentScrollPosition(nativeScrollPos),
|
|
17511
|
+
updateDOMTransform
|
|
17512
|
+
);
|
|
17204
17513
|
},
|
|
17205
17514
|
[brain, updateDOMTransform]
|
|
17206
17515
|
);
|
|
17207
17516
|
(0, import_react32.useEffect)(() => {
|
|
17208
17517
|
const removeOnRenderCount = brain.onRenderCountChange(() => {
|
|
17209
|
-
setTotalScrollSize(brain.
|
|
17518
|
+
setTotalScrollSize(brain.getNativeScrollSize());
|
|
17210
17519
|
});
|
|
17211
|
-
setTotalScrollSize(brain.
|
|
17520
|
+
setTotalScrollSize(brain.getNativeScrollSize());
|
|
17212
17521
|
updateDOMTransform(
|
|
17213
17522
|
brain.getScrollPosition() || { scrollLeft: 0, scrollTop: 0 }
|
|
17214
17523
|
);
|
|
17215
17524
|
return removeOnRenderCount;
|
|
17216
17525
|
}, [brain]);
|
|
17526
|
+
const scrollRatioRef = (0, import_react32.useRef)({ brain, vertical: 1, horizontal: 1 });
|
|
17527
|
+
(0, import_react32.useLayoutEffect)(() => {
|
|
17528
|
+
const prev = scrollRatioRef.current;
|
|
17529
|
+
const vertical = brain.getScrollRatio("vertical");
|
|
17530
|
+
const horizontal = brain.getScrollRatio("horizontal");
|
|
17531
|
+
scrollRatioRef.current = { brain, vertical, horizontal };
|
|
17532
|
+
const scroller = domRef.current?.parentElement;
|
|
17533
|
+
if (!scroller || prev.brain !== brain || prev.vertical === vertical && prev.horizontal === horizontal) {
|
|
17534
|
+
return;
|
|
17535
|
+
}
|
|
17536
|
+
const nativeScrollPos = brain.toNativeScrollPosition(
|
|
17537
|
+
brain.getScrollPosition()
|
|
17538
|
+
);
|
|
17539
|
+
if (prev.vertical !== vertical) {
|
|
17540
|
+
scroller.scrollTop = nativeScrollPos.scrollTop;
|
|
17541
|
+
}
|
|
17542
|
+
if (prev.horizontal !== horizontal) {
|
|
17543
|
+
scroller.scrollLeft = nativeScrollPos.scrollLeft;
|
|
17544
|
+
}
|
|
17545
|
+
}, [scrollSize, brain]);
|
|
17217
17546
|
return /* @__PURE__ */ React41.createElement(
|
|
17218
17547
|
VirtualScrollContainer,
|
|
17219
17548
|
{
|
|
@@ -17694,11 +18023,15 @@ function InfiniteTableInternalHeaderFn(props) {
|
|
|
17694
18023
|
};
|
|
17695
18024
|
});
|
|
17696
18025
|
const domRef = (0, import_react36.useRef)(null);
|
|
17697
|
-
const updateDOMTransform = (0, import_react36.useCallback)(
|
|
17698
|
-
|
|
17699
|
-
domRef.current
|
|
17700
|
-
|
|
17701
|
-
|
|
18026
|
+
const updateDOMTransform = (0, import_react36.useCallback)(
|
|
18027
|
+
(scrollPosition) => {
|
|
18028
|
+
if (domRef.current) {
|
|
18029
|
+
const { scrollLeft: scrollLeft2 } = headerBrain.getDOMScrollPosition(scrollPosition);
|
|
18030
|
+
domRef.current.style.transform = `translate3d(${-scrollLeft2}px, 0px, 0px)`;
|
|
18031
|
+
}
|
|
18032
|
+
},
|
|
18033
|
+
[headerBrain]
|
|
18034
|
+
);
|
|
17702
18035
|
(0, import_react36.useEffect)(() => {
|
|
17703
18036
|
const removeOnScroll = headerBrain.onScroll(updateDOMTransform);
|
|
17704
18037
|
updateDOMTransform(
|
|
@@ -20876,10 +21209,10 @@ var InfiniteTableApiImpl = class {
|
|
|
20876
21209
|
return false;
|
|
20877
21210
|
}
|
|
20878
21211
|
if (newScrollPosition.scrollLeft !== currentScrollPosition.scrollLeft && !cantScrollLeft) {
|
|
20879
|
-
|
|
21212
|
+
this.setNativeScroll({ scrollLeft: newScrollPosition.scrollLeft });
|
|
20880
21213
|
}
|
|
20881
21214
|
if (newScrollPosition.scrollTop !== currentScrollPosition.scrollTop && !cantScrollTop) {
|
|
20882
|
-
|
|
21215
|
+
this.setNativeScroll({ scrollTop: newScrollPosition.scrollTop });
|
|
20883
21216
|
}
|
|
20884
21217
|
return true;
|
|
20885
21218
|
};
|
|
@@ -21310,6 +21643,29 @@ var InfiniteTableApiImpl = class {
|
|
|
21310
21643
|
get scrollContainer() {
|
|
21311
21644
|
return this.getState().scrollerDOMRef.current;
|
|
21312
21645
|
}
|
|
21646
|
+
/**
|
|
21647
|
+
* All scroll positions in the API are content positions. The scroll
|
|
21648
|
+
* container can be shorter than the content (when the content is larger
|
|
21649
|
+
* than what browsers support), so writes go through the brain's ratio -
|
|
21650
|
+
* see VirtualBrain/largeContent.ts. Identity when the content fits.
|
|
21651
|
+
*/
|
|
21652
|
+
setNativeScroll(contentScroll) {
|
|
21653
|
+
const state = this.getState();
|
|
21654
|
+
const scroller = state.scrollerDOMRef.current;
|
|
21655
|
+
if (!scroller) {
|
|
21656
|
+
return;
|
|
21657
|
+
}
|
|
21658
|
+
const native = state.brain.toNativeScrollPosition({
|
|
21659
|
+
scrollTop: contentScroll.scrollTop ?? 0,
|
|
21660
|
+
scrollLeft: contentScroll.scrollLeft ?? 0
|
|
21661
|
+
});
|
|
21662
|
+
if (contentScroll.scrollTop !== void 0) {
|
|
21663
|
+
scroller.scrollTop = native.scrollTop;
|
|
21664
|
+
}
|
|
21665
|
+
if (contentScroll.scrollLeft !== void 0) {
|
|
21666
|
+
scroller.scrollLeft = native.scrollLeft;
|
|
21667
|
+
}
|
|
21668
|
+
}
|
|
21313
21669
|
get scrollLeftMax() {
|
|
21314
21670
|
const scrollLeftMax = this.getState().brain.scrollLeftMax;
|
|
21315
21671
|
return scrollLeftMax;
|
|
@@ -21323,20 +21679,14 @@ var InfiniteTableApiImpl = class {
|
|
|
21323
21679
|
return state.brain.getScrollPosition().scrollLeft;
|
|
21324
21680
|
}
|
|
21325
21681
|
set scrollLeft(scrollLeft2) {
|
|
21326
|
-
|
|
21327
|
-
if (state.scrollerDOMRef.current) {
|
|
21328
|
-
state.scrollerDOMRef.current.scrollLeft = Math.max(scrollLeft2, 0);
|
|
21329
|
-
}
|
|
21682
|
+
this.setNativeScroll({ scrollLeft: Math.max(scrollLeft2, 0) });
|
|
21330
21683
|
}
|
|
21331
21684
|
get scrollTop() {
|
|
21332
21685
|
const state = this.getState();
|
|
21333
21686
|
return state.brain.getScrollPosition().scrollTop;
|
|
21334
21687
|
}
|
|
21335
21688
|
set scrollTop(scrollTop2) {
|
|
21336
|
-
|
|
21337
|
-
if (state.scrollerDOMRef.current) {
|
|
21338
|
-
state.scrollerDOMRef.current.scrollTop = Math.max(scrollTop2, 0);
|
|
21339
|
-
}
|
|
21689
|
+
this.setNativeScroll({ scrollTop: Math.max(scrollTop2, 0) });
|
|
21340
21690
|
}
|
|
21341
21691
|
scrollRowIntoView(rowIndex, config = { offset: 0 }) {
|
|
21342
21692
|
const state = this.getState();
|
|
@@ -21362,10 +21712,10 @@ var InfiniteTableApiImpl = class {
|
|
|
21362
21712
|
return false;
|
|
21363
21713
|
}
|
|
21364
21714
|
if (scrollTopValid && scrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
21365
|
-
|
|
21715
|
+
this.setNativeScroll({ scrollTop: scrollPosition.scrollTop });
|
|
21366
21716
|
}
|
|
21367
21717
|
if (scrollLeftChanged) {
|
|
21368
|
-
|
|
21718
|
+
this.setNativeScroll({ scrollLeft: scrollPosition.scrollLeft });
|
|
21369
21719
|
}
|
|
21370
21720
|
return true;
|
|
21371
21721
|
}
|
|
@@ -21387,7 +21737,7 @@ var InfiniteTableApiImpl = class {
|
|
|
21387
21737
|
return false;
|
|
21388
21738
|
}
|
|
21389
21739
|
if (scrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
|
|
21390
|
-
|
|
21740
|
+
this.setNativeScroll({ scrollLeft: scrollPosition.scrollLeft });
|
|
21391
21741
|
}
|
|
21392
21742
|
return true;
|
|
21393
21743
|
}
|
|
@@ -26629,6 +26979,12 @@ var HorizontalLayoutMatrixBrain = class extends MatrixBrain {
|
|
|
26629
26979
|
this.onTotalPageCountChangeFns.delete(fn);
|
|
26630
26980
|
};
|
|
26631
26981
|
};
|
|
26982
|
+
this.onScrollOriginChange = (fn) => {
|
|
26983
|
+
if (this.options?.masterBrain) {
|
|
26984
|
+
return this.options.masterBrain.onScrollOriginChange(fn);
|
|
26985
|
+
}
|
|
26986
|
+
return super.onScrollOriginChangeForBrain(fn);
|
|
26987
|
+
};
|
|
26632
26988
|
this.options = opts;
|
|
26633
26989
|
if (this.options.masterBrain) {
|
|
26634
26990
|
this.options.masterBrain.onTotalPageCountChange(() => {
|
|
@@ -26870,6 +27226,46 @@ var HorizontalLayoutMatrixBrain = class extends MatrixBrain {
|
|
|
26870
27226
|
this.options.masterBrain = void 0;
|
|
26871
27227
|
this.onTotalPageCountChangeFns.clear();
|
|
26872
27228
|
}
|
|
27229
|
+
// -------------------------------------------------------------------------
|
|
27230
|
+
// very large content - see largeContent.ts
|
|
27231
|
+
//
|
|
27232
|
+
// Here the rows become width (pageWidth x totalPageCount) while the height
|
|
27233
|
+
// always fits the viewport, so it's the horizontal axis that can get larger
|
|
27234
|
+
// than the browser supports - with way fewer rows than in the normal layout.
|
|
27235
|
+
// -------------------------------------------------------------------------
|
|
27236
|
+
supportsLargeContent(direction) {
|
|
27237
|
+
return direction === "horizontal";
|
|
27238
|
+
}
|
|
27239
|
+
/**
|
|
27240
|
+
* The horizontal origin is a whole number of pages: cells are positioned at
|
|
27241
|
+
* `calc(pageWidth * (pageIndex - originPageIndex))`, with pageWidth being a
|
|
27242
|
+
* CSS var (so column resizes keep working without rewriting every cell).
|
|
27243
|
+
*/
|
|
27244
|
+
alignScrollOrigin(direction, value) {
|
|
27245
|
+
if (direction === "vertical" || !this.pageWidth) {
|
|
27246
|
+
return Math.floor(value);
|
|
27247
|
+
}
|
|
27248
|
+
return Math.floor(value / this.pageWidth) * this.pageWidth;
|
|
27249
|
+
}
|
|
27250
|
+
/**
|
|
27251
|
+
* The page at the horizontal scroll origin - page offsets in the DOM are
|
|
27252
|
+
* relative to it.
|
|
27253
|
+
*/
|
|
27254
|
+
getScrollOriginPageIndex() {
|
|
27255
|
+
const pageWidth = this.getPageWidth();
|
|
27256
|
+
return pageWidth ? Math.round(this.getScrollOrigin().scrollLeft / pageWidth) : 0;
|
|
27257
|
+
}
|
|
27258
|
+
// the header brain follows the body brain (its master) - same origin, so
|
|
27259
|
+
// the header and the body cells stay aligned
|
|
27260
|
+
getScrollOrigin() {
|
|
27261
|
+
return this.options?.masterBrain ? this.options.masterBrain.getScrollOrigin() : super.getScrollOrigin();
|
|
27262
|
+
}
|
|
27263
|
+
updateScrollOrigin() {
|
|
27264
|
+
if (this.options?.masterBrain) {
|
|
27265
|
+
return;
|
|
27266
|
+
}
|
|
27267
|
+
super.updateScrollOrigin();
|
|
27268
|
+
}
|
|
26873
27269
|
getVirtualizedContentSizeFor(direction) {
|
|
26874
27270
|
if (direction === "vertical") {
|
|
26875
27271
|
const rowHeight = this.getInitialRowHeight();
|
|
@@ -28779,7 +29175,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
28779
29175
|
}
|
|
28780
29176
|
let valid2 = isValidLicense(licenseKey, {
|
|
28781
29177
|
publishedAt: 1624970570587,
|
|
28782
|
-
version: "10.1.
|
|
29178
|
+
version: "10.1.4"
|
|
28783
29179
|
});
|
|
28784
29180
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
28785
29181
|
return true;
|