@infinite-table/infinite-react 8.0.0-canary.1 → 8.0.0
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 +4 -7
- package/index.dev.js +67 -68
- package/index.dev.mjs +61 -62
- package/index.js +8 -8
- package/index.mjs +8 -8
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1110,9 +1110,7 @@ type HorizontalLayoutColVisibilityOptions = {
|
|
|
1110
1110
|
|
|
1111
1111
|
interface GridCellInterface<T_ADDITIONAL_CELL_INFO = any> {
|
|
1112
1112
|
debugId: string;
|
|
1113
|
-
update(content: Renderable, additionalInfo?: T_ADDITIONAL_CELL_INFO
|
|
1114
|
-
scrolling: boolean;
|
|
1115
|
-
}): void;
|
|
1113
|
+
update(content: Renderable, additionalInfo?: T_ADDITIONAL_CELL_INFO): void;
|
|
1116
1114
|
getElement(): HTMLElement | null;
|
|
1117
1115
|
getNode(): Renderable;
|
|
1118
1116
|
destroy(): void;
|
|
@@ -1120,6 +1118,7 @@ interface GridCellInterface<T_ADDITIONAL_CELL_INFO = any> {
|
|
|
1120
1118
|
getAdditionalInfo(): T_ADDITIONAL_CELL_INFO | undefined;
|
|
1121
1119
|
isMounted(): boolean;
|
|
1122
1120
|
ref: React.RefCallback<HTMLElement | undefined>;
|
|
1121
|
+
setPendingAfterCommitWork(fn: (() => void) | null): void;
|
|
1123
1122
|
}
|
|
1124
1123
|
|
|
1125
1124
|
type CellPos = [number, number];
|
|
@@ -1140,10 +1139,7 @@ declare class GridCellManager<T_ADDITIONAL_CELL_INFO> extends Logger {
|
|
|
1140
1139
|
private clearCellFromMatrix;
|
|
1141
1140
|
private addCellToMatrix;
|
|
1142
1141
|
private setCellPositionInMatrix;
|
|
1143
|
-
renderNodeAtCell(node: Renderable, cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>, cellPos: CellPos, additionalInfo?: T_ADDITIONAL_CELL_INFO
|
|
1144
|
-
scrolling: boolean;
|
|
1145
|
-
isHorizontalLayout: boolean;
|
|
1146
|
-
}): GridCellInterface<T_ADDITIONAL_CELL_INFO>;
|
|
1142
|
+
renderNodeAtCell(node: Renderable, cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>, cellPos: CellPos, additionalInfo?: T_ADDITIONAL_CELL_INFO): GridCellInterface<T_ADDITIONAL_CELL_INFO>;
|
|
1147
1143
|
getCellPosition(cell: GridCellInterface<T_ADDITIONAL_CELL_INFO>): CellPos | null;
|
|
1148
1144
|
getCellAt(cellPos: CellPos): GridCellInterface<T_ADDITIONAL_CELL_INFO> | undefined;
|
|
1149
1145
|
/**
|
|
@@ -1326,6 +1322,7 @@ declare class GridRenderer extends Logger {
|
|
|
1326
1322
|
};
|
|
1327
1323
|
protected onMouseEnterNotBound: (event: React.MouseEvent<HTMLElement>) => void;
|
|
1328
1324
|
protected onMouseLeaveNotBound: (event: React.MouseEvent<HTMLElement>) => void;
|
|
1325
|
+
private getMatrixRowIndexFromElement;
|
|
1329
1326
|
protected renderCellAt(rowIndex: number, colIndex: number, cell: GridCellInterface, renderCell: TableRenderCellFn): void;
|
|
1330
1327
|
protected onMouseEnter: (rowIndex: number) => void;
|
|
1331
1328
|
private addHoverClass;
|
package/index.dev.js
CHANGED
|
@@ -2117,7 +2117,7 @@ function InfiniteTableFooter(props) {
|
|
|
2117
2117
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
2118
2118
|
var React51 = __toESM(require("react"));
|
|
2119
2119
|
var import_react36 = require("react");
|
|
2120
|
-
var
|
|
2120
|
+
var import_react_dom = require("react-dom");
|
|
2121
2121
|
|
|
2122
2122
|
// src/utils/keyMirror.ts
|
|
2123
2123
|
function keyMirror(obj) {
|
|
@@ -8856,41 +8856,23 @@ var import_react28 = require("react");
|
|
|
8856
8856
|
|
|
8857
8857
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
8858
8858
|
var React37 = __toESM(require("react"));
|
|
8859
|
-
var import_react_dom = require("react-dom");
|
|
8860
8859
|
var import_react27 = require("react");
|
|
8861
|
-
var SHOULD_FLUSH_SYNC = () => false;
|
|
8862
8860
|
function AvoidReactDiffFn(props) {
|
|
8863
8861
|
const [children, setChildren] = (0, import_react27.useState)(props.updater.get);
|
|
8864
8862
|
const rafId = (0, import_react27.useRef)(null);
|
|
8865
|
-
const
|
|
8863
|
+
const afterCommitRef = (0, import_react27.useRef)(props.afterCommit);
|
|
8864
|
+
afterCommitRef.current = props.afterCommit;
|
|
8866
8865
|
(0, import_react27.useLayoutEffect)(() => {
|
|
8867
8866
|
function onChange(children2) {
|
|
8868
|
-
let FLUSH_SYNC = shouldFlushSync();
|
|
8869
8867
|
if (props.useraf) {
|
|
8870
8868
|
if (rafId.current != null) {
|
|
8871
8869
|
cancelAnimationFrame(rafId.current);
|
|
8872
8870
|
}
|
|
8873
8871
|
rafId.current = requestAnimationFrame(() => {
|
|
8874
|
-
|
|
8875
|
-
queueMicrotask(() => {
|
|
8876
|
-
(0, import_react_dom.flushSync)(() => {
|
|
8877
|
-
setChildren(children2);
|
|
8878
|
-
});
|
|
8879
|
-
});
|
|
8880
|
-
} else {
|
|
8881
|
-
setChildren(children2);
|
|
8882
|
-
}
|
|
8872
|
+
setChildren(children2);
|
|
8883
8873
|
});
|
|
8884
8874
|
} else {
|
|
8885
|
-
|
|
8886
|
-
queueMicrotask(() => {
|
|
8887
|
-
(0, import_react_dom.flushSync)(() => {
|
|
8888
|
-
setChildren(children2);
|
|
8889
|
-
});
|
|
8890
|
-
});
|
|
8891
|
-
} else {
|
|
8892
|
-
setChildren(children2);
|
|
8893
|
-
}
|
|
8875
|
+
setChildren(children2);
|
|
8894
8876
|
}
|
|
8895
8877
|
}
|
|
8896
8878
|
const remove = props.updater.onChange(onChange);
|
|
@@ -8900,7 +8882,10 @@ function AvoidReactDiffFn(props) {
|
|
|
8900
8882
|
}
|
|
8901
8883
|
remove();
|
|
8902
8884
|
};
|
|
8903
|
-
}, [props.updater, props.useraf
|
|
8885
|
+
}, [props.updater, props.useraf]);
|
|
8886
|
+
(0, import_react27.useLayoutEffect)(() => {
|
|
8887
|
+
afterCommitRef.current?.();
|
|
8888
|
+
});
|
|
8904
8889
|
return children ?? null;
|
|
8905
8890
|
}
|
|
8906
8891
|
var AvoidReactDiff = React37.memo(AvoidReactDiffFn);
|
|
@@ -10229,10 +10214,14 @@ var GridCellForReact = class {
|
|
|
10229
10214
|
constructor(debugId, cellInfo) {
|
|
10230
10215
|
this.element = null;
|
|
10231
10216
|
this.mounted = false;
|
|
10232
|
-
this.
|
|
10217
|
+
this.pendingAfterCommitWork = null;
|
|
10233
10218
|
this.mountSubscription = buildSubscriptionCallback();
|
|
10234
|
-
this.
|
|
10235
|
-
|
|
10219
|
+
this.afterCommit = () => {
|
|
10220
|
+
if (this.pendingAfterCommitWork) {
|
|
10221
|
+
const work = this.pendingAfterCommitWork;
|
|
10222
|
+
this.pendingAfterCommitWork = null;
|
|
10223
|
+
work();
|
|
10224
|
+
}
|
|
10236
10225
|
};
|
|
10237
10226
|
const count = CELL_COUNT_BY_DEBUG_ID.get(debugId) ?? 0;
|
|
10238
10227
|
const key = `${debugId}:GridCellReact:${count}`;
|
|
@@ -10246,7 +10235,7 @@ var GridCellForReact = class {
|
|
|
10246
10235
|
key,
|
|
10247
10236
|
name: key,
|
|
10248
10237
|
updater: this.updater,
|
|
10249
|
-
|
|
10238
|
+
afterCommit: this.afterCommit
|
|
10250
10239
|
}
|
|
10251
10240
|
);
|
|
10252
10241
|
this.ref = (htmlElement) => {
|
|
@@ -10259,6 +10248,9 @@ var GridCellForReact = class {
|
|
|
10259
10248
|
}
|
|
10260
10249
|
};
|
|
10261
10250
|
}
|
|
10251
|
+
setPendingAfterCommitWork(fn) {
|
|
10252
|
+
this.pendingAfterCommitWork = fn;
|
|
10253
|
+
}
|
|
10262
10254
|
isMounted() {
|
|
10263
10255
|
return this.mounted;
|
|
10264
10256
|
}
|
|
@@ -10273,6 +10265,7 @@ var GridCellForReact = class {
|
|
|
10273
10265
|
destroy() {
|
|
10274
10266
|
this.mountSubscription.destroy();
|
|
10275
10267
|
this.updater.destroy();
|
|
10268
|
+
this.pendingAfterCommitWork = null;
|
|
10276
10269
|
this.ref = emptyFn;
|
|
10277
10270
|
this.element = null;
|
|
10278
10271
|
this.node = null;
|
|
@@ -10280,8 +10273,7 @@ var GridCellForReact = class {
|
|
|
10280
10273
|
getNode() {
|
|
10281
10274
|
return this.node;
|
|
10282
10275
|
}
|
|
10283
|
-
update(content, additionalInfo
|
|
10284
|
-
this.IS_UPDATED_WHILE_SCROLLING_IN_HORIZONTAL_LAYOUT = scrollingObjectParam ? scrollingObjectParam.scrolling && scrollingObjectParam.isHorizontalLayout : false;
|
|
10276
|
+
update(content, additionalInfo) {
|
|
10285
10277
|
this.updater(content);
|
|
10286
10278
|
this.cellInfo = additionalInfo;
|
|
10287
10279
|
}
|
|
@@ -10573,14 +10565,14 @@ var GridCellManager = class extends Logger {
|
|
|
10573
10565
|
}
|
|
10574
10566
|
this.addCellToMatrix(cell, cellPos);
|
|
10575
10567
|
}
|
|
10576
|
-
renderNodeAtCell(node, cell, cellPos, additionalInfo
|
|
10568
|
+
renderNodeAtCell(node, cell, cellPos, additionalInfo) {
|
|
10577
10569
|
const currentCellAtPos = this.getCellAt(cellPos);
|
|
10578
10570
|
if (currentCellAtPos && currentCellAtPos !== cell) {
|
|
10579
10571
|
this.detachCellAt(cellPos);
|
|
10580
10572
|
}
|
|
10581
10573
|
this.pool.attachCell(cell);
|
|
10582
10574
|
this.setCellPositionInMatrix(cell, cellPos);
|
|
10583
|
-
cell.update(node, additionalInfo
|
|
10575
|
+
cell.update(node, additionalInfo);
|
|
10584
10576
|
return cell;
|
|
10585
10577
|
}
|
|
10586
10578
|
getCellPosition(cell) {
|
|
@@ -11163,10 +11155,6 @@ var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
|
11163
11155
|
var columnOffsetAtIndexWhileReordering2 = stripVar(
|
|
11164
11156
|
InternalVars.columnOffsetAtIndexWhileReordering
|
|
11165
11157
|
);
|
|
11166
|
-
var SCROLLING_OBJECT_PARAM_FLYWEIGHT = {
|
|
11167
|
-
scrolling: false,
|
|
11168
|
-
isHorizontalLayout: false
|
|
11169
|
-
};
|
|
11170
11158
|
var GridRenderer = class extends Logger {
|
|
11171
11159
|
constructor(brain, debugId) {
|
|
11172
11160
|
debugId = debugId || "ReactHeadlessTableRenderer";
|
|
@@ -11606,11 +11594,11 @@ var GridRenderer = class extends Logger {
|
|
|
11606
11594
|
return covered ? [rowspanParent, colspanParent] : false;
|
|
11607
11595
|
};
|
|
11608
11596
|
this.onMouseEnterNotBound = (event) => {
|
|
11609
|
-
const rowIndex =
|
|
11597
|
+
const rowIndex = this.getMatrixRowIndexFromElement(event.currentTarget);
|
|
11610
11598
|
this.onMouseEnter(rowIndex);
|
|
11611
11599
|
};
|
|
11612
11600
|
this.onMouseLeaveNotBound = (event) => {
|
|
11613
|
-
const rowIndex =
|
|
11601
|
+
const rowIndex = this.getMatrixRowIndexFromElement(event.currentTarget);
|
|
11614
11602
|
this.onMouseLeave(rowIndex);
|
|
11615
11603
|
};
|
|
11616
11604
|
this.onMouseEnter = (rowIndex) => {
|
|
@@ -11697,28 +11685,35 @@ var GridRenderer = class extends Logger {
|
|
|
11697
11685
|
}
|
|
11698
11686
|
const { x, y } = itemPosition;
|
|
11699
11687
|
if (itemElement) {
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
itemElement.__zIndex
|
|
11716
|
-
|
|
11688
|
+
const applyPosition = () => {
|
|
11689
|
+
this.updateHoverClassNamesForRow(rowIndex);
|
|
11690
|
+
const realCoords = this.getCellRealCoordinates(rowIndex, colIndex);
|
|
11691
|
+
itemElement.dataset.rowIndex = realCoords.rowIndex;
|
|
11692
|
+
itemElement.dataset.colIndex = realCoords.colIndex;
|
|
11693
|
+
if (ITEM_POSITION_WITH_TRANSFORM) {
|
|
11694
|
+
this.setTransform(itemElement, rowIndex, colIndex, { x, y }, null);
|
|
11695
|
+
itemElement.style.willChange = "transform";
|
|
11696
|
+
itemElement.style.backfaceVisibility = "hidden";
|
|
11697
|
+
const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
|
|
11698
|
+
const zIndex2 = hidden ? "-1" : (
|
|
11699
|
+
// #updatezindex - we need to allow elements use their own zIndex, so we
|
|
11700
|
+
// resort to allowing them to have it as a data-z-index attribute
|
|
11701
|
+
itemElement.dataset.zIndex || "auto"
|
|
11702
|
+
);
|
|
11703
|
+
if (itemElement.__zIndex !== zIndex2) {
|
|
11704
|
+
itemElement.__zIndex = zIndex2;
|
|
11705
|
+
itemElement.style.zIndex = zIndex2;
|
|
11706
|
+
}
|
|
11707
|
+
} else {
|
|
11708
|
+
itemElement.style.display = "";
|
|
11709
|
+
itemElement.style.left = `${x}px`;
|
|
11710
|
+
itemElement.style.top = `${y}px`;
|
|
11717
11711
|
}
|
|
11712
|
+
};
|
|
11713
|
+
if (this.scrolling && this.brain.isHorizontalLayoutBrain) {
|
|
11714
|
+
cell.setPendingAfterCommitWork(applyPosition);
|
|
11718
11715
|
} else {
|
|
11719
|
-
|
|
11720
|
-
itemElement.style.left = `${x}px`;
|
|
11721
|
-
itemElement.style.top = `${y}px`;
|
|
11716
|
+
applyPosition();
|
|
11722
11717
|
}
|
|
11723
11718
|
}
|
|
11724
11719
|
};
|
|
@@ -12273,6 +12268,13 @@ var GridRenderer = class extends Logger {
|
|
|
12273
12268
|
colIndex
|
|
12274
12269
|
};
|
|
12275
12270
|
}
|
|
12271
|
+
getMatrixRowIndexFromElement(element) {
|
|
12272
|
+
const renderedRowIndex = Number(element.dataset.rowIndex);
|
|
12273
|
+
if (this.brain.isHorizontalLayoutBrain) {
|
|
12274
|
+
return this.brain.getRowIndexInPage(renderedRowIndex);
|
|
12275
|
+
}
|
|
12276
|
+
return renderedRowIndex;
|
|
12277
|
+
}
|
|
12276
12278
|
renderCellAt(rowIndex, colIndex, cell, renderCell) {
|
|
12277
12279
|
if (this.destroyed) {
|
|
12278
12280
|
return;
|
|
@@ -12334,14 +12336,11 @@ var GridRenderer = class extends Logger {
|
|
|
12334
12336
|
}
|
|
12335
12337
|
return;
|
|
12336
12338
|
}
|
|
12337
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT.scrolling = this.scrolling;
|
|
12338
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT.isHorizontalLayout = isHorizontalLayout;
|
|
12339
12339
|
this.cellManager.renderNodeAtCell(
|
|
12340
12340
|
renderedNode,
|
|
12341
12341
|
cell,
|
|
12342
12342
|
[rowIndex, colIndex],
|
|
12343
|
-
cellAdditionalInfo
|
|
12344
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT
|
|
12343
|
+
cellAdditionalInfo
|
|
12345
12344
|
);
|
|
12346
12345
|
this.updateElementPosition(cell, { hidden, rowspan, colspan });
|
|
12347
12346
|
return;
|
|
@@ -13980,7 +13979,7 @@ function InfiniteTableHeaderCellFn(props) {
|
|
|
13980
13979
|
),
|
|
13981
13980
|
currentHeader
|
|
13982
13981
|
);
|
|
13983
|
-
draggingProxy = (0,
|
|
13982
|
+
draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
|
|
13984
13983
|
}
|
|
13985
13984
|
return /* @__PURE__ */ React51.createElement(ContextProvider, { value: renderParam }, /* @__PURE__ */ React51.createElement(
|
|
13986
13985
|
InfiniteTableCell,
|
|
@@ -26433,7 +26432,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
26433
26432
|
}
|
|
26434
26433
|
let valid2 = isValidLicense(licenseKey, {
|
|
26435
26434
|
publishedAt: 1624970570587,
|
|
26436
|
-
version: "8.0.0
|
|
26435
|
+
version: "8.0.0"
|
|
26437
26436
|
});
|
|
26438
26437
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
26439
26438
|
return true;
|
|
@@ -27298,7 +27297,7 @@ var import_react59 = require("react");
|
|
|
27298
27297
|
// src/components/hooks/useOverlay/index.tsx
|
|
27299
27298
|
var React57 = __toESM(require("react"));
|
|
27300
27299
|
var import_react55 = require("react");
|
|
27301
|
-
var
|
|
27300
|
+
var import_react_dom2 = require("react-dom");
|
|
27302
27301
|
|
|
27303
27302
|
// src/utils/pageGeometry/alignment/index.ts
|
|
27304
27303
|
function isHTMLElement(v) {
|
|
@@ -27550,7 +27549,7 @@ function useOverlayPortal(content, portalContainer) {
|
|
|
27550
27549
|
}
|
|
27551
27550
|
getContainer();
|
|
27552
27551
|
}, [portalContainer]);
|
|
27553
|
-
return portalContainer ? container ? (0,
|
|
27552
|
+
return portalContainer ? container ? (0, import_react_dom2.createPortal)(content, container) : (
|
|
27554
27553
|
// we're probably still fetching the container
|
|
27555
27554
|
/* @__PURE__ */ React57.createElement(React57.Fragment, null)
|
|
27556
27555
|
) : portalContainer === null || portalContainer === false ? content : /* @__PURE__ */ React57.createElement(DefaultOverlayPortal, null, content);
|
|
@@ -32265,7 +32264,7 @@ var FlashingColumnCell = createFlashingColumnCellComponent();
|
|
|
32265
32264
|
// src/components/HeadlessTable/MatrixDebugger.tsx
|
|
32266
32265
|
var React82 = __toESM(require("react"));
|
|
32267
32266
|
var import_react77 = require("react");
|
|
32268
|
-
var
|
|
32267
|
+
var import_react_dom3 = require("react-dom");
|
|
32269
32268
|
function INTERNAL_MatrixDebugger(props) {
|
|
32270
32269
|
const [getState, setGetState] = React82.useState(null);
|
|
32271
32270
|
(0, import_react77.useEffect)(() => {
|
|
@@ -32305,7 +32304,7 @@ function MatrixDebuggerUI() {
|
|
|
32305
32304
|
const columnsIndexes = cellManager.getColumnsWithCells();
|
|
32306
32305
|
const domRef = (0, import_react77.useRef)(null);
|
|
32307
32306
|
const displayTimeoutRef = (0, import_react77.useRef)(null);
|
|
32308
|
-
return /* @__PURE__ */ React82.createElement("div", { style: { overflow: "auto" } }, (0,
|
|
32307
|
+
return /* @__PURE__ */ React82.createElement("div", { style: { overflow: "auto" } }, (0, import_react_dom3.createPortal)(
|
|
32309
32308
|
/* @__PURE__ */ React82.createElement(
|
|
32310
32309
|
"div",
|
|
32311
32310
|
{
|
package/index.dev.mjs
CHANGED
|
@@ -8795,41 +8795,23 @@ import { useLayoutEffect as useLayoutEffect8, useMemo as useMemo6 } from "react"
|
|
|
8795
8795
|
|
|
8796
8796
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
8797
8797
|
import * as React37 from "react";
|
|
8798
|
-
import { flushSync } from "react-dom";
|
|
8799
8798
|
import { useLayoutEffect as useLayoutEffect7, useRef as useRef15, useState as useState12 } from "react";
|
|
8800
|
-
var SHOULD_FLUSH_SYNC = () => false;
|
|
8801
8799
|
function AvoidReactDiffFn(props) {
|
|
8802
8800
|
const [children, setChildren] = useState12(props.updater.get);
|
|
8803
8801
|
const rafId = useRef15(null);
|
|
8804
|
-
const
|
|
8802
|
+
const afterCommitRef = useRef15(props.afterCommit);
|
|
8803
|
+
afterCommitRef.current = props.afterCommit;
|
|
8805
8804
|
useLayoutEffect7(() => {
|
|
8806
8805
|
function onChange(children2) {
|
|
8807
|
-
let FLUSH_SYNC = shouldFlushSync();
|
|
8808
8806
|
if (props.useraf) {
|
|
8809
8807
|
if (rafId.current != null) {
|
|
8810
8808
|
cancelAnimationFrame(rafId.current);
|
|
8811
8809
|
}
|
|
8812
8810
|
rafId.current = requestAnimationFrame(() => {
|
|
8813
|
-
|
|
8814
|
-
queueMicrotask(() => {
|
|
8815
|
-
flushSync(() => {
|
|
8816
|
-
setChildren(children2);
|
|
8817
|
-
});
|
|
8818
|
-
});
|
|
8819
|
-
} else {
|
|
8820
|
-
setChildren(children2);
|
|
8821
|
-
}
|
|
8811
|
+
setChildren(children2);
|
|
8822
8812
|
});
|
|
8823
8813
|
} else {
|
|
8824
|
-
|
|
8825
|
-
queueMicrotask(() => {
|
|
8826
|
-
flushSync(() => {
|
|
8827
|
-
setChildren(children2);
|
|
8828
|
-
});
|
|
8829
|
-
});
|
|
8830
|
-
} else {
|
|
8831
|
-
setChildren(children2);
|
|
8832
|
-
}
|
|
8814
|
+
setChildren(children2);
|
|
8833
8815
|
}
|
|
8834
8816
|
}
|
|
8835
8817
|
const remove = props.updater.onChange(onChange);
|
|
@@ -8839,7 +8821,10 @@ function AvoidReactDiffFn(props) {
|
|
|
8839
8821
|
}
|
|
8840
8822
|
remove();
|
|
8841
8823
|
};
|
|
8842
|
-
}, [props.updater, props.useraf
|
|
8824
|
+
}, [props.updater, props.useraf]);
|
|
8825
|
+
useLayoutEffect7(() => {
|
|
8826
|
+
afterCommitRef.current?.();
|
|
8827
|
+
});
|
|
8843
8828
|
return children ?? null;
|
|
8844
8829
|
}
|
|
8845
8830
|
var AvoidReactDiff = React37.memo(AvoidReactDiffFn);
|
|
@@ -10168,10 +10153,14 @@ var GridCellForReact = class {
|
|
|
10168
10153
|
constructor(debugId, cellInfo) {
|
|
10169
10154
|
this.element = null;
|
|
10170
10155
|
this.mounted = false;
|
|
10171
|
-
this.
|
|
10156
|
+
this.pendingAfterCommitWork = null;
|
|
10172
10157
|
this.mountSubscription = buildSubscriptionCallback();
|
|
10173
|
-
this.
|
|
10174
|
-
|
|
10158
|
+
this.afterCommit = () => {
|
|
10159
|
+
if (this.pendingAfterCommitWork) {
|
|
10160
|
+
const work = this.pendingAfterCommitWork;
|
|
10161
|
+
this.pendingAfterCommitWork = null;
|
|
10162
|
+
work();
|
|
10163
|
+
}
|
|
10175
10164
|
};
|
|
10176
10165
|
const count = CELL_COUNT_BY_DEBUG_ID.get(debugId) ?? 0;
|
|
10177
10166
|
const key = `${debugId}:GridCellReact:${count}`;
|
|
@@ -10185,7 +10174,7 @@ var GridCellForReact = class {
|
|
|
10185
10174
|
key,
|
|
10186
10175
|
name: key,
|
|
10187
10176
|
updater: this.updater,
|
|
10188
|
-
|
|
10177
|
+
afterCommit: this.afterCommit
|
|
10189
10178
|
}
|
|
10190
10179
|
);
|
|
10191
10180
|
this.ref = (htmlElement) => {
|
|
@@ -10198,6 +10187,9 @@ var GridCellForReact = class {
|
|
|
10198
10187
|
}
|
|
10199
10188
|
};
|
|
10200
10189
|
}
|
|
10190
|
+
setPendingAfterCommitWork(fn) {
|
|
10191
|
+
this.pendingAfterCommitWork = fn;
|
|
10192
|
+
}
|
|
10201
10193
|
isMounted() {
|
|
10202
10194
|
return this.mounted;
|
|
10203
10195
|
}
|
|
@@ -10212,6 +10204,7 @@ var GridCellForReact = class {
|
|
|
10212
10204
|
destroy() {
|
|
10213
10205
|
this.mountSubscription.destroy();
|
|
10214
10206
|
this.updater.destroy();
|
|
10207
|
+
this.pendingAfterCommitWork = null;
|
|
10215
10208
|
this.ref = emptyFn;
|
|
10216
10209
|
this.element = null;
|
|
10217
10210
|
this.node = null;
|
|
@@ -10219,8 +10212,7 @@ var GridCellForReact = class {
|
|
|
10219
10212
|
getNode() {
|
|
10220
10213
|
return this.node;
|
|
10221
10214
|
}
|
|
10222
|
-
update(content, additionalInfo
|
|
10223
|
-
this.IS_UPDATED_WHILE_SCROLLING_IN_HORIZONTAL_LAYOUT = scrollingObjectParam ? scrollingObjectParam.scrolling && scrollingObjectParam.isHorizontalLayout : false;
|
|
10215
|
+
update(content, additionalInfo) {
|
|
10224
10216
|
this.updater(content);
|
|
10225
10217
|
this.cellInfo = additionalInfo;
|
|
10226
10218
|
}
|
|
@@ -10512,14 +10504,14 @@ var GridCellManager = class extends Logger {
|
|
|
10512
10504
|
}
|
|
10513
10505
|
this.addCellToMatrix(cell, cellPos);
|
|
10514
10506
|
}
|
|
10515
|
-
renderNodeAtCell(node, cell, cellPos, additionalInfo
|
|
10507
|
+
renderNodeAtCell(node, cell, cellPos, additionalInfo) {
|
|
10516
10508
|
const currentCellAtPos = this.getCellAt(cellPos);
|
|
10517
10509
|
if (currentCellAtPos && currentCellAtPos !== cell) {
|
|
10518
10510
|
this.detachCellAt(cellPos);
|
|
10519
10511
|
}
|
|
10520
10512
|
this.pool.attachCell(cell);
|
|
10521
10513
|
this.setCellPositionInMatrix(cell, cellPos);
|
|
10522
|
-
cell.update(node, additionalInfo
|
|
10514
|
+
cell.update(node, additionalInfo);
|
|
10523
10515
|
return cell;
|
|
10524
10516
|
}
|
|
10525
10517
|
getCellPosition(cell) {
|
|
@@ -11102,10 +11094,6 @@ var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
|
11102
11094
|
var columnOffsetAtIndexWhileReordering2 = stripVar(
|
|
11103
11095
|
InternalVars.columnOffsetAtIndexWhileReordering
|
|
11104
11096
|
);
|
|
11105
|
-
var SCROLLING_OBJECT_PARAM_FLYWEIGHT = {
|
|
11106
|
-
scrolling: false,
|
|
11107
|
-
isHorizontalLayout: false
|
|
11108
|
-
};
|
|
11109
11097
|
var GridRenderer = class extends Logger {
|
|
11110
11098
|
constructor(brain, debugId) {
|
|
11111
11099
|
debugId = debugId || "ReactHeadlessTableRenderer";
|
|
@@ -11545,11 +11533,11 @@ var GridRenderer = class extends Logger {
|
|
|
11545
11533
|
return covered ? [rowspanParent, colspanParent] : false;
|
|
11546
11534
|
};
|
|
11547
11535
|
this.onMouseEnterNotBound = (event) => {
|
|
11548
|
-
const rowIndex =
|
|
11536
|
+
const rowIndex = this.getMatrixRowIndexFromElement(event.currentTarget);
|
|
11549
11537
|
this.onMouseEnter(rowIndex);
|
|
11550
11538
|
};
|
|
11551
11539
|
this.onMouseLeaveNotBound = (event) => {
|
|
11552
|
-
const rowIndex =
|
|
11540
|
+
const rowIndex = this.getMatrixRowIndexFromElement(event.currentTarget);
|
|
11553
11541
|
this.onMouseLeave(rowIndex);
|
|
11554
11542
|
};
|
|
11555
11543
|
this.onMouseEnter = (rowIndex) => {
|
|
@@ -11636,28 +11624,35 @@ var GridRenderer = class extends Logger {
|
|
|
11636
11624
|
}
|
|
11637
11625
|
const { x, y } = itemPosition;
|
|
11638
11626
|
if (itemElement) {
|
|
11639
|
-
|
|
11640
|
-
|
|
11641
|
-
|
|
11642
|
-
|
|
11643
|
-
|
|
11644
|
-
|
|
11645
|
-
|
|
11646
|
-
|
|
11647
|
-
|
|
11648
|
-
|
|
11649
|
-
|
|
11650
|
-
|
|
11651
|
-
|
|
11652
|
-
|
|
11653
|
-
|
|
11654
|
-
itemElement.__zIndex
|
|
11655
|
-
|
|
11627
|
+
const applyPosition = () => {
|
|
11628
|
+
this.updateHoverClassNamesForRow(rowIndex);
|
|
11629
|
+
const realCoords = this.getCellRealCoordinates(rowIndex, colIndex);
|
|
11630
|
+
itemElement.dataset.rowIndex = realCoords.rowIndex;
|
|
11631
|
+
itemElement.dataset.colIndex = realCoords.colIndex;
|
|
11632
|
+
if (ITEM_POSITION_WITH_TRANSFORM) {
|
|
11633
|
+
this.setTransform(itemElement, rowIndex, colIndex, { x, y }, null);
|
|
11634
|
+
itemElement.style.willChange = "transform";
|
|
11635
|
+
itemElement.style.backfaceVisibility = "hidden";
|
|
11636
|
+
const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
|
|
11637
|
+
const zIndex2 = hidden ? "-1" : (
|
|
11638
|
+
// #updatezindex - we need to allow elements use their own zIndex, so we
|
|
11639
|
+
// resort to allowing them to have it as a data-z-index attribute
|
|
11640
|
+
itemElement.dataset.zIndex || "auto"
|
|
11641
|
+
);
|
|
11642
|
+
if (itemElement.__zIndex !== zIndex2) {
|
|
11643
|
+
itemElement.__zIndex = zIndex2;
|
|
11644
|
+
itemElement.style.zIndex = zIndex2;
|
|
11645
|
+
}
|
|
11646
|
+
} else {
|
|
11647
|
+
itemElement.style.display = "";
|
|
11648
|
+
itemElement.style.left = `${x}px`;
|
|
11649
|
+
itemElement.style.top = `${y}px`;
|
|
11656
11650
|
}
|
|
11651
|
+
};
|
|
11652
|
+
if (this.scrolling && this.brain.isHorizontalLayoutBrain) {
|
|
11653
|
+
cell.setPendingAfterCommitWork(applyPosition);
|
|
11657
11654
|
} else {
|
|
11658
|
-
|
|
11659
|
-
itemElement.style.left = `${x}px`;
|
|
11660
|
-
itemElement.style.top = `${y}px`;
|
|
11655
|
+
applyPosition();
|
|
11661
11656
|
}
|
|
11662
11657
|
}
|
|
11663
11658
|
};
|
|
@@ -12212,6 +12207,13 @@ var GridRenderer = class extends Logger {
|
|
|
12212
12207
|
colIndex
|
|
12213
12208
|
};
|
|
12214
12209
|
}
|
|
12210
|
+
getMatrixRowIndexFromElement(element) {
|
|
12211
|
+
const renderedRowIndex = Number(element.dataset.rowIndex);
|
|
12212
|
+
if (this.brain.isHorizontalLayoutBrain) {
|
|
12213
|
+
return this.brain.getRowIndexInPage(renderedRowIndex);
|
|
12214
|
+
}
|
|
12215
|
+
return renderedRowIndex;
|
|
12216
|
+
}
|
|
12215
12217
|
renderCellAt(rowIndex, colIndex, cell, renderCell) {
|
|
12216
12218
|
if (this.destroyed) {
|
|
12217
12219
|
return;
|
|
@@ -12273,14 +12275,11 @@ var GridRenderer = class extends Logger {
|
|
|
12273
12275
|
}
|
|
12274
12276
|
return;
|
|
12275
12277
|
}
|
|
12276
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT.scrolling = this.scrolling;
|
|
12277
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT.isHorizontalLayout = isHorizontalLayout;
|
|
12278
12278
|
this.cellManager.renderNodeAtCell(
|
|
12279
12279
|
renderedNode,
|
|
12280
12280
|
cell,
|
|
12281
12281
|
[rowIndex, colIndex],
|
|
12282
|
-
cellAdditionalInfo
|
|
12283
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT
|
|
12282
|
+
cellAdditionalInfo
|
|
12284
12283
|
);
|
|
12285
12284
|
this.updateElementPosition(cell, { hidden, rowspan, colspan });
|
|
12286
12285
|
return;
|
|
@@ -26381,7 +26380,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
26381
26380
|
}
|
|
26382
26381
|
let valid2 = isValidLicense(licenseKey, {
|
|
26383
26382
|
publishedAt: 1624970570587,
|
|
26384
|
-
version: "8.0.0
|
|
26383
|
+
version: "8.0.0"
|
|
26385
26384
|
});
|
|
26386
26385
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
26387
26386
|
return true;
|