@infinite-table/infinite-react 8.0.0-canary.1 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +255 -8
- package/index.dev.js +79 -68
- package/index.dev.mjs +67 -62
- package/index.js +8 -8
- package/index.mjs +8 -8
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -69,10 +69,14 @@ var require_binary_search = __commonJS({
|
|
|
69
69
|
var index_exports = {};
|
|
70
70
|
__export(index_exports, {
|
|
71
71
|
CellSelectionState: () => CellSelectionState,
|
|
72
|
+
DRAG_ITEM_ATTRIBUTE: () => DRAG_ITEM_ATTRIBUTE,
|
|
72
73
|
DataClient: () => DataClient,
|
|
73
74
|
DataSource: () => DataSource,
|
|
74
75
|
DataSourceActionType: () => DataSourceActionType,
|
|
75
76
|
DeepMap: () => DeepMap,
|
|
77
|
+
DragDropProvider: () => DragDropProvider,
|
|
78
|
+
DragInteractionTarget: () => DragInteractionTarget,
|
|
79
|
+
DragList: () => DragList,
|
|
76
80
|
FixedSizeSet: () => FixedSizeSet,
|
|
77
81
|
FlashingColumnCell: () => FlashingColumnCell,
|
|
78
82
|
GroupRowsState: () => GroupRowsState,
|
|
@@ -112,6 +116,8 @@ __export(index_exports, {
|
|
|
112
116
|
useDataSourceInternal: () => useDataSourceInternal,
|
|
113
117
|
useDataSourceSelector: () => useDataSourceSelector,
|
|
114
118
|
useDataSourceState: () => useDataSourceState,
|
|
119
|
+
useDragDropProvider: () => useDragDropProvider,
|
|
120
|
+
useDragListContext: () => useDragListContext,
|
|
115
121
|
useEffectWhen: () => useEffectWhen,
|
|
116
122
|
useEffectWhenSameDeps: () => useEffectWhenSameDeps,
|
|
117
123
|
useEffectWithChanges: () => useEffectWithChanges,
|
|
@@ -2117,7 +2123,7 @@ function InfiniteTableFooter(props) {
|
|
|
2117
2123
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
2118
2124
|
var React51 = __toESM(require("react"));
|
|
2119
2125
|
var import_react36 = require("react");
|
|
2120
|
-
var
|
|
2126
|
+
var import_react_dom = require("react-dom");
|
|
2121
2127
|
|
|
2122
2128
|
// src/utils/keyMirror.ts
|
|
2123
2129
|
function keyMirror(obj) {
|
|
@@ -8856,41 +8862,23 @@ var import_react28 = require("react");
|
|
|
8856
8862
|
|
|
8857
8863
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
8858
8864
|
var React37 = __toESM(require("react"));
|
|
8859
|
-
var import_react_dom = require("react-dom");
|
|
8860
8865
|
var import_react27 = require("react");
|
|
8861
|
-
var SHOULD_FLUSH_SYNC = () => false;
|
|
8862
8866
|
function AvoidReactDiffFn(props) {
|
|
8863
8867
|
const [children, setChildren] = (0, import_react27.useState)(props.updater.get);
|
|
8864
8868
|
const rafId = (0, import_react27.useRef)(null);
|
|
8865
|
-
const
|
|
8869
|
+
const afterCommitRef = (0, import_react27.useRef)(props.afterCommit);
|
|
8870
|
+
afterCommitRef.current = props.afterCommit;
|
|
8866
8871
|
(0, import_react27.useLayoutEffect)(() => {
|
|
8867
8872
|
function onChange(children2) {
|
|
8868
|
-
let FLUSH_SYNC = shouldFlushSync();
|
|
8869
8873
|
if (props.useraf) {
|
|
8870
8874
|
if (rafId.current != null) {
|
|
8871
8875
|
cancelAnimationFrame(rafId.current);
|
|
8872
8876
|
}
|
|
8873
8877
|
rafId.current = requestAnimationFrame(() => {
|
|
8874
|
-
|
|
8875
|
-
queueMicrotask(() => {
|
|
8876
|
-
(0, import_react_dom.flushSync)(() => {
|
|
8877
|
-
setChildren(children2);
|
|
8878
|
-
});
|
|
8879
|
-
});
|
|
8880
|
-
} else {
|
|
8881
|
-
setChildren(children2);
|
|
8882
|
-
}
|
|
8878
|
+
setChildren(children2);
|
|
8883
8879
|
});
|
|
8884
8880
|
} else {
|
|
8885
|
-
|
|
8886
|
-
queueMicrotask(() => {
|
|
8887
|
-
(0, import_react_dom.flushSync)(() => {
|
|
8888
|
-
setChildren(children2);
|
|
8889
|
-
});
|
|
8890
|
-
});
|
|
8891
|
-
} else {
|
|
8892
|
-
setChildren(children2);
|
|
8893
|
-
}
|
|
8881
|
+
setChildren(children2);
|
|
8894
8882
|
}
|
|
8895
8883
|
}
|
|
8896
8884
|
const remove = props.updater.onChange(onChange);
|
|
@@ -8900,7 +8888,10 @@ function AvoidReactDiffFn(props) {
|
|
|
8900
8888
|
}
|
|
8901
8889
|
remove();
|
|
8902
8890
|
};
|
|
8903
|
-
}, [props.updater, props.useraf
|
|
8891
|
+
}, [props.updater, props.useraf]);
|
|
8892
|
+
(0, import_react27.useLayoutEffect)(() => {
|
|
8893
|
+
afterCommitRef.current?.();
|
|
8894
|
+
});
|
|
8904
8895
|
return children ?? null;
|
|
8905
8896
|
}
|
|
8906
8897
|
var AvoidReactDiff = React37.memo(AvoidReactDiffFn);
|
|
@@ -10229,10 +10220,14 @@ var GridCellForReact = class {
|
|
|
10229
10220
|
constructor(debugId, cellInfo) {
|
|
10230
10221
|
this.element = null;
|
|
10231
10222
|
this.mounted = false;
|
|
10232
|
-
this.
|
|
10223
|
+
this.pendingAfterCommitWork = null;
|
|
10233
10224
|
this.mountSubscription = buildSubscriptionCallback();
|
|
10234
|
-
this.
|
|
10235
|
-
|
|
10225
|
+
this.afterCommit = () => {
|
|
10226
|
+
if (this.pendingAfterCommitWork) {
|
|
10227
|
+
const work = this.pendingAfterCommitWork;
|
|
10228
|
+
this.pendingAfterCommitWork = null;
|
|
10229
|
+
work();
|
|
10230
|
+
}
|
|
10236
10231
|
};
|
|
10237
10232
|
const count = CELL_COUNT_BY_DEBUG_ID.get(debugId) ?? 0;
|
|
10238
10233
|
const key = `${debugId}:GridCellReact:${count}`;
|
|
@@ -10246,7 +10241,7 @@ var GridCellForReact = class {
|
|
|
10246
10241
|
key,
|
|
10247
10242
|
name: key,
|
|
10248
10243
|
updater: this.updater,
|
|
10249
|
-
|
|
10244
|
+
afterCommit: this.afterCommit
|
|
10250
10245
|
}
|
|
10251
10246
|
);
|
|
10252
10247
|
this.ref = (htmlElement) => {
|
|
@@ -10259,6 +10254,9 @@ var GridCellForReact = class {
|
|
|
10259
10254
|
}
|
|
10260
10255
|
};
|
|
10261
10256
|
}
|
|
10257
|
+
setPendingAfterCommitWork(fn) {
|
|
10258
|
+
this.pendingAfterCommitWork = fn;
|
|
10259
|
+
}
|
|
10262
10260
|
isMounted() {
|
|
10263
10261
|
return this.mounted;
|
|
10264
10262
|
}
|
|
@@ -10273,6 +10271,7 @@ var GridCellForReact = class {
|
|
|
10273
10271
|
destroy() {
|
|
10274
10272
|
this.mountSubscription.destroy();
|
|
10275
10273
|
this.updater.destroy();
|
|
10274
|
+
this.pendingAfterCommitWork = null;
|
|
10276
10275
|
this.ref = emptyFn;
|
|
10277
10276
|
this.element = null;
|
|
10278
10277
|
this.node = null;
|
|
@@ -10280,8 +10279,7 @@ var GridCellForReact = class {
|
|
|
10280
10279
|
getNode() {
|
|
10281
10280
|
return this.node;
|
|
10282
10281
|
}
|
|
10283
|
-
update(content, additionalInfo
|
|
10284
|
-
this.IS_UPDATED_WHILE_SCROLLING_IN_HORIZONTAL_LAYOUT = scrollingObjectParam ? scrollingObjectParam.scrolling && scrollingObjectParam.isHorizontalLayout : false;
|
|
10282
|
+
update(content, additionalInfo) {
|
|
10285
10283
|
this.updater(content);
|
|
10286
10284
|
this.cellInfo = additionalInfo;
|
|
10287
10285
|
}
|
|
@@ -10573,14 +10571,14 @@ var GridCellManager = class extends Logger {
|
|
|
10573
10571
|
}
|
|
10574
10572
|
this.addCellToMatrix(cell, cellPos);
|
|
10575
10573
|
}
|
|
10576
|
-
renderNodeAtCell(node, cell, cellPos, additionalInfo
|
|
10574
|
+
renderNodeAtCell(node, cell, cellPos, additionalInfo) {
|
|
10577
10575
|
const currentCellAtPos = this.getCellAt(cellPos);
|
|
10578
10576
|
if (currentCellAtPos && currentCellAtPos !== cell) {
|
|
10579
10577
|
this.detachCellAt(cellPos);
|
|
10580
10578
|
}
|
|
10581
10579
|
this.pool.attachCell(cell);
|
|
10582
10580
|
this.setCellPositionInMatrix(cell, cellPos);
|
|
10583
|
-
cell.update(node, additionalInfo
|
|
10581
|
+
cell.update(node, additionalInfo);
|
|
10584
10582
|
return cell;
|
|
10585
10583
|
}
|
|
10586
10584
|
getCellPosition(cell) {
|
|
@@ -11163,10 +11161,6 @@ var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
|
11163
11161
|
var columnOffsetAtIndexWhileReordering2 = stripVar(
|
|
11164
11162
|
InternalVars.columnOffsetAtIndexWhileReordering
|
|
11165
11163
|
);
|
|
11166
|
-
var SCROLLING_OBJECT_PARAM_FLYWEIGHT = {
|
|
11167
|
-
scrolling: false,
|
|
11168
|
-
isHorizontalLayout: false
|
|
11169
|
-
};
|
|
11170
11164
|
var GridRenderer = class extends Logger {
|
|
11171
11165
|
constructor(brain, debugId) {
|
|
11172
11166
|
debugId = debugId || "ReactHeadlessTableRenderer";
|
|
@@ -11606,11 +11600,11 @@ var GridRenderer = class extends Logger {
|
|
|
11606
11600
|
return covered ? [rowspanParent, colspanParent] : false;
|
|
11607
11601
|
};
|
|
11608
11602
|
this.onMouseEnterNotBound = (event) => {
|
|
11609
|
-
const rowIndex =
|
|
11603
|
+
const rowIndex = this.getMatrixRowIndexFromElement(event.currentTarget);
|
|
11610
11604
|
this.onMouseEnter(rowIndex);
|
|
11611
11605
|
};
|
|
11612
11606
|
this.onMouseLeaveNotBound = (event) => {
|
|
11613
|
-
const rowIndex =
|
|
11607
|
+
const rowIndex = this.getMatrixRowIndexFromElement(event.currentTarget);
|
|
11614
11608
|
this.onMouseLeave(rowIndex);
|
|
11615
11609
|
};
|
|
11616
11610
|
this.onMouseEnter = (rowIndex) => {
|
|
@@ -11697,28 +11691,35 @@ var GridRenderer = class extends Logger {
|
|
|
11697
11691
|
}
|
|
11698
11692
|
const { x, y } = itemPosition;
|
|
11699
11693
|
if (itemElement) {
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
itemElement.__zIndex
|
|
11716
|
-
|
|
11694
|
+
const applyPosition = () => {
|
|
11695
|
+
this.updateHoverClassNamesForRow(rowIndex);
|
|
11696
|
+
const realCoords = this.getCellRealCoordinates(rowIndex, colIndex);
|
|
11697
|
+
itemElement.dataset.rowIndex = realCoords.rowIndex;
|
|
11698
|
+
itemElement.dataset.colIndex = realCoords.colIndex;
|
|
11699
|
+
if (ITEM_POSITION_WITH_TRANSFORM) {
|
|
11700
|
+
this.setTransform(itemElement, rowIndex, colIndex, { x, y }, null);
|
|
11701
|
+
itemElement.style.willChange = "transform";
|
|
11702
|
+
itemElement.style.backfaceVisibility = "hidden";
|
|
11703
|
+
const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
|
|
11704
|
+
const zIndex2 = hidden ? "-1" : (
|
|
11705
|
+
// #updatezindex - we need to allow elements use their own zIndex, so we
|
|
11706
|
+
// resort to allowing them to have it as a data-z-index attribute
|
|
11707
|
+
itemElement.dataset.zIndex || "auto"
|
|
11708
|
+
);
|
|
11709
|
+
if (itemElement.__zIndex !== zIndex2) {
|
|
11710
|
+
itemElement.__zIndex = zIndex2;
|
|
11711
|
+
itemElement.style.zIndex = zIndex2;
|
|
11712
|
+
}
|
|
11713
|
+
} else {
|
|
11714
|
+
itemElement.style.display = "";
|
|
11715
|
+
itemElement.style.left = `${x}px`;
|
|
11716
|
+
itemElement.style.top = `${y}px`;
|
|
11717
11717
|
}
|
|
11718
|
+
};
|
|
11719
|
+
if (this.scrolling && this.brain.isHorizontalLayoutBrain) {
|
|
11720
|
+
cell.setPendingAfterCommitWork(applyPosition);
|
|
11718
11721
|
} else {
|
|
11719
|
-
|
|
11720
|
-
itemElement.style.left = `${x}px`;
|
|
11721
|
-
itemElement.style.top = `${y}px`;
|
|
11722
|
+
applyPosition();
|
|
11722
11723
|
}
|
|
11723
11724
|
}
|
|
11724
11725
|
};
|
|
@@ -12273,6 +12274,13 @@ var GridRenderer = class extends Logger {
|
|
|
12273
12274
|
colIndex
|
|
12274
12275
|
};
|
|
12275
12276
|
}
|
|
12277
|
+
getMatrixRowIndexFromElement(element) {
|
|
12278
|
+
const renderedRowIndex = Number(element.dataset.rowIndex);
|
|
12279
|
+
if (this.brain.isHorizontalLayoutBrain) {
|
|
12280
|
+
return this.brain.getRowIndexInPage(renderedRowIndex);
|
|
12281
|
+
}
|
|
12282
|
+
return renderedRowIndex;
|
|
12283
|
+
}
|
|
12276
12284
|
renderCellAt(rowIndex, colIndex, cell, renderCell) {
|
|
12277
12285
|
if (this.destroyed) {
|
|
12278
12286
|
return;
|
|
@@ -12334,14 +12342,11 @@ var GridRenderer = class extends Logger {
|
|
|
12334
12342
|
}
|
|
12335
12343
|
return;
|
|
12336
12344
|
}
|
|
12337
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT.scrolling = this.scrolling;
|
|
12338
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT.isHorizontalLayout = isHorizontalLayout;
|
|
12339
12345
|
this.cellManager.renderNodeAtCell(
|
|
12340
12346
|
renderedNode,
|
|
12341
12347
|
cell,
|
|
12342
12348
|
[rowIndex, colIndex],
|
|
12343
|
-
cellAdditionalInfo
|
|
12344
|
-
SCROLLING_OBJECT_PARAM_FLYWEIGHT
|
|
12349
|
+
cellAdditionalInfo
|
|
12345
12350
|
);
|
|
12346
12351
|
this.updateElementPosition(cell, { hidden, rowspan, colspan });
|
|
12347
12352
|
return;
|
|
@@ -13980,7 +13985,7 @@ function InfiniteTableHeaderCellFn(props) {
|
|
|
13980
13985
|
),
|
|
13981
13986
|
currentHeader
|
|
13982
13987
|
);
|
|
13983
|
-
draggingProxy = (0,
|
|
13988
|
+
draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
|
|
13984
13989
|
}
|
|
13985
13990
|
return /* @__PURE__ */ React51.createElement(ContextProvider, { value: renderParam }, /* @__PURE__ */ React51.createElement(
|
|
13986
13991
|
InfiniteTableCell,
|
|
@@ -26433,7 +26438,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
26433
26438
|
}
|
|
26434
26439
|
let valid2 = isValidLicense(licenseKey, {
|
|
26435
26440
|
publishedAt: 1624970570587,
|
|
26436
|
-
version: "8.0.
|
|
26441
|
+
version: "8.0.1"
|
|
26437
26442
|
});
|
|
26438
26443
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
26439
26444
|
return true;
|
|
@@ -27298,7 +27303,7 @@ var import_react59 = require("react");
|
|
|
27298
27303
|
// src/components/hooks/useOverlay/index.tsx
|
|
27299
27304
|
var React57 = __toESM(require("react"));
|
|
27300
27305
|
var import_react55 = require("react");
|
|
27301
|
-
var
|
|
27306
|
+
var import_react_dom2 = require("react-dom");
|
|
27302
27307
|
|
|
27303
27308
|
// src/utils/pageGeometry/alignment/index.ts
|
|
27304
27309
|
function isHTMLElement(v) {
|
|
@@ -27550,7 +27555,7 @@ function useOverlayPortal(content, portalContainer) {
|
|
|
27550
27555
|
}
|
|
27551
27556
|
getContainer();
|
|
27552
27557
|
}, [portalContainer]);
|
|
27553
|
-
return portalContainer ? container ? (0,
|
|
27558
|
+
return portalContainer ? container ? (0, import_react_dom2.createPortal)(content, container) : (
|
|
27554
27559
|
// we're probably still fetching the container
|
|
27555
27560
|
/* @__PURE__ */ React57.createElement(React57.Fragment, null)
|
|
27556
27561
|
) : portalContainer === null || portalContainer === false ? content : /* @__PURE__ */ React57.createElement(DefaultOverlayPortal, null, content);
|
|
@@ -32265,7 +32270,7 @@ var FlashingColumnCell = createFlashingColumnCellComponent();
|
|
|
32265
32270
|
// src/components/HeadlessTable/MatrixDebugger.tsx
|
|
32266
32271
|
var React82 = __toESM(require("react"));
|
|
32267
32272
|
var import_react77 = require("react");
|
|
32268
|
-
var
|
|
32273
|
+
var import_react_dom3 = require("react-dom");
|
|
32269
32274
|
function INTERNAL_MatrixDebugger(props) {
|
|
32270
32275
|
const [getState, setGetState] = React82.useState(null);
|
|
32271
32276
|
(0, import_react77.useEffect)(() => {
|
|
@@ -32305,7 +32310,7 @@ function MatrixDebuggerUI() {
|
|
|
32305
32310
|
const columnsIndexes = cellManager.getColumnsWithCells();
|
|
32306
32311
|
const domRef = (0, import_react77.useRef)(null);
|
|
32307
32312
|
const displayTimeoutRef = (0, import_react77.useRef)(null);
|
|
32308
|
-
return /* @__PURE__ */ React82.createElement("div", { style: { overflow: "auto" } }, (0,
|
|
32313
|
+
return /* @__PURE__ */ React82.createElement("div", { style: { overflow: "auto" } }, (0, import_react_dom3.createPortal)(
|
|
32309
32314
|
/* @__PURE__ */ React82.createElement(
|
|
32310
32315
|
"div",
|
|
32311
32316
|
{
|
|
@@ -32398,10 +32403,14 @@ var components = {
|
|
|
32398
32403
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32399
32404
|
0 && (module.exports = {
|
|
32400
32405
|
CellSelectionState,
|
|
32406
|
+
DRAG_ITEM_ATTRIBUTE,
|
|
32401
32407
|
DataClient,
|
|
32402
32408
|
DataSource,
|
|
32403
32409
|
DataSourceActionType,
|
|
32404
32410
|
DeepMap,
|
|
32411
|
+
DragDropProvider,
|
|
32412
|
+
DragInteractionTarget,
|
|
32413
|
+
DragList,
|
|
32405
32414
|
FixedSizeSet,
|
|
32406
32415
|
FlashingColumnCell,
|
|
32407
32416
|
GroupRowsState,
|
|
@@ -32441,6 +32450,8 @@ var components = {
|
|
|
32441
32450
|
useDataSourceInternal,
|
|
32442
32451
|
useDataSourceSelector,
|
|
32443
32452
|
useDataSourceState,
|
|
32453
|
+
useDragDropProvider,
|
|
32454
|
+
useDragListContext,
|
|
32444
32455
|
useEffectWhen,
|
|
32445
32456
|
useEffectWhenSameDeps,
|
|
32446
32457
|
useEffectWithChanges,
|
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.
|
|
26383
|
+
version: "8.0.1"
|
|
26385
26384
|
});
|
|
26386
26385
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
26387
26386
|
return true;
|
|
@@ -32355,10 +32354,14 @@ var components = {
|
|
|
32355
32354
|
};
|
|
32356
32355
|
export {
|
|
32357
32356
|
CellSelectionState,
|
|
32357
|
+
DRAG_ITEM_ATTRIBUTE,
|
|
32358
32358
|
DataClient,
|
|
32359
32359
|
DataSource,
|
|
32360
32360
|
DataSourceActionType,
|
|
32361
32361
|
DeepMap,
|
|
32362
|
+
DragDropProvider,
|
|
32363
|
+
DragInteractionTarget,
|
|
32364
|
+
DragList,
|
|
32362
32365
|
FixedSizeSet,
|
|
32363
32366
|
FlashingColumnCell,
|
|
32364
32367
|
GroupRowsState,
|
|
@@ -32398,6 +32401,8 @@ export {
|
|
|
32398
32401
|
useDataSourceInternal,
|
|
32399
32402
|
useDataSourceSelector,
|
|
32400
32403
|
useDataSourceState,
|
|
32404
|
+
useDragDropProvider,
|
|
32405
|
+
useDragListContext,
|
|
32401
32406
|
useEffectWhen,
|
|
32402
32407
|
useEffectWhenSameDeps,
|
|
32403
32408
|
useEffectWithChanges,
|