@infinite-table/infinite-react 7.4.1 → 7.5.0-canary.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.css +1 -1
- package/index.d.ts +2170 -2111
- package/index.dev.js +653 -218
- package/index.dev.mjs +654 -219
- package/index.js +8 -8
- package/index.mjs +8 -8
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -1388,6 +1388,13 @@ var toUpperFirst = (s) => {
|
|
|
1388
1388
|
return s ? s.substr(0, 1).toUpperCase() + s.substr(1) : s;
|
|
1389
1389
|
};
|
|
1390
1390
|
|
|
1391
|
+
// src/components/InfiniteTable/types/Utility.ts
|
|
1392
|
+
function notNullable(value) {
|
|
1393
|
+
if (value === null || value === void 0) return false;
|
|
1394
|
+
const testDummyForCompileError = value;
|
|
1395
|
+
return true;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1391
1398
|
// src/components/utils/isControlledValue.ts
|
|
1392
1399
|
function isControlledValue(value) {
|
|
1393
1400
|
const controlled = value !== void 0;
|
|
@@ -1461,6 +1468,165 @@ var usePrevious = (value, initialValue) => {
|
|
|
1461
1468
|
return ref.current;
|
|
1462
1469
|
};
|
|
1463
1470
|
|
|
1471
|
+
// src/utils/devTools/devToolsTracks.ts
|
|
1472
|
+
var DevToolsTracks = {
|
|
1473
|
+
DataSource: {
|
|
1474
|
+
track: "DataSource",
|
|
1475
|
+
labels: {
|
|
1476
|
+
RemoteDataLoad: "Remote data load",
|
|
1477
|
+
TreeUnfilteredTreePaths: "Computing unfiltered tree paths",
|
|
1478
|
+
Filter: "Filter",
|
|
1479
|
+
Sort: "Sort",
|
|
1480
|
+
Group: "Group",
|
|
1481
|
+
LazyGroup: "Lazy group",
|
|
1482
|
+
Tree: "Tree",
|
|
1483
|
+
FlattenTree: "Flatten tree",
|
|
1484
|
+
Flatten: "Flatten groups",
|
|
1485
|
+
PrepareData: "Preparing data",
|
|
1486
|
+
ComputeSelectionCount: "Computing selection count",
|
|
1487
|
+
ComputeSelectionCountLazy: "Computing selection count (lazy)",
|
|
1488
|
+
PrepareRowInfo: "Preparing row info array",
|
|
1489
|
+
DiffRowInfoInStore: "setDataArray diffing in RowInfoStore"
|
|
1490
|
+
}
|
|
1491
|
+
},
|
|
1492
|
+
InfiniteTable: {
|
|
1493
|
+
track: "InfiniteTable",
|
|
1494
|
+
labels: {
|
|
1495
|
+
Render: "Rendering"
|
|
1496
|
+
}
|
|
1497
|
+
},
|
|
1498
|
+
MatrixBrain: {
|
|
1499
|
+
track: "Layout Computations",
|
|
1500
|
+
labels: {
|
|
1501
|
+
ComputeRenderRange: "Computing render range"
|
|
1502
|
+
}
|
|
1503
|
+
},
|
|
1504
|
+
ComponentState: {
|
|
1505
|
+
track: "ComponentState",
|
|
1506
|
+
labels: {
|
|
1507
|
+
PropUpdate: "Prop update"
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1512
|
+
// src/utils/devTools/index.ts
|
|
1513
|
+
var DevToolsMarker = class _DevToolsMarker {
|
|
1514
|
+
constructor(debugId) {
|
|
1515
|
+
this.debugId = debugId;
|
|
1516
|
+
this.markerDetails = {
|
|
1517
|
+
label: "",
|
|
1518
|
+
track: "",
|
|
1519
|
+
trackGroup: void 0,
|
|
1520
|
+
color: void 0,
|
|
1521
|
+
details: [],
|
|
1522
|
+
tooltip: void 0
|
|
1523
|
+
};
|
|
1524
|
+
this.stopped = false;
|
|
1525
|
+
this.start = (startDetails) => {
|
|
1526
|
+
if (this.markerDetails.startTs) {
|
|
1527
|
+
return this;
|
|
1528
|
+
}
|
|
1529
|
+
const start = performance.now();
|
|
1530
|
+
this.markerDetails.details = startDetails?.details ?? [];
|
|
1531
|
+
this.markerDetails.startTs = start;
|
|
1532
|
+
return this;
|
|
1533
|
+
};
|
|
1534
|
+
this.end = (markerDetails = {}) => {
|
|
1535
|
+
if (this.stopped) {
|
|
1536
|
+
return this;
|
|
1537
|
+
}
|
|
1538
|
+
this.stopped = true;
|
|
1539
|
+
const start = markerDetails.startTs ?? this.markerDetails.startTs;
|
|
1540
|
+
const end = markerDetails.endTs ?? this.markerDetails.endTs ?? performance.now();
|
|
1541
|
+
const color = markerDetails.color || this.markerDetails.color || "primary";
|
|
1542
|
+
const trackGroup = markerDetails.trackGroup || this.markerDetails.trackGroup || `Infinite Table (${this.debugId})`;
|
|
1543
|
+
const details = [
|
|
1544
|
+
...this.markerDetails.details || [],
|
|
1545
|
+
...markerDetails.details || []
|
|
1546
|
+
];
|
|
1547
|
+
const tooltip = markerDetails.tooltip || this.markerDetails.tooltip;
|
|
1548
|
+
const label = markerDetails.label || this.markerDetails.label || "Unknown";
|
|
1549
|
+
const track = markerDetails.track || this.markerDetails.track || "Unknown";
|
|
1550
|
+
performance.measure(label, {
|
|
1551
|
+
start,
|
|
1552
|
+
end,
|
|
1553
|
+
detail: {
|
|
1554
|
+
devtools: {
|
|
1555
|
+
dataType: "track-entry",
|
|
1556
|
+
trackGroup,
|
|
1557
|
+
track,
|
|
1558
|
+
color,
|
|
1559
|
+
properties: details.length > 0 ? details.map((detail) => [detail.name, detail.value]) : void 0,
|
|
1560
|
+
tooltipText: tooltip
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
});
|
|
1564
|
+
return this;
|
|
1565
|
+
};
|
|
1566
|
+
this.debugId = debugId;
|
|
1567
|
+
}
|
|
1568
|
+
static create(debugId) {
|
|
1569
|
+
return new _DevToolsMarker(debugId);
|
|
1570
|
+
}
|
|
1571
|
+
get startTimestamp() {
|
|
1572
|
+
return this.markerDetails.startTs;
|
|
1573
|
+
}
|
|
1574
|
+
get track() {
|
|
1575
|
+
const self = this;
|
|
1576
|
+
return Object.keys(DevToolsTracks).reduce(
|
|
1577
|
+
(acc, track) => {
|
|
1578
|
+
const trackObj = {
|
|
1579
|
+
start: self.start,
|
|
1580
|
+
end: (markerDetails) => {
|
|
1581
|
+
return self.end({
|
|
1582
|
+
...markerDetails,
|
|
1583
|
+
track: DevToolsTracks[track].track,
|
|
1584
|
+
label: markerDetails.label
|
|
1585
|
+
});
|
|
1586
|
+
},
|
|
1587
|
+
get label() {
|
|
1588
|
+
const currentTrack = DevToolsTracks[track];
|
|
1589
|
+
return Object.keys(currentTrack.labels).reduce(
|
|
1590
|
+
(labelAcc, label) => {
|
|
1591
|
+
const labelObj = {
|
|
1592
|
+
start: self.start,
|
|
1593
|
+
end: (markerDetails) => {
|
|
1594
|
+
return self.end({
|
|
1595
|
+
...markerDetails,
|
|
1596
|
+
track: currentTrack.track,
|
|
1597
|
+
label: currentTrack.labels[label]
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
};
|
|
1601
|
+
Object.defineProperty(labelAcc, label, {
|
|
1602
|
+
get: () => {
|
|
1603
|
+
self.markerDetails.label = currentTrack.labels[label];
|
|
1604
|
+
return labelObj;
|
|
1605
|
+
}
|
|
1606
|
+
});
|
|
1607
|
+
return labelAcc;
|
|
1608
|
+
},
|
|
1609
|
+
{}
|
|
1610
|
+
);
|
|
1611
|
+
}
|
|
1612
|
+
};
|
|
1613
|
+
Object.defineProperty(acc, track, {
|
|
1614
|
+
get: () => {
|
|
1615
|
+
const currentTrack = DevToolsTracks[track];
|
|
1616
|
+
self.markerDetails.track = currentTrack.track;
|
|
1617
|
+
return trackObj;
|
|
1618
|
+
}
|
|
1619
|
+
});
|
|
1620
|
+
return acc;
|
|
1621
|
+
},
|
|
1622
|
+
{}
|
|
1623
|
+
);
|
|
1624
|
+
}
|
|
1625
|
+
};
|
|
1626
|
+
function getMarker(debugId) {
|
|
1627
|
+
return DevToolsMarker.create(debugId);
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1464
1630
|
// src/components/hooks/useComponentState/index.tsx
|
|
1465
1631
|
var notifyChange = (props, callbackPropName, values) => {
|
|
1466
1632
|
const callbackProp = props[callbackPropName];
|
|
@@ -1717,9 +1883,10 @@ function buildManagedComponent(config) {
|
|
|
1717
1883
|
}
|
|
1718
1884
|
});
|
|
1719
1885
|
if (updatedPropsToStateCount > 0 || newMappedStateCount > 0) {
|
|
1720
|
-
const
|
|
1721
|
-
|
|
1722
|
-
) :
|
|
1886
|
+
const debugId = state.debugId;
|
|
1887
|
+
const marker = debugId ? getMarker(debugId).track.ComponentState.label.PropUpdate.start() : void 0;
|
|
1888
|
+
const debugChannelName = config.debugName ? typeof config.debugName === "function" ? `${config.debugName(currentProps)}:rerender` : `${config.debugName}:rerender` : "rerender";
|
|
1889
|
+
const logger2 = dbg(debugChannelName);
|
|
1723
1890
|
logger2(
|
|
1724
1891
|
"Triggered by new values for the following props",
|
|
1725
1892
|
...[
|
|
@@ -1727,6 +1894,25 @@ function buildManagedComponent(config) {
|
|
|
1727
1894
|
...Object.keys(updatedPropsToState ?? {})
|
|
1728
1895
|
]
|
|
1729
1896
|
);
|
|
1897
|
+
if (marker) {
|
|
1898
|
+
marker.end({
|
|
1899
|
+
label: debugChannelName,
|
|
1900
|
+
details: [
|
|
1901
|
+
newMappedStateCount > 0 ? {
|
|
1902
|
+
name: "Updated properties",
|
|
1903
|
+
value: Object.keys(newMappedState).join(", ")
|
|
1904
|
+
} : void 0,
|
|
1905
|
+
updatedPropsToStateCount > 0 ? {
|
|
1906
|
+
name: "Updated props",
|
|
1907
|
+
value: Object.keys(updatedPropsToState).join(", ")
|
|
1908
|
+
} : void 0,
|
|
1909
|
+
updatedPropsToStateCount > 0 || updatedPropsToState ? {
|
|
1910
|
+
name: "Details",
|
|
1911
|
+
value: "The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."
|
|
1912
|
+
} : void 0
|
|
1913
|
+
].filter(notNullable)
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1730
1916
|
const action = {
|
|
1731
1917
|
payload: {
|
|
1732
1918
|
mappedState: newMappedStateCount ? newMappedState : null,
|
|
@@ -6069,16 +6255,6 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
6069
6255
|
return generatedGroupColumn;
|
|
6070
6256
|
}
|
|
6071
6257
|
|
|
6072
|
-
// src/components/InfiniteTable/utils/objectValuesExcept.ts
|
|
6073
|
-
function objectValuesExcept(obj, exceptList) {
|
|
6074
|
-
const result = [];
|
|
6075
|
-
for (const k in obj)
|
|
6076
|
-
if (obj.hasOwnProperty(k) && !exceptList.hasOwnProperty(k)) {
|
|
6077
|
-
result.push(obj[k]);
|
|
6078
|
-
}
|
|
6079
|
-
return result;
|
|
6080
|
-
}
|
|
6081
|
-
|
|
6082
6258
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
6083
6259
|
var ColumnCellCls = "_1eexc2a7 _1eexc2a6";
|
|
6084
6260
|
var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "_1eexc2an", variantClassNames: { dragging: { false: "_1eexc2ao", true: "_1eexc2ap" }, insideDisabledDraggingPage: { true: "_1eexc2aq", false: "_1eexc2ar" }, cellSelected: { false: "_1eexc2as", true: "_1eexc2at" }, treeNode: { parent: "_1eexc2au", leaf: "_1eexc2av", false: "_1eexc2aw" }, align: { start: "_1eexc2ax", end: "_1eexc2ay", center: "_1eexc2az" }, verticalAlign: { start: "_1eexc2a10", end: "_1eexc2a11", center: "_1eexc2a12" }, rowActive: { false: "_1eexc2a13", true: "_1eexc2a14" }, groupRow: { false: "_1eexc2a15", true: "_1eexc2a16" }, groupCell: { false: "_1eexc2a17", true: "_1eexc2a18" }, rowDisabled: { false: "_1eexc2a19", true: "_1eexc2a1a" }, zebra: { false: "_1eexc2a1b", even: "_1eexc2a1c", odd: "_1eexc2a1d" }, rowSelected: { true: "_1eexc2a1e", false: "_1eexc2a1f", null: "_1eexc2a1g" }, first: { true: "_1eexc2a1h", false: "_1eexc2a1i" }, last: { true: "_1eexc2a1j", false: "_1eexc2a1k" }, groupByField: { true: "_1eexc2a1l", false: "_1eexc2a1m" }, firstInCategory: { true: "_1eexc2a1n", false: "_1eexc2a1o" }, firstRow: { true: "_1eexc2a1p", false: "_1eexc2a1q" }, firstRowInHorizontalLayoutPage: { true: "_1eexc2a1r", false: "_1eexc2a1s" }, lastInCategory: { true: "_1eexc2a1t", false: "_1eexc2a1u" }, pinned: { start: "_1eexc2a1v", end: "_1eexc2a1w", false: "_1eexc2a1x" }, filtered: { true: "_1eexc2a1y", false: "_1eexc2a1z" } }, defaultVariants: {}, compoundVariants: [[{ firstRowInHorizontalLayoutPage: true, firstRow: false }, "_1eexc2a20"], [{ pinned: "start", lastInCategory: true }, "_1eexc2a21"], [{ pinned: "start", firstInCategory: true }, "_1eexc2a22"], [{ pinned: "end", firstInCategory: true }, "_1eexc2a23"], [{ pinned: "end", lastInCategory: true }, "_1eexc2a24"], [{ align: "center", groupCell: false }, "_1eexc2a25"], [{ rowDisabled: true, zebra: "odd" }, "_1eexc2a26"]] });
|
|
@@ -6652,6 +6828,7 @@ var import_react17 = require("react");
|
|
|
6652
6828
|
function InfiniteTableColumnEditor() {
|
|
6653
6829
|
const { initialValue, setValue, confirmEdit, cancelEdit, readOnly } = useInfiniteColumnEditor();
|
|
6654
6830
|
const domRef = (0, import_react17.useRef)(null);
|
|
6831
|
+
const cancelledRef = (0, import_react17.useRef)(false);
|
|
6655
6832
|
const refCallback = React28.useCallback((node) => {
|
|
6656
6833
|
domRef.current = node;
|
|
6657
6834
|
if (node) {
|
|
@@ -6663,18 +6840,24 @@ function InfiniteTableColumnEditor() {
|
|
|
6663
6840
|
if (key === "Enter" || key === "Tab") {
|
|
6664
6841
|
confirmEdit();
|
|
6665
6842
|
} else if (key === "Escape") {
|
|
6843
|
+
cancelledRef.current = true;
|
|
6666
6844
|
cancelEdit();
|
|
6667
6845
|
} else {
|
|
6668
6846
|
event.stopPropagation();
|
|
6669
6847
|
}
|
|
6670
6848
|
}, []);
|
|
6849
|
+
const onBlur = (0, import_react17.useCallback)(() => {
|
|
6850
|
+
if (!cancelledRef.current) {
|
|
6851
|
+
confirmEdit();
|
|
6852
|
+
}
|
|
6853
|
+
}, []);
|
|
6671
6854
|
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(
|
|
6672
6855
|
"input",
|
|
6673
6856
|
{
|
|
6674
6857
|
readOnly,
|
|
6675
6858
|
ref: refCallback,
|
|
6676
6859
|
onKeyDown: onKeyDown2,
|
|
6677
|
-
onBlur
|
|
6860
|
+
onBlur,
|
|
6678
6861
|
className: join(absoluteCover, outline.none),
|
|
6679
6862
|
type: "text",
|
|
6680
6863
|
defaultValue: initialValue,
|
|
@@ -6685,6 +6868,16 @@ function InfiniteTableColumnEditor() {
|
|
|
6685
6868
|
));
|
|
6686
6869
|
}
|
|
6687
6870
|
|
|
6871
|
+
// src/components/InfiniteTable/utils/objectValuesExcept.ts
|
|
6872
|
+
function objectValuesExcept(obj, exceptList) {
|
|
6873
|
+
const result = [];
|
|
6874
|
+
for (const k in obj)
|
|
6875
|
+
if (obj.hasOwnProperty(k) && !exceptList.hasOwnProperty(k)) {
|
|
6876
|
+
result.push(obj[k]);
|
|
6877
|
+
}
|
|
6878
|
+
return result;
|
|
6879
|
+
}
|
|
6880
|
+
|
|
6688
6881
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
6689
6882
|
var columnZIndexAtIndex3 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
6690
6883
|
var columnVisibilityAtIndex2 = stripVar(InternalVars.columnVisibilityAtIndex);
|
|
@@ -6779,7 +6972,8 @@ function applyColumnStyle(existingStyle, columnStyle, param) {
|
|
|
6779
6972
|
}
|
|
6780
6973
|
function InfiniteTableColumnCellFn(props) {
|
|
6781
6974
|
const {
|
|
6782
|
-
|
|
6975
|
+
dataSourceStatePartialForCell,
|
|
6976
|
+
rowInfoStore,
|
|
6783
6977
|
rowStyle,
|
|
6784
6978
|
rowClassName,
|
|
6785
6979
|
rowIndexInHorizontalLayoutPage,
|
|
@@ -6801,8 +6995,30 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6801
6995
|
fieldsToColumn,
|
|
6802
6996
|
domRef: initialDomRef,
|
|
6803
6997
|
hidden,
|
|
6804
|
-
showZebraRows
|
|
6998
|
+
showZebraRows,
|
|
6999
|
+
// DataSource context values passed as props
|
|
7000
|
+
getDataSourceState,
|
|
7001
|
+
dataSourceApi,
|
|
7002
|
+
dataSourceActions,
|
|
7003
|
+
// InfiniteTable context values passed as props
|
|
7004
|
+
getState,
|
|
7005
|
+
imperativeApi,
|
|
7006
|
+
componentActions,
|
|
7007
|
+
getComputed,
|
|
7008
|
+
getDataSourceMasterContext
|
|
6805
7009
|
} = props;
|
|
7010
|
+
const rowInfoFromStore = (0, import_react18.useSyncExternalStore)(
|
|
7011
|
+
(0, import_react18.useCallback)(
|
|
7012
|
+
(callback) => rowInfoStore.subscribeToRowIndex(rowIndex, callback),
|
|
7013
|
+
[rowInfoStore, rowIndex]
|
|
7014
|
+
),
|
|
7015
|
+
(0, import_react18.useCallback)(
|
|
7016
|
+
() => rowInfoStore.getRowInfoAtIndex(rowIndex),
|
|
7017
|
+
[rowInfoStore, rowIndex]
|
|
7018
|
+
)
|
|
7019
|
+
);
|
|
7020
|
+
const isEmptyRowInfo = !rowInfoFromStore;
|
|
7021
|
+
const isEmptyColumn = !column;
|
|
6806
7022
|
const htmlElementRef = React29.useRef(null);
|
|
6807
7023
|
const domRef = (0, import_react18.useCallback)(
|
|
6808
7024
|
(node) => {
|
|
@@ -6813,23 +7029,25 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6813
7029
|
},
|
|
6814
7030
|
[initialDomRef]
|
|
6815
7031
|
);
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
7032
|
+
const rowInfo = rowInfoFromStore ?? {
|
|
7033
|
+
id: "",
|
|
7034
|
+
indexInAll: rowIndex,
|
|
7035
|
+
rowSelected: false,
|
|
7036
|
+
rowDisabled: false,
|
|
7037
|
+
isCellSelected: () => false,
|
|
7038
|
+
hasSelectedCells: () => false,
|
|
7039
|
+
isGroupRow: false,
|
|
7040
|
+
isTreeNode: false,
|
|
7041
|
+
isParentNode: false,
|
|
7042
|
+
treeNesting: 0,
|
|
7043
|
+
nodePath: [],
|
|
7044
|
+
collapsed: false,
|
|
7045
|
+
dataSourceHasGrouping: false,
|
|
7046
|
+
selfLoaded: true,
|
|
7047
|
+
data: {}
|
|
7048
|
+
};
|
|
6819
7049
|
const { rowSelected } = rowInfo;
|
|
6820
|
-
const
|
|
6821
|
-
getState,
|
|
6822
|
-
actions: componentActions,
|
|
6823
|
-
computed,
|
|
6824
|
-
api: imperativeApi,
|
|
6825
|
-
getDataSourceMasterContext
|
|
6826
|
-
} = useInfiniteTable();
|
|
6827
|
-
const {
|
|
6828
|
-
componentState: dataSourceState,
|
|
6829
|
-
getState: getDataSourceState,
|
|
6830
|
-
api: dataSourceApi,
|
|
6831
|
-
componentActions: dataSourceActions
|
|
6832
|
-
} = useDataSourceContextValue();
|
|
7050
|
+
const computed = getComputed();
|
|
6833
7051
|
const { activeRowIndex, keyboardNavigation, columnReorderInPageIndex } = getState();
|
|
6834
7052
|
const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
|
|
6835
7053
|
const renderingContext = {
|
|
@@ -6914,7 +7132,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
6914
7132
|
},
|
|
6915
7133
|
[rowIndex, rowDisabled, column.computedVisibleIndex, keyboardNavigation]
|
|
6916
7134
|
);
|
|
6917
|
-
const { selectionMode, cellSelection, isNodeReadOnly: isNodeReadOnly2 } =
|
|
7135
|
+
const { selectionMode, cellSelection, isNodeReadOnly: isNodeReadOnly2 } = dataSourceStatePartialForCell;
|
|
6918
7136
|
const cellSelected = renderParam.cellSelected;
|
|
6919
7137
|
renderParam.domRef = domRef;
|
|
6920
7138
|
renderParam.htmlElementRef = htmlElementRef;
|
|
@@ -7273,6 +7491,9 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
7273
7491
|
renderChildren: (0, import_react18.useCallback)(() => theChildren, [renderChildren])
|
|
7274
7492
|
};
|
|
7275
7493
|
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
7494
|
+
if (isEmptyColumn || isEmptyRowInfo) {
|
|
7495
|
+
return /* @__PURE__ */ React29.createElement("div", { ref: domRef, style: { display: "none" } });
|
|
7496
|
+
}
|
|
7276
7497
|
return (
|
|
7277
7498
|
// this context is here for supporting useInfiniteColumnCell to be used
|
|
7278
7499
|
// with a custom column component, specified via column.components.ColumnCell
|
|
@@ -8510,28 +8731,39 @@ var import_react27 = require("react");
|
|
|
8510
8731
|
var React39 = __toESM(require("react"));
|
|
8511
8732
|
var import_react_dom = require("react-dom");
|
|
8512
8733
|
var import_react26 = require("react");
|
|
8734
|
+
var SHOULD_FLUSH_SYNC = () => false;
|
|
8513
8735
|
function AvoidReactDiffFn(props) {
|
|
8514
8736
|
const [children, setChildren] = (0, import_react26.useState)(props.updater.get);
|
|
8515
8737
|
const rafId = (0, import_react26.useRef)(null);
|
|
8738
|
+
const shouldFlushSync = props.shouldFlushSync ?? SHOULD_FLUSH_SYNC;
|
|
8516
8739
|
(0, import_react26.useLayoutEffect)(() => {
|
|
8517
8740
|
function onChange(children2) {
|
|
8741
|
+
let FLUSH_SYNC = shouldFlushSync();
|
|
8518
8742
|
if (props.useraf) {
|
|
8519
8743
|
if (rafId.current != null) {
|
|
8520
8744
|
cancelAnimationFrame(rafId.current);
|
|
8521
8745
|
}
|
|
8522
8746
|
rafId.current = requestAnimationFrame(() => {
|
|
8747
|
+
if (FLUSH_SYNC) {
|
|
8748
|
+
queueMicrotask(() => {
|
|
8749
|
+
(0, import_react_dom.flushSync)(() => {
|
|
8750
|
+
setChildren(children2);
|
|
8751
|
+
});
|
|
8752
|
+
});
|
|
8753
|
+
} else {
|
|
8754
|
+
setChildren(children2);
|
|
8755
|
+
}
|
|
8756
|
+
});
|
|
8757
|
+
} else {
|
|
8758
|
+
if (FLUSH_SYNC) {
|
|
8523
8759
|
queueMicrotask(() => {
|
|
8524
8760
|
(0, import_react_dom.flushSync)(() => {
|
|
8525
8761
|
setChildren(children2);
|
|
8526
8762
|
});
|
|
8527
8763
|
});
|
|
8528
|
-
}
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
(0, import_react_dom.flushSync)(() => {
|
|
8532
|
-
setChildren(children2);
|
|
8533
|
-
});
|
|
8534
|
-
});
|
|
8764
|
+
} else {
|
|
8765
|
+
setChildren(children2);
|
|
8766
|
+
}
|
|
8535
8767
|
}
|
|
8536
8768
|
}
|
|
8537
8769
|
const remove = props.updater.onChange(onChange);
|
|
@@ -8541,7 +8773,7 @@ function AvoidReactDiffFn(props) {
|
|
|
8541
8773
|
}
|
|
8542
8774
|
remove();
|
|
8543
8775
|
};
|
|
8544
|
-
}, [props.updater, props.useraf]);
|
|
8776
|
+
}, [props.updater, props.useraf, shouldFlushSync]);
|
|
8545
8777
|
return children ?? null;
|
|
8546
8778
|
}
|
|
8547
8779
|
var AvoidReactDiff = React39.memo(AvoidReactDiffFn);
|
|
@@ -9870,14 +10102,26 @@ var GridCellForReact = class {
|
|
|
9870
10102
|
constructor(debugId, cellInfo) {
|
|
9871
10103
|
this.element = null;
|
|
9872
10104
|
this.mounted = false;
|
|
10105
|
+
this.IS_UPDATED_WHILE_SCROLLING = false;
|
|
9873
10106
|
this.mountSubscription = buildSubscriptionCallback();
|
|
10107
|
+
this.isUpdatedWhileScrolling = () => {
|
|
10108
|
+
return this.IS_UPDATED_WHILE_SCROLLING;
|
|
10109
|
+
};
|
|
9874
10110
|
const count = CELL_COUNT_BY_DEBUG_ID.get(debugId) ?? 0;
|
|
9875
10111
|
const key = `${debugId}:GridCellReact:${count}`;
|
|
9876
10112
|
CELL_COUNT_BY_DEBUG_ID.set(debugId, count + 1);
|
|
9877
10113
|
this.debugId = key;
|
|
9878
10114
|
this.cellInfo = cellInfo;
|
|
9879
10115
|
this.updater = buildSubscriptionCallback();
|
|
9880
|
-
this.node = /* @__PURE__ */ React40.createElement(
|
|
10116
|
+
this.node = /* @__PURE__ */ React40.createElement(
|
|
10117
|
+
AvoidReactDiff,
|
|
10118
|
+
{
|
|
10119
|
+
key,
|
|
10120
|
+
name: key,
|
|
10121
|
+
updater: this.updater,
|
|
10122
|
+
shouldFlushSync: this.isUpdatedWhileScrolling
|
|
10123
|
+
}
|
|
10124
|
+
);
|
|
9881
10125
|
this.ref = (htmlElement) => {
|
|
9882
10126
|
this.element = htmlElement;
|
|
9883
10127
|
if (htmlElement) {
|
|
@@ -9909,7 +10153,8 @@ var GridCellForReact = class {
|
|
|
9909
10153
|
getNode() {
|
|
9910
10154
|
return this.node;
|
|
9911
10155
|
}
|
|
9912
|
-
update(content, additionalInfo) {
|
|
10156
|
+
update(content, additionalInfo, scrollingObjectParam) {
|
|
10157
|
+
this.IS_UPDATED_WHILE_SCROLLING = scrollingObjectParam ? scrollingObjectParam.scrolling : false;
|
|
9913
10158
|
this.updater(content);
|
|
9914
10159
|
this.cellInfo = additionalInfo;
|
|
9915
10160
|
}
|
|
@@ -10201,14 +10446,14 @@ var GridCellManager = class extends Logger {
|
|
|
10201
10446
|
}
|
|
10202
10447
|
this.addCellToMatrix(cell, cellPos);
|
|
10203
10448
|
}
|
|
10204
|
-
renderNodeAtCell(node, cell, cellPos, additionalInfo) {
|
|
10449
|
+
renderNodeAtCell(node, cell, cellPos, additionalInfo, scrollingObjectParam) {
|
|
10205
10450
|
const currentCellAtPos = this.getCellAt(cellPos);
|
|
10206
10451
|
if (currentCellAtPos && currentCellAtPos !== cell) {
|
|
10207
10452
|
this.detachCellAt(cellPos);
|
|
10208
10453
|
}
|
|
10209
10454
|
this.pool.attachCell(cell);
|
|
10210
10455
|
this.setCellPositionInMatrix(cell, cellPos);
|
|
10211
|
-
cell.update(node, additionalInfo);
|
|
10456
|
+
cell.update(node, additionalInfo, scrollingObjectParam);
|
|
10212
10457
|
return cell;
|
|
10213
10458
|
}
|
|
10214
10459
|
getCellPosition(cell) {
|
|
@@ -10791,6 +11036,9 @@ var columnOffsetAtIndex2 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
|
10791
11036
|
var columnOffsetAtIndexWhileReordering2 = stripVar(
|
|
10792
11037
|
InternalVars.columnOffsetAtIndexWhileReordering
|
|
10793
11038
|
);
|
|
11039
|
+
var SCROLLING_OBJECT_PARAM_FLYWEIGHT = {
|
|
11040
|
+
scrolling: false
|
|
11041
|
+
};
|
|
10794
11042
|
var GridRenderer = class extends Logger {
|
|
10795
11043
|
constructor(brain, debugId) {
|
|
10796
11044
|
debugId = debugId || "ReactHeadlessTableRenderer";
|
|
@@ -11229,6 +11477,14 @@ var GridRenderer = class extends Logger {
|
|
|
11229
11477
|
const covered = coveredByAnotherRow || coveredByAnotherCol;
|
|
11230
11478
|
return covered ? [rowspanParent, colspanParent] : false;
|
|
11231
11479
|
};
|
|
11480
|
+
this.onMouseEnterNotBound = (event) => {
|
|
11481
|
+
const rowIndex = Number(event.target.dataset.rowIndex);
|
|
11482
|
+
this.onMouseEnter(rowIndex);
|
|
11483
|
+
};
|
|
11484
|
+
this.onMouseLeaveNotBound = (event) => {
|
|
11485
|
+
const rowIndex = Number(event.target.dataset.rowIndex);
|
|
11486
|
+
this.onMouseLeave(rowIndex);
|
|
11487
|
+
};
|
|
11232
11488
|
this.onMouseEnter = (rowIndex) => {
|
|
11233
11489
|
this.lastEnteredRow = rowIndex;
|
|
11234
11490
|
this.lastExitedRow = -1;
|
|
@@ -11918,8 +12174,12 @@ var GridRenderer = class extends Logger {
|
|
|
11918
12174
|
hidden,
|
|
11919
12175
|
heightWithRowspan,
|
|
11920
12176
|
widthWithColspan,
|
|
11921
|
-
onMouseEnter: this.onMouseEnter.bind(null, rowIndex),
|
|
11922
|
-
|
|
12177
|
+
// onMouseEnter: this.onMouseEnter.bind(null, rowIndex),
|
|
12178
|
+
onMouseEnter: this.onMouseEnterNotBound,
|
|
12179
|
+
//.bind(null, rowIndex),
|
|
12180
|
+
// onMouseLeave: this.onMouseLeave.bind(null, rowIndex),
|
|
12181
|
+
onMouseLeave: this.onMouseLeaveNotBound,
|
|
12182
|
+
//.bind(null, rowIndex),
|
|
11923
12183
|
domRef: cell.ref
|
|
11924
12184
|
});
|
|
11925
12185
|
if (!cell.isMounted()) {
|
|
@@ -11945,11 +12205,13 @@ var GridRenderer = class extends Logger {
|
|
|
11945
12205
|
}
|
|
11946
12206
|
return;
|
|
11947
12207
|
}
|
|
12208
|
+
SCROLLING_OBJECT_PARAM_FLYWEIGHT.scrolling = this.scrolling;
|
|
11948
12209
|
this.cellManager.renderNodeAtCell(
|
|
11949
12210
|
renderedNode,
|
|
11950
12211
|
cell,
|
|
11951
12212
|
[rowIndex, colIndex],
|
|
11952
|
-
cellAdditionalInfo
|
|
12213
|
+
cellAdditionalInfo,
|
|
12214
|
+
SCROLLING_OBJECT_PARAM_FLYWEIGHT
|
|
11953
12215
|
);
|
|
11954
12216
|
this.updateElementPosition(cell, { hidden, rowspan, colspan });
|
|
11955
12217
|
return;
|
|
@@ -18832,165 +19094,6 @@ function finishRowInfoReducersFor(params) {
|
|
|
18832
19094
|
return results;
|
|
18833
19095
|
}
|
|
18834
19096
|
|
|
18835
|
-
// src/utils/devTools/devToolsTracks.ts
|
|
18836
|
-
var DevToolsTracks = {
|
|
18837
|
-
DataSource: {
|
|
18838
|
-
track: "DataSource",
|
|
18839
|
-
labels: {
|
|
18840
|
-
RemoteDataLoad: "Remote data load",
|
|
18841
|
-
TreeUnfilteredTreePaths: "Computing unfiltered tree paths",
|
|
18842
|
-
Filter: "Filter",
|
|
18843
|
-
Sort: "Sort",
|
|
18844
|
-
Group: "Group",
|
|
18845
|
-
LazyGroup: "Lazy group",
|
|
18846
|
-
Tree: "Tree",
|
|
18847
|
-
FlattenTree: "Flatten tree",
|
|
18848
|
-
Flatten: "Flatten groups",
|
|
18849
|
-
PrepareData: "Preparing data",
|
|
18850
|
-
ComputeSelectionCount: "Computing selection count",
|
|
18851
|
-
ComputeSelectionCountLazy: "Computing selection count (lazy)",
|
|
18852
|
-
PrepareRowInfo: "Preparing row info array"
|
|
18853
|
-
}
|
|
18854
|
-
},
|
|
18855
|
-
InfiniteTable: {
|
|
18856
|
-
track: "InfiniteTable",
|
|
18857
|
-
labels: {
|
|
18858
|
-
Render: "Rendering"
|
|
18859
|
-
}
|
|
18860
|
-
},
|
|
18861
|
-
MatrixBrain: {
|
|
18862
|
-
track: "Layout Computations",
|
|
18863
|
-
labels: {
|
|
18864
|
-
ComputeRenderRange: "Computing render range"
|
|
18865
|
-
}
|
|
18866
|
-
}
|
|
18867
|
-
};
|
|
18868
|
-
|
|
18869
|
-
// src/utils/devTools/index.ts
|
|
18870
|
-
var DevToolsMarker = class _DevToolsMarker {
|
|
18871
|
-
constructor(debugId) {
|
|
18872
|
-
this.debugId = debugId;
|
|
18873
|
-
this.markerDetails = {
|
|
18874
|
-
label: "",
|
|
18875
|
-
track: "",
|
|
18876
|
-
trackGroup: void 0,
|
|
18877
|
-
color: void 0,
|
|
18878
|
-
details: [],
|
|
18879
|
-
tooltip: void 0
|
|
18880
|
-
};
|
|
18881
|
-
this.stopped = false;
|
|
18882
|
-
this.start = (startDetails) => {
|
|
18883
|
-
if (this.markerDetails.startTs) {
|
|
18884
|
-
return this;
|
|
18885
|
-
}
|
|
18886
|
-
const start = performance.now();
|
|
18887
|
-
this.markerDetails.details = startDetails?.details ?? [];
|
|
18888
|
-
this.markerDetails.startTs = start;
|
|
18889
|
-
return this;
|
|
18890
|
-
};
|
|
18891
|
-
this.end = (markerDetails = {}) => {
|
|
18892
|
-
if (this.stopped) {
|
|
18893
|
-
return this;
|
|
18894
|
-
}
|
|
18895
|
-
this.stopped = true;
|
|
18896
|
-
const start = markerDetails.startTs ?? this.markerDetails.startTs;
|
|
18897
|
-
const end = markerDetails.endTs ?? this.markerDetails.endTs ?? performance.now();
|
|
18898
|
-
const color = markerDetails.color || this.markerDetails.color || "primary";
|
|
18899
|
-
const trackGroup = markerDetails.trackGroup || this.markerDetails.trackGroup || `Infinite Table (${this.debugId})`;
|
|
18900
|
-
const details = [
|
|
18901
|
-
...this.markerDetails.details || [],
|
|
18902
|
-
...markerDetails.details || []
|
|
18903
|
-
];
|
|
18904
|
-
const tooltip = markerDetails.tooltip || this.markerDetails.tooltip;
|
|
18905
|
-
const label = markerDetails.label || this.markerDetails.label || "Unknown";
|
|
18906
|
-
const track = markerDetails.track || this.markerDetails.track || "Unknown";
|
|
18907
|
-
performance.measure(label, {
|
|
18908
|
-
start,
|
|
18909
|
-
end,
|
|
18910
|
-
detail: {
|
|
18911
|
-
devtools: {
|
|
18912
|
-
dataType: "track-entry",
|
|
18913
|
-
trackGroup,
|
|
18914
|
-
track,
|
|
18915
|
-
color,
|
|
18916
|
-
properties: details.length > 0 ? details.map((detail) => [detail.name, detail.value]) : void 0,
|
|
18917
|
-
tooltipText: tooltip
|
|
18918
|
-
}
|
|
18919
|
-
}
|
|
18920
|
-
});
|
|
18921
|
-
return this;
|
|
18922
|
-
};
|
|
18923
|
-
this.debugId = debugId;
|
|
18924
|
-
}
|
|
18925
|
-
static create(debugId) {
|
|
18926
|
-
return new _DevToolsMarker(debugId);
|
|
18927
|
-
}
|
|
18928
|
-
get startTimestamp() {
|
|
18929
|
-
return this.markerDetails.startTs;
|
|
18930
|
-
}
|
|
18931
|
-
get track() {
|
|
18932
|
-
const self = this;
|
|
18933
|
-
return Object.keys(DevToolsTracks).reduce(
|
|
18934
|
-
(acc, track) => {
|
|
18935
|
-
const trackObj = {
|
|
18936
|
-
start: self.start,
|
|
18937
|
-
end: (markerDetails) => {
|
|
18938
|
-
return self.end({
|
|
18939
|
-
...markerDetails,
|
|
18940
|
-
track: DevToolsTracks[track].track,
|
|
18941
|
-
label: markerDetails.label
|
|
18942
|
-
});
|
|
18943
|
-
},
|
|
18944
|
-
get label() {
|
|
18945
|
-
const currentTrack = DevToolsTracks[track];
|
|
18946
|
-
return Object.keys(currentTrack.labels).reduce(
|
|
18947
|
-
(labelAcc, label) => {
|
|
18948
|
-
const labelObj = {
|
|
18949
|
-
start: self.start,
|
|
18950
|
-
end: (markerDetails) => {
|
|
18951
|
-
return self.end({
|
|
18952
|
-
...markerDetails,
|
|
18953
|
-
track: currentTrack.track,
|
|
18954
|
-
label: currentTrack.labels[label]
|
|
18955
|
-
});
|
|
18956
|
-
}
|
|
18957
|
-
};
|
|
18958
|
-
Object.defineProperty(labelAcc, label, {
|
|
18959
|
-
get: () => {
|
|
18960
|
-
self.markerDetails.label = currentTrack.labels[label];
|
|
18961
|
-
return labelObj;
|
|
18962
|
-
}
|
|
18963
|
-
});
|
|
18964
|
-
return labelAcc;
|
|
18965
|
-
},
|
|
18966
|
-
{}
|
|
18967
|
-
);
|
|
18968
|
-
}
|
|
18969
|
-
};
|
|
18970
|
-
Object.defineProperty(acc, track, {
|
|
18971
|
-
get: () => {
|
|
18972
|
-
const currentTrack = DevToolsTracks[track];
|
|
18973
|
-
self.markerDetails.track = currentTrack.track;
|
|
18974
|
-
return trackObj;
|
|
18975
|
-
}
|
|
18976
|
-
});
|
|
18977
|
-
return acc;
|
|
18978
|
-
},
|
|
18979
|
-
{}
|
|
18980
|
-
);
|
|
18981
|
-
}
|
|
18982
|
-
};
|
|
18983
|
-
function getMarker(debugId) {
|
|
18984
|
-
return DevToolsMarker.create(debugId);
|
|
18985
|
-
}
|
|
18986
|
-
|
|
18987
|
-
// src/components/InfiniteTable/types/Utility.ts
|
|
18988
|
-
function notNullable(value) {
|
|
18989
|
-
if (value === null || value === void 0) return false;
|
|
18990
|
-
const testDummyForCompileError = value;
|
|
18991
|
-
return true;
|
|
18992
|
-
}
|
|
18993
|
-
|
|
18994
19097
|
// src/components/DataSource/state/reducer.ts
|
|
18995
19098
|
function cleanupEmptyFilterValues(filterValue, filterTypes) {
|
|
18996
19099
|
if (!filterValue) {
|
|
@@ -19768,6 +19871,9 @@ function concludeReducer(params) {
|
|
|
19768
19871
|
treeMutations: treeMutations?.size ? treeMutations : void 0
|
|
19769
19872
|
};
|
|
19770
19873
|
}
|
|
19874
|
+
state.rowInfoStore.notifyDataArray(rowInfoDataArray, {
|
|
19875
|
+
marker: debugId ? getMarker(debugId).track.DataSource.label.DiffRowInfoInStore : void 0
|
|
19876
|
+
});
|
|
19771
19877
|
if (rootMarker) {
|
|
19772
19878
|
rootMarker?.track.DataSource.label.PrepareData.end({
|
|
19773
19879
|
details: [
|
|
@@ -20622,6 +20728,279 @@ var normalizeSortInfo = (initialSortInfo, weakMap3) => {
|
|
|
20622
20728
|
return result;
|
|
20623
20729
|
};
|
|
20624
20730
|
|
|
20731
|
+
// src/components/DataSource/RowInfoStore.ts
|
|
20732
|
+
function deepEqual(a, b) {
|
|
20733
|
+
if (a === b) return true;
|
|
20734
|
+
if (a == null || b == null) return a === b;
|
|
20735
|
+
if (typeof a !== typeof b) return false;
|
|
20736
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
20737
|
+
if (a.length !== b.length) return false;
|
|
20738
|
+
for (let i = 0, len = a.length; i < len; i++) {
|
|
20739
|
+
if (!deepEqual(a[i], b[i])) return false;
|
|
20740
|
+
}
|
|
20741
|
+
return true;
|
|
20742
|
+
}
|
|
20743
|
+
if (typeof a === "object") {
|
|
20744
|
+
const keysA = Object.keys(a);
|
|
20745
|
+
const keysB = Object.keys(b);
|
|
20746
|
+
if (keysA.length !== keysB.length) return false;
|
|
20747
|
+
for (const key of keysA) {
|
|
20748
|
+
if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
|
|
20749
|
+
if (!deepEqual(a[key], b[key])) return false;
|
|
20750
|
+
}
|
|
20751
|
+
return true;
|
|
20752
|
+
}
|
|
20753
|
+
return false;
|
|
20754
|
+
}
|
|
20755
|
+
function isSameRowInfoType(one, two) {
|
|
20756
|
+
if (one === void 0 || two === void 0) return false;
|
|
20757
|
+
if (one.isGroupRow !== two.isGroupRow) return false;
|
|
20758
|
+
if (one.dataSourceHasGrouping !== two.dataSourceHasGrouping) return false;
|
|
20759
|
+
if (one.isTreeNode !== two.isTreeNode) return false;
|
|
20760
|
+
if (one.isTreeNode) {
|
|
20761
|
+
if (one.isParentNode !== two.isParentNode)
|
|
20762
|
+
return false;
|
|
20763
|
+
}
|
|
20764
|
+
return true;
|
|
20765
|
+
}
|
|
20766
|
+
var rowInfoBase_KeysRecord = {
|
|
20767
|
+
id: true,
|
|
20768
|
+
value: true,
|
|
20769
|
+
indexInAll: true,
|
|
20770
|
+
rowSelected: true,
|
|
20771
|
+
rowDisabled: true,
|
|
20772
|
+
isCellSelected: false,
|
|
20773
|
+
hasSelectedCells: false
|
|
20774
|
+
};
|
|
20775
|
+
var rowInfo_NoGrouping_RowInfoNormal_KeysRecord = {
|
|
20776
|
+
...rowInfoBase_KeysRecord,
|
|
20777
|
+
dataSourceHasGrouping: true,
|
|
20778
|
+
isTreeNode: true,
|
|
20779
|
+
data: false,
|
|
20780
|
+
isGroupRow: true,
|
|
20781
|
+
selfLoaded: true
|
|
20782
|
+
};
|
|
20783
|
+
var rowInfo_HasGrouping_RowInfoBase_KeysRecord = {
|
|
20784
|
+
indexInGroup: true,
|
|
20785
|
+
groupKeys: true,
|
|
20786
|
+
groupBy: true,
|
|
20787
|
+
rootGroupBy: true,
|
|
20788
|
+
parents: false,
|
|
20789
|
+
indexInParentGroups: true,
|
|
20790
|
+
groupCount: true,
|
|
20791
|
+
groupNesting: true,
|
|
20792
|
+
collapsed: true,
|
|
20793
|
+
selfLoaded: true
|
|
20794
|
+
};
|
|
20795
|
+
var rowInfo_HasGrouping_RowInfoGroup_KeysRecord = {
|
|
20796
|
+
...rowInfoBase_KeysRecord,
|
|
20797
|
+
...rowInfo_HasGrouping_RowInfoBase_KeysRecord,
|
|
20798
|
+
dataSourceHasGrouping: true,
|
|
20799
|
+
isTreeNode: true,
|
|
20800
|
+
data: false,
|
|
20801
|
+
reducerData: true,
|
|
20802
|
+
isGroupRow: true,
|
|
20803
|
+
duplicateOf: false,
|
|
20804
|
+
deepRowInfoArray: false,
|
|
20805
|
+
error: true,
|
|
20806
|
+
reducerResults: true,
|
|
20807
|
+
groupCount: true,
|
|
20808
|
+
groupData: true,
|
|
20809
|
+
selectedChildredCount: true,
|
|
20810
|
+
deselectedChildredCount: true,
|
|
20811
|
+
totalChildrenCount: true,
|
|
20812
|
+
collapsedChildrenCount: true,
|
|
20813
|
+
collapsedGroupsCount: true,
|
|
20814
|
+
directChildrenCount: true,
|
|
20815
|
+
directChildrenLoadedCount: true,
|
|
20816
|
+
pivotValuesMap: true,
|
|
20817
|
+
childrenAvailable: true,
|
|
20818
|
+
childrenLoading: true
|
|
20819
|
+
};
|
|
20820
|
+
var rowInfo_Tree_RowInfoBase_KeysRecord = {
|
|
20821
|
+
isTreeNode: true,
|
|
20822
|
+
isParentNode: true,
|
|
20823
|
+
indexInParent: true,
|
|
20824
|
+
nodePath: true,
|
|
20825
|
+
parentNodes: false,
|
|
20826
|
+
indexInParentNodes: true,
|
|
20827
|
+
totalLeafNodesCount: true,
|
|
20828
|
+
collapsedLeafNodesCount: true,
|
|
20829
|
+
treeNesting: true,
|
|
20830
|
+
selfLoaded: true
|
|
20831
|
+
};
|
|
20832
|
+
var rowInfo_Tree_RowInfoLeafNode_KeysRecord = {
|
|
20833
|
+
...rowInfoBase_KeysRecord,
|
|
20834
|
+
...rowInfo_Tree_RowInfoBase_KeysRecord,
|
|
20835
|
+
dataSourceHasGrouping: true,
|
|
20836
|
+
isTreeNode: true,
|
|
20837
|
+
isGroupRow: true,
|
|
20838
|
+
isParentNode: true,
|
|
20839
|
+
data: false
|
|
20840
|
+
};
|
|
20841
|
+
var rowInfo_Tree_RowInfoParentNode_KeysRecord = {
|
|
20842
|
+
...rowInfoBase_KeysRecord,
|
|
20843
|
+
...rowInfo_Tree_RowInfoBase_KeysRecord,
|
|
20844
|
+
dataSourceHasGrouping: true,
|
|
20845
|
+
isParentNode: true,
|
|
20846
|
+
isGroupRow: true,
|
|
20847
|
+
nodeExpanded: true,
|
|
20848
|
+
selfExpanded: true,
|
|
20849
|
+
data: false,
|
|
20850
|
+
selectedLeafNodesCount: true,
|
|
20851
|
+
deepRowInfoArray: false,
|
|
20852
|
+
deselectedLeafNodesCount: true,
|
|
20853
|
+
duplicateOf: false
|
|
20854
|
+
};
|
|
20855
|
+
var rowInfoKeys_noGrouping = Object.entries(
|
|
20856
|
+
rowInfo_NoGrouping_RowInfoNormal_KeysRecord
|
|
20857
|
+
).map(([key, value]) => value ? key : void 0).filter(Boolean);
|
|
20858
|
+
var rowInfoKeys_hasGrouping_normalRow = Object.entries(
|
|
20859
|
+
rowInfo_NoGrouping_RowInfoNormal_KeysRecord
|
|
20860
|
+
).map(
|
|
20861
|
+
([key, value]) => value ? key : void 0
|
|
20862
|
+
);
|
|
20863
|
+
var rowInfoKeys_hasGrouping_groupRow = Object.entries(
|
|
20864
|
+
rowInfo_HasGrouping_RowInfoGroup_KeysRecord
|
|
20865
|
+
).map(
|
|
20866
|
+
([key, value]) => value ? key : void 0
|
|
20867
|
+
);
|
|
20868
|
+
var rowInfoKeys_tree_leafNode = Object.entries(
|
|
20869
|
+
rowInfo_Tree_RowInfoLeafNode_KeysRecord
|
|
20870
|
+
).map(
|
|
20871
|
+
([key, value]) => value ? key : void 0
|
|
20872
|
+
);
|
|
20873
|
+
var rowInfoKeys_tree_parentNode = Object.entries(
|
|
20874
|
+
rowInfo_Tree_RowInfoParentNode_KeysRecord
|
|
20875
|
+
).map(
|
|
20876
|
+
([key, value]) => value ? key : void 0
|
|
20877
|
+
);
|
|
20878
|
+
function deepEqualRowInfo(oldRowInfo, newRowInfo) {
|
|
20879
|
+
if (oldRowInfo === newRowInfo) return true;
|
|
20880
|
+
if (!oldRowInfo || !newRowInfo) {
|
|
20881
|
+
return false;
|
|
20882
|
+
}
|
|
20883
|
+
if (!isSameRowInfoType(oldRowInfo, newRowInfo)) {
|
|
20884
|
+
return false;
|
|
20885
|
+
}
|
|
20886
|
+
if (oldRowInfo.id !== newRowInfo.id) return false;
|
|
20887
|
+
if (oldRowInfo.data !== newRowInfo.data) {
|
|
20888
|
+
if (!deepEqual(oldRowInfo.data, newRowInfo.data)) {
|
|
20889
|
+
return false;
|
|
20890
|
+
}
|
|
20891
|
+
}
|
|
20892
|
+
let allKeys = [];
|
|
20893
|
+
if (!oldRowInfo.dataSourceHasGrouping) {
|
|
20894
|
+
if (oldRowInfo.isTreeNode) {
|
|
20895
|
+
allKeys = oldRowInfo.isTreeNode && oldRowInfo.isParentNode ? rowInfoKeys_tree_parentNode : rowInfoKeys_tree_leafNode;
|
|
20896
|
+
} else {
|
|
20897
|
+
allKeys = rowInfoKeys_noGrouping;
|
|
20898
|
+
}
|
|
20899
|
+
} else {
|
|
20900
|
+
allKeys = oldRowInfo.isGroupRow ? rowInfoKeys_hasGrouping_groupRow : rowInfoKeys_hasGrouping_normalRow;
|
|
20901
|
+
}
|
|
20902
|
+
for (const key of allKeys) {
|
|
20903
|
+
const oldValue = oldRowInfo[key];
|
|
20904
|
+
const newValue = newRowInfo[key];
|
|
20905
|
+
if (typeof oldValue === "function" || typeof newValue === "function") {
|
|
20906
|
+
continue;
|
|
20907
|
+
}
|
|
20908
|
+
if (!deepEqual(oldValue, newValue)) {
|
|
20909
|
+
return false;
|
|
20910
|
+
}
|
|
20911
|
+
}
|
|
20912
|
+
return true;
|
|
20913
|
+
}
|
|
20914
|
+
function createRowInfoStore() {
|
|
20915
|
+
let dataArray = [];
|
|
20916
|
+
const subscribers = /* @__PURE__ */ new Map();
|
|
20917
|
+
const notifyDataArray = (newDataArray, params) => {
|
|
20918
|
+
const oldDataArray = dataArray;
|
|
20919
|
+
const marker = params?.marker;
|
|
20920
|
+
if (marker) {
|
|
20921
|
+
marker.start({
|
|
20922
|
+
details: [
|
|
20923
|
+
{ name: "new dataArray length", value: newDataArray.length },
|
|
20924
|
+
{
|
|
20925
|
+
name: "old dataArray length",
|
|
20926
|
+
value: oldDataArray.length
|
|
20927
|
+
}
|
|
20928
|
+
]
|
|
20929
|
+
});
|
|
20930
|
+
}
|
|
20931
|
+
const changedIndices = [];
|
|
20932
|
+
const subscribedRowIndexes = getSubscribedRowIndexes();
|
|
20933
|
+
for (const index of subscribedRowIndexes) {
|
|
20934
|
+
const oldRowInfo = oldDataArray[index];
|
|
20935
|
+
const newRowInfo = newDataArray[index];
|
|
20936
|
+
if (newRowInfo === void 0) {
|
|
20937
|
+
changedIndices.push(index);
|
|
20938
|
+
continue;
|
|
20939
|
+
}
|
|
20940
|
+
if (!deepEqualRowInfo(oldRowInfo, newRowInfo)) {
|
|
20941
|
+
changedIndices.push(index);
|
|
20942
|
+
}
|
|
20943
|
+
}
|
|
20944
|
+
dataArray = newDataArray;
|
|
20945
|
+
if (changedIndices.length > 0) {
|
|
20946
|
+
queueMicrotask(() => {
|
|
20947
|
+
console.log("notify", changedIndices);
|
|
20948
|
+
for (let i = 0, len = changedIndices.length; i < len; i++) {
|
|
20949
|
+
const index = changedIndices[i];
|
|
20950
|
+
const indexSubscribers = subscribers.get(index);
|
|
20951
|
+
if (indexSubscribers) {
|
|
20952
|
+
for (const callback of indexSubscribers) {
|
|
20953
|
+
callback();
|
|
20954
|
+
}
|
|
20955
|
+
}
|
|
20956
|
+
}
|
|
20957
|
+
});
|
|
20958
|
+
}
|
|
20959
|
+
if (marker) {
|
|
20960
|
+
marker.end({
|
|
20961
|
+
details: [{ name: "updated row infos", value: changedIndices.length }]
|
|
20962
|
+
});
|
|
20963
|
+
}
|
|
20964
|
+
};
|
|
20965
|
+
const getRowInfoAtIndex = (index) => {
|
|
20966
|
+
return dataArray[index];
|
|
20967
|
+
};
|
|
20968
|
+
const subscribeToRowIndex = (rowIndex, callback) => {
|
|
20969
|
+
let indexSubscribers = subscribers.get(rowIndex);
|
|
20970
|
+
if (!indexSubscribers) {
|
|
20971
|
+
indexSubscribers = /* @__PURE__ */ new Set();
|
|
20972
|
+
subscribers.set(rowIndex, indexSubscribers);
|
|
20973
|
+
}
|
|
20974
|
+
indexSubscribers.add(callback);
|
|
20975
|
+
return () => {
|
|
20976
|
+
const subs = subscribers.get(rowIndex);
|
|
20977
|
+
if (subs) {
|
|
20978
|
+
subs.delete(callback);
|
|
20979
|
+
if (subs.size === 0) {
|
|
20980
|
+
subscribers.delete(rowIndex);
|
|
20981
|
+
}
|
|
20982
|
+
}
|
|
20983
|
+
};
|
|
20984
|
+
};
|
|
20985
|
+
const getSubscribedRowIndexes = () => {
|
|
20986
|
+
return Array.from(subscribers.keys());
|
|
20987
|
+
};
|
|
20988
|
+
const getDataArray = () => {
|
|
20989
|
+
return dataArray;
|
|
20990
|
+
};
|
|
20991
|
+
const clear = () => {
|
|
20992
|
+
dataArray = [];
|
|
20993
|
+
subscribers.clear();
|
|
20994
|
+
};
|
|
20995
|
+
return {
|
|
20996
|
+
notifyDataArray,
|
|
20997
|
+
getRowInfoAtIndex,
|
|
20998
|
+
subscribeToRowIndex,
|
|
20999
|
+
getDataArray,
|
|
21000
|
+
clear
|
|
21001
|
+
};
|
|
21002
|
+
}
|
|
21003
|
+
|
|
20625
21004
|
// src/components/DataSource/state/getInitialState.ts
|
|
20626
21005
|
var defaultCursorId = Symbol("cursorId");
|
|
20627
21006
|
var isNodeReadOnly = (rowInfo) => {
|
|
@@ -20641,6 +21020,7 @@ function initSetupState(props) {
|
|
|
20641
21020
|
debugTimings: /* @__PURE__ */ new Map(),
|
|
20642
21021
|
debugWarnings: /* @__PURE__ */ new Map(),
|
|
20643
21022
|
devToolsDetected: !!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,
|
|
21023
|
+
rowInfoStore: createRowInfoStore(),
|
|
20644
21024
|
// TODO cleanup indexer on unmount
|
|
20645
21025
|
indexer: new Indexer(),
|
|
20646
21026
|
totalLeafNodesCount: 0,
|
|
@@ -20741,6 +21121,7 @@ var cleanupDataSource = (state) => {
|
|
|
20741
21121
|
state.treeSelectionState?.destroy();
|
|
20742
21122
|
state.idToPathMap.clear();
|
|
20743
21123
|
state.idToIndexMap.clear();
|
|
21124
|
+
state.rowInfoStore.clear();
|
|
20744
21125
|
};
|
|
20745
21126
|
var forwardProps3 = (setupState, props) => {
|
|
20746
21127
|
return {
|
|
@@ -22447,6 +22828,9 @@ function isSortInfoForColumn(sortInfo, col) {
|
|
|
22447
22828
|
}
|
|
22448
22829
|
var InfiniteTableApiImpl = class {
|
|
22449
22830
|
constructor(context) {
|
|
22831
|
+
this.getVisibleRenderRange = () => {
|
|
22832
|
+
return this.getState().brain.getRenderRange();
|
|
22833
|
+
};
|
|
22450
22834
|
this.hideFilterOperatorMenu = () => {
|
|
22451
22835
|
this.actions.filterOperatorMenuVisibleForColumnId = null;
|
|
22452
22836
|
};
|
|
@@ -23293,7 +23677,9 @@ var InfiniteTableApiImpl = class {
|
|
|
23293
23677
|
}
|
|
23294
23678
|
set scrollLeft(scrollLeft2) {
|
|
23295
23679
|
const state = this.getState();
|
|
23296
|
-
state.scrollerDOMRef.current
|
|
23680
|
+
if (state.scrollerDOMRef.current) {
|
|
23681
|
+
state.scrollerDOMRef.current.scrollLeft = Math.max(scrollLeft2, 0);
|
|
23682
|
+
}
|
|
23297
23683
|
}
|
|
23298
23684
|
get scrollTop() {
|
|
23299
23685
|
const state = this.getState();
|
|
@@ -23301,7 +23687,9 @@ var InfiniteTableApiImpl = class {
|
|
|
23301
23687
|
}
|
|
23302
23688
|
set scrollTop(scrollTop2) {
|
|
23303
23689
|
const state = this.getState();
|
|
23304
|
-
state.scrollerDOMRef.current
|
|
23690
|
+
if (state.scrollerDOMRef.current) {
|
|
23691
|
+
state.scrollerDOMRef.current.scrollTop = Math.max(scrollTop2, 0);
|
|
23692
|
+
}
|
|
23305
23693
|
}
|
|
23306
23694
|
scrollRowIntoView(rowIndex, config = { offset: 0 }) {
|
|
23307
23695
|
const state = this.getState();
|
|
@@ -24176,12 +24564,14 @@ function initSetupState2({
|
|
|
24176
24564
|
headerOnRenderUpdater
|
|
24177
24565
|
} = createBrains(debugId, !!wrapRowsHorizontally);
|
|
24178
24566
|
const domRef = (0, import_react42.createRef)();
|
|
24567
|
+
const now = Date.now();
|
|
24179
24568
|
return {
|
|
24180
24569
|
debugWarnings: /* @__PURE__ */ new Map(),
|
|
24181
24570
|
renderer,
|
|
24182
24571
|
onRenderUpdater,
|
|
24183
24572
|
headerRenderer,
|
|
24184
24573
|
headerOnRenderUpdater,
|
|
24574
|
+
updatedAt: now,
|
|
24185
24575
|
devToolsDetected: !!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,
|
|
24186
24576
|
propsCache: /* @__PURE__ */ new Map([]),
|
|
24187
24577
|
lastRowToCollapseRef: { current: null },
|
|
@@ -24468,6 +24858,7 @@ var mapPropsToState = (params) => {
|
|
|
24468
24858
|
}
|
|
24469
24859
|
const isRowDetailEnabled = !rowDetailRenderer ? false : props.isRowDetailEnabled || true;
|
|
24470
24860
|
let result = {
|
|
24861
|
+
updatedAt: Date.now(),
|
|
24471
24862
|
isTree: parentState.isTree,
|
|
24472
24863
|
rowDetailRenderer,
|
|
24473
24864
|
rowDetailState,
|
|
@@ -25688,7 +26079,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
25688
26079
|
}
|
|
25689
26080
|
let valid2 = isValidLicense(licenseKey, {
|
|
25690
26081
|
publishedAt: 1624970570587,
|
|
25691
|
-
version: "7.
|
|
26082
|
+
version: "7.5.0-canary.0"
|
|
25692
26083
|
});
|
|
25693
26084
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
25694
26085
|
return true;
|
|
@@ -29927,7 +30318,7 @@ var InfiniteTableDetailRow = React73.memo(
|
|
|
29927
30318
|
var SCROLL_BOTTOM_OFFSET = 1;
|
|
29928
30319
|
function useCellRendering(param) {
|
|
29929
30320
|
const { computed, bodySize, imperativeApi } = param;
|
|
29930
|
-
const { actions, state, getState } = useInfiniteTable();
|
|
30321
|
+
const { actions, state, getState, getComputed, getDataSourceMasterContext } = useInfiniteTable();
|
|
29931
30322
|
const {
|
|
29932
30323
|
computedPinnedStartColumns,
|
|
29933
30324
|
computedPinnedEndColumns,
|
|
@@ -29946,7 +30337,13 @@ function useCellRendering(param) {
|
|
|
29946
30337
|
componentActions: dataSourceActions,
|
|
29947
30338
|
api: dataSourceApi
|
|
29948
30339
|
} = useDataSourceContextValue();
|
|
29949
|
-
const {
|
|
30340
|
+
const {
|
|
30341
|
+
dataArray,
|
|
30342
|
+
rowInfoStore,
|
|
30343
|
+
selectionMode,
|
|
30344
|
+
cellSelection,
|
|
30345
|
+
isNodeReadOnly: isNodeReadOnly2
|
|
30346
|
+
} = dataSourceState;
|
|
29950
30347
|
const getData = useLatest(dataArray);
|
|
29951
30348
|
const {
|
|
29952
30349
|
rowHeight,
|
|
@@ -29969,7 +30366,9 @@ function useCellRendering(param) {
|
|
|
29969
30366
|
onScrollStop,
|
|
29970
30367
|
scrollToBottomOffset,
|
|
29971
30368
|
wrapRowsHorizontally,
|
|
29972
|
-
|
|
30369
|
+
updatedAt: componentStateUpdatedAt,
|
|
30370
|
+
ready,
|
|
30371
|
+
editingCell
|
|
29973
30372
|
} = state;
|
|
29974
30373
|
const repaintId = dataSourceState.updatedAt;
|
|
29975
30374
|
useYourBrain({
|
|
@@ -30052,6 +30451,13 @@ function useCellRendering(param) {
|
|
|
30052
30451
|
(0, import_react69.useEffect)(() => {
|
|
30053
30452
|
rerender();
|
|
30054
30453
|
}, [dataSourceState]);
|
|
30454
|
+
const dataSourceStatePartialForCell = (0, import_react68.useMemo)(() => {
|
|
30455
|
+
return {
|
|
30456
|
+
isNodeReadOnly: isNodeReadOnly2,
|
|
30457
|
+
selectionMode,
|
|
30458
|
+
cellSelection
|
|
30459
|
+
};
|
|
30460
|
+
}, [isNodeReadOnly2, selectionMode, cellSelection]);
|
|
30055
30461
|
const renderCell = (0, import_react69.useCallback)(
|
|
30056
30462
|
(params) => {
|
|
30057
30463
|
const {
|
|
@@ -30082,6 +30488,10 @@ function useCellRendering(param) {
|
|
|
30082
30488
|
}
|
|
30083
30489
|
const rowIndexInHorizontalLayoutPage = wrapRowsHorizontally ? brain.getRowIndexInPage(rowIndex) : null;
|
|
30084
30490
|
const horizontalLayoutPageIndex = wrapRowsHorizontally ? brain.getPageIndexForRow(rowIndex) : null;
|
|
30491
|
+
const inEditMode = imperativeApi.isEditorVisibleForCell({
|
|
30492
|
+
rowIndex,
|
|
30493
|
+
columnId: column.id
|
|
30494
|
+
});
|
|
30085
30495
|
const cellProps = {
|
|
30086
30496
|
getData,
|
|
30087
30497
|
virtualized: true,
|
|
@@ -30090,7 +30500,7 @@ function useCellRendering(param) {
|
|
|
30090
30500
|
rowIndexInHorizontalLayoutPage,
|
|
30091
30501
|
horizontalLayoutPageIndex,
|
|
30092
30502
|
rowIndex,
|
|
30093
|
-
|
|
30503
|
+
rowInfoStore,
|
|
30094
30504
|
hidden,
|
|
30095
30505
|
toggleGroupRow,
|
|
30096
30506
|
rowHeight: rowHeight2,
|
|
@@ -30107,7 +30517,21 @@ function useCellRendering(param) {
|
|
|
30107
30517
|
rowStyle,
|
|
30108
30518
|
rowClassName,
|
|
30109
30519
|
cellStyle,
|
|
30110
|
-
cellClassName
|
|
30520
|
+
cellClassName,
|
|
30521
|
+
// Whether this specific cell is in edit mode
|
|
30522
|
+
// Passed as prop to trigger re-render when editing state changes
|
|
30523
|
+
inEditMode,
|
|
30524
|
+
// DataSource context values passed as props to avoid context re-renders
|
|
30525
|
+
getDataSourceState,
|
|
30526
|
+
dataSourceApi,
|
|
30527
|
+
dataSourceActions,
|
|
30528
|
+
// InfiniteTable context values passed as props to avoid context re-renders
|
|
30529
|
+
getState,
|
|
30530
|
+
imperativeApi,
|
|
30531
|
+
componentActions: actions,
|
|
30532
|
+
getComputed,
|
|
30533
|
+
getDataSourceMasterContext,
|
|
30534
|
+
dataSourceStatePartialForCell
|
|
30111
30535
|
};
|
|
30112
30536
|
return /* @__PURE__ */ React74.createElement(InfiniteTableColumnCell, { ...cellProps });
|
|
30113
30537
|
},
|
|
@@ -30129,11 +30553,22 @@ function useCellRendering(param) {
|
|
|
30129
30553
|
showZebraRows,
|
|
30130
30554
|
brain,
|
|
30131
30555
|
repaintId,
|
|
30132
|
-
|
|
30556
|
+
rowInfoStore,
|
|
30133
30557
|
rowStyle,
|
|
30134
30558
|
rowClassName,
|
|
30135
30559
|
cellClassName,
|
|
30136
|
-
cellStyle
|
|
30560
|
+
cellStyle,
|
|
30561
|
+
getDataSourceState,
|
|
30562
|
+
dataSourceApi,
|
|
30563
|
+
dataSourceActions,
|
|
30564
|
+
getState,
|
|
30565
|
+
imperativeApi,
|
|
30566
|
+
actions,
|
|
30567
|
+
getComputed,
|
|
30568
|
+
getDataSourceMasterContext,
|
|
30569
|
+
componentStateUpdatedAt,
|
|
30570
|
+
editingCell,
|
|
30571
|
+
dataSourceStatePartialForCell
|
|
30137
30572
|
]
|
|
30138
30573
|
);
|
|
30139
30574
|
const renderDetailRow = (0, import_react68.useMemo)(() => {
|
|
@@ -30480,7 +30915,7 @@ var InfiniteTableComponent = React78.memo(
|
|
|
30480
30915
|
if (false) {
|
|
30481
30916
|
globalThis.infiniteApi = context.api;
|
|
30482
30917
|
}
|
|
30483
|
-
}, [componentState.ready]);
|
|
30918
|
+
}, [componentState.ready, context.api]);
|
|
30484
30919
|
const debugId = useDebugMode();
|
|
30485
30920
|
React78.useEffect(() => {
|
|
30486
30921
|
if (masterContext) {
|