@procore/data-table 14.13.0 → 14.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/legacy/index.cjs +160 -20
- package/dist/legacy/index.d.cts +9 -0
- package/dist/legacy/index.d.ts +9 -0
- package/dist/legacy/index.js +160 -20
- package/dist/modern/index.cjs +147 -9
- package/dist/modern/index.d.cts +9 -0
- package/dist/modern/index.d.ts +9 -0
- package/dist/modern/index.js +147 -9
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 14.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f15455d4a3: Add Expand/Collapse state persistence
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 1375fc5db2: Fix removeEventListener when unmounting GenericHeader
|
|
12
|
+
- f41092bb36: `Pill` no longer converts text to uppercase by default. Customization must be done manually using `pillOptions`
|
|
13
|
+
- cb8844fbdd: Fix issue with selected rows on ClientSide after Searching
|
|
14
|
+
|
|
3
15
|
## 14.13.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/legacy/index.cjs
CHANGED
|
@@ -53436,7 +53436,7 @@ var Renderer9 = ({
|
|
|
53436
53436
|
if (isGroup || rowPinned && columnDefinition.aggFunc) {
|
|
53437
53437
|
return /* @__PURE__ */ React76__default.default.createElement(coreReact.Typography, { ...typographyProps, weight: "semibold" }, label);
|
|
53438
53438
|
}
|
|
53439
|
-
return /* @__PURE__ */ React76__default.default.createElement(coreReact.Pill, { color: getColor(value), className: cx10("pill-cell") }, label
|
|
53439
|
+
return /* @__PURE__ */ React76__default.default.createElement(coreReact.Pill, { color: getColor(value), className: cx10("pill-cell") }, label);
|
|
53440
53440
|
};
|
|
53441
53441
|
var PillCellRenderer = withDataTableRenderer(Renderer9, "select");
|
|
53442
53442
|
var Editor5 = React76__default.default.forwardRef(
|
|
@@ -53473,7 +53473,7 @@ var Editor5 = React76__default.default.forwardRef(
|
|
|
53473
53473
|
function getLabel3(item) {
|
|
53474
53474
|
var _a2;
|
|
53475
53475
|
const unformattedLabel = ((_a2 = columnDefinition.getStringFormattedValue) == null ? void 0 : _a2.call(columnDefinition, item)) || "";
|
|
53476
|
-
return unformattedLabel
|
|
53476
|
+
return unformattedLabel;
|
|
53477
53477
|
}
|
|
53478
53478
|
return /* @__PURE__ */ React76__default.default.createElement(
|
|
53479
53479
|
coreReact.PillSelect,
|
|
@@ -56625,9 +56625,10 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56625
56625
|
props.api.addEventListener("columnRowGroupChanged", updateExpandedState);
|
|
56626
56626
|
return () => {
|
|
56627
56627
|
props.column.removeEventListener("sortChanged", onSortChanged);
|
|
56628
|
-
|
|
56628
|
+
removeEventListenerFromGrid(
|
|
56629
56629
|
"columnRowGroupChanged",
|
|
56630
|
-
updateExpandedState
|
|
56630
|
+
updateExpandedState,
|
|
56631
|
+
props.api
|
|
56631
56632
|
);
|
|
56632
56633
|
};
|
|
56633
56634
|
}, [props.column]);
|
|
@@ -57722,6 +57723,7 @@ var InternalTableContext = React76__default.default.createContext({
|
|
|
57722
57723
|
getRowHeight: () => () => rowSize.md,
|
|
57723
57724
|
grandTotalsLabelInnerRenderer: void 0,
|
|
57724
57725
|
gridApi: void 0,
|
|
57726
|
+
localStoragePersistenceKey: void 0,
|
|
57725
57727
|
onBulkEditUpdate: () => Promise.resolve(),
|
|
57726
57728
|
onServerSideDataRequest: void 0,
|
|
57727
57729
|
onTableConfigChange: () => {
|
|
@@ -57738,6 +57740,7 @@ var InternalTableContext = React76__default.default.createContext({
|
|
|
57738
57740
|
setRowHeight: () => {
|
|
57739
57741
|
},
|
|
57740
57742
|
showExpandCollapseAllToggle: false,
|
|
57743
|
+
expandCollapseStateRef: null,
|
|
57741
57744
|
tableRef: null,
|
|
57742
57745
|
getColumnDefinition: () => void 0,
|
|
57743
57746
|
setSelectedGroupIndex: () => {
|
|
@@ -78185,6 +78188,63 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
|
|
|
78185
78188
|
};
|
|
78186
78189
|
};
|
|
78187
78190
|
|
|
78191
|
+
// src/utils/expandRows.ts
|
|
78192
|
+
var getGroupRowState = (gridApi, groupDefaultExpanded = 0) => {
|
|
78193
|
+
const expandedRoutes = [];
|
|
78194
|
+
const collapsedRoutes = [];
|
|
78195
|
+
if (gridApi) {
|
|
78196
|
+
gridApi.forEachNode((node) => {
|
|
78197
|
+
const route = node.getRoute();
|
|
78198
|
+
if (route) {
|
|
78199
|
+
const routePath = route.join(",");
|
|
78200
|
+
const defaultExpandLevel = groupDefaultExpanded === -1 ? Infinity : groupDefaultExpanded;
|
|
78201
|
+
if (node.level > defaultExpandLevel - 1) {
|
|
78202
|
+
if (node.expanded) {
|
|
78203
|
+
expandedRoutes.push(routePath);
|
|
78204
|
+
}
|
|
78205
|
+
} else if (!node.expanded) {
|
|
78206
|
+
collapsedRoutes.push(routePath);
|
|
78207
|
+
}
|
|
78208
|
+
}
|
|
78209
|
+
});
|
|
78210
|
+
}
|
|
78211
|
+
return { expandedRoutes, collapsedRoutes };
|
|
78212
|
+
};
|
|
78213
|
+
var setExpandCollapseRow = (gridApi, tableConfig, groupDefaultExpanded = 0) => {
|
|
78214
|
+
var _a, _b;
|
|
78215
|
+
const expandedRoutes = ((_a = tableConfig.groupRowState) == null ? void 0 : _a.expandedRoutes) ?? [];
|
|
78216
|
+
const collapsedRoutes = ((_b = tableConfig.groupRowState) == null ? void 0 : _b.collapsedRoutes) ?? [];
|
|
78217
|
+
gridApi.forEachNode((node) => {
|
|
78218
|
+
const route = node.getRoute();
|
|
78219
|
+
if (route) {
|
|
78220
|
+
const routePath = route.join(",");
|
|
78221
|
+
const defaultExpandLevel = groupDefaultExpanded === -1 ? Infinity : groupDefaultExpanded;
|
|
78222
|
+
if (node.level > defaultExpandLevel - 1) {
|
|
78223
|
+
if (expandedRoutes.includes(routePath)) {
|
|
78224
|
+
node.setExpanded(true);
|
|
78225
|
+
}
|
|
78226
|
+
} else if (collapsedRoutes.includes(routePath)) {
|
|
78227
|
+
node.setExpanded(false);
|
|
78228
|
+
}
|
|
78229
|
+
}
|
|
78230
|
+
});
|
|
78231
|
+
};
|
|
78232
|
+
var isRowOpenedByDefault = (node, tableConfig, groupDefaultExpanded = 0) => {
|
|
78233
|
+
var _a, _b;
|
|
78234
|
+
const expandedRoutes = ((_a = tableConfig == null ? void 0 : tableConfig.groupRowState) == null ? void 0 : _a.expandedRoutes) ?? [];
|
|
78235
|
+
const collapsedRoutes = ((_b = tableConfig == null ? void 0 : tableConfig.groupRowState) == null ? void 0 : _b.collapsedRoutes) ?? [];
|
|
78236
|
+
const route = node.getRoute();
|
|
78237
|
+
if (!route) {
|
|
78238
|
+
return false;
|
|
78239
|
+
}
|
|
78240
|
+
const routePath = route.join(",");
|
|
78241
|
+
const defaultExpandLevel = groupDefaultExpanded === -1 ? Infinity : groupDefaultExpanded;
|
|
78242
|
+
if (node.level > defaultExpandLevel - 1) {
|
|
78243
|
+
return expandedRoutes.includes(routePath);
|
|
78244
|
+
} else
|
|
78245
|
+
return !collapsedRoutes.includes(routePath);
|
|
78246
|
+
};
|
|
78247
|
+
|
|
78188
78248
|
// src/utils/getRootRowNode.ts
|
|
78189
78249
|
function getRootRowNode(rowNode) {
|
|
78190
78250
|
return rowNode.level > 0 && rowNode.parent ? getRootRowNode(rowNode.parent) : rowNode;
|
|
@@ -80707,6 +80767,7 @@ var useTableApi = ({
|
|
|
80707
80767
|
columnApi,
|
|
80708
80768
|
columnDefinitions,
|
|
80709
80769
|
gridApi,
|
|
80770
|
+
groupDefaultExpanded,
|
|
80710
80771
|
setLoadingStatus,
|
|
80711
80772
|
wrapperRef
|
|
80712
80773
|
}) => {
|
|
@@ -80900,10 +80961,33 @@ var useTableApi = ({
|
|
|
80900
80961
|
const setSearchValue = React76__default.default.useCallback(
|
|
80901
80962
|
(value) => {
|
|
80902
80963
|
gridApi == null ? void 0 : gridApi.setQuickFilter(value);
|
|
80964
|
+
gridApi == null ? void 0 : gridApi.forEachNodeAfterFilterAndSort((node) => {
|
|
80965
|
+
if (node.id) {
|
|
80966
|
+
const currentNode = rowSelectionRef == null ? void 0 : rowSelectionRef.current.affectedRows[node.id];
|
|
80967
|
+
if (currentNode && currentNode.selectedState === rowSelectionState.selected) {
|
|
80968
|
+
node.setSelected(true, false, "checkboxSelected");
|
|
80969
|
+
}
|
|
80970
|
+
}
|
|
80971
|
+
});
|
|
80903
80972
|
resetPagination();
|
|
80973
|
+
gridApi == null ? void 0 : gridApi.redrawRows();
|
|
80904
80974
|
},
|
|
80905
|
-
[gridApi]
|
|
80975
|
+
[gridApi, rowSelectionRef.current]
|
|
80906
80976
|
);
|
|
80977
|
+
React76__default.default.useEffect(() => {
|
|
80978
|
+
function handleRowSelection(event) {
|
|
80979
|
+
if (event.node.displayed && event.node.id) {
|
|
80980
|
+
rowSelectionRef.current.affectedRows[event.node.id] = {
|
|
80981
|
+
node: event.node,
|
|
80982
|
+
selectedState: event.node.isSelected() ? rowSelectionState.selected : rowSelectionState.unselected
|
|
80983
|
+
};
|
|
80984
|
+
}
|
|
80985
|
+
}
|
|
80986
|
+
(gridApi == null ? void 0 : gridApi.addEventListener) && gridApi.addEventListener("rowSelected", handleRowSelection);
|
|
80987
|
+
return () => {
|
|
80988
|
+
removeEventListenerFromGrid("rowSelected", handleRowSelection, gridApi);
|
|
80989
|
+
};
|
|
80990
|
+
}, [gridApi]);
|
|
80907
80991
|
const setLoading = React76__default.default.useCallback((loading, message = "") => {
|
|
80908
80992
|
setLoadingStatus({
|
|
80909
80993
|
loading,
|
|
@@ -80965,6 +81049,7 @@ var useTableApi = ({
|
|
|
80965
81049
|
adjustRowDragIcon(gridApi, columnApi);
|
|
80966
81050
|
});
|
|
80967
81051
|
}
|
|
81052
|
+
setExpandCollapseRow(gridApi, config, groupDefaultExpanded);
|
|
80968
81053
|
},
|
|
80969
81054
|
[columnApi, gridApi, internalSetRowHeight, filterStorage.setSelectedFilters]
|
|
80970
81055
|
);
|
|
@@ -81058,7 +81143,8 @@ var useTableApi = ({
|
|
|
81058
81143
|
columnApi,
|
|
81059
81144
|
rowHeight,
|
|
81060
81145
|
filterStorage,
|
|
81061
|
-
rowSelectionRef
|
|
81146
|
+
rowSelectionRef,
|
|
81147
|
+
groupDefaultExpanded
|
|
81062
81148
|
}),
|
|
81063
81149
|
[columnApi, gridApi, rowHeight, filterStorage]
|
|
81064
81150
|
);
|
|
@@ -81332,7 +81418,6 @@ function buildPartialTableApi({
|
|
|
81332
81418
|
focusField && (gridApi == null ? void 0 : gridApi.setFocusedCell(rowIndex, focusField));
|
|
81333
81419
|
};
|
|
81334
81420
|
return {
|
|
81335
|
-
getVisibleRowNodes,
|
|
81336
81421
|
applyTransaction,
|
|
81337
81422
|
applyServerSideTransaction,
|
|
81338
81423
|
collapseAll,
|
|
@@ -81347,6 +81432,7 @@ function buildPartialTableApi({
|
|
|
81347
81432
|
getSelectedRows: getSelectedRows2,
|
|
81348
81433
|
getServerSideSelectionState,
|
|
81349
81434
|
getTableConfiguration,
|
|
81435
|
+
getVisibleRowNodes,
|
|
81350
81436
|
refreshCells,
|
|
81351
81437
|
setPinnedBottomRowData,
|
|
81352
81438
|
setRowData,
|
|
@@ -81464,6 +81550,12 @@ var DataTable = ({
|
|
|
81464
81550
|
const [rowHeight, setRowHeight] = React76__default.default.useState(
|
|
81465
81551
|
(initialTableConfig == null ? void 0 : initialTableConfig.rowHeight) || rowSize.md
|
|
81466
81552
|
);
|
|
81553
|
+
const expandCollapseStateRef = React76__default.default.useRef(
|
|
81554
|
+
(initialTableConfig == null ? void 0 : initialTableConfig.groupRowState) || {
|
|
81555
|
+
expandedRoutes: [],
|
|
81556
|
+
collapsedRoutes: []
|
|
81557
|
+
}
|
|
81558
|
+
);
|
|
81467
81559
|
const rowHeightRef = React76__default.default.useRef(
|
|
81468
81560
|
(initialTableConfig == null ? void 0 : initialTableConfig.rowHeight) || rowSize.md
|
|
81469
81561
|
);
|
|
@@ -81511,12 +81603,14 @@ var DataTable = ({
|
|
|
81511
81603
|
if (localStoragePersistenceKey) {
|
|
81512
81604
|
webSdkStorage.storage.local.setItem(localStoragePersistenceKey, {
|
|
81513
81605
|
...config,
|
|
81606
|
+
groupRowState: expandCollapseStateRef.current,
|
|
81514
81607
|
rowHeight: rowHeightRef.current,
|
|
81515
81608
|
serverFilters: filterStorage.filtersState
|
|
81516
81609
|
});
|
|
81517
81610
|
}
|
|
81518
81611
|
onTableConfigChange == null ? void 0 : onTableConfigChange({
|
|
81519
81612
|
...config,
|
|
81613
|
+
groupRowState: expandCollapseStateRef.current,
|
|
81520
81614
|
rowHeight: rowHeightRef.current,
|
|
81521
81615
|
serverFilters: filterStorage.filtersState
|
|
81522
81616
|
});
|
|
@@ -81627,6 +81721,7 @@ var DataTable = ({
|
|
|
81627
81721
|
onServerSideDataRequest,
|
|
81628
81722
|
onTableConfigChange: internalOnTableConfigChange,
|
|
81629
81723
|
rowSelectionRef,
|
|
81724
|
+
expandCollapseStateRef,
|
|
81630
81725
|
rowHeight,
|
|
81631
81726
|
searchStorage,
|
|
81632
81727
|
selectedGroupIndex,
|
|
@@ -81687,7 +81782,7 @@ function getServerSideDatasource(onServerSideDataRequestCallbackRef, onEmptyResp
|
|
|
81687
81782
|
}
|
|
81688
81783
|
var minimumColumnWidth = 140;
|
|
81689
81784
|
var Table = (props) => {
|
|
81690
|
-
var _a, _b;
|
|
81785
|
+
var _a, _b, _c;
|
|
81691
81786
|
const { suppressColumnVirtualisation = true, rowActionsConfig = {} } = props;
|
|
81692
81787
|
const I18n = coreReact.useI18nContext();
|
|
81693
81788
|
const internalTableContext = useInternalTableContext();
|
|
@@ -81729,8 +81824,10 @@ var Table = (props) => {
|
|
|
81729
81824
|
columnDefinitions: internalTableContext.columnDefinitions,
|
|
81730
81825
|
gridApi,
|
|
81731
81826
|
setLoadingStatus,
|
|
81732
|
-
wrapperRef
|
|
81827
|
+
wrapperRef,
|
|
81828
|
+
groupDefaultExpanded: props.groupDefaultExpanded
|
|
81733
81829
|
});
|
|
81830
|
+
const initialTableConfig = internalTableContext.initialTableConfig;
|
|
81734
81831
|
React76__default.default.useImperativeHandle(internalTableContext.tableRef, () => tableApi, [
|
|
81735
81832
|
tableApi
|
|
81736
81833
|
]);
|
|
@@ -82044,8 +82141,8 @@ var Table = (props) => {
|
|
|
82044
82141
|
);
|
|
82045
82142
|
const onColumnGroupOpened = React76__default.default.useCallback(
|
|
82046
82143
|
(event) => {
|
|
82047
|
-
var _a2, _b2,
|
|
82048
|
-
(
|
|
82144
|
+
var _a2, _b2, _c2;
|
|
82145
|
+
(_c2 = internalTableContext.analytics) == null ? void 0 : _c2.client.addEvent(
|
|
82049
82146
|
"design_system.data_table.column.expand_toggled",
|
|
82050
82147
|
{
|
|
82051
82148
|
client: internalTableContext.analytics.clientName,
|
|
@@ -82062,14 +82159,14 @@ var Table = (props) => {
|
|
|
82062
82159
|
);
|
|
82063
82160
|
const onColumnPinned = React76__default.default.useCallback(
|
|
82064
82161
|
(event) => {
|
|
82065
|
-
var _a2, _b2,
|
|
82162
|
+
var _a2, _b2, _c2, _d;
|
|
82066
82163
|
(_d = internalTableContext.analytics) == null ? void 0 : _d.client.addEvent(
|
|
82067
82164
|
"design_system.data_table.column.pinned",
|
|
82068
82165
|
{
|
|
82069
82166
|
client: internalTableContext.analytics.clientName,
|
|
82070
82167
|
column: (_a2 = event.column) == null ? void 0 : _a2.getColId(),
|
|
82071
82168
|
side: (_b2 = event.column) == null ? void 0 : _b2.getPinned(),
|
|
82072
|
-
position: (
|
|
82169
|
+
position: (_c2 = columnApi == null ? void 0 : columnApi.getColumns()) == null ? void 0 : _c2.findIndex(
|
|
82073
82170
|
(col) => {
|
|
82074
82171
|
var _a3;
|
|
82075
82172
|
return col.getId() === ((_a3 = event.column) == null ? void 0 : _a3.getColId());
|
|
@@ -82168,7 +82265,7 @@ var Table = (props) => {
|
|
|
82168
82265
|
const onDragStopped = React76__default.default.useCallback(
|
|
82169
82266
|
// eslint-disable-next-line complexity
|
|
82170
82267
|
(event) => {
|
|
82171
|
-
var _a2, _b2,
|
|
82268
|
+
var _a2, _b2, _c2;
|
|
82172
82269
|
if (event.target.className.includes("ag-header-cell")) {
|
|
82173
82270
|
internalTableContext.onTableConfigChange();
|
|
82174
82271
|
}
|
|
@@ -82186,7 +82283,7 @@ var Table = (props) => {
|
|
|
82186
82283
|
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
82187
82284
|
(col) => col.isVisible()
|
|
82188
82285
|
);
|
|
82189
|
-
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || ((
|
|
82286
|
+
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || ((_c2 = moveColumnEvent.column) == null ? void 0 : _c2.getColDef().rowDrag)) {
|
|
82190
82287
|
adjustRowDragIcon(event.api, event.columnApi);
|
|
82191
82288
|
}
|
|
82192
82289
|
}
|
|
@@ -82265,27 +82362,55 @@ var Table = (props) => {
|
|
|
82265
82362
|
(_a2 = document.getElementsByClassName("ag-body-viewport")[0]) == null ? void 0 : _a2.clientWidth
|
|
82266
82363
|
);
|
|
82267
82364
|
}, [setViewportWidth]);
|
|
82365
|
+
const isClientSideGroupOpenByDefault = React76__default.default.useCallback(
|
|
82366
|
+
(params) => {
|
|
82367
|
+
const node = params.rowNode;
|
|
82368
|
+
if (!node) {
|
|
82369
|
+
return false;
|
|
82370
|
+
}
|
|
82371
|
+
return isRowOpenedByDefault(
|
|
82372
|
+
node,
|
|
82373
|
+
initialTableConfig,
|
|
82374
|
+
props.groupsAlwaysExpanded ? -1 : props.groupDefaultExpanded
|
|
82375
|
+
);
|
|
82376
|
+
},
|
|
82377
|
+
[initialTableConfig, props.groupDefaultExpanded]
|
|
82378
|
+
);
|
|
82379
|
+
const isServerSideGroupOpenByDefault = React76__default.default.useCallback(
|
|
82380
|
+
(params) => {
|
|
82381
|
+
const node = params.rowNode;
|
|
82382
|
+
if (!node) {
|
|
82383
|
+
return false;
|
|
82384
|
+
}
|
|
82385
|
+
return isRowOpenedByDefault(
|
|
82386
|
+
node,
|
|
82387
|
+
initialTableConfig,
|
|
82388
|
+
props.groupsAlwaysExpanded ? -1 : props.groupDefaultExpanded
|
|
82389
|
+
);
|
|
82390
|
+
},
|
|
82391
|
+
[initialTableConfig, props.groupDefaultExpanded]
|
|
82392
|
+
);
|
|
82268
82393
|
const onGridReady = (params) => {
|
|
82269
|
-
var _a2, _b2,
|
|
82394
|
+
var _a2, _b2, _c2;
|
|
82270
82395
|
internalTableContext.setGridApi(params.api);
|
|
82271
82396
|
internalTableContext.setColumnApi(params.columnApi);
|
|
82272
82397
|
setViewportWidth(
|
|
82273
82398
|
(_a2 = document.getElementsByClassName("ag-body-viewport")[0]) == null ? void 0 : _a2.clientWidth
|
|
82274
82399
|
);
|
|
82275
|
-
(
|
|
82400
|
+
(_c2 = (_b2 = props.UNSAFE_internalAGGridOverrides) == null ? void 0 : _b2.onGridReady) == null ? void 0 : _c2.call(_b2, params);
|
|
82276
82401
|
};
|
|
82277
82402
|
const postProcessPopup = (params) => {
|
|
82278
82403
|
params.ePopup.style.top = `${HEADER_HEIGHT}px`;
|
|
82279
82404
|
};
|
|
82280
82405
|
const internalOnRowSelected = (event) => {
|
|
82281
|
-
var _a2, _b2,
|
|
82406
|
+
var _a2, _b2, _c2;
|
|
82282
82407
|
(_a2 = props.onRowSelected) == null ? void 0 : _a2.call(props, event);
|
|
82283
82408
|
if (props.siblingGroupsRowSelectionDisabled) {
|
|
82284
82409
|
const rootRowNode = getRootRowNode(event.node);
|
|
82285
82410
|
if (!event.node.isSelected() && internalTableContext.selectedGroupIndex !== null && (rootRowNode == null ? void 0 : rootRowNode.id) === internalTableContext.selectedGroupIndex && event.api.getSelectedNodes().length === 0) {
|
|
82286
82411
|
(_b2 = internalTableContext == null ? void 0 : internalTableContext.setSelectedGroupIndex) == null ? void 0 : _b2.call(internalTableContext, null);
|
|
82287
82412
|
} else {
|
|
82288
|
-
(
|
|
82413
|
+
(_c2 = internalTableContext == null ? void 0 : internalTableContext.setSelectedGroupIndex) == null ? void 0 : _c2.call(internalTableContext, (prevState) => {
|
|
82289
82414
|
return prevState ?? (rootRowNode == null ? void 0 : rootRowNode.id) ?? null;
|
|
82290
82415
|
});
|
|
82291
82416
|
}
|
|
@@ -82294,13 +82419,26 @@ var Table = (props) => {
|
|
|
82294
82419
|
const internalRowGroupOpened = React76__default.default.useCallback(
|
|
82295
82420
|
(event) => {
|
|
82296
82421
|
var _a2;
|
|
82422
|
+
if (internalTableContext.expandCollapseStateRef) {
|
|
82423
|
+
internalTableContext.expandCollapseStateRef.current = getGroupRowState(
|
|
82424
|
+
gridApi,
|
|
82425
|
+
props.groupDefaultExpanded
|
|
82426
|
+
);
|
|
82427
|
+
}
|
|
82428
|
+
internalTableContext.onTableConfigChange();
|
|
82297
82429
|
(_a2 = props.onRowGroupOpened) == null ? void 0 : _a2.call(props, {
|
|
82298
82430
|
expanded: event.expanded,
|
|
82299
82431
|
node: serializeNode(event.node),
|
|
82300
82432
|
rowIndex: event.rowIndex
|
|
82301
82433
|
});
|
|
82302
82434
|
},
|
|
82303
|
-
[
|
|
82435
|
+
[
|
|
82436
|
+
props.onRowGroupOpened,
|
|
82437
|
+
internalTableContext.onTableConfigChange,
|
|
82438
|
+
tableApi == null ? void 0 : tableApi.getTableConfiguration(),
|
|
82439
|
+
(_c = internalTableContext.expandCollapseStateRef) == null ? void 0 : _c.current,
|
|
82440
|
+
gridApi
|
|
82441
|
+
]
|
|
82304
82442
|
);
|
|
82305
82443
|
const getGroupRowAgg = React76__default.default.useCallback(
|
|
82306
82444
|
(params) => {
|
|
@@ -82453,6 +82591,8 @@ var Table = (props) => {
|
|
|
82453
82591
|
alwaysAggregateAtRootLevel: !onSSDR,
|
|
82454
82592
|
autoGroupColumnDef: decoratedAutoGroupColDef,
|
|
82455
82593
|
cacheBlockSize: props.paginationPageSize || defaultPaginationPageSize,
|
|
82594
|
+
isGroupOpenByDefault: isClientSideGroupOpenByDefault,
|
|
82595
|
+
isServerSideGroupOpenByDefault,
|
|
82456
82596
|
defaultColDef,
|
|
82457
82597
|
enableGroupEdit: internalTableContext.enableGroupEditAndValidation,
|
|
82458
82598
|
enableCellTextSelection: internalTableContext.enableCellTextSelection,
|
package/dist/legacy/index.d.cts
CHANGED
|
@@ -792,6 +792,10 @@ interface DataTableConfig {
|
|
|
792
792
|
} | undefined;
|
|
793
793
|
rowHeight?: RowSize;
|
|
794
794
|
serverFilters?: IServerFilter[];
|
|
795
|
+
groupRowState?: {
|
|
796
|
+
expandedRoutes: string[];
|
|
797
|
+
collapsedRoutes: string[];
|
|
798
|
+
};
|
|
795
799
|
}
|
|
796
800
|
interface HTMLStringExportConfig {
|
|
797
801
|
header?: React.FunctionComponent;
|
|
@@ -1308,6 +1312,7 @@ interface InternalTableContext {
|
|
|
1308
1312
|
onBulkEditUpdate: DataTableProps['onBulkEditUpdate'];
|
|
1309
1313
|
onServerSideDataRequest?: DataTableProps['onServerSideDataRequest'];
|
|
1310
1314
|
updateServerSideDataSource: (params: UpdateServerSideDataSourceParams) => void;
|
|
1315
|
+
localStoragePersistenceKey?: string;
|
|
1311
1316
|
onTableConfigChange: () => void;
|
|
1312
1317
|
rowHeight: RowSize;
|
|
1313
1318
|
rowSelectionRef?: React__default.MutableRefObject<RowSelectionRef>;
|
|
@@ -1317,6 +1322,10 @@ interface InternalTableContext {
|
|
|
1317
1322
|
setGridApi: (gridApi: GridApi) => void;
|
|
1318
1323
|
setRowHeight: (rowHeight: RowSize, createTrackEvent?: boolean, triggerTableConfigChange?: boolean) => void;
|
|
1319
1324
|
showExpandCollapseAllToggle: boolean;
|
|
1325
|
+
expandCollapseStateRef: React__default.MutableRefObject<{
|
|
1326
|
+
expandedRoutes: string[];
|
|
1327
|
+
collapsedRoutes: string[];
|
|
1328
|
+
}> | null;
|
|
1320
1329
|
tableRef: React__default.RefObject<TableApi> | null;
|
|
1321
1330
|
getColumnDefinition: (field: string) => ColumnDefinition | undefined;
|
|
1322
1331
|
totalRowCount: number;
|
package/dist/legacy/index.d.ts
CHANGED
|
@@ -792,6 +792,10 @@ interface DataTableConfig {
|
|
|
792
792
|
} | undefined;
|
|
793
793
|
rowHeight?: RowSize;
|
|
794
794
|
serverFilters?: IServerFilter[];
|
|
795
|
+
groupRowState?: {
|
|
796
|
+
expandedRoutes: string[];
|
|
797
|
+
collapsedRoutes: string[];
|
|
798
|
+
};
|
|
795
799
|
}
|
|
796
800
|
interface HTMLStringExportConfig {
|
|
797
801
|
header?: React.FunctionComponent;
|
|
@@ -1308,6 +1312,7 @@ interface InternalTableContext {
|
|
|
1308
1312
|
onBulkEditUpdate: DataTableProps['onBulkEditUpdate'];
|
|
1309
1313
|
onServerSideDataRequest?: DataTableProps['onServerSideDataRequest'];
|
|
1310
1314
|
updateServerSideDataSource: (params: UpdateServerSideDataSourceParams) => void;
|
|
1315
|
+
localStoragePersistenceKey?: string;
|
|
1311
1316
|
onTableConfigChange: () => void;
|
|
1312
1317
|
rowHeight: RowSize;
|
|
1313
1318
|
rowSelectionRef?: React__default.MutableRefObject<RowSelectionRef>;
|
|
@@ -1317,6 +1322,10 @@ interface InternalTableContext {
|
|
|
1317
1322
|
setGridApi: (gridApi: GridApi) => void;
|
|
1318
1323
|
setRowHeight: (rowHeight: RowSize, createTrackEvent?: boolean, triggerTableConfigChange?: boolean) => void;
|
|
1319
1324
|
showExpandCollapseAllToggle: boolean;
|
|
1325
|
+
expandCollapseStateRef: React__default.MutableRefObject<{
|
|
1326
|
+
expandedRoutes: string[];
|
|
1327
|
+
collapsedRoutes: string[];
|
|
1328
|
+
}> | null;
|
|
1320
1329
|
tableRef: React__default.RefObject<TableApi> | null;
|
|
1321
1330
|
getColumnDefinition: (field: string) => ColumnDefinition | undefined;
|
|
1322
1331
|
totalRowCount: number;
|