@infinite-table/infinite-react 10.1.1 → 10.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +18 -1
- package/index.dev.js +128 -118
- package/index.dev.mjs +66 -56
- package/index.js +8 -8
- package/index.mjs +8 -8
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -19112,7 +19112,7 @@ function loadData(data, componentState, actions, overrides, masterContext) {
|
|
|
19112
19112
|
//@ts-ignore
|
|
19113
19113
|
typeof data === "object" && typeof data.then === "function"
|
|
19114
19114
|
);
|
|
19115
|
-
const togglesLoading = dataIsPromise && (!componentState.lazyLoad ||
|
|
19115
|
+
const togglesLoading = dataIsPromise && (!componentState.lazyLoad || !append && !dataParams.groupKeys?.length);
|
|
19116
19116
|
if (togglesLoading) {
|
|
19117
19117
|
actions.loading = true;
|
|
19118
19118
|
}
|
|
@@ -27033,6 +27033,8 @@ var forwardProps4 = (_setupState) => {
|
|
|
27033
27033
|
getColumnMenuItems: 1,
|
|
27034
27034
|
getCellContextMenuItems: 1,
|
|
27035
27035
|
getContextMenuItems: 1,
|
|
27036
|
+
menuPortalContainer: 1,
|
|
27037
|
+
menuConstrainTo: 1,
|
|
27036
27038
|
columnPinning: 1,
|
|
27037
27039
|
editable: 1,
|
|
27038
27040
|
columnDefaultEditable: 1,
|
|
@@ -27432,7 +27434,8 @@ var LoadingIcon = (props) => {
|
|
|
27432
27434
|
function buildColumnForGroupBy(options, toggleGroupRow, groupColumnFromProps, renderers) {
|
|
27433
27435
|
const { groupByForColumn, groupIndexForColumn, groupRenderStrategy } = options;
|
|
27434
27436
|
const userDefinedGroupColumn = groupByForColumn.column ? { ...groupByForColumn.column } : {};
|
|
27435
|
-
|
|
27437
|
+
const theGroupColumnFromProps = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : groupColumnFromProps;
|
|
27438
|
+
return {
|
|
27436
27439
|
header: `Group by ${groupByForColumn.field || groupByForColumn.groupField}`,
|
|
27437
27440
|
groupByForColumn,
|
|
27438
27441
|
render: renderers.getGroupColumnRender({
|
|
@@ -27440,27 +27443,17 @@ function buildColumnForGroupBy(options, toggleGroupRow, groupColumnFromProps, re
|
|
|
27440
27443
|
groupRenderStrategy
|
|
27441
27444
|
}),
|
|
27442
27445
|
...userDefinedGroupColumn,
|
|
27446
|
+
...theGroupColumnFromProps,
|
|
27447
|
+
// a renderGroupIcon from the groupColumn prop is wrapped too, as with a
|
|
27448
|
+
// single group column: it is called only where a group icon belongs, with
|
|
27449
|
+
// the default icon in renderBag.groupIcon
|
|
27443
27450
|
renderGroupIcon: renderers.getGroupColumnRenderGroupIcon({
|
|
27444
|
-
initialRenderGroupIcon:
|
|
27451
|
+
initialRenderGroupIcon: theGroupColumnFromProps?.renderGroupIcon ?? userDefinedGroupColumn.renderGroupIcon,
|
|
27445
27452
|
groupIndexForColumn,
|
|
27446
27453
|
toggleGroupRow,
|
|
27447
27454
|
groupRenderStrategy
|
|
27448
27455
|
})
|
|
27449
27456
|
};
|
|
27450
|
-
if (groupColumnFromProps) {
|
|
27451
|
-
if (typeof groupColumnFromProps === "function") {
|
|
27452
|
-
generatedGroupColumn = {
|
|
27453
|
-
...generatedGroupColumn,
|
|
27454
|
-
...groupColumnFromProps(options, toggleGroupRow)
|
|
27455
|
-
};
|
|
27456
|
-
} else {
|
|
27457
|
-
generatedGroupColumn = {
|
|
27458
|
-
...generatedGroupColumn,
|
|
27459
|
-
...groupColumnFromProps
|
|
27460
|
-
};
|
|
27461
|
-
}
|
|
27462
|
-
}
|
|
27463
|
-
return generatedGroupColumn;
|
|
27464
27457
|
}
|
|
27465
27458
|
function buildSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps, renderers) {
|
|
27466
27459
|
const theGroupColumnFromProps = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : groupColumnFromProps;
|
|
@@ -28786,7 +28779,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
28786
28779
|
}
|
|
28787
28780
|
let valid2 = isValidLicense(licenseKey, {
|
|
28788
28781
|
publishedAt: 1624970570587,
|
|
28789
|
-
version: "10.1.
|
|
28782
|
+
version: "10.1.3"
|
|
28790
28783
|
});
|
|
28791
28784
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
28792
28785
|
return true;
|
|
@@ -29495,7 +29488,7 @@ function useDOMEventHandlers() {
|
|
|
29495
29488
|
}
|
|
29496
29489
|
|
|
29497
29490
|
// src/components/InfiniteTable/hooks/useColumnMenu.ts
|
|
29498
|
-
var
|
|
29491
|
+
var import_react60 = require("react");
|
|
29499
29492
|
|
|
29500
29493
|
// src/components/hooks/useOverlay/index.tsx
|
|
29501
29494
|
var React57 = __toESM(require("react"));
|
|
@@ -29754,7 +29747,9 @@ function useOverlayPortal(content, portalContainer) {
|
|
|
29754
29747
|
}
|
|
29755
29748
|
getContainer();
|
|
29756
29749
|
}, [portalContainer]);
|
|
29757
|
-
|
|
29750
|
+
const currentContainer = typeof portalContainer === "function" ? portalContainer() : null;
|
|
29751
|
+
const targetContainer = isHTMLElement2(currentContainer) ? currentContainer : container;
|
|
29752
|
+
return portalContainer ? targetContainer ? (0, import_react_dom3.createPortal)(content, targetContainer) : (
|
|
29758
29753
|
// we're probably still fetching the container
|
|
29759
29754
|
/* @__PURE__ */ React57.createElement(React57.Fragment, null)
|
|
29760
29755
|
) : portalContainer === null || portalContainer === false ? content : /* @__PURE__ */ React57.createElement(DefaultOverlayPortal, null, content);
|
|
@@ -31108,6 +31103,41 @@ function getMenuForColumn(columnId, context, onHideIntent) {
|
|
|
31108
31103
|
);
|
|
31109
31104
|
}
|
|
31110
31105
|
|
|
31106
|
+
// src/components/InfiniteTable/utils/menuOverlayTargets.ts
|
|
31107
|
+
function resolveMenuElement(element) {
|
|
31108
|
+
return typeof element === "function" ? element() : element;
|
|
31109
|
+
}
|
|
31110
|
+
function getMenuConstrainTo(state) {
|
|
31111
|
+
return resolveMenuElement(state.menuConstrainTo) ?? state.domRef.current;
|
|
31112
|
+
}
|
|
31113
|
+
function getMenuPortalContainer(getState, menuPortalContainer, defaultContainer) {
|
|
31114
|
+
if (!menuPortalContainer) {
|
|
31115
|
+
return defaultContainer || false;
|
|
31116
|
+
}
|
|
31117
|
+
return () => resolveMenuElement(menuPortalContainer) ?? (defaultContainer || getState().portalDOMRef.current);
|
|
31118
|
+
}
|
|
31119
|
+
|
|
31120
|
+
// src/components/InfiniteTable/hooks/useMenuPortalContainer.ts
|
|
31121
|
+
var import_react59 = require("react");
|
|
31122
|
+
function useMenuPortalContainer() {
|
|
31123
|
+
const { getState, menuPortalContainer } = useInfiniteTableSelector((ctx) => {
|
|
31124
|
+
return {
|
|
31125
|
+
getState: ctx.getState,
|
|
31126
|
+
menuPortalContainer: ctx.state.menuPortalContainer
|
|
31127
|
+
};
|
|
31128
|
+
});
|
|
31129
|
+
const { portalDOMRef } = useDataSourceMasterDetailSelector((ctx) => {
|
|
31130
|
+
return {
|
|
31131
|
+
portalDOMRef: ctx.getMasterState().portalDOMRef
|
|
31132
|
+
};
|
|
31133
|
+
}) || {};
|
|
31134
|
+
const defaultContainer = portalDOMRef?.current;
|
|
31135
|
+
return (0, import_react59.useMemo)(
|
|
31136
|
+
() => getMenuPortalContainer(getState, menuPortalContainer, defaultContainer),
|
|
31137
|
+
[getState, menuPortalContainer, defaultContainer]
|
|
31138
|
+
);
|
|
31139
|
+
}
|
|
31140
|
+
|
|
31111
31141
|
// src/components/InfiniteTable/hooks/useColumnMenu.ts
|
|
31112
31142
|
var menuIconSelector2 = `[${MenuIconDataAttributes["data-name"]}="${MenuIconDataAttributesValues["data-name"]}"]`;
|
|
31113
31143
|
function showMenuForColumn(options) {
|
|
@@ -31137,7 +31167,7 @@ function showMenuForColumn(options) {
|
|
|
31137
31167
|
}
|
|
31138
31168
|
columnMenuTargetRef.current = null;
|
|
31139
31169
|
showOverlay(() => getMenuForColumn(columnId, context, onHideIntent), {
|
|
31140
|
-
constrainTo:
|
|
31170
|
+
constrainTo: getMenuConstrainTo(getState()),
|
|
31141
31171
|
id: "column-menu",
|
|
31142
31172
|
alignTo: target,
|
|
31143
31173
|
alignPosition: [
|
|
@@ -31161,19 +31191,14 @@ function useColumnMenu() {
|
|
|
31161
31191
|
columnMenuVisibleKey: ctx.state.columnMenuVisibleKey
|
|
31162
31192
|
};
|
|
31163
31193
|
});
|
|
31164
|
-
const { portalDOMRef } = useDataSourceMasterDetailSelector((ctx) => {
|
|
31165
|
-
return {
|
|
31166
|
-
portalDOMRef: ctx.getMasterState().portalDOMRef
|
|
31167
|
-
};
|
|
31168
|
-
}) || {};
|
|
31169
31194
|
const {
|
|
31170
31195
|
showOverlay,
|
|
31171
31196
|
portal: menuPortal,
|
|
31172
31197
|
clearAll
|
|
31173
31198
|
} = useOverlay({
|
|
31174
|
-
portalContainer:
|
|
31199
|
+
portalContainer: useMenuPortalContainer()
|
|
31175
31200
|
});
|
|
31176
|
-
(0,
|
|
31201
|
+
(0, import_react60.useEffect)(() => {
|
|
31177
31202
|
const state = getState();
|
|
31178
31203
|
return state.onColumnMenuClick.onChange((info) => {
|
|
31179
31204
|
if (!info) {
|
|
@@ -31186,7 +31211,7 @@ function useColumnMenu() {
|
|
|
31186
31211
|
actions.columnMenuVisibleForColumnId = info.column.id;
|
|
31187
31212
|
});
|
|
31188
31213
|
}, []);
|
|
31189
|
-
(0,
|
|
31214
|
+
(0, import_react60.useEffect)(() => {
|
|
31190
31215
|
const { columnMenuVisibleForColumnId: columnMenuVisibleForColumnId2, columnMenuTargetRef } = getState();
|
|
31191
31216
|
if (columnMenuVisibleForColumnId2) {
|
|
31192
31217
|
let handleMouseDown2 = function(event) {
|
|
@@ -31221,7 +31246,7 @@ function useColumnMenu() {
|
|
|
31221
31246
|
|
|
31222
31247
|
// src/components/InfiniteTable/components/FocusDetect.tsx
|
|
31223
31248
|
var React65 = __toESM(require("react"));
|
|
31224
|
-
var
|
|
31249
|
+
var import_react61 = require("react");
|
|
31225
31250
|
var style = {
|
|
31226
31251
|
width: 0,
|
|
31227
31252
|
height: 0,
|
|
@@ -31241,7 +31266,7 @@ function FocusDetect() {
|
|
|
31241
31266
|
} = useInfiniteTableStableContext();
|
|
31242
31267
|
const { getDataSourceState, getDataSourceMasterContext } = useDataSourceStableContext();
|
|
31243
31268
|
const { focusDetectDOMRef } = getState();
|
|
31244
|
-
const onFocus = (0,
|
|
31269
|
+
const onFocus = (0, import_react61.useCallback)(async () => {
|
|
31245
31270
|
const context = {
|
|
31246
31271
|
getDataSourceState,
|
|
31247
31272
|
getDataSourceMasterContext,
|
|
@@ -31266,7 +31291,7 @@ function FocusDetect() {
|
|
|
31266
31291
|
}
|
|
31267
31292
|
|
|
31268
31293
|
// src/components/InfiniteTable/hooks/useEditingCallbackProps.ts
|
|
31269
|
-
var
|
|
31294
|
+
var import_react62 = require("react");
|
|
31270
31295
|
function useOnEditCancelled() {
|
|
31271
31296
|
const context = useInfiniteTableStableContext();
|
|
31272
31297
|
const { getState, editingCell } = useInfiniteTableSelector((ctx) => {
|
|
@@ -31276,7 +31301,7 @@ function useOnEditCancelled() {
|
|
|
31276
31301
|
};
|
|
31277
31302
|
});
|
|
31278
31303
|
const cancelled = editingCell && !editingCell.active ? editingCell.cancelled : void 0;
|
|
31279
|
-
(0,
|
|
31304
|
+
(0, import_react62.useEffect)(() => {
|
|
31280
31305
|
if (cancelled) {
|
|
31281
31306
|
const { onEditCancelled } = getState();
|
|
31282
31307
|
const editingCell2 = getState().editingCell;
|
|
@@ -31304,7 +31329,7 @@ function useOnEditRejected() {
|
|
|
31304
31329
|
};
|
|
31305
31330
|
});
|
|
31306
31331
|
const rejected = editingCell && !editingCell.active && editingCell.accepted instanceof Error ? editingCell.accepted : void 0;
|
|
31307
|
-
(0,
|
|
31332
|
+
(0, import_react62.useEffect)(() => {
|
|
31308
31333
|
if (rejected) {
|
|
31309
31334
|
const { onEditRejected } = getState();
|
|
31310
31335
|
const editingCell2 = getState().editingCell;
|
|
@@ -31334,7 +31359,7 @@ function useFocusOnEditStop() {
|
|
|
31334
31359
|
});
|
|
31335
31360
|
const active = editingCell?.active;
|
|
31336
31361
|
const prevActive = usePrevious(active);
|
|
31337
|
-
(0,
|
|
31362
|
+
(0, import_react62.useEffect)(() => {
|
|
31338
31363
|
if (!active && prevActive) {
|
|
31339
31364
|
context.api.focus();
|
|
31340
31365
|
}
|
|
@@ -31349,7 +31374,7 @@ function useOnEditAccepted() {
|
|
|
31349
31374
|
};
|
|
31350
31375
|
});
|
|
31351
31376
|
const accepted = editingCell && !editingCell.active && !editingCell.cancelled && editingCell.accepted === true;
|
|
31352
|
-
(0,
|
|
31377
|
+
(0, import_react62.useEffect)(() => {
|
|
31353
31378
|
if (accepted) {
|
|
31354
31379
|
const { onEditAccepted } = getState();
|
|
31355
31380
|
const editingCell2 = getState().editingCell;
|
|
@@ -31375,7 +31400,7 @@ function useOnEditPersisted() {
|
|
|
31375
31400
|
};
|
|
31376
31401
|
});
|
|
31377
31402
|
const persisted = editingCell ? editingCell.persisted : void 0;
|
|
31378
|
-
(0,
|
|
31403
|
+
(0, import_react62.useEffect)(() => {
|
|
31379
31404
|
if (persisted) {
|
|
31380
31405
|
const { editingCell: editingCell2, onEditPersistError, onEditPersistSuccess } = getState();
|
|
31381
31406
|
if (!editingCell2) {
|
|
@@ -31412,7 +31437,7 @@ function useEditingCallbackProps() {
|
|
|
31412
31437
|
}
|
|
31413
31438
|
|
|
31414
31439
|
// src/components/InfiniteTable/hooks/useColumnFilterOperatorMenu.ts
|
|
31415
|
-
var
|
|
31440
|
+
var import_react63 = require("react");
|
|
31416
31441
|
|
|
31417
31442
|
// src/components/InfiniteTable/utils/getFilterOperatorMenuForColumn.tsx
|
|
31418
31443
|
var React68 = __toESM(require("react"));
|
|
@@ -31541,11 +31566,6 @@ function getFilterOperatorMenuForColumn(columnId, context, onHideIntent) {
|
|
|
31541
31566
|
// src/components/InfiniteTable/hooks/useColumnFilterOperatorMenu.ts
|
|
31542
31567
|
var OFFSET2 = 10;
|
|
31543
31568
|
function useColumnFilterOperatorMenu() {
|
|
31544
|
-
const { portalDOMRef } = useDataSourceMasterDetailSelector((ctx) => {
|
|
31545
|
-
return {
|
|
31546
|
-
portalDOMRef: ctx.getMasterState().portalDOMRef
|
|
31547
|
-
};
|
|
31548
|
-
}) || {};
|
|
31549
31569
|
const stableContext = useInfiniteTableStableContext();
|
|
31550
31570
|
const { getState, actions } = stableContext;
|
|
31551
31571
|
const {
|
|
@@ -31553,9 +31573,9 @@ function useColumnFilterOperatorMenu() {
|
|
|
31553
31573
|
portal: menuPortal,
|
|
31554
31574
|
clearAll
|
|
31555
31575
|
} = useOverlay({
|
|
31556
|
-
portalContainer:
|
|
31576
|
+
portalContainer: useMenuPortalContainer()
|
|
31557
31577
|
});
|
|
31558
|
-
(0,
|
|
31578
|
+
(0, import_react63.useEffect)(() => {
|
|
31559
31579
|
const state = getState();
|
|
31560
31580
|
return state.onFilterOperatorMenuClick.onChange((info) => {
|
|
31561
31581
|
if (!info) {
|
|
@@ -31579,7 +31599,7 @@ function useColumnFilterOperatorMenu() {
|
|
|
31579
31599
|
onHideIntent
|
|
31580
31600
|
),
|
|
31581
31601
|
{
|
|
31582
|
-
constrainTo: getState()
|
|
31602
|
+
constrainTo: getMenuConstrainTo(getState()),
|
|
31583
31603
|
id: "filter-operator-menu",
|
|
31584
31604
|
alignTo: rect,
|
|
31585
31605
|
alignPosition: [
|
|
@@ -31594,7 +31614,7 @@ function useColumnFilterOperatorMenu() {
|
|
|
31594
31614
|
actions.filterOperatorMenuVisibleForColumnId = column.id;
|
|
31595
31615
|
});
|
|
31596
31616
|
}, []);
|
|
31597
|
-
(0,
|
|
31617
|
+
(0, import_react63.useEffect)(() => {
|
|
31598
31618
|
const { filterOperatorMenuVisibleForColumnId } = getState();
|
|
31599
31619
|
if (filterOperatorMenuVisibleForColumnId) {
|
|
31600
31620
|
let handleMouseDown2 = function(event) {
|
|
@@ -31621,7 +31641,7 @@ function useColumnFilterOperatorMenu() {
|
|
|
31621
31641
|
}
|
|
31622
31642
|
|
|
31623
31643
|
// src/components/InfiniteTable/hooks/useContextMenu.ts
|
|
31624
|
-
var
|
|
31644
|
+
var import_react64 = require("react");
|
|
31625
31645
|
|
|
31626
31646
|
// src/components/InfiniteTable/utils/getCellContextMenu.tsx
|
|
31627
31647
|
var React70 = __toESM(require("react"));
|
|
@@ -31783,20 +31803,15 @@ var ALIGN_POSITIONS = [
|
|
|
31783
31803
|
];
|
|
31784
31804
|
function useCellContextMenu() {
|
|
31785
31805
|
const context = useInfiniteTableStableContext();
|
|
31786
|
-
const { portalDOMRef } = useDataSourceMasterDetailSelector((ctx) => {
|
|
31787
|
-
return {
|
|
31788
|
-
portalDOMRef: ctx.getMasterState().portalDOMRef
|
|
31789
|
-
};
|
|
31790
|
-
}) || {};
|
|
31791
31806
|
const { getState, actions } = context;
|
|
31792
31807
|
const {
|
|
31793
31808
|
showOverlay,
|
|
31794
31809
|
portal: menuPortal,
|
|
31795
31810
|
clearAll
|
|
31796
31811
|
} = useOverlay({
|
|
31797
|
-
portalContainer:
|
|
31812
|
+
portalContainer: useMenuPortalContainer()
|
|
31798
31813
|
});
|
|
31799
|
-
(0,
|
|
31814
|
+
(0, import_react64.useEffect)(() => {
|
|
31800
31815
|
const { actions: actions2, getState: getState2, getDataSourceState } = context;
|
|
31801
31816
|
const state = getState2();
|
|
31802
31817
|
return state.cellContextMenu.onChange((info) => {
|
|
@@ -31820,7 +31835,7 @@ function useCellContextMenu() {
|
|
|
31820
31835
|
rect.width += OFFSET3;
|
|
31821
31836
|
rect.height += OFFSET3;
|
|
31822
31837
|
showOverlay(menu, {
|
|
31823
|
-
constrainTo: getState2()
|
|
31838
|
+
constrainTo: getMenuConstrainTo(getState2()),
|
|
31824
31839
|
id: "cell-context-menu",
|
|
31825
31840
|
alignTo: rect,
|
|
31826
31841
|
alignPosition: ALIGN_POSITIONS
|
|
@@ -31847,7 +31862,7 @@ function useCellContextMenu() {
|
|
|
31847
31862
|
}
|
|
31848
31863
|
});
|
|
31849
31864
|
}, []);
|
|
31850
|
-
(0,
|
|
31865
|
+
(0, import_react64.useEffect)(() => {
|
|
31851
31866
|
const { cellContextMenuVisibleFor } = getState();
|
|
31852
31867
|
if (cellContextMenuVisibleFor) {
|
|
31853
31868
|
let handleMouseDown2 = function(event) {
|
|
@@ -31874,20 +31889,15 @@ function useCellContextMenu() {
|
|
|
31874
31889
|
}
|
|
31875
31890
|
function useTableContextMenu() {
|
|
31876
31891
|
const context = useInfiniteTableStableContext();
|
|
31877
|
-
const { portalDOMRef } = useDataSourceMasterDetailSelector((ctx) => {
|
|
31878
|
-
return {
|
|
31879
|
-
portalDOMRef: ctx.getMasterState().portalDOMRef
|
|
31880
|
-
};
|
|
31881
|
-
}) || {};
|
|
31882
31892
|
const { getState, actions } = context;
|
|
31883
31893
|
const {
|
|
31884
31894
|
showOverlay,
|
|
31885
31895
|
portal: menuPortal,
|
|
31886
31896
|
clearAll
|
|
31887
31897
|
} = useOverlay({
|
|
31888
|
-
portalContainer:
|
|
31898
|
+
portalContainer: useMenuPortalContainer()
|
|
31889
31899
|
});
|
|
31890
|
-
(0,
|
|
31900
|
+
(0, import_react64.useEffect)(() => {
|
|
31891
31901
|
const { actions: actions2, getState: getState2 } = context;
|
|
31892
31902
|
const state = getState2();
|
|
31893
31903
|
return state.contextMenu.onChange((info) => {
|
|
@@ -31912,7 +31922,7 @@ function useTableContextMenu() {
|
|
|
31912
31922
|
rect.width += OFFSET3;
|
|
31913
31923
|
rect.height += OFFSET3;
|
|
31914
31924
|
showOverlay(menu, {
|
|
31915
|
-
constrainTo: getState2()
|
|
31925
|
+
constrainTo: getMenuConstrainTo(getState2()),
|
|
31916
31926
|
id: "table-context-menu",
|
|
31917
31927
|
alignTo: rect,
|
|
31918
31928
|
alignPosition: ALIGN_POSITIONS
|
|
@@ -31936,7 +31946,7 @@ function useTableContextMenu() {
|
|
|
31936
31946
|
}
|
|
31937
31947
|
});
|
|
31938
31948
|
}, []);
|
|
31939
|
-
(0,
|
|
31949
|
+
(0, import_react64.useEffect)(() => {
|
|
31940
31950
|
const { contextMenuVisibleFor } = getState();
|
|
31941
31951
|
if (contextMenuVisibleFor) {
|
|
31942
31952
|
let handleMouseDown2 = function(event) {
|
|
@@ -31963,19 +31973,19 @@ function useTableContextMenu() {
|
|
|
31963
31973
|
}
|
|
31964
31974
|
|
|
31965
31975
|
// src/components/InfiniteTable/components/HScrollSyncContent.tsx
|
|
31966
|
-
var
|
|
31976
|
+
var import_react66 = require("react");
|
|
31967
31977
|
var React71 = __toESM(require("react"));
|
|
31968
31978
|
|
|
31969
31979
|
// src/components/InfiniteTable/hooks/useGridScroll.ts
|
|
31970
|
-
var
|
|
31980
|
+
var import_react65 = require("react");
|
|
31971
31981
|
function useGridScroll(onScroll, deps) {
|
|
31972
31982
|
const { brain } = useInfiniteTableSelector((ctx) => {
|
|
31973
31983
|
return {
|
|
31974
31984
|
brain: ctx.state.brain
|
|
31975
31985
|
};
|
|
31976
31986
|
});
|
|
31977
|
-
const memoizedOnScroll = (0,
|
|
31978
|
-
(0,
|
|
31987
|
+
const memoizedOnScroll = (0, import_react65.useCallback)(onScroll, deps);
|
|
31988
|
+
(0, import_react65.useEffect)(() => {
|
|
31979
31989
|
const removeOnScroll = brain.onScroll(memoizedOnScroll);
|
|
31980
31990
|
return removeOnScroll;
|
|
31981
31991
|
}, [brain, memoizedOnScroll]);
|
|
@@ -31987,7 +31997,7 @@ var HScrollSyncContentCls = "yzx0vj0";
|
|
|
31987
31997
|
// src/components/InfiniteTable/components/HScrollSyncContent.tsx
|
|
31988
31998
|
function HScrollSyncContent(props) {
|
|
31989
31999
|
const { width, maxWidth, minWidth, scrollable, ...domProps } = props;
|
|
31990
|
-
const domRef = (0,
|
|
32000
|
+
const domRef = (0, import_react66.useRef)(null);
|
|
31991
32001
|
useGridScroll(
|
|
31992
32002
|
(scrollPos) => {
|
|
31993
32003
|
if (domRef.current && scrollable !== false) {
|
|
@@ -32049,7 +32059,7 @@ function useVisibleColumnSizes() {
|
|
|
32049
32059
|
var DEBUG_NAME = "InfiniteTable";
|
|
32050
32060
|
|
|
32051
32061
|
// src/components/InfiniteTable/hooks/useHorizontalLayout.ts
|
|
32052
|
-
var
|
|
32062
|
+
var import_react67 = require("react");
|
|
32053
32063
|
function useHorizontalLayout() {
|
|
32054
32064
|
const { getState, actions, dataSourceActions, getDataSourceState } = useInfiniteTableSelector((ctx) => {
|
|
32055
32065
|
return {
|
|
@@ -32066,7 +32076,7 @@ function useHorizontalLayout() {
|
|
|
32066
32076
|
if (!wrapRowsHorizontally) {
|
|
32067
32077
|
repeatWrappedGroupRows = false;
|
|
32068
32078
|
}
|
|
32069
|
-
(0,
|
|
32079
|
+
(0, import_react67.useEffect)(() => {
|
|
32070
32080
|
if (!wrapRowsHorizontally) {
|
|
32071
32081
|
if (getDataSourceState().repeatWrappedGroupRows) {
|
|
32072
32082
|
dataSourceActions.repeatWrappedGroupRows = false;
|
|
@@ -32110,7 +32120,7 @@ function useHorizontalLayout() {
|
|
|
32110
32120
|
}
|
|
32111
32121
|
|
|
32112
32122
|
// src/components/InfiniteTable/hooks/useDebugMode.ts
|
|
32113
|
-
var
|
|
32123
|
+
var import_react68 = require("react");
|
|
32114
32124
|
|
|
32115
32125
|
// src/utils/themeVarsUtils.ts
|
|
32116
32126
|
function collectThemeVarNames() {
|
|
@@ -32312,7 +32322,7 @@ function useDebugMode() {
|
|
|
32312
32322
|
}
|
|
32313
32323
|
}
|
|
32314
32324
|
}
|
|
32315
|
-
(0,
|
|
32325
|
+
(0, import_react68.useEffect)(() => {
|
|
32316
32326
|
const dataSourceState = getDataSourceState();
|
|
32317
32327
|
if (dataSourceState.debugId !== debugId) {
|
|
32318
32328
|
dataSourceActions.debugId = debugId;
|
|
@@ -32564,9 +32574,9 @@ function useDevTools() {
|
|
|
32564
32574
|
});
|
|
32565
32575
|
const state = getState();
|
|
32566
32576
|
const debugId = state.debugId;
|
|
32567
|
-
const debugIdRef = (0,
|
|
32577
|
+
const debugIdRef = (0, import_react68.useRef)(debugId);
|
|
32568
32578
|
debugIdRef.current = debugId;
|
|
32569
|
-
(0,
|
|
32579
|
+
(0, import_react68.useEffect)(() => {
|
|
32570
32580
|
const debugId2 = debugIdRef.current;
|
|
32571
32581
|
if (!debugId2) {
|
|
32572
32582
|
return;
|
|
@@ -32594,7 +32604,7 @@ function useDevTools() {
|
|
|
32594
32604
|
withHookFn(hookFn2);
|
|
32595
32605
|
});
|
|
32596
32606
|
}, []);
|
|
32597
|
-
(0,
|
|
32607
|
+
(0, import_react68.useEffect)(() => {
|
|
32598
32608
|
const debugId2 = debugIdRef.current;
|
|
32599
32609
|
if (!debugId2) {
|
|
32600
32610
|
return;
|
|
@@ -32612,7 +32622,7 @@ function useDevTools() {
|
|
|
32612
32622
|
});
|
|
32613
32623
|
}
|
|
32614
32624
|
});
|
|
32615
|
-
(0,
|
|
32625
|
+
(0, import_react68.useEffect)(() => {
|
|
32616
32626
|
if (!debugId) {
|
|
32617
32627
|
return;
|
|
32618
32628
|
}
|
|
@@ -32642,7 +32652,7 @@ function useInfinitePortalContainer() {
|
|
|
32642
32652
|
|
|
32643
32653
|
// src/components/InfiniteTable/components/GroupingToolbar/index.tsx
|
|
32644
32654
|
var React73 = __toESM(require("react"));
|
|
32645
|
-
var
|
|
32655
|
+
var import_react69 = require("react");
|
|
32646
32656
|
|
|
32647
32657
|
// src/components/InfiniteTable/components/GroupingToolbar/index.css.ts
|
|
32648
32658
|
var GroupingToolbarItemClearCls = "hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n";
|
|
@@ -32828,7 +32838,7 @@ function GroupingToolbar(props) {
|
|
|
32828
32838
|
});
|
|
32829
32839
|
dataSourceApi.setGroupBy(newGroupBy);
|
|
32830
32840
|
};
|
|
32831
|
-
const shouldAcceptDrop = (0,
|
|
32841
|
+
const shouldAcceptDrop = (0, import_react69.useCallback)(
|
|
32832
32842
|
(event) => {
|
|
32833
32843
|
const { computedColumnsMap: computedColumnsMap2 } = getComputed();
|
|
32834
32844
|
const columnId = event.dragItem.id;
|
|
@@ -32890,8 +32900,8 @@ function GroupingToolbar(props) {
|
|
|
32890
32900
|
var React78 = __toESM(require("react"));
|
|
32891
32901
|
|
|
32892
32902
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
32893
|
-
var import_react70 = require("react");
|
|
32894
32903
|
var import_react71 = require("react");
|
|
32904
|
+
var import_react72 = require("react");
|
|
32895
32905
|
var React75 = __toESM(require("react"));
|
|
32896
32906
|
|
|
32897
32907
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
@@ -32935,7 +32945,7 @@ var React74 = __toESM(require("react"));
|
|
|
32935
32945
|
var RowDetailRecipe = createRuntimeFn({ defaultClassName: "evqes20", variantClassNames: {}, defaultVariants: {}, compoundVariants: [] });
|
|
32936
32946
|
|
|
32937
32947
|
// src/components/InfiniteTable/components/InfiniteTableRow/useRegisterDetail.ts
|
|
32938
|
-
var
|
|
32948
|
+
var import_react70 = require("react");
|
|
32939
32949
|
|
|
32940
32950
|
// src/components/InfiniteTable/components/InfiniteTableRow/registerDetailShared.ts
|
|
32941
32951
|
function restoreDetailStateForRowId(rowId, options) {
|
|
@@ -33063,11 +33073,11 @@ function useRegisterDetail(props) {
|
|
|
33063
33073
|
getMasterState: ctx.getState
|
|
33064
33074
|
};
|
|
33065
33075
|
});
|
|
33066
|
-
const { currentRowCache, cacheCalledByRowDetailRenderer } = (0,
|
|
33076
|
+
const { currentRowCache, cacheCalledByRowDetailRenderer } = (0, import_react70.useMemo)(
|
|
33067
33077
|
() => createCurrentRowCache(rowInfo.id, rowDetailsCache),
|
|
33068
33078
|
[rowDetailsCache, rowInfo.id]
|
|
33069
33079
|
);
|
|
33070
|
-
const masterDetailContextValue = (0,
|
|
33080
|
+
const masterDetailContextValue = (0, import_react70.useMemo)(() => {
|
|
33071
33081
|
return createMasterDetailContextValue({
|
|
33072
33082
|
rowInfo,
|
|
33073
33083
|
currentRowCache,
|
|
@@ -33211,7 +33221,7 @@ function useCellRendering(param) {
|
|
|
33211
33221
|
toggleGroupRow,
|
|
33212
33222
|
columnSize
|
|
33213
33223
|
} = computed;
|
|
33214
|
-
const visibleColumnIds = (0,
|
|
33224
|
+
const visibleColumnIds = (0, import_react71.useMemo)(
|
|
33215
33225
|
() => computedVisibleColumns.map((column) => column.id),
|
|
33216
33226
|
[computedVisibleColumns]
|
|
33217
33227
|
);
|
|
@@ -33248,18 +33258,18 @@ function useCellRendering(param) {
|
|
|
33248
33258
|
bodySize,
|
|
33249
33259
|
rowspan
|
|
33250
33260
|
});
|
|
33251
|
-
const scrollTopMaxRef = (0,
|
|
33252
|
-
(0,
|
|
33261
|
+
const scrollTopMaxRef = (0, import_react72.useRef)(0);
|
|
33262
|
+
(0, import_react72.useEffect)(() => {
|
|
33253
33263
|
return brain.onRenderCountChange(() => {
|
|
33254
33264
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
33255
33265
|
});
|
|
33256
33266
|
}, [brain]);
|
|
33257
|
-
(0,
|
|
33267
|
+
(0, import_react72.useEffect)(() => {
|
|
33258
33268
|
return brain.onRenderRangeChange((range) => {
|
|
33259
33269
|
getState().onRenderRangeChange?.(range);
|
|
33260
33270
|
});
|
|
33261
33271
|
}, [brain]);
|
|
33262
|
-
(0,
|
|
33272
|
+
(0, import_react72.useEffect)(() => {
|
|
33263
33273
|
return brain.onScrollStop((scrollPosition) => {
|
|
33264
33274
|
const { scrollTop: scrollTop2, scrollLeft: scrollLeft2 } = scrollPosition;
|
|
33265
33275
|
if (scrollTop2 === 0) {
|
|
@@ -33299,13 +33309,13 @@ function useCellRendering(param) {
|
|
|
33299
33309
|
}
|
|
33300
33310
|
});
|
|
33301
33311
|
}, [brain, onScrollToTop, onScrollToBottom, onScrollStop]);
|
|
33302
|
-
(0,
|
|
33312
|
+
(0, import_react72.useEffect)(() => {
|
|
33303
33313
|
if (!bodySize.height) {
|
|
33304
33314
|
return;
|
|
33305
33315
|
}
|
|
33306
33316
|
actions.ready = true;
|
|
33307
33317
|
}, [!!bodySize.height]);
|
|
33308
|
-
(0,
|
|
33318
|
+
(0, import_react72.useEffect)(() => {
|
|
33309
33319
|
if (!ready) {
|
|
33310
33320
|
}
|
|
33311
33321
|
const { onReady } = getState();
|
|
@@ -33313,14 +33323,14 @@ function useCellRendering(param) {
|
|
|
33313
33323
|
onReady({ api: imperativeApi, dataSourceApi });
|
|
33314
33324
|
}
|
|
33315
33325
|
}, [ready]);
|
|
33316
|
-
const dataSourceStatePartialForCell = (0,
|
|
33326
|
+
const dataSourceStatePartialForCell = (0, import_react71.useMemo)(() => {
|
|
33317
33327
|
return {
|
|
33318
33328
|
isNodeReadOnly: isNodeReadOnly2,
|
|
33319
33329
|
selectionMode,
|
|
33320
33330
|
cellSelection
|
|
33321
33331
|
};
|
|
33322
33332
|
}, [isNodeReadOnly2, selectionMode, cellSelection]);
|
|
33323
|
-
const renderCell = (0,
|
|
33333
|
+
const renderCell = (0, import_react72.useCallback)(
|
|
33324
33334
|
(params) => {
|
|
33325
33335
|
const {
|
|
33326
33336
|
rowIndex,
|
|
@@ -33439,7 +33449,7 @@ function useCellRendering(param) {
|
|
|
33439
33449
|
dataSourceStatePartialForCell
|
|
33440
33450
|
]
|
|
33441
33451
|
);
|
|
33442
|
-
const renderDetailRow = (0,
|
|
33452
|
+
const renderDetailRow = (0, import_react71.useMemo)(() => {
|
|
33443
33453
|
if (!isRowDetailsExpanded) {
|
|
33444
33454
|
return void 0;
|
|
33445
33455
|
}
|
|
@@ -33479,7 +33489,7 @@ function useCellRendering(param) {
|
|
|
33479
33489
|
}
|
|
33480
33490
|
|
|
33481
33491
|
// src/components/InfiniteTable/hooks/useToggleWrapRowsHorizontally.ts
|
|
33482
|
-
var
|
|
33492
|
+
var import_react73 = require("react");
|
|
33483
33493
|
function useToggleWrapRowsHorizontally() {
|
|
33484
33494
|
const { state, getState, actions } = useInfiniteTableSelector((ctx) => {
|
|
33485
33495
|
return {
|
|
@@ -33490,7 +33500,7 @@ function useToggleWrapRowsHorizontally() {
|
|
|
33490
33500
|
});
|
|
33491
33501
|
const { wrapRowsHorizontally } = state;
|
|
33492
33502
|
const oldWrapRowsHorizontally = usePrevious(wrapRowsHorizontally);
|
|
33493
|
-
(0,
|
|
33503
|
+
(0, import_react73.useEffect)(() => {
|
|
33494
33504
|
if (oldWrapRowsHorizontally !== wrapRowsHorizontally) {
|
|
33495
33505
|
const { brain, headerBrain, renderer, onRenderUpdater } = getState();
|
|
33496
33506
|
brain.destroy();
|
|
@@ -33551,7 +33561,7 @@ function LoadMaskFn(props) {
|
|
|
33551
33561
|
var LoadMask = React77.memo(LoadMaskFn);
|
|
33552
33562
|
|
|
33553
33563
|
// src/components/InfiniteTable/components/InfiniteTableBody/index.tsx
|
|
33554
|
-
var
|
|
33564
|
+
var import_react74 = require("react");
|
|
33555
33565
|
var _HOVERED_CLASS_NAMES = [
|
|
33556
33566
|
RowHoverCls,
|
|
33557
33567
|
`${InfiniteTableColumnCellClassName}--hovered`
|
|
@@ -33668,7 +33678,7 @@ function InfiniteTableBody(props) {
|
|
|
33668
33678
|
});
|
|
33669
33679
|
const { autoFocus, tabIndex } = domProps ?? {};
|
|
33670
33680
|
useToggleWrapRowsHorizontally();
|
|
33671
|
-
const hoverClassNames = (0,
|
|
33681
|
+
const hoverClassNames = (0, import_react74.useMemo)(() => {
|
|
33672
33682
|
if (!showHoverRows) {
|
|
33673
33683
|
return void 0;
|
|
33674
33684
|
}
|
|
@@ -34327,7 +34337,7 @@ var keyboardShortcuts = {
|
|
|
34327
34337
|
};
|
|
34328
34338
|
|
|
34329
34339
|
// src/components/hooks/useInterceptedMap.ts
|
|
34330
|
-
var
|
|
34340
|
+
var import_react75 = require("react");
|
|
34331
34341
|
function interceptMap(map2, fns) {
|
|
34332
34342
|
const { set, delete: deleteKey, clear } = map2;
|
|
34333
34343
|
if (fns.set) {
|
|
@@ -34489,21 +34499,21 @@ _WeakFixedSizeSet.DEFAULT_SIZE = 10;
|
|
|
34489
34499
|
var WeakFixedSizeSet = _WeakFixedSizeSet;
|
|
34490
34500
|
|
|
34491
34501
|
// src/components/hooks/useEffectWhenSameDeps.ts
|
|
34492
|
-
var
|
|
34502
|
+
var import_react76 = require("react");
|
|
34493
34503
|
var isSameDeps = (deps, prevDeps) => {
|
|
34494
34504
|
return deps.every((dep, index) => dep === prevDeps[index]);
|
|
34495
34505
|
};
|
|
34496
34506
|
var useEffectWhenSameDeps = (callback, deps) => {
|
|
34497
|
-
const depsRef = (0,
|
|
34507
|
+
const depsRef = (0, import_react76.useRef)(deps);
|
|
34498
34508
|
const sameDeps = isSameDeps(deps, depsRef.current);
|
|
34499
|
-
const isInitialRef = (0,
|
|
34509
|
+
const isInitialRef = (0, import_react76.useRef)(true);
|
|
34500
34510
|
depsRef.current = deps;
|
|
34501
|
-
const effectDepsRef = (0,
|
|
34511
|
+
const effectDepsRef = (0, import_react76.useRef)(["same"]);
|
|
34502
34512
|
const effectDeps = sameDeps ? [Date.now()] : effectDepsRef.current;
|
|
34503
34513
|
effectDepsRef.current = effectDeps;
|
|
34504
|
-
const callbackRef = (0,
|
|
34514
|
+
const callbackRef = (0, import_react76.useRef)(callback);
|
|
34505
34515
|
callbackRef.current = callback;
|
|
34506
|
-
(0,
|
|
34516
|
+
(0, import_react76.useEffect)(() => {
|
|
34507
34517
|
if (isInitialRef.current) {
|
|
34508
34518
|
isInitialRef.current = false;
|
|
34509
34519
|
return;
|
|
@@ -34513,7 +34523,7 @@ var useEffectWhenSameDeps = (callback, deps) => {
|
|
|
34513
34523
|
};
|
|
34514
34524
|
|
|
34515
34525
|
// src/components/hooks/useEffectWhen.ts
|
|
34516
|
-
var
|
|
34526
|
+
var import_react77 = require("react");
|
|
34517
34527
|
var isSameDeps2 = (deps, prevDeps, compare) => {
|
|
34518
34528
|
return deps.every((dep, index) => {
|
|
34519
34529
|
if (compare) {
|
|
@@ -34524,26 +34534,26 @@ var isSameDeps2 = (deps, prevDeps, compare) => {
|
|
|
34524
34534
|
};
|
|
34525
34535
|
var useEffectWhen = (callback, options) => {
|
|
34526
34536
|
const { same: depsForSame, different: depsForDifferent, compare } = options;
|
|
34527
|
-
const sameDepsRef = (0,
|
|
34528
|
-
const differentDepsRef = (0,
|
|
34537
|
+
const sameDepsRef = (0, import_react77.useRef)(depsForSame);
|
|
34538
|
+
const differentDepsRef = (0, import_react77.useRef)(depsForDifferent);
|
|
34529
34539
|
const sameRespected = isSameDeps2(depsForSame, sameDepsRef.current, compare);
|
|
34530
34540
|
const differentRespected = !isSameDeps2(
|
|
34531
34541
|
depsForDifferent,
|
|
34532
34542
|
differentDepsRef.current,
|
|
34533
34543
|
compare
|
|
34534
34544
|
);
|
|
34535
|
-
const isInitialRef = (0,
|
|
34545
|
+
const isInitialRef = (0, import_react77.useRef)(true);
|
|
34536
34546
|
sameDepsRef.current = depsForSame;
|
|
34537
34547
|
differentDepsRef.current = depsForDifferent;
|
|
34538
|
-
const effectDepsRef = (0,
|
|
34548
|
+
const effectDepsRef = (0, import_react77.useRef)(["same"]);
|
|
34539
34549
|
const effectDeps = sameRespected && differentRespected ? [Date.now()] : effectDepsRef.current;
|
|
34540
34550
|
effectDepsRef.current = effectDeps;
|
|
34541
|
-
const callbackRef = (0,
|
|
34551
|
+
const callbackRef = (0, import_react77.useRef)(callback);
|
|
34542
34552
|
callbackRef.current = callback;
|
|
34543
34553
|
if (sameRespected && differentRespected) {
|
|
34544
34554
|
isInitialRef.current = false;
|
|
34545
34555
|
}
|
|
34546
|
-
(0,
|
|
34556
|
+
(0, import_react77.useEffect)(() => {
|
|
34547
34557
|
if (isInitialRef.current) {
|
|
34548
34558
|
return;
|
|
34549
34559
|
}
|
|
@@ -34657,11 +34667,11 @@ var FlashingColumnCell = createFlashingColumnCellComponent();
|
|
|
34657
34667
|
|
|
34658
34668
|
// src/components/HeadlessTable/MatrixDebugger.tsx
|
|
34659
34669
|
var React83 = __toESM(require("react"));
|
|
34660
|
-
var
|
|
34670
|
+
var import_react78 = require("react");
|
|
34661
34671
|
var import_react_dom4 = require("react-dom");
|
|
34662
34672
|
function INTERNAL_MatrixDebugger(props) {
|
|
34663
34673
|
const [getState, setGetState] = React83.useState(null);
|
|
34664
|
-
(0,
|
|
34674
|
+
(0, import_react78.useEffect)(() => {
|
|
34665
34675
|
const { debugTarget } = props;
|
|
34666
34676
|
const intervalId = setInterval(() => {
|
|
34667
34677
|
if (globalThis.INFINITE && globalThis.INFINITE[debugTarget]) {
|
|
@@ -34684,7 +34694,7 @@ function MatrixDebuggerUI() {
|
|
|
34684
34694
|
const { getState } = contextValue;
|
|
34685
34695
|
const [, rerender] = useRerender();
|
|
34686
34696
|
const cellManager = getState().renderer.cellManager;
|
|
34687
|
-
(0,
|
|
34697
|
+
(0, import_react78.useEffect)(() => {
|
|
34688
34698
|
const delayedRerender = debounce(
|
|
34689
34699
|
() => {
|
|
34690
34700
|
console.log("rerender");
|
|
@@ -34696,8 +34706,8 @@ function MatrixDebuggerUI() {
|
|
|
34696
34706
|
}, [cellManager, rerender]);
|
|
34697
34707
|
const rowIndexes = cellManager.getRowsWithCells();
|
|
34698
34708
|
const columnsIndexes = cellManager.getColumnsWithCells();
|
|
34699
|
-
const domRef = (0,
|
|
34700
|
-
const displayTimeoutRef = (0,
|
|
34709
|
+
const domRef = (0, import_react78.useRef)(null);
|
|
34710
|
+
const displayTimeoutRef = (0, import_react78.useRef)(null);
|
|
34701
34711
|
return /* @__PURE__ */ React83.createElement("div", { style: { overflow: "auto" } }, (0, import_react_dom4.createPortal)(
|
|
34702
34712
|
/* @__PURE__ */ React83.createElement(
|
|
34703
34713
|
"div",
|