@infinite-table/infinite-react 8.0.0-canary.0 → 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 +75 -68
- package/index.dev.mjs +69 -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
|
@@ -1322,6 +1322,14 @@ function shallowEqualObjects(objA, objB, ignoreKeys) {
|
|
|
1322
1322
|
if (!objA || !objB) {
|
|
1323
1323
|
return false;
|
|
1324
1324
|
}
|
|
1325
|
+
const typeA = typeof objA;
|
|
1326
|
+
const typeB = typeof objB;
|
|
1327
|
+
if (typeA !== typeB) {
|
|
1328
|
+
return false;
|
|
1329
|
+
}
|
|
1330
|
+
if (typeA !== "object") {
|
|
1331
|
+
return false;
|
|
1332
|
+
}
|
|
1325
1333
|
var aKeys = Object.keys(objA);
|
|
1326
1334
|
var bKeys = Object.keys(objB);
|
|
1327
1335
|
if (ignoreKeys) {
|
|
@@ -2109,7 +2117,7 @@ function InfiniteTableFooter(props) {
|
|
|
2109
2117
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
2110
2118
|
var React51 = __toESM(require("react"));
|
|
2111
2119
|
var import_react36 = require("react");
|
|
2112
|
-
var
|
|
2120
|
+
var import_react_dom = require("react-dom");
|
|
2113
2121
|
|
|
2114
2122
|
// src/utils/keyMirror.ts
|
|
2115
2123
|
function keyMirror(obj) {
|
|
@@ -8848,41 +8856,23 @@ var import_react28 = require("react");
|
|
|
8848
8856
|
|
|
8849
8857
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
8850
8858
|
var React37 = __toESM(require("react"));
|
|
8851
|
-
var import_react_dom = require("react-dom");
|
|
8852
8859
|
var import_react27 = require("react");
|
|
8853
|
-
var SHOULD_FLUSH_SYNC = () => false;
|
|
8854
8860
|
function AvoidReactDiffFn(props) {
|
|
8855
8861
|
const [children, setChildren] = (0, import_react27.useState)(props.updater.get);
|
|
8856
8862
|
const rafId = (0, import_react27.useRef)(null);
|
|
8857
|
-
const
|
|
8863
|
+
const afterCommitRef = (0, import_react27.useRef)(props.afterCommit);
|
|
8864
|
+
afterCommitRef.current = props.afterCommit;
|
|
8858
8865
|
(0, import_react27.useLayoutEffect)(() => {
|
|
8859
8866
|
function onChange(children2) {
|
|
8860
|
-
let FLUSH_SYNC = shouldFlushSync();
|
|
8861
8867
|
if (props.useraf) {
|
|
8862
8868
|
if (rafId.current != null) {
|
|
8863
8869
|
cancelAnimationFrame(rafId.current);
|
|
8864
8870
|
}
|
|
8865
8871
|
rafId.current = requestAnimationFrame(() => {
|
|
8866
|
-
|
|
8867
|
-
queueMicrotask(() => {
|
|
8868
|
-
(0, import_react_dom.flushSync)(() => {
|
|
8869
|
-
setChildren(children2);
|
|
8870
|
-
});
|
|
8871
|
-
});
|
|
8872
|
-
} else {
|
|
8873
|
-
setChildren(children2);
|
|
8874
|
-
}
|
|
8872
|
+
setChildren(children2);
|
|
8875
8873
|
});
|
|
8876
8874
|
} else {
|
|
8877
|
-
|
|
8878
|
-
queueMicrotask(() => {
|
|
8879
|
-
(0, import_react_dom.flushSync)(() => {
|
|
8880
|
-
setChildren(children2);
|
|
8881
|
-
});
|
|
8882
|
-
});
|
|
8883
|
-
} else {
|
|
8884
|
-
setChildren(children2);
|
|
8885
|
-
}
|
|
8875
|
+
setChildren(children2);
|
|
8886
8876
|
}
|
|
8887
8877
|
}
|
|
8888
8878
|
const remove = props.updater.onChange(onChange);
|
|
@@ -8892,7 +8882,10 @@ function AvoidReactDiffFn(props) {
|
|
|
8892
8882
|
}
|
|
8893
8883
|
remove();
|
|
8894
8884
|
};
|
|
8895
|
-
}, [props.updater, props.useraf
|
|
8885
|
+
}, [props.updater, props.useraf]);
|
|
8886
|
+
(0, import_react27.useLayoutEffect)(() => {
|
|
8887
|
+
afterCommitRef.current?.();
|
|
8888
|
+
});
|
|
8896
8889
|
return children ?? null;
|
|
8897
8890
|
}
|
|
8898
8891
|
var AvoidReactDiff = React37.memo(AvoidReactDiffFn);
|
|
@@ -10221,10 +10214,14 @@ var GridCellForReact = class {
|
|
|
10221
10214
|
constructor(debugId, cellInfo) {
|
|
10222
10215
|
this.element = null;
|
|
10223
10216
|
this.mounted = false;
|
|
10224
|
-
this.
|
|
10217
|
+
this.pendingAfterCommitWork = null;
|
|
10225
10218
|
this.mountSubscription = buildSubscriptionCallback();
|
|
10226
|
-
this.
|
|
10227
|
-
|
|
10219
|
+
this.afterCommit = () => {
|
|
10220
|
+
if (this.pendingAfterCommitWork) {
|
|
10221
|
+
const work = this.pendingAfterCommitWork;
|
|
10222
|
+
this.pendingAfterCommitWork = null;
|
|
10223
|
+
work();
|
|
10224
|
+
}
|
|
10228
10225
|
};
|
|
10229
10226
|
const count = CELL_COUNT_BY_DEBUG_ID.get(debugId) ?? 0;
|
|
10230
10227
|
const key = `${debugId}:GridCellReact:${count}`;
|
|
@@ -10238,7 +10235,7 @@ var GridCellForReact = class {
|
|
|
10238
10235
|
key,
|
|
10239
10236
|
name: key,
|
|
10240
10237
|
updater: this.updater,
|
|
10241
|
-
|
|
10238
|
+
afterCommit: this.afterCommit
|
|
10242
10239
|
}
|
|
10243
10240
|
);
|
|
10244
10241
|
this.ref = (htmlElement) => {
|
|
@@ -10251,6 +10248,9 @@ var GridCellForReact = class {
|
|
|
10251
10248
|
}
|
|
10252
10249
|
};
|
|
10253
10250
|
}
|
|
10251
|
+
setPendingAfterCommitWork(fn) {
|
|
10252
|
+
this.pendingAfterCommitWork = fn;
|
|
10253
|
+
}
|
|
10254
10254
|
isMounted() {
|
|
10255
10255
|
return this.mounted;
|
|
10256
10256
|
}
|
|
@@ -10265,6 +10265,7 @@ var GridCellForReact = class {
|
|
|
10265
10265
|
destroy() {
|
|
10266
10266
|
this.mountSubscription.destroy();
|
|
10267
10267
|
this.updater.destroy();
|
|
10268
|
+
this.pendingAfterCommitWork = null;
|
|
10268
10269
|
this.ref = emptyFn;
|
|
10269
10270
|
this.element = null;
|
|
10270
10271
|
this.node = null;
|
|
@@ -10272,8 +10273,7 @@ var GridCellForReact = class {
|
|
|
10272
10273
|
getNode() {
|
|
10273
10274
|
return this.node;
|
|
10274
10275
|
}
|
|
10275
|
-
update(content, additionalInfo
|
|
10276
|
-
this.IS_UPDATED_WHILE_SCROLLING_IN_HORIZONTAL_LAYOUT = scrollingObjectParam ? scrollingObjectParam.scrolling && scrollingObjectParam.isHorizontalLayout : false;
|
|
10276
|
+
update(content, additionalInfo) {
|
|
10277
10277
|
this.updater(content);
|
|
10278
10278
|
this.cellInfo = additionalInfo;
|
|
10279
10279
|
}
|
|
@@ -10565,14 +10565,14 @@ var GridCellManager = class extends Logger {
|
|
|
10565
10565
|
}
|
|
10566
10566
|
this.addCellToMatrix(cell, cellPos);
|
|
10567
10567
|
}
|
|
10568
|
-
renderNodeAtCell(node, cell, cellPos, additionalInfo
|
|
10568
|
+
renderNodeAtCell(node, cell, cellPos, additionalInfo) {
|
|
10569
10569
|
const currentCellAtPos = this.getCellAt(cellPos);
|
|
10570
10570
|
if (currentCellAtPos && currentCellAtPos !== cell) {
|
|
10571
10571
|
this.detachCellAt(cellPos);
|
|
10572
10572
|
}
|
|
10573
10573
|
this.pool.attachCell(cell);
|
|
10574
10574
|
this.setCellPositionInMatrix(cell, cellPos);
|
|
10575
|
-
cell.update(node, additionalInfo
|
|
10575
|
+
cell.update(node, additionalInfo);
|
|
10576
10576
|
return cell;
|
|
10577
10577
|
}
|
|
10578
10578
|
getCellPosition(cell) {
|
|
@@ -11155,10 +11155,6 @@ var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
|
11155
11155
|
var columnOffsetAtIndexWhileReordering2 = stripVar(
|
|
11156
11156
|
InternalVars.columnOffsetAtIndexWhileReordering
|
|
11157
11157
|
);
|
|
11158
|
-
var SCROLLING_OBJECT_PARAM_FLYWEIGHT = {
|
|
11159
|
-
scrolling: false,
|
|
11160
|
-
isHorizontalLayout: false
|
|
11161
|
-
};
|
|
11162
11158
|
var GridRenderer = class extends Logger {
|
|
11163
11159
|
constructor(brain, debugId) {
|
|
11164
11160
|
debugId = debugId || "ReactHeadlessTableRenderer";
|
|
@@ -11598,11 +11594,11 @@ var GridRenderer = class extends Logger {
|
|
|
11598
11594
|
return covered ? [rowspanParent, colspanParent] : false;
|
|
11599
11595
|
};
|
|
11600
11596
|
this.onMouseEnterNotBound = (event) => {
|
|
11601
|
-
const rowIndex =
|
|
11597
|
+
const rowIndex = this.getMatrixRowIndexFromElement(event.currentTarget);
|
|
11602
11598
|
this.onMouseEnter(rowIndex);
|
|
11603
11599
|
};
|
|
11604
11600
|
this.onMouseLeaveNotBound = (event) => {
|
|
11605
|
-
const rowIndex =
|
|
11601
|
+
const rowIndex = this.getMatrixRowIndexFromElement(event.currentTarget);
|
|
11606
11602
|
this.onMouseLeave(rowIndex);
|
|
11607
11603
|
};
|
|
11608
11604
|
this.onMouseEnter = (rowIndex) => {
|
|
@@ -11689,28 +11685,35 @@ var GridRenderer = class extends Logger {
|
|
|
11689
11685
|
}
|
|
11690
11686
|
const { x, y } = itemPosition;
|
|
11691
11687
|
if (itemElement) {
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
itemElement.__zIndex
|
|
11708
|
-
|
|
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`;
|
|
11709
11711
|
}
|
|
11712
|
+
};
|
|
11713
|
+
if (this.scrolling && this.brain.isHorizontalLayoutBrain) {
|
|
11714
|
+
cell.setPendingAfterCommitWork(applyPosition);
|
|
11710
11715
|
} else {
|
|
11711
|
-
|
|
11712
|
-
itemElement.style.left = `${x}px`;
|
|
11713
|
-
itemElement.style.top = `${y}px`;
|
|
11716
|
+
applyPosition();
|
|
11714
11717
|
}
|
|
11715
11718
|
}
|
|
11716
11719
|
};
|
|
@@ -12265,6 +12268,13 @@ var GridRenderer = class extends Logger {
|
|
|
12265
12268
|
colIndex
|
|
12266
12269
|
};
|
|
12267
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
|
+
}
|
|
12268
12278
|
renderCellAt(rowIndex, colIndex, cell, renderCell) {
|
|
12269
12279
|
if (this.destroyed) {
|
|
12270
12280
|
return;
|
|
@@ -12326,14 +12336,11 @@ var GridRenderer = class extends Logger {
|
|
|
12326
12336
|
}
|
|
12327
12337
|
return;
|
|
12328
12338
|
}
|
|
12329
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT.scrolling = this.scrolling;
|
|
12330
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT.isHorizontalLayout = isHorizontalLayout;
|
|
12331
12339
|
this.cellManager.renderNodeAtCell(
|
|
12332
12340
|
renderedNode,
|
|
12333
12341
|
cell,
|
|
12334
12342
|
[rowIndex, colIndex],
|
|
12335
|
-
cellAdditionalInfo
|
|
12336
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT
|
|
12343
|
+
cellAdditionalInfo
|
|
12337
12344
|
);
|
|
12338
12345
|
this.updateElementPosition(cell, { hidden, rowspan, colspan });
|
|
12339
12346
|
return;
|
|
@@ -13972,7 +13979,7 @@ function InfiniteTableHeaderCellFn(props) {
|
|
|
13972
13979
|
),
|
|
13973
13980
|
currentHeader
|
|
13974
13981
|
);
|
|
13975
|
-
draggingProxy = (0,
|
|
13982
|
+
draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
|
|
13976
13983
|
}
|
|
13977
13984
|
return /* @__PURE__ */ React51.createElement(ContextProvider, { value: renderParam }, /* @__PURE__ */ React51.createElement(
|
|
13978
13985
|
InfiniteTableCell,
|
|
@@ -26425,7 +26432,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
26425
26432
|
}
|
|
26426
26433
|
let valid2 = isValidLicense(licenseKey, {
|
|
26427
26434
|
publishedAt: 1624970570587,
|
|
26428
|
-
version: "8.0.0
|
|
26435
|
+
version: "8.0.0"
|
|
26429
26436
|
});
|
|
26430
26437
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
26431
26438
|
return true;
|
|
@@ -27290,7 +27297,7 @@ var import_react59 = require("react");
|
|
|
27290
27297
|
// src/components/hooks/useOverlay/index.tsx
|
|
27291
27298
|
var React57 = __toESM(require("react"));
|
|
27292
27299
|
var import_react55 = require("react");
|
|
27293
|
-
var
|
|
27300
|
+
var import_react_dom2 = require("react-dom");
|
|
27294
27301
|
|
|
27295
27302
|
// src/utils/pageGeometry/alignment/index.ts
|
|
27296
27303
|
function isHTMLElement(v) {
|
|
@@ -27542,7 +27549,7 @@ function useOverlayPortal(content, portalContainer) {
|
|
|
27542
27549
|
}
|
|
27543
27550
|
getContainer();
|
|
27544
27551
|
}, [portalContainer]);
|
|
27545
|
-
return portalContainer ? container ? (0,
|
|
27552
|
+
return portalContainer ? container ? (0, import_react_dom2.createPortal)(content, container) : (
|
|
27546
27553
|
// we're probably still fetching the container
|
|
27547
27554
|
/* @__PURE__ */ React57.createElement(React57.Fragment, null)
|
|
27548
27555
|
) : portalContainer === null || portalContainer === false ? content : /* @__PURE__ */ React57.createElement(DefaultOverlayPortal, null, content);
|
|
@@ -32257,7 +32264,7 @@ var FlashingColumnCell = createFlashingColumnCellComponent();
|
|
|
32257
32264
|
// src/components/HeadlessTable/MatrixDebugger.tsx
|
|
32258
32265
|
var React82 = __toESM(require("react"));
|
|
32259
32266
|
var import_react77 = require("react");
|
|
32260
|
-
var
|
|
32267
|
+
var import_react_dom3 = require("react-dom");
|
|
32261
32268
|
function INTERNAL_MatrixDebugger(props) {
|
|
32262
32269
|
const [getState, setGetState] = React82.useState(null);
|
|
32263
32270
|
(0, import_react77.useEffect)(() => {
|
|
@@ -32297,7 +32304,7 @@ function MatrixDebuggerUI() {
|
|
|
32297
32304
|
const columnsIndexes = cellManager.getColumnsWithCells();
|
|
32298
32305
|
const domRef = (0, import_react77.useRef)(null);
|
|
32299
32306
|
const displayTimeoutRef = (0, import_react77.useRef)(null);
|
|
32300
|
-
return /* @__PURE__ */ React82.createElement("div", { style: { overflow: "auto" } }, (0,
|
|
32307
|
+
return /* @__PURE__ */ React82.createElement("div", { style: { overflow: "auto" } }, (0, import_react_dom3.createPortal)(
|
|
32301
32308
|
/* @__PURE__ */ React82.createElement(
|
|
32302
32309
|
"div",
|
|
32303
32310
|
{
|
package/index.dev.mjs
CHANGED
|
@@ -1253,6 +1253,14 @@ function shallowEqualObjects(objA, objB, ignoreKeys) {
|
|
|
1253
1253
|
if (!objA || !objB) {
|
|
1254
1254
|
return false;
|
|
1255
1255
|
}
|
|
1256
|
+
const typeA = typeof objA;
|
|
1257
|
+
const typeB = typeof objB;
|
|
1258
|
+
if (typeA !== typeB) {
|
|
1259
|
+
return false;
|
|
1260
|
+
}
|
|
1261
|
+
if (typeA !== "object") {
|
|
1262
|
+
return false;
|
|
1263
|
+
}
|
|
1256
1264
|
var aKeys = Object.keys(objA);
|
|
1257
1265
|
var bKeys = Object.keys(objB);
|
|
1258
1266
|
if (ignoreKeys) {
|
|
@@ -8787,41 +8795,23 @@ import { useLayoutEffect as useLayoutEffect8, useMemo as useMemo6 } from "react"
|
|
|
8787
8795
|
|
|
8788
8796
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
8789
8797
|
import * as React37 from "react";
|
|
8790
|
-
import { flushSync } from "react-dom";
|
|
8791
8798
|
import { useLayoutEffect as useLayoutEffect7, useRef as useRef15, useState as useState12 } from "react";
|
|
8792
|
-
var SHOULD_FLUSH_SYNC = () => false;
|
|
8793
8799
|
function AvoidReactDiffFn(props) {
|
|
8794
8800
|
const [children, setChildren] = useState12(props.updater.get);
|
|
8795
8801
|
const rafId = useRef15(null);
|
|
8796
|
-
const
|
|
8802
|
+
const afterCommitRef = useRef15(props.afterCommit);
|
|
8803
|
+
afterCommitRef.current = props.afterCommit;
|
|
8797
8804
|
useLayoutEffect7(() => {
|
|
8798
8805
|
function onChange(children2) {
|
|
8799
|
-
let FLUSH_SYNC = shouldFlushSync();
|
|
8800
8806
|
if (props.useraf) {
|
|
8801
8807
|
if (rafId.current != null) {
|
|
8802
8808
|
cancelAnimationFrame(rafId.current);
|
|
8803
8809
|
}
|
|
8804
8810
|
rafId.current = requestAnimationFrame(() => {
|
|
8805
|
-
|
|
8806
|
-
queueMicrotask(() => {
|
|
8807
|
-
flushSync(() => {
|
|
8808
|
-
setChildren(children2);
|
|
8809
|
-
});
|
|
8810
|
-
});
|
|
8811
|
-
} else {
|
|
8812
|
-
setChildren(children2);
|
|
8813
|
-
}
|
|
8811
|
+
setChildren(children2);
|
|
8814
8812
|
});
|
|
8815
8813
|
} else {
|
|
8816
|
-
|
|
8817
|
-
queueMicrotask(() => {
|
|
8818
|
-
flushSync(() => {
|
|
8819
|
-
setChildren(children2);
|
|
8820
|
-
});
|
|
8821
|
-
});
|
|
8822
|
-
} else {
|
|
8823
|
-
setChildren(children2);
|
|
8824
|
-
}
|
|
8814
|
+
setChildren(children2);
|
|
8825
8815
|
}
|
|
8826
8816
|
}
|
|
8827
8817
|
const remove = props.updater.onChange(onChange);
|
|
@@ -8831,7 +8821,10 @@ function AvoidReactDiffFn(props) {
|
|
|
8831
8821
|
}
|
|
8832
8822
|
remove();
|
|
8833
8823
|
};
|
|
8834
|
-
}, [props.updater, props.useraf
|
|
8824
|
+
}, [props.updater, props.useraf]);
|
|
8825
|
+
useLayoutEffect7(() => {
|
|
8826
|
+
afterCommitRef.current?.();
|
|
8827
|
+
});
|
|
8835
8828
|
return children ?? null;
|
|
8836
8829
|
}
|
|
8837
8830
|
var AvoidReactDiff = React37.memo(AvoidReactDiffFn);
|
|
@@ -10160,10 +10153,14 @@ var GridCellForReact = class {
|
|
|
10160
10153
|
constructor(debugId, cellInfo) {
|
|
10161
10154
|
this.element = null;
|
|
10162
10155
|
this.mounted = false;
|
|
10163
|
-
this.
|
|
10156
|
+
this.pendingAfterCommitWork = null;
|
|
10164
10157
|
this.mountSubscription = buildSubscriptionCallback();
|
|
10165
|
-
this.
|
|
10166
|
-
|
|
10158
|
+
this.afterCommit = () => {
|
|
10159
|
+
if (this.pendingAfterCommitWork) {
|
|
10160
|
+
const work = this.pendingAfterCommitWork;
|
|
10161
|
+
this.pendingAfterCommitWork = null;
|
|
10162
|
+
work();
|
|
10163
|
+
}
|
|
10167
10164
|
};
|
|
10168
10165
|
const count = CELL_COUNT_BY_DEBUG_ID.get(debugId) ?? 0;
|
|
10169
10166
|
const key = `${debugId}:GridCellReact:${count}`;
|
|
@@ -10177,7 +10174,7 @@ var GridCellForReact = class {
|
|
|
10177
10174
|
key,
|
|
10178
10175
|
name: key,
|
|
10179
10176
|
updater: this.updater,
|
|
10180
|
-
|
|
10177
|
+
afterCommit: this.afterCommit
|
|
10181
10178
|
}
|
|
10182
10179
|
);
|
|
10183
10180
|
this.ref = (htmlElement) => {
|
|
@@ -10190,6 +10187,9 @@ var GridCellForReact = class {
|
|
|
10190
10187
|
}
|
|
10191
10188
|
};
|
|
10192
10189
|
}
|
|
10190
|
+
setPendingAfterCommitWork(fn) {
|
|
10191
|
+
this.pendingAfterCommitWork = fn;
|
|
10192
|
+
}
|
|
10193
10193
|
isMounted() {
|
|
10194
10194
|
return this.mounted;
|
|
10195
10195
|
}
|
|
@@ -10204,6 +10204,7 @@ var GridCellForReact = class {
|
|
|
10204
10204
|
destroy() {
|
|
10205
10205
|
this.mountSubscription.destroy();
|
|
10206
10206
|
this.updater.destroy();
|
|
10207
|
+
this.pendingAfterCommitWork = null;
|
|
10207
10208
|
this.ref = emptyFn;
|
|
10208
10209
|
this.element = null;
|
|
10209
10210
|
this.node = null;
|
|
@@ -10211,8 +10212,7 @@ var GridCellForReact = class {
|
|
|
10211
10212
|
getNode() {
|
|
10212
10213
|
return this.node;
|
|
10213
10214
|
}
|
|
10214
|
-
update(content, additionalInfo
|
|
10215
|
-
this.IS_UPDATED_WHILE_SCROLLING_IN_HORIZONTAL_LAYOUT = scrollingObjectParam ? scrollingObjectParam.scrolling && scrollingObjectParam.isHorizontalLayout : false;
|
|
10215
|
+
update(content, additionalInfo) {
|
|
10216
10216
|
this.updater(content);
|
|
10217
10217
|
this.cellInfo = additionalInfo;
|
|
10218
10218
|
}
|
|
@@ -10504,14 +10504,14 @@ var GridCellManager = class extends Logger {
|
|
|
10504
10504
|
}
|
|
10505
10505
|
this.addCellToMatrix(cell, cellPos);
|
|
10506
10506
|
}
|
|
10507
|
-
renderNodeAtCell(node, cell, cellPos, additionalInfo
|
|
10507
|
+
renderNodeAtCell(node, cell, cellPos, additionalInfo) {
|
|
10508
10508
|
const currentCellAtPos = this.getCellAt(cellPos);
|
|
10509
10509
|
if (currentCellAtPos && currentCellAtPos !== cell) {
|
|
10510
10510
|
this.detachCellAt(cellPos);
|
|
10511
10511
|
}
|
|
10512
10512
|
this.pool.attachCell(cell);
|
|
10513
10513
|
this.setCellPositionInMatrix(cell, cellPos);
|
|
10514
|
-
cell.update(node, additionalInfo
|
|
10514
|
+
cell.update(node, additionalInfo);
|
|
10515
10515
|
return cell;
|
|
10516
10516
|
}
|
|
10517
10517
|
getCellPosition(cell) {
|
|
@@ -11094,10 +11094,6 @@ var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
|
11094
11094
|
var columnOffsetAtIndexWhileReordering2 = stripVar(
|
|
11095
11095
|
InternalVars.columnOffsetAtIndexWhileReordering
|
|
11096
11096
|
);
|
|
11097
|
-
var SCROLLING_OBJECT_PARAM_FLYWEIGHT = {
|
|
11098
|
-
scrolling: false,
|
|
11099
|
-
isHorizontalLayout: false
|
|
11100
|
-
};
|
|
11101
11097
|
var GridRenderer = class extends Logger {
|
|
11102
11098
|
constructor(brain, debugId) {
|
|
11103
11099
|
debugId = debugId || "ReactHeadlessTableRenderer";
|
|
@@ -11537,11 +11533,11 @@ var GridRenderer = class extends Logger {
|
|
|
11537
11533
|
return covered ? [rowspanParent, colspanParent] : false;
|
|
11538
11534
|
};
|
|
11539
11535
|
this.onMouseEnterNotBound = (event) => {
|
|
11540
|
-
const rowIndex =
|
|
11536
|
+
const rowIndex = this.getMatrixRowIndexFromElement(event.currentTarget);
|
|
11541
11537
|
this.onMouseEnter(rowIndex);
|
|
11542
11538
|
};
|
|
11543
11539
|
this.onMouseLeaveNotBound = (event) => {
|
|
11544
|
-
const rowIndex =
|
|
11540
|
+
const rowIndex = this.getMatrixRowIndexFromElement(event.currentTarget);
|
|
11545
11541
|
this.onMouseLeave(rowIndex);
|
|
11546
11542
|
};
|
|
11547
11543
|
this.onMouseEnter = (rowIndex) => {
|
|
@@ -11628,28 +11624,35 @@ var GridRenderer = class extends Logger {
|
|
|
11628
11624
|
}
|
|
11629
11625
|
const { x, y } = itemPosition;
|
|
11630
11626
|
if (itemElement) {
|
|
11631
|
-
|
|
11632
|
-
|
|
11633
|
-
|
|
11634
|
-
|
|
11635
|
-
|
|
11636
|
-
|
|
11637
|
-
|
|
11638
|
-
|
|
11639
|
-
|
|
11640
|
-
|
|
11641
|
-
|
|
11642
|
-
|
|
11643
|
-
|
|
11644
|
-
|
|
11645
|
-
|
|
11646
|
-
itemElement.__zIndex
|
|
11647
|
-
|
|
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`;
|
|
11648
11650
|
}
|
|
11651
|
+
};
|
|
11652
|
+
if (this.scrolling && this.brain.isHorizontalLayoutBrain) {
|
|
11653
|
+
cell.setPendingAfterCommitWork(applyPosition);
|
|
11649
11654
|
} else {
|
|
11650
|
-
|
|
11651
|
-
itemElement.style.left = `${x}px`;
|
|
11652
|
-
itemElement.style.top = `${y}px`;
|
|
11655
|
+
applyPosition();
|
|
11653
11656
|
}
|
|
11654
11657
|
}
|
|
11655
11658
|
};
|
|
@@ -12204,6 +12207,13 @@ var GridRenderer = class extends Logger {
|
|
|
12204
12207
|
colIndex
|
|
12205
12208
|
};
|
|
12206
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
|
+
}
|
|
12207
12217
|
renderCellAt(rowIndex, colIndex, cell, renderCell) {
|
|
12208
12218
|
if (this.destroyed) {
|
|
12209
12219
|
return;
|
|
@@ -12265,14 +12275,11 @@ var GridRenderer = class extends Logger {
|
|
|
12265
12275
|
}
|
|
12266
12276
|
return;
|
|
12267
12277
|
}
|
|
12268
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT.scrolling = this.scrolling;
|
|
12269
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT.isHorizontalLayout = isHorizontalLayout;
|
|
12270
12278
|
this.cellManager.renderNodeAtCell(
|
|
12271
12279
|
renderedNode,
|
|
12272
12280
|
cell,
|
|
12273
12281
|
[rowIndex, colIndex],
|
|
12274
|
-
cellAdditionalInfo
|
|
12275
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT
|
|
12282
|
+
cellAdditionalInfo
|
|
12276
12283
|
);
|
|
12277
12284
|
this.updateElementPosition(cell, { hidden, rowspan, colspan });
|
|
12278
12285
|
return;
|
|
@@ -26373,7 +26380,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
26373
26380
|
}
|
|
26374
26381
|
let valid2 = isValidLicense(licenseKey, {
|
|
26375
26382
|
publishedAt: 1624970570587,
|
|
26376
|
-
version: "8.0.0
|
|
26383
|
+
version: "8.0.0"
|
|
26377
26384
|
});
|
|
26378
26385
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
26379
26386
|
return true;
|