@infinite-table/infinite-react 5.1.0-canary.1 → 6.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.css +363 -160
- package/index.d.ts +1195 -60
- package/index.dev.js +2613 -406
- package/index.dev.mjs +2599 -400
- package/index.js +2613 -406
- package/index.mjs +2599 -400
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -83,7 +83,12 @@ __export(src_exports, {
|
|
|
83
83
|
RowDetailState: () => RowDetailState,
|
|
84
84
|
RowDisabledState: () => RowDisabledState,
|
|
85
85
|
RowSelectionState: () => RowSelectionState,
|
|
86
|
+
TreeDataSource: () => TreeDataSource,
|
|
87
|
+
TreeExpandState: () => TreeExpandState,
|
|
88
|
+
TreeGrid: () => TreeGrid,
|
|
89
|
+
TreeSelectionState: () => TreeSelectionState,
|
|
86
90
|
WeakFixedSizeSet: () => WeakFixedSizeSet,
|
|
91
|
+
alignNode: () => alignNode,
|
|
87
92
|
components: () => components,
|
|
88
93
|
createFlashingColumnCellComponent: () => createFlashingColumnCellComponent,
|
|
89
94
|
debounce: () => debounce,
|
|
@@ -97,7 +102,9 @@ __export(src_exports, {
|
|
|
97
102
|
interceptMap: () => interceptMap,
|
|
98
103
|
keyboardShortcuts: () => keyboardShortcuts,
|
|
99
104
|
multisort: () => multisort,
|
|
105
|
+
multisortNested: () => multisortNested,
|
|
100
106
|
queryKeyToCacheKey: () => queryKeyToCacheKey,
|
|
107
|
+
toTreeDataArray: () => toTreeDataArray,
|
|
101
108
|
useComponentState: () => useManagedComponentState,
|
|
102
109
|
useDataSourceInternal: () => useDataSourceInternal,
|
|
103
110
|
useDataSourceState: () => useDataSourceState,
|
|
@@ -110,6 +117,7 @@ __export(src_exports, {
|
|
|
110
117
|
useInfiniteColumnEditor: () => useInfiniteColumnEditor,
|
|
111
118
|
useInfiniteColumnFilterEditor: () => useInfiniteColumnFilterEditor,
|
|
112
119
|
useInfiniteHeaderCell: () => useInfiniteHeaderCell,
|
|
120
|
+
useInfinitePortalContainer: () => useInfinitePortalContainer,
|
|
113
121
|
useManagedDataSource: () => useManagedDataSource,
|
|
114
122
|
useMasterRowInfo: () => useMasterRowInfo,
|
|
115
123
|
useOverlay: () => useOverlay,
|
|
@@ -135,7 +143,7 @@ function debounce(fn, { wait }) {
|
|
|
135
143
|
}
|
|
136
144
|
|
|
137
145
|
// src/components/InfiniteTable/index.tsx
|
|
138
|
-
var
|
|
146
|
+
var React69 = __toESM(require("react"));
|
|
139
147
|
|
|
140
148
|
// src/utils/join.ts
|
|
141
149
|
var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
|
|
@@ -249,6 +257,18 @@ var DeepMap = class {
|
|
|
249
257
|
);
|
|
250
258
|
return result;
|
|
251
259
|
}
|
|
260
|
+
getEntriesStartingWith(keys, excludeSelf, depthLimit) {
|
|
261
|
+
const result = [];
|
|
262
|
+
this.getStartingWith(
|
|
263
|
+
keys,
|
|
264
|
+
(keys2, value) => {
|
|
265
|
+
result.push([keys2, value]);
|
|
266
|
+
},
|
|
267
|
+
excludeSelf,
|
|
268
|
+
depthLimit
|
|
269
|
+
);
|
|
270
|
+
return result;
|
|
271
|
+
}
|
|
252
272
|
getKeysStartingWith(keys, excludeSelf, depthLimit) {
|
|
253
273
|
const result = [];
|
|
254
274
|
this.getStartingWith(
|
|
@@ -936,16 +956,16 @@ var setupResizeObserver = (node, callback, config = { debounce: 0 }) => {
|
|
|
936
956
|
const onResizeCallback = debounceTime ? debounce(callback, { wait: debounceTime }) : callback;
|
|
937
957
|
const observer = new RO((entries) => {
|
|
938
958
|
const entry = entries[0];
|
|
939
|
-
let { width, height } = entry.contentRect;
|
|
959
|
+
let { width, height: height2 } = entry.contentRect;
|
|
940
960
|
if (entry.borderBoxSize?.[0]) {
|
|
941
|
-
|
|
961
|
+
height2 = entry.borderBoxSize[0].blockSize;
|
|
942
962
|
width = entry.borderBoxSize[0].inlineSize;
|
|
943
963
|
} else {
|
|
944
964
|
const rect = node.getBoundingClientRect();
|
|
945
|
-
|
|
965
|
+
height2 = rect.height;
|
|
946
966
|
width = rect.width;
|
|
947
967
|
}
|
|
948
|
-
onResizeCallback({ width, height });
|
|
968
|
+
onResizeCallback({ width, height: height2 });
|
|
949
969
|
});
|
|
950
970
|
observer.observe(node);
|
|
951
971
|
return () => {
|
|
@@ -1016,10 +1036,10 @@ var WRAPPER_STYLE = {
|
|
|
1016
1036
|
var useCSSVariableWatch = (params) => {
|
|
1017
1037
|
const lastValueRef = (0, import_react2.useRef)(0);
|
|
1018
1038
|
const onResize = React2.useCallback(
|
|
1019
|
-
({ height }) => {
|
|
1020
|
-
if (
|
|
1021
|
-
lastValueRef.current =
|
|
1022
|
-
params.onChange(
|
|
1039
|
+
({ height: height2 }) => {
|
|
1040
|
+
if (height2 != null && height2 !== lastValueRef.current) {
|
|
1041
|
+
lastValueRef.current = height2;
|
|
1042
|
+
params.onChange(height2);
|
|
1023
1043
|
}
|
|
1024
1044
|
},
|
|
1025
1045
|
[params.onChange]
|
|
@@ -1044,7 +1064,7 @@ var CSSNumericVariableWatch = (props) => {
|
|
|
1044
1064
|
...props,
|
|
1045
1065
|
ref: domRef
|
|
1046
1066
|
});
|
|
1047
|
-
const
|
|
1067
|
+
const height2 = props.varName.startsWith("var(") ? props.varName : `var(${props.varName})`;
|
|
1048
1068
|
const { allowInts = false } = props;
|
|
1049
1069
|
return /* @__PURE__ */ React2.createElement(
|
|
1050
1070
|
"div",
|
|
@@ -1058,7 +1078,7 @@ var CSSNumericVariableWatch = (props) => {
|
|
|
1058
1078
|
{
|
|
1059
1079
|
ref: domRef,
|
|
1060
1080
|
style: {
|
|
1061
|
-
height: allowInts ? `calc(1px * ${
|
|
1081
|
+
height: allowInts ? `calc(1px * ${height2})` : height2
|
|
1062
1082
|
// we do multiplication in order to support integer (without px) values as well
|
|
1063
1083
|
}
|
|
1064
1084
|
}
|
|
@@ -1120,9 +1140,9 @@ var import_react10 = require("react");
|
|
|
1120
1140
|
// src/components/VirtualList/SpacePlaceholder.tsx
|
|
1121
1141
|
var React6 = __toESM(require("react"));
|
|
1122
1142
|
function SpacePlaceholderFn(props) {
|
|
1123
|
-
const { height, width, count } = props;
|
|
1143
|
+
const { height: height2, width, count } = props;
|
|
1124
1144
|
const style2 = {
|
|
1125
|
-
height,
|
|
1145
|
+
height: height2,
|
|
1126
1146
|
width,
|
|
1127
1147
|
zIndex: -1,
|
|
1128
1148
|
opacity: 0,
|
|
@@ -1134,7 +1154,7 @@ function SpacePlaceholderFn(props) {
|
|
|
1134
1154
|
{
|
|
1135
1155
|
"data-count": count,
|
|
1136
1156
|
"data-placeholder-width": false ? width : void 0,
|
|
1137
|
-
"data-placeholder-height": false ?
|
|
1157
|
+
"data-placeholder-height": false ? height2 : void 0,
|
|
1138
1158
|
"data-name": "SpacePlaceholder",
|
|
1139
1159
|
style: style2
|
|
1140
1160
|
}
|
|
@@ -1354,7 +1374,8 @@ var internalProps = {
|
|
|
1354
1374
|
var InternalVars = { currentColumnTransformX: "var(--currentColumnTransformX__16hkbkc0)", y: "var(--y__16hkbkc1)", currentFlashingBackground: "var(--currentFlashingBackground__16hkbkc2)", currentFlashingDuration: "var(--currentFlashingDuration__16hkbkc3)", activeCellRowOffset: "var(--activeCellRowOffset__16hkbkc4)", activeCellRowOffsetX: "var(--activeCellRowOffsetX__16hkbkc5)", activeCellRowHeight: "var(--activeCellRowHeight__16hkbkc6)", activeCellOffsetX: "var(--activeCellOffsetX__16hkbkc7)", activeCellOffsetY: "var(--activeCellOffsetY__16hkbkc8)", scrollTopForActiveRow: "var(--scrollTopForActiveRow__16hkbkc9)", scrollLeftForActiveRowWhenHorizontalLayout: "var(--scrollLeftForActiveRowWhenHorizontalLayout__16hkbkca)", activeCellColWidth: "var(--activeCellColWidth__16hkbkcb)", activeCellColOffset: "var(--activeCellColOffset__16hkbkcc)", columnReorderEffectDurationAtIndex: "var(--columnReorderEffectDurationAtIndex__16hkbkcd)", columnWidthAtIndex: "var(--columnWidthAtIndex__16hkbkce)", columnOffsetAtIndex: "var(--columnOffsetAtIndex__16hkbkcf)", columnOffsetAtIndexWhileReordering: "var(--columnOffsetAtIndexWhileReordering__16hkbkcg)", columnZIndexAtIndex: "var(--columnZIndexAtIndex__16hkbkch)", pinnedStartWidth: "var(--pinnedStartWidth__16hkbkci)", pinnedEndWidth: "var(--pinnedEndWidth__16hkbkcj)", pinnedEndOffset: "var(--pinnedEndOffset__16hkbkck)", computedVisibleColumnsCount: "var(--computedVisibleColumnsCount__16hkbkcl)", baseZIndexForCells: "var(--baseZIndexForCells__16hkbkcm)", bodyWidth: "var(--bodyWidth__16hkbkcn)", bodyHeight: "var(--bodyHeight__16hkbkco)", scrollbarWidthHorizontal: "var(--scrollbarWidthHorizontal__16hkbkcp)", scrollbarWidthVertical: "var(--scrollbarWidthVertical__16hkbkcq)", scrollLeft: "var(--scrollLeft__16hkbkcr)", scrollTop: "var(--scrollTop__16hkbkcs)" };
|
|
1355
1375
|
|
|
1356
1376
|
// src/components/InfiniteTable/vars.css.ts
|
|
1357
|
-
var
|
|
1377
|
+
var CSS_LOADED_VALUE = "true";
|
|
1378
|
+
var ThemeVars = { loaded: "var(--infinite-loaded)", color: { accent: "var(--infinite-accent-color)", success: "var(--infinite-success-color)", error: "var(--infinite-error-color)", color: "var(--infinite-color)" }, spacing: { "0": "var(--infinite-space-0)", "1": "var(--infinite-space-1)", "2": "var(--infinite-space-2)", "3": "var(--infinite-space-3)", "4": "var(--infinite-space-4)", "5": "var(--infinite-space-5)", "6": "var(--infinite-space-6)", "7": "var(--infinite-space-7)", "8": "var(--infinite-space-8)", "9": "var(--infinite-space-9)", "10": "var(--infinite-space-10)" }, fontSize: { "0": "var(--infinite-font-size-0)", "1": "var(--infinite-font-size-1)", "2": "var(--infinite-font-size-2)", "3": "var(--infinite-font-size-3)", "4": "var(--infinite-font-size-4)", "5": "var(--infinite-font-size-5)", "6": "var(--infinite-font-size-6)", "7": "var(--infinite-font-size-7)" }, fontFamily: "var(--infinite-font-family)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", background: "var(--infinite-background)", iconSize: "var(--infinite-icon-size)", runtime: { bodyWidth: "var(--infinite-runtime-body-content-width)", totalVisibleColumnsWidthValue: "var(--infinite-runtime-total-visible-columns-width)", totalVisibleColumnsWidthVar: "var(--infinite-runtime-total-visible-columns-width-var)", visibleColumnsCount: "var(--infinite-runtime-visible-columns-count)", browserScrollbarWidth: "var(--infinite-runtime-browser-scrollbar-width)" }, components: { LoadMask: { padding: "var(--infinite-load-mask-padding)", color: "var(--infinite-load-mask-color)", textBackground: "var(--infinite-load-mask-text-background)", overlayBackground: "var(--infinite-load-mask-overlay-background)", overlayOpacity: "var(--infinite-load-mask-overlay-opacity)", borderRadius: "var(--infinite-load-mask-border-radius)" }, Header: { background: "var(--infinite-header-background)", color: "var(--infinite-header-color)", columnHeaderHeight: "var(--infinite-column-header-height)" }, HeaderCell: { background: "var(--infinite-header-cell-background)", hoverBackground: "var(--infinite-header-cell-hover-background)", border: "var(--infinite-header-cell-border)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", menuIconLineWidth: "var(--infinite-header-cell-menu-icon-line-width)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)", borderRight: "var(--infinite-header-cell-border-right)", resizeHandleActiveAreaWidth: "var(--infinite-resize-handle-active-area-width)", resizeHandleWidth: "var(--infinite-resize-handle-width)", resizeHandleHoverBackground: "var(--infinite-resize-handle-hover-background)", resizeHandleConstrainedHoverBackground: "var(--infinite-resize-handle-constrained-hover-background)", filterOperatorPaddingX: "var(--infinite-filter-operator-padding-x)", filterEditorPaddingX: "var(--infinite-filter-editor-padding-x)", filterEditorMarginX: "var(--infinite-filter-editor-margin-x)", filterOperatorPaddingY: "var(--infinite-filter-operator-padding-y)", filterEditorPaddingY: "var(--infinite-filter-editor-padding-y)", filterEditorMarginY: "var(--infinite-filter-editor-margin-y)", filterEditorBackground: "var(--infinite-filter-editor-background)", filterEditorBorder: "var(--infinite-filter-editor-border)", filterEditorFocusBorderColor: "var(--infinite-filter-editor-focus-border-color)", filterEditorBorderRadius: "var(--infinite-filter-editor-border-radius)", filterEditorColor: "var(--infinite-filter-editor-color)" }, ActiveCellIndicator: { inset: "var(--infinite-active-cell-indicator-inset)" }, Cell: { flashingDuration: "var(--infinite-flashing-duration)", flashingAnimationName: "var(--infinite-flashing-animation-name)", flashingOverlayZIndex: "var(--infinite-flashing-overlay-z-index)", flashingBackground: "var(--infinite-flashing-background)", flashingUpBackground: "var(--infinite-flashing-up-background)", flashingDownBackground: "var(--infinite-flashing-down-background)", padding: "var(--infinite-cell-padding)", borderWidth: "var(--infinite-cell-border-width)", border: "var(--infinite-cell-border)", borderLeft: "var(--infinite-cell-border-left)", borderRight: "var(--infinite-cell-border-right)", borderTop: "var(--infinite-cell-border-top)", borderInvisible: "var(--infinite-cell-border-invisible)", borderRadius: "var(--infinite-cell-border-radius)", reorderEffectDuration: "var(--infinite-column-reorder-effect-duration)", pinnedBorder: "var(--infinite-pinned-cell-border)", horizontalLayoutColumnReorderDisabledPageOpacity: "var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)", color: "var(--infinite-cell-color)", selectedBackground: "var(--infinite-selected-cell-background)", selectedBackgroundDefault: "var(--infinite-selected-cell-background-default)", selectedBackgroundAlpha: "var(--infinite-selected-cell-background-alpha)", selectedBackgroundAlphaWhenTableUnfocused: "var(--infinite-selected-cell-background-alpha--table-unfocused)", selectedBorderColor: "var(--infinite-selected-cell-border-color)", selectedBorderWidth: "var(--infinite-selected-cell-border-width)", selectedBorderStyle: "var(--infinite-selected-cell-border-style)", selectedBorder: "var(--infinite-selected-cell-border)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBackgroundDefault: "var(--infinite-active-cell-background-default)", activeBorderColor: "var(--infinite-active-cell-border-color)", activeBorderWidth: "var(--infinite-active-cell-border-width)", activeBorderStyle: "var(--infinite-active-cell-border-style)", activeBorder: "var(--infinite-active-cell-border)" }, SelectionCheckBox: { marginInline: "var(--infinite-selection-checkbox-margin-inline)" }, Menu: { background: "var(--infinite-menu-background)", color: "var(--infinite-menu-color)", separatorColor: "var(--infinite-menu-separator-color)", padding: "var(--infinite-menu-padding)", cellPaddingVertical: "var(--infinite-menu-cell-padding-vertical)", cellPaddingHorizontal: "var(--infinite-menu-cell-padding-horizontal)", cellMarginVertical: "var(--infinite-menu-cell-margin-vertical)", itemDisabledBackground: "var(--infinite-menu-item-disabled-background)", itemActiveBackground: "var(--infinite-menu-item-active-background)", itemActiveOpacity: "var(--infinite-menu-item-active-opacity)", itemPressedOpacity: "var(--infinite-menu-item-pressed-opacity)", itemPressedBackground: "var(--infinite-menu-item-pressed-background)", itemDisabledOpacity: "var(--infinite-menu-item-disabled-opacity)", borderRadius: "var(--infinite-menu-border-radius)", shadowColor: "var(--infinite-menu-shadow-color)" }, RowDetail: { background: "var(--infinite-rowdetail-background)", padding: "var(--infinite-rowdetail-padding)", gridHeight: "var(--infinite-rowdetail-grid-height)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", disabledBackground: "var(--infinite-row-disabled-background)", oddDisabledBackground: "var(--infinite-row-odd-disabled-background)", selectedBackground: "var(--infinite-row-selected-background)", disabledOpacity: "var(--infinite-row-disabled-opacity)", activeBackground: "var(--infinite-active-row-background)", activeBorderColor: "var(--infinite-active-row-border-color)", activeBorderWidth: "var(--infinite-active-row-border-width)", activeBorderStyle: "var(--infinite-active-row-border-style)", activeBorder: "var(--infinite-active-row-border)", activeBackgroundAlpha: "var(--infinite-active-row-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-row-background-alpha--table-unfocused)", hoverBackground: "var(--infinite-row-hover-background)", selectedHoverBackground: "var(--infinite-row-selected-hover-background)", selectedDisabledBackground: "var(--infinite-row-selected-disabled-background)", groupRowBackground: "var(--infinite-group-row-background)", groupRowColumnNesting: "var(--infinite-group-row-column-nesting)", groupNesting: "var(--infinite-dont-override-group-row-nesting-length)", pointerEventsWhileScrolling: "var(--infinite-row-pointer-events-while-scrolling)" }, ColumnCell: { background: "var(--infinite-column-cell-bg-dont-override)" } } };
|
|
1358
1379
|
var columnHeaderHeightName = "column-header-height";
|
|
1359
1380
|
|
|
1360
1381
|
// src/components/InfiniteTable/utils/infiniteDOMUtils.ts
|
|
@@ -1516,7 +1537,41 @@ var ALL_DIRECTIONS = {
|
|
|
1516
1537
|
vertical: true
|
|
1517
1538
|
};
|
|
1518
1539
|
|
|
1540
|
+
// src/components/VirtualBrain/getGreatestCountVisibleInSize.ts
|
|
1541
|
+
function getGreatestCountVisibleInSize(availableSize, itemSizes) {
|
|
1542
|
+
const len = itemSizes.length;
|
|
1543
|
+
if (!len) {
|
|
1544
|
+
return 0;
|
|
1545
|
+
}
|
|
1546
|
+
let maxCount = -1;
|
|
1547
|
+
for (let start = 0; start < len; start++) {
|
|
1548
|
+
let sum2 = 0;
|
|
1549
|
+
let count = 0;
|
|
1550
|
+
if (len - start <= maxCount) {
|
|
1551
|
+
break;
|
|
1552
|
+
}
|
|
1553
|
+
for (let i = start; i < len; i++) {
|
|
1554
|
+
sum2 += itemSizes[i];
|
|
1555
|
+
count++;
|
|
1556
|
+
if (sum2 > availableSize) {
|
|
1557
|
+
if (count > maxCount) {
|
|
1558
|
+
maxCount = count;
|
|
1559
|
+
}
|
|
1560
|
+
break;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
return maxCount < 0 ? len : Math.min(maxCount, len);
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1519
1567
|
// src/components/VirtualBrain/MatrixBrain.ts
|
|
1568
|
+
var DEFAULT_EXTEND_BY = {
|
|
1569
|
+
start: 0,
|
|
1570
|
+
end: 0
|
|
1571
|
+
};
|
|
1572
|
+
var immediateCallback = (fn) => {
|
|
1573
|
+
fn();
|
|
1574
|
+
};
|
|
1520
1575
|
var getRenderRangeCellCount = (range) => {
|
|
1521
1576
|
const { start, end } = range;
|
|
1522
1577
|
const [startRow, startCol] = start;
|
|
@@ -1541,6 +1596,8 @@ var MatrixBrain = class extends Logger {
|
|
|
1541
1596
|
const logName = `MatrixBrain${name ? `:${name}` : ""}`;
|
|
1542
1597
|
super(logName);
|
|
1543
1598
|
this.scrolling = false;
|
|
1599
|
+
this.RENDER_COUNT_SAFETY_MARGIN_START = 1;
|
|
1600
|
+
this.RENDER_COUNT_SAFETY_MARGIN_END = 1;
|
|
1544
1601
|
this.availableWidth = 0;
|
|
1545
1602
|
this.availableRenderWidth = 0;
|
|
1546
1603
|
this.isHorizontalLayoutBrain = false;
|
|
@@ -1557,14 +1614,8 @@ var MatrixBrain = class extends Logger {
|
|
|
1557
1614
|
this.horizontalTotalSize = 0;
|
|
1558
1615
|
this.horizontalRenderCount = void 0;
|
|
1559
1616
|
this.verticalRenderCount = void 0;
|
|
1560
|
-
this.horizontalExtendRangeBy =
|
|
1561
|
-
|
|
1562
|
-
end: 0
|
|
1563
|
-
};
|
|
1564
|
-
this.verticalExtendRangeBy = {
|
|
1565
|
-
start: 0,
|
|
1566
|
-
end: 0
|
|
1567
|
-
};
|
|
1617
|
+
this.horizontalExtendRangeBy = DEFAULT_EXTEND_BY;
|
|
1618
|
+
this.verticalExtendRangeBy = DEFAULT_EXTEND_BY;
|
|
1568
1619
|
this.horizontalRenderRange = {
|
|
1569
1620
|
startIndex: 0,
|
|
1570
1621
|
endIndex: 0
|
|
@@ -1670,14 +1721,15 @@ var MatrixBrain = class extends Logger {
|
|
|
1670
1721
|
});
|
|
1671
1722
|
});
|
|
1672
1723
|
};
|
|
1673
|
-
this.notifyVerticalRenderRangeChange = () => {
|
|
1724
|
+
this.notifyVerticalRenderRangeChange = (immediate = false) => {
|
|
1674
1725
|
if (this.destroyed) {
|
|
1675
1726
|
return;
|
|
1676
1727
|
}
|
|
1677
1728
|
const fns = this.onVerticalRenderRangeChangeFns;
|
|
1678
1729
|
const range = this.verticalRenderRange;
|
|
1730
|
+
const callback = immediate ? immediateCallback : raf2;
|
|
1679
1731
|
fns.forEach((fn) => {
|
|
1680
|
-
|
|
1732
|
+
callback(() => {
|
|
1681
1733
|
if (this.destroyed) {
|
|
1682
1734
|
return;
|
|
1683
1735
|
}
|
|
@@ -1687,14 +1739,15 @@ var MatrixBrain = class extends Logger {
|
|
|
1687
1739
|
});
|
|
1688
1740
|
});
|
|
1689
1741
|
};
|
|
1690
|
-
this.notifyHorizontalRenderRangeChange = () => {
|
|
1742
|
+
this.notifyHorizontalRenderRangeChange = (immediate = false) => {
|
|
1691
1743
|
if (this.destroyed) {
|
|
1692
1744
|
return;
|
|
1693
1745
|
}
|
|
1694
1746
|
const fns = this.onHorizontalRenderRangeChangeFns;
|
|
1695
1747
|
const range = this.horizontalRenderRange;
|
|
1748
|
+
const callback = immediate ? immediateCallback : raf2;
|
|
1696
1749
|
fns.forEach((fn) => {
|
|
1697
|
-
|
|
1750
|
+
callback(() => {
|
|
1698
1751
|
if (this.destroyed) {
|
|
1699
1752
|
return;
|
|
1700
1753
|
}
|
|
@@ -1794,7 +1847,7 @@ var MatrixBrain = class extends Logger {
|
|
|
1794
1847
|
return [];
|
|
1795
1848
|
}
|
|
1796
1849
|
const { scrollTop: scrollTop2 } = this.scrollPosition;
|
|
1797
|
-
const { height } = this.getAvailableSize();
|
|
1850
|
+
const { height: height2 } = this.getAvailableSize();
|
|
1798
1851
|
const offsets = [];
|
|
1799
1852
|
const heights = [];
|
|
1800
1853
|
let sum2 = 0;
|
|
@@ -1803,7 +1856,7 @@ var MatrixBrain = class extends Logger {
|
|
|
1803
1856
|
heights.push(rowHeight);
|
|
1804
1857
|
sum2 += rowHeight;
|
|
1805
1858
|
}
|
|
1806
|
-
const baseOffset =
|
|
1859
|
+
const baseOffset = height2 - sum2 + (skipScroll ? 0 : scrollTop2);
|
|
1807
1860
|
sum2 = 0;
|
|
1808
1861
|
let index = 0;
|
|
1809
1862
|
for (let rowIndex = this.rows - this.fixedRowsEnd; rowIndex < this.rows; rowIndex++) {
|
|
@@ -1970,6 +2023,7 @@ var MatrixBrain = class extends Logger {
|
|
|
1970
2023
|
};
|
|
1971
2024
|
};
|
|
1972
2025
|
this.computeDirectionalRenderRange = (direction) => {
|
|
2026
|
+
const itemSize = direction === "horizontal" ? this.colWidth : this.rowHeight;
|
|
1973
2027
|
let renderCount = direction === "horizontal" ? this.horizontalRenderCount : this.verticalRenderCount;
|
|
1974
2028
|
const count = direction === "horizontal" ? this.cols : this.rows;
|
|
1975
2029
|
if (!renderCount) {
|
|
@@ -1981,14 +2035,21 @@ var MatrixBrain = class extends Logger {
|
|
|
1981
2035
|
const fixedStartIndex = (direction === "horizontal" ? this.fixedColsStart : this.fixedRowsStart) || 0;
|
|
1982
2036
|
let scrollPositionForDirection = direction === "horizontal" ? this.scrollPosition.scrollLeft : this.scrollPosition.scrollTop;
|
|
1983
2037
|
scrollPositionForDirection += this.getFixedStartSize(direction);
|
|
2038
|
+
const isItemSizeConstant = typeof itemSize !== "function";
|
|
1984
2039
|
const extendBy = direction === "horizontal" ? this.horizontalExtendRangeBy : this.verticalExtendRangeBy;
|
|
1985
2040
|
let startIndex = this.getItemAt(scrollPositionForDirection, direction);
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
2041
|
+
let extendByStart = extendBy.start || 0;
|
|
2042
|
+
let extendByEnd = extendBy.end || 0;
|
|
2043
|
+
if (!isItemSizeConstant) {
|
|
2044
|
+
extendByStart += this.RENDER_COUNT_SAFETY_MARGIN_START;
|
|
2045
|
+
extendByEnd += this.RENDER_COUNT_SAFETY_MARGIN_END;
|
|
1989
2046
|
}
|
|
1990
|
-
if (
|
|
1991
|
-
|
|
2047
|
+
if (extendByStart) {
|
|
2048
|
+
startIndex = Math.max(0, startIndex - extendByStart);
|
|
2049
|
+
renderCount += extendByStart;
|
|
2050
|
+
}
|
|
2051
|
+
if (extendByEnd) {
|
|
2052
|
+
renderCount += extendByEnd;
|
|
1992
2053
|
}
|
|
1993
2054
|
let endIndex = startIndex + renderCount;
|
|
1994
2055
|
const theEnd = Math.max(
|
|
@@ -2543,14 +2604,15 @@ var MatrixBrain = class extends Logger {
|
|
|
2543
2604
|
this.notifyScrollChange();
|
|
2544
2605
|
}
|
|
2545
2606
|
}
|
|
2546
|
-
notifyRenderRangeChange() {
|
|
2607
|
+
notifyRenderRangeChange(immediate = false) {
|
|
2547
2608
|
if (this.destroyed) {
|
|
2548
2609
|
return;
|
|
2549
2610
|
}
|
|
2550
2611
|
const fns = this.onRenderRangeChangeFns;
|
|
2551
2612
|
const range = this.getRenderRange();
|
|
2613
|
+
const callback = immediate ? immediateCallback : raf2;
|
|
2552
2614
|
fns.forEach((fn) => {
|
|
2553
|
-
|
|
2615
|
+
callback(() => {
|
|
2554
2616
|
if (this.destroyed) {
|
|
2555
2617
|
return;
|
|
2556
2618
|
}
|
|
@@ -2582,16 +2644,7 @@ var MatrixBrain = class extends Logger {
|
|
|
2582
2644
|
for (let i = 0; i < count; i++) {
|
|
2583
2645
|
sizes.push(this.getItemSize(i, direction));
|
|
2584
2646
|
}
|
|
2585
|
-
sizes
|
|
2586
|
-
let sum2 = 0;
|
|
2587
|
-
for (let i = 0; i < count; i++) {
|
|
2588
|
-
sum2 += sizes[i];
|
|
2589
|
-
renderCount++;
|
|
2590
|
-
if (sum2 > size) {
|
|
2591
|
-
break;
|
|
2592
|
-
}
|
|
2593
|
-
}
|
|
2594
|
-
renderCount += 1;
|
|
2647
|
+
renderCount = getGreatestCountVisibleInSize(size, sizes);
|
|
2595
2648
|
} else {
|
|
2596
2649
|
renderCount = (itemSize ? Math.ceil(size / itemSize) : 0) + 1;
|
|
2597
2650
|
}
|
|
@@ -2712,8 +2765,8 @@ var MatrixBrain = class extends Logger {
|
|
|
2712
2765
|
this.rowspanParent.clear();
|
|
2713
2766
|
this.colspanParent.clear();
|
|
2714
2767
|
this.alwaysRenderedColumns.clear();
|
|
2715
|
-
this.horizontalExtendRangeBy =
|
|
2716
|
-
this.verticalExtendRangeBy =
|
|
2768
|
+
this.horizontalExtendRangeBy = DEFAULT_EXTEND_BY;
|
|
2769
|
+
this.verticalExtendRangeBy = DEFAULT_EXTEND_BY;
|
|
2717
2770
|
this.destroyed = true;
|
|
2718
2771
|
this.onDestroyFns = [];
|
|
2719
2772
|
this.onScrollFns = [];
|
|
@@ -4169,12 +4222,12 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
4169
4222
|
return;
|
|
4170
4223
|
}
|
|
4171
4224
|
const covered = false;
|
|
4172
|
-
const
|
|
4225
|
+
const height2 = this.brain.getRowHeight(rowIndex);
|
|
4173
4226
|
const rowFixed = this.brain.isRowFixedStart(rowIndex) ? "start" : this.brain.isRowFixedEnd(rowIndex) ? "end" : false;
|
|
4174
4227
|
const hidden = !!covered;
|
|
4175
4228
|
const renderedDetailNode = renderDetailRow({
|
|
4176
4229
|
rowIndex,
|
|
4177
|
-
height,
|
|
4230
|
+
height: height2,
|
|
4178
4231
|
rowFixed,
|
|
4179
4232
|
hidden,
|
|
4180
4233
|
onMouseEnter: () => {
|
|
@@ -4215,11 +4268,11 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
4215
4268
|
return;
|
|
4216
4269
|
}
|
|
4217
4270
|
const covered = this.isCellCovered(rowIndex, colIndex);
|
|
4218
|
-
const
|
|
4271
|
+
const height2 = this.brain.getRowHeight(rowIndex);
|
|
4219
4272
|
const width = this.brain.getColWidth(colIndex);
|
|
4220
4273
|
const rowspan = this.brain.getRowspan(rowIndex, colIndex);
|
|
4221
4274
|
const colspan = this.brain.getColspan(rowIndex, colIndex);
|
|
4222
|
-
const heightWithRowspan = rowspan === 1 ?
|
|
4275
|
+
const heightWithRowspan = rowspan === 1 ? height2 : this.brain.getRowHeightWithSpan(rowIndex, colIndex, rowspan);
|
|
4223
4276
|
const widthWithColspan = colspan === 1 ? width : this.brain.getColWidthWithSpan(rowIndex, colIndex, colspan);
|
|
4224
4277
|
const { row: rowFixed, col: colFixed } = this.isCellFixed(
|
|
4225
4278
|
rowIndex,
|
|
@@ -4230,7 +4283,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
4230
4283
|
const renderedNode = renderCell({
|
|
4231
4284
|
rowIndex: renderRowIndex,
|
|
4232
4285
|
colIndex: renderColIndex,
|
|
4233
|
-
height,
|
|
4286
|
+
height: height2,
|
|
4234
4287
|
width,
|
|
4235
4288
|
rowspan,
|
|
4236
4289
|
colspan,
|
|
@@ -4364,7 +4417,7 @@ function createRenderer(brain) {
|
|
|
4364
4417
|
|
|
4365
4418
|
// src/components/HeadlessTable/RawTable.tsx
|
|
4366
4419
|
function RawTableFn(props) {
|
|
4367
|
-
const { brain, renderCell, renderDetailRow } = props;
|
|
4420
|
+
const { brain, renderCell, renderDetailRow, forceRerenderTimestamp } = props;
|
|
4368
4421
|
const { renderer, onRenderUpdater } = (0, import_react6.useMemo)(() => {
|
|
4369
4422
|
return props.onRenderUpdater && props.renderer ? {
|
|
4370
4423
|
renderer: props.renderer,
|
|
@@ -4382,7 +4435,14 @@ function RawTableFn(props) {
|
|
|
4382
4435
|
renderCell,
|
|
4383
4436
|
renderDetailRow
|
|
4384
4437
|
});
|
|
4385
|
-
}, [
|
|
4438
|
+
}, [
|
|
4439
|
+
renderer,
|
|
4440
|
+
brain,
|
|
4441
|
+
renderCell,
|
|
4442
|
+
renderDetailRow,
|
|
4443
|
+
onRenderUpdater,
|
|
4444
|
+
forceRerenderTimestamp
|
|
4445
|
+
]);
|
|
4386
4446
|
(0, import_react6.useEffect)(() => {
|
|
4387
4447
|
const remove = brain.onRenderRangeChange((renderRange) => {
|
|
4388
4448
|
renderer.renderRange(renderRange, {
|
|
@@ -4531,10 +4591,10 @@ var createRuntimeFn = (config) => {
|
|
|
4531
4591
|
|
|
4532
4592
|
// src/components/InfiniteTable/components/ActiveCellIndicator.css.ts
|
|
4533
4593
|
var ActiveCellIndicatorRecipe = createRuntimeFn({ defaultClassName: "ActiveCellIndicator_ActiveCellIndicator__nxbq1c1 utilities_pointerEvents_none__16lm1iwl utilities_position_absolute__16lm1iw2", variantClassNames: { visible: { true: "ActiveCellIndicator_ActiveCellIndicatorRecipe_visible_true__nxbq1c3", false: "ActiveCellIndicator_ActiveCellIndicatorRecipe_visible_false__nxbq1c4" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4534
|
-
var ActiveIndicatorWrapperCls = "ActiveCellIndicator_ActiveIndicatorWrapperCls__nxbq1c0 utilities_pointerEvents_none__16lm1iwl utilities_position_sticky__16lm1iw4
|
|
4594
|
+
var ActiveIndicatorWrapperCls = "ActiveCellIndicator_ActiveIndicatorWrapperCls__nxbq1c0 utilities_pointerEvents_none__16lm1iwl utilities_position_sticky__16lm1iw4 utilities_left_0__16lm1iw1f utilities_top_0__16lm1iw1d utilities_height_0__16lm1iw18 utilities_zIndex_1000000__16lm1iwu";
|
|
4535
4595
|
|
|
4536
4596
|
// src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
|
|
4537
|
-
var ActiveRowIndicatorRecipe = createRuntimeFn({ defaultClassName: "ActiveRowIndicator_ActiveRowIndicator__j26lrx0 utilities_pointerEvents_none__16lm1iwl utilities_position_absolute__16lm1iw2
|
|
4597
|
+
var ActiveRowIndicatorRecipe = createRuntimeFn({ defaultClassName: "ActiveRowIndicator_ActiveRowIndicator__j26lrx0 utilities_pointerEvents_none__16lm1iwl utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1d utilities_left_0__16lm1iw1f", variantClassNames: { active: { true: "ActiveRowIndicator_ActiveRowIndicatorRecipe_active_true__j26lrx2", false: "ActiveRowIndicator_ActiveRowIndicatorRecipe_active_false__j26lrx3" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4538
4598
|
|
|
4539
4599
|
// src/components/InfiniteTable/components/ActiveRowIndicator.tsx
|
|
4540
4600
|
var { rootClassName: rootClassName3 } = internalProps;
|
|
@@ -4721,6 +4781,7 @@ function HeadlessTable(props) {
|
|
|
4721
4781
|
activeCellIndex,
|
|
4722
4782
|
onRenderUpdater,
|
|
4723
4783
|
wrapRowsHorizontally,
|
|
4784
|
+
forceRerenderTimestamp,
|
|
4724
4785
|
...domProps
|
|
4725
4786
|
} = props;
|
|
4726
4787
|
const { autoFocus } = domProps;
|
|
@@ -4788,6 +4849,7 @@ function HeadlessTable(props) {
|
|
|
4788
4849
|
/* @__PURE__ */ React13.createElement(
|
|
4789
4850
|
RawTable,
|
|
4790
4851
|
{
|
|
4852
|
+
forceRerenderTimestamp,
|
|
4791
4853
|
renderer,
|
|
4792
4854
|
onRenderUpdater,
|
|
4793
4855
|
renderCell,
|
|
@@ -4993,7 +5055,7 @@ function buildManagedComponent(config) {
|
|
|
4993
5055
|
});
|
|
4994
5056
|
const propsToStateSetRef = (0, import_react14.useRef)(/* @__PURE__ */ new Set());
|
|
4995
5057
|
const propsToForward = (0, import_react14.useMemo)(
|
|
4996
|
-
() => config.forwardProps ? config.forwardProps(initialSetupState) : {},
|
|
5058
|
+
() => config.forwardProps ? config.forwardProps(initialSetupState, props) : {},
|
|
4997
5059
|
[initialSetupState]
|
|
4998
5060
|
);
|
|
4999
5061
|
const parentState = useParentStateFn();
|
|
@@ -5041,7 +5103,7 @@ function buildManagedComponent(config) {
|
|
|
5041
5103
|
const parentState2 = getParentState?.() ?? null;
|
|
5042
5104
|
const mappedState = action.payload.mappedState;
|
|
5043
5105
|
const updatedProps = action.payload.updatedPropsToState;
|
|
5044
|
-
const newState =
|
|
5106
|
+
const newState = { ...previousState };
|
|
5045
5107
|
if (mappedState) {
|
|
5046
5108
|
Object.assign(newState, mappedState);
|
|
5047
5109
|
}
|
|
@@ -5239,22 +5301,23 @@ var useInternalProps = () => {
|
|
|
5239
5301
|
};
|
|
5240
5302
|
|
|
5241
5303
|
// src/components/InfiniteTable/utilities.css.ts
|
|
5242
|
-
var absoluteCover = "utilities_position_absolute__16lm1iw2
|
|
5243
|
-
var alignItems = { center: "
|
|
5244
|
-
var cssEllipsisClassName = "
|
|
5304
|
+
var absoluteCover = "utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1d utilities_left_0__16lm1iw1f utilities_right_0__16lm1iw1k utilities_bottom_0__16lm1iw1i";
|
|
5305
|
+
var alignItems = { center: "utilities_alignItems_center__16lm1iw1r", stretch: "utilities_alignItems_stretch__16lm1iw1s" };
|
|
5306
|
+
var cssEllipsisClassName = "utilities_whiteSpace_nowrap__16lm1iw24 utilities_textOverflow_ellipsis__16lm1iw25 utilities_overflow_hidden__16lm1iw1y";
|
|
5245
5307
|
var cursor = { pointer: "utilities_cursor_pointer__16lm1iwi", "default": "utilities_cursor_default__16lm1iwj", colResize: "utilities_cursor_colResize__16lm1iwk" };
|
|
5246
5308
|
var display = { flex: "utilities_display_flex__16lm1iwz", contents: "utilities_display_contents__16lm1iw10", none: "utilities_display_none__16lm1iw11", block: "utilities_display_block__16lm1iw12", grid: "utilities_display_grid__16lm1iw13", inlineBlock: "utilities_display_inlineBlock__16lm1iw14", inlineFlex: "utilities_display_inlineFlex__16lm1iw15", inlineGrid: "utilities_display_inlineGrid__16lm1iw16" };
|
|
5247
5309
|
var flex = { "1": "utilities_flex_1__16lm1iwm", none: "utilities_flex_none__16lm1iwn" };
|
|
5248
|
-
var flexFlow = { column: "
|
|
5249
|
-
var
|
|
5250
|
-
var
|
|
5310
|
+
var flexFlow = { column: "utilities_flexFlow_column__16lm1iw1n", columnReverse: "utilities_flexFlow_columnReverse__16lm1iw1o", row: "utilities_flexFlow_row__16lm1iw1p", rowReverse: "utilities_flexFlow_rowReverse__16lm1iw1q" };
|
|
5311
|
+
var height = { "0": "utilities_height_0__16lm1iw18", "100%": "utilities_height_100%__16lm1iw19", "50%": "utilities_height_50%__16lm1iw1a" };
|
|
5312
|
+
var justifyContent = { center: "utilities_justifyContent_center__16lm1iw1t", spaceBetween: "utilities_justifyContent_spaceBetween__16lm1iw1u", spaceAround: "utilities_justifyContent_spaceAround__16lm1iw1v", start: "utilities_justifyContent_start__16lm1iw1w", end: "utilities_justifyContent_end__16lm1iw1x" };
|
|
5313
|
+
var left = { "0": "utilities_left_0__16lm1iw1f", "100%": "utilities_left_100%__16lm1iw1g", auto: "utilities_left_auto__16lm1iw1h" };
|
|
5251
5314
|
var outline = { none: "utilities_outline_none__16lm1iwd" };
|
|
5252
|
-
var overflow = { hidden: "
|
|
5315
|
+
var overflow = { hidden: "utilities_overflow_hidden__16lm1iw1y", auto: "utilities_overflow_auto__16lm1iw1z", visible: "utilities_overflow_visible__16lm1iw20" };
|
|
5253
5316
|
var position = { relative: "utilities_position_relative__16lm1iw1", absolute: "utilities_position_absolute__16lm1iw2", "static": "utilities_position_static__16lm1iw3", sticky: "utilities_position_sticky__16lm1iw4", fixed: "utilities_position_fixed__16lm1iw5" };
|
|
5254
|
-
var top = { "0": "
|
|
5317
|
+
var top = { "0": "utilities_top_0__16lm1iw1d", "100%": "utilities_top_100%__16lm1iw1e" };
|
|
5255
5318
|
var transformTranslateZero = "utilities_transformTranslateZero__16lm1iwe";
|
|
5256
5319
|
var userSelect = { none: "utilities_userSelect_none__16lm1iw17" };
|
|
5257
|
-
var visibility = { visible: "
|
|
5320
|
+
var visibility = { visible: "utilities_visibility_visible__16lm1iw21", hidden: "utilities_visibility_hidden__16lm1iw22" };
|
|
5258
5321
|
var zIndex = { "1": "utilities_zIndex_1__16lm1iwo", "10": "utilities_zIndex_10__16lm1iwp", "100": "utilities_zIndex_100__16lm1iwq", "1000": "utilities_zIndex_1000__16lm1iwr", "10000": "utilities_zIndex_10000__16lm1iws", "100000": "utilities_zIndex_100000__16lm1iwt", "1000000": "utilities_zIndex_1000000__16lm1iwu", "10000000": "utilities_zIndex_10000000__16lm1iwv", "1k": "utilities_zIndex_1k__16lm1iww", "10k": "utilities_zIndex_10k__16lm1iwx", "100k": "utilities_zIndex_100k__16lm1iwy" };
|
|
5259
5322
|
|
|
5260
5323
|
// src/components/InfiniteTable/components/InfiniteTableFooter/InfiniteTableFooter.tsx
|
|
@@ -5401,29 +5464,29 @@ var React26 = __toESM(require("react"));
|
|
|
5401
5464
|
var import_react18 = require("react");
|
|
5402
5465
|
|
|
5403
5466
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5404
|
-
var CellCls = "cell_CellCls__1eexc2a5 utilities_display_flex__16lm1iwz
|
|
5405
|
-
var HeaderCellContentRecipe = createRuntimeFn({ defaultClassName: "
|
|
5406
|
-
var HeaderCellProxy = "header_HeaderCellProxy__12zfob1n
|
|
5407
|
-
var HeaderCellRecipe = createRuntimeFn({ defaultClassName: "header_HeaderCellRecipe__12zfob1o utilities_display_block__16lm1iw12", variantClassNames: { rowActive: { false: "header_HeaderCellRecipe_rowActive_false__12zfob1p", true: "header_HeaderCellRecipe_rowActive_true__12zfob1q" }, cellSelected: { false: "header_HeaderCellRecipe_cellSelected_false__12zfob1r", true: "header_HeaderCellRecipe_cellSelected_true__12zfob1s" }, rowSelected: { false: "header_HeaderCellRecipe_rowSelected_false__12zfob1t", true: "header_HeaderCellRecipe_rowSelected_true__12zfob1u", null: "header_HeaderCellRecipe_rowSelected_null__12zfob1v" }, rowDisabled: { false: "header_HeaderCellRecipe_rowDisabled_false__12zfob1w", true: "header_HeaderCellRecipe_rowDisabled_true__12zfob1x" }, firstRow: { false: "header_HeaderCellRecipe_firstRow_false__12zfob1y", true: "header_HeaderCellRecipe_firstRow_true__12zfob1z" }, firstRowInHorizontalLayoutPage: { false: "
|
|
5467
|
+
var CellCls = "cell_CellCls__1eexc2a5 utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1p utilities_alignItems_center__16lm1iw1r utilities_position_absolute__16lm1iw2 utilities_willChange_transform__16lm1iw23 utilities_whiteSpace_nowrap__16lm1iw24 utilities_userSelect_none__16lm1iw17";
|
|
5468
|
+
var HeaderCellContentRecipe = createRuntimeFn({ defaultClassName: "header_HeaderCellContentRecipe__12zfob129 utilities_height_100%__16lm1iw19 utilities_width_100%__16lm1iw1c utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1p utilities_alignItems_center__16lm1iw1r utilities_justifyContent_start__16lm1iw1w", variantClassNames: { filtered: { false: "header_HeaderCellContentRecipe_filtered_false__12zfob12a", true: "header_HeaderCellContentRecipe_filtered_true__12zfob12b" }, verticalAlign: { start: "header_HeaderCellContentRecipe_verticalAlign_start__12zfob12c", end: "header_HeaderCellContentRecipe_verticalAlign_end__12zfob12d", center: "header_HeaderCellContentRecipe_verticalAlign_center__12zfob12e" }, align: { start: "header_HeaderCellContentRecipe_align_start__12zfob12f", end: "header_HeaderCellContentRecipe_align_end__12zfob12g", center: "header_HeaderCellContentRecipe_align_center__12zfob12h" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5469
|
+
var HeaderCellProxy = "header_HeaderCellProxy__12zfob1n utilities_whiteSpace_nowrap__16lm1iw24 utilities_textOverflow_ellipsis__16lm1iw25 utilities_overflow_hidden__16lm1iw1y";
|
|
5470
|
+
var HeaderCellRecipe = createRuntimeFn({ defaultClassName: "header_HeaderCellRecipe__12zfob1o utilities_display_block__16lm1iw12", variantClassNames: { rowActive: { false: "header_HeaderCellRecipe_rowActive_false__12zfob1p", true: "header_HeaderCellRecipe_rowActive_true__12zfob1q" }, cellSelected: { false: "header_HeaderCellRecipe_cellSelected_false__12zfob1r", true: "header_HeaderCellRecipe_cellSelected_true__12zfob1s" }, rowSelected: { false: "header_HeaderCellRecipe_rowSelected_false__12zfob1t", true: "header_HeaderCellRecipe_rowSelected_true__12zfob1u", null: "header_HeaderCellRecipe_rowSelected_null__12zfob1v" }, rowDisabled: { false: "header_HeaderCellRecipe_rowDisabled_false__12zfob1w", true: "header_HeaderCellRecipe_rowDisabled_true__12zfob1x" }, firstRow: { false: "header_HeaderCellRecipe_firstRow_false__12zfob1y", true: "header_HeaderCellRecipe_firstRow_true__12zfob1z" }, treeNode: { parent: "header_HeaderCellRecipe_treeNode_parent__12zfob110", leaf: "header_HeaderCellRecipe_treeNode_leaf__12zfob111", false: "header_HeaderCellRecipe_treeNode_false__12zfob112" }, firstRowInHorizontalLayoutPage: { false: "header_HeaderCellRecipe_firstRowInHorizontalLayoutPage_false__12zfob113", true: "header_HeaderCellRecipe_firstRowInHorizontalLayoutPage_true__12zfob114" }, groupRow: { false: "header_HeaderCellRecipe_groupRow_false__12zfob115", true: "header_HeaderCellRecipe_groupRow_true__12zfob116" }, groupCell: { false: "header_HeaderCellRecipe_groupCell_false__12zfob117", true: "header_HeaderCellRecipe_groupCell_true__12zfob118" }, align: { start: "header_HeaderCellRecipe_align_start__12zfob119", end: "header_HeaderCellRecipe_align_end__12zfob11a", center: "header_HeaderCellRecipe_align_center__12zfob11b" }, verticalAlign: { start: "header_HeaderCellRecipe_verticalAlign_start__12zfob11c", end: "header_HeaderCellRecipe_verticalAlign_end__12zfob11d", center: "header_HeaderCellRecipe_verticalAlign_center__12zfob11e" }, zebra: { false: "header_HeaderCellRecipe_zebra_false__12zfob11f", even: "header_HeaderCellRecipe_zebra_even__12zfob11g", odd: "header_HeaderCellRecipe_zebra_odd__12zfob11h" }, dragging: { true: "header_HeaderCellRecipe_dragging_true__12zfob11i", false: "header_HeaderCellRecipe_dragging_false__12zfob11j" }, insideDisabledDraggingPage: { true: "header_HeaderCellRecipe_insideDisabledDraggingPage_true__12zfob11k", false: "header_HeaderCellRecipe_insideDisabledDraggingPage_false__12zfob11l" }, first: { true: "header_HeaderCellRecipe_first_true__12zfob11m", false: "header_HeaderCellRecipe_first_false__12zfob11n" }, last: { true: "header_HeaderCellRecipe_last_true__12zfob11o", false: "header_HeaderCellRecipe_last_false__12zfob11p" }, groupByField: { true: "header_HeaderCellRecipe_groupByField_true__12zfob11q", false: "header_HeaderCellRecipe_groupByField_false__12zfob11r" }, firstInCategory: { true: "header_HeaderCellRecipe_firstInCategory_true__12zfob11s", false: "header_HeaderCellRecipe_firstInCategory_false__12zfob11t" }, lastInCategory: { true: "header_HeaderCellRecipe_lastInCategory_true__12zfob11u", false: "header_HeaderCellRecipe_lastInCategory_false__12zfob11v" }, pinned: { start: "header_HeaderCellRecipe_pinned_start__12zfob11w", end: "header_HeaderCellRecipe_pinned_end__12zfob11x", false: "header_HeaderCellRecipe_pinned_false__12zfob11y" }, filtered: { true: "header_HeaderCellRecipe_filtered_true__12zfob11z", false: "header_HeaderCellRecipe_filtered_false__12zfob120" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "header_HeaderCellRecipe_compound_0__12zfob121"], [{ pinned: "end", firstInCategory: true }, "header_HeaderCellRecipe_compound_1__12zfob122"], [{ pinned: false, lastInCategory: true }, "header_HeaderCellRecipe_compound_2__12zfob123"]] });
|
|
5408
5471
|
var HeaderClsRecipe = createRuntimeFn({ defaultClassName: "header_HeaderClsRecipe__12zfob19 utilities_display_block__16lm1iw12 utilities_position_absolute__16lm1iw2", variantClassNames: { pinned: { start: "header_HeaderClsRecipe_pinned_start__12zfob1a", end: "header_HeaderClsRecipe_pinned_end__12zfob1b", false: "header_HeaderClsRecipe_pinned_false__12zfob1c" }, firstInCategory: { true: "header_HeaderClsRecipe_firstInCategory_true__12zfob1d", false: "header_HeaderClsRecipe_firstInCategory_false__12zfob1e" }, lastInCategory: { true: "header_HeaderClsRecipe_lastInCategory_true__12zfob1f", false: "header_HeaderClsRecipe_lastInCategory_false__12zfob1g" }, overflow: { true: "header_HeaderClsRecipe_overflow_true__12zfob1h", false: "header_HeaderClsRecipe_overflow_false__12zfob1i" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "header_HeaderClsRecipe_compound_0__12zfob1j"], [{ pinned: "start", firstInCategory: true }, "header_HeaderClsRecipe_compound_1__12zfob1k"], [{ overflow: true, pinned: "end" }, "header_HeaderClsRecipe_compound_2__12zfob1l"], [{ pinned: "end", lastInCategory: true }, "header_HeaderClsRecipe_compound_3__12zfob1m"]] });
|
|
5409
|
-
var HeaderFilterEditorCls = "
|
|
5472
|
+
var HeaderFilterEditorCls = "header_HeaderFilterEditorCls__12zfob12r utilities_width_100%__16lm1iw1c utilities_height_100%__16lm1iw19";
|
|
5410
5473
|
var HeaderFilterIconIndexCls = "header_HeaderFilterIconIndexCls__12zfob17";
|
|
5411
|
-
var HeaderFilterOperatorCls = "
|
|
5412
|
-
var HeaderFilterOperatorIconRecipe = createRuntimeFn({ defaultClassName: "
|
|
5413
|
-
var HeaderFilterRecipe = createRuntimeFn({ defaultClassName: "
|
|
5414
|
-
var HeaderGroupCls = "
|
|
5415
|
-
var HeaderMenuIconCls = createRuntimeFn({ defaultClassName: "
|
|
5474
|
+
var HeaderFilterOperatorCls = "header_HeaderFilterOperatorCls__12zfob12n utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1p utilities_alignItems_center__16lm1iw1r utilities_position_relative__16lm1iw1";
|
|
5475
|
+
var HeaderFilterOperatorIconRecipe = createRuntimeFn({ defaultClassName: "header_HeaderFilterOperatorIconRecipe__12zfob12o utilities_position_relative__16lm1iw1 utilities_top_0__16lm1iw1d", variantClassNames: { disabled: { true: "header_HeaderFilterOperatorIconRecipe_disabled_true__12zfob12p", false: "header_HeaderFilterOperatorIconRecipe_disabled_false__12zfob12q" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5476
|
+
var HeaderFilterRecipe = createRuntimeFn({ defaultClassName: "header_HeaderFilterRecipe__12zfob12k utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1p utilities_alignItems_stretch__16lm1iw1s utilities_position_relative__16lm1iw1", variantClassNames: { active: { true: "header_HeaderFilterRecipe_active_true__12zfob12l", false: "header_HeaderFilterRecipe_active_false__12zfob12m" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5477
|
+
var HeaderGroupCls = "header_HeaderGroupCls__12zfob12j utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1p utilities_alignItems_center__16lm1iw1r";
|
|
5478
|
+
var HeaderMenuIconCls = createRuntimeFn({ defaultClassName: "header_HeaderMenuIconCls__12zfob124 utilities_position_relative__16lm1iw1 utilities_display_flex__16lm1iwz utilities_flexFlow_column__16lm1iw1n utilities_justifyContent_spaceAround__16lm1iw1v utilities_visibility_hidden__16lm1iw22", variantClassNames: { menuVisible: { true: "header_HeaderMenuIconCls_menuVisible_true__12zfob125" }, reserveSpaceWhenHidden: { true: "header_HeaderMenuIconCls_reserveSpaceWhenHidden_true__12zfob126", false: "header_HeaderMenuIconCls_reserveSpaceWhenHidden_false__12zfob127" } }, defaultVariants: {}, compoundVariants: [[{ menuVisible: true, reserveSpaceWhenHidden: false }, "header_HeaderMenuIconCls_compound_0__12zfob128"]] });
|
|
5416
5479
|
var HeaderScrollbarPlaceholderCls = "header_HeaderScrollbarPlaceholderCls__12zfob18 utilities_position_absolute__16lm1iw2";
|
|
5417
5480
|
var HeaderSortIconCls = "utilities_position_relative__16lm1iw1";
|
|
5418
5481
|
var HeaderSortIconIndexCls = "header_HeaderSortIconIndexCls__12zfob16";
|
|
5419
5482
|
var HeaderSortIconRecipe = createRuntimeFn({ defaultClassName: "header__12zfob12", variantClassNames: { align: { start: "header_HeaderSortIconRecipe_align_start__12zfob13", center: "header_HeaderSortIconRecipe_align_center__12zfob14", end: "header_HeaderSortIconRecipe_align_end__12zfob15" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5420
|
-
var HeaderWrapperCls = "
|
|
5483
|
+
var HeaderWrapperCls = "header_HeaderWrapperCls__12zfob12i utilities_overflow_hidden__16lm1iw1y utilities_position_relative__16lm1iw1 utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1p";
|
|
5421
5484
|
|
|
5422
5485
|
// src/components/InfiniteTable/components/icons/InfiniteTableIconClassName.ts
|
|
5423
5486
|
var InfiniteTableIconClassName = "InfiniteTableIcon";
|
|
5424
5487
|
|
|
5425
5488
|
// src/components/InfiniteTable/components/icons/FilterIcon.css.ts
|
|
5426
|
-
var FilterIconCls = "FilterIcon_FilterIconCls__6aunoi0 utilities_display_flex__16lm1iwz
|
|
5489
|
+
var FilterIconCls = "FilterIcon_FilterIconCls__6aunoi0 utilities_display_flex__16lm1iwz utilities_flexFlow_column__16lm1iw1n utilities_position_relative__16lm1iw1 utilities_justifyContent_spaceAround__16lm1iw1v utilities_alignItems_center__16lm1iw1r";
|
|
5427
5490
|
|
|
5428
5491
|
// src/components/InfiniteTable/components/icons/FilterIcon.tsx
|
|
5429
5492
|
var defaultLineStyle = {
|
|
@@ -6513,6 +6576,7 @@ function getColumnLabel(colIdOrCol, context) {
|
|
|
6513
6576
|
horizontalLayoutPageIndex: null,
|
|
6514
6577
|
column: col,
|
|
6515
6578
|
columnApi,
|
|
6579
|
+
dataSourceApi,
|
|
6516
6580
|
insideColumnMenu: true,
|
|
6517
6581
|
dragging: false,
|
|
6518
6582
|
columnsMap: computed.computedColumnsMap,
|
|
@@ -6610,8 +6674,7 @@ function InfiniteTableColumnHeaderFilterEmpty() {
|
|
|
6610
6674
|
onPointerDown: stopPropagation,
|
|
6611
6675
|
className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterRecipe(
|
|
6612
6676
|
{ active: false }
|
|
6613
|
-
)}
|
|
6614
|
-
style: { height: "100%" }
|
|
6677
|
+
)} ${height["50%"]}`
|
|
6615
6678
|
}
|
|
6616
6679
|
);
|
|
6617
6680
|
}
|
|
@@ -6865,6 +6928,7 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
6865
6928
|
rowDisabled: extraFlags.rowDisabled,
|
|
6866
6929
|
groupRow: extraFlags.groupRow,
|
|
6867
6930
|
groupCell: extraFlags.groupCell,
|
|
6931
|
+
treeNode: extraFlags.treeNode,
|
|
6868
6932
|
verticalAlign: extraFlags.verticalAlign,
|
|
6869
6933
|
align: extraFlags.align,
|
|
6870
6934
|
zebra: extraFlags.zebra
|
|
@@ -6903,6 +6967,13 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
6903
6967
|
if (extraFlags.rowDisabled) {
|
|
6904
6968
|
result.push(...baseClasses.map((c) => `${c}--disabled`));
|
|
6905
6969
|
}
|
|
6970
|
+
if (extraFlags.treeNode) {
|
|
6971
|
+
result.push(
|
|
6972
|
+
...baseClasses.map(
|
|
6973
|
+
(c) => `${c}--tree-node ${c}-tree-${extraFlags.treeNode}-node`
|
|
6974
|
+
)
|
|
6975
|
+
);
|
|
6976
|
+
}
|
|
6906
6977
|
if (extraFlags.groupRow) {
|
|
6907
6978
|
result.push(...baseClasses.map((c) => `${c}--group-row`));
|
|
6908
6979
|
result.push(
|
|
@@ -6926,7 +6997,7 @@ var import_react21 = require("react");
|
|
|
6926
6997
|
|
|
6927
6998
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
6928
6999
|
var FooterCls = "utilities_position_relative__16lm1iw1";
|
|
6929
|
-
var InfiniteCls = "InfiniteCls_InfiniteCls__1yeub2v0 utilities_position_relative__16lm1iw1 utilities_display_flex__16lm1iwz
|
|
7000
|
+
var InfiniteCls = "InfiniteCls_InfiniteCls__1yeub2v0 utilities_position_relative__16lm1iw1 utilities_display_flex__16lm1iwz utilities_flexFlow_column__16lm1iw1n utilities_boxSizingBorderBox__16lm1iw0";
|
|
6930
7001
|
var InfiniteClsHasPinnedEnd = "InfiniteCls_InfiniteClsHasPinnedEnd__1yeub2vs";
|
|
6931
7002
|
var InfiniteClsHasPinnedStart = "InfiniteCls_InfiniteClsHasPinnedStart__1yeub2vr";
|
|
6932
7003
|
var InfiniteClsRecipe = createRuntimeFn({ defaultClassName: "InfiniteCls__1yeub2v2", variantClassNames: { horizontalLayout: { true: "InfiniteCls_InfiniteClsRecipe_horizontalLayout_true__1yeub2v3", false: "InfiniteCls_InfiniteClsRecipe_horizontalLayout_false__1yeub2v4" }, focused: { true: "InfiniteCls_InfiniteClsRecipe_focused_true__1yeub2v5", false: "InfiniteCls_InfiniteClsRecipe_focused_false__1yeub2v6" }, focusedWithin: { true: "InfiniteCls_InfiniteClsRecipe_focusedWithin_true__1yeub2v7", false: "InfiniteCls_InfiniteClsRecipe_focusedWithin_false__1yeub2v8" }, hasPinnedStart: { true: "InfiniteCls_InfiniteClsRecipe_hasPinnedStart_true__1yeub2v9", false: "InfiniteCls_InfiniteClsRecipe_hasPinnedStart_false__1yeub2va" }, hasPinnedEnd: { true: "InfiniteCls_InfiniteClsRecipe_hasPinnedEnd_true__1yeub2vb", false: "InfiniteCls_InfiniteClsRecipe_hasPinnedEnd_false__1yeub2vc" }, hasPinnedStartOverflow: { true: "InfiniteCls_InfiniteClsRecipe_hasPinnedStartOverflow_true__1yeub2vd", false: "InfiniteCls_InfiniteClsRecipe_hasPinnedStartOverflow_false__1yeub2ve" }, hasPinnedEndOverflow: { true: "InfiniteCls_InfiniteClsRecipe_hasPinnedEndOverflow_true__1yeub2vf", false: "InfiniteCls_InfiniteClsRecipe_hasPinnedEndOverflow_false__1yeub2vg" } }, defaultVariants: {}, compoundVariants: [[{ focused: false, focusedWithin: false }, "InfiniteCls_InfiniteClsRecipe_compound_0__1yeub2vh"]] });
|
|
@@ -7762,7 +7833,8 @@ var useColumnPointerEvents = ({
|
|
|
7762
7833
|
}, []);
|
|
7763
7834
|
const onPointerDown = (0, import_react21.useCallback)(
|
|
7764
7835
|
(e) => {
|
|
7765
|
-
|
|
7836
|
+
const tagName = e.target?.tagName;
|
|
7837
|
+
if (tagName === "INPUT" || tagName === "BUTTON") {
|
|
7766
7838
|
return;
|
|
7767
7839
|
}
|
|
7768
7840
|
const { brain, draggableColumnsRestrictTo } = getState();
|
|
@@ -8071,6 +8143,7 @@ var LoadingIcon = (props) => {
|
|
|
8071
8143
|
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
8072
8144
|
var GroupRowExpanderCls = createRuntimeFn({ defaultClassName: "row__7pupv01", variantClassNames: { align: { start: "row_GroupRowExpanderCls_align_start__7pupv02", center: "row_GroupRowExpanderCls_align_center__7pupv03", end: "row_GroupRowExpanderCls_align_end__7pupv04" } }, defaultVariants: {}, compoundVariants: [] });
|
|
8073
8145
|
var RowHoverCls = "row_RowHoverCls__7pupv00";
|
|
8146
|
+
var TreeColumnCellExpanderCls = createRuntimeFn({ defaultClassName: "row__7pupv05", variantClassNames: { align: { start: "row_TreeColumnCellExpanderCls_align_start__7pupv06", center: "row_TreeColumnCellExpanderCls_align_center__7pupv07", end: "row_TreeColumnCellExpanderCls_align_end__7pupv08" } }, defaultVariants: {}, compoundVariants: [] });
|
|
8074
8147
|
|
|
8075
8148
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
8076
8149
|
function styleForGroupColumn({
|
|
@@ -8246,8 +8319,8 @@ function objectValuesExcept(obj, exceptList) {
|
|
|
8246
8319
|
}
|
|
8247
8320
|
|
|
8248
8321
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
8249
|
-
var ColumnCellCls = "cell_ColumnCellCls__1eexc2a6 cell_CellCls__1eexc2a5 utilities_display_flex__16lm1iwz
|
|
8250
|
-
var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "cell_ColumnCellRecipe__1eexc2am", variantClassNames: { dragging: { false: "cell_ColumnCellRecipe_dragging_false__1eexc2an", true: "cell_ColumnCellRecipe_dragging_true__1eexc2ao" }, insideDisabledDraggingPage: { true: "cell_ColumnCellRecipe_insideDisabledDraggingPage_true__1eexc2ap", false: "cell_ColumnCellRecipe_insideDisabledDraggingPage_false__1eexc2aq" }, cellSelected: { false: "cell_ColumnCellRecipe_cellSelected_false__1eexc2ar", true: "cell_ColumnCellRecipe_cellSelected_true__1eexc2as" }, align: { start: "
|
|
8322
|
+
var ColumnCellCls = "cell_ColumnCellCls__1eexc2a6 cell_CellCls__1eexc2a5 utilities_display_flex__16lm1iwz utilities_flexFlow_row__16lm1iw1p utilities_alignItems_center__16lm1iw1r utilities_position_absolute__16lm1iw2 utilities_willChange_transform__16lm1iw23 utilities_whiteSpace_nowrap__16lm1iw24 utilities_userSelect_none__16lm1iw17";
|
|
8323
|
+
var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "cell_ColumnCellRecipe__1eexc2am", variantClassNames: { dragging: { false: "cell_ColumnCellRecipe_dragging_false__1eexc2an", true: "cell_ColumnCellRecipe_dragging_true__1eexc2ao" }, insideDisabledDraggingPage: { true: "cell_ColumnCellRecipe_insideDisabledDraggingPage_true__1eexc2ap", false: "cell_ColumnCellRecipe_insideDisabledDraggingPage_false__1eexc2aq" }, cellSelected: { false: "cell_ColumnCellRecipe_cellSelected_false__1eexc2ar", true: "cell_ColumnCellRecipe_cellSelected_true__1eexc2as" }, treeNode: { parent: "cell_ColumnCellRecipe_treeNode_parent__1eexc2at", leaf: "cell_ColumnCellRecipe_treeNode_leaf__1eexc2au", false: "cell_ColumnCellRecipe_treeNode_false__1eexc2av" }, align: { start: "cell_ColumnCellRecipe_align_start__1eexc2aw", end: "cell_ColumnCellRecipe_align_end__1eexc2ax", center: "cell_ColumnCellRecipe_align_center__1eexc2ay" }, verticalAlign: { start: "cell_ColumnCellRecipe_verticalAlign_start__1eexc2az", end: "cell_ColumnCellRecipe_verticalAlign_end__1eexc2a10", center: "cell_ColumnCellRecipe_verticalAlign_center__1eexc2a11" }, rowActive: { false: "cell_ColumnCellRecipe_rowActive_false__1eexc2a12", true: "cell_ColumnCellRecipe_rowActive_true__1eexc2a13" }, groupRow: { false: "cell_ColumnCellRecipe_groupRow_false__1eexc2a14", true: "cell_ColumnCellRecipe_groupRow_true__1eexc2a15" }, groupCell: { false: "cell_ColumnCellRecipe_groupCell_false__1eexc2a16", true: "cell_ColumnCellRecipe_groupCell_true__1eexc2a17" }, rowDisabled: { false: "cell_ColumnCellRecipe_rowDisabled_false__1eexc2a18", true: "cell_ColumnCellRecipe_rowDisabled_true__1eexc2a19" }, zebra: { false: "cell_ColumnCellRecipe_zebra_false__1eexc2a1a", even: "cell_ColumnCellRecipe_zebra_even__1eexc2a1b", odd: "cell_ColumnCellRecipe_zebra_odd__1eexc2a1c" }, rowSelected: { true: "cell_ColumnCellRecipe_rowSelected_true__1eexc2a1d", false: "cell_ColumnCellRecipe_rowSelected_false__1eexc2a1e", null: "cell_ColumnCellRecipe_rowSelected_null__1eexc2a1f" }, first: { true: "cell_ColumnCellRecipe_first_true__1eexc2a1g", false: "cell_ColumnCellRecipe_first_false__1eexc2a1h" }, last: { true: "cell_ColumnCellRecipe_last_true__1eexc2a1i", false: "cell_ColumnCellRecipe_last_false__1eexc2a1j" }, groupByField: { true: "cell_ColumnCellRecipe_groupByField_true__1eexc2a1k", false: "cell_ColumnCellRecipe_groupByField_false__1eexc2a1l" }, firstInCategory: { true: "cell_ColumnCellRecipe_firstInCategory_true__1eexc2a1m", false: "cell_ColumnCellRecipe_firstInCategory_false__1eexc2a1n" }, firstRow: { true: "cell_ColumnCellRecipe_firstRow_true__1eexc2a1o", false: "cell_ColumnCellRecipe_firstRow_false__1eexc2a1p" }, firstRowInHorizontalLayoutPage: { true: "cell_ColumnCellRecipe_firstRowInHorizontalLayoutPage_true__1eexc2a1q", false: "cell_ColumnCellRecipe_firstRowInHorizontalLayoutPage_false__1eexc2a1r" }, lastInCategory: { true: "cell_ColumnCellRecipe_lastInCategory_true__1eexc2a1s", false: "cell_ColumnCellRecipe_lastInCategory_false__1eexc2a1t" }, pinned: { start: "cell_ColumnCellRecipe_pinned_start__1eexc2a1u", end: "cell_ColumnCellRecipe_pinned_end__1eexc2a1v", false: "cell_ColumnCellRecipe_pinned_false__1eexc2a1w" }, filtered: { true: "cell_ColumnCellRecipe_filtered_true__1eexc2a1x", false: "cell_ColumnCellRecipe_filtered_false__1eexc2a1y" } }, defaultVariants: {}, compoundVariants: [[{ firstRowInHorizontalLayoutPage: true, firstRow: false }, "cell_ColumnCellRecipe_compound_0__1eexc2a1z"], [{ pinned: "start", lastInCategory: true }, "cell_ColumnCellRecipe_compound_1__1eexc2a20"], [{ pinned: "start", firstInCategory: true }, "cell_ColumnCellRecipe_compound_2__1eexc2a21"], [{ pinned: "end", firstInCategory: true }, "cell_ColumnCellRecipe_compound_3__1eexc2a22"], [{ pinned: "end", lastInCategory: true }, "cell_ColumnCellRecipe_compound_4__1eexc2a23"], [{ align: "center", groupCell: false }, "cell_ColumnCellRecipe_compound_5__1eexc2a24"], [{ rowDisabled: true, zebra: "odd" }, "cell_ColumnCellRecipe_compound_6__1eexc2a25"]] });
|
|
8251
8324
|
var ColumnCellSelectionIndicatorRecipe = createRuntimeFn({ defaultClassName: "cell_ColumnCellSelectionIndicatorRecipe__1eexc2ad", variantClassNames: { right: { true: "cell_ColumnCellSelectionIndicatorRecipe_right_true__1eexc2ae", false: "cell_ColumnCellSelectionIndicatorRecipe_right_false__1eexc2af" }, left: { true: "cell_ColumnCellSelectionIndicatorRecipe_left_true__1eexc2ag", false: "cell_ColumnCellSelectionIndicatorRecipe_left_false__1eexc2ah" }, top: { true: "cell_ColumnCellSelectionIndicatorRecipe_top_true__1eexc2ai", false: "cell_ColumnCellSelectionIndicatorRecipe_top_false__1eexc2aj" }, bottom: { true: "cell_ColumnCellSelectionIndicatorRecipe_bottom_true__1eexc2ak", false: "cell_ColumnCellSelectionIndicatorRecipe_bottom_false__1eexc2al" } }, defaultVariants: {}, compoundVariants: [] });
|
|
8252
8325
|
var FlashingColumnCellRecipe = createRuntimeFn({ defaultClassName: "cell_FlashingColumnCellRecipe__1eexc2a9", variantClassNames: { direction: { up: "cell_FlashingColumnCellRecipe_direction_up__1eexc2aa", down: "cell_FlashingColumnCellRecipe_direction_down__1eexc2ab", neutral: "cell_FlashingColumnCellRecipe_direction_neutral__1eexc2ac" } }, defaultVariants: {}, compoundVariants: [] });
|
|
8253
8326
|
var SelectionCheckboxCls = "cell_SelectionCheckboxCls__1eexc2a7";
|
|
@@ -8346,7 +8419,7 @@ function getCellContext(context) {
|
|
|
8346
8419
|
} = context;
|
|
8347
8420
|
const { dataArray } = getDataSourceState();
|
|
8348
8421
|
const rowInfo = dataArray[rowIndex];
|
|
8349
|
-
const { isGroupRow } = rowInfo;
|
|
8422
|
+
const { isGroupRow, isTreeNode } = rowInfo;
|
|
8350
8423
|
const column = getComputed().computedColumnsMap.get(columnId);
|
|
8351
8424
|
const {
|
|
8352
8425
|
activeRowIndex,
|
|
@@ -8371,7 +8444,9 @@ function getCellContext(context) {
|
|
|
8371
8444
|
dataSourceApi,
|
|
8372
8445
|
column,
|
|
8373
8446
|
columnApi,
|
|
8447
|
+
isParentNode: false,
|
|
8374
8448
|
isGroupRow: true,
|
|
8449
|
+
isTreeNode: false,
|
|
8375
8450
|
rowDetailState: false,
|
|
8376
8451
|
data: rowInfo.data,
|
|
8377
8452
|
rowActive,
|
|
@@ -8379,11 +8454,45 @@ function getCellContext(context) {
|
|
|
8379
8454
|
rowSelected: rowInfo.rowSelected,
|
|
8380
8455
|
value,
|
|
8381
8456
|
rawValue
|
|
8457
|
+
} : isTreeNode ? rowInfo.isParentNode ? {
|
|
8458
|
+
api,
|
|
8459
|
+
dataSourceApi,
|
|
8460
|
+
columnApi,
|
|
8461
|
+
column,
|
|
8462
|
+
nodeExpanded: rowInfo.nodeExpanded,
|
|
8463
|
+
isTreeNode: true,
|
|
8464
|
+
isGroupRow: false,
|
|
8465
|
+
isParentNode: true,
|
|
8466
|
+
rowDetailState,
|
|
8467
|
+
data: rowInfo.data,
|
|
8468
|
+
rowActive,
|
|
8469
|
+
rowInfo,
|
|
8470
|
+
rowSelected: rowInfo.rowSelected,
|
|
8471
|
+
value,
|
|
8472
|
+
rawValue
|
|
8473
|
+
} : {
|
|
8474
|
+
api,
|
|
8475
|
+
dataSourceApi,
|
|
8476
|
+
columnApi,
|
|
8477
|
+
column,
|
|
8478
|
+
nodeExpanded: false,
|
|
8479
|
+
isTreeNode: true,
|
|
8480
|
+
isGroupRow: false,
|
|
8481
|
+
isParentNode: false,
|
|
8482
|
+
rowDetailState,
|
|
8483
|
+
data: rowInfo.data,
|
|
8484
|
+
rowActive,
|
|
8485
|
+
rowInfo,
|
|
8486
|
+
rowSelected: rowInfo.rowSelected,
|
|
8487
|
+
value,
|
|
8488
|
+
rawValue
|
|
8382
8489
|
} : {
|
|
8383
8490
|
api,
|
|
8384
8491
|
dataSourceApi,
|
|
8385
8492
|
columnApi,
|
|
8386
8493
|
column,
|
|
8494
|
+
isTreeNode: false,
|
|
8495
|
+
isParentNode: false,
|
|
8387
8496
|
isGroupRow: false,
|
|
8388
8497
|
rowDetailState,
|
|
8389
8498
|
data: rowInfo.data,
|
|
@@ -8441,6 +8550,9 @@ function getColumnRenderingParams(options) {
|
|
|
8441
8550
|
renderGroupIcon: column.renderGroupIcon || groupByColumnReference?.renderGroupIcon,
|
|
8442
8551
|
renderSelectionCheckBox: column.renderSelectionCheckBox,
|
|
8443
8552
|
renderRowDetailIcon: column.renderRowDetailIcon,
|
|
8553
|
+
renderTreeIcon: column.renderTreeIcon,
|
|
8554
|
+
renderTreeIconForParentNode: column.renderTreeIconForParentNode,
|
|
8555
|
+
renderTreeIconForLeafNode: column.renderTreeIconForLeafNode,
|
|
8444
8556
|
renderValue: column.renderValue || groupByColumnReference?.renderValue,
|
|
8445
8557
|
renderGroupValue: column.renderGroupValue || groupByColumnReference?.renderGroupValue,
|
|
8446
8558
|
renderLeafValue: column.renderLeafValue || groupByColumnReference?.renderLeafValue
|
|
@@ -8477,7 +8589,12 @@ function getColumnRenderParam(options) {
|
|
|
8477
8589
|
formattedValueContext
|
|
8478
8590
|
} = options;
|
|
8479
8591
|
const { value } = formattedValueContext;
|
|
8480
|
-
const {
|
|
8592
|
+
const {
|
|
8593
|
+
api: imperativeApi,
|
|
8594
|
+
getDataSourceState,
|
|
8595
|
+
getState,
|
|
8596
|
+
dataSourceApi
|
|
8597
|
+
} = context;
|
|
8481
8598
|
const { editingCell } = getState();
|
|
8482
8599
|
const { indexInAll: rowIndex } = rowInfo;
|
|
8483
8600
|
const dataSourceState = getDataSourceState();
|
|
@@ -8505,10 +8622,28 @@ function getColumnRenderParam(options) {
|
|
|
8505
8622
|
groupByColumn,
|
|
8506
8623
|
selectionMode,
|
|
8507
8624
|
api: imperativeApi,
|
|
8625
|
+
dataSourceApi,
|
|
8508
8626
|
toggleCurrentRowDetails: () => imperativeApi.rowDetailApi.toggleRowDetail(rowInfo.id),
|
|
8509
8627
|
toggleRowDetails: imperativeApi.rowDetailApi.toggleRowDetail,
|
|
8510
8628
|
expandRowDetails: imperativeApi.rowDetailApi.expandRowDetail,
|
|
8511
8629
|
collapseRowDetails: imperativeApi.rowDetailApi.collapseRowDetail,
|
|
8630
|
+
toggleCurrentTreeNode: () => {
|
|
8631
|
+
dataSourceApi.treeApi.toggleNode(
|
|
8632
|
+
rowInfo.nodePath
|
|
8633
|
+
);
|
|
8634
|
+
},
|
|
8635
|
+
toggleTreeNode: dataSourceApi.treeApi.toggleNode,
|
|
8636
|
+
expandTreeNode: dataSourceApi.treeApi.expandNode,
|
|
8637
|
+
collapseTreeNode: dataSourceApi.treeApi.collapseNode,
|
|
8638
|
+
selectTreeNode: dataSourceApi.treeApi.selectNode,
|
|
8639
|
+
deselectTreeNode: dataSourceApi.treeApi.deselectNode,
|
|
8640
|
+
toggleTreeNodeSelection: dataSourceApi.treeApi.toggleNodeSelection,
|
|
8641
|
+
toggleCurrentTreeNodeSelection: () => {
|
|
8642
|
+
if (!rowInfo.isTreeNode) {
|
|
8643
|
+
return;
|
|
8644
|
+
}
|
|
8645
|
+
dataSourceApi.treeApi.toggleNodeSelection(rowInfo.nodePath);
|
|
8646
|
+
},
|
|
8512
8647
|
selectRow: imperativeApi.rowSelectionApi.selectRow,
|
|
8513
8648
|
deselectRow: imperativeApi.rowSelectionApi.deselectRow,
|
|
8514
8649
|
toggleRowSelection: imperativeApi.rowSelectionApi.toggleRowSelection,
|
|
@@ -8532,12 +8667,18 @@ function getColumnRenderParam(options) {
|
|
|
8532
8667
|
groupIcon: null
|
|
8533
8668
|
},
|
|
8534
8669
|
selectCurrentRow: () => {
|
|
8670
|
+
if (rowInfo.isTreeNode) {
|
|
8671
|
+
return;
|
|
8672
|
+
}
|
|
8535
8673
|
return imperativeApi.rowSelectionApi.selectRow(
|
|
8536
8674
|
rowInfo.id,
|
|
8537
8675
|
rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0
|
|
8538
8676
|
);
|
|
8539
8677
|
},
|
|
8540
8678
|
deselectCurrentRow: () => {
|
|
8679
|
+
if (rowInfo.isTreeNode) {
|
|
8680
|
+
return;
|
|
8681
|
+
}
|
|
8541
8682
|
return imperativeApi.rowSelectionApi.deselectRow(
|
|
8542
8683
|
rowInfo.id,
|
|
8543
8684
|
rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0
|
|
@@ -8552,7 +8693,7 @@ function getColumnRenderParam(options) {
|
|
|
8552
8693
|
toggleGroupRow(rowInfo.groupKeys);
|
|
8553
8694
|
},
|
|
8554
8695
|
toggleCurrentRowSelection: () => {
|
|
8555
|
-
if (rowInfo.isGroupRow) {
|
|
8696
|
+
if (rowInfo.isGroupRow || rowInfo.isTreeNode) {
|
|
8556
8697
|
return;
|
|
8557
8698
|
}
|
|
8558
8699
|
return imperativeApi.rowSelectionApi.toggleRowSelection(rowInfo.id);
|
|
@@ -8597,7 +8738,9 @@ function getFormattedValueParamForCell(value, column, rowInfo, context, rowDetai
|
|
|
8597
8738
|
const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
|
|
8598
8739
|
return rowInfo.isGroupRow ? {
|
|
8599
8740
|
rowInfo,
|
|
8600
|
-
isGroupRow:
|
|
8741
|
+
isGroupRow: true,
|
|
8742
|
+
isTreeNode: false,
|
|
8743
|
+
isParentNode: false,
|
|
8601
8744
|
data: rowInfo.data,
|
|
8602
8745
|
rowDetailState: false,
|
|
8603
8746
|
rowSelected,
|
|
@@ -8605,9 +8748,37 @@ function getFormattedValueParamForCell(value, column, rowInfo, context, rowDetai
|
|
|
8605
8748
|
value,
|
|
8606
8749
|
rawValue: value,
|
|
8607
8750
|
field: column.field
|
|
8751
|
+
} : rowInfo.isTreeNode ? rowInfo.isParentNode ? {
|
|
8752
|
+
rowInfo,
|
|
8753
|
+
isGroupRow: false,
|
|
8754
|
+
isTreeNode: true,
|
|
8755
|
+
isParentNode: true,
|
|
8756
|
+
nodeExpanded: rowInfo.nodeExpanded,
|
|
8757
|
+
data: rowInfo.data,
|
|
8758
|
+
rowDetailState,
|
|
8759
|
+
rowSelected,
|
|
8760
|
+
rowActive,
|
|
8761
|
+
value,
|
|
8762
|
+
rawValue: value,
|
|
8763
|
+
field: column.field
|
|
8764
|
+
} : {
|
|
8765
|
+
rowInfo,
|
|
8766
|
+
isGroupRow: false,
|
|
8767
|
+
isTreeNode: true,
|
|
8768
|
+
isParentNode: false,
|
|
8769
|
+
nodeExpanded: false,
|
|
8770
|
+
data: rowInfo.data,
|
|
8771
|
+
rowDetailState,
|
|
8772
|
+
rowSelected,
|
|
8773
|
+
rowActive,
|
|
8774
|
+
value,
|
|
8775
|
+
rawValue: value,
|
|
8776
|
+
field: column.field
|
|
8608
8777
|
} : {
|
|
8609
8778
|
rowInfo,
|
|
8610
|
-
isGroupRow:
|
|
8779
|
+
isGroupRow: false,
|
|
8780
|
+
isTreeNode: false,
|
|
8781
|
+
isParentNode: false,
|
|
8611
8782
|
data: rowInfo.data,
|
|
8612
8783
|
rowDetailState,
|
|
8613
8784
|
rowSelected,
|
|
@@ -8751,6 +8922,13 @@ function InfiniteTableColumnEditor() {
|
|
|
8751
8922
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
8752
8923
|
var { rootClassName: rootClassName6 } = internalProps;
|
|
8753
8924
|
var columnZIndexAtIndex4 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
8925
|
+
function styleForTreeColumn({
|
|
8926
|
+
rowInfo
|
|
8927
|
+
}) {
|
|
8928
|
+
return {
|
|
8929
|
+
[stripVar(ThemeVars.components.Row.groupNesting)]: rowInfo.isTreeNode ? rowInfo.isParentNode ? rowInfo.treeNesting : rowInfo.treeNesting + 1 : 0
|
|
8930
|
+
};
|
|
8931
|
+
}
|
|
8754
8932
|
var InfiniteTableColumnCellContext = React36.createContext(null);
|
|
8755
8933
|
var InfiniteTableColumnCellClassName = `${rootClassName6}ColumnCell`;
|
|
8756
8934
|
var defaultRenderRowDetailIcon = (params) => {
|
|
@@ -8766,23 +8944,49 @@ var defaultRenderRowDetailIcon = (params) => {
|
|
|
8766
8944
|
}
|
|
8767
8945
|
);
|
|
8768
8946
|
};
|
|
8947
|
+
var EXPANDER_STYLE = {
|
|
8948
|
+
display: "inline-block",
|
|
8949
|
+
visibility: "visible"
|
|
8950
|
+
};
|
|
8951
|
+
var defaultRenderTreeIcon = (params) => {
|
|
8952
|
+
const { toggleCurrentTreeNode, nodeExpanded } = params;
|
|
8953
|
+
return /* @__PURE__ */ React36.createElement(
|
|
8954
|
+
ExpanderIcon,
|
|
8955
|
+
{
|
|
8956
|
+
style: EXPANDER_STYLE,
|
|
8957
|
+
expanded: nodeExpanded,
|
|
8958
|
+
onChange: toggleCurrentTreeNode
|
|
8959
|
+
}
|
|
8960
|
+
);
|
|
8961
|
+
};
|
|
8769
8962
|
var defaultRenderSelectionCheckBox = (params) => {
|
|
8770
8963
|
const {
|
|
8771
8964
|
rowInfo,
|
|
8772
8965
|
selectCurrentRow,
|
|
8773
8966
|
deselectCurrentRow,
|
|
8774
8967
|
toggleCurrentGroupRowSelection,
|
|
8775
|
-
column
|
|
8968
|
+
column,
|
|
8969
|
+
dataSourceApi,
|
|
8970
|
+
api
|
|
8776
8971
|
} = params;
|
|
8777
8972
|
if (rowInfo.isGroupRow && !column.groupByForColumn) {
|
|
8778
8973
|
}
|
|
8974
|
+
const { components: components2 } = api.getState();
|
|
8975
|
+
const CheckBoxCmp = components2?.CheckBox || InfiniteCheckBox;
|
|
8779
8976
|
return /* @__PURE__ */ React36.createElement(
|
|
8780
|
-
|
|
8977
|
+
CheckBoxCmp,
|
|
8781
8978
|
{
|
|
8782
8979
|
domProps: {
|
|
8783
8980
|
className: SelectionCheckboxCls
|
|
8784
8981
|
},
|
|
8785
8982
|
onChange: (selected) => {
|
|
8983
|
+
if (rowInfo.isTreeNode) {
|
|
8984
|
+
dataSourceApi.treeApi.setNodeSelection(
|
|
8985
|
+
rowInfo.nodePath,
|
|
8986
|
+
selected ?? false
|
|
8987
|
+
);
|
|
8988
|
+
return;
|
|
8989
|
+
}
|
|
8786
8990
|
if (rowInfo.isGroupRow) {
|
|
8787
8991
|
toggleCurrentGroupRowSelection();
|
|
8788
8992
|
return;
|
|
@@ -8925,6 +9129,10 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
8925
9129
|
const cellSelected = renderParam.cellSelected;
|
|
8926
9130
|
renderParam.domRef = domRef;
|
|
8927
9131
|
renderParam.htmlElementRef = htmlElementRef;
|
|
9132
|
+
renderParam.toggleCurrentTreeNode = (0, import_react25.useCallback)(
|
|
9133
|
+
renderParam.toggleCurrentTreeNode,
|
|
9134
|
+
[rowInfo]
|
|
9135
|
+
);
|
|
8928
9136
|
renderParam.selectCell = (0, import_react25.useCallback)(renderParam.selectCell, [rowInfo]);
|
|
8929
9137
|
renderParam.deselectCell = (0, import_react25.useCallback)(renderParam.deselectCell, [rowInfo]);
|
|
8930
9138
|
renderParam.selectCurrentRow = (0, import_react25.useCallback)(renderParam.selectCurrentRow, [
|
|
@@ -8945,6 +9153,10 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
8945
9153
|
renderParam.toggleCurrentGroupRowSelection,
|
|
8946
9154
|
[rowInfo]
|
|
8947
9155
|
);
|
|
9156
|
+
renderParam.toggleCurrentTreeNodeSelection = (0, import_react25.useCallback)(
|
|
9157
|
+
renderParam.toggleCurrentTreeNodeSelection,
|
|
9158
|
+
[rowInfo]
|
|
9159
|
+
);
|
|
8948
9160
|
const EditorComponent = column.components?.Editor ?? InfiniteTableColumnEditor;
|
|
8949
9161
|
const editor = inEdit ? /* @__PURE__ */ React36.createElement(CellEditorContextComponent, { contextValue: renderParam }, /* @__PURE__ */ React36.createElement(EditorComponent, null)) : null;
|
|
8950
9162
|
const renderChildren = (0, import_react25.useCallback)(
|
|
@@ -8989,6 +9201,31 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
8989
9201
|
);
|
|
8990
9202
|
}
|
|
8991
9203
|
}
|
|
9204
|
+
if (rowInfo.isTreeNode) {
|
|
9205
|
+
const { isParentNode } = rowInfo;
|
|
9206
|
+
let fn = void 0;
|
|
9207
|
+
const renderForNodeOrLeaf = isParentNode ? renderFunctions.renderTreeIconForParentNode : renderFunctions.renderTreeIconForLeafNode;
|
|
9208
|
+
fn = renderForNodeOrLeaf || // for parents, fallback to the renderTreeIcon as well
|
|
9209
|
+
(isParentNode ? renderFunctions.renderTreeIcon : void 0);
|
|
9210
|
+
if (fn === true) {
|
|
9211
|
+
fn = defaultRenderTreeIcon;
|
|
9212
|
+
}
|
|
9213
|
+
if (!fn) {
|
|
9214
|
+
fn = void 0;
|
|
9215
|
+
}
|
|
9216
|
+
if (fn) {
|
|
9217
|
+
renderParam.renderBag.treeIcon = /* @__PURE__ */ React36.createElement(
|
|
9218
|
+
RenderCellHookComponent,
|
|
9219
|
+
{
|
|
9220
|
+
render: fn,
|
|
9221
|
+
renderParam: {
|
|
9222
|
+
...renderParam,
|
|
9223
|
+
renderBag: { ...renderParam.renderBag }
|
|
9224
|
+
}
|
|
9225
|
+
}
|
|
9226
|
+
);
|
|
9227
|
+
}
|
|
9228
|
+
}
|
|
8992
9229
|
if (renderFunctions.renderRowDetailIcon) {
|
|
8993
9230
|
renderParam.renderBag.rowDetailsIcon = /* @__PURE__ */ React36.createElement(
|
|
8994
9231
|
RenderCellHookComponent,
|
|
@@ -9056,7 +9293,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
9056
9293
|
if (valueToRender instanceof Date) {
|
|
9057
9294
|
valueToRender = valueToRender.toLocaleDateString();
|
|
9058
9295
|
}
|
|
9059
|
-
const all = /* @__PURE__ */ React36.createElement(React36.Fragment, null, align2 !== "end" ? renderParam.renderBag.groupIcon : null, align2 !== "end" ? renderParam.renderBag.rowDetailsIcon : null, align2 !== "end" ? renderParam.renderBag.selectionCheckBox : null, valueToRender, align2 === "end" ? renderParam.renderBag.selectionCheckBox : null, align2 === "end" ? renderParam.renderBag.rowDetailsIcon : null, align2 === "end" ? renderParam.renderBag.groupIcon : null);
|
|
9296
|
+
const all = /* @__PURE__ */ React36.createElement(React36.Fragment, null, align2 !== "end" ? renderParam.renderBag.treeIcon : null, align2 !== "end" ? renderParam.renderBag.groupIcon : null, align2 !== "end" ? renderParam.renderBag.rowDetailsIcon : null, align2 !== "end" ? renderParam.renderBag.selectionCheckBox : null, valueToRender, align2 === "end" ? renderParam.renderBag.selectionCheckBox : null, align2 === "end" ? renderParam.renderBag.rowDetailsIcon : null, align2 === "end" ? renderParam.renderBag.groupIcon : null, align2 === "end" ? renderParam.renderBag.treeIcon : null);
|
|
9060
9297
|
if (column.render) {
|
|
9061
9298
|
return /* @__PURE__ */ React36.createElement(
|
|
9062
9299
|
RenderCellHookComponent,
|
|
@@ -9086,6 +9323,8 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
9086
9323
|
toggleCurrentRowDetails: true,
|
|
9087
9324
|
toggleCurrentRowSelection: true,
|
|
9088
9325
|
toggleCurrentGroupRowSelection: true,
|
|
9326
|
+
toggleCurrentTreeNodeSelection: true,
|
|
9327
|
+
toggleCurrentTreeNode: true,
|
|
9089
9328
|
rowHasSelectedCells: true
|
|
9090
9329
|
})
|
|
9091
9330
|
]
|
|
@@ -9105,6 +9344,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
9105
9344
|
return rowInfo.hasSelectedCells(visibleColumnIds);
|
|
9106
9345
|
}
|
|
9107
9346
|
});
|
|
9347
|
+
const columnIsTree = rowInfo.isTreeNode && (column.renderTreeIcon || column.renderTreeIconForLeafNode || column.renderTreeIconForParentNode);
|
|
9108
9348
|
const rowComputedClassName = typeof rowClassName === "function" ? rowClassName(rowPropsAndStyleArgs) : rowClassName;
|
|
9109
9349
|
let colClassName = void 0;
|
|
9110
9350
|
if (groupByColumnReference?.className) {
|
|
@@ -9125,10 +9365,21 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
9125
9365
|
applyColumnClassName(column.className, stylingParam)
|
|
9126
9366
|
);
|
|
9127
9367
|
}
|
|
9368
|
+
if (columnIsTree) {
|
|
9369
|
+
colClassName = join(
|
|
9370
|
+
colClassName,
|
|
9371
|
+
TreeColumnCellExpanderCls({
|
|
9372
|
+
align: align2
|
|
9373
|
+
})
|
|
9374
|
+
);
|
|
9375
|
+
}
|
|
9128
9376
|
let style2;
|
|
9129
9377
|
if (rowInfo.dataSourceHasGrouping && column.groupByForColumn) {
|
|
9130
9378
|
style2 = styleForGroupColumn({ rowInfo });
|
|
9131
9379
|
}
|
|
9380
|
+
if (columnIsTree) {
|
|
9381
|
+
style2 = styleForTreeColumn({ rowInfo });
|
|
9382
|
+
}
|
|
9132
9383
|
if (rowStyle) {
|
|
9133
9384
|
style2 = typeof rowStyle === "function" ? { ...style2, ...rowStyle(rowPropsAndStyleArgs) } : { ...style2, ...rowStyle };
|
|
9134
9385
|
}
|
|
@@ -9212,6 +9463,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
9212
9463
|
rowActive,
|
|
9213
9464
|
cellSelected,
|
|
9214
9465
|
rowSelected,
|
|
9466
|
+
treeNode: rowInfo.isTreeNode ? rowInfo.isParentNode ? "parent" : "leaf" : false,
|
|
9215
9467
|
firstRow: rowInfo.indexInAll === 0,
|
|
9216
9468
|
firstRowInHorizontalLayoutPage: rowIndexInHorizontalLayoutPage === 0,
|
|
9217
9469
|
groupRow: rowInfo.isGroupRow,
|
|
@@ -9363,7 +9615,7 @@ var React39 = __toESM(require("react"));
|
|
|
9363
9615
|
var import_react26 = require("react");
|
|
9364
9616
|
|
|
9365
9617
|
// src/components/InfiniteTable/components/icons/SortIcon.css.ts
|
|
9366
|
-
var SortIconCls = "SortIcon_SortIconCls__1ek6mqy0 utilities_display_flex__16lm1iwz
|
|
9618
|
+
var SortIconCls = "SortIcon_SortIconCls__1ek6mqy0 utilities_display_flex__16lm1iwz utilities_flexFlow_column__16lm1iw1n utilities_position_relative__16lm1iw1 utilities_justifyContent_spaceAround__16lm1iw1v";
|
|
9367
9619
|
|
|
9368
9620
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
9369
9621
|
var defaultLineStyle3 = {
|
|
@@ -9581,9 +9833,9 @@ function getColumnGroupResizer(colIndexes, config) {
|
|
|
9581
9833
|
}
|
|
9582
9834
|
|
|
9583
9835
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
|
|
9584
|
-
var ResizeHandleCls = "ResizeHandle_ResizeHandleCls__zneyzh0 utilities_position_absolute__16lm1iw2
|
|
9585
|
-
var ResizeHandleDraggerClsRecipe = createRuntimeFn({ defaultClassName: "ResizeHandle_ResizeHandleDraggerClsRecipe__zneyzhc utilities_position_absolute__16lm1iw2
|
|
9586
|
-
var ResizeHandleRecipeCls = createRuntimeFn({ defaultClassName: "ResizeHandle__zneyzh1", variantClassNames: { computedPinned: { start: "ResizeHandle_ResizeHandleRecipeCls_computedPinned_start__zneyzh2", end: "ResizeHandle_ResizeHandleRecipeCls_computedPinned_end__zneyzh3
|
|
9836
|
+
var ResizeHandleCls = "ResizeHandle_ResizeHandleCls__zneyzh0 utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1d utilities_right_0__16lm1iw1k utilities_bottom_0__16lm1iw1i utilities_cursor_colResize__16lm1iwk utilities_overflow_hidden__16lm1iw1y";
|
|
9837
|
+
var ResizeHandleDraggerClsRecipe = createRuntimeFn({ defaultClassName: "ResizeHandle_ResizeHandleDraggerClsRecipe__zneyzhc utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1d utilities_bottom_0__16lm1iw1i", variantClassNames: { constrained: { false: "ResizeHandle_ResizeHandleDraggerClsRecipe_constrained_false__zneyzhd", true: "ResizeHandle_ResizeHandleDraggerClsRecipe_constrained_true__zneyzhe" }, computedPinned: { start: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedPinned_start__zneyzhf", end: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedPinned_end__zneyzhg", false: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedPinned_false__zneyzhh" }, computedFirstInCategory: { true: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedFirstInCategory_true__zneyzhi", false: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedFirstInCategory_false__zneyzhj" }, computedLastInCategory: { true: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedLastInCategory_true__zneyzhk", false: "ResizeHandle_ResizeHandleDraggerClsRecipe_computedLastInCategory_false__zneyzhl" } }, defaultVariants: {}, compoundVariants: [[{ computedPinned: "start", computedLastInCategory: true }, "ResizeHandle_ResizeHandleDraggerClsRecipe_compound_0__zneyzhm"], [{ computedPinned: "end", computedFirstInCategory: true }, "ResizeHandle_ResizeHandleDraggerClsRecipe_compound_1__zneyzhn"]] });
|
|
9838
|
+
var ResizeHandleRecipeCls = createRuntimeFn({ defaultClassName: "ResizeHandle__zneyzh1", variantClassNames: { computedPinned: { start: "ResizeHandle_ResizeHandleRecipeCls_computedPinned_start__zneyzh2", end: "ResizeHandle_ResizeHandleRecipeCls_computedPinned_end__zneyzh3 utilities_left_0__16lm1iw1f utilities_right_auto__16lm1iw1m", false: "ResizeHandle_ResizeHandleRecipeCls_computedPinned_false__zneyzh4" }, computedFirstInCategory: { true: "ResizeHandle_ResizeHandleRecipeCls_computedFirstInCategory_true__zneyzh5", false: "ResizeHandle_ResizeHandleRecipeCls_computedFirstInCategory_false__zneyzh6" }, computedLastInCategory: { true: "ResizeHandle_ResizeHandleRecipeCls_computedLastInCategory_true__zneyzh7", false: "ResizeHandle_ResizeHandleRecipeCls_computedLastInCategory_false__zneyzh8" } }, defaultVariants: {}, compoundVariants: [[{ computedPinned: "end", computedLastInCategory: false, computedFirstInCategory: true }, "ResizeHandle_ResizeHandleRecipeCls_compound_0__zneyzh9"], [{ computedPinned: false, computedFirstInCategory: false, computedLastInCategory: true }, "ResizeHandle_ResizeHandleRecipeCls_compound_1__zneyzha"], [{ computedPinned: "start", computedFirstInCategory: false, computedLastInCategory: true }, "ResizeHandle_ResizeHandleRecipeCls_compound_2__zneyzhb"]] });
|
|
9587
9839
|
|
|
9588
9840
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
9589
9841
|
var { rootClassName: rootClassName7 } = internalProps;
|
|
@@ -9785,18 +10037,29 @@ function useColumnResizeHandle(column, opts) {
|
|
|
9785
10037
|
|
|
9786
10038
|
// src/components/InfiniteTable/components/InfiniteTableHeader/headerClassName.ts
|
|
9787
10039
|
var InfiniteTableHeaderCellClassName = `${rootClassName2}HeaderCell`;
|
|
10040
|
+
var InfiniteTableHeaderWrapperClassName = `${rootClassName2}HeaderWrapper`;
|
|
9788
10041
|
|
|
9789
10042
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
9790
10043
|
var defaultRenderSelectionCheckBox2 = (params) => {
|
|
9791
|
-
const { allRowsSelected, someRowsSelected, api } = params;
|
|
10044
|
+
const { allRowsSelected, someRowsSelected, api, dataSourceApi } = params;
|
|
9792
10045
|
const selected = allRowsSelected ? true : someRowsSelected ? null : false;
|
|
10046
|
+
const { components: components2, isTree } = api.getState();
|
|
10047
|
+
const CheckBoxCmp = components2?.CheckBox || InfiniteCheckBox;
|
|
9793
10048
|
return /* @__PURE__ */ React42.createElement(
|
|
9794
|
-
|
|
10049
|
+
CheckBoxCmp,
|
|
9795
10050
|
{
|
|
9796
10051
|
domProps: {
|
|
9797
10052
|
className: SelectionCheckboxCls
|
|
9798
10053
|
},
|
|
9799
10054
|
onChange: (selected2) => {
|
|
10055
|
+
if (isTree) {
|
|
10056
|
+
if (selected2) {
|
|
10057
|
+
dataSourceApi.treeApi.selectAll();
|
|
10058
|
+
} else {
|
|
10059
|
+
dataSourceApi.treeApi.deselectAll();
|
|
10060
|
+
}
|
|
10061
|
+
return;
|
|
10062
|
+
}
|
|
9800
10063
|
if (selected2) {
|
|
9801
10064
|
api.rowSelectionApi.selectAll();
|
|
9802
10065
|
} else {
|
|
@@ -9846,7 +10109,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
9846
10109
|
const horizontalLayoutPageIndex = props.horizontalLayoutPageIndex;
|
|
9847
10110
|
const dragging = columnReorderDragColumnId === column.id;
|
|
9848
10111
|
const insideDisabledDraggingPage = columnReorderInPageIndex != null ? horizontalLayoutPageIndex !== columnReorderInPageIndex : false;
|
|
9849
|
-
const { onResize, height, width, headerOptions, columnsMap } = props;
|
|
10112
|
+
const { onResize, height: height2, width, headerOptions, columnsMap } = props;
|
|
9850
10113
|
const sortInfo = column.computedSortInfo;
|
|
9851
10114
|
const header = column.header;
|
|
9852
10115
|
const ref = (0, import_react29.useCallback)(
|
|
@@ -9909,10 +10172,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
9909
10172
|
};
|
|
9910
10173
|
const MenuIconCmp = column.components?.MenuIcon || components2?.MenuIcon || MenuIcon;
|
|
9911
10174
|
const menuIcon = /* @__PURE__ */ React42.createElement(MenuIconCmp, { ...menuIconProps });
|
|
10175
|
+
const domRef = (0, import_react29.useRef)(null);
|
|
9912
10176
|
const initialRenderParam = {
|
|
9913
10177
|
horizontalLayoutPageIndex,
|
|
9914
10178
|
dragging,
|
|
9915
10179
|
domRef: ref,
|
|
10180
|
+
htmlElementRef: domRef,
|
|
9916
10181
|
insideColumnMenu: false,
|
|
9917
10182
|
column,
|
|
9918
10183
|
columnsMap,
|
|
@@ -9923,6 +10188,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
9923
10188
|
allRowsSelected,
|
|
9924
10189
|
selectionMode,
|
|
9925
10190
|
api,
|
|
10191
|
+
dataSourceApi,
|
|
9926
10192
|
columnApi,
|
|
9927
10193
|
renderBag: {
|
|
9928
10194
|
sortIcon,
|
|
@@ -10053,7 +10319,6 @@ function InfiniteTableHeaderCell(props) {
|
|
|
10053
10319
|
}
|
|
10054
10320
|
return all;
|
|
10055
10321
|
};
|
|
10056
|
-
const domRef = (0, import_react29.useRef)(null);
|
|
10057
10322
|
(0, import_react29.useEffect)(() => {
|
|
10058
10323
|
let clearOnResize = null;
|
|
10059
10324
|
const node = domRef.current;
|
|
@@ -10066,7 +10331,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
10066
10331
|
}, [domRef.current, props.onResize]);
|
|
10067
10332
|
let style2 = {
|
|
10068
10333
|
// height: column.computedFiltered? height*2: height,
|
|
10069
|
-
height
|
|
10334
|
+
height: height2
|
|
10070
10335
|
};
|
|
10071
10336
|
if (column.headerStyle) {
|
|
10072
10337
|
style2 = typeof column.headerStyle === "function" ? { ...style2, ...column.headerStyle(renderParam) || {} } : { ...style2, ...column.headerStyle };
|
|
@@ -10086,7 +10351,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
10086
10351
|
className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
|
|
10087
10352
|
style: {
|
|
10088
10353
|
position: "absolute",
|
|
10089
|
-
height,
|
|
10354
|
+
height: height2,
|
|
10090
10355
|
width,
|
|
10091
10356
|
left: proxyPosition.left ?? 0,
|
|
10092
10357
|
top: proxyPosition.top ?? 0,
|
|
@@ -10131,6 +10396,22 @@ function InfiniteTableHeaderCell(props) {
|
|
|
10131
10396
|
"data-sort": column.computedSortedAsc ? "asc" : column.computedSortedDesc ? "desc" : "none",
|
|
10132
10397
|
"data-sort-index": `${column.computedSortIndex ?? -1}`
|
|
10133
10398
|
};
|
|
10399
|
+
const columnFilterEditor = column.computedFilterable ? /* @__PURE__ */ React42.createElement(
|
|
10400
|
+
InfiniteTableColumnHeaderFilter,
|
|
10401
|
+
{
|
|
10402
|
+
horizontalLayoutPageIndex,
|
|
10403
|
+
filterEditor: FilterEditor,
|
|
10404
|
+
filterOperatorSwitch: FilterOperatorSwitch ?? InfiniteTableFilterOperatorSwitch,
|
|
10405
|
+
operator,
|
|
10406
|
+
filterTypes,
|
|
10407
|
+
onChange: debouncedOnFilterValueChange,
|
|
10408
|
+
columnFilterType: filterTypeKey,
|
|
10409
|
+
columnLabel: column.field || column.name || column.id,
|
|
10410
|
+
columnFilterValue: column.computedFilterValue,
|
|
10411
|
+
columnHeaderHeight
|
|
10412
|
+
}
|
|
10413
|
+
) : /* @__PURE__ */ React42.createElement(InfiniteTableColumnHeaderFilterEmpty, null);
|
|
10414
|
+
renderParam.renderBag.filterEditor = columnFilterEditor;
|
|
10134
10415
|
return /* @__PURE__ */ React42.createElement(ContextProvider, { value: renderParam }, /* @__PURE__ */ React42.createElement(
|
|
10135
10416
|
InfiniteTableCell,
|
|
10136
10417
|
{
|
|
@@ -10147,7 +10428,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
10147
10428
|
HeaderCellContentRecipe(contentRecipeVariants),
|
|
10148
10429
|
justifyContent[align2]
|
|
10149
10430
|
),
|
|
10150
|
-
contentStyle: showColumnFilters ? { height:
|
|
10431
|
+
contentStyle: showColumnFilters ? { height: height2 / 2 } : void 0,
|
|
10151
10432
|
className: join(
|
|
10152
10433
|
InfiniteTableHeaderCellClassName,
|
|
10153
10434
|
userSelect.none,
|
|
@@ -10169,6 +10450,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
10169
10450
|
rowActive: false,
|
|
10170
10451
|
firstRow: true,
|
|
10171
10452
|
firstRowInHorizontalLayoutPage: true,
|
|
10453
|
+
treeNode: false,
|
|
10172
10454
|
groupCell: false,
|
|
10173
10455
|
groupRow: false,
|
|
10174
10456
|
rowExpanded: false
|
|
@@ -10177,21 +10459,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
10177
10459
|
CellCls
|
|
10178
10460
|
),
|
|
10179
10461
|
cssEllipsis: headerCSSEllipsis,
|
|
10180
|
-
afterChildren: /* @__PURE__ */ React42.createElement(React42.Fragment, null, showColumnFilters ?
|
|
10181
|
-
InfiniteTableColumnHeaderFilter,
|
|
10182
|
-
{
|
|
10183
|
-
horizontalLayoutPageIndex,
|
|
10184
|
-
filterEditor: FilterEditor,
|
|
10185
|
-
filterOperatorSwitch: FilterOperatorSwitch ?? InfiniteTableFilterOperatorSwitch,
|
|
10186
|
-
operator,
|
|
10187
|
-
filterTypes,
|
|
10188
|
-
onChange: debouncedOnFilterValueChange,
|
|
10189
|
-
columnFilterType: filterTypeKey,
|
|
10190
|
-
columnLabel: column.field || column.name || column.id,
|
|
10191
|
-
columnFilterValue: column.computedFilterValue,
|
|
10192
|
-
columnHeaderHeight
|
|
10193
|
-
}
|
|
10194
|
-
) : /* @__PURE__ */ React42.createElement(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
|
|
10462
|
+
afterChildren: /* @__PURE__ */ React42.createElement(React42.Fragment, null, showColumnFilters ? columnFilterEditor : null, resizeHandle),
|
|
10195
10463
|
renderChildren
|
|
10196
10464
|
}
|
|
10197
10465
|
), draggingProxy);
|
|
@@ -10501,7 +10769,7 @@ var TableHeaderGroupClassName = `${rootClassName2}HeaderGroup`;
|
|
|
10501
10769
|
var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
|
|
10502
10770
|
var columnZIndexAtIndex6 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
10503
10771
|
function InfiniteTableHeaderGroup(props) {
|
|
10504
|
-
const { columnGroup, height, columns, bodyBrain, columnGroupsMaxDepth } = props;
|
|
10772
|
+
const { columnGroup, height: height2, columns, bodyBrain, columnGroupsMaxDepth } = props;
|
|
10505
10773
|
let { header, style: userStyle } = columnGroup;
|
|
10506
10774
|
if (header instanceof Function) {
|
|
10507
10775
|
header = header({
|
|
@@ -10511,7 +10779,7 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
10511
10779
|
}
|
|
10512
10780
|
const handle = useColumnGroupResizeHandle(columns, {
|
|
10513
10781
|
bodyBrain,
|
|
10514
|
-
groupHeight:
|
|
10782
|
+
groupHeight: height2,
|
|
10515
10783
|
columnGroup,
|
|
10516
10784
|
columnGroupsMaxDepth
|
|
10517
10785
|
});
|
|
@@ -10526,7 +10794,7 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
10526
10794
|
}) : userStyle;
|
|
10527
10795
|
style2 = style2 && typeof style2 === "object" ? style2 : {};
|
|
10528
10796
|
style2.width = width;
|
|
10529
|
-
style2.height =
|
|
10797
|
+
style2.height = height2;
|
|
10530
10798
|
return /* @__PURE__ */ React45.createElement(
|
|
10531
10799
|
"div",
|
|
10532
10800
|
{
|
|
@@ -10602,7 +10870,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
10602
10870
|
rowIndex,
|
|
10603
10871
|
colIndex,
|
|
10604
10872
|
domRef: domRef2,
|
|
10605
|
-
height,
|
|
10873
|
+
height: height2,
|
|
10606
10874
|
widthWithColspan,
|
|
10607
10875
|
heightWithRowspan,
|
|
10608
10876
|
hidden
|
|
@@ -10634,7 +10902,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
10634
10902
|
domRef: domRef2,
|
|
10635
10903
|
columns: columns2,
|
|
10636
10904
|
width: widthWithColspan,
|
|
10637
|
-
height,
|
|
10905
|
+
height: height2,
|
|
10638
10906
|
columnGroup: computedColumnGroup
|
|
10639
10907
|
}
|
|
10640
10908
|
) : null;
|
|
@@ -10699,7 +10967,7 @@ function TableHeaderWrapper(props) {
|
|
|
10699
10967
|
}
|
|
10700
10968
|
} = tableContextValue;
|
|
10701
10969
|
const rows = !computedColumnGroups || !Object.keys(computedColumnGroups).length ? 1 : columnGroupsMaxDepth + 2;
|
|
10702
|
-
const
|
|
10970
|
+
const height2 = rows * columnHeaderHeight + (showColumnFilters ? columnHeaderHeight : 0);
|
|
10703
10971
|
const columnAndGroupTreeInfo = React47.useMemo(() => {
|
|
10704
10972
|
if (!computedColumnGroups || !Object.keys(computedColumnGroups).length) {
|
|
10705
10973
|
return void 0;
|
|
@@ -10770,7 +11038,7 @@ function TableHeaderWrapper(props) {
|
|
|
10770
11038
|
rowHeight,
|
|
10771
11039
|
rows,
|
|
10772
11040
|
cols: computedVisibleColumns.length,
|
|
10773
|
-
height,
|
|
11041
|
+
height: height2,
|
|
10774
11042
|
rowspan,
|
|
10775
11043
|
colspan
|
|
10776
11044
|
},
|
|
@@ -10785,7 +11053,7 @@ function TableHeaderWrapper(props) {
|
|
|
10785
11053
|
columns: computedVisibleColumns,
|
|
10786
11054
|
headerBrain,
|
|
10787
11055
|
bodyBrain,
|
|
10788
|
-
columnHeaderHeight:
|
|
11056
|
+
columnHeaderHeight: height2,
|
|
10789
11057
|
columnGroupsMaxDepth,
|
|
10790
11058
|
columnAndGroupTreeInfo
|
|
10791
11059
|
}
|
|
@@ -10803,9 +11071,9 @@ function TableHeaderWrapper(props) {
|
|
|
10803
11071
|
return /* @__PURE__ */ React47.createElement(
|
|
10804
11072
|
"div",
|
|
10805
11073
|
{
|
|
10806
|
-
className: HeaderWrapperCls
|
|
11074
|
+
className: `${InfiniteTableHeaderWrapperClassName} ${HeaderWrapperCls}`,
|
|
10807
11075
|
style: {
|
|
10808
|
-
height
|
|
11076
|
+
height: height2
|
|
10809
11077
|
}
|
|
10810
11078
|
},
|
|
10811
11079
|
header,
|
|
@@ -10920,8 +11188,8 @@ var InfiniteTableLicenseFooter = React48.forwardRef(
|
|
|
10920
11188
|
var React49 = __toESM(require("react"));
|
|
10921
11189
|
|
|
10922
11190
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
10923
|
-
var LoadMaskCls = { visible: "LoadMask_LoadMaskCls_visible__qy58ya1 LoadMask_LoadMaskBaseCls__qy58ya0 utilities_position_absolute__16lm1iw2
|
|
10924
|
-
var LoadMaskOverlayCls = "LoadMask_LoadMaskOverlayCls__qy58ya3 utilities_position_absolute__16lm1iw2
|
|
11191
|
+
var LoadMaskCls = { visible: "LoadMask_LoadMaskCls_visible__qy58ya1 LoadMask_LoadMaskBaseCls__qy58ya0 utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1d utilities_left_0__16lm1iw1f utilities_right_0__16lm1iw1k utilities_bottom_0__16lm1iw1i", hidden: "LoadMask_LoadMaskCls_hidden__qy58ya2 LoadMask_LoadMaskBaseCls__qy58ya0 utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1d utilities_left_0__16lm1iw1f utilities_right_0__16lm1iw1k utilities_bottom_0__16lm1iw1i" };
|
|
11192
|
+
var LoadMaskOverlayCls = "LoadMask_LoadMaskOverlayCls__qy58ya3 utilities_position_absolute__16lm1iw2 utilities_top_0__16lm1iw1d utilities_left_0__16lm1iw1f utilities_right_0__16lm1iw1k utilities_bottom_0__16lm1iw1i";
|
|
10925
11193
|
var LoadMaskTextCls = "LoadMask_LoadMaskTextCls__qy58ya4";
|
|
10926
11194
|
|
|
10927
11195
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
@@ -11088,7 +11356,8 @@ function lazyGroup(groupParams, rootData) {
|
|
|
11088
11356
|
}
|
|
11089
11357
|
const res = indexer.indexArray(dataArray, {
|
|
11090
11358
|
toPrimaryKey,
|
|
11091
|
-
cache
|
|
11359
|
+
cache,
|
|
11360
|
+
nodesKey: void 0
|
|
11092
11361
|
});
|
|
11093
11362
|
dataArray = res;
|
|
11094
11363
|
}
|
|
@@ -11101,7 +11370,9 @@ function lazyGroup(groupParams, rootData) {
|
|
|
11101
11370
|
reducerResults: {},
|
|
11102
11371
|
cache: false,
|
|
11103
11372
|
childrenLoading: false,
|
|
11104
|
-
childrenAvailable: false
|
|
11373
|
+
childrenAvailable: false,
|
|
11374
|
+
isTree: false,
|
|
11375
|
+
isGroupBy: true
|
|
11105
11376
|
};
|
|
11106
11377
|
deepMap.set(
|
|
11107
11378
|
[
|
|
@@ -11125,7 +11396,9 @@ function lazyGroup(groupParams, rootData) {
|
|
|
11125
11396
|
childrenAvailable: false,
|
|
11126
11397
|
commonData: dataObject,
|
|
11127
11398
|
totalChildrenCount: dataArray[i].totalChildrenCount,
|
|
11128
|
-
reducerResults: dataArray[i].aggregations || {}
|
|
11399
|
+
reducerResults: dataArray[i].aggregations || {},
|
|
11400
|
+
isTree: false,
|
|
11401
|
+
isGroupBy: true
|
|
11129
11402
|
};
|
|
11130
11403
|
deepMap.set(currentGroupKeys, deepMapGroupValue);
|
|
11131
11404
|
if (pivot) {
|
|
@@ -11215,6 +11488,111 @@ function processGroup(deepMap, currentGroupKeys, currentPivotKeys, item, itemInd
|
|
|
11215
11488
|
currentPivotKeys.length = 0;
|
|
11216
11489
|
}
|
|
11217
11490
|
}
|
|
11491
|
+
function processTreeNode(treeParams, deepMap, treePaths, parentPath, item, itemIndex, reducers, initialReducerValue) {
|
|
11492
|
+
const { isLeafNode, getNodeChildren, toKey } = treeParams;
|
|
11493
|
+
const id = toKey(item);
|
|
11494
|
+
const nodePath = [...parentPath, id];
|
|
11495
|
+
const isLeaf = isLeafNode(item);
|
|
11496
|
+
treePaths.set(nodePath, true);
|
|
11497
|
+
if (isLeaf) {
|
|
11498
|
+
for (let i = 0, len = parentPath.length; i <= len; i++) {
|
|
11499
|
+
const currentPath = parentPath.slice(0, i);
|
|
11500
|
+
const currentTreeValue = deepMap.get(currentPath);
|
|
11501
|
+
const { reducerResults: reducerResults2, items: currentLeafItems } = currentTreeValue;
|
|
11502
|
+
currentLeafItems.push(item);
|
|
11503
|
+
currentTreeValue.leavesAvailableCount++;
|
|
11504
|
+
currentTreeValue.totalLeafNodesCount++;
|
|
11505
|
+
if (reducers) {
|
|
11506
|
+
computeReducersFor(
|
|
11507
|
+
item,
|
|
11508
|
+
itemIndex,
|
|
11509
|
+
reducers,
|
|
11510
|
+
reducerResults2,
|
|
11511
|
+
currentPath
|
|
11512
|
+
);
|
|
11513
|
+
}
|
|
11514
|
+
}
|
|
11515
|
+
return;
|
|
11516
|
+
}
|
|
11517
|
+
const reducerResults = deepClone(initialReducerValue);
|
|
11518
|
+
const items = [];
|
|
11519
|
+
deepMap.set(nodePath, {
|
|
11520
|
+
items,
|
|
11521
|
+
isTree: true,
|
|
11522
|
+
isGroupBy: false,
|
|
11523
|
+
node: item,
|
|
11524
|
+
reducerResults,
|
|
11525
|
+
cache: false,
|
|
11526
|
+
childrenLoading: false,
|
|
11527
|
+
childrenAvailable: true,
|
|
11528
|
+
totalLeafNodesCount: 0,
|
|
11529
|
+
leavesAvailableCount: 0,
|
|
11530
|
+
treeNesting: parentPath.length
|
|
11531
|
+
});
|
|
11532
|
+
const children = getNodeChildren(item);
|
|
11533
|
+
if (!children || !Array.isArray(children)) {
|
|
11534
|
+
return;
|
|
11535
|
+
}
|
|
11536
|
+
for (let i = 0, len = children.length; i < len; i++) {
|
|
11537
|
+
const child = children[i];
|
|
11538
|
+
processTreeNode(
|
|
11539
|
+
treeParams,
|
|
11540
|
+
deepMap,
|
|
11541
|
+
treePaths,
|
|
11542
|
+
nodePath,
|
|
11543
|
+
child,
|
|
11544
|
+
i,
|
|
11545
|
+
reducers,
|
|
11546
|
+
initialReducerValue
|
|
11547
|
+
);
|
|
11548
|
+
}
|
|
11549
|
+
if (reducers) {
|
|
11550
|
+
completeReducers(reducers, reducerResults, items);
|
|
11551
|
+
}
|
|
11552
|
+
}
|
|
11553
|
+
function tree(treeParams, data) {
|
|
11554
|
+
const { reducers } = treeParams;
|
|
11555
|
+
const initialReducerValue = initReducers(reducers);
|
|
11556
|
+
const globalReducerResults = deepClone(initialReducerValue);
|
|
11557
|
+
const deepMap = new DeepMap();
|
|
11558
|
+
const treePaths = new DeepMap();
|
|
11559
|
+
deepMap.set([], {
|
|
11560
|
+
items: [],
|
|
11561
|
+
isTree: true,
|
|
11562
|
+
isGroupBy: false,
|
|
11563
|
+
reducerResults: globalReducerResults,
|
|
11564
|
+
cache: false,
|
|
11565
|
+
childrenLoading: false,
|
|
11566
|
+
childrenAvailable: true,
|
|
11567
|
+
totalLeafNodesCount: 0,
|
|
11568
|
+
leavesAvailableCount: 0,
|
|
11569
|
+
node: null,
|
|
11570
|
+
treeNesting: -1
|
|
11571
|
+
});
|
|
11572
|
+
for (let i = 0, len = data.length; i < len; i++) {
|
|
11573
|
+
processTreeNode(
|
|
11574
|
+
treeParams,
|
|
11575
|
+
deepMap,
|
|
11576
|
+
treePaths,
|
|
11577
|
+
[],
|
|
11578
|
+
data[i],
|
|
11579
|
+
i,
|
|
11580
|
+
reducers,
|
|
11581
|
+
initialReducerValue
|
|
11582
|
+
);
|
|
11583
|
+
}
|
|
11584
|
+
if (reducers) {
|
|
11585
|
+
completeReducers(reducers, globalReducerResults, data);
|
|
11586
|
+
}
|
|
11587
|
+
const result = {
|
|
11588
|
+
deepMap,
|
|
11589
|
+
treeParams,
|
|
11590
|
+
treePaths,
|
|
11591
|
+
initialData: data,
|
|
11592
|
+
reducerResults: globalReducerResults
|
|
11593
|
+
};
|
|
11594
|
+
return result;
|
|
11595
|
+
}
|
|
11218
11596
|
function group(groupParams, data) {
|
|
11219
11597
|
const {
|
|
11220
11598
|
groupBy,
|
|
@@ -11232,6 +11610,8 @@ function group(groupParams, data) {
|
|
|
11232
11610
|
if (!groupByLength) {
|
|
11233
11611
|
const deepMapGroupValue = {
|
|
11234
11612
|
items: [],
|
|
11613
|
+
isTree: false,
|
|
11614
|
+
isGroupBy: true,
|
|
11235
11615
|
cache: false,
|
|
11236
11616
|
childrenLoading: false,
|
|
11237
11617
|
childrenAvailable: false,
|
|
@@ -11267,6 +11647,8 @@ function group(groupParams, data) {
|
|
|
11267
11647
|
if (!deepMap.has(currentGroupKeys)) {
|
|
11268
11648
|
const deepMapGroupValue = {
|
|
11269
11649
|
items: [],
|
|
11650
|
+
isTree: false,
|
|
11651
|
+
isGroupBy: true,
|
|
11270
11652
|
cache: false,
|
|
11271
11653
|
commonData: { ...commonData },
|
|
11272
11654
|
childrenLoading: false,
|
|
@@ -11335,8 +11717,6 @@ function group(groupParams, data) {
|
|
|
11335
11717
|
next?.();
|
|
11336
11718
|
}
|
|
11337
11719
|
);
|
|
11338
|
-
}
|
|
11339
|
-
if (reducers) {
|
|
11340
11720
|
completeReducers(reducers, globalReducerResults, data);
|
|
11341
11721
|
}
|
|
11342
11722
|
const result = {
|
|
@@ -11413,6 +11793,7 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
11413
11793
|
groupCount: groupItems.length,
|
|
11414
11794
|
groupData: groupItems,
|
|
11415
11795
|
groupKeys,
|
|
11796
|
+
isTreeNode: false,
|
|
11416
11797
|
rowSelected: false,
|
|
11417
11798
|
selectedChildredCount: 0,
|
|
11418
11799
|
deselectedChildredCount: 0,
|
|
@@ -11450,6 +11831,14 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
11450
11831
|
};
|
|
11451
11832
|
return enhancedGroupData;
|
|
11452
11833
|
}
|
|
11834
|
+
function toDuplicateRow(parent, indexInAll, currentPage) {
|
|
11835
|
+
return {
|
|
11836
|
+
...parent,
|
|
11837
|
+
id: `duplicate_row_on_page_${currentPage}_for__${parent.id}`,
|
|
11838
|
+
indexInAll,
|
|
11839
|
+
duplicateOf: parent.id
|
|
11840
|
+
};
|
|
11841
|
+
}
|
|
11453
11842
|
function completeReducers(reducers, reducerResults, items) {
|
|
11454
11843
|
if (reducers) {
|
|
11455
11844
|
for (const key in reducers)
|
|
@@ -11462,10 +11851,186 @@ function completeReducers(reducers, reducerResults, items) {
|
|
|
11462
11851
|
}
|
|
11463
11852
|
return reducerResults;
|
|
11464
11853
|
}
|
|
11854
|
+
function flattenTreeNodes(dataArray, parentPath, parents, indexInParentNodes, params, result) {
|
|
11855
|
+
const treeNesting = parentPath.length;
|
|
11856
|
+
const { isLeafNode, getNodeChildren } = params.treeParams;
|
|
11857
|
+
const {
|
|
11858
|
+
toPrimaryKey,
|
|
11859
|
+
treeResult,
|
|
11860
|
+
isRowDisabled,
|
|
11861
|
+
isNodeSelected,
|
|
11862
|
+
withRowInfo,
|
|
11863
|
+
isNodeExpanded,
|
|
11864
|
+
treeSelectionState,
|
|
11865
|
+
repeatWrappedGroupRows,
|
|
11866
|
+
rowsPerPage
|
|
11867
|
+
} = params;
|
|
11868
|
+
const { deepMap } = treeResult;
|
|
11869
|
+
const len = dataArray.length;
|
|
11870
|
+
const currentParent = parents[parents.length - 1];
|
|
11871
|
+
const parentExpanded = currentParent ? currentParent.nodeExpanded : true;
|
|
11872
|
+
for (let i = 0; i < len; i++) {
|
|
11873
|
+
const item = dataArray[i];
|
|
11874
|
+
const key = toPrimaryKey(item, i);
|
|
11875
|
+
const nodePath = [...parentPath, key];
|
|
11876
|
+
const isLeaf = isLeafNode(item);
|
|
11877
|
+
if (isLeaf) {
|
|
11878
|
+
const rowInfo2 = {
|
|
11879
|
+
id: key,
|
|
11880
|
+
nodePath,
|
|
11881
|
+
isGroupRow: false,
|
|
11882
|
+
data: item,
|
|
11883
|
+
treeNesting,
|
|
11884
|
+
totalLeafNodesCount: 0,
|
|
11885
|
+
collapsedLeafNodesCount: 0,
|
|
11886
|
+
isTreeNode: true,
|
|
11887
|
+
isParentNode: false,
|
|
11888
|
+
selfLoaded: true,
|
|
11889
|
+
rowSelected: false,
|
|
11890
|
+
rowDisabled: false,
|
|
11891
|
+
isCellSelected: returnFalse,
|
|
11892
|
+
hasSelectedCells: returnFalse,
|
|
11893
|
+
dataSourceHasGrouping: false,
|
|
11894
|
+
parentNodes: Array.from(parents),
|
|
11895
|
+
indexInParentNodes: [...indexInParentNodes, i],
|
|
11896
|
+
indexInParent: i,
|
|
11897
|
+
indexInAll: parentExpanded ? result.length : -1
|
|
11898
|
+
};
|
|
11899
|
+
if (isNodeSelected) {
|
|
11900
|
+
rowInfo2.rowSelected = isNodeSelected(rowInfo2);
|
|
11901
|
+
}
|
|
11902
|
+
if (isRowDisabled) {
|
|
11903
|
+
rowInfo2.rowDisabled = isRowDisabled(rowInfo2);
|
|
11904
|
+
}
|
|
11905
|
+
if (withRowInfo) {
|
|
11906
|
+
withRowInfo(rowInfo2);
|
|
11907
|
+
}
|
|
11908
|
+
const currentPage = repeatWrappedGroupRows && rowsPerPage != null && rowsPerPage > 0 && rowInfo2.indexInAll % rowsPerPage === 0 ? rowInfo2.indexInAll / rowsPerPage : null;
|
|
11909
|
+
for (let j = 0, len2 = parents.length; j < len2; j++) {
|
|
11910
|
+
const parent = parents[j];
|
|
11911
|
+
if (!parentExpanded) {
|
|
11912
|
+
parent.collapsedLeafNodesCount += 1;
|
|
11913
|
+
}
|
|
11914
|
+
parent.deepRowInfoArray.push(rowInfo2);
|
|
11915
|
+
if (currentPage != null && parentExpanded) {
|
|
11916
|
+
if (typeof repeatWrappedGroupRows === "function" && repeatWrappedGroupRows(parent) !== true) {
|
|
11917
|
+
continue;
|
|
11918
|
+
}
|
|
11919
|
+
const duplicateRowInfo = toDuplicateRow(
|
|
11920
|
+
parent,
|
|
11921
|
+
rowInfo2.indexInAll,
|
|
11922
|
+
currentPage
|
|
11923
|
+
);
|
|
11924
|
+
result[duplicateRowInfo.indexInAll] = duplicateRowInfo;
|
|
11925
|
+
rowInfo2.indexInAll++;
|
|
11926
|
+
}
|
|
11927
|
+
}
|
|
11928
|
+
if (parentExpanded) {
|
|
11929
|
+
result[rowInfo2.indexInAll] = rowInfo2;
|
|
11930
|
+
}
|
|
11931
|
+
continue;
|
|
11932
|
+
}
|
|
11933
|
+
const deepMapValue = deepMap.get(nodePath);
|
|
11934
|
+
const totalLeafNodesCount = deepMapValue?.totalLeafNodesCount ?? 0;
|
|
11935
|
+
const rowInfo = {
|
|
11936
|
+
dataSourceHasGrouping: false,
|
|
11937
|
+
nodeExpanded: false,
|
|
11938
|
+
selfExpanded: false,
|
|
11939
|
+
nodePath,
|
|
11940
|
+
id: key,
|
|
11941
|
+
data: item,
|
|
11942
|
+
indexInAll: result.length,
|
|
11943
|
+
indexInParent: i,
|
|
11944
|
+
indexInParentNodes: [...indexInParentNodes, i],
|
|
11945
|
+
totalLeafNodesCount,
|
|
11946
|
+
treeNesting,
|
|
11947
|
+
selfLoaded: true,
|
|
11948
|
+
isParentNode: true,
|
|
11949
|
+
isTreeNode: true,
|
|
11950
|
+
isGroupRow: false,
|
|
11951
|
+
deepRowInfoArray: [],
|
|
11952
|
+
parentNodes: Array.from(parents),
|
|
11953
|
+
collapsedLeafNodesCount: 0,
|
|
11954
|
+
rowSelected: false,
|
|
11955
|
+
rowDisabled: false,
|
|
11956
|
+
isCellSelected: returnFalse,
|
|
11957
|
+
hasSelectedCells: returnFalse,
|
|
11958
|
+
selectedLeafNodesCount: 0,
|
|
11959
|
+
deselectedLeafNodesCount: 0
|
|
11960
|
+
// selectedLeafNodesCount: 0,
|
|
11961
|
+
// deselectedLeafNodesCount: 0,
|
|
11962
|
+
};
|
|
11963
|
+
if (isNodeSelected) {
|
|
11964
|
+
rowInfo.rowSelected = isNodeSelected(rowInfo);
|
|
11965
|
+
if (treeSelectionState) {
|
|
11966
|
+
const selectionCount = treeSelectionState.getSelectionCountFor(
|
|
11967
|
+
rowInfo.nodePath
|
|
11968
|
+
);
|
|
11969
|
+
rowInfo.selectedLeafNodesCount = selectionCount.selectedCount;
|
|
11970
|
+
rowInfo.deselectedLeafNodesCount = selectionCount.deselectedCount;
|
|
11971
|
+
}
|
|
11972
|
+
}
|
|
11973
|
+
if (isRowDisabled) {
|
|
11974
|
+
rowInfo.rowDisabled = isRowDisabled(rowInfo);
|
|
11975
|
+
}
|
|
11976
|
+
if (withRowInfo) {
|
|
11977
|
+
withRowInfo(rowInfo);
|
|
11978
|
+
}
|
|
11979
|
+
let expanded = true;
|
|
11980
|
+
if (isNodeExpanded) {
|
|
11981
|
+
rowInfo.selfExpanded = expanded = isNodeExpanded(rowInfo);
|
|
11982
|
+
}
|
|
11983
|
+
if (!parentExpanded) {
|
|
11984
|
+
expanded = false;
|
|
11985
|
+
}
|
|
11986
|
+
rowInfo.nodeExpanded = expanded;
|
|
11987
|
+
if (expanded && parentExpanded && repeatWrappedGroupRows && rowsPerPage != null && rowsPerPage > 0) {
|
|
11988
|
+
const indexInAll = rowInfo.indexInAll;
|
|
11989
|
+
const currentParents = rowInfo.parentNodes;
|
|
11990
|
+
if (currentParents.length > 0 && indexInAll % rowsPerPage === 0) {
|
|
11991
|
+
const currentPage = indexInAll / rowsPerPage;
|
|
11992
|
+
let insertCount = 0;
|
|
11993
|
+
currentParents.forEach((parent) => {
|
|
11994
|
+
if (typeof repeatWrappedGroupRows === "function" && repeatWrappedGroupRows(parent) !== true) {
|
|
11995
|
+
return;
|
|
11996
|
+
}
|
|
11997
|
+
result.push(
|
|
11998
|
+
toDuplicateRow(parent, indexInAll + insertCount, currentPage)
|
|
11999
|
+
);
|
|
12000
|
+
insertCount++;
|
|
12001
|
+
rowInfo.indexInAll++;
|
|
12002
|
+
});
|
|
12003
|
+
}
|
|
12004
|
+
}
|
|
12005
|
+
if (parentExpanded) {
|
|
12006
|
+
result[rowInfo.indexInAll] = rowInfo;
|
|
12007
|
+
}
|
|
12008
|
+
const children = getNodeChildren(item);
|
|
12009
|
+
if (Array.isArray(children)) {
|
|
12010
|
+
flattenTreeNodes(
|
|
12011
|
+
children,
|
|
12012
|
+
nodePath,
|
|
12013
|
+
[...parents, rowInfo],
|
|
12014
|
+
rowInfo.indexInParentNodes,
|
|
12015
|
+
params,
|
|
12016
|
+
result
|
|
12017
|
+
);
|
|
12018
|
+
}
|
|
12019
|
+
}
|
|
12020
|
+
return result;
|
|
12021
|
+
}
|
|
12022
|
+
function enhancedTreeFlatten(param) {
|
|
12023
|
+
const { dataArray } = param;
|
|
12024
|
+
const result = [];
|
|
12025
|
+
flattenTreeNodes(dataArray, [], [], [], param, result);
|
|
12026
|
+
return { data: result };
|
|
12027
|
+
}
|
|
11465
12028
|
function enhancedFlatten(param) {
|
|
11466
12029
|
const {
|
|
11467
12030
|
lazyLoad,
|
|
11468
12031
|
groupResult,
|
|
12032
|
+
rowsPerPage,
|
|
12033
|
+
repeatWrappedGroupRows,
|
|
11469
12034
|
withRowInfo,
|
|
11470
12035
|
toPrimaryKey,
|
|
11471
12036
|
groupRowsState,
|
|
@@ -11531,11 +12096,29 @@ function enhancedFlatten(param) {
|
|
|
11531
12096
|
include = false;
|
|
11532
12097
|
}
|
|
11533
12098
|
if (include) {
|
|
11534
|
-
|
|
11535
|
-
|
|
11536
|
-
|
|
11537
|
-
|
|
11538
|
-
|
|
12099
|
+
if (repeatWrappedGroupRows && rowsPerPage != null && rowsPerPage > 0) {
|
|
12100
|
+
const indexInAll = enhancedGroupData.indexInAll;
|
|
12101
|
+
const currentParents = enhancedGroupData.parents;
|
|
12102
|
+
if (currentParents.length > 0 && indexInAll % rowsPerPage === 0) {
|
|
12103
|
+
const currentPage = indexInAll / rowsPerPage;
|
|
12104
|
+
let insertCount = 0;
|
|
12105
|
+
currentParents.forEach((parent2) => {
|
|
12106
|
+
if (typeof repeatWrappedGroupRows === "function" && repeatWrappedGroupRows(parent2) !== true) {
|
|
12107
|
+
return;
|
|
12108
|
+
}
|
|
12109
|
+
result.push(
|
|
12110
|
+
toDuplicateRow(parent2, indexInAll + insertCount, currentPage)
|
|
12111
|
+
);
|
|
12112
|
+
insertCount++;
|
|
12113
|
+
enhancedGroupData.indexInAll++;
|
|
12114
|
+
});
|
|
12115
|
+
}
|
|
12116
|
+
}
|
|
12117
|
+
result.push(enhancedGroupData);
|
|
12118
|
+
groupRowsIndexes.push(result.length - 1);
|
|
12119
|
+
}
|
|
12120
|
+
enhancedGroupData.collapsedChildrenCount = 0;
|
|
12121
|
+
parents.forEach((parent2) => {
|
|
11539
12122
|
parent2.deepRowInfoArray.push(enhancedGroupData);
|
|
11540
12123
|
parent2.collapsedGroupsCount += collapsed ? 1 : 0;
|
|
11541
12124
|
});
|
|
@@ -11550,13 +12133,29 @@ function enhancedFlatten(param) {
|
|
|
11550
12133
|
if (continueWithChildren) {
|
|
11551
12134
|
if (!next) {
|
|
11552
12135
|
if (!pivot) {
|
|
11553
|
-
|
|
12136
|
+
let startIndex = result.length;
|
|
11554
12137
|
if (!collapsed) {
|
|
11555
12138
|
result.length += items.length;
|
|
11556
12139
|
}
|
|
12140
|
+
let extraArtificialGroupRows = 0;
|
|
11557
12141
|
for (let index = 0, len = items.length; index < len; index++) {
|
|
11558
12142
|
const item = items[index];
|
|
11559
|
-
|
|
12143
|
+
if (!collapsed && repeatWrappedGroupRows && rowsPerPage != null && rowsPerPage > 0) {
|
|
12144
|
+
const currentInsertIndex = startIndex + index + extraArtificialGroupRows;
|
|
12145
|
+
if (currentInsertIndex % rowsPerPage === 0) {
|
|
12146
|
+
const currentPage = currentInsertIndex / rowsPerPage;
|
|
12147
|
+
parents.forEach((parent2) => {
|
|
12148
|
+
if (typeof repeatWrappedGroupRows === "function" && repeatWrappedGroupRows(parent2) !== true) {
|
|
12149
|
+
return;
|
|
12150
|
+
}
|
|
12151
|
+
const i = startIndex + index + extraArtificialGroupRows;
|
|
12152
|
+
result[i] = toDuplicateRow(parent2, i, currentPage);
|
|
12153
|
+
extraArtificialGroupRows++;
|
|
12154
|
+
result.length++;
|
|
12155
|
+
});
|
|
12156
|
+
}
|
|
12157
|
+
}
|
|
12158
|
+
const indexInAll = startIndex + index + extraArtificialGroupRows;
|
|
11560
12159
|
const itemId = item ? toPrimaryKey(item, indexInAll) : `${groupKeys}-${index}`;
|
|
11561
12160
|
const rowInfo = {
|
|
11562
12161
|
id: itemId,
|
|
@@ -11564,6 +12163,7 @@ function enhancedFlatten(param) {
|
|
|
11564
12163
|
isCellSelected: returnFalse,
|
|
11565
12164
|
hasSelectedCells: returnFalse,
|
|
11566
12165
|
dataSourceHasGrouping: true,
|
|
12166
|
+
isTreeNode: false,
|
|
11567
12167
|
isGroupRow: false,
|
|
11568
12168
|
selfLoaded: !!item,
|
|
11569
12169
|
rowSelected: false,
|
|
@@ -11599,7 +12199,7 @@ function enhancedFlatten(param) {
|
|
|
11599
12199
|
parent2.deepRowInfoArray.push(rowInfo);
|
|
11600
12200
|
});
|
|
11601
12201
|
if (!collapsed) {
|
|
11602
|
-
result[startIndex + index] = rowInfo;
|
|
12202
|
+
result[startIndex + index + extraArtificialGroupRows] = rowInfo;
|
|
11603
12203
|
}
|
|
11604
12204
|
}
|
|
11605
12205
|
}
|
|
@@ -11620,6 +12220,73 @@ function enhancedFlatten(param) {
|
|
|
11620
12220
|
// src/components/DataSource/index.tsx
|
|
11621
12221
|
var React51 = __toESM(require("react"));
|
|
11622
12222
|
|
|
12223
|
+
// src/utils/groupAndPivot/treeUtils.ts
|
|
12224
|
+
var emptyFn = () => {
|
|
12225
|
+
};
|
|
12226
|
+
function toTreeDataArray(data, options) {
|
|
12227
|
+
const treeMap = new DeepMap();
|
|
12228
|
+
const nodesKey = options.nodesKey ?? "children";
|
|
12229
|
+
const emptyGroup = options.emptyGroup ?? {};
|
|
12230
|
+
const toPath = typeof options.pathKey === "function" ? options.pathKey : (data2) => data2[options.pathKey];
|
|
12231
|
+
for (const item of data) {
|
|
12232
|
+
const path = toPath(item);
|
|
12233
|
+
for (let i = 0; i < path.length; i++) {
|
|
12234
|
+
const p = path.slice(0, i);
|
|
12235
|
+
if (!treeMap.has(p)) {
|
|
12236
|
+
treeMap.set(p, void 0);
|
|
12237
|
+
}
|
|
12238
|
+
}
|
|
12239
|
+
treeMap.set(path, item);
|
|
12240
|
+
}
|
|
12241
|
+
function traverse(path, arr) {
|
|
12242
|
+
const nextLevelKeys = treeMap.getKeysStartingWith(path, true, 1);
|
|
12243
|
+
for (const nextLevelKey of nextLevelKeys) {
|
|
12244
|
+
const p = [...path, nextLevelKey[nextLevelKey.length - 1]];
|
|
12245
|
+
let item = treeMap.get(p);
|
|
12246
|
+
const children = item ? item[nodesKey] ?? [] : [];
|
|
12247
|
+
traverse(p, children);
|
|
12248
|
+
if (children.length) {
|
|
12249
|
+
if (!item) {
|
|
12250
|
+
item = typeof emptyGroup === "function" ? emptyGroup(p, children) : emptyGroup;
|
|
12251
|
+
}
|
|
12252
|
+
item[nodesKey] = children;
|
|
12253
|
+
}
|
|
12254
|
+
arr.push(item);
|
|
12255
|
+
}
|
|
12256
|
+
return arr;
|
|
12257
|
+
}
|
|
12258
|
+
return traverse([], []);
|
|
12259
|
+
}
|
|
12260
|
+
function traverseTreeNode(traverseParams, treeTraverseOptions, parentPath, item) {
|
|
12261
|
+
const { isLeafNode, getNodeChildren, toKey } = traverseParams;
|
|
12262
|
+
const { onParentNode, onNode, onLeafNode } = treeTraverseOptions;
|
|
12263
|
+
const id = toKey(item);
|
|
12264
|
+
const nodePath = [...parentPath, id];
|
|
12265
|
+
const isLeaf = isLeafNode(item);
|
|
12266
|
+
const next = once(() => {
|
|
12267
|
+
const children = getNodeChildren(item);
|
|
12268
|
+
if (!children || !Array.isArray(children)) {
|
|
12269
|
+
return;
|
|
12270
|
+
}
|
|
12271
|
+
for (let i = 0, len = children.length; i < len; i++) {
|
|
12272
|
+
const child = children[i];
|
|
12273
|
+
traverseTreeNode(traverseParams, treeTraverseOptions, nodePath, child);
|
|
12274
|
+
}
|
|
12275
|
+
});
|
|
12276
|
+
if (isLeaf) {
|
|
12277
|
+
onLeafNode?.(item);
|
|
12278
|
+
onNode?.(item, emptyFn);
|
|
12279
|
+
} else {
|
|
12280
|
+
onParentNode?.(item, next, getNodeChildren(item));
|
|
12281
|
+
onNode?.(item, next);
|
|
12282
|
+
}
|
|
12283
|
+
}
|
|
12284
|
+
function treeTraverse(treeParams, traverseOptions, data) {
|
|
12285
|
+
for (let i = 0, len = data.length; i < len; i++) {
|
|
12286
|
+
traverseTreeNode(treeParams, traverseOptions, [], data[i]);
|
|
12287
|
+
}
|
|
12288
|
+
}
|
|
12289
|
+
|
|
11623
12290
|
// src/utils/multisort/sortTypes.ts
|
|
11624
12291
|
var numberComparator = function(first, second) {
|
|
11625
12292
|
return first - second;
|
|
@@ -11640,7 +12307,7 @@ var defaultSortTypes = {
|
|
|
11640
12307
|
var sortTypes_default = defaultSortTypes;
|
|
11641
12308
|
|
|
11642
12309
|
// src/utils/multisort/index.ts
|
|
11643
|
-
|
|
12310
|
+
function toPlainSortInfo(sortInfo) {
|
|
11644
12311
|
const plainSortInfo = sortInfo.map((sortInfo2) => {
|
|
11645
12312
|
if (Array.isArray(sortInfo2.field)) {
|
|
11646
12313
|
return sortInfo2.field.map((field, index) => {
|
|
@@ -11660,7 +12327,63 @@ var multisort = (sortInfo, array, get) => {
|
|
|
11660
12327
|
}
|
|
11661
12328
|
return sortInfo2;
|
|
11662
12329
|
}).flat();
|
|
11663
|
-
|
|
12330
|
+
return plainSortInfo;
|
|
12331
|
+
}
|
|
12332
|
+
var multisort = (sortInfo, array, options) => {
|
|
12333
|
+
const get = typeof options === "function" ? options : options?.get;
|
|
12334
|
+
array.sort(getMultisortFunction(toPlainSortInfo(sortInfo), get));
|
|
12335
|
+
return array;
|
|
12336
|
+
};
|
|
12337
|
+
var multisortNested = (sortInfo, array, options) => {
|
|
12338
|
+
const sortFn = getMultisortFunction(
|
|
12339
|
+
toPlainSortInfo(sortInfo),
|
|
12340
|
+
options.get
|
|
12341
|
+
);
|
|
12342
|
+
const depthFirst = options.depthFirst ?? false;
|
|
12343
|
+
const inplace = options.inplace ?? false;
|
|
12344
|
+
if (!depthFirst) {
|
|
12345
|
+
if (inplace) {
|
|
12346
|
+
array.sort(sortFn);
|
|
12347
|
+
} else {
|
|
12348
|
+
array = [...array].sort(sortFn);
|
|
12349
|
+
}
|
|
12350
|
+
}
|
|
12351
|
+
const { nodesKey, toKey } = options;
|
|
12352
|
+
const getNodeChildren = (node) => {
|
|
12353
|
+
return node[nodesKey];
|
|
12354
|
+
};
|
|
12355
|
+
const isLeafNode = (node) => {
|
|
12356
|
+
return node[nodesKey] === void 0;
|
|
12357
|
+
};
|
|
12358
|
+
treeTraverse(
|
|
12359
|
+
{
|
|
12360
|
+
isLeafNode: options.isLeafNode ?? isLeafNode,
|
|
12361
|
+
getNodeChildren: options.getNodeChildren ?? getNodeChildren,
|
|
12362
|
+
toKey
|
|
12363
|
+
},
|
|
12364
|
+
{
|
|
12365
|
+
onParentNode: (item, next, children) => {
|
|
12366
|
+
if (depthFirst) {
|
|
12367
|
+
next();
|
|
12368
|
+
}
|
|
12369
|
+
if (Array.isArray(children)) {
|
|
12370
|
+
const res = inplace ? children.sort(sortFn) : [...children].sort(sortFn);
|
|
12371
|
+
item[nodesKey] = res;
|
|
12372
|
+
}
|
|
12373
|
+
if (!depthFirst) {
|
|
12374
|
+
next();
|
|
12375
|
+
}
|
|
12376
|
+
}
|
|
12377
|
+
},
|
|
12378
|
+
array
|
|
12379
|
+
);
|
|
12380
|
+
if (depthFirst) {
|
|
12381
|
+
if (inplace) {
|
|
12382
|
+
array.sort(sortFn);
|
|
12383
|
+
} else {
|
|
12384
|
+
array = [...array].sort(sortFn);
|
|
12385
|
+
}
|
|
12386
|
+
}
|
|
11664
12387
|
return array;
|
|
11665
12388
|
};
|
|
11666
12389
|
multisort.knownTypes = sortTypes_default;
|
|
@@ -13010,7 +13733,7 @@ function getRowSelectionApi(param) {
|
|
|
13010
13733
|
const selected = [];
|
|
13011
13734
|
if (state.lazyLoad) {
|
|
13012
13735
|
console.error(
|
|
13013
|
-
`getSelectedPrimaryKeys
|
|
13736
|
+
`getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results`
|
|
13014
13737
|
);
|
|
13015
13738
|
}
|
|
13016
13739
|
state.originalDataArray.forEach((data) => {
|
|
@@ -13063,22 +13786,33 @@ function discardCallsWithEqualArg(fn, timeframe = 50, getCompareObject) {
|
|
|
13063
13786
|
var Indexer = class {
|
|
13064
13787
|
constructor() {
|
|
13065
13788
|
this.primaryKeyToData = /* @__PURE__ */ new Map();
|
|
13789
|
+
this.nodePathsToData = new DeepMap();
|
|
13066
13790
|
this.add = (primaryKey, data) => {
|
|
13067
13791
|
this.primaryKeyToData.set(primaryKey, data);
|
|
13068
13792
|
};
|
|
13793
|
+
this.addNodePath = (nodePath, data) => {
|
|
13794
|
+
this.nodePathsToData.set(nodePath, data);
|
|
13795
|
+
this.add(nodePath[nodePath.length - 1], data);
|
|
13796
|
+
};
|
|
13069
13797
|
this.clear = () => {
|
|
13070
13798
|
this.primaryKeyToData.clear();
|
|
13799
|
+
this.nodePathsToData.clear();
|
|
13071
13800
|
};
|
|
13072
13801
|
this.getDataForPrimaryKey = (primaryKey) => {
|
|
13073
13802
|
return this.primaryKeyToData.get(primaryKey);
|
|
13074
13803
|
};
|
|
13804
|
+
this.getDataForNodePath = (nodePath) => {
|
|
13805
|
+
return this.nodePathsToData.get(nodePath);
|
|
13806
|
+
};
|
|
13075
13807
|
this.indexArray = (arr, options) => {
|
|
13076
|
-
const { cache, toPrimaryKey } = options;
|
|
13808
|
+
const { cache, toPrimaryKey, getNodeChildren, isLeafNode, nodesKey } = options;
|
|
13809
|
+
const isTree = !!getNodeChildren && !!isLeafNode;
|
|
13077
13810
|
if (cache && cache.shouldResetDataSource()) {
|
|
13078
13811
|
this.clear();
|
|
13079
13812
|
arr = [];
|
|
13080
13813
|
}
|
|
13081
|
-
|
|
13814
|
+
const shouldCloneArray = cache && !cache.isEmpty();
|
|
13815
|
+
if (shouldCloneArray) {
|
|
13082
13816
|
arr = arr.concat();
|
|
13083
13817
|
}
|
|
13084
13818
|
if (!arr.length && cache) {
|
|
@@ -13088,49 +13822,89 @@ var Indexer = class {
|
|
|
13088
13822
|
const info = cacheInfo[cacheIndex];
|
|
13089
13823
|
if (info.type === "insert") {
|
|
13090
13824
|
const insertPK = toPrimaryKey(info.data);
|
|
13091
|
-
|
|
13825
|
+
if (isTree) {
|
|
13826
|
+
this.addNodePath([insertPK], info.data);
|
|
13827
|
+
} else {
|
|
13828
|
+
this.add(insertPK, info.data);
|
|
13829
|
+
}
|
|
13092
13830
|
arr.push(info.data);
|
|
13093
13831
|
}
|
|
13094
13832
|
}
|
|
13095
13833
|
cache?.removeInfo(void 0);
|
|
13096
13834
|
}
|
|
13097
13835
|
} else {
|
|
13098
|
-
|
|
13099
|
-
let
|
|
13100
|
-
|
|
13101
|
-
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
13110
|
-
|
|
13836
|
+
const indexArray = (arr2, parentPath) => {
|
|
13837
|
+
for (let i = 0; i < arr2.length; i++) {
|
|
13838
|
+
let item = arr2[i];
|
|
13839
|
+
if (shouldCloneArray && isTree && Array.isArray(item[nodesKey])) {
|
|
13840
|
+
item = arr2[i] = { ...item };
|
|
13841
|
+
}
|
|
13842
|
+
let deleted = false;
|
|
13843
|
+
if (item != null) {
|
|
13844
|
+
const pk = toPrimaryKey(item);
|
|
13845
|
+
const nodePath = isTree ? [...parentPath, pk] : void 0;
|
|
13846
|
+
let isTreeModeForNode = isTree && nodePath;
|
|
13847
|
+
let cacheInfo = isTreeModeForNode ? cache?.getMutationsForNodePath(nodePath) : cache?.getMutationsForPrimaryKey(pk);
|
|
13848
|
+
if (cacheInfo && cacheInfo.length) {
|
|
13849
|
+
for (let cacheIndex = 0, cacheLength = cacheInfo.length; cacheIndex < cacheLength; cacheIndex++) {
|
|
13850
|
+
const info = cacheInfo[cacheIndex];
|
|
13851
|
+
if (info.type === "delete" && !deleted) {
|
|
13852
|
+
if (isTreeModeForNode) {
|
|
13853
|
+
this.nodePathsToData.delete(nodePath);
|
|
13854
|
+
} else {
|
|
13855
|
+
this.primaryKeyToData.delete(pk);
|
|
13856
|
+
}
|
|
13857
|
+
deleted = true;
|
|
13858
|
+
arr2.splice(i, 1);
|
|
13859
|
+
i--;
|
|
13860
|
+
}
|
|
13861
|
+
if (info.type === "update" && !deleted) {
|
|
13862
|
+
item = { ...item, ...info.data };
|
|
13863
|
+
arr2[i] = item;
|
|
13864
|
+
}
|
|
13865
|
+
if (info.type === "insert") {
|
|
13866
|
+
const insertPK = toPrimaryKey(info.data);
|
|
13867
|
+
if (isTreeModeForNode) {
|
|
13868
|
+
const currentPath = [...parentPath, insertPK];
|
|
13869
|
+
this.addNodePath(currentPath, info.data);
|
|
13870
|
+
} else {
|
|
13871
|
+
this.add(insertPK, info.data);
|
|
13872
|
+
}
|
|
13873
|
+
if (info.position === "before") {
|
|
13874
|
+
arr2.splice(i, 0, info.data);
|
|
13875
|
+
i--;
|
|
13876
|
+
} else {
|
|
13877
|
+
arr2.splice(i + 1, 0, info.data);
|
|
13878
|
+
}
|
|
13879
|
+
}
|
|
13111
13880
|
}
|
|
13112
|
-
if (
|
|
13113
|
-
|
|
13114
|
-
|
|
13881
|
+
if (isTreeModeForNode) {
|
|
13882
|
+
cache?.removeNodePathInfo(nodePath);
|
|
13883
|
+
} else {
|
|
13884
|
+
cache?.removeInfo(pk);
|
|
13115
13885
|
}
|
|
13116
|
-
|
|
13117
|
-
|
|
13118
|
-
|
|
13119
|
-
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13123
|
-
|
|
13886
|
+
}
|
|
13887
|
+
if (!deleted) {
|
|
13888
|
+
if (isTreeModeForNode) {
|
|
13889
|
+
const isLeaf = isLeafNode(item);
|
|
13890
|
+
let children = isLeaf ? null : getNodeChildren(item);
|
|
13891
|
+
if (!isLeaf && Array.isArray(children)) {
|
|
13892
|
+
parentPath.push(pk);
|
|
13893
|
+
if (shouldCloneArray) {
|
|
13894
|
+
item[nodesKey] = children = children.concat();
|
|
13895
|
+
}
|
|
13896
|
+
indexArray(children, parentPath);
|
|
13897
|
+
parentPath.pop();
|
|
13124
13898
|
}
|
|
13899
|
+
this.addNodePath(nodePath, item);
|
|
13900
|
+
} else {
|
|
13901
|
+
this.add(pk, item);
|
|
13125
13902
|
}
|
|
13126
13903
|
}
|
|
13127
|
-
cache?.removeInfo(pk);
|
|
13128
|
-
}
|
|
13129
|
-
if (!deleted) {
|
|
13130
|
-
this.add(pk, item);
|
|
13131
13904
|
}
|
|
13132
13905
|
}
|
|
13133
|
-
}
|
|
13906
|
+
};
|
|
13907
|
+
indexArray(arr, []);
|
|
13134
13908
|
}
|
|
13135
13909
|
return arr;
|
|
13136
13910
|
};
|
|
@@ -13398,6 +14172,7 @@ var DataSourceCache = class {
|
|
|
13398
14172
|
this.affectedFields = /* @__PURE__ */ new Set();
|
|
13399
14173
|
this.allFieldsAffected = false;
|
|
13400
14174
|
this.primaryKeyToData = /* @__PURE__ */ new Map();
|
|
14175
|
+
this.nodePathToData = new DeepMap();
|
|
13401
14176
|
this.getAffectedFields = () => {
|
|
13402
14177
|
if (this.allFieldsAffected) {
|
|
13403
14178
|
return true;
|
|
@@ -13416,6 +14191,17 @@ var DataSourceCache = class {
|
|
|
13416
14191
|
});
|
|
13417
14192
|
this.primaryKeyToData.set(pk, value);
|
|
13418
14193
|
};
|
|
14194
|
+
this.deleteNodePath = (nodePath, originalData, metadata) => {
|
|
14195
|
+
this.allFieldsAffected = true;
|
|
14196
|
+
const value = this.nodePathToData.get(nodePath) || [];
|
|
14197
|
+
value.push({
|
|
14198
|
+
type: "delete",
|
|
14199
|
+
nodePath,
|
|
14200
|
+
originalData,
|
|
14201
|
+
metadata
|
|
14202
|
+
});
|
|
14203
|
+
this.nodePathToData.set(nodePath, value);
|
|
14204
|
+
};
|
|
13419
14205
|
this.insert = (primaryKey, data, position2, metadata) => {
|
|
13420
14206
|
const pk = primaryKey;
|
|
13421
14207
|
const value = this.primaryKeyToData.get(pk) || [];
|
|
@@ -13430,6 +14216,19 @@ var DataSourceCache = class {
|
|
|
13430
14216
|
});
|
|
13431
14217
|
this.primaryKeyToData.set(pk, value);
|
|
13432
14218
|
};
|
|
14219
|
+
this.insertNodePath = (nodePath, data, position2, metadata) => {
|
|
14220
|
+
const value = this.nodePathToData.get(nodePath) || [];
|
|
14221
|
+
this.allFieldsAffected = true;
|
|
14222
|
+
value.push({
|
|
14223
|
+
type: "insert",
|
|
14224
|
+
nodePath,
|
|
14225
|
+
data,
|
|
14226
|
+
position: position2,
|
|
14227
|
+
originalData: null,
|
|
14228
|
+
metadata
|
|
14229
|
+
});
|
|
14230
|
+
this.nodePathToData.set(nodePath, value);
|
|
14231
|
+
};
|
|
13433
14232
|
this.update = (primaryKey, data, originalData, metadata) => {
|
|
13434
14233
|
if (!this.allFieldsAffected) {
|
|
13435
14234
|
const keys = Object.keys(data);
|
|
@@ -13446,6 +14245,21 @@ var DataSourceCache = class {
|
|
|
13446
14245
|
});
|
|
13447
14246
|
this.primaryKeyToData.set(primaryKey, value);
|
|
13448
14247
|
};
|
|
14248
|
+
this.updateNodePath = (nodePath, data, originalData, metadata) => {
|
|
14249
|
+
if (!this.allFieldsAffected) {
|
|
14250
|
+
const keys = Object.keys(data);
|
|
14251
|
+
keys.forEach((key) => this.affectedFields.add(key));
|
|
14252
|
+
}
|
|
14253
|
+
const value = this.nodePathToData.get(nodePath) || [];
|
|
14254
|
+
value.push({
|
|
14255
|
+
type: "update",
|
|
14256
|
+
nodePath,
|
|
14257
|
+
data,
|
|
14258
|
+
originalData,
|
|
14259
|
+
metadata
|
|
14260
|
+
});
|
|
14261
|
+
this.nodePathToData.set(nodePath, value);
|
|
14262
|
+
};
|
|
13449
14263
|
this.resetDataSource = (metadata) => {
|
|
13450
14264
|
this.clear();
|
|
13451
14265
|
this.allFieldsAffected = true;
|
|
@@ -13467,21 +14281,31 @@ var DataSourceCache = class {
|
|
|
13467
14281
|
this.primaryKeyToData.clear();
|
|
13468
14282
|
};
|
|
13469
14283
|
this.isEmpty = () => {
|
|
13470
|
-
return this.primaryKeyToData.size === 0;
|
|
14284
|
+
return this.primaryKeyToData.size === 0 && this.nodePathToData.size === 0;
|
|
13471
14285
|
};
|
|
13472
14286
|
this.removeInfo = (primaryKey) => {
|
|
13473
14287
|
this.primaryKeyToData.delete(primaryKey);
|
|
13474
14288
|
};
|
|
14289
|
+
this.removeNodePathInfo = (nodePath) => {
|
|
14290
|
+
this.nodePathToData.delete(nodePath);
|
|
14291
|
+
};
|
|
13475
14292
|
this.getMutationsForPrimaryKey = (primaryKey) => {
|
|
13476
14293
|
const data = this.primaryKeyToData.get(primaryKey);
|
|
13477
14294
|
return data;
|
|
13478
14295
|
};
|
|
14296
|
+
this.getMutationsForNodePath = (nodePath) => {
|
|
14297
|
+
const data = this.nodePathToData.get(nodePath);
|
|
14298
|
+
return data;
|
|
14299
|
+
};
|
|
13479
14300
|
this.getMutationsCount = () => {
|
|
13480
14301
|
return this.primaryKeyToData.size;
|
|
13481
14302
|
};
|
|
13482
14303
|
this.getMutations = () => {
|
|
13483
14304
|
return new Map(this.primaryKeyToData);
|
|
13484
14305
|
};
|
|
14306
|
+
this.getTreeMutations = () => {
|
|
14307
|
+
return DeepMap.clone(this.nodePathToData);
|
|
14308
|
+
};
|
|
13485
14309
|
this.getMutationsArray = () => {
|
|
13486
14310
|
return Array.from(this.primaryKeyToData.values()).flat();
|
|
13487
14311
|
};
|
|
@@ -13493,6 +14317,7 @@ var DataSourceCache = class {
|
|
|
13493
14317
|
clone.primaryKeyToData = light ? cache.primaryKeyToData : new Map(
|
|
13494
14318
|
cache.primaryKeyToData
|
|
13495
14319
|
);
|
|
14320
|
+
clone.nodePathToData = light ? cache.nodePathToData : DeepMap.clone(cache.nodePathToData);
|
|
13496
14321
|
return clone;
|
|
13497
14322
|
}
|
|
13498
14323
|
};
|
|
@@ -13505,6 +14330,657 @@ function getRowInfoArray(getState) {
|
|
|
13505
14330
|
return getState().dataArray;
|
|
13506
14331
|
}
|
|
13507
14332
|
|
|
14333
|
+
// src/components/DataSource/TreeExpandState.ts
|
|
14334
|
+
var TreeExpandState = class {
|
|
14335
|
+
constructor(clone) {
|
|
14336
|
+
this.collapsedPathsMap = new DeepMap();
|
|
14337
|
+
this.expandedPathsMap = new DeepMap();
|
|
14338
|
+
this.collapsedIdsMap = /* @__PURE__ */ new Map();
|
|
14339
|
+
this.expandedIdsMap = /* @__PURE__ */ new Map();
|
|
14340
|
+
this._mode = "path";
|
|
14341
|
+
this.defaultExpanded = false;
|
|
14342
|
+
this.expandAll = () => {
|
|
14343
|
+
this.update({
|
|
14344
|
+
defaultExpanded: true,
|
|
14345
|
+
collapsedPaths: []
|
|
14346
|
+
});
|
|
14347
|
+
};
|
|
14348
|
+
this.collapseAll = () => {
|
|
14349
|
+
this.update({
|
|
14350
|
+
defaultExpanded: false,
|
|
14351
|
+
expandedPaths: []
|
|
14352
|
+
});
|
|
14353
|
+
};
|
|
14354
|
+
const stateObject = clone && clone instanceof Object.getPrototypeOf(this).constructor ? clone.getState() : clone;
|
|
14355
|
+
if (stateObject) {
|
|
14356
|
+
this.update(stateObject);
|
|
14357
|
+
}
|
|
14358
|
+
}
|
|
14359
|
+
get mode() {
|
|
14360
|
+
return this._mode;
|
|
14361
|
+
}
|
|
14362
|
+
reset() {
|
|
14363
|
+
this.collapsedPathsMap.clear();
|
|
14364
|
+
this.expandedPathsMap.clear();
|
|
14365
|
+
this.collapsedIdsMap.clear();
|
|
14366
|
+
this.expandedIdsMap.clear();
|
|
14367
|
+
}
|
|
14368
|
+
destroy() {
|
|
14369
|
+
this.reset();
|
|
14370
|
+
}
|
|
14371
|
+
expandNode(nodePathOrId) {
|
|
14372
|
+
this.setNodeExpanded(nodePathOrId, true);
|
|
14373
|
+
}
|
|
14374
|
+
collapseNode(nodePathOrId) {
|
|
14375
|
+
this.setNodeExpanded(nodePathOrId, false);
|
|
14376
|
+
}
|
|
14377
|
+
setNodeExpanded(nodePathOrId, expanded) {
|
|
14378
|
+
const {
|
|
14379
|
+
collapsedPathsMap,
|
|
14380
|
+
collapsedIdsMap,
|
|
14381
|
+
expandedPathsMap,
|
|
14382
|
+
expandedIdsMap,
|
|
14383
|
+
defaultExpanded,
|
|
14384
|
+
_mode: selectionMode
|
|
14385
|
+
} = this;
|
|
14386
|
+
if (selectionMode === "id" && Array.isArray(nodePathOrId)) {
|
|
14387
|
+
nodePathOrId = nodePathOrId[nodePathOrId.length - 1];
|
|
14388
|
+
}
|
|
14389
|
+
if (expanded === defaultExpanded) {
|
|
14390
|
+
if (expanded) {
|
|
14391
|
+
if (selectionMode === "path" && Array.isArray(nodePathOrId)) {
|
|
14392
|
+
collapsedPathsMap.delete(nodePathOrId);
|
|
14393
|
+
} else {
|
|
14394
|
+
collapsedIdsMap.delete(nodePathOrId);
|
|
14395
|
+
}
|
|
14396
|
+
} else {
|
|
14397
|
+
if (selectionMode === "path" && Array.isArray(nodePathOrId)) {
|
|
14398
|
+
expandedPathsMap.delete(nodePathOrId);
|
|
14399
|
+
} else {
|
|
14400
|
+
expandedIdsMap.delete(nodePathOrId);
|
|
14401
|
+
}
|
|
14402
|
+
}
|
|
14403
|
+
} else {
|
|
14404
|
+
if (expanded) {
|
|
14405
|
+
if (selectionMode === "path" && Array.isArray(nodePathOrId)) {
|
|
14406
|
+
expandedPathsMap.set(nodePathOrId, true);
|
|
14407
|
+
} else {
|
|
14408
|
+
expandedIdsMap.set(nodePathOrId, true);
|
|
14409
|
+
}
|
|
14410
|
+
} else {
|
|
14411
|
+
if (selectionMode === "path" && Array.isArray(nodePathOrId)) {
|
|
14412
|
+
collapsedPathsMap.set(nodePathOrId, true);
|
|
14413
|
+
} else {
|
|
14414
|
+
collapsedIdsMap.set(nodePathOrId, true);
|
|
14415
|
+
}
|
|
14416
|
+
}
|
|
14417
|
+
}
|
|
14418
|
+
}
|
|
14419
|
+
isNodeExpandedByPath(nodePath) {
|
|
14420
|
+
return this.isNodeExpanded(nodePath);
|
|
14421
|
+
}
|
|
14422
|
+
isNodeExpandedById(id) {
|
|
14423
|
+
return this.isNodeExpanded(id);
|
|
14424
|
+
}
|
|
14425
|
+
isNodeExpanded(nodePathOrId) {
|
|
14426
|
+
if (this._mode === "id" && Array.isArray(nodePathOrId)) {
|
|
14427
|
+
nodePathOrId = nodePathOrId[nodePathOrId.length - 1];
|
|
14428
|
+
}
|
|
14429
|
+
if (this._mode === "id" && Array.isArray(nodePathOrId)) {
|
|
14430
|
+
throw `You try to check if a node is expanded by id (${nodePathOrId}) but your TreeExpandState is configured to use node paths.`;
|
|
14431
|
+
}
|
|
14432
|
+
if (this._mode === "path" && !Array.isArray(nodePathOrId)) {
|
|
14433
|
+
throw `You try to check if a node is expanded by path (${nodePathOrId}) but your TreeExpandState is configured to use node ids.`;
|
|
14434
|
+
}
|
|
14435
|
+
if (this.defaultExpanded) {
|
|
14436
|
+
if (this._mode === "path" && Array.isArray(nodePathOrId)) {
|
|
14437
|
+
return !this.collapsedPathsMap.has(nodePathOrId);
|
|
14438
|
+
} else {
|
|
14439
|
+
return !this.collapsedIdsMap.has(nodePathOrId);
|
|
14440
|
+
}
|
|
14441
|
+
}
|
|
14442
|
+
if (this._mode === "path" && Array.isArray(nodePathOrId)) {
|
|
14443
|
+
return this.expandedPathsMap.has(nodePathOrId);
|
|
14444
|
+
}
|
|
14445
|
+
return this.expandedIdsMap.has(nodePathOrId);
|
|
14446
|
+
}
|
|
14447
|
+
update(stateObject) {
|
|
14448
|
+
this.defaultExpanded = stateObject.defaultExpanded;
|
|
14449
|
+
this.reset();
|
|
14450
|
+
if (stateObject.expandedPaths || stateObject.collapsedPaths) {
|
|
14451
|
+
this._mode = "path";
|
|
14452
|
+
const expandedPaths = stateObject.expandedPaths || null;
|
|
14453
|
+
const collapsedPaths = stateObject.collapsedPaths || null;
|
|
14454
|
+
if (expandedPaths) {
|
|
14455
|
+
for (let i = 0, len = expandedPaths.length; i < len; i++) {
|
|
14456
|
+
this.expandedPathsMap.set(expandedPaths[i], true);
|
|
14457
|
+
}
|
|
14458
|
+
}
|
|
14459
|
+
if (collapsedPaths) {
|
|
14460
|
+
for (let i = 0, len = collapsedPaths.length; i < len; i++) {
|
|
14461
|
+
this.collapsedPathsMap.set(collapsedPaths[i], true);
|
|
14462
|
+
}
|
|
14463
|
+
}
|
|
14464
|
+
return;
|
|
14465
|
+
}
|
|
14466
|
+
this._mode = "id";
|
|
14467
|
+
const expandedIds = stateObject.expandedIds || null;
|
|
14468
|
+
const collapsedIds = stateObject.collapsedIds || null;
|
|
14469
|
+
if (expandedIds) {
|
|
14470
|
+
for (let i = 0, len = expandedIds.length; i < len; i++) {
|
|
14471
|
+
this.expandedIdsMap.set(expandedIds[i], true);
|
|
14472
|
+
}
|
|
14473
|
+
}
|
|
14474
|
+
if (collapsedIds) {
|
|
14475
|
+
for (let i = 0, len = collapsedIds.length; i < len; i++) {
|
|
14476
|
+
this.collapsedIdsMap.set(collapsedIds[i], true);
|
|
14477
|
+
}
|
|
14478
|
+
}
|
|
14479
|
+
}
|
|
14480
|
+
getState() {
|
|
14481
|
+
if (this._mode === "path") {
|
|
14482
|
+
const collapsedPaths = Array.from(
|
|
14483
|
+
this.collapsedPathsMap.keys()
|
|
14484
|
+
);
|
|
14485
|
+
const expandedPaths = Array.from(
|
|
14486
|
+
this.expandedPathsMap.keys()
|
|
14487
|
+
);
|
|
14488
|
+
return {
|
|
14489
|
+
defaultExpanded: this.defaultExpanded,
|
|
14490
|
+
collapsedPaths,
|
|
14491
|
+
expandedPaths
|
|
14492
|
+
};
|
|
14493
|
+
}
|
|
14494
|
+
const collapsedIds = Array.from(
|
|
14495
|
+
this.collapsedIdsMap.keys()
|
|
14496
|
+
);
|
|
14497
|
+
const expandedIds = Array.from(
|
|
14498
|
+
this.expandedIdsMap.keys()
|
|
14499
|
+
);
|
|
14500
|
+
return {
|
|
14501
|
+
defaultExpanded: this.defaultExpanded,
|
|
14502
|
+
collapsedIds,
|
|
14503
|
+
expandedIds
|
|
14504
|
+
};
|
|
14505
|
+
}
|
|
14506
|
+
};
|
|
14507
|
+
|
|
14508
|
+
// src/components/DataSource/TreeSelectionState.ts
|
|
14509
|
+
var shortestToLongest = (a, b) => a.length - b.length;
|
|
14510
|
+
var TreeSelectionState = class {
|
|
14511
|
+
constructor(state, getConfig) {
|
|
14512
|
+
this.selectedPaths = null;
|
|
14513
|
+
this.deselectedPaths = null;
|
|
14514
|
+
this.defaultSelection = false;
|
|
14515
|
+
this.selectionMap = new DeepMap();
|
|
14516
|
+
this.cache = new DeepMap();
|
|
14517
|
+
const stateObject = state instanceof Object.getPrototypeOf(this).constructor ? (
|
|
14518
|
+
//@ts-ignore
|
|
14519
|
+
state.getState()
|
|
14520
|
+
) : state;
|
|
14521
|
+
this.setConfigFn(getConfig);
|
|
14522
|
+
this.update(stateObject);
|
|
14523
|
+
}
|
|
14524
|
+
getTreeDeepMap() {
|
|
14525
|
+
return this.getConfig().treeDeepMap;
|
|
14526
|
+
}
|
|
14527
|
+
isLeafNode(nodePath) {
|
|
14528
|
+
return !this.getTreeDeepMap().has(nodePath);
|
|
14529
|
+
}
|
|
14530
|
+
getLeafNodesCount(nodePath) {
|
|
14531
|
+
const treeDeepMap = this.getTreeDeepMap();
|
|
14532
|
+
const deepMapValue = treeDeepMap.get(nodePath);
|
|
14533
|
+
if (!deepMapValue) {
|
|
14534
|
+
return 1;
|
|
14535
|
+
}
|
|
14536
|
+
return deepMapValue.items.length;
|
|
14537
|
+
}
|
|
14538
|
+
static from(treeSelectionState, getConfig) {
|
|
14539
|
+
return new TreeSelectionState(treeSelectionState, getConfig);
|
|
14540
|
+
}
|
|
14541
|
+
setConfigFn(getConfig) {
|
|
14542
|
+
this.getConfig = getConfig;
|
|
14543
|
+
this.xcache();
|
|
14544
|
+
}
|
|
14545
|
+
xcache() {
|
|
14546
|
+
this.cache.clear();
|
|
14547
|
+
}
|
|
14548
|
+
update(stateObject) {
|
|
14549
|
+
this.selectedPaths = stateObject.selectedPaths || null;
|
|
14550
|
+
this.deselectedPaths = stateObject.deselectedPaths || null;
|
|
14551
|
+
const { selectionMap, selectedPaths, deselectedPaths } = this;
|
|
14552
|
+
selectionMap.clear();
|
|
14553
|
+
selectedPaths?.forEach(
|
|
14554
|
+
(nodePath) => this.setSelectionForPath(nodePath, true)
|
|
14555
|
+
);
|
|
14556
|
+
deselectedPaths?.forEach(
|
|
14557
|
+
(nodePath) => this.setSelectionForPath(nodePath, false)
|
|
14558
|
+
);
|
|
14559
|
+
this.defaultSelection = stateObject.defaultSelection;
|
|
14560
|
+
this.xcache();
|
|
14561
|
+
}
|
|
14562
|
+
setSelectionForPath(nodePath, selected) {
|
|
14563
|
+
this.selectionMap.set(nodePath, selected);
|
|
14564
|
+
}
|
|
14565
|
+
getState() {
|
|
14566
|
+
const selectedPaths = [];
|
|
14567
|
+
const deselectedPaths = [];
|
|
14568
|
+
this.selectionMap.topDownEntries().forEach(([path, value]) => {
|
|
14569
|
+
if (value) {
|
|
14570
|
+
selectedPaths.push(path);
|
|
14571
|
+
} else {
|
|
14572
|
+
deselectedPaths.push(path);
|
|
14573
|
+
}
|
|
14574
|
+
});
|
|
14575
|
+
return {
|
|
14576
|
+
defaultSelection: this.defaultSelection,
|
|
14577
|
+
selectedPaths,
|
|
14578
|
+
deselectedPaths
|
|
14579
|
+
};
|
|
14580
|
+
}
|
|
14581
|
+
deselectAll() {
|
|
14582
|
+
this.update({
|
|
14583
|
+
defaultSelection: false,
|
|
14584
|
+
selectedPaths: [],
|
|
14585
|
+
deselectedPaths: []
|
|
14586
|
+
});
|
|
14587
|
+
}
|
|
14588
|
+
selectAll() {
|
|
14589
|
+
this.update({
|
|
14590
|
+
defaultSelection: true,
|
|
14591
|
+
deselectedPaths: [],
|
|
14592
|
+
selectedPaths: []
|
|
14593
|
+
});
|
|
14594
|
+
}
|
|
14595
|
+
isNodeSelected(nodePath) {
|
|
14596
|
+
return this.isPathSelected(nodePath);
|
|
14597
|
+
}
|
|
14598
|
+
isSelfSelected(nodePath) {
|
|
14599
|
+
return this.selectionMap.get(nodePath) ?? null;
|
|
14600
|
+
}
|
|
14601
|
+
cacheIt(nodePath, state) {
|
|
14602
|
+
this.cache.set(nodePath, state);
|
|
14603
|
+
return state;
|
|
14604
|
+
}
|
|
14605
|
+
getSelectionStateForNode(nodePath, earlyExit) {
|
|
14606
|
+
const cachedResult = this.cache.get(nodePath);
|
|
14607
|
+
if (cachedResult) {
|
|
14608
|
+
return cachedResult;
|
|
14609
|
+
}
|
|
14610
|
+
if (this.isLeafNode(nodePath)) {
|
|
14611
|
+
const selected = this.isSelfSelected(nodePath);
|
|
14612
|
+
if (selected !== null) {
|
|
14613
|
+
return this.cacheIt(nodePath, {
|
|
14614
|
+
selected,
|
|
14615
|
+
selectedCount: selected ? 1 : 0,
|
|
14616
|
+
deselectedCount: selected ? 0 : 1,
|
|
14617
|
+
leafCount: 1
|
|
14618
|
+
});
|
|
14619
|
+
}
|
|
14620
|
+
}
|
|
14621
|
+
const leafCount = this.getLeafNodesCount(nodePath);
|
|
14622
|
+
let currentSelectionState = this.isSelfSelected(nodePath);
|
|
14623
|
+
const { selectionMap } = this;
|
|
14624
|
+
const childPaths = selectionMap.getKeysStartingWith(nodePath, true).sort(shortestToLongest);
|
|
14625
|
+
if (!childPaths.length) {
|
|
14626
|
+
if (currentSelectionState !== null) {
|
|
14627
|
+
const res2 = leafCount ? currentSelectionState : (
|
|
14628
|
+
/* if this has no leaves, we'll consider it deselected */
|
|
14629
|
+
false
|
|
14630
|
+
);
|
|
14631
|
+
return this.cacheIt(nodePath, {
|
|
14632
|
+
selected: res2,
|
|
14633
|
+
selectedCount: res2 ? leafCount : 0,
|
|
14634
|
+
deselectedCount: res2 ? 0 : leafCount,
|
|
14635
|
+
leafCount
|
|
14636
|
+
});
|
|
14637
|
+
}
|
|
14638
|
+
const res = leafCount ? this.getNodeBooleanSelectionStateFromParent(nodePath) : false;
|
|
14639
|
+
return this.cacheIt(nodePath, {
|
|
14640
|
+
selected: res,
|
|
14641
|
+
selectedCount: res ? leafCount : 0,
|
|
14642
|
+
deselectedCount: res ? 0 : leafCount,
|
|
14643
|
+
leafCount
|
|
14644
|
+
});
|
|
14645
|
+
}
|
|
14646
|
+
let selectedCount = 0;
|
|
14647
|
+
let deselectedCount = 0;
|
|
14648
|
+
const selfSelected = this.getNodeBooleanSelectionStateFromParent(nodePath);
|
|
14649
|
+
if (selfSelected) {
|
|
14650
|
+
selectedCount += leafCount;
|
|
14651
|
+
} else {
|
|
14652
|
+
deselectedCount += leafCount;
|
|
14653
|
+
}
|
|
14654
|
+
for (let i = 0, len = childPaths.length; i < len; i++) {
|
|
14655
|
+
const childPath = childPaths[i];
|
|
14656
|
+
const { selectedCount: selCount, deselectedCount: deselCount } = this.getSelectionStateForNode(childPath);
|
|
14657
|
+
if (selfSelected) {
|
|
14658
|
+
selectedCount -= deselCount;
|
|
14659
|
+
deselectedCount += deselCount;
|
|
14660
|
+
} else {
|
|
14661
|
+
deselectedCount -= selCount;
|
|
14662
|
+
selectedCount += selCount;
|
|
14663
|
+
}
|
|
14664
|
+
if (earlyExit && selCount > 0 && deselCount > 0) {
|
|
14665
|
+
return this.cacheIt(nodePath, {
|
|
14666
|
+
selected: null,
|
|
14667
|
+
leafCount,
|
|
14668
|
+
selectedCount,
|
|
14669
|
+
deselectedCount
|
|
14670
|
+
});
|
|
14671
|
+
}
|
|
14672
|
+
}
|
|
14673
|
+
if (!selectedCount && !deselectedCount) {
|
|
14674
|
+
return this.cacheIt(nodePath, {
|
|
14675
|
+
selected: selfSelected,
|
|
14676
|
+
selectedCount: selfSelected ? leafCount : 0,
|
|
14677
|
+
deselectedCount: selfSelected ? 0 : leafCount,
|
|
14678
|
+
leafCount
|
|
14679
|
+
});
|
|
14680
|
+
}
|
|
14681
|
+
if (selectedCount) {
|
|
14682
|
+
const res = selectedCount === leafCount ? true : null;
|
|
14683
|
+
return this.cacheIt(nodePath, {
|
|
14684
|
+
selected: res,
|
|
14685
|
+
selectedCount,
|
|
14686
|
+
deselectedCount,
|
|
14687
|
+
leafCount
|
|
14688
|
+
});
|
|
14689
|
+
}
|
|
14690
|
+
return this.cacheIt(nodePath, {
|
|
14691
|
+
selected: false,
|
|
14692
|
+
selectedCount: 0,
|
|
14693
|
+
deselectedCount: leafCount,
|
|
14694
|
+
leafCount
|
|
14695
|
+
});
|
|
14696
|
+
}
|
|
14697
|
+
isPathSelected(nodePath) {
|
|
14698
|
+
return this.getSelectionStateForNode(nodePath, true).selected;
|
|
14699
|
+
}
|
|
14700
|
+
getNodeBooleanSelectionStateFromParent(initialNodePath) {
|
|
14701
|
+
const { defaultSelection, selectionMap } = this;
|
|
14702
|
+
if (!initialNodePath.length) {
|
|
14703
|
+
return defaultSelection;
|
|
14704
|
+
}
|
|
14705
|
+
const nodePath = [...initialNodePath];
|
|
14706
|
+
do {
|
|
14707
|
+
const currentValue = selectionMap.get(nodePath);
|
|
14708
|
+
if (currentValue !== void 0) {
|
|
14709
|
+
return currentValue;
|
|
14710
|
+
}
|
|
14711
|
+
nodePath.pop();
|
|
14712
|
+
} while (nodePath.length);
|
|
14713
|
+
return defaultSelection;
|
|
14714
|
+
}
|
|
14715
|
+
setNodeSelection(nodePath, selected) {
|
|
14716
|
+
if (!nodePath.length) {
|
|
14717
|
+
return;
|
|
14718
|
+
}
|
|
14719
|
+
const keys = this.selectionMap.getKeysStartingWith(nodePath);
|
|
14720
|
+
keys.forEach((nodePath2) => {
|
|
14721
|
+
this.selectionMap.delete(nodePath2);
|
|
14722
|
+
});
|
|
14723
|
+
if (nodePath.length === 1 && this.defaultSelection === selected) {
|
|
14724
|
+
} else {
|
|
14725
|
+
this.setSelectionForPath(nodePath, selected);
|
|
14726
|
+
if (nodePath.length > 1) {
|
|
14727
|
+
const parentPath = nodePath.slice(0, -1);
|
|
14728
|
+
const parentSelected = this.isNodeSelected(parentPath);
|
|
14729
|
+
if (parentSelected === selected) {
|
|
14730
|
+
this.setNodeSelection(parentPath, selected);
|
|
14731
|
+
}
|
|
14732
|
+
}
|
|
14733
|
+
}
|
|
14734
|
+
}
|
|
14735
|
+
selectNode(nodePath) {
|
|
14736
|
+
this.setNodeSelection(nodePath, true);
|
|
14737
|
+
}
|
|
14738
|
+
deselectNode(nodePath) {
|
|
14739
|
+
this.setNodeSelection(nodePath, false);
|
|
14740
|
+
}
|
|
14741
|
+
toggleNodeSelection(nodePath) {
|
|
14742
|
+
this.setNodeSelection(nodePath, !this.isNodeSelected(nodePath));
|
|
14743
|
+
}
|
|
14744
|
+
getSelectedCount() {
|
|
14745
|
+
return this.getSelectionCountFor([]).selectedCount;
|
|
14746
|
+
}
|
|
14747
|
+
getDeselectedCount() {
|
|
14748
|
+
return this.getSelectionCountFor([]).deselectedCount;
|
|
14749
|
+
}
|
|
14750
|
+
getSelectionCountFor(nodePath = []) {
|
|
14751
|
+
const { selectedCount, deselectedCount } = this.getSelectionStateForNode(nodePath);
|
|
14752
|
+
return {
|
|
14753
|
+
selectedCount,
|
|
14754
|
+
deselectedCount
|
|
14755
|
+
};
|
|
14756
|
+
}
|
|
14757
|
+
destroy() {
|
|
14758
|
+
this.getConfig = null;
|
|
14759
|
+
this.xcache();
|
|
14760
|
+
this.selectionMap.clear();
|
|
14761
|
+
}
|
|
14762
|
+
};
|
|
14763
|
+
|
|
14764
|
+
// src/components/DataSource/getTreeApi.ts
|
|
14765
|
+
function cloneTreeSelection(treeSelection, stateOrGetState) {
|
|
14766
|
+
return new TreeSelectionState(
|
|
14767
|
+
treeSelection,
|
|
14768
|
+
treeSelectionStateConfigGetter(stateOrGetState)
|
|
14769
|
+
);
|
|
14770
|
+
}
|
|
14771
|
+
function treeSelectionStateConfigGetter(stateOrStateGetter) {
|
|
14772
|
+
return () => {
|
|
14773
|
+
const state = typeof stateOrStateGetter === "function" ? stateOrStateGetter() : stateOrStateGetter;
|
|
14774
|
+
return {
|
|
14775
|
+
treeDeepMap: state.treeDeepMap
|
|
14776
|
+
};
|
|
14777
|
+
};
|
|
14778
|
+
}
|
|
14779
|
+
function getTreeApi(param) {
|
|
14780
|
+
const { getState, actions, dataSourceApi } = param;
|
|
14781
|
+
const setNodeSelection = (nodePath, selected) => {
|
|
14782
|
+
const { treeSelectionState: treeSelection, selectionMode } = getState();
|
|
14783
|
+
if (selectionMode === "single-row") {
|
|
14784
|
+
actions.treeSelection = selected ? nodePath[nodePath.length - 1] : null;
|
|
14785
|
+
return;
|
|
14786
|
+
}
|
|
14787
|
+
if (selectionMode !== "multi-row") {
|
|
14788
|
+
throw "Selection mode is not multi-row or single-row";
|
|
14789
|
+
}
|
|
14790
|
+
if (!(treeSelection instanceof TreeSelectionState)) {
|
|
14791
|
+
throw "Invalid tree selection";
|
|
14792
|
+
}
|
|
14793
|
+
const treeSelectionState = new TreeSelectionState(
|
|
14794
|
+
treeSelection,
|
|
14795
|
+
treeSelectionStateConfigGetter(getState)
|
|
14796
|
+
);
|
|
14797
|
+
treeSelectionState.setNodeSelection(nodePath, selected);
|
|
14798
|
+
getState().lastSelectionUpdatedNodePathRef.current = nodePath;
|
|
14799
|
+
actions.treeSelection = treeSelectionState;
|
|
14800
|
+
};
|
|
14801
|
+
const getCallbackParam = (_nodePath) => {
|
|
14802
|
+
return {
|
|
14803
|
+
dataSourceApi
|
|
14804
|
+
};
|
|
14805
|
+
};
|
|
14806
|
+
const api = {
|
|
14807
|
+
get allRowsSelected() {
|
|
14808
|
+
return getState().allRowsSelected;
|
|
14809
|
+
},
|
|
14810
|
+
isNodeExpanded(nodePath) {
|
|
14811
|
+
const state = getState();
|
|
14812
|
+
const { isNodeExpanded, isNodeCollapsed, treeExpandState } = state;
|
|
14813
|
+
const rowInfo = this.getRowInfoByPath(nodePath);
|
|
14814
|
+
if (rowInfo) {
|
|
14815
|
+
if (!rowInfo.isTreeNode || !rowInfo.isParentNode) {
|
|
14816
|
+
return false;
|
|
14817
|
+
}
|
|
14818
|
+
if (isNodeCollapsed) {
|
|
14819
|
+
return !isNodeExpanded(rowInfo);
|
|
14820
|
+
}
|
|
14821
|
+
if (isNodeExpanded) {
|
|
14822
|
+
return isNodeExpanded(rowInfo);
|
|
14823
|
+
}
|
|
14824
|
+
}
|
|
14825
|
+
return treeExpandState.isNodeExpanded(nodePath);
|
|
14826
|
+
},
|
|
14827
|
+
expandAll() {
|
|
14828
|
+
const treeExpandState = new TreeExpandState({
|
|
14829
|
+
defaultExpanded: true,
|
|
14830
|
+
collapsedPaths: []
|
|
14831
|
+
});
|
|
14832
|
+
getState().lastExpandStateInfoRef.current = {
|
|
14833
|
+
state: "expanded",
|
|
14834
|
+
nodePath: null
|
|
14835
|
+
};
|
|
14836
|
+
actions.treeExpandState = treeExpandState;
|
|
14837
|
+
},
|
|
14838
|
+
collapseAll() {
|
|
14839
|
+
const treeExpandState = new TreeExpandState({
|
|
14840
|
+
defaultExpanded: false,
|
|
14841
|
+
expandedPaths: []
|
|
14842
|
+
});
|
|
14843
|
+
getState().lastExpandStateInfoRef.current = {
|
|
14844
|
+
state: "collapsed",
|
|
14845
|
+
nodePath: null
|
|
14846
|
+
};
|
|
14847
|
+
actions.treeExpandState = treeExpandState;
|
|
14848
|
+
},
|
|
14849
|
+
expandNode(nodePath) {
|
|
14850
|
+
const state = getState();
|
|
14851
|
+
const treeExpandState = new TreeExpandState(state.treeExpandState);
|
|
14852
|
+
treeExpandState.expandNode(nodePath);
|
|
14853
|
+
getState().lastExpandStateInfoRef.current = {
|
|
14854
|
+
state: "expanded",
|
|
14855
|
+
nodePath
|
|
14856
|
+
};
|
|
14857
|
+
actions.treeExpandState = treeExpandState;
|
|
14858
|
+
state.onNodeExpand?.(nodePath, getCallbackParam(nodePath));
|
|
14859
|
+
},
|
|
14860
|
+
collapseNode(nodePath) {
|
|
14861
|
+
const state = getState();
|
|
14862
|
+
const treeExpandState = new TreeExpandState(state.treeExpandState);
|
|
14863
|
+
treeExpandState.collapseNode(nodePath);
|
|
14864
|
+
getState().lastExpandStateInfoRef.current = {
|
|
14865
|
+
state: "collapsed",
|
|
14866
|
+
nodePath
|
|
14867
|
+
};
|
|
14868
|
+
actions.treeExpandState = treeExpandState;
|
|
14869
|
+
state.onNodeCollapse?.(nodePath, getCallbackParam(nodePath));
|
|
14870
|
+
},
|
|
14871
|
+
toggleNode(nodePath) {
|
|
14872
|
+
const state = getState();
|
|
14873
|
+
const treeExpandState = new TreeExpandState(state.treeExpandState);
|
|
14874
|
+
const newExpanded = !api.isNodeExpanded(nodePath);
|
|
14875
|
+
treeExpandState.setNodeExpanded(nodePath, newExpanded);
|
|
14876
|
+
getState().lastExpandStateInfoRef.current = {
|
|
14877
|
+
state: newExpanded ? "expanded" : "collapsed",
|
|
14878
|
+
nodePath
|
|
14879
|
+
};
|
|
14880
|
+
actions.treeExpandState = treeExpandState;
|
|
14881
|
+
if (newExpanded) {
|
|
14882
|
+
state.onNodeExpand?.(nodePath, getCallbackParam(nodePath));
|
|
14883
|
+
} else {
|
|
14884
|
+
state.onNodeCollapse?.(nodePath, getCallbackParam(nodePath));
|
|
14885
|
+
}
|
|
14886
|
+
},
|
|
14887
|
+
getNodeDataByPath(nodePath) {
|
|
14888
|
+
const { treeDeepMap } = getState();
|
|
14889
|
+
if (!treeDeepMap || !nodePath.length) {
|
|
14890
|
+
return null;
|
|
14891
|
+
}
|
|
14892
|
+
const rowInfo = api.getRowInfoByPath(nodePath);
|
|
14893
|
+
return rowInfo ? rowInfo.data : null;
|
|
14894
|
+
},
|
|
14895
|
+
getRowInfoByPath(nodePath) {
|
|
14896
|
+
const { pathToIndexDeepMap } = getState();
|
|
14897
|
+
const index = pathToIndexDeepMap.get(nodePath);
|
|
14898
|
+
if (index !== void 0) {
|
|
14899
|
+
return getRowInfoAt(index, getState);
|
|
14900
|
+
}
|
|
14901
|
+
return null;
|
|
14902
|
+
},
|
|
14903
|
+
selectAll() {
|
|
14904
|
+
const { treeSelectionState: treeSelection, selectionMode } = getState();
|
|
14905
|
+
if (selectionMode !== "multi-row") {
|
|
14906
|
+
throw "Selection mode is not multi-row";
|
|
14907
|
+
}
|
|
14908
|
+
if (!(treeSelection instanceof TreeSelectionState)) {
|
|
14909
|
+
throw "Invalid node selection";
|
|
14910
|
+
}
|
|
14911
|
+
const treeSelectionState = new TreeSelectionState(
|
|
14912
|
+
treeSelection,
|
|
14913
|
+
treeSelectionStateConfigGetter(getState)
|
|
14914
|
+
);
|
|
14915
|
+
treeSelectionState.selectAll();
|
|
14916
|
+
getState().lastSelectionUpdatedNodePathRef.current = null;
|
|
14917
|
+
actions.treeSelection = treeSelectionState;
|
|
14918
|
+
},
|
|
14919
|
+
deselectAll() {
|
|
14920
|
+
const { treeSelectionState: treeSelection, selectionMode } = getState();
|
|
14921
|
+
if (selectionMode !== "multi-row") {
|
|
14922
|
+
throw "Selection mode is not multi-row";
|
|
14923
|
+
}
|
|
14924
|
+
if (!(treeSelection instanceof TreeSelectionState)) {
|
|
14925
|
+
throw "Invalid node selection";
|
|
14926
|
+
}
|
|
14927
|
+
const treeSelectionState = new TreeSelectionState(
|
|
14928
|
+
treeSelection,
|
|
14929
|
+
treeSelectionStateConfigGetter(getState)
|
|
14930
|
+
);
|
|
14931
|
+
treeSelectionState.deselectAll();
|
|
14932
|
+
getState().lastSelectionUpdatedNodePathRef.current = null;
|
|
14933
|
+
actions.treeSelection = treeSelectionState;
|
|
14934
|
+
},
|
|
14935
|
+
isNodeSelected(nodePath) {
|
|
14936
|
+
const { treeSelection, selectionMode } = getState();
|
|
14937
|
+
if (selectionMode === "single-row") {
|
|
14938
|
+
const pk = nodePath[nodePath.length - 1];
|
|
14939
|
+
if (Array.isArray(treeSelection)) {
|
|
14940
|
+
return treeSelection.join(",") === nodePath.join(",");
|
|
14941
|
+
}
|
|
14942
|
+
return treeSelection === pk;
|
|
14943
|
+
}
|
|
14944
|
+
if (selectionMode !== "multi-row") {
|
|
14945
|
+
throw "Selection mode is not multi-row or single-row";
|
|
14946
|
+
}
|
|
14947
|
+
if (!(treeSelection instanceof TreeSelectionState)) {
|
|
14948
|
+
throw "Invalid tree selection";
|
|
14949
|
+
}
|
|
14950
|
+
return treeSelection.isNodeSelected(nodePath);
|
|
14951
|
+
},
|
|
14952
|
+
selectNode(nodePath) {
|
|
14953
|
+
setNodeSelection(nodePath, true);
|
|
14954
|
+
},
|
|
14955
|
+
deselectNode(nodePath) {
|
|
14956
|
+
setNodeSelection(nodePath, false);
|
|
14957
|
+
},
|
|
14958
|
+
setNodeSelection(nodePath, selected) {
|
|
14959
|
+
setNodeSelection(nodePath, selected);
|
|
14960
|
+
},
|
|
14961
|
+
toggleNodeSelection(nodePath) {
|
|
14962
|
+
if (this.isNodeSelected(nodePath)) {
|
|
14963
|
+
this.deselectNode(nodePath);
|
|
14964
|
+
} else {
|
|
14965
|
+
this.selectNode(nodePath);
|
|
14966
|
+
}
|
|
14967
|
+
},
|
|
14968
|
+
getDataByNodePath(nodePath) {
|
|
14969
|
+
return dataSourceApi.getDataByNodePath(nodePath);
|
|
14970
|
+
},
|
|
14971
|
+
updateDataByNodePath(data, nodePath, options) {
|
|
14972
|
+
return dataSourceApi.updateDataByNodePath(data, nodePath, options);
|
|
14973
|
+
},
|
|
14974
|
+
getRowInfoByNodePath(nodePath) {
|
|
14975
|
+
return dataSourceApi.getRowInfoByNodePath(nodePath);
|
|
14976
|
+
},
|
|
14977
|
+
getIndexByNodePath(nodePath) {
|
|
14978
|
+
return dataSourceApi.getIndexByNodePath(nodePath);
|
|
14979
|
+
}
|
|
14980
|
+
};
|
|
14981
|
+
return api;
|
|
14982
|
+
}
|
|
14983
|
+
|
|
13508
14984
|
// src/components/DataSource/BooleanCollectionState.ts
|
|
13509
14985
|
var BooleanCollectionState = class {
|
|
13510
14986
|
constructor(state) {
|
|
@@ -13724,10 +15200,22 @@ var DataSourceApiImpl = class {
|
|
|
13724
15200
|
const index = this.getIndexByPrimaryKey(id);
|
|
13725
15201
|
return this.getRowInfoByIndex(index);
|
|
13726
15202
|
};
|
|
15203
|
+
this.getRowInfoByNodePath = (nodePath) => {
|
|
15204
|
+
const index = this.getIndexByNodePath(nodePath);
|
|
15205
|
+
return this.getRowInfoByIndex(index);
|
|
15206
|
+
};
|
|
13727
15207
|
this.getIndexByPrimaryKey = (id) => {
|
|
13728
15208
|
const map2 = this.getState().idToIndexMap;
|
|
13729
15209
|
return map2.get(id) ?? -1;
|
|
13730
15210
|
};
|
|
15211
|
+
this.getIndexByNodePath = (nodePath) => {
|
|
15212
|
+
const map2 = this.getState().pathToIndexDeepMap;
|
|
15213
|
+
return map2.get(nodePath) ?? -1;
|
|
15214
|
+
};
|
|
15215
|
+
this.getNodePathById = (id) => {
|
|
15216
|
+
const map2 = this.getState().idToPathMap;
|
|
15217
|
+
return map2.get(id) ?? null;
|
|
15218
|
+
};
|
|
13731
15219
|
this.getPrimaryKeyByIndex = (index) => {
|
|
13732
15220
|
const rowInfo = this.getRowInfoByIndex(index);
|
|
13733
15221
|
return rowInfo ? rowInfo.id : void 0;
|
|
@@ -13739,6 +15227,10 @@ var DataSourceApiImpl = class {
|
|
|
13739
15227
|
const { indexer } = this.getState();
|
|
13740
15228
|
return indexer.getDataForPrimaryKey(id) ?? null;
|
|
13741
15229
|
};
|
|
15230
|
+
this.getDataByNodePath = (nodePath) => {
|
|
15231
|
+
const { indexer } = this.getState();
|
|
15232
|
+
return indexer.getDataForNodePath(nodePath) ?? null;
|
|
15233
|
+
};
|
|
13742
15234
|
/**
|
|
13743
15235
|
* Replaces all data in the DataSource with the provided data.
|
|
13744
15236
|
* @param data - The new data to replace the existing data with.
|
|
@@ -13769,13 +15261,40 @@ var DataSourceApiImpl = class {
|
|
|
13769
15261
|
return this.updateDataArray([data], options);
|
|
13770
15262
|
};
|
|
13771
15263
|
this.updateDataArray = (data, options) => {
|
|
13772
|
-
const
|
|
15264
|
+
const isTree = this.getState().isTree;
|
|
15265
|
+
let primaryKeys = !isTree ? data.map((d) => {
|
|
15266
|
+
return this.toPrimaryKey(d);
|
|
15267
|
+
}) : void 0;
|
|
15268
|
+
const nodePaths = isTree ? data.map((d) => {
|
|
15269
|
+
return this.getNodePathById(this.toPrimaryKey(d)) || [];
|
|
15270
|
+
}) : null;
|
|
15271
|
+
const result = primaryKeys ? this.batchOperation({
|
|
13773
15272
|
type: "update",
|
|
13774
15273
|
array: data,
|
|
13775
15274
|
primaryKeys: data.map((d) => {
|
|
13776
15275
|
return this.toPrimaryKey(d);
|
|
13777
15276
|
}),
|
|
13778
15277
|
metadata: options?.metadata
|
|
15278
|
+
}) : this.batchOperation({
|
|
15279
|
+
type: "update",
|
|
15280
|
+
array: data,
|
|
15281
|
+
nodePaths: nodePaths || [],
|
|
15282
|
+
metadata: options?.metadata
|
|
15283
|
+
});
|
|
15284
|
+
if (options?.flush) {
|
|
15285
|
+
this.commit();
|
|
15286
|
+
}
|
|
15287
|
+
return result;
|
|
15288
|
+
};
|
|
15289
|
+
this.updateDataByNodePath = (data, nodePath, options) => {
|
|
15290
|
+
return this.updateDataArrayByNodePath([data], [nodePath], options);
|
|
15291
|
+
};
|
|
15292
|
+
this.updateDataArrayByNodePath = (data, nodePaths, options) => {
|
|
15293
|
+
const result = this.batchOperation({
|
|
15294
|
+
type: "update",
|
|
15295
|
+
array: data,
|
|
15296
|
+
nodePaths,
|
|
15297
|
+
metadata: options?.metadata
|
|
13779
15298
|
});
|
|
13780
15299
|
if (options?.flush) {
|
|
13781
15300
|
this.commit();
|
|
@@ -13793,10 +15312,29 @@ var DataSourceApiImpl = class {
|
|
|
13793
15312
|
}
|
|
13794
15313
|
return result;
|
|
13795
15314
|
};
|
|
13796
|
-
this.
|
|
15315
|
+
this.removeDataByNodePath = (nodePath, options) => {
|
|
13797
15316
|
const result = this.batchOperation({
|
|
13798
15317
|
type: "delete",
|
|
13799
|
-
|
|
15318
|
+
nodePaths: [nodePath],
|
|
15319
|
+
metadata: options?.metadata
|
|
15320
|
+
});
|
|
15321
|
+
if (options?.flush) {
|
|
15322
|
+
this.commit();
|
|
15323
|
+
}
|
|
15324
|
+
return result;
|
|
15325
|
+
};
|
|
15326
|
+
this.removeData = (data, options) => {
|
|
15327
|
+
const isTree = this.getState().isTree;
|
|
15328
|
+
let primaryKeys = !isTree ? [this.toPrimaryKey(data)] : void 0;
|
|
15329
|
+
const nodePath = isTree ? this.getNodePathById(this.toPrimaryKey(data)) : null;
|
|
15330
|
+
let nodePaths = isTree && nodePath ? [nodePath] : void 0;
|
|
15331
|
+
const result = primaryKeys ? this.batchOperation({
|
|
15332
|
+
type: "delete",
|
|
15333
|
+
primaryKeys,
|
|
15334
|
+
metadata: options?.metadata
|
|
15335
|
+
}) : this.batchOperation({
|
|
15336
|
+
type: "delete",
|
|
15337
|
+
nodePaths: nodePaths || [],
|
|
13800
15338
|
metadata: options?.metadata
|
|
13801
15339
|
});
|
|
13802
15340
|
if (options?.flush) {
|
|
@@ -13816,9 +15354,18 @@ var DataSourceApiImpl = class {
|
|
|
13816
15354
|
return result;
|
|
13817
15355
|
};
|
|
13818
15356
|
this.removeDataArray = (data, options) => {
|
|
13819
|
-
const
|
|
15357
|
+
const isTree = this.getState().isTree;
|
|
15358
|
+
const nodePaths = isTree ? data.map((d) => {
|
|
15359
|
+
return this.getNodePathById(this.toPrimaryKey(d)) || [];
|
|
15360
|
+
}) : null;
|
|
15361
|
+
const primaryKeys = !isTree ? data.map(this.toPrimaryKey) : void 0;
|
|
15362
|
+
const result = isTree ? this.batchOperation({
|
|
13820
15363
|
type: "delete",
|
|
13821
|
-
|
|
15364
|
+
nodePaths: nodePaths || [],
|
|
15365
|
+
metadata: options?.metadata
|
|
15366
|
+
}) : this.batchOperation({
|
|
15367
|
+
type: "delete",
|
|
15368
|
+
primaryKeys: primaryKeys || [],
|
|
13822
15369
|
metadata: options?.metadata
|
|
13823
15370
|
});
|
|
13824
15371
|
if (options?.flush) {
|
|
@@ -13841,6 +15388,7 @@ var DataSourceApiImpl = class {
|
|
|
13841
15388
|
this.insertDataArray = (data, options) => {
|
|
13842
15389
|
let position2 = "before";
|
|
13843
15390
|
let primaryKey = void 0;
|
|
15391
|
+
let nodePath = options.nodePath;
|
|
13844
15392
|
if (options.position === "before" || options.position === "after") {
|
|
13845
15393
|
position2 = options.position;
|
|
13846
15394
|
primaryKey = options.primaryKey;
|
|
@@ -13854,12 +15402,20 @@ var DataSourceApiImpl = class {
|
|
|
13854
15402
|
primaryKey = !arr.length ? void 0 : this.toPrimaryKey(arr[arr.length - 1]);
|
|
13855
15403
|
}
|
|
13856
15404
|
}
|
|
13857
|
-
const
|
|
15405
|
+
const isTree = this.getState().isTree;
|
|
15406
|
+
const result = isTree ? this.batchOperation({
|
|
15407
|
+
type: "insert",
|
|
15408
|
+
array: data,
|
|
15409
|
+
position: position2,
|
|
15410
|
+
metadata: options?.metadata,
|
|
15411
|
+
nodePath: this.getNodePathById(primaryKey) || []
|
|
15412
|
+
}) : this.batchOperation({
|
|
13858
15413
|
type: "insert",
|
|
13859
15414
|
array: data,
|
|
13860
15415
|
position: position2,
|
|
13861
15416
|
metadata: options?.metadata,
|
|
13862
|
-
primaryKey
|
|
15417
|
+
primaryKey,
|
|
15418
|
+
nodePath
|
|
13863
15419
|
});
|
|
13864
15420
|
if (options?.flush) {
|
|
13865
15421
|
this.commit();
|
|
@@ -13938,7 +15494,9 @@ var DataSourceApiImpl = class {
|
|
|
13938
15494
|
return rowDisabledState ? rowDisabledState.areAllDisabled() : false;
|
|
13939
15495
|
};
|
|
13940
15496
|
this.getState = param.getState;
|
|
15497
|
+
this.getState().__apiRef.current = this;
|
|
13941
15498
|
this.actions = param.actions;
|
|
15499
|
+
this.treeApi = getTreeApi({ ...param, dataSourceApi: this });
|
|
13942
15500
|
}
|
|
13943
15501
|
batchOperation(operation) {
|
|
13944
15502
|
if (!this.pendingPromise) {
|
|
@@ -13974,34 +15532,77 @@ var DataSourceApiImpl = class {
|
|
|
13974
15532
|
switch (operation.type) {
|
|
13975
15533
|
case "update":
|
|
13976
15534
|
operation.array.forEach((data, index) => {
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
|
|
13984
|
-
|
|
15535
|
+
if (operation.primaryKeys) {
|
|
15536
|
+
const key = operation.primaryKeys[index];
|
|
15537
|
+
const rowInfo = this.getRowInfoByPrimaryKey(key);
|
|
15538
|
+
if (rowInfo && !rowInfo.isGroupRow) {
|
|
15539
|
+
cache.update(
|
|
15540
|
+
operation.primaryKeys[index],
|
|
15541
|
+
data,
|
|
15542
|
+
rowInfo.data,
|
|
15543
|
+
operation.metadata
|
|
15544
|
+
);
|
|
15545
|
+
}
|
|
15546
|
+
} else if (operation.nodePaths) {
|
|
15547
|
+
const rowInfo = this.getRowInfoByNodePath(
|
|
15548
|
+
operation.nodePaths[index]
|
|
13985
15549
|
);
|
|
15550
|
+
if (rowInfo && !rowInfo.isGroupRow) {
|
|
15551
|
+
cache.updateNodePath(
|
|
15552
|
+
operation.nodePaths[index],
|
|
15553
|
+
data,
|
|
15554
|
+
rowInfo.data,
|
|
15555
|
+
operation.metadata
|
|
15556
|
+
);
|
|
15557
|
+
}
|
|
13986
15558
|
}
|
|
13987
15559
|
});
|
|
13988
15560
|
break;
|
|
13989
15561
|
case "delete":
|
|
13990
|
-
operation.primaryKeys
|
|
13991
|
-
|
|
13992
|
-
|
|
13993
|
-
|
|
13994
|
-
|
|
13995
|
-
|
|
15562
|
+
if (operation.primaryKeys) {
|
|
15563
|
+
operation.primaryKeys.forEach((key) => {
|
|
15564
|
+
const rowInfo = this.getRowInfoByPrimaryKey(key);
|
|
15565
|
+
if (rowInfo && !rowInfo.isGroupRow) {
|
|
15566
|
+
cache.delete(key, rowInfo.data, operation.metadata);
|
|
15567
|
+
}
|
|
15568
|
+
});
|
|
15569
|
+
} else if (operation.nodePaths) {
|
|
15570
|
+
operation.nodePaths.forEach((nodePath2) => {
|
|
15571
|
+
const rowInfo = this.getRowInfoByNodePath(nodePath2);
|
|
15572
|
+
if (rowInfo && !rowInfo.isGroupRow) {
|
|
15573
|
+
cache.deleteNodePath(
|
|
15574
|
+
nodePath2,
|
|
15575
|
+
rowInfo.data,
|
|
15576
|
+
operation.metadata
|
|
15577
|
+
);
|
|
15578
|
+
}
|
|
15579
|
+
});
|
|
15580
|
+
}
|
|
13996
15581
|
break;
|
|
13997
15582
|
case "insert":
|
|
13998
15583
|
let pk = operation.primaryKey;
|
|
13999
15584
|
let position2 = operation.position;
|
|
14000
|
-
operation.
|
|
14001
|
-
|
|
14002
|
-
|
|
14003
|
-
|
|
14004
|
-
|
|
15585
|
+
let nodePath = operation.nodePath;
|
|
15586
|
+
if (nodePath) {
|
|
15587
|
+
operation.array.forEach((data) => {
|
|
15588
|
+
cache.insertNodePath(
|
|
15589
|
+
nodePath,
|
|
15590
|
+
data,
|
|
15591
|
+
position2,
|
|
15592
|
+
operation.metadata
|
|
15593
|
+
);
|
|
15594
|
+
pk = this.toPrimaryKey(data);
|
|
15595
|
+
nodePath.pop();
|
|
15596
|
+
nodePath.push(pk);
|
|
15597
|
+
position2 = "after";
|
|
15598
|
+
});
|
|
15599
|
+
} else {
|
|
15600
|
+
operation.array.forEach((data) => {
|
|
15601
|
+
cache.insert(pk, data, position2, operation.metadata);
|
|
15602
|
+
pk = this.toPrimaryKey(data);
|
|
15603
|
+
position2 = "after";
|
|
15604
|
+
});
|
|
15605
|
+
}
|
|
14005
15606
|
break;
|
|
14006
15607
|
case "replace-all":
|
|
14007
15608
|
cache.resetDataSource(operation.metadata);
|
|
@@ -14034,16 +15635,25 @@ function getCacheAffectedParts(state) {
|
|
|
14034
15635
|
return {
|
|
14035
15636
|
sortInfo: false,
|
|
14036
15637
|
groupBy: false,
|
|
15638
|
+
tree: false,
|
|
14037
15639
|
filterValue: false,
|
|
14038
15640
|
aggregationReducers: false
|
|
14039
15641
|
};
|
|
14040
15642
|
}
|
|
14041
15643
|
let sortInfoAffected = false;
|
|
14042
15644
|
let groupByAffected = false;
|
|
15645
|
+
let treeAffected = false;
|
|
14043
15646
|
let filterAffected = false;
|
|
14044
15647
|
let aggregationsAffected = false;
|
|
14045
15648
|
const keys = cache.getAffectedFields();
|
|
14046
|
-
const {
|
|
15649
|
+
const {
|
|
15650
|
+
sortInfo,
|
|
15651
|
+
groupBy,
|
|
15652
|
+
filterValue,
|
|
15653
|
+
aggregationReducers,
|
|
15654
|
+
nodesKey,
|
|
15655
|
+
isTree
|
|
15656
|
+
} = state;
|
|
14047
15657
|
if (sortInfo && sortInfo.length) {
|
|
14048
15658
|
if (keys === true) {
|
|
14049
15659
|
sortInfoAffected = true;
|
|
@@ -14074,6 +15684,13 @@ function getCacheAffectedParts(state) {
|
|
|
14074
15684
|
}
|
|
14075
15685
|
}
|
|
14076
15686
|
}
|
|
15687
|
+
if (isTree) {
|
|
15688
|
+
if (keys === true) {
|
|
15689
|
+
treeAffected = true;
|
|
15690
|
+
} else {
|
|
15691
|
+
treeAffected = keys.has(nodesKey);
|
|
15692
|
+
}
|
|
15693
|
+
}
|
|
14077
15694
|
if (filterValue && filterValue.length) {
|
|
14078
15695
|
if (keys === true) {
|
|
14079
15696
|
filterAffected = true;
|
|
@@ -14113,7 +15730,8 @@ function getCacheAffectedParts(state) {
|
|
|
14113
15730
|
sortInfo: sortInfoAffected,
|
|
14114
15731
|
groupBy: groupByAffected,
|
|
14115
15732
|
filterValue: filterAffected,
|
|
14116
|
-
aggregationReducers: aggregationsAffected
|
|
15733
|
+
aggregationReducers: aggregationsAffected,
|
|
15734
|
+
tree: treeAffected
|
|
14117
15735
|
};
|
|
14118
15736
|
}
|
|
14119
15737
|
|
|
@@ -14196,6 +15814,7 @@ function returnFalse2() {
|
|
|
14196
15814
|
function toRowInfo(data, id, index, isRowSelected, isRowDisabled, cellSelectionState) {
|
|
14197
15815
|
const rowInfo = {
|
|
14198
15816
|
dataSourceHasGrouping: false,
|
|
15817
|
+
isTreeNode: false,
|
|
14199
15818
|
data,
|
|
14200
15819
|
id,
|
|
14201
15820
|
indexInAll: index,
|
|
@@ -14312,17 +15931,29 @@ function concludeReducer(params) {
|
|
|
14312
15931
|
originalDataArrayChanged = true;
|
|
14313
15932
|
}
|
|
14314
15933
|
const toPrimaryKey = state.toPrimaryKey;
|
|
15934
|
+
const nodesKey = state.nodesKey;
|
|
15935
|
+
const getNodeChildren = nodesKey ? (node) => {
|
|
15936
|
+
return node[nodesKey];
|
|
15937
|
+
} : void 0;
|
|
15938
|
+
const isLeafNode = nodesKey ? (node) => {
|
|
15939
|
+
return node[nodesKey] === void 0;
|
|
15940
|
+
} : void 0;
|
|
14315
15941
|
let mutations;
|
|
15942
|
+
let treeMutations;
|
|
14316
15943
|
const shouldIndex = originalDataArrayChanged;
|
|
14317
15944
|
if (shouldIndex) {
|
|
14318
15945
|
state.indexer.clear();
|
|
14319
15946
|
if (!state.lazyLoad) {
|
|
14320
15947
|
mutations = cache?.getMutations();
|
|
15948
|
+
treeMutations = cache?.getTreeMutations();
|
|
14321
15949
|
state.originalDataArray = state.indexer.indexArray(
|
|
14322
15950
|
state.originalDataArray,
|
|
14323
15951
|
{
|
|
14324
15952
|
toPrimaryKey,
|
|
14325
|
-
cache
|
|
15953
|
+
cache,
|
|
15954
|
+
getNodeChildren,
|
|
15955
|
+
isLeafNode,
|
|
15956
|
+
nodesKey
|
|
14326
15957
|
}
|
|
14327
15958
|
);
|
|
14328
15959
|
}
|
|
@@ -14346,7 +15977,9 @@ function concludeReducer(params) {
|
|
|
14346
15977
|
const shouldSortAgain = shouldSort && (sortDepsChanged || !state.lastSortDataArray || cacheAffectedParts.sortInfo);
|
|
14347
15978
|
const groupBy = state.groupBy;
|
|
14348
15979
|
const pivotBy = state.pivotBy;
|
|
14349
|
-
const
|
|
15980
|
+
const isTree = state.isTree;
|
|
15981
|
+
const shouldGroup = !isTree && (groupBy.length > 0 || !!pivotBy);
|
|
15982
|
+
const shouldTree = isTree;
|
|
14350
15983
|
const rowDisabledStateDepsChanged = haveDepsChanged(previousState, state, [
|
|
14351
15984
|
"rowDisabledState",
|
|
14352
15985
|
"isRowDisabled"
|
|
@@ -14357,6 +15990,12 @@ function concludeReducer(params) {
|
|
|
14357
15990
|
"isRowSelected",
|
|
14358
15991
|
"originalLazyGroupDataChangeDetect"
|
|
14359
15992
|
]);
|
|
15993
|
+
const treeSelectionDepsChanged = haveDepsChanged(previousState, state, [
|
|
15994
|
+
"treeSelection",
|
|
15995
|
+
"cellSelection",
|
|
15996
|
+
"isNodeSelected",
|
|
15997
|
+
"originalLazyGroupDataChangeDetect"
|
|
15998
|
+
]);
|
|
14360
15999
|
const groupsDepsChanged = originalDataArrayChanged || sortDepsChanged || haveDepsChanged(previousState, state, [
|
|
14361
16000
|
"generateGroupRows",
|
|
14362
16001
|
"originalLazyGroupData",
|
|
@@ -14367,12 +16006,25 @@ function concludeReducer(params) {
|
|
|
14367
16006
|
"aggregationReducers",
|
|
14368
16007
|
"pivotTotalColumnPosition",
|
|
14369
16008
|
"pivotGrandTotalColumnPosition",
|
|
14370
|
-
"showSeparatePivotColumnForSingleAggregation"
|
|
16009
|
+
"showSeparatePivotColumnForSingleAggregation",
|
|
16010
|
+
"repeatWrappedGroupRows",
|
|
16011
|
+
"rowsPerPage"
|
|
16012
|
+
]);
|
|
16013
|
+
const treeDepsChanged = originalDataArrayChanged || sortDepsChanged || haveDepsChanged(previousState, state, [
|
|
16014
|
+
"originalLazyGroupData",
|
|
16015
|
+
"originalLazyGroupDataChangeDetect",
|
|
16016
|
+
"treeExpandState",
|
|
16017
|
+
"isNodeExpanded",
|
|
16018
|
+
"isNodeCollapsed",
|
|
16019
|
+
"aggregationReducers",
|
|
16020
|
+
"repeatWrappedGroupRows",
|
|
16021
|
+
"rowsPerPage"
|
|
14371
16022
|
]);
|
|
14372
16023
|
const rowInfoReducersChanged = haveDepsChanged(previousState, state, [
|
|
14373
16024
|
"rowInfoReducers"
|
|
14374
16025
|
]);
|
|
14375
16026
|
const shouldGroupAgain = shouldGroup && (groupsDepsChanged || !state.lastGroupDataArray || cacheAffectedParts.groupBy) || selectionDepsChanged || rowDisabledStateDepsChanged || rowInfoReducersChanged;
|
|
16027
|
+
const shouldTreeAgain = shouldTree && (treeDepsChanged || cacheAffectedParts.tree || !state.lastTreeDataArray) || treeSelectionDepsChanged || rowDisabledStateDepsChanged || rowInfoReducersChanged;
|
|
14376
16028
|
const now = Date.now();
|
|
14377
16029
|
let dataArray = state.originalDataArray;
|
|
14378
16030
|
if (!shouldFilter) {
|
|
@@ -14396,8 +16048,25 @@ function concludeReducer(params) {
|
|
|
14396
16048
|
if (shouldSort) {
|
|
14397
16049
|
const prevKnownTypes = multisort.knownTypes;
|
|
14398
16050
|
multisort.knownTypes = { ...prevKnownTypes, ...state.sortTypes };
|
|
14399
|
-
|
|
14400
|
-
|
|
16051
|
+
if (shouldSortAgain) {
|
|
16052
|
+
if (state.sortFunction) {
|
|
16053
|
+
dataArray = state.sortFunction(sortInfo, [...dataArray]);
|
|
16054
|
+
} else {
|
|
16055
|
+
if (isTree) {
|
|
16056
|
+
dataArray = multisortNested(sortInfo, dataArray, {
|
|
16057
|
+
inplace: false,
|
|
16058
|
+
isLeafNode,
|
|
16059
|
+
getNodeChildren,
|
|
16060
|
+
toKey: toPrimaryKey,
|
|
16061
|
+
nodesKey
|
|
16062
|
+
});
|
|
16063
|
+
} else {
|
|
16064
|
+
dataArray = multisort(sortInfo, [...dataArray]);
|
|
16065
|
+
}
|
|
16066
|
+
}
|
|
16067
|
+
} else {
|
|
16068
|
+
dataArray = state.lastSortDataArray;
|
|
16069
|
+
}
|
|
14401
16070
|
multisort.knownTypes = prevKnownTypes;
|
|
14402
16071
|
state.lastSortDataArray = dataArray;
|
|
14403
16072
|
state.sortedAt = now;
|
|
@@ -14405,6 +16074,7 @@ function concludeReducer(params) {
|
|
|
14405
16074
|
state.postSortDataArray = dataArray;
|
|
14406
16075
|
let rowInfoDataArray = state.dataArray;
|
|
14407
16076
|
const rowSelectionState = state.rowSelection instanceof RowSelectionState ? state.rowSelection : void 0;
|
|
16077
|
+
const treeExpandState = state.treeExpandState instanceof TreeExpandState ? state.treeExpandState : void 0;
|
|
14408
16078
|
const cellSelectionState = state.cellSelection instanceof CellSelectionState ? state.cellSelection : void 0;
|
|
14409
16079
|
rowSelectionState?.xcache();
|
|
14410
16080
|
let isRowSelected = state.selectionMode === "single-row" ? (rowInfo) => {
|
|
@@ -14424,6 +16094,19 @@ function concludeReducer(params) {
|
|
|
14424
16094
|
state.selectionMode
|
|
14425
16095
|
);
|
|
14426
16096
|
}
|
|
16097
|
+
let isNodeExpanded = state.isNodeExpanded;
|
|
16098
|
+
if (state.isNodeCollapsed) {
|
|
16099
|
+
isNodeExpanded = (rowInfo) => !state.isNodeExpanded(rowInfo);
|
|
16100
|
+
}
|
|
16101
|
+
if (!isNodeExpanded) {
|
|
16102
|
+
const defaultIsRowExpanded = (rowInfo) => {
|
|
16103
|
+
if (!rowInfo.isTreeNode || !rowInfo.isParentNode) {
|
|
16104
|
+
return false;
|
|
16105
|
+
}
|
|
16106
|
+
return treeExpandState.isNodeExpanded(rowInfo.nodePath);
|
|
16107
|
+
};
|
|
16108
|
+
isNodeExpanded = defaultIsRowExpanded;
|
|
16109
|
+
}
|
|
14427
16110
|
const rowInfoReducers = state.rowInfoReducers;
|
|
14428
16111
|
if (shouldGroup) {
|
|
14429
16112
|
if (shouldGroupAgain) {
|
|
@@ -14483,11 +16166,98 @@ function concludeReducer(params) {
|
|
|
14483
16166
|
lazyLoad: !!state.lazyLoad,
|
|
14484
16167
|
reducers: aggregationReducers,
|
|
14485
16168
|
toPrimaryKey,
|
|
14486
|
-
isRowSelected,
|
|
14487
|
-
rowSelectionState,
|
|
16169
|
+
isRowSelected,
|
|
16170
|
+
rowSelectionState,
|
|
16171
|
+
withRowInfo,
|
|
16172
|
+
repeatWrappedGroupRows: state.rowsPerPage != null ? state.repeatWrappedGroupRows : false,
|
|
16173
|
+
rowsPerPage: state.rowsPerPage,
|
|
16174
|
+
groupRowsState: state.groupRowsState,
|
|
16175
|
+
generateGroupRows: state.generateGroupRows
|
|
16176
|
+
});
|
|
16177
|
+
rowInfoDataArray = flattenResult.data;
|
|
16178
|
+
state.rowInfoReducerResults = finishRowInfoReducersFor({
|
|
16179
|
+
reducers: rowInfoReducers,
|
|
16180
|
+
results: rowInfoReducerResults,
|
|
16181
|
+
array: rowInfoDataArray
|
|
16182
|
+
});
|
|
16183
|
+
state.groupRowsIndexesInDataArray = flattenResult.groupRowsIndexes;
|
|
16184
|
+
state.reducerResults = groupResult.reducerResults;
|
|
16185
|
+
const pivotGroupsAndCols = pivotBy ? getPivotColumnsAndColumnGroups({
|
|
16186
|
+
deepMap: groupResult.topLevelPivotColumns,
|
|
16187
|
+
pivotBy,
|
|
16188
|
+
pivotTotalColumnPosition: state.pivotTotalColumnPosition ?? "end",
|
|
16189
|
+
pivotGrandTotalColumnPosition: state.pivotGrandTotalColumnPosition ?? false,
|
|
16190
|
+
reducers: state.aggregationReducers,
|
|
16191
|
+
showSeparatePivotColumnForSingleAggregation: state.showSeparatePivotColumnForSingleAggregation
|
|
16192
|
+
}) : void 0;
|
|
16193
|
+
state.pivotColumns = pivotGroupsAndCols?.columns;
|
|
16194
|
+
state.pivotColumnGroups = pivotGroupsAndCols?.columnGroups;
|
|
16195
|
+
} else {
|
|
16196
|
+
rowInfoDataArray = state.lastGroupDataArray;
|
|
16197
|
+
}
|
|
16198
|
+
state.lastGroupDataArray = rowInfoDataArray;
|
|
16199
|
+
state.groupedAt = now;
|
|
16200
|
+
} else if (shouldTree) {
|
|
16201
|
+
if (shouldTreeAgain) {
|
|
16202
|
+
let aggregationReducers = state.aggregationReducers;
|
|
16203
|
+
const treeParams = {
|
|
16204
|
+
isLeafNode,
|
|
16205
|
+
getNodeChildren,
|
|
16206
|
+
toKey: toPrimaryKey,
|
|
16207
|
+
reducers: aggregationReducers
|
|
16208
|
+
};
|
|
16209
|
+
const treeResult = tree(treeParams, dataArray);
|
|
16210
|
+
state.treeDeepMap = treeResult.deepMap;
|
|
16211
|
+
state.treePaths = treeResult.treePaths;
|
|
16212
|
+
const treeSelectionState = state.selectionMode === "multi-row" ? getTreeSelectionState(
|
|
16213
|
+
state.treeSelection,
|
|
16214
|
+
state.selectionMode,
|
|
16215
|
+
state
|
|
16216
|
+
) : void 0;
|
|
16217
|
+
state.treeSelectionState = treeSelectionState;
|
|
16218
|
+
const rowInfoReducerKeys = Object.keys(
|
|
16219
|
+
rowInfoReducers || {}
|
|
16220
|
+
);
|
|
16221
|
+
const rowInfoReducerResults = initRowInfoReducers(
|
|
16222
|
+
rowInfoReducers
|
|
16223
|
+
);
|
|
16224
|
+
const rowInfoReducersShape = {
|
|
16225
|
+
reducers: rowInfoReducers,
|
|
16226
|
+
results: rowInfoReducerResults,
|
|
16227
|
+
reducerKeys: rowInfoReducerKeys,
|
|
16228
|
+
rowInfo: {}
|
|
16229
|
+
};
|
|
16230
|
+
const withRowInfoForReducers = rowInfoReducerResults ? (rowInfo) => {
|
|
16231
|
+
rowInfoReducersShape.rowInfo = rowInfo;
|
|
16232
|
+
computeRowInfoReducersFor(rowInfoReducersShape);
|
|
16233
|
+
} : void 0;
|
|
16234
|
+
const withRowInfoForCellSelection = cellSelectionState ? (rowInfo) => {
|
|
16235
|
+
rowInfo.isCellSelected = (colId) => {
|
|
16236
|
+
return cellSelectionState.isCellSelected(rowInfo.id, colId);
|
|
16237
|
+
};
|
|
16238
|
+
} : void 0;
|
|
16239
|
+
const withRowInfo = withRowInfoForReducers || withRowInfoForCellSelection ? composeFunctions(
|
|
16240
|
+
withRowInfoForReducers,
|
|
16241
|
+
withRowInfoForCellSelection
|
|
16242
|
+
) : void 0;
|
|
16243
|
+
let isNodeSelected = state.selectionMode === "single-row" ? (rowInfo) => {
|
|
16244
|
+
return rowInfo.id === state.treeSelection;
|
|
16245
|
+
} : state.selectionMode === "multi-row" ? (rowInfo) => {
|
|
16246
|
+
return treeSelectionState.isNodeSelected(rowInfo.nodePath);
|
|
16247
|
+
} : void 0;
|
|
16248
|
+
const repeatWrappedGroupRows = state.rowsPerPage != null ? state.repeatWrappedGroupRows : false;
|
|
16249
|
+
const flattenResult = enhancedTreeFlatten({
|
|
16250
|
+
treeResult,
|
|
16251
|
+
treeParams,
|
|
16252
|
+
dataArray,
|
|
16253
|
+
reducers: aggregationReducers,
|
|
16254
|
+
toPrimaryKey,
|
|
16255
|
+
isNodeSelected,
|
|
16256
|
+
isNodeExpanded,
|
|
16257
|
+
treeSelectionState,
|
|
14488
16258
|
withRowInfo,
|
|
14489
|
-
|
|
14490
|
-
|
|
16259
|
+
repeatWrappedGroupRows,
|
|
16260
|
+
rowsPerPage: state.rowsPerPage
|
|
14491
16261
|
});
|
|
14492
16262
|
rowInfoDataArray = flattenResult.data;
|
|
14493
16263
|
state.rowInfoReducerResults = finishRowInfoReducersFor({
|
|
@@ -14495,23 +16265,13 @@ function concludeReducer(params) {
|
|
|
14495
16265
|
results: rowInfoReducerResults,
|
|
14496
16266
|
array: rowInfoDataArray
|
|
14497
16267
|
});
|
|
14498
|
-
state.
|
|
14499
|
-
state.
|
|
14500
|
-
|
|
14501
|
-
deepMap: groupResult.topLevelPivotColumns,
|
|
14502
|
-
pivotBy,
|
|
14503
|
-
pivotTotalColumnPosition: state.pivotTotalColumnPosition ?? "end",
|
|
14504
|
-
pivotGrandTotalColumnPosition: state.pivotGrandTotalColumnPosition ?? false,
|
|
14505
|
-
reducers: state.aggregationReducers,
|
|
14506
|
-
showSeparatePivotColumnForSingleAggregation: state.showSeparatePivotColumnForSingleAggregation
|
|
14507
|
-
}) : void 0;
|
|
14508
|
-
state.pivotColumns = pivotGroupsAndCols?.columns;
|
|
14509
|
-
state.pivotColumnGroups = pivotGroupsAndCols?.columnGroups;
|
|
16268
|
+
state.reducerResults = treeResult.reducerResults;
|
|
16269
|
+
state.totalLeafNodesCount = treeResult.deepMap.get([])?.totalLeafNodesCount ?? 0;
|
|
16270
|
+
state.treeAt = now;
|
|
14510
16271
|
} else {
|
|
14511
|
-
rowInfoDataArray = state.
|
|
16272
|
+
rowInfoDataArray = state.lastTreeDataArray;
|
|
14512
16273
|
}
|
|
14513
|
-
state.
|
|
14514
|
-
state.groupedAt = now;
|
|
16274
|
+
state.lastTreeDataArray = rowInfoDataArray;
|
|
14515
16275
|
} else {
|
|
14516
16276
|
state.groupDeepMap = void 0;
|
|
14517
16277
|
state.pivotColumns = void 0;
|
|
@@ -14563,6 +16323,9 @@ function concludeReducer(params) {
|
|
|
14563
16323
|
let allRowsSelected = true;
|
|
14564
16324
|
let someRowsSelected = false;
|
|
14565
16325
|
state.dataArray.forEach((rowInfo) => {
|
|
16326
|
+
if (rowInfo.isTreeNode) {
|
|
16327
|
+
return;
|
|
16328
|
+
}
|
|
14566
16329
|
if (rowInfo.isGroupRow && rowInfo.groupKeys.length === 1) {
|
|
14567
16330
|
const { rowSelected } = rowInfo;
|
|
14568
16331
|
if (rowSelected !== true) {
|
|
@@ -14576,8 +16339,8 @@ function concludeReducer(params) {
|
|
|
14576
16339
|
state.allRowsSelected = allRowsSelected;
|
|
14577
16340
|
state.someRowsSelected = someRowsSelected;
|
|
14578
16341
|
} else {
|
|
14579
|
-
const dataArrayCount = state.filteredCount;
|
|
14580
|
-
const selectedRowCount = state.rowSelection.getSelectedCount();
|
|
16342
|
+
const dataArrayCount = state.isTree ? state.totalLeafNodesCount : state.filteredCount;
|
|
16343
|
+
const selectedRowCount = state.isTree ? state.treeSelectionState ? state.treeSelectionState.getSelectedCount() : 0 : state.rowSelection.getSelectedCount();
|
|
14581
16344
|
state.allRowsSelected = dataArrayCount === selectedRowCount;
|
|
14582
16345
|
state.someRowsSelected = selectedRowCount > 0;
|
|
14583
16346
|
}
|
|
@@ -14589,7 +16352,8 @@ function concludeReducer(params) {
|
|
|
14589
16352
|
if (originalDataArrayChanged) {
|
|
14590
16353
|
state.originalDataArrayChangedInfo = {
|
|
14591
16354
|
timestamp: now,
|
|
14592
|
-
mutations: mutations?.size ? mutations : void 0
|
|
16355
|
+
mutations: mutations?.size ? mutations : void 0,
|
|
16356
|
+
treeMutations: treeMutations?.size ? treeMutations : void 0
|
|
14593
16357
|
};
|
|
14594
16358
|
}
|
|
14595
16359
|
return state;
|
|
@@ -15274,10 +17038,22 @@ function initSetupState() {
|
|
|
15274
17038
|
return {
|
|
15275
17039
|
// TODO cleanup indexer on unmount
|
|
15276
17040
|
indexer: new Indexer(),
|
|
17041
|
+
totalLeafNodesCount: 0,
|
|
17042
|
+
__apiRef: { current: null },
|
|
17043
|
+
repeatWrappedGroupRows: false,
|
|
15277
17044
|
destroyedRef: {
|
|
15278
17045
|
current: false
|
|
15279
17046
|
},
|
|
17047
|
+
lastSelectionUpdatedNodePathRef: { current: null },
|
|
17048
|
+
lastExpandStateInfoRef: {
|
|
17049
|
+
current: {
|
|
17050
|
+
state: "collapsed",
|
|
17051
|
+
nodePath: null
|
|
17052
|
+
}
|
|
17053
|
+
},
|
|
15280
17054
|
idToIndexMap: /* @__PURE__ */ new Map(),
|
|
17055
|
+
idToPathMap: /* @__PURE__ */ new Map(),
|
|
17056
|
+
pathToIndexDeepMap: new DeepMap(),
|
|
15281
17057
|
getDataSourceMasterContextRef: { current: () => void 0 },
|
|
15282
17058
|
// TODO: cleanup cache on unmount
|
|
15283
17059
|
cache: void 0,
|
|
@@ -15288,6 +17064,7 @@ function initSetupState() {
|
|
|
15288
17064
|
timestamp: 0,
|
|
15289
17065
|
mutations: void 0
|
|
15290
17066
|
},
|
|
17067
|
+
rowsPerPage: null,
|
|
15291
17068
|
lazyLoadCacheOfLoadedBatches: new DeepMap(),
|
|
15292
17069
|
dataParams: void 0,
|
|
15293
17070
|
onCleanup: buildSubscriptionCallback(),
|
|
@@ -15316,6 +17093,7 @@ function initSetupState() {
|
|
|
15316
17093
|
updatedAt: now,
|
|
15317
17094
|
groupedAt: 0,
|
|
15318
17095
|
sortedAt: 0,
|
|
17096
|
+
treeAt: 0,
|
|
15319
17097
|
filteredAt: 0,
|
|
15320
17098
|
reducedAt: now,
|
|
15321
17099
|
generateGroupRows: true,
|
|
@@ -15340,16 +17118,35 @@ function getCompareObjectForDataParams(dataParams) {
|
|
|
15340
17118
|
var EMPTY_ARRAY2 = [];
|
|
15341
17119
|
var cleanupDataSource = (state) => {
|
|
15342
17120
|
state.destroyedRef.current = true;
|
|
17121
|
+
state.__apiRef.current = null;
|
|
17122
|
+
state.lastSelectionUpdatedNodePathRef.current = null;
|
|
17123
|
+
state.lastExpandStateInfoRef.current = {
|
|
17124
|
+
state: "collapsed",
|
|
17125
|
+
nodePath: null
|
|
17126
|
+
};
|
|
17127
|
+
state.treeExpandState?.destroy();
|
|
17128
|
+
state.treePaths?.clear();
|
|
17129
|
+
state.pathToIndexDeepMap?.clear();
|
|
17130
|
+
state.rowDisabledState?.destroy();
|
|
17131
|
+
state.groupRowsState?.destroy();
|
|
17132
|
+
state.treeSelectionState?.destroy();
|
|
17133
|
+
state.idToPathMap.clear();
|
|
17134
|
+
state.idToIndexMap.clear();
|
|
15343
17135
|
};
|
|
15344
|
-
var forwardProps3 = (setupState) => {
|
|
17136
|
+
var forwardProps3 = (setupState, props) => {
|
|
15345
17137
|
return {
|
|
15346
17138
|
onDataParamsChange: (fn) => fn ? discardCallsWithEqualArg(fn, 100, getCompareObjectForDataParams) : void 0,
|
|
15347
17139
|
lazyLoad: (lazyLoad) => !!lazyLoad,
|
|
15348
17140
|
data: 1,
|
|
15349
17141
|
debugId: 1,
|
|
17142
|
+
nodesKey: 1,
|
|
17143
|
+
isNodeExpanded: 1,
|
|
17144
|
+
isNodeCollapsed: 1,
|
|
15350
17145
|
pivotBy: 1,
|
|
15351
17146
|
primaryKey: 1,
|
|
17147
|
+
debugMode: 1,
|
|
15352
17148
|
livePagination: 1,
|
|
17149
|
+
treeSelection: 1,
|
|
15353
17150
|
refetchKey: (refetchKey) => refetchKey ?? "",
|
|
15354
17151
|
filterFunction: 1,
|
|
15355
17152
|
filterValue: 1,
|
|
@@ -15369,18 +17166,48 @@ var forwardProps3 = (setupState) => {
|
|
|
15369
17166
|
state.idToIndexMap.clear();
|
|
15370
17167
|
},
|
|
15371
17168
|
reducer: (_, rowInfo) => {
|
|
17169
|
+
if (props.debugMode && !props.nodesKey && state.idToIndexMap.has(rowInfo.id)) {
|
|
17170
|
+
console.warn(`Duplicate id found in data source: ${rowInfo.id}`);
|
|
17171
|
+
}
|
|
15372
17172
|
state.idToIndexMap.set(rowInfo.id, rowInfo.indexInAll);
|
|
15373
17173
|
}
|
|
15374
17174
|
};
|
|
15375
|
-
|
|
17175
|
+
const result = reducers ? {
|
|
15376
17176
|
...reducers,
|
|
15377
17177
|
__idToIndex: idToIndexReducer
|
|
15378
17178
|
} : {
|
|
15379
17179
|
__idToIndex: idToIndexReducer
|
|
15380
17180
|
};
|
|
17181
|
+
if (props.nodesKey) {
|
|
17182
|
+
const pathToIndexReducer = {
|
|
17183
|
+
initialValue: () => {
|
|
17184
|
+
state.idToPathMap.clear();
|
|
17185
|
+
state.pathToIndexDeepMap.clear();
|
|
17186
|
+
},
|
|
17187
|
+
reducer: (_, rowInfo) => {
|
|
17188
|
+
if (rowInfo.isTreeNode) {
|
|
17189
|
+
state.idToPathMap.set(rowInfo.id, rowInfo.nodePath);
|
|
17190
|
+
if (props.debugMode && state.pathToIndexDeepMap.has(rowInfo.nodePath)) {
|
|
17191
|
+
console.warn(
|
|
17192
|
+
`Duplicate node path found in data source (debugId: ${props.debugId || "none"}): ${rowInfo.nodePath}`
|
|
17193
|
+
);
|
|
17194
|
+
}
|
|
17195
|
+
state.pathToIndexDeepMap.set(
|
|
17196
|
+
rowInfo.nodePath,
|
|
17197
|
+
rowInfo.indexInAll
|
|
17198
|
+
);
|
|
17199
|
+
}
|
|
17200
|
+
}
|
|
17201
|
+
};
|
|
17202
|
+
result.__pathToIndex = pathToIndexReducer;
|
|
17203
|
+
}
|
|
17204
|
+
return result;
|
|
15381
17205
|
},
|
|
17206
|
+
onNodeCollapse: 1,
|
|
17207
|
+
onNodeExpand: 1,
|
|
15382
17208
|
batchOperationDelay: 1,
|
|
15383
17209
|
isRowSelected: 1,
|
|
17210
|
+
isNodeSelected: 1,
|
|
15384
17211
|
isRowDisabled: 1,
|
|
15385
17212
|
rowDisabledState: (rowDisabledState) => {
|
|
15386
17213
|
if (!rowDisabledState) {
|
|
@@ -15402,6 +17229,7 @@ var forwardProps3 = (setupState) => {
|
|
|
15402
17229
|
},
|
|
15403
17230
|
onDataArrayChange: 1,
|
|
15404
17231
|
onDataMutations: 1,
|
|
17232
|
+
onTreeDataMutations: 1,
|
|
15405
17233
|
aggregationReducers: 1,
|
|
15406
17234
|
collapseGroupRowsOnDataFunctionChange: (collapseGroupRowsOnDataFunctionChange) => collapseGroupRowsOnDataFunctionChange ?? true,
|
|
15407
17235
|
loading: (loading) => loading ?? false,
|
|
@@ -15418,8 +17246,64 @@ function getLivePaginationCursorValue(livePaginationCursorProp, state) {
|
|
|
15418
17246
|
return livePaginationCursor;
|
|
15419
17247
|
}
|
|
15420
17248
|
var weakMap = /* @__PURE__ */ new WeakMap();
|
|
17249
|
+
function toShouldReloadObject(shouldReloadData) {
|
|
17250
|
+
if (typeof shouldReloadData === "boolean") {
|
|
17251
|
+
return {
|
|
17252
|
+
filterValue: shouldReloadData,
|
|
17253
|
+
sortInfo: shouldReloadData,
|
|
17254
|
+
groupBy: shouldReloadData,
|
|
17255
|
+
pivotBy: shouldReloadData
|
|
17256
|
+
};
|
|
17257
|
+
}
|
|
17258
|
+
const result = {};
|
|
17259
|
+
if (shouldReloadData.filterValue != null) {
|
|
17260
|
+
result.filterValue = shouldReloadData.filterValue;
|
|
17261
|
+
}
|
|
17262
|
+
if (shouldReloadData.sortInfo != null) {
|
|
17263
|
+
result.sortInfo = shouldReloadData.sortInfo;
|
|
17264
|
+
}
|
|
17265
|
+
if (shouldReloadData.groupBy != null) {
|
|
17266
|
+
result.groupBy = shouldReloadData.groupBy;
|
|
17267
|
+
}
|
|
17268
|
+
if (shouldReloadData.pivotBy != null) {
|
|
17269
|
+
result.pivotBy = shouldReloadData.pivotBy;
|
|
17270
|
+
}
|
|
17271
|
+
return result;
|
|
17272
|
+
}
|
|
17273
|
+
var treeSelectionStateDefaultObject = {
|
|
17274
|
+
selectedPaths: [],
|
|
17275
|
+
deselectedPaths: [],
|
|
17276
|
+
defaultSelection: false
|
|
17277
|
+
};
|
|
17278
|
+
function getTreeSelectionState(currentTreeSelection, selectionMode, state) {
|
|
17279
|
+
if (selectionMode != "multi-row") {
|
|
17280
|
+
throw new Error(
|
|
17281
|
+
`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${selectionMode}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
17282
|
+
|
|
17283
|
+
|
|
17284
|
+
`
|
|
17285
|
+
);
|
|
17286
|
+
}
|
|
17287
|
+
const config = treeSelectionStateConfigGetter(state);
|
|
17288
|
+
if (currentTreeSelection instanceof TreeSelectionState) {
|
|
17289
|
+
currentTreeSelection.setConfigFn(config);
|
|
17290
|
+
return currentTreeSelection;
|
|
17291
|
+
}
|
|
17292
|
+
if (currentTreeSelection === null || currentTreeSelection === void 0 || typeof currentTreeSelection != "object") {
|
|
17293
|
+
currentTreeSelection = void 0;
|
|
17294
|
+
}
|
|
17295
|
+
const treeSelectionStateObject = currentTreeSelection ?? treeSelectionStateDefaultObject;
|
|
17296
|
+
let instance = weakMap.get(treeSelectionStateObject);
|
|
17297
|
+
if (instance) {
|
|
17298
|
+
instance.setConfigFn(config);
|
|
17299
|
+
}
|
|
17300
|
+
instance = instance ?? new TreeSelectionState(treeSelectionStateObject, config);
|
|
17301
|
+
weakMap.set(treeSelectionStateObject, instance);
|
|
17302
|
+
return instance;
|
|
17303
|
+
}
|
|
15421
17304
|
function deriveStateFromProps(params) {
|
|
15422
17305
|
const { props, state, oldState } = params;
|
|
17306
|
+
const isTree = !!state.nodesKey;
|
|
15423
17307
|
const controlledSort = isControlledValue(props.sortInfo);
|
|
15424
17308
|
const controlledFilter = isControlledValue(props.filterValue);
|
|
15425
17309
|
const { filterTypes } = state;
|
|
@@ -15452,29 +17336,31 @@ function deriveStateFromProps(params) {
|
|
|
15452
17336
|
let cellSelectionState = null;
|
|
15453
17337
|
let currentRowSelection = props.rowSelection !== void 0 ? props.rowSelection : state.rowSelection === void 0 ? props.defaultRowSelection !== void 0 ? props.defaultRowSelection : null : state.rowSelection;
|
|
15454
17338
|
let currentCellSelection = props.cellSelection !== void 0 ? props.cellSelection : state.cellSelection === void 0 ? props.defaultCellSelection !== void 0 ? props.defaultCellSelection : null : state.cellSelection || null;
|
|
15455
|
-
if (
|
|
15456
|
-
if (selectionMode
|
|
15457
|
-
if (
|
|
15458
|
-
|
|
15459
|
-
|
|
15460
|
-
|
|
15461
|
-
|
|
15462
|
-
|
|
15463
|
-
|
|
15464
|
-
|
|
15465
|
-
|
|
15466
|
-
|
|
15467
|
-
if (selectionMode === "single-row") {
|
|
15468
|
-
rowSelectionState = currentRowSelection;
|
|
17339
|
+
if (!isTree) {
|
|
17340
|
+
if (selectionMode !== false) {
|
|
17341
|
+
if (selectionMode === "single-row" || selectionMode === "multi-row") {
|
|
17342
|
+
if (currentRowSelection === null) {
|
|
17343
|
+
rowSelectionState = selectionMode === "single-row" ? null : new RowSelectionState(
|
|
17344
|
+
{
|
|
17345
|
+
selectedRows: [],
|
|
17346
|
+
deselectedRows: [],
|
|
17347
|
+
defaultSelection: false
|
|
17348
|
+
},
|
|
17349
|
+
rowSelectionStateConfigGetter(state)
|
|
17350
|
+
);
|
|
15469
17351
|
} else {
|
|
15470
|
-
if (
|
|
17352
|
+
if (selectionMode === "single-row") {
|
|
15471
17353
|
rowSelectionState = currentRowSelection;
|
|
15472
17354
|
} else {
|
|
15473
|
-
|
|
15474
|
-
currentRowSelection
|
|
15475
|
-
|
|
15476
|
-
|
|
15477
|
-
|
|
17355
|
+
if (currentRowSelection instanceof RowSelectionState) {
|
|
17356
|
+
rowSelectionState = currentRowSelection;
|
|
17357
|
+
} else {
|
|
17358
|
+
const instance = new RowSelectionState(
|
|
17359
|
+
currentRowSelection,
|
|
17360
|
+
rowSelectionStateConfigGetter(state)
|
|
17361
|
+
);
|
|
17362
|
+
rowSelectionState = instance;
|
|
17363
|
+
}
|
|
15478
17364
|
}
|
|
15479
17365
|
}
|
|
15480
17366
|
}
|
|
@@ -15497,9 +17383,22 @@ function deriveStateFromProps(params) {
|
|
|
15497
17383
|
}
|
|
15498
17384
|
const primaryKeyDescriptor = state.primaryKey;
|
|
15499
17385
|
const toPrimaryKey = typeof primaryKeyDescriptor === "function" ? (data) => primaryKeyDescriptor(data) : (data) => data[primaryKeyDescriptor];
|
|
17386
|
+
const treeProps = props;
|
|
17387
|
+
let treeExpandState = treeProps.treeExpandState || state.treeExpandState || treeProps.defaultTreeExpandState;
|
|
17388
|
+
if (treeExpandState && !(treeExpandState instanceof TreeExpandState)) {
|
|
17389
|
+
const instance = weakMap.get(treeExpandState) ?? new TreeExpandState(treeExpandState);
|
|
17390
|
+
weakMap.set(treeExpandState, instance);
|
|
17391
|
+
treeExpandState = instance;
|
|
17392
|
+
}
|
|
17393
|
+
treeExpandState = treeExpandState || new TreeExpandState({
|
|
17394
|
+
defaultExpanded: true,
|
|
17395
|
+
collapsedPaths: []
|
|
17396
|
+
});
|
|
15500
17397
|
let groupRowsState = props.groupRowsState || state.groupRowsState || props.defaultGroupRowsState;
|
|
15501
17398
|
if (groupRowsState && !(groupRowsState instanceof GroupRowsState)) {
|
|
15502
|
-
|
|
17399
|
+
const instance = weakMap.get(groupRowsState) ?? new GroupRowsState(groupRowsState);
|
|
17400
|
+
weakMap.set(groupRowsState, instance);
|
|
17401
|
+
groupRowsState = instance;
|
|
15503
17402
|
}
|
|
15504
17403
|
groupRowsState = groupRowsState || new GroupRowsState(
|
|
15505
17404
|
state.lazyLoad ? { expandedRows: [], collapsedRows: true } : {
|
|
@@ -15507,7 +17406,7 @@ function deriveStateFromProps(params) {
|
|
|
15507
17406
|
collapsedRows: []
|
|
15508
17407
|
}
|
|
15509
17408
|
);
|
|
15510
|
-
const
|
|
17409
|
+
const shouldReloadData = toShouldReloadObject(props.shouldReloadData || {});
|
|
15511
17410
|
const propsGroupMode = props.groupMode ?? (shouldReloadData.groupBy != null ? shouldReloadData.groupBy ? "remote" : "local" : void 0);
|
|
15512
17411
|
const propsSortMode = props.sortMode ?? shouldReloadData.sortInfo != null ? shouldReloadData.sortInfo ? "remote" : "local" : void 0;
|
|
15513
17412
|
const propsFilterMode = props.filterMode ?? shouldReloadData.filterValue != null ? shouldReloadData.filterValue ? "remote" : "local" : void 0;
|
|
@@ -15550,8 +17449,11 @@ function deriveStateFromProps(params) {
|
|
|
15550
17449
|
}
|
|
15551
17450
|
}
|
|
15552
17451
|
const result = {
|
|
17452
|
+
isTree,
|
|
15553
17453
|
selectionMode,
|
|
15554
17454
|
groupRowsState,
|
|
17455
|
+
treeExpandState,
|
|
17456
|
+
treeExpandMode: treeExpandState.mode,
|
|
15555
17457
|
shouldReloadData: {
|
|
15556
17458
|
// #sortMode_vs_shouldReloadData.sortInfo
|
|
15557
17459
|
// we reconstruct this object
|
|
@@ -15560,10 +17462,10 @@ function deriveStateFromProps(params) {
|
|
|
15560
17462
|
// since we want a subtle difference between the computed sortMode and shouldReloadData.sortInfo (for example)
|
|
15561
17463
|
// difference: sortMode will be local when sortFunction is provided, however, the user may want to reload data when sortInfo changes
|
|
15562
17464
|
// and thus the data will be refetched, but will be sorted locally
|
|
15563
|
-
filterValue:
|
|
15564
|
-
sortInfo:
|
|
15565
|
-
groupBy:
|
|
15566
|
-
pivotBy:
|
|
17465
|
+
filterValue: shouldReloadData?.filterValue ?? filterMode === "remote",
|
|
17466
|
+
sortInfo: shouldReloadData?.sortInfo ?? sortMode === "remote",
|
|
17467
|
+
groupBy: shouldReloadData?.groupBy ?? groupMode === "remote",
|
|
17468
|
+
pivotBy: shouldReloadData?.pivotBy ?? pivotMode === "remote"
|
|
15567
17469
|
},
|
|
15568
17470
|
isRowDisabled,
|
|
15569
17471
|
rowSelection: rowSelectionState,
|
|
@@ -15622,6 +17524,41 @@ function getMappedCallbacks() {
|
|
|
15622
17524
|
]
|
|
15623
17525
|
};
|
|
15624
17526
|
},
|
|
17527
|
+
treeSelection: (treeSelection, state) => {
|
|
17528
|
+
if (state.selectionMode === "single-row") {
|
|
17529
|
+
const callbackParams2 = [
|
|
17530
|
+
treeSelection,
|
|
17531
|
+
{ selectionMode: "single-row" }
|
|
17532
|
+
];
|
|
17533
|
+
return {
|
|
17534
|
+
callbackParams: callbackParams2
|
|
17535
|
+
};
|
|
17536
|
+
}
|
|
17537
|
+
const callbackParams = [
|
|
17538
|
+
treeSelection.getState(),
|
|
17539
|
+
{
|
|
17540
|
+
selectionMode: "multi-row",
|
|
17541
|
+
lastUpdatedNodePath: state.lastSelectionUpdatedNodePathRef.current,
|
|
17542
|
+
dataSourceApi: state.__apiRef.current
|
|
17543
|
+
}
|
|
17544
|
+
];
|
|
17545
|
+
return {
|
|
17546
|
+
callbackParams
|
|
17547
|
+
};
|
|
17548
|
+
},
|
|
17549
|
+
treeExpandState: (treeExpandState, state) => {
|
|
17550
|
+
const callbackParams = [
|
|
17551
|
+
treeExpandState.getState(),
|
|
17552
|
+
{
|
|
17553
|
+
nodeState: state.lastExpandStateInfoRef.current.state,
|
|
17554
|
+
nodePath: state.lastExpandStateInfoRef.current.nodePath,
|
|
17555
|
+
dataSourceApi: state.__apiRef.current
|
|
17556
|
+
}
|
|
17557
|
+
];
|
|
17558
|
+
return {
|
|
17559
|
+
callbackParams
|
|
17560
|
+
};
|
|
17561
|
+
},
|
|
15625
17562
|
cellSelection: (cellSelection, state) => {
|
|
15626
17563
|
if (state.selectionMode === "single-cell") {
|
|
15627
17564
|
return {
|
|
@@ -15847,6 +17784,14 @@ function useDataSourceInternal(props) {
|
|
|
15847
17784
|
timestamp: componentState.originalDataArrayChangedInfo.timestamp
|
|
15848
17785
|
});
|
|
15849
17786
|
}
|
|
17787
|
+
if (componentState.onTreeDataMutations && componentState.originalDataArrayChangedInfo.treeMutations && componentState.originalDataArrayChangedInfo.treeMutations.size) {
|
|
17788
|
+
componentState.onTreeDataMutations({
|
|
17789
|
+
nodesKey: componentState.nodesKey ? componentState.nodesKey : void 0,
|
|
17790
|
+
dataArray: componentState.originalDataArray,
|
|
17791
|
+
treeMutations: componentState.originalDataArrayChangedInfo.treeMutations,
|
|
17792
|
+
timestamp: componentState.originalDataArrayChangedInfo.timestamp
|
|
17793
|
+
});
|
|
17794
|
+
}
|
|
15850
17795
|
}, [componentState.originalDataArrayChangedInfo]);
|
|
15851
17796
|
(0, import_react36.useEffect)(() => {
|
|
15852
17797
|
componentState.onReady?.(api);
|
|
@@ -16134,16 +18079,7 @@ function notNullable(value) {
|
|
|
16134
18079
|
return true;
|
|
16135
18080
|
}
|
|
16136
18081
|
|
|
16137
|
-
// src/components/
|
|
16138
|
-
function ensureSortedPerOrder(arr, sortPattern) {
|
|
16139
|
-
const arrSet = new Set(arr);
|
|
16140
|
-
return sortPattern.map((item) => {
|
|
16141
|
-
if (arrSet.has(item)) {
|
|
16142
|
-
return item;
|
|
16143
|
-
}
|
|
16144
|
-
return null;
|
|
16145
|
-
}).filter((x) => x != null);
|
|
16146
|
-
}
|
|
18082
|
+
// src/components/types/CellPositionByIndex.ts
|
|
16147
18083
|
function ensureMinMaxCellPositionByIndex(start, end) {
|
|
16148
18084
|
let { rowIndex: startRowIndex, colIndex: startColIndex } = start;
|
|
16149
18085
|
let { rowIndex: endRowIndex, colIndex: endColIndex } = end;
|
|
@@ -16154,6 +18090,64 @@ function ensureMinMaxCellPositionByIndex(start, end) {
|
|
|
16154
18090
|
{ rowIndex: rowEnd, colIndex: colEnd }
|
|
16155
18091
|
];
|
|
16156
18092
|
}
|
|
18093
|
+
function isSamePage(startPosition, endPosition, options) {
|
|
18094
|
+
const { rowsPerPage } = options;
|
|
18095
|
+
return !rowsPerPage ? true : Math.floor(startPosition.rowIndex / rowsPerPage) === Math.floor(endPosition.rowIndex / rowsPerPage);
|
|
18096
|
+
}
|
|
18097
|
+
function getPositionsArrayForRangeInHorizontaLLayout(startPosition, endPosition, options) {
|
|
18098
|
+
if (isSamePage(startPosition, endPosition, options)) {
|
|
18099
|
+
throw "You should not call this when the positions are in the same page";
|
|
18100
|
+
}
|
|
18101
|
+
const { rowsPerPage, columnsPerSet } = options;
|
|
18102
|
+
if (rowsPerPage === 0) {
|
|
18103
|
+
throw "rowsPerPage cannot be 0";
|
|
18104
|
+
}
|
|
18105
|
+
let start = startPosition;
|
|
18106
|
+
let end = endPosition;
|
|
18107
|
+
if (Math.floor(startPosition.rowIndex / rowsPerPage) > Math.floor(endPosition.rowIndex / rowsPerPage)) {
|
|
18108
|
+
start = endPosition;
|
|
18109
|
+
end = startPosition;
|
|
18110
|
+
}
|
|
18111
|
+
let { rowIndex: startRowIndex, colIndex: startColIndex } = start;
|
|
18112
|
+
let { rowIndex: endRowIndex, colIndex: endColIndex } = end;
|
|
18113
|
+
const pageForStartRowIndex = Math.floor(startRowIndex / rowsPerPage);
|
|
18114
|
+
const pageForEndRowIndex = Math.floor(endRowIndex / rowsPerPage);
|
|
18115
|
+
const offsetForStartRowIndex = startRowIndex % rowsPerPage;
|
|
18116
|
+
const offsetForEndRowIndex = endRowIndex % rowsPerPage;
|
|
18117
|
+
const minOffset = Math.min(offsetForStartRowIndex, offsetForEndRowIndex);
|
|
18118
|
+
const maxOffset = Math.max(offsetForStartRowIndex, offsetForEndRowIndex);
|
|
18119
|
+
const positions = [];
|
|
18120
|
+
for (let page = pageForStartRowIndex; page <= pageForEndRowIndex; page++) {
|
|
18121
|
+
for (let offset = minOffset; offset <= maxOffset; offset++) {
|
|
18122
|
+
const rowIndex = page * rowsPerPage + offset;
|
|
18123
|
+
if (page === pageForStartRowIndex) {
|
|
18124
|
+
for (let colIndex = startColIndex; colIndex < columnsPerSet; colIndex++) {
|
|
18125
|
+
positions.push({ rowIndex, colIndex });
|
|
18126
|
+
}
|
|
18127
|
+
} else if (page === pageForEndRowIndex) {
|
|
18128
|
+
for (let colIndex = 0; colIndex <= endColIndex; colIndex++) {
|
|
18129
|
+
positions.push({ rowIndex, colIndex });
|
|
18130
|
+
}
|
|
18131
|
+
} else {
|
|
18132
|
+
for (let colIndex = 0; colIndex < columnsPerSet; colIndex++) {
|
|
18133
|
+
positions.push({ rowIndex, colIndex });
|
|
18134
|
+
}
|
|
18135
|
+
}
|
|
18136
|
+
}
|
|
18137
|
+
}
|
|
18138
|
+
return positions;
|
|
18139
|
+
}
|
|
18140
|
+
|
|
18141
|
+
// src/components/InfiniteTable/api/getCellSelectionApi.ts
|
|
18142
|
+
function ensureSortedPerOrder(arr, sortPattern) {
|
|
18143
|
+
const arrSet = new Set(arr);
|
|
18144
|
+
return sortPattern.map((item) => {
|
|
18145
|
+
if (arrSet.has(item)) {
|
|
18146
|
+
return item;
|
|
18147
|
+
}
|
|
18148
|
+
return null;
|
|
18149
|
+
}).filter((x) => x != null);
|
|
18150
|
+
}
|
|
16157
18151
|
var InfiniteTableCellSelectionApiImpl = class {
|
|
16158
18152
|
constructor(param) {
|
|
16159
18153
|
this.getCellSelectionPosition = (options) => {
|
|
@@ -17990,7 +19984,7 @@ var MultiCellSelector = class {
|
|
|
17990
19984
|
this.multiSelectEndPosition = void 0;
|
|
17991
19985
|
}
|
|
17992
19986
|
}
|
|
17993
|
-
multiSelectClick(position2) {
|
|
19987
|
+
multiSelectClick(position2, options) {
|
|
17994
19988
|
if (!this.multiSelectStartPosition) {
|
|
17995
19989
|
return;
|
|
17996
19990
|
}
|
|
@@ -18001,13 +19995,39 @@ var MultiCellSelector = class {
|
|
|
18001
19995
|
if (this.multiSelectEndPosition) {
|
|
18002
19996
|
this.deselectRange(
|
|
18003
19997
|
this.multiSelectStartPosition,
|
|
18004
|
-
this.multiSelectEndPosition
|
|
19998
|
+
this.multiSelectEndPosition,
|
|
19999
|
+
options
|
|
18005
20000
|
);
|
|
18006
20001
|
}
|
|
18007
|
-
this.selectRange(this.multiSelectStartPosition, position2);
|
|
20002
|
+
this.selectRange(this.multiSelectStartPosition, position2, options);
|
|
18008
20003
|
this.multiSelectEndPosition = position2;
|
|
18009
20004
|
}
|
|
18010
|
-
setRangeSelected(startPosition, endPosition, selected) {
|
|
20005
|
+
setRangeSelected(startPosition, endPosition, selected, options) {
|
|
20006
|
+
if (options.horizontalLayout && !isSamePage(startPosition, endPosition, options)) {
|
|
20007
|
+
const positions = getPositionsArrayForRangeInHorizontaLLayout(
|
|
20008
|
+
startPosition,
|
|
20009
|
+
endPosition,
|
|
20010
|
+
{
|
|
20011
|
+
rowsPerPage: options.rowsPerPage,
|
|
20012
|
+
columnsPerSet: options.columnsPerSet
|
|
20013
|
+
}
|
|
20014
|
+
);
|
|
20015
|
+
positions.forEach((position2) => {
|
|
20016
|
+
const selectionPosition = this.getCellSelectionPosition({
|
|
20017
|
+
rowIndex: position2.rowIndex,
|
|
20018
|
+
colIndex: position2.colIndex
|
|
20019
|
+
});
|
|
20020
|
+
if (!selectionPosition) {
|
|
20021
|
+
return;
|
|
20022
|
+
}
|
|
20023
|
+
if (selected) {
|
|
20024
|
+
this.cellSelectionState.selectCell(...selectionPosition);
|
|
20025
|
+
} else {
|
|
20026
|
+
this.cellSelectionState.deselectCell(...selectionPosition);
|
|
20027
|
+
}
|
|
20028
|
+
});
|
|
20029
|
+
return;
|
|
20030
|
+
}
|
|
18011
20031
|
const [start, end] = ensureMinMaxCellPositionByIndex(
|
|
18012
20032
|
startPosition,
|
|
18013
20033
|
endPosition
|
|
@@ -18034,11 +20054,11 @@ var MultiCellSelector = class {
|
|
|
18034
20054
|
}
|
|
18035
20055
|
}
|
|
18036
20056
|
}
|
|
18037
|
-
deselectRange(startPosition, endPosition) {
|
|
18038
|
-
this.setRangeSelected(startPosition, endPosition, false);
|
|
20057
|
+
deselectRange(startPosition, endPosition, options) {
|
|
20058
|
+
this.setRangeSelected(startPosition, endPosition, false, options);
|
|
18039
20059
|
}
|
|
18040
|
-
selectRange(startPosition, endPosition) {
|
|
18041
|
-
this.setRangeSelected(startPosition, endPosition, true);
|
|
20060
|
+
selectRange(startPosition, endPosition, options) {
|
|
20061
|
+
this.setRangeSelected(startPosition, endPosition, true, options);
|
|
18042
20062
|
}
|
|
18043
20063
|
};
|
|
18044
20064
|
|
|
@@ -18287,7 +20307,7 @@ var HorizontalLayoutMatrixBrain = class extends MatrixBrain {
|
|
|
18287
20307
|
}
|
|
18288
20308
|
}
|
|
18289
20309
|
computeDirectionalRenderCount(direction, itemSize, count, theRenderSize) {
|
|
18290
|
-
if (direction === "vertical") {
|
|
20310
|
+
if (direction === "vertical" || typeof itemSize === "number") {
|
|
18291
20311
|
return super.computeDirectionalRenderCount(
|
|
18292
20312
|
direction,
|
|
18293
20313
|
itemSize,
|
|
@@ -18297,15 +20317,6 @@ var HorizontalLayoutMatrixBrain = class extends MatrixBrain {
|
|
|
18297
20317
|
}
|
|
18298
20318
|
let renderCount = 0;
|
|
18299
20319
|
let size = theRenderSize.width;
|
|
18300
|
-
size -= this.getFixedSize("horizontal");
|
|
18301
|
-
if (size <= 0) {
|
|
18302
|
-
return 0;
|
|
18303
|
-
}
|
|
18304
|
-
if (typeof itemSize === "number") {
|
|
18305
|
-
renderCount = (itemSize ? Math.ceil(size / itemSize) : 0) + 1;
|
|
18306
|
-
renderCount = Math.min(count, renderCount);
|
|
18307
|
-
return renderCount;
|
|
18308
|
-
}
|
|
18309
20320
|
const pagesInView = Math.floor(size / this.pageWidth);
|
|
18310
20321
|
renderCount += pagesInView * this.initialCols;
|
|
18311
20322
|
const remainingSize = size - pagesInView * this.pageWidth;
|
|
@@ -18313,16 +20324,10 @@ var HorizontalLayoutMatrixBrain = class extends MatrixBrain {
|
|
|
18313
20324
|
for (let i = 0; i < this.initialCols; i++) {
|
|
18314
20325
|
sizes.push(this.getItemSize(i, direction));
|
|
18315
20326
|
}
|
|
18316
|
-
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
|
|
18320
|
-
renderCount++;
|
|
18321
|
-
if (sum2 > remainingSize) {
|
|
18322
|
-
break;
|
|
18323
|
-
}
|
|
18324
|
-
}
|
|
18325
|
-
renderCount += 1;
|
|
20327
|
+
renderCount += getGreatestCountVisibleInSize(
|
|
20328
|
+
remainingSize,
|
|
20329
|
+
sizes.concat(sizes)
|
|
20330
|
+
);
|
|
18326
20331
|
renderCount = Math.min(count, renderCount);
|
|
18327
20332
|
return renderCount;
|
|
18328
20333
|
}
|
|
@@ -18636,7 +20641,8 @@ function initSetupState2({
|
|
|
18636
20641
|
pinnedStartScrollListener: new ScrollListener(),
|
|
18637
20642
|
pinnedEndScrollListener: new ScrollListener(),
|
|
18638
20643
|
columnsWhenInlineGroupRenderStrategy: void 0,
|
|
18639
|
-
editingCell: null
|
|
20644
|
+
editingCell: null,
|
|
20645
|
+
forceBodyRerenderTimestamp: 0
|
|
18640
20646
|
};
|
|
18641
20647
|
}
|
|
18642
20648
|
var forwardProps4 = (_setupState) => {
|
|
@@ -18650,6 +20656,7 @@ var forwardProps4 = (_setupState) => {
|
|
|
18650
20656
|
groupColumn: 1,
|
|
18651
20657
|
onReady: 1,
|
|
18652
20658
|
domProps: 1,
|
|
20659
|
+
debugMode: 1,
|
|
18653
20660
|
onKeyDown: 1,
|
|
18654
20661
|
onCellClick: 1,
|
|
18655
20662
|
focusedClassName: 1,
|
|
@@ -18681,6 +20688,7 @@ var forwardProps4 = (_setupState) => {
|
|
|
18681
20688
|
rowProps: 1,
|
|
18682
20689
|
rowClassName: 1,
|
|
18683
20690
|
cellClassName: 1,
|
|
20691
|
+
repeatWrappedGroupRows: 1,
|
|
18684
20692
|
pinnedStartMaxWidth: 1,
|
|
18685
20693
|
pinnedEndMaxWidth: 1,
|
|
18686
20694
|
pivotColumn: 1,
|
|
@@ -18858,6 +20866,7 @@ var mapPropsToState = (params) => {
|
|
|
18858
20866
|
}
|
|
18859
20867
|
const isRowDetailEnabled = !rowDetailRenderer ? false : props.isRowDetailEnabled || true;
|
|
18860
20868
|
return {
|
|
20869
|
+
isTree: parentState.isTree,
|
|
18861
20870
|
rowDetailRenderer,
|
|
18862
20871
|
rowDetailState,
|
|
18863
20872
|
isRowDetailExpanded,
|
|
@@ -18929,6 +20938,9 @@ function getColumnVisibilityForHideEmptyGroupColumns(params) {
|
|
|
18929
20938
|
for (let i = 0; i < len; i++) {
|
|
18930
20939
|
const groupRowIndex = groupRowsIndexesInDataArray[i];
|
|
18931
20940
|
const rowInfo = dataArray[groupRowIndex];
|
|
20941
|
+
if (rowInfo.isTreeNode) {
|
|
20942
|
+
continue;
|
|
20943
|
+
}
|
|
18932
20944
|
if (!rowInfo.isGroupRow) {
|
|
18933
20945
|
continue;
|
|
18934
20946
|
}
|
|
@@ -19049,7 +21061,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
19049
21061
|
const toggleGroupRow = useToggleGroupRow();
|
|
19050
21062
|
const {
|
|
19051
21063
|
componentActions,
|
|
19052
|
-
componentState: { columns, groupRenderStrategy }
|
|
21064
|
+
componentState: { columns, groupRenderStrategy, isTree }
|
|
19053
21065
|
} = useManagedComponentState();
|
|
19054
21066
|
function computeColumnsWhenInlineGroupRenderStrategy(columns2, groupByMap2, groupRenderStrategy2, toggleGroupRow2) {
|
|
19055
21067
|
const computedColumns = {};
|
|
@@ -19070,6 +21082,9 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
19070
21082
|
return rowInfo.isGroupRow ? rowInfo.groupKeys?.[groupIndex] : rowInfo.value;
|
|
19071
21083
|
},
|
|
19072
21084
|
rowspan: ({ rowInfo, dataArray }) => {
|
|
21085
|
+
if (rowInfo.isTreeNode) {
|
|
21086
|
+
return 1;
|
|
21087
|
+
}
|
|
19073
21088
|
if (!rowInfo.isGroupRow) {
|
|
19074
21089
|
return 1;
|
|
19075
21090
|
}
|
|
@@ -19116,7 +21131,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
19116
21131
|
}
|
|
19117
21132
|
(0, import_react45.useEffect)(() => {
|
|
19118
21133
|
const update = () => {
|
|
19119
|
-
componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(
|
|
21134
|
+
componentActions.columnsWhenInlineGroupRenderStrategy = isTree ? void 0 : computeColumnsWhenInlineGroupRenderStrategy(
|
|
19120
21135
|
columns,
|
|
19121
21136
|
groupByMap,
|
|
19122
21137
|
groupRenderStrategy,
|
|
@@ -20052,7 +22067,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
20052
22067
|
}
|
|
20053
22068
|
let valid2 = isValidLicense(licenseKey, {
|
|
20054
22069
|
publishedAt: 1624970570587,
|
|
20055
|
-
version: "
|
|
22070
|
+
version: "6.0.1"
|
|
20056
22071
|
});
|
|
20057
22072
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
20058
22073
|
return true;
|
|
@@ -20164,6 +22179,7 @@ function onCellDoubleClick(context, _event) {
|
|
|
20164
22179
|
function updateCellSelectionOnCellClick(context, event) {
|
|
20165
22180
|
const {
|
|
20166
22181
|
getDataSourceState,
|
|
22182
|
+
getState,
|
|
20167
22183
|
getComputed,
|
|
20168
22184
|
rowIndex,
|
|
20169
22185
|
colIndex,
|
|
@@ -20177,7 +22193,10 @@ function updateCellSelectionOnCellClick(context, event) {
|
|
|
20177
22193
|
if (selectionMode !== "multi-cell") {
|
|
20178
22194
|
return;
|
|
20179
22195
|
}
|
|
20180
|
-
const { multiCellSelector } = getComputed();
|
|
22196
|
+
const { multiCellSelector, computedVisibleColumns } = getComputed();
|
|
22197
|
+
const { brain } = getState();
|
|
22198
|
+
const { rowsPerPage } = brain;
|
|
22199
|
+
const columnsPerSet = computedVisibleColumns.length;
|
|
20181
22200
|
const cellSelection = new CellSelectionState(existingCellSelection);
|
|
20182
22201
|
multiCellSelector.cellSelectionState = cellSelection;
|
|
20183
22202
|
const position2 = {
|
|
@@ -20187,7 +22206,17 @@ function updateCellSelectionOnCellClick(context, event) {
|
|
|
20187
22206
|
if (event.metaKey || event.ctrlKey) {
|
|
20188
22207
|
multiCellSelector.singleAddClick(position2);
|
|
20189
22208
|
} else if (event.shiftKey) {
|
|
20190
|
-
|
|
22209
|
+
const horizontalLayout = !!getState().wrapRowsHorizontally;
|
|
22210
|
+
multiCellSelector.multiSelectClick(
|
|
22211
|
+
position2,
|
|
22212
|
+
horizontalLayout ? {
|
|
22213
|
+
horizontalLayout,
|
|
22214
|
+
rowsPerPage,
|
|
22215
|
+
columnsPerSet
|
|
22216
|
+
} : {
|
|
22217
|
+
horizontalLayout
|
|
22218
|
+
}
|
|
22219
|
+
);
|
|
20191
22220
|
} else {
|
|
20192
22221
|
multiCellSelector.resetClick(position2);
|
|
20193
22222
|
}
|
|
@@ -20204,10 +22233,13 @@ function updateRowSelectionOnCellClick(context, event) {
|
|
|
20204
22233
|
} = context;
|
|
20205
22234
|
const { multiRowSelector, renderSelectionCheckBox } = getComputed();
|
|
20206
22235
|
const dataSourceState = getDataSourceState();
|
|
20207
|
-
const { selectionMode, groupBy, dataArray } = dataSourceState;
|
|
22236
|
+
const { selectionMode, groupBy, dataArray, isTree } = dataSourceState;
|
|
20208
22237
|
if (groupBy.length) {
|
|
20209
22238
|
return false;
|
|
20210
22239
|
}
|
|
22240
|
+
if (isTree) {
|
|
22241
|
+
return false;
|
|
22242
|
+
}
|
|
20211
22243
|
const rowInfo = dataArray[rowIndex];
|
|
20212
22244
|
if (rowInfo?.rowDisabled) {
|
|
20213
22245
|
return false;
|
|
@@ -20233,7 +22265,8 @@ function updateRowSelectionOnCellClick(context, event) {
|
|
|
20233
22265
|
return true;
|
|
20234
22266
|
}
|
|
20235
22267
|
} else if (selectionMode === "single-row") {
|
|
20236
|
-
const
|
|
22268
|
+
const rowInfo2 = dataArray[rowIndex];
|
|
22269
|
+
const id = rowInfo2.id;
|
|
20237
22270
|
if (event.metaKey || event.ctrlKey) {
|
|
20238
22271
|
api.rowSelectionApi.toggleRowSelection(id);
|
|
20239
22272
|
} else {
|
|
@@ -20277,7 +22310,7 @@ function getNextEnabledRowIndex(getDataSourceState, activeRowIndex, direction) {
|
|
|
20277
22310
|
return clamp(i, min, max);
|
|
20278
22311
|
}
|
|
20279
22312
|
function handleRowNavigation(options, event) {
|
|
20280
|
-
const { getState, getDataSourceState, actions, api } = options;
|
|
22313
|
+
const { getState, getDataSourceState, actions, api, dataSourceApi } = options;
|
|
20281
22314
|
const { key } = event;
|
|
20282
22315
|
const dataArray = getDataSourceState().dataArray;
|
|
20283
22316
|
const arrLength = dataArray.length;
|
|
@@ -20353,6 +22386,9 @@ function handleRowNavigation(options, event) {
|
|
|
20353
22386
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
20354
22387
|
return api.toggleGroupRow(rowInfo.groupKeys);
|
|
20355
22388
|
}
|
|
22389
|
+
if (rowInfo && rowInfo.isTreeNode && rowInfo.isParentNode) {
|
|
22390
|
+
return dataSourceApi.treeApi.toggleNode(rowInfo.nodePath);
|
|
22391
|
+
}
|
|
20356
22392
|
const hasRowDetail = api.rowDetailApi.isRowDetailEnabledForRow(
|
|
20357
22393
|
rowInfo.id
|
|
20358
22394
|
);
|
|
@@ -20394,6 +22430,7 @@ function handleCellNavigation(options, event) {
|
|
|
20394
22430
|
getState,
|
|
20395
22431
|
getComputed,
|
|
20396
22432
|
getDataSourceState,
|
|
22433
|
+
dataSourceApi,
|
|
20397
22434
|
actions
|
|
20398
22435
|
} = options;
|
|
20399
22436
|
const { key, shiftKey } = event;
|
|
@@ -20467,6 +22504,9 @@ function handleCellNavigation(options, event) {
|
|
|
20467
22504
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
20468
22505
|
return api.toggleGroupRow(rowInfo.groupKeys);
|
|
20469
22506
|
}
|
|
22507
|
+
if (rowInfo && rowInfo.isTreeNode && rowInfo.isParentNode) {
|
|
22508
|
+
return dataSourceApi.treeApi.toggleNode(rowInfo.nodePath);
|
|
22509
|
+
}
|
|
20470
22510
|
if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
|
|
20471
22511
|
return api.rowDetailApi.toggleRowDetail(rowInfo.id);
|
|
20472
22512
|
}
|
|
@@ -20559,7 +22599,9 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
20559
22599
|
getDataSourceState,
|
|
20560
22600
|
dataSourceActions,
|
|
20561
22601
|
api: imperativeApi,
|
|
20562
|
-
|
|
22602
|
+
dataSourceApi,
|
|
22603
|
+
cloneRowSelection: cloneRowSelection2,
|
|
22604
|
+
cloneTreeSelection: cloneTreeSelection2
|
|
20563
22605
|
} = context;
|
|
20564
22606
|
const { key, ctrlKey, metaKey } = keyboardEvent;
|
|
20565
22607
|
if (!validKeys2[key]) {
|
|
@@ -20573,7 +22615,13 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
20573
22615
|
keyboardNavigation,
|
|
20574
22616
|
keyboardSelection
|
|
20575
22617
|
} = state;
|
|
20576
|
-
const {
|
|
22618
|
+
const {
|
|
22619
|
+
selectionMode,
|
|
22620
|
+
groupBy,
|
|
22621
|
+
rowSelection,
|
|
22622
|
+
treeSelectionState: treeSelection,
|
|
22623
|
+
isTree
|
|
22624
|
+
} = dataSourceState;
|
|
20577
22625
|
if (keyboardSelection === false) {
|
|
20578
22626
|
return false;
|
|
20579
22627
|
}
|
|
@@ -20590,6 +22638,14 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
20590
22638
|
return false;
|
|
20591
22639
|
}
|
|
20592
22640
|
if (key === "a" && (ctrlKey || metaKey)) {
|
|
22641
|
+
if (isTree && treeSelection) {
|
|
22642
|
+
const treeSelectionState = cloneTreeSelection2(
|
|
22643
|
+
treeSelection
|
|
22644
|
+
);
|
|
22645
|
+
treeSelectionState.selectAll();
|
|
22646
|
+
dataSourceActions.treeSelection = treeSelectionState;
|
|
22647
|
+
return true;
|
|
22648
|
+
}
|
|
20593
22649
|
const rowSelectionState = cloneRowSelection2(
|
|
20594
22650
|
rowSelection
|
|
20595
22651
|
);
|
|
@@ -20607,6 +22663,11 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
20607
22663
|
imperativeApi.rowSelectionApi.toggleRowSelection(rowInfo.id);
|
|
20608
22664
|
}
|
|
20609
22665
|
return true;
|
|
22666
|
+
} else if (isTree) {
|
|
22667
|
+
if (rowInfo.isTreeNode && rowInfo.nodePath) {
|
|
22668
|
+
dataSourceApi.treeApi.toggleNodeSelection(rowInfo.nodePath);
|
|
22669
|
+
return true;
|
|
22670
|
+
}
|
|
20610
22671
|
} else {
|
|
20611
22672
|
const event = { ...keyboardEvent };
|
|
20612
22673
|
const { renderSelectionCheckBox } = context.getComputed();
|
|
@@ -20980,6 +23041,9 @@ async function onKeyDown(context, event) {
|
|
|
20980
23041
|
...context,
|
|
20981
23042
|
cloneRowSelection: (rowSelection) => {
|
|
20982
23043
|
return cloneRowSelection(rowSelection, context.getDataSourceState);
|
|
23044
|
+
},
|
|
23045
|
+
cloneTreeSelection: (treeSelection) => {
|
|
23046
|
+
return cloneTreeSelection(treeSelection, context.getDataSourceState);
|
|
20983
23047
|
}
|
|
20984
23048
|
};
|
|
20985
23049
|
if (handleKeyboardSelection(keyboardHandlerContext, event)) {
|
|
@@ -21058,6 +23122,9 @@ function useEventHandlersContext() {
|
|
|
21058
23122
|
actions,
|
|
21059
23123
|
getDataSourceState,
|
|
21060
23124
|
dataSourceActions,
|
|
23125
|
+
cloneTreeSelection: (treeSelection) => {
|
|
23126
|
+
return cloneTreeSelection(treeSelection, getDataSourceState);
|
|
23127
|
+
},
|
|
21061
23128
|
cloneRowSelection: (rowSelection) => {
|
|
21062
23129
|
return cloneRowSelection(rowSelection, getDataSourceState);
|
|
21063
23130
|
}
|
|
@@ -21527,7 +23594,7 @@ function OverlayContent(props) {
|
|
|
21527
23594
|
(0, import_react54.useEffect)(() => {
|
|
21528
23595
|
return props.realign.onChange((handle) => {
|
|
21529
23596
|
if (nodeRef.current && handle) {
|
|
21530
|
-
|
|
23597
|
+
alignNode(nodeRef.current, handle);
|
|
21531
23598
|
}
|
|
21532
23599
|
});
|
|
21533
23600
|
}, [props.realign]);
|
|
@@ -21537,7 +23604,7 @@ function OverlayContent(props) {
|
|
|
21537
23604
|
style: { position: "absolute", top: 0, left: 0 },
|
|
21538
23605
|
ref: (0, import_react54.useCallback)((node) => {
|
|
21539
23606
|
if (node) {
|
|
21540
|
-
|
|
23607
|
+
alignNode(node, props);
|
|
21541
23608
|
}
|
|
21542
23609
|
nodeRef.current = node;
|
|
21543
23610
|
}, [])
|
|
@@ -21545,7 +23612,7 @@ function OverlayContent(props) {
|
|
|
21545
23612
|
typeof props.children === "function" ? props.children() : props.children
|
|
21546
23613
|
);
|
|
21547
23614
|
}
|
|
21548
|
-
async function
|
|
23615
|
+
async function alignNode(node, params) {
|
|
21549
23616
|
let { constrainTo, alignTo, alignPosition } = params;
|
|
21550
23617
|
if (Object.keys(alignTo).length === 2 && alignTo.top !== void 0 && alignTo.left !== void 0) {
|
|
21551
23618
|
alignTo = {
|
|
@@ -21653,20 +23720,35 @@ function useOverlay(params) {
|
|
|
21653
23720
|
const id = params2.id || getIdForReactOnlyChild(content) || getChangeDetect();
|
|
21654
23721
|
const key = `${id}`;
|
|
21655
23722
|
let handle = handles.get(key);
|
|
21656
|
-
const
|
|
21657
|
-
|
|
21658
|
-
|
|
21659
|
-
|
|
21660
|
-
|
|
21661
|
-
|
|
21662
|
-
|
|
23723
|
+
const getChildrenFnForContent = (content2) => {
|
|
23724
|
+
return () => {
|
|
23725
|
+
const children = typeof content2 === "function" ? content2() : content2;
|
|
23726
|
+
return injectPortalContainerAndConstrainInMenuChild(
|
|
23727
|
+
children,
|
|
23728
|
+
rootParams.portalContainer,
|
|
23729
|
+
params2.constrainTo ?? rootParams.constrainTo
|
|
23730
|
+
);
|
|
23731
|
+
};
|
|
21663
23732
|
};
|
|
21664
|
-
|
|
21665
|
-
|
|
23733
|
+
const childrenFn = getChildrenFnForContent(content);
|
|
23734
|
+
const updateOverlay = (overlayContent, options) => {
|
|
23735
|
+
if (!handle) {
|
|
23736
|
+
return;
|
|
23737
|
+
}
|
|
23738
|
+
const childrenFn2 = getChildrenFnForContent(overlayContent);
|
|
23739
|
+
Object.assign(handle, { children: childrenFn2 });
|
|
21666
23740
|
updateContent();
|
|
21667
|
-
|
|
21668
|
-
|
|
21669
|
-
|
|
23741
|
+
const skipRealign = !!options?.skipRealign;
|
|
23742
|
+
const shouldRealign = !skipRealign;
|
|
23743
|
+
if (shouldRealign) {
|
|
23744
|
+
setHandleToRealign(handle.key);
|
|
23745
|
+
setRealignTimestamp(Date.now());
|
|
23746
|
+
}
|
|
23747
|
+
};
|
|
23748
|
+
if (handle) {
|
|
23749
|
+
Object.assign(handle, params2);
|
|
23750
|
+
updateOverlay(content);
|
|
23751
|
+
return updateOverlay;
|
|
21670
23752
|
}
|
|
21671
23753
|
handle = {
|
|
21672
23754
|
key,
|
|
@@ -21678,7 +23760,7 @@ function useOverlay(params) {
|
|
|
21678
23760
|
};
|
|
21679
23761
|
handles.set(handle.key, handle);
|
|
21680
23762
|
updateContent();
|
|
21681
|
-
return
|
|
23763
|
+
return updateOverlay;
|
|
21682
23764
|
},
|
|
21683
23765
|
[handles, rootParams.portalContainer, updateContent]
|
|
21684
23766
|
);
|
|
@@ -21733,8 +23815,8 @@ MenuItem.defaultProps = {
|
|
|
21733
23815
|
};
|
|
21734
23816
|
|
|
21735
23817
|
// src/components/Menu/MenuCls.css.ts
|
|
21736
|
-
var MenuCls = "MenuCls_MenuCls__db3arf0 utilities_boxSizingBorderBox__16lm1iw0 utilities_position_relative__16lm1iw1 utilities_display_inlineGrid__16lm1iw16
|
|
21737
|
-
var MenuItemCls = createRuntimeFn({ defaultClassName: "MenuCls_MenuItemCls__db3arf2 utilities_display_flex__16lm1iwz
|
|
23818
|
+
var MenuCls = "MenuCls_MenuCls__db3arf0 utilities_boxSizingBorderBox__16lm1iw0 utilities_position_relative__16lm1iw1 utilities_display_inlineGrid__16lm1iw16 utilities_flexFlow_column__16lm1iw1n utilities_margin_none__16lm1iw8";
|
|
23819
|
+
var MenuItemCls = createRuntimeFn({ defaultClassName: "MenuCls_MenuItemCls__db3arf2 utilities_display_flex__16lm1iwz utilities_alignItems_center__16lm1iw1r utilities_userSelect_none__16lm1iw17", variantClassNames: { disabled: { true: "MenuCls_MenuItemCls_disabled_true__db3arf3 utilities_cursor_default__16lm1iwj utilities_userSelect_none__16lm1iw17", false: "utilities_cursor_pointer__16lm1iwi" }, active: { true: "MenuCls_MenuItemCls_active_true__db3arf5", false: "MenuCls_MenuItemCls_active_false__db3arf6" }, pressed: { false: "MenuCls_MenuItemCls_pressed_false__db3arf7", true: "MenuCls_MenuItemCls_pressed_true__db3arf8" }, keyboardActive: { true: "MenuCls_MenuItemCls_keyboardActive_true__db3arf9", false: "MenuCls_MenuItemCls_keyboardActive_false__db3arfa" } }, defaultVariants: {}, compoundVariants: [[{ active: true, disabled: false }, "MenuCls_MenuItemCls_compound_0__db3arfb"], [{ pressed: true, active: true, disabled: false }, "MenuCls_MenuItemCls_compound_1__db3arfc"]] });
|
|
21738
23820
|
var MenuRowCls = "MenuCls_MenuRowCls__db3arf1";
|
|
21739
23821
|
var MenuSeparatorCls = "MenuCls_MenuSeparatorCls__db3arfd";
|
|
21740
23822
|
|
|
@@ -23745,6 +25827,95 @@ function useToggleWrapRowsHorizontally() {
|
|
|
23745
25827
|
}, [oldWrapRowsHorizontally, wrapRowsHorizontally]);
|
|
23746
25828
|
}
|
|
23747
25829
|
|
|
25830
|
+
// src/components/InfiniteTable/hooks/useHorizontalLayout.ts
|
|
25831
|
+
var import_react66 = require("react");
|
|
25832
|
+
function useHorizontalLayout() {
|
|
25833
|
+
const { getState, actions, dataSourceActions, getDataSourceState } = useInfiniteTable();
|
|
25834
|
+
const { groupBy, isTree } = getDataSourceState();
|
|
25835
|
+
const { brain, wrapRowsHorizontally, repeatWrappedGroupRows } = getState();
|
|
25836
|
+
(0, import_react66.useEffect)(() => {
|
|
25837
|
+
if (!wrapRowsHorizontally) {
|
|
25838
|
+
return;
|
|
25839
|
+
}
|
|
25840
|
+
const onVerticalRenderRangeChange = () => {
|
|
25841
|
+
const {
|
|
25842
|
+
rowsPerPage: currentRowsPerPage,
|
|
25843
|
+
repeatWrappedGroupRows: currentRepeatWrappedGroupRows
|
|
25844
|
+
} = getDataSourceState();
|
|
25845
|
+
let changes = false;
|
|
25846
|
+
const rowsPerPage = brain.rowsPerPage;
|
|
25847
|
+
const newRowsPerPage = (groupBy && groupBy.length > 0 || isTree) && rowsPerPage > 0 ? rowsPerPage : null;
|
|
25848
|
+
if (currentRowsPerPage != newRowsPerPage) {
|
|
25849
|
+
dataSourceActions.rowsPerPage = newRowsPerPage;
|
|
25850
|
+
changes = true;
|
|
25851
|
+
}
|
|
25852
|
+
if (currentRepeatWrappedGroupRows != repeatWrappedGroupRows) {
|
|
25853
|
+
dataSourceActions.repeatWrappedGroupRows = repeatWrappedGroupRows ?? false;
|
|
25854
|
+
changes = true;
|
|
25855
|
+
}
|
|
25856
|
+
return changes;
|
|
25857
|
+
};
|
|
25858
|
+
onVerticalRenderRangeChange();
|
|
25859
|
+
let timeoutId;
|
|
25860
|
+
const off = brain.onVerticalRenderRangeChange(() => {
|
|
25861
|
+
if (onVerticalRenderRangeChange()) {
|
|
25862
|
+
timeoutId = setTimeout(() => {
|
|
25863
|
+
actions.forceBodyRerenderTimestamp = Date.now();
|
|
25864
|
+
});
|
|
25865
|
+
}
|
|
25866
|
+
});
|
|
25867
|
+
return () => {
|
|
25868
|
+
if (timeoutId) {
|
|
25869
|
+
clearTimeout(timeoutId);
|
|
25870
|
+
}
|
|
25871
|
+
off();
|
|
25872
|
+
};
|
|
25873
|
+
}, [brain, wrapRowsHorizontally, groupBy, isTree, repeatWrappedGroupRows]);
|
|
25874
|
+
}
|
|
25875
|
+
|
|
25876
|
+
// src/components/InfiniteTable/hooks/useDebugMode.ts
|
|
25877
|
+
var React68 = __toESM(require("react"));
|
|
25878
|
+
var logWarning = once(() => {
|
|
25879
|
+
console.warn(
|
|
25880
|
+
`It appears you have not loaded the CSS file for InfiniteTable.
|
|
25881
|
+
In most environments, you should be able to fix this by adding the following line:
|
|
25882
|
+
|
|
25883
|
+
import '@infinite-table/infinite-react/index.css'
|
|
25884
|
+
|
|
25885
|
+
`
|
|
25886
|
+
);
|
|
25887
|
+
});
|
|
25888
|
+
var cssFileLoadedVarName = stripVar(ThemeVars.loaded);
|
|
25889
|
+
function useDebugMode() {
|
|
25890
|
+
const { getState } = useInfiniteTable();
|
|
25891
|
+
React68.useEffect(() => {
|
|
25892
|
+
runDebugMode(getState);
|
|
25893
|
+
}, []);
|
|
25894
|
+
}
|
|
25895
|
+
function runDebugMode(getState) {
|
|
25896
|
+
const state = getState();
|
|
25897
|
+
const { debugMode, domRef } = state;
|
|
25898
|
+
if (debugMode) {
|
|
25899
|
+
if (domRef.current) {
|
|
25900
|
+
const value = getComputedStyle(domRef.current).getPropertyValue(
|
|
25901
|
+
cssFileLoadedVarName
|
|
25902
|
+
);
|
|
25903
|
+
if (value !== `${CSS_LOADED_VALUE}`) {
|
|
25904
|
+
logWarning();
|
|
25905
|
+
}
|
|
25906
|
+
}
|
|
25907
|
+
}
|
|
25908
|
+
}
|
|
25909
|
+
|
|
25910
|
+
// src/components/InfiniteTable/hooks/useInfinitePortalContainer.ts
|
|
25911
|
+
function useInfinitePortalContainer() {
|
|
25912
|
+
const masterContext = useMasterDetailContext();
|
|
25913
|
+
const masterState = masterContext ? masterContext.getMasterState() : null;
|
|
25914
|
+
const infiniteState = useInfiniteTable().getState();
|
|
25915
|
+
const portalContainer = (masterState || infiniteState).portalDOMRef.current;
|
|
25916
|
+
return portalContainer;
|
|
25917
|
+
}
|
|
25918
|
+
|
|
23748
25919
|
// src/components/InfiniteTable/index.tsx
|
|
23749
25920
|
var InfiniteTableClassName = internalProps.rootClassName;
|
|
23750
25921
|
var HOVERED_CLASS_NAMES = [RowHoverCls, "InfiniteColumnCell--hovered"];
|
|
@@ -23773,7 +25944,7 @@ function InfiniteTableHeader2() {
|
|
|
23773
25944
|
const { state: componentState, getComputed } = context;
|
|
23774
25945
|
const { header, brain, headerBrain, wrapRowsHorizontally } = componentState;
|
|
23775
25946
|
const { scrollbars } = getComputed();
|
|
23776
|
-
return header ? /* @__PURE__ */
|
|
25947
|
+
return header ? /* @__PURE__ */ React69.createElement(
|
|
23777
25948
|
TableHeaderWrapper,
|
|
23778
25949
|
{
|
|
23779
25950
|
wrapRowsHorizontally: !!wrapRowsHorizontally,
|
|
@@ -23790,7 +25961,7 @@ var InfiniteTableBodyCls = join(
|
|
|
23790
25961
|
transformTranslateZero
|
|
23791
25962
|
);
|
|
23792
25963
|
function InfiniteTableBodyContainer(props) {
|
|
23793
|
-
return /* @__PURE__ */
|
|
25964
|
+
return /* @__PURE__ */ React69.createElement(
|
|
23794
25965
|
"div",
|
|
23795
25966
|
{
|
|
23796
25967
|
...props,
|
|
@@ -23827,7 +25998,7 @@ function InfiniteTableBody() {
|
|
|
23827
25998
|
const {
|
|
23828
25999
|
componentState: { loading }
|
|
23829
26000
|
} = useDataSourceContextValue();
|
|
23830
|
-
const onContextMenu =
|
|
26001
|
+
const onContextMenu = React69.useCallback((event) => {
|
|
23831
26002
|
const state = context.getState();
|
|
23832
26003
|
const target = event.target;
|
|
23833
26004
|
if (!masterContext && event._from_row_detail) {
|
|
@@ -23873,9 +26044,10 @@ function InfiniteTableBody() {
|
|
|
23873
26044
|
});
|
|
23874
26045
|
const { autoFocus, tabIndex } = domProps ?? {};
|
|
23875
26046
|
useToggleWrapRowsHorizontally();
|
|
23876
|
-
return /* @__PURE__ */
|
|
26047
|
+
return /* @__PURE__ */ React69.createElement(InfiniteTableBodyContainer, { onContextMenu }, /* @__PURE__ */ React69.createElement(
|
|
23877
26048
|
HeadlessTable,
|
|
23878
26049
|
{
|
|
26050
|
+
forceRerenderTimestamp: componentState.forceBodyRerenderTimestamp,
|
|
23879
26051
|
debugId,
|
|
23880
26052
|
tabIndex: tabIndex ?? 0,
|
|
23881
26053
|
autoFocus: autoFocus ?? void 0,
|
|
@@ -23893,9 +26065,9 @@ function InfiniteTableBody() {
|
|
|
23893
26065
|
cellHoverClassNames: showHoverRows ? HOVERED_CLASS_NAMES : void 0,
|
|
23894
26066
|
scrollerDOMRef
|
|
23895
26067
|
}
|
|
23896
|
-
), /* @__PURE__ */
|
|
26068
|
+
), /* @__PURE__ */ React69.createElement(LoadMaskCmp, { visible: loading }, loadingText));
|
|
23897
26069
|
}
|
|
23898
|
-
var InfiniteTableComponent =
|
|
26070
|
+
var InfiniteTableComponent = React69.memo(
|
|
23899
26071
|
function InfiniteTableComponent2() {
|
|
23900
26072
|
const context = useInfiniteTable();
|
|
23901
26073
|
const masterContext = useMasterDetailContext();
|
|
@@ -23927,7 +26099,7 @@ var InfiniteTableComponent = React68.memo(
|
|
|
23927
26099
|
useScrollToActiveRow(activeRowIndex, dataArray.length, api);
|
|
23928
26100
|
useScrollToActiveCell(activeCellIndex, dataArray.length, api);
|
|
23929
26101
|
const { onKeyDown: onKeyDown2 } = useDOMEventHandlers();
|
|
23930
|
-
|
|
26102
|
+
React69.useEffect(() => {
|
|
23931
26103
|
const dataSourceState = getDataSourceState();
|
|
23932
26104
|
const onChange = debounce(
|
|
23933
26105
|
(renderRange) => {
|
|
@@ -23950,17 +26122,18 @@ var InfiniteTableComponent = React68.memo(
|
|
|
23950
26122
|
...initialDOMProps
|
|
23951
26123
|
} = componentState.domProps ?? {};
|
|
23952
26124
|
const domProps = useDOMProps(initialDOMProps);
|
|
23953
|
-
|
|
26125
|
+
React69.useEffect(() => {
|
|
23954
26126
|
brain.setScrollStopDelay(scrollStopDelay);
|
|
23955
26127
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
23956
26128
|
}, [scrollStopDelay]);
|
|
23957
26129
|
useAutoSizeColumns();
|
|
26130
|
+
useHorizontalLayout();
|
|
23958
26131
|
useEditingCallbackProps();
|
|
23959
26132
|
const { menuPortal } = useColumnMenu();
|
|
23960
26133
|
const { menuPortal: cellContextMenuPortal } = useCellContextMenu();
|
|
23961
26134
|
const { menuPortal: tableContextMenuPortal } = useTableContextMenu();
|
|
23962
26135
|
const { menuPortal: filterOperatorMenuPortal } = useColumnFilterOperatorMenu();
|
|
23963
|
-
|
|
26136
|
+
React69.useEffect(() => {
|
|
23964
26137
|
if (typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY === "function") {
|
|
23965
26138
|
globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(
|
|
23966
26139
|
componentState.id,
|
|
@@ -23973,13 +26146,14 @@ var InfiniteTableComponent = React68.memo(
|
|
|
23973
26146
|
globalThis.infiniteApi = context.api;
|
|
23974
26147
|
}
|
|
23975
26148
|
}, [componentState.ready]);
|
|
23976
|
-
|
|
26149
|
+
useDebugMode();
|
|
26150
|
+
React69.useEffect(() => {
|
|
23977
26151
|
if (masterContext) {
|
|
23978
26152
|
portalDOMRef.current = masterContext.getMasterState().portalDOMRef.current;
|
|
23979
26153
|
}
|
|
23980
26154
|
}, []);
|
|
23981
|
-
const children = initialChildren ?? /* @__PURE__ */
|
|
23982
|
-
return /* @__PURE__ */
|
|
26155
|
+
const children = initialChildren ?? /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(InfiniteTableHeader2, null), /* @__PURE__ */ React69.createElement(InfiniteTableBody, null));
|
|
26156
|
+
return /* @__PURE__ */ React69.createElement("div", { onKeyDown: onKeyDown2, ref: domRef, ...domProps }, children, /* @__PURE__ */ React69.createElement(
|
|
23983
26157
|
"div",
|
|
23984
26158
|
{
|
|
23985
26159
|
ref: portalDOMRef,
|
|
@@ -23995,14 +26169,14 @@ var InfiniteTableComponent = React68.memo(
|
|
|
23995
26169
|
cellContextMenuPortal,
|
|
23996
26170
|
tableContextMenuPortal,
|
|
23997
26171
|
filterOperatorMenuPortal
|
|
23998
|
-
), rowHeightCSSVar ? /* @__PURE__ */
|
|
26172
|
+
), rowHeightCSSVar ? /* @__PURE__ */ React69.createElement(
|
|
23999
26173
|
CSSNumericVariableWatch,
|
|
24000
26174
|
{
|
|
24001
26175
|
key: "row-height",
|
|
24002
26176
|
varName: rowHeightCSSVar,
|
|
24003
26177
|
onChange: onRowHeightCSSVarChange
|
|
24004
26178
|
}
|
|
24005
|
-
) : null, /* @__PURE__ */
|
|
26179
|
+
) : null, /* @__PURE__ */ React69.createElement(
|
|
24006
26180
|
CSSNumericVariableWatch,
|
|
24007
26181
|
{
|
|
24008
26182
|
key: "flashing-duration",
|
|
@@ -24010,21 +26184,21 @@ var InfiniteTableComponent = React68.memo(
|
|
|
24010
26184
|
varName: ThemeVars.components.Cell.flashingDuration,
|
|
24011
26185
|
onChange: onFlashingDurationCSSVarChange
|
|
24012
26186
|
}
|
|
24013
|
-
), rowDetailHeightCSSVar ? /* @__PURE__ */
|
|
26187
|
+
), rowDetailHeightCSSVar ? /* @__PURE__ */ React69.createElement(
|
|
24014
26188
|
CSSNumericVariableWatch,
|
|
24015
26189
|
{
|
|
24016
26190
|
key: "row-detail-height",
|
|
24017
26191
|
varName: rowDetailHeightCSSVar,
|
|
24018
26192
|
onChange: onRowDetailHeightCSSVarChange
|
|
24019
26193
|
}
|
|
24020
|
-
) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */
|
|
26194
|
+
) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */ React69.createElement(
|
|
24021
26195
|
CSSNumericVariableWatch,
|
|
24022
26196
|
{
|
|
24023
26197
|
key: "column-header-height",
|
|
24024
26198
|
varName: columnHeaderHeightCSSVar,
|
|
24025
26199
|
onChange: onColumnHeaderHeightCSSVarChange
|
|
24026
26200
|
}
|
|
24027
|
-
) : null, licenseValid ? null : /* @__PURE__ */
|
|
26201
|
+
) : null, licenseValid ? null : /* @__PURE__ */ React69.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React69.createElement(FocusDetect, null));
|
|
24028
26202
|
}
|
|
24029
26203
|
);
|
|
24030
26204
|
function InfiniteTableContextProvider({
|
|
@@ -24048,7 +26222,7 @@ function InfiniteTableContextProvider({
|
|
|
24048
26222
|
getDataSourceMasterContext,
|
|
24049
26223
|
api: dataSourceApi
|
|
24050
26224
|
} = useDataSourceContextValue();
|
|
24051
|
-
const [imperativeApi] =
|
|
26225
|
+
const [imperativeApi] = React69.useState(() => {
|
|
24052
26226
|
return getImperativeApi({
|
|
24053
26227
|
getComputed,
|
|
24054
26228
|
getState,
|
|
@@ -24084,38 +26258,52 @@ function InfiniteTableContextProvider({
|
|
|
24084
26258
|
},
|
|
24085
26259
|
{ earlyAttach: true, debounce: 50 }
|
|
24086
26260
|
);
|
|
24087
|
-
|
|
26261
|
+
React69.useEffect(() => {
|
|
24088
26262
|
if (scrollerDOMRef.current) {
|
|
24089
26263
|
scrollerDOMRef.current.scrollTop = 0;
|
|
24090
26264
|
}
|
|
24091
26265
|
}, [scrollTopKey, scrollerDOMRef]);
|
|
24092
26266
|
const TableContext2 = getInfiniteTableContext();
|
|
24093
|
-
return /* @__PURE__ */
|
|
26267
|
+
return /* @__PURE__ */ React69.createElement(TableContext2.Provider, { value: contextValue }, /* @__PURE__ */ React69.createElement(InfiniteTableComponent, null));
|
|
24094
26268
|
}
|
|
24095
26269
|
var DEFAULT_ROW_HEIGHT = 40;
|
|
24096
26270
|
var DEFAULT_COLUMN_HEADER_HEIGHT = toCSSVarName(columnHeaderHeightName);
|
|
24097
26271
|
var InfiniteTable = function(props) {
|
|
24098
26272
|
const table = (
|
|
24099
26273
|
//@ts-ignore
|
|
24100
|
-
/* @__PURE__ */
|
|
26274
|
+
/* @__PURE__ */ React69.createElement(
|
|
24101
26275
|
InfiniteTableRoot,
|
|
24102
26276
|
{
|
|
26277
|
+
repeatWrappedGroupRows: !!props.wrapRowsHorizontally,
|
|
24103
26278
|
rowHeight: DEFAULT_ROW_HEIGHT,
|
|
24104
26279
|
columnHeaderHeight: DEFAULT_COLUMN_HEADER_HEIGHT,
|
|
24105
26280
|
...props
|
|
24106
26281
|
},
|
|
24107
|
-
/* @__PURE__ */
|
|
26282
|
+
/* @__PURE__ */ React69.createElement(InfiniteTableContextProvider, { children: props.children })
|
|
24108
26283
|
)
|
|
24109
26284
|
);
|
|
24110
26285
|
if (false) {
|
|
24111
|
-
return /* @__PURE__ */
|
|
26286
|
+
return /* @__PURE__ */ React69.createElement(React69.StrictMode, null, table);
|
|
24112
26287
|
}
|
|
24113
26288
|
return table;
|
|
24114
26289
|
};
|
|
24115
26290
|
InfiniteTable.Header = InfiniteTableHeader2;
|
|
24116
26291
|
InfiniteTable.Body = InfiniteTableBody;
|
|
24117
26292
|
InfiniteTable.HScrollSyncContent = HScrollSyncContent;
|
|
24118
|
-
InfiniteTable.Footer = () => /* @__PURE__ */
|
|
26293
|
+
InfiniteTable.Footer = () => /* @__PURE__ */ React69.createElement(InfiniteTableFooter, null);
|
|
26294
|
+
|
|
26295
|
+
// src/components/TreeGrid/TreeDataSource.tsx
|
|
26296
|
+
var React70 = __toESM(require("react"));
|
|
26297
|
+
function TreeDataSource(props) {
|
|
26298
|
+
const { DataSource: DataSourceComponent } = useDataSourceInternal(props);
|
|
26299
|
+
return /* @__PURE__ */ React70.createElement(DataSourceComponent, { nodesKey: props.nodesKey || "children" }, props.children ?? null);
|
|
26300
|
+
}
|
|
26301
|
+
|
|
26302
|
+
// src/components/TreeGrid/TreeGrid.tsx
|
|
26303
|
+
var React71 = __toESM(require("react"));
|
|
26304
|
+
function TreeGrid(props) {
|
|
26305
|
+
return /* @__PURE__ */ React71.createElement(InfiniteTable, { ...props });
|
|
26306
|
+
}
|
|
24119
26307
|
|
|
24120
26308
|
// src/components/DataSource/DataLoader/DataQuery.ts
|
|
24121
26309
|
var logger2 = debug("InfiniteTable:DataQuery");
|
|
@@ -24356,7 +26544,7 @@ var keyboardShortcuts = {
|
|
|
24356
26544
|
};
|
|
24357
26545
|
|
|
24358
26546
|
// src/components/hooks/useInterceptedMap.ts
|
|
24359
|
-
var
|
|
26547
|
+
var import_react67 = require("react");
|
|
24360
26548
|
function interceptMap(map2, fns) {
|
|
24361
26549
|
const { set, delete: deleteKey, clear } = map2;
|
|
24362
26550
|
if (fns.set) {
|
|
@@ -24518,21 +26706,21 @@ var WeakFixedSizeSet = _WeakFixedSizeSet;
|
|
|
24518
26706
|
WeakFixedSizeSet.DEFAULT_SIZE = 10;
|
|
24519
26707
|
|
|
24520
26708
|
// src/components/hooks/useEffectWhenSameDeps.ts
|
|
24521
|
-
var
|
|
26709
|
+
var import_react68 = require("react");
|
|
24522
26710
|
var isSameDeps = (deps, prevDeps) => {
|
|
24523
26711
|
return deps.every((dep, index) => dep === prevDeps[index]);
|
|
24524
26712
|
};
|
|
24525
26713
|
var useEffectWhenSameDeps = (callback, deps) => {
|
|
24526
|
-
const depsRef = (0,
|
|
26714
|
+
const depsRef = (0, import_react68.useRef)(deps);
|
|
24527
26715
|
const sameDeps = isSameDeps(deps, depsRef.current);
|
|
24528
|
-
const isInitialRef = (0,
|
|
26716
|
+
const isInitialRef = (0, import_react68.useRef)(true);
|
|
24529
26717
|
depsRef.current = deps;
|
|
24530
|
-
const effectDepsRef = (0,
|
|
26718
|
+
const effectDepsRef = (0, import_react68.useRef)(["same"]);
|
|
24531
26719
|
const effectDeps = sameDeps ? [Date.now()] : effectDepsRef.current;
|
|
24532
26720
|
effectDepsRef.current = effectDeps;
|
|
24533
|
-
const callbackRef = (0,
|
|
26721
|
+
const callbackRef = (0, import_react68.useRef)(callback);
|
|
24534
26722
|
callbackRef.current = callback;
|
|
24535
|
-
(0,
|
|
26723
|
+
(0, import_react68.useEffect)(() => {
|
|
24536
26724
|
if (isInitialRef.current) {
|
|
24537
26725
|
isInitialRef.current = false;
|
|
24538
26726
|
return;
|
|
@@ -24542,7 +26730,7 @@ var useEffectWhenSameDeps = (callback, deps) => {
|
|
|
24542
26730
|
};
|
|
24543
26731
|
|
|
24544
26732
|
// src/components/hooks/useEffectWhen.ts
|
|
24545
|
-
var
|
|
26733
|
+
var import_react69 = require("react");
|
|
24546
26734
|
var isSameDeps2 = (deps, prevDeps, compare) => {
|
|
24547
26735
|
return deps.every((dep, index) => {
|
|
24548
26736
|
if (compare) {
|
|
@@ -24553,26 +26741,26 @@ var isSameDeps2 = (deps, prevDeps, compare) => {
|
|
|
24553
26741
|
};
|
|
24554
26742
|
var useEffectWhen = (callback, options) => {
|
|
24555
26743
|
const { same: depsForSame, different: depsForDifferent, compare } = options;
|
|
24556
|
-
const sameDepsRef = (0,
|
|
24557
|
-
const differentDepsRef = (0,
|
|
26744
|
+
const sameDepsRef = (0, import_react69.useRef)(depsForSame);
|
|
26745
|
+
const differentDepsRef = (0, import_react69.useRef)(depsForDifferent);
|
|
24558
26746
|
const sameRespected = isSameDeps2(depsForSame, sameDepsRef.current, compare);
|
|
24559
26747
|
const differentRespected = !isSameDeps2(
|
|
24560
26748
|
depsForDifferent,
|
|
24561
26749
|
differentDepsRef.current,
|
|
24562
26750
|
compare
|
|
24563
26751
|
);
|
|
24564
|
-
const isInitialRef = (0,
|
|
26752
|
+
const isInitialRef = (0, import_react69.useRef)(true);
|
|
24565
26753
|
sameDepsRef.current = depsForSame;
|
|
24566
26754
|
differentDepsRef.current = depsForDifferent;
|
|
24567
|
-
const effectDepsRef = (0,
|
|
26755
|
+
const effectDepsRef = (0, import_react69.useRef)(["same"]);
|
|
24568
26756
|
const effectDeps = sameRespected && differentRespected ? [Date.now()] : effectDepsRef.current;
|
|
24569
26757
|
effectDepsRef.current = effectDeps;
|
|
24570
|
-
const callbackRef = (0,
|
|
26758
|
+
const callbackRef = (0, import_react69.useRef)(callback);
|
|
24571
26759
|
callbackRef.current = callback;
|
|
24572
26760
|
if (sameRespected && differentRespected) {
|
|
24573
26761
|
isInitialRef.current = false;
|
|
24574
26762
|
}
|
|
24575
|
-
(0,
|
|
26763
|
+
(0, import_react69.useEffect)(() => {
|
|
24576
26764
|
if (isInitialRef.current) {
|
|
24577
26765
|
return;
|
|
24578
26766
|
}
|
|
@@ -24581,14 +26769,25 @@ var useEffectWhen = (callback, options) => {
|
|
|
24581
26769
|
};
|
|
24582
26770
|
|
|
24583
26771
|
// src/components/InfiniteTable/components/InfiniteTableRow/FlashingColumnCell.tsx
|
|
24584
|
-
var
|
|
26772
|
+
var React72 = __toESM(require("react"));
|
|
24585
26773
|
var currentFlashingDurationVar = stripVar(
|
|
24586
26774
|
InternalVars.currentFlashingDuration
|
|
24587
26775
|
);
|
|
24588
26776
|
var defaultRender = ({ children }) => {
|
|
24589
|
-
return /* @__PURE__ */
|
|
26777
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, children);
|
|
24590
26778
|
};
|
|
24591
26779
|
var DEFAULT_FLASH_DURATION = 1e3;
|
|
26780
|
+
var INTERNAL_FLASH_CLS_FOR_DIRECTION = {
|
|
26781
|
+
up: FlashingColumnCellRecipe({
|
|
26782
|
+
direction: "up"
|
|
26783
|
+
}).split(" "),
|
|
26784
|
+
down: FlashingColumnCellRecipe({
|
|
26785
|
+
direction: "down"
|
|
26786
|
+
}).split(" "),
|
|
26787
|
+
neutral: FlashingColumnCellRecipe({
|
|
26788
|
+
direction: "neutral"
|
|
26789
|
+
}).split(" ")
|
|
26790
|
+
};
|
|
24592
26791
|
var createFlashingColumnCellComponent = (options = {}) => {
|
|
24593
26792
|
const {
|
|
24594
26793
|
flashDuration: FLASH_DURATION,
|
|
@@ -24597,7 +26796,7 @@ var createFlashingColumnCellComponent = (options = {}) => {
|
|
|
24597
26796
|
// fadeClassName,
|
|
24598
26797
|
render = defaultRender
|
|
24599
26798
|
} = options;
|
|
24600
|
-
const FlashingColumnCell2 =
|
|
26799
|
+
const FlashingColumnCell2 = React72.forwardRef(
|
|
24601
26800
|
(props, _ref) => {
|
|
24602
26801
|
const cellContext = useInfiniteColumnCell();
|
|
24603
26802
|
const {
|
|
@@ -24607,60 +26806,60 @@ var createFlashingColumnCellComponent = (options = {}) => {
|
|
|
24607
26806
|
const { domRef, value, column, rowInfo, htmlElementRef } = cellContext;
|
|
24608
26807
|
const rowId = rowInfo.id;
|
|
24609
26808
|
const columnId = column.id;
|
|
24610
|
-
const initialRef =
|
|
24611
|
-
const oldValueRef =
|
|
26809
|
+
const initialRef = React72.useRef(true);
|
|
26810
|
+
const oldValueRef = React72.useRef(value);
|
|
24612
26811
|
const oldValue = initialRef.current ? null : oldValueRef.current;
|
|
24613
26812
|
initialRef.current = false;
|
|
24614
|
-
const flashTimeoutIdRef =
|
|
24615
|
-
const
|
|
26813
|
+
const flashTimeoutIdRef = React72.useRef();
|
|
26814
|
+
const flashDirectionRef = React72.useRef();
|
|
26815
|
+
const fadeTimeoutIdRef = React72.useRef();
|
|
24616
26816
|
useEffectWhen(
|
|
24617
26817
|
() => {
|
|
24618
26818
|
if (value === oldValueRef.current) {
|
|
24619
26819
|
return;
|
|
24620
26820
|
}
|
|
24621
|
-
|
|
24622
|
-
|
|
24623
|
-
}
|
|
24624
|
-
if (fadeTimeoutIdRef.current) {
|
|
24625
|
-
clearTimeout(fadeTimeoutIdRef.current);
|
|
24626
|
-
}
|
|
24627
|
-
const el = htmlElementRef.current;
|
|
24628
|
-
oldValueRef.current = value;
|
|
24629
|
-
if (!el) {
|
|
24630
|
-
return;
|
|
24631
|
-
}
|
|
24632
|
-
const flashDirection = typeof value === "number" ? value > oldValue ? "up" : "down" : "neutral";
|
|
24633
|
-
const internalflashCls = FlashingColumnCellRecipe({
|
|
24634
|
-
direction: flashDirection
|
|
24635
|
-
}).split(" ");
|
|
24636
|
-
el.style.setProperty(currentFlashingDurationVar, `${duration}`);
|
|
24637
|
-
if (flashClassName) {
|
|
24638
|
-
el.classList.add(flashClassName);
|
|
24639
|
-
}
|
|
24640
|
-
el.classList.add(...internalflashCls);
|
|
24641
|
-
flashTimeoutIdRef.current = setTimeout(() => {
|
|
24642
|
-
flashTimeoutIdRef.current = void 0;
|
|
24643
|
-
if (flashClassName) {
|
|
24644
|
-
el.classList.remove(flashClassName);
|
|
24645
|
-
}
|
|
24646
|
-
el.classList.remove(...internalflashCls);
|
|
24647
|
-
el.style.removeProperty(currentFlashingDurationVar);
|
|
24648
|
-
}, duration);
|
|
24649
|
-
return () => {
|
|
26821
|
+
const clear = () => {
|
|
26822
|
+
const el2 = htmlElementRef.current;
|
|
24650
26823
|
if (flashTimeoutIdRef.current) {
|
|
24651
26824
|
clearTimeout(flashTimeoutIdRef.current);
|
|
26825
|
+
flashTimeoutIdRef.current = void 0;
|
|
24652
26826
|
}
|
|
24653
26827
|
if (fadeTimeoutIdRef.current) {
|
|
24654
26828
|
clearTimeout(fadeTimeoutIdRef.current);
|
|
26829
|
+
fadeTimeoutIdRef.current = void 0;
|
|
26830
|
+
}
|
|
26831
|
+
if (flashDirectionRef.current && el2) {
|
|
26832
|
+
const flashDirection2 = flashDirectionRef.current;
|
|
26833
|
+
const internalflashCls2 = INTERNAL_FLASH_CLS_FOR_DIRECTION[flashDirection2];
|
|
26834
|
+
el2.classList.remove(
|
|
26835
|
+
...flashClassName ? [flashClassName, ...internalflashCls2] : internalflashCls2
|
|
26836
|
+
);
|
|
26837
|
+
el2.style.removeProperty(currentFlashingDurationVar);
|
|
26838
|
+
flashDirectionRef.current = void 0;
|
|
24655
26839
|
}
|
|
24656
26840
|
};
|
|
26841
|
+
oldValueRef.current = value;
|
|
26842
|
+
const el = htmlElementRef.current;
|
|
26843
|
+
if (!el) {
|
|
26844
|
+
return;
|
|
26845
|
+
}
|
|
26846
|
+
clear();
|
|
26847
|
+
const flashDirection = typeof value === "number" ? value > oldValue ? "up" : "down" : "neutral";
|
|
26848
|
+
const internalflashCls = INTERNAL_FLASH_CLS_FOR_DIRECTION[flashDirection];
|
|
26849
|
+
el.style.setProperty(currentFlashingDurationVar, `${duration}`);
|
|
26850
|
+
el.classList.add(
|
|
26851
|
+
...flashClassName ? [flashClassName, ...internalflashCls] : internalflashCls
|
|
26852
|
+
);
|
|
26853
|
+
flashDirectionRef.current = flashDirection;
|
|
26854
|
+
flashTimeoutIdRef.current = setTimeout(clear, duration);
|
|
26855
|
+
return clear;
|
|
24657
26856
|
},
|
|
24658
26857
|
{
|
|
24659
26858
|
same: [columnId, rowId],
|
|
24660
26859
|
different: [value]
|
|
24661
26860
|
}
|
|
24662
26861
|
);
|
|
24663
|
-
return /* @__PURE__ */
|
|
26862
|
+
return /* @__PURE__ */ React72.createElement("div", { ref: domRef, ...props, className: join(props.className) }, render({ children: props.children, oldValue }));
|
|
24664
26863
|
}
|
|
24665
26864
|
);
|
|
24666
26865
|
return FlashingColumnCell2;
|
|
@@ -24693,7 +26892,12 @@ var components = {
|
|
|
24693
26892
|
RowDetailState,
|
|
24694
26893
|
RowDisabledState,
|
|
24695
26894
|
RowSelectionState,
|
|
26895
|
+
TreeDataSource,
|
|
26896
|
+
TreeExpandState,
|
|
26897
|
+
TreeGrid,
|
|
26898
|
+
TreeSelectionState,
|
|
24696
26899
|
WeakFixedSizeSet,
|
|
26900
|
+
alignNode,
|
|
24697
26901
|
components,
|
|
24698
26902
|
createFlashingColumnCellComponent,
|
|
24699
26903
|
debounce,
|
|
@@ -24707,7 +26911,9 @@ var components = {
|
|
|
24707
26911
|
interceptMap,
|
|
24708
26912
|
keyboardShortcuts,
|
|
24709
26913
|
multisort,
|
|
26914
|
+
multisortNested,
|
|
24710
26915
|
queryKeyToCacheKey,
|
|
26916
|
+
toTreeDataArray,
|
|
24711
26917
|
useComponentState,
|
|
24712
26918
|
useDataSourceInternal,
|
|
24713
26919
|
useDataSourceState,
|
|
@@ -24720,6 +26926,7 @@ var components = {
|
|
|
24720
26926
|
useInfiniteColumnEditor,
|
|
24721
26927
|
useInfiniteColumnFilterEditor,
|
|
24722
26928
|
useInfiniteHeaderCell,
|
|
26929
|
+
useInfinitePortalContainer,
|
|
24723
26930
|
useManagedDataSource,
|
|
24724
26931
|
useMasterRowInfo,
|
|
24725
26932
|
useOverlay,
|