@procore/data-table 14.40.0 → 14.42.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 +18 -0
- package/dist/legacy/index.cjs +80 -52
- package/dist/legacy/index.d.cts +4 -0
- package/dist/legacy/index.d.ts +4 -0
- package/dist/legacy/index.js +80 -52
- package/dist/modern/index.cjs +79 -51
- package/dist/modern/index.d.cts +4 -0
- package/dist/modern/index.d.ts +4 -0
- package/dist/modern/index.js +79 -51
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 14.42.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 433e594: Add a callOnRowDragEndAfterLeave prop to know where rows are moved if the user drags a row outside the table
|
|
8
|
+
|
|
9
|
+
## 14.41.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- f1804f1: Support using required and optional groups at the same time
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 83c2765: Fixed variable name conflicting with type name that leads to an error on storybook.
|
|
18
|
+
- Updated dependencies [27c6ad8]
|
|
19
|
+
- @procore/toast-alert@5.1.2
|
|
20
|
+
|
|
3
21
|
## 14.40.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/dist/legacy/index.cjs
CHANGED
|
@@ -103539,13 +103539,13 @@ var BulkEditInput = (props) => {
|
|
|
103539
103539
|
);
|
|
103540
103540
|
case "peopleMultiSelect":
|
|
103541
103541
|
const {
|
|
103542
|
-
placeholder:
|
|
103543
|
-
...
|
|
103542
|
+
placeholder: peopleMultiSelectPlaceholder,
|
|
103543
|
+
...peopleMultiSelectParams
|
|
103544
103544
|
} = props.editorParams;
|
|
103545
103545
|
return /* @__PURE__ */ React80__default.default.createElement(
|
|
103546
103546
|
coreReact.Form.MultiSelect,
|
|
103547
103547
|
{
|
|
103548
|
-
...
|
|
103548
|
+
...peopleMultiSelectParams,
|
|
103549
103549
|
beforeShow: getBulkEditorOptions,
|
|
103550
103550
|
colWidth: 12,
|
|
103551
103551
|
"data-qa": `data-table-bulk-edit-input-${props.name}`,
|
|
@@ -103557,7 +103557,7 @@ var BulkEditInput = (props) => {
|
|
|
103557
103557
|
name: field.input.name,
|
|
103558
103558
|
optionRenderer: personOptionRenderer(props.editorParams),
|
|
103559
103559
|
options,
|
|
103560
|
-
placeholder:
|
|
103560
|
+
placeholder: peopleMultiSelectPlaceholder ?? placeholderForField
|
|
103561
103561
|
}
|
|
103562
103562
|
);
|
|
103563
103563
|
case "radio":
|
|
@@ -104497,6 +104497,63 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
|
|
|
104497
104497
|
};
|
|
104498
104498
|
};
|
|
104499
104499
|
|
|
104500
|
+
// src/utils/dragging.ts
|
|
104501
|
+
function handleDragStopped({
|
|
104502
|
+
event,
|
|
104503
|
+
internalTableContext,
|
|
104504
|
+
moveColumnEvent: moveColumnEvent2,
|
|
104505
|
+
rowDragMoveEvent: rowDragMoveEvent2,
|
|
104506
|
+
rowDragEndEvent: rowDragEndEvent2,
|
|
104507
|
+
tableProps
|
|
104508
|
+
}) {
|
|
104509
|
+
var _a, _b, _c;
|
|
104510
|
+
if (event.target.className.includes("ag-header-cell")) {
|
|
104511
|
+
internalTableContext.onTableConfigChange();
|
|
104512
|
+
}
|
|
104513
|
+
if (moveColumnEvent2) {
|
|
104514
|
+
(_b = internalTableContext.analytics) == null ? void 0 : _b.client.addEvent(
|
|
104515
|
+
"design_system.data_table.column.repositioned",
|
|
104516
|
+
{
|
|
104517
|
+
client: internalTableContext.analytics.clientName,
|
|
104518
|
+
column: (_a = moveColumnEvent2.column) == null ? void 0 : _a.getColId(),
|
|
104519
|
+
position: moveColumnEvent2.toIndex
|
|
104520
|
+
}
|
|
104521
|
+
);
|
|
104522
|
+
if (tableProps.onRowDragEnd) {
|
|
104523
|
+
const allColumns = event.columnApi.getAllGridColumns();
|
|
104524
|
+
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
104525
|
+
(col) => col.isVisible()
|
|
104526
|
+
);
|
|
104527
|
+
if (moveColumnEvent2.toIndex === firstVisibleColumnIndex || ((_c = moveColumnEvent2.column) == null ? void 0 : _c.getColDef().rowDrag)) {
|
|
104528
|
+
adjustRowDragIcon(event.api, event.columnApi);
|
|
104529
|
+
}
|
|
104530
|
+
}
|
|
104531
|
+
moveColumnEvent2 = void 0;
|
|
104532
|
+
}
|
|
104533
|
+
if (tableProps.onRowDragEnd && rowDragMoveEvent2) {
|
|
104534
|
+
if (rowDragEndEvent2 && rowDragEndEvent2.overIndex >= 0) {
|
|
104535
|
+
tableProps.onRowDragEnd(
|
|
104536
|
+
rowDragEndEvent2.node.data,
|
|
104537
|
+
rowDragEndEvent2.node.rowIndex,
|
|
104538
|
+
rowDragEndEvent2.node,
|
|
104539
|
+
rowDragEndEvent2.overNode
|
|
104540
|
+
);
|
|
104541
|
+
} else if (tableProps.callOnRowDragEndAfterLeave) {
|
|
104542
|
+
tableProps.onRowDragEnd(
|
|
104543
|
+
rowDragMoveEvent2.node.data,
|
|
104544
|
+
rowDragMoveEvent2.node.rowIndex,
|
|
104545
|
+
rowDragMoveEvent2.node,
|
|
104546
|
+
rowDragMoveEvent2.overNode
|
|
104547
|
+
);
|
|
104548
|
+
}
|
|
104549
|
+
if (tableProps.rows && !tableProps.rowDragManaged) {
|
|
104550
|
+
event.api.setRowData(tableProps.rows);
|
|
104551
|
+
}
|
|
104552
|
+
}
|
|
104553
|
+
rowDragMoveEvent2 = void 0;
|
|
104554
|
+
rowDragEndEvent2 = void 0;
|
|
104555
|
+
}
|
|
104556
|
+
|
|
104500
104557
|
// src/utils/expandRows.ts
|
|
104501
104558
|
function getStringifiedRoute(node) {
|
|
104502
104559
|
var _a;
|
|
@@ -109866,50 +109923,18 @@ var Table = (props) => {
|
|
|
109866
109923
|
}
|
|
109867
109924
|
const onDragStopped = React80__default.default.useCallback(
|
|
109868
109925
|
// eslint-disable-next-line complexity
|
|
109869
|
-
(event) => {
|
|
109870
|
-
|
|
109871
|
-
|
|
109872
|
-
|
|
109873
|
-
|
|
109874
|
-
|
|
109875
|
-
|
|
109876
|
-
|
|
109877
|
-
{
|
|
109878
|
-
client: internalTableContext.analytics.clientName,
|
|
109879
|
-
column: (_a2 = moveColumnEvent.column) == null ? void 0 : _a2.getColId(),
|
|
109880
|
-
position: moveColumnEvent.toIndex
|
|
109881
|
-
}
|
|
109882
|
-
);
|
|
109883
|
-
if (props.onRowDragEnd) {
|
|
109884
|
-
const allColumns = event.columnApi.getAllGridColumns();
|
|
109885
|
-
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
109886
|
-
(col) => col.isVisible()
|
|
109887
|
-
);
|
|
109888
|
-
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || ((_c2 = moveColumnEvent.column) == null ? void 0 : _c2.getColDef().rowDrag)) {
|
|
109889
|
-
adjustRowDragIcon(event.api, event.columnApi);
|
|
109890
|
-
}
|
|
109891
|
-
}
|
|
109892
|
-
moveColumnEvent = void 0;
|
|
109893
|
-
}
|
|
109894
|
-
if (props.onRowDragEnd && rowDragMoveEvent) {
|
|
109895
|
-
if (rowDragEndEvent && rowDragEndEvent.overIndex >= 0) {
|
|
109896
|
-
props.onRowDragEnd(
|
|
109897
|
-
rowDragEndEvent.node.data,
|
|
109898
|
-
rowDragEndEvent.node.rowIndex,
|
|
109899
|
-
rowDragEndEvent.node,
|
|
109900
|
-
rowDragEndEvent.overNode
|
|
109901
|
-
);
|
|
109902
|
-
}
|
|
109903
|
-
if (props.rows && !props.rowDragManaged) {
|
|
109904
|
-
event.api.setRowData(props.rows);
|
|
109905
|
-
}
|
|
109906
|
-
}
|
|
109907
|
-
rowDragMoveEvent = void 0;
|
|
109908
|
-
rowDragEndEvent = void 0;
|
|
109909
|
-
},
|
|
109926
|
+
(event) => handleDragStopped({
|
|
109927
|
+
event,
|
|
109928
|
+
internalTableContext,
|
|
109929
|
+
moveColumnEvent,
|
|
109930
|
+
rowDragMoveEvent,
|
|
109931
|
+
rowDragEndEvent,
|
|
109932
|
+
tableProps: props
|
|
109933
|
+
}),
|
|
109910
109934
|
[
|
|
109911
109935
|
internalTableContext.onTableConfigChange,
|
|
109912
109936
|
props.onRowDragEnd,
|
|
109937
|
+
props.callOnRowDragEndAfterLeave,
|
|
109913
109938
|
props.rowDragManaged,
|
|
109914
109939
|
props.rows
|
|
109915
109940
|
]
|
|
@@ -112126,7 +112151,7 @@ var FiltersPanelButton = () => {
|
|
|
112126
112151
|
}
|
|
112127
112152
|
return /* @__PURE__ */ React80__default.default.createElement(ClientSideFiltersPanelToggleButton, null);
|
|
112128
112153
|
};
|
|
112129
|
-
var RowGroupSelector = ({ localeText }) => {
|
|
112154
|
+
var RowGroupSelector = ({ localeText, modifyRowGroupFieldsOnSelection }) => {
|
|
112130
112155
|
const {
|
|
112131
112156
|
columnDefinitions: _columnDefinitions,
|
|
112132
112157
|
columnApi,
|
|
@@ -112149,24 +112174,26 @@ var RowGroupSelector = ({ localeText }) => {
|
|
|
112149
112174
|
});
|
|
112150
112175
|
}, [columnDefinitions]);
|
|
112151
112176
|
const selectedColumns = React80__default.default.useMemo(
|
|
112152
|
-
() => mapColumnsToOptions(groupedColumns),
|
|
112177
|
+
() => mapColumnsToOptions(groupedColumns.filter((col) => col.enableRowGroup)),
|
|
112153
112178
|
[groupedColumns]
|
|
112154
112179
|
);
|
|
112155
112180
|
const onGroupedClear = React80__default.default.useCallback(() => {
|
|
112156
112181
|
var _a;
|
|
112157
|
-
|
|
112158
|
-
|
|
112182
|
+
const modifiedFields = (modifyRowGroupFieldsOnSelection == null ? void 0 : modifyRowGroupFieldsOnSelection([])) ?? [];
|
|
112183
|
+
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(modifiedFields);
|
|
112184
|
+
}, [tableRef, modifyRowGroupFieldsOnSelection]);
|
|
112159
112185
|
const onGroupedRowChange = React80__default.default.useCallback(
|
|
112160
112186
|
(newValue) => {
|
|
112161
112187
|
var _a;
|
|
112162
112188
|
const fields = newValue.map((val) => {
|
|
112163
112189
|
return val.id;
|
|
112164
112190
|
});
|
|
112191
|
+
const modifiedFields = (modifyRowGroupFieldsOnSelection == null ? void 0 : modifyRowGroupFieldsOnSelection(fields)) ?? fields;
|
|
112165
112192
|
if (!ramda.equals(selectedColumns, newValue)) {
|
|
112166
|
-
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(
|
|
112193
|
+
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(modifiedFields);
|
|
112167
112194
|
}
|
|
112168
112195
|
},
|
|
112169
|
-
[selectedColumns]
|
|
112196
|
+
[selectedColumns, modifyRowGroupFieldsOnSelection]
|
|
112170
112197
|
);
|
|
112171
112198
|
React80__default.default.useEffect(() => {
|
|
112172
112199
|
function onDisplayedColumnsChanged(event) {
|
|
@@ -112310,7 +112337,8 @@ var QuickControls = (props) => {
|
|
|
112310
112337
|
reset: I18n.t("dataTable.tableSettings.reset"),
|
|
112311
112338
|
placeholder: I18n.t("dataTable.tableSettings.selectColumnGroup"),
|
|
112312
112339
|
selectedItemsPrefix: I18n.t("dataTable.tableSettings.groupBy")
|
|
112313
|
-
}
|
|
112340
|
+
},
|
|
112341
|
+
modifyRowGroupFieldsOnSelection: props.modifyRowGroupFieldsOnSelection
|
|
112314
112342
|
}
|
|
112315
112343
|
), /* @__PURE__ */ React80__default.default.createElement(ConfigPanelButton, null))), /* @__PURE__ */ React80__default.default.createElement(
|
|
112316
112344
|
QuickFilters,
|
package/dist/legacy/index.d.cts
CHANGED
|
@@ -1006,6 +1006,7 @@ interface TableProps<TRow = any, TBottomRow = any> {
|
|
|
1006
1006
|
modules: Module[];
|
|
1007
1007
|
onCellValueChanged?: (params: CellValueChangeParams<any>) => void;
|
|
1008
1008
|
onRowDragEnd?: (row: TRow, endIndex: number, node: Pick<RowNode, 'childIndex' | 'group'>, overNode?: Pick<RowNode, 'childIndex' | 'group' | 'data'>) => void;
|
|
1009
|
+
callOnRowDragEndAfterLeave?: boolean;
|
|
1009
1010
|
onRowGroupOpened?: (event: RowGroupToggledEvent<TRow>) => void;
|
|
1010
1011
|
onRowSelected?: (event: RowSelectedEvent) => void;
|
|
1011
1012
|
onSelectAll?: (param: SelectAllState.All | SelectAllState.None) => void;
|
|
@@ -1452,6 +1453,7 @@ interface QuickControlsProps extends Omit<SearchProps, 'disabled'> {
|
|
|
1452
1453
|
style?: React__default.CSSProperties;
|
|
1453
1454
|
disabledSearch?: boolean;
|
|
1454
1455
|
filterOverlayMatchesTriggerWidth?: boolean;
|
|
1456
|
+
modifyRowGroupFieldsOnSelection?: (userSelection: string[]) => string[];
|
|
1455
1457
|
}
|
|
1456
1458
|
|
|
1457
1459
|
interface ActionButtonProps {
|
|
@@ -1484,6 +1486,7 @@ declare const _default$1: (({ analytics, children, columnDefinitions: _columnDef
|
|
|
1484
1486
|
placeholder: string;
|
|
1485
1487
|
selectedItemsPrefix?: string | undefined;
|
|
1486
1488
|
};
|
|
1489
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1487
1490
|
}>;
|
|
1488
1491
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1489
1492
|
Table: React__default.FC<Omit<TableProps<any, any>, "selectionSSREnabled" | "modules">>;
|
|
@@ -1521,6 +1524,7 @@ declare const _default: (({ analytics, children, columnDefinitions: _columnDefin
|
|
|
1521
1524
|
placeholder: string;
|
|
1522
1525
|
selectedItemsPrefix?: string | undefined;
|
|
1523
1526
|
};
|
|
1527
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1524
1528
|
}>;
|
|
1525
1529
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1526
1530
|
Table: React__default.FC<Omit<TableProps<any, any>, "rows" | "modules">>;
|
package/dist/legacy/index.d.ts
CHANGED
|
@@ -1006,6 +1006,7 @@ interface TableProps<TRow = any, TBottomRow = any> {
|
|
|
1006
1006
|
modules: Module[];
|
|
1007
1007
|
onCellValueChanged?: (params: CellValueChangeParams<any>) => void;
|
|
1008
1008
|
onRowDragEnd?: (row: TRow, endIndex: number, node: Pick<RowNode, 'childIndex' | 'group'>, overNode?: Pick<RowNode, 'childIndex' | 'group' | 'data'>) => void;
|
|
1009
|
+
callOnRowDragEndAfterLeave?: boolean;
|
|
1009
1010
|
onRowGroupOpened?: (event: RowGroupToggledEvent<TRow>) => void;
|
|
1010
1011
|
onRowSelected?: (event: RowSelectedEvent) => void;
|
|
1011
1012
|
onSelectAll?: (param: SelectAllState.All | SelectAllState.None) => void;
|
|
@@ -1452,6 +1453,7 @@ interface QuickControlsProps extends Omit<SearchProps, 'disabled'> {
|
|
|
1452
1453
|
style?: React__default.CSSProperties;
|
|
1453
1454
|
disabledSearch?: boolean;
|
|
1454
1455
|
filterOverlayMatchesTriggerWidth?: boolean;
|
|
1456
|
+
modifyRowGroupFieldsOnSelection?: (userSelection: string[]) => string[];
|
|
1455
1457
|
}
|
|
1456
1458
|
|
|
1457
1459
|
interface ActionButtonProps {
|
|
@@ -1484,6 +1486,7 @@ declare const _default$1: (({ analytics, children, columnDefinitions: _columnDef
|
|
|
1484
1486
|
placeholder: string;
|
|
1485
1487
|
selectedItemsPrefix?: string | undefined;
|
|
1486
1488
|
};
|
|
1489
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1487
1490
|
}>;
|
|
1488
1491
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1489
1492
|
Table: React__default.FC<Omit<TableProps<any, any>, "selectionSSREnabled" | "modules">>;
|
|
@@ -1521,6 +1524,7 @@ declare const _default: (({ analytics, children, columnDefinitions: _columnDefin
|
|
|
1521
1524
|
placeholder: string;
|
|
1522
1525
|
selectedItemsPrefix?: string | undefined;
|
|
1523
1526
|
};
|
|
1527
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1524
1528
|
}>;
|
|
1525
1529
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1526
1530
|
Table: React__default.FC<Omit<TableProps<any, any>, "rows" | "modules">>;
|
package/dist/legacy/index.js
CHANGED
|
@@ -103526,13 +103526,13 @@ var BulkEditInput = (props) => {
|
|
|
103526
103526
|
);
|
|
103527
103527
|
case "peopleMultiSelect":
|
|
103528
103528
|
const {
|
|
103529
|
-
placeholder:
|
|
103530
|
-
...
|
|
103529
|
+
placeholder: peopleMultiSelectPlaceholder,
|
|
103530
|
+
...peopleMultiSelectParams
|
|
103531
103531
|
} = props.editorParams;
|
|
103532
103532
|
return /* @__PURE__ */ React80.createElement(
|
|
103533
103533
|
Form.MultiSelect,
|
|
103534
103534
|
{
|
|
103535
|
-
...
|
|
103535
|
+
...peopleMultiSelectParams,
|
|
103536
103536
|
beforeShow: getBulkEditorOptions,
|
|
103537
103537
|
colWidth: 12,
|
|
103538
103538
|
"data-qa": `data-table-bulk-edit-input-${props.name}`,
|
|
@@ -103544,7 +103544,7 @@ var BulkEditInput = (props) => {
|
|
|
103544
103544
|
name: field.input.name,
|
|
103545
103545
|
optionRenderer: personOptionRenderer(props.editorParams),
|
|
103546
103546
|
options,
|
|
103547
|
-
placeholder:
|
|
103547
|
+
placeholder: peopleMultiSelectPlaceholder ?? placeholderForField
|
|
103548
103548
|
}
|
|
103549
103549
|
);
|
|
103550
103550
|
case "radio":
|
|
@@ -104484,6 +104484,63 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
|
|
|
104484
104484
|
};
|
|
104485
104485
|
};
|
|
104486
104486
|
|
|
104487
|
+
// src/utils/dragging.ts
|
|
104488
|
+
function handleDragStopped({
|
|
104489
|
+
event,
|
|
104490
|
+
internalTableContext,
|
|
104491
|
+
moveColumnEvent: moveColumnEvent2,
|
|
104492
|
+
rowDragMoveEvent: rowDragMoveEvent2,
|
|
104493
|
+
rowDragEndEvent: rowDragEndEvent2,
|
|
104494
|
+
tableProps
|
|
104495
|
+
}) {
|
|
104496
|
+
var _a, _b, _c;
|
|
104497
|
+
if (event.target.className.includes("ag-header-cell")) {
|
|
104498
|
+
internalTableContext.onTableConfigChange();
|
|
104499
|
+
}
|
|
104500
|
+
if (moveColumnEvent2) {
|
|
104501
|
+
(_b = internalTableContext.analytics) == null ? void 0 : _b.client.addEvent(
|
|
104502
|
+
"design_system.data_table.column.repositioned",
|
|
104503
|
+
{
|
|
104504
|
+
client: internalTableContext.analytics.clientName,
|
|
104505
|
+
column: (_a = moveColumnEvent2.column) == null ? void 0 : _a.getColId(),
|
|
104506
|
+
position: moveColumnEvent2.toIndex
|
|
104507
|
+
}
|
|
104508
|
+
);
|
|
104509
|
+
if (tableProps.onRowDragEnd) {
|
|
104510
|
+
const allColumns = event.columnApi.getAllGridColumns();
|
|
104511
|
+
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
104512
|
+
(col) => col.isVisible()
|
|
104513
|
+
);
|
|
104514
|
+
if (moveColumnEvent2.toIndex === firstVisibleColumnIndex || ((_c = moveColumnEvent2.column) == null ? void 0 : _c.getColDef().rowDrag)) {
|
|
104515
|
+
adjustRowDragIcon(event.api, event.columnApi);
|
|
104516
|
+
}
|
|
104517
|
+
}
|
|
104518
|
+
moveColumnEvent2 = void 0;
|
|
104519
|
+
}
|
|
104520
|
+
if (tableProps.onRowDragEnd && rowDragMoveEvent2) {
|
|
104521
|
+
if (rowDragEndEvent2 && rowDragEndEvent2.overIndex >= 0) {
|
|
104522
|
+
tableProps.onRowDragEnd(
|
|
104523
|
+
rowDragEndEvent2.node.data,
|
|
104524
|
+
rowDragEndEvent2.node.rowIndex,
|
|
104525
|
+
rowDragEndEvent2.node,
|
|
104526
|
+
rowDragEndEvent2.overNode
|
|
104527
|
+
);
|
|
104528
|
+
} else if (tableProps.callOnRowDragEndAfterLeave) {
|
|
104529
|
+
tableProps.onRowDragEnd(
|
|
104530
|
+
rowDragMoveEvent2.node.data,
|
|
104531
|
+
rowDragMoveEvent2.node.rowIndex,
|
|
104532
|
+
rowDragMoveEvent2.node,
|
|
104533
|
+
rowDragMoveEvent2.overNode
|
|
104534
|
+
);
|
|
104535
|
+
}
|
|
104536
|
+
if (tableProps.rows && !tableProps.rowDragManaged) {
|
|
104537
|
+
event.api.setRowData(tableProps.rows);
|
|
104538
|
+
}
|
|
104539
|
+
}
|
|
104540
|
+
rowDragMoveEvent2 = void 0;
|
|
104541
|
+
rowDragEndEvent2 = void 0;
|
|
104542
|
+
}
|
|
104543
|
+
|
|
104487
104544
|
// src/utils/expandRows.ts
|
|
104488
104545
|
function getStringifiedRoute(node) {
|
|
104489
104546
|
var _a;
|
|
@@ -109853,50 +109910,18 @@ var Table = (props) => {
|
|
|
109853
109910
|
}
|
|
109854
109911
|
const onDragStopped = React80.useCallback(
|
|
109855
109912
|
// eslint-disable-next-line complexity
|
|
109856
|
-
(event) => {
|
|
109857
|
-
|
|
109858
|
-
|
|
109859
|
-
|
|
109860
|
-
|
|
109861
|
-
|
|
109862
|
-
|
|
109863
|
-
|
|
109864
|
-
{
|
|
109865
|
-
client: internalTableContext.analytics.clientName,
|
|
109866
|
-
column: (_a2 = moveColumnEvent.column) == null ? void 0 : _a2.getColId(),
|
|
109867
|
-
position: moveColumnEvent.toIndex
|
|
109868
|
-
}
|
|
109869
|
-
);
|
|
109870
|
-
if (props.onRowDragEnd) {
|
|
109871
|
-
const allColumns = event.columnApi.getAllGridColumns();
|
|
109872
|
-
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
109873
|
-
(col) => col.isVisible()
|
|
109874
|
-
);
|
|
109875
|
-
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || ((_c2 = moveColumnEvent.column) == null ? void 0 : _c2.getColDef().rowDrag)) {
|
|
109876
|
-
adjustRowDragIcon(event.api, event.columnApi);
|
|
109877
|
-
}
|
|
109878
|
-
}
|
|
109879
|
-
moveColumnEvent = void 0;
|
|
109880
|
-
}
|
|
109881
|
-
if (props.onRowDragEnd && rowDragMoveEvent) {
|
|
109882
|
-
if (rowDragEndEvent && rowDragEndEvent.overIndex >= 0) {
|
|
109883
|
-
props.onRowDragEnd(
|
|
109884
|
-
rowDragEndEvent.node.data,
|
|
109885
|
-
rowDragEndEvent.node.rowIndex,
|
|
109886
|
-
rowDragEndEvent.node,
|
|
109887
|
-
rowDragEndEvent.overNode
|
|
109888
|
-
);
|
|
109889
|
-
}
|
|
109890
|
-
if (props.rows && !props.rowDragManaged) {
|
|
109891
|
-
event.api.setRowData(props.rows);
|
|
109892
|
-
}
|
|
109893
|
-
}
|
|
109894
|
-
rowDragMoveEvent = void 0;
|
|
109895
|
-
rowDragEndEvent = void 0;
|
|
109896
|
-
},
|
|
109913
|
+
(event) => handleDragStopped({
|
|
109914
|
+
event,
|
|
109915
|
+
internalTableContext,
|
|
109916
|
+
moveColumnEvent,
|
|
109917
|
+
rowDragMoveEvent,
|
|
109918
|
+
rowDragEndEvent,
|
|
109919
|
+
tableProps: props
|
|
109920
|
+
}),
|
|
109897
109921
|
[
|
|
109898
109922
|
internalTableContext.onTableConfigChange,
|
|
109899
109923
|
props.onRowDragEnd,
|
|
109924
|
+
props.callOnRowDragEndAfterLeave,
|
|
109900
109925
|
props.rowDragManaged,
|
|
109901
109926
|
props.rows
|
|
109902
109927
|
]
|
|
@@ -112113,7 +112138,7 @@ var FiltersPanelButton = () => {
|
|
|
112113
112138
|
}
|
|
112114
112139
|
return /* @__PURE__ */ React80.createElement(ClientSideFiltersPanelToggleButton, null);
|
|
112115
112140
|
};
|
|
112116
|
-
var RowGroupSelector = ({ localeText }) => {
|
|
112141
|
+
var RowGroupSelector = ({ localeText, modifyRowGroupFieldsOnSelection }) => {
|
|
112117
112142
|
const {
|
|
112118
112143
|
columnDefinitions: _columnDefinitions,
|
|
112119
112144
|
columnApi,
|
|
@@ -112136,24 +112161,26 @@ var RowGroupSelector = ({ localeText }) => {
|
|
|
112136
112161
|
});
|
|
112137
112162
|
}, [columnDefinitions]);
|
|
112138
112163
|
const selectedColumns = React80.useMemo(
|
|
112139
|
-
() => mapColumnsToOptions(groupedColumns),
|
|
112164
|
+
() => mapColumnsToOptions(groupedColumns.filter((col) => col.enableRowGroup)),
|
|
112140
112165
|
[groupedColumns]
|
|
112141
112166
|
);
|
|
112142
112167
|
const onGroupedClear = React80.useCallback(() => {
|
|
112143
112168
|
var _a;
|
|
112144
|
-
|
|
112145
|
-
|
|
112169
|
+
const modifiedFields = (modifyRowGroupFieldsOnSelection == null ? void 0 : modifyRowGroupFieldsOnSelection([])) ?? [];
|
|
112170
|
+
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(modifiedFields);
|
|
112171
|
+
}, [tableRef, modifyRowGroupFieldsOnSelection]);
|
|
112146
112172
|
const onGroupedRowChange = React80.useCallback(
|
|
112147
112173
|
(newValue) => {
|
|
112148
112174
|
var _a;
|
|
112149
112175
|
const fields = newValue.map((val) => {
|
|
112150
112176
|
return val.id;
|
|
112151
112177
|
});
|
|
112178
|
+
const modifiedFields = (modifyRowGroupFieldsOnSelection == null ? void 0 : modifyRowGroupFieldsOnSelection(fields)) ?? fields;
|
|
112152
112179
|
if (!equals(selectedColumns, newValue)) {
|
|
112153
|
-
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(
|
|
112180
|
+
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(modifiedFields);
|
|
112154
112181
|
}
|
|
112155
112182
|
},
|
|
112156
|
-
[selectedColumns]
|
|
112183
|
+
[selectedColumns, modifyRowGroupFieldsOnSelection]
|
|
112157
112184
|
);
|
|
112158
112185
|
React80.useEffect(() => {
|
|
112159
112186
|
function onDisplayedColumnsChanged(event) {
|
|
@@ -112297,7 +112324,8 @@ var QuickControls = (props) => {
|
|
|
112297
112324
|
reset: I18n.t("dataTable.tableSettings.reset"),
|
|
112298
112325
|
placeholder: I18n.t("dataTable.tableSettings.selectColumnGroup"),
|
|
112299
112326
|
selectedItemsPrefix: I18n.t("dataTable.tableSettings.groupBy")
|
|
112300
|
-
}
|
|
112327
|
+
},
|
|
112328
|
+
modifyRowGroupFieldsOnSelection: props.modifyRowGroupFieldsOnSelection
|
|
112301
112329
|
}
|
|
112302
112330
|
), /* @__PURE__ */ React80.createElement(ConfigPanelButton, null))), /* @__PURE__ */ React80.createElement(
|
|
112303
112331
|
QuickFilters,
|
package/dist/modern/index.cjs
CHANGED
|
@@ -103427,13 +103427,13 @@ var BulkEditInput = (props) => {
|
|
|
103427
103427
|
);
|
|
103428
103428
|
case "peopleMultiSelect":
|
|
103429
103429
|
const {
|
|
103430
|
-
placeholder:
|
|
103431
|
-
...
|
|
103430
|
+
placeholder: peopleMultiSelectPlaceholder,
|
|
103431
|
+
...peopleMultiSelectParams
|
|
103432
103432
|
} = props.editorParams;
|
|
103433
103433
|
return /* @__PURE__ */ React80__default.default.createElement(
|
|
103434
103434
|
coreReact.Form.MultiSelect,
|
|
103435
103435
|
{
|
|
103436
|
-
...
|
|
103436
|
+
...peopleMultiSelectParams,
|
|
103437
103437
|
beforeShow: getBulkEditorOptions,
|
|
103438
103438
|
colWidth: 12,
|
|
103439
103439
|
"data-qa": `data-table-bulk-edit-input-${props.name}`,
|
|
@@ -103445,7 +103445,7 @@ var BulkEditInput = (props) => {
|
|
|
103445
103445
|
name: field.input.name,
|
|
103446
103446
|
optionRenderer: personOptionRenderer(props.editorParams),
|
|
103447
103447
|
options,
|
|
103448
|
-
placeholder:
|
|
103448
|
+
placeholder: peopleMultiSelectPlaceholder ?? placeholderForField
|
|
103449
103449
|
}
|
|
103450
103450
|
);
|
|
103451
103451
|
case "radio":
|
|
@@ -104363,6 +104363,62 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
|
|
|
104363
104363
|
};
|
|
104364
104364
|
};
|
|
104365
104365
|
|
|
104366
|
+
// src/utils/dragging.ts
|
|
104367
|
+
function handleDragStopped({
|
|
104368
|
+
event,
|
|
104369
|
+
internalTableContext,
|
|
104370
|
+
moveColumnEvent: moveColumnEvent2,
|
|
104371
|
+
rowDragMoveEvent: rowDragMoveEvent2,
|
|
104372
|
+
rowDragEndEvent: rowDragEndEvent2,
|
|
104373
|
+
tableProps
|
|
104374
|
+
}) {
|
|
104375
|
+
if (event.target.className.includes("ag-header-cell")) {
|
|
104376
|
+
internalTableContext.onTableConfigChange();
|
|
104377
|
+
}
|
|
104378
|
+
if (moveColumnEvent2) {
|
|
104379
|
+
internalTableContext.analytics?.client.addEvent(
|
|
104380
|
+
"design_system.data_table.column.repositioned",
|
|
104381
|
+
{
|
|
104382
|
+
client: internalTableContext.analytics.clientName,
|
|
104383
|
+
column: moveColumnEvent2.column?.getColId(),
|
|
104384
|
+
position: moveColumnEvent2.toIndex
|
|
104385
|
+
}
|
|
104386
|
+
);
|
|
104387
|
+
if (tableProps.onRowDragEnd) {
|
|
104388
|
+
const allColumns = event.columnApi.getAllGridColumns();
|
|
104389
|
+
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
104390
|
+
(col) => col.isVisible()
|
|
104391
|
+
);
|
|
104392
|
+
if (moveColumnEvent2.toIndex === firstVisibleColumnIndex || moveColumnEvent2.column?.getColDef().rowDrag) {
|
|
104393
|
+
adjustRowDragIcon(event.api, event.columnApi);
|
|
104394
|
+
}
|
|
104395
|
+
}
|
|
104396
|
+
moveColumnEvent2 = void 0;
|
|
104397
|
+
}
|
|
104398
|
+
if (tableProps.onRowDragEnd && rowDragMoveEvent2) {
|
|
104399
|
+
if (rowDragEndEvent2 && rowDragEndEvent2.overIndex >= 0) {
|
|
104400
|
+
tableProps.onRowDragEnd(
|
|
104401
|
+
rowDragEndEvent2.node.data,
|
|
104402
|
+
rowDragEndEvent2.node.rowIndex,
|
|
104403
|
+
rowDragEndEvent2.node,
|
|
104404
|
+
rowDragEndEvent2.overNode
|
|
104405
|
+
);
|
|
104406
|
+
} else if (tableProps.callOnRowDragEndAfterLeave) {
|
|
104407
|
+
tableProps.onRowDragEnd(
|
|
104408
|
+
rowDragMoveEvent2.node.data,
|
|
104409
|
+
rowDragMoveEvent2.node.rowIndex,
|
|
104410
|
+
rowDragMoveEvent2.node,
|
|
104411
|
+
rowDragMoveEvent2.overNode
|
|
104412
|
+
);
|
|
104413
|
+
}
|
|
104414
|
+
if (tableProps.rows && !tableProps.rowDragManaged) {
|
|
104415
|
+
event.api.setRowData(tableProps.rows);
|
|
104416
|
+
}
|
|
104417
|
+
}
|
|
104418
|
+
rowDragMoveEvent2 = void 0;
|
|
104419
|
+
rowDragEndEvent2 = void 0;
|
|
104420
|
+
}
|
|
104421
|
+
|
|
104366
104422
|
// src/utils/expandRows.ts
|
|
104367
104423
|
function getStringifiedRoute(node) {
|
|
104368
104424
|
return node.getRoute()?.map((r) => typeof r === "object" ? JSON.stringify(r) : r);
|
|
@@ -109685,49 +109741,18 @@ var Table = (props) => {
|
|
|
109685
109741
|
}
|
|
109686
109742
|
const onDragStopped = React80__default.default.useCallback(
|
|
109687
109743
|
// eslint-disable-next-line complexity
|
|
109688
|
-
(event) => {
|
|
109689
|
-
|
|
109690
|
-
|
|
109691
|
-
|
|
109692
|
-
|
|
109693
|
-
|
|
109694
|
-
|
|
109695
|
-
|
|
109696
|
-
client: internalTableContext.analytics.clientName,
|
|
109697
|
-
column: moveColumnEvent.column?.getColId(),
|
|
109698
|
-
position: moveColumnEvent.toIndex
|
|
109699
|
-
}
|
|
109700
|
-
);
|
|
109701
|
-
if (props.onRowDragEnd) {
|
|
109702
|
-
const allColumns = event.columnApi.getAllGridColumns();
|
|
109703
|
-
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
109704
|
-
(col) => col.isVisible()
|
|
109705
|
-
);
|
|
109706
|
-
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || moveColumnEvent.column?.getColDef().rowDrag) {
|
|
109707
|
-
adjustRowDragIcon(event.api, event.columnApi);
|
|
109708
|
-
}
|
|
109709
|
-
}
|
|
109710
|
-
moveColumnEvent = void 0;
|
|
109711
|
-
}
|
|
109712
|
-
if (props.onRowDragEnd && rowDragMoveEvent) {
|
|
109713
|
-
if (rowDragEndEvent && rowDragEndEvent.overIndex >= 0) {
|
|
109714
|
-
props.onRowDragEnd(
|
|
109715
|
-
rowDragEndEvent.node.data,
|
|
109716
|
-
rowDragEndEvent.node.rowIndex,
|
|
109717
|
-
rowDragEndEvent.node,
|
|
109718
|
-
rowDragEndEvent.overNode
|
|
109719
|
-
);
|
|
109720
|
-
}
|
|
109721
|
-
if (props.rows && !props.rowDragManaged) {
|
|
109722
|
-
event.api.setRowData(props.rows);
|
|
109723
|
-
}
|
|
109724
|
-
}
|
|
109725
|
-
rowDragMoveEvent = void 0;
|
|
109726
|
-
rowDragEndEvent = void 0;
|
|
109727
|
-
},
|
|
109744
|
+
(event) => handleDragStopped({
|
|
109745
|
+
event,
|
|
109746
|
+
internalTableContext,
|
|
109747
|
+
moveColumnEvent,
|
|
109748
|
+
rowDragMoveEvent,
|
|
109749
|
+
rowDragEndEvent,
|
|
109750
|
+
tableProps: props
|
|
109751
|
+
}),
|
|
109728
109752
|
[
|
|
109729
109753
|
internalTableContext.onTableConfigChange,
|
|
109730
109754
|
props.onRowDragEnd,
|
|
109755
|
+
props.callOnRowDragEndAfterLeave,
|
|
109731
109756
|
props.rowDragManaged,
|
|
109732
109757
|
props.rows
|
|
109733
109758
|
]
|
|
@@ -111900,7 +111925,7 @@ var FiltersPanelButton = () => {
|
|
|
111900
111925
|
}
|
|
111901
111926
|
return /* @__PURE__ */ React80__default.default.createElement(ClientSideFiltersPanelToggleButton, null);
|
|
111902
111927
|
};
|
|
111903
|
-
var RowGroupSelector = ({ localeText }) => {
|
|
111928
|
+
var RowGroupSelector = ({ localeText, modifyRowGroupFieldsOnSelection }) => {
|
|
111904
111929
|
const {
|
|
111905
111930
|
columnDefinitions: _columnDefinitions,
|
|
111906
111931
|
columnApi,
|
|
@@ -111923,22 +111948,24 @@ var RowGroupSelector = ({ localeText }) => {
|
|
|
111923
111948
|
});
|
|
111924
111949
|
}, [columnDefinitions]);
|
|
111925
111950
|
const selectedColumns = React80__default.default.useMemo(
|
|
111926
|
-
() => mapColumnsToOptions(groupedColumns),
|
|
111951
|
+
() => mapColumnsToOptions(groupedColumns.filter((col) => col.enableRowGroup)),
|
|
111927
111952
|
[groupedColumns]
|
|
111928
111953
|
);
|
|
111929
111954
|
const onGroupedClear = React80__default.default.useCallback(() => {
|
|
111930
|
-
|
|
111931
|
-
|
|
111955
|
+
const modifiedFields = modifyRowGroupFieldsOnSelection?.([]) ?? [];
|
|
111956
|
+
tableRef?.current?.setRowGrouping(modifiedFields);
|
|
111957
|
+
}, [tableRef, modifyRowGroupFieldsOnSelection]);
|
|
111932
111958
|
const onGroupedRowChange = React80__default.default.useCallback(
|
|
111933
111959
|
(newValue) => {
|
|
111934
111960
|
const fields = newValue.map((val) => {
|
|
111935
111961
|
return val.id;
|
|
111936
111962
|
});
|
|
111963
|
+
const modifiedFields = modifyRowGroupFieldsOnSelection?.(fields) ?? fields;
|
|
111937
111964
|
if (!ramda.equals(selectedColumns, newValue)) {
|
|
111938
|
-
tableRef?.current?.setRowGrouping(
|
|
111965
|
+
tableRef?.current?.setRowGrouping(modifiedFields);
|
|
111939
111966
|
}
|
|
111940
111967
|
},
|
|
111941
|
-
[selectedColumns]
|
|
111968
|
+
[selectedColumns, modifyRowGroupFieldsOnSelection]
|
|
111942
111969
|
);
|
|
111943
111970
|
React80__default.default.useEffect(() => {
|
|
111944
111971
|
function onDisplayedColumnsChanged(event) {
|
|
@@ -112080,7 +112107,8 @@ var QuickControls = (props) => {
|
|
|
112080
112107
|
reset: I18n.t("dataTable.tableSettings.reset"),
|
|
112081
112108
|
placeholder: I18n.t("dataTable.tableSettings.selectColumnGroup"),
|
|
112082
112109
|
selectedItemsPrefix: I18n.t("dataTable.tableSettings.groupBy")
|
|
112083
|
-
}
|
|
112110
|
+
},
|
|
112111
|
+
modifyRowGroupFieldsOnSelection: props.modifyRowGroupFieldsOnSelection
|
|
112084
112112
|
}
|
|
112085
112113
|
), /* @__PURE__ */ React80__default.default.createElement(ConfigPanelButton, null))), /* @__PURE__ */ React80__default.default.createElement(
|
|
112086
112114
|
QuickFilters,
|
package/dist/modern/index.d.cts
CHANGED
|
@@ -1006,6 +1006,7 @@ interface TableProps<TRow = any, TBottomRow = any> {
|
|
|
1006
1006
|
modules: Module[];
|
|
1007
1007
|
onCellValueChanged?: (params: CellValueChangeParams<any>) => void;
|
|
1008
1008
|
onRowDragEnd?: (row: TRow, endIndex: number, node: Pick<RowNode, 'childIndex' | 'group'>, overNode?: Pick<RowNode, 'childIndex' | 'group' | 'data'>) => void;
|
|
1009
|
+
callOnRowDragEndAfterLeave?: boolean;
|
|
1009
1010
|
onRowGroupOpened?: (event: RowGroupToggledEvent<TRow>) => void;
|
|
1010
1011
|
onRowSelected?: (event: RowSelectedEvent) => void;
|
|
1011
1012
|
onSelectAll?: (param: SelectAllState.All | SelectAllState.None) => void;
|
|
@@ -1452,6 +1453,7 @@ interface QuickControlsProps extends Omit<SearchProps, 'disabled'> {
|
|
|
1452
1453
|
style?: React__default.CSSProperties;
|
|
1453
1454
|
disabledSearch?: boolean;
|
|
1454
1455
|
filterOverlayMatchesTriggerWidth?: boolean;
|
|
1456
|
+
modifyRowGroupFieldsOnSelection?: (userSelection: string[]) => string[];
|
|
1455
1457
|
}
|
|
1456
1458
|
|
|
1457
1459
|
interface ActionButtonProps {
|
|
@@ -1484,6 +1486,7 @@ declare const _default$1: (({ analytics, children, columnDefinitions: _columnDef
|
|
|
1484
1486
|
placeholder: string;
|
|
1485
1487
|
selectedItemsPrefix?: string | undefined;
|
|
1486
1488
|
};
|
|
1489
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1487
1490
|
}>;
|
|
1488
1491
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1489
1492
|
Table: React__default.FC<Omit<TableProps<any, any>, "selectionSSREnabled" | "modules">>;
|
|
@@ -1521,6 +1524,7 @@ declare const _default: (({ analytics, children, columnDefinitions: _columnDefin
|
|
|
1521
1524
|
placeholder: string;
|
|
1522
1525
|
selectedItemsPrefix?: string | undefined;
|
|
1523
1526
|
};
|
|
1527
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1524
1528
|
}>;
|
|
1525
1529
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1526
1530
|
Table: React__default.FC<Omit<TableProps<any, any>, "rows" | "modules">>;
|
package/dist/modern/index.d.ts
CHANGED
|
@@ -1006,6 +1006,7 @@ interface TableProps<TRow = any, TBottomRow = any> {
|
|
|
1006
1006
|
modules: Module[];
|
|
1007
1007
|
onCellValueChanged?: (params: CellValueChangeParams<any>) => void;
|
|
1008
1008
|
onRowDragEnd?: (row: TRow, endIndex: number, node: Pick<RowNode, 'childIndex' | 'group'>, overNode?: Pick<RowNode, 'childIndex' | 'group' | 'data'>) => void;
|
|
1009
|
+
callOnRowDragEndAfterLeave?: boolean;
|
|
1009
1010
|
onRowGroupOpened?: (event: RowGroupToggledEvent<TRow>) => void;
|
|
1010
1011
|
onRowSelected?: (event: RowSelectedEvent) => void;
|
|
1011
1012
|
onSelectAll?: (param: SelectAllState.All | SelectAllState.None) => void;
|
|
@@ -1452,6 +1453,7 @@ interface QuickControlsProps extends Omit<SearchProps, 'disabled'> {
|
|
|
1452
1453
|
style?: React__default.CSSProperties;
|
|
1453
1454
|
disabledSearch?: boolean;
|
|
1454
1455
|
filterOverlayMatchesTriggerWidth?: boolean;
|
|
1456
|
+
modifyRowGroupFieldsOnSelection?: (userSelection: string[]) => string[];
|
|
1455
1457
|
}
|
|
1456
1458
|
|
|
1457
1459
|
interface ActionButtonProps {
|
|
@@ -1484,6 +1486,7 @@ declare const _default$1: (({ analytics, children, columnDefinitions: _columnDef
|
|
|
1484
1486
|
placeholder: string;
|
|
1485
1487
|
selectedItemsPrefix?: string | undefined;
|
|
1486
1488
|
};
|
|
1489
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1487
1490
|
}>;
|
|
1488
1491
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1489
1492
|
Table: React__default.FC<Omit<TableProps<any, any>, "selectionSSREnabled" | "modules">>;
|
|
@@ -1521,6 +1524,7 @@ declare const _default: (({ analytics, children, columnDefinitions: _columnDefin
|
|
|
1521
1524
|
placeholder: string;
|
|
1522
1525
|
selectedItemsPrefix?: string | undefined;
|
|
1523
1526
|
};
|
|
1527
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1524
1528
|
}>;
|
|
1525
1529
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1526
1530
|
Table: React__default.FC<Omit<TableProps<any, any>, "rows" | "modules">>;
|
package/dist/modern/index.js
CHANGED
|
@@ -103414,13 +103414,13 @@ var BulkEditInput = (props) => {
|
|
|
103414
103414
|
);
|
|
103415
103415
|
case "peopleMultiSelect":
|
|
103416
103416
|
const {
|
|
103417
|
-
placeholder:
|
|
103418
|
-
...
|
|
103417
|
+
placeholder: peopleMultiSelectPlaceholder,
|
|
103418
|
+
...peopleMultiSelectParams
|
|
103419
103419
|
} = props.editorParams;
|
|
103420
103420
|
return /* @__PURE__ */ React80.createElement(
|
|
103421
103421
|
Form.MultiSelect,
|
|
103422
103422
|
{
|
|
103423
|
-
...
|
|
103423
|
+
...peopleMultiSelectParams,
|
|
103424
103424
|
beforeShow: getBulkEditorOptions,
|
|
103425
103425
|
colWidth: 12,
|
|
103426
103426
|
"data-qa": `data-table-bulk-edit-input-${props.name}`,
|
|
@@ -103432,7 +103432,7 @@ var BulkEditInput = (props) => {
|
|
|
103432
103432
|
name: field.input.name,
|
|
103433
103433
|
optionRenderer: personOptionRenderer(props.editorParams),
|
|
103434
103434
|
options,
|
|
103435
|
-
placeholder:
|
|
103435
|
+
placeholder: peopleMultiSelectPlaceholder ?? placeholderForField
|
|
103436
103436
|
}
|
|
103437
103437
|
);
|
|
103438
103438
|
case "radio":
|
|
@@ -104350,6 +104350,62 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
|
|
|
104350
104350
|
};
|
|
104351
104351
|
};
|
|
104352
104352
|
|
|
104353
|
+
// src/utils/dragging.ts
|
|
104354
|
+
function handleDragStopped({
|
|
104355
|
+
event,
|
|
104356
|
+
internalTableContext,
|
|
104357
|
+
moveColumnEvent: moveColumnEvent2,
|
|
104358
|
+
rowDragMoveEvent: rowDragMoveEvent2,
|
|
104359
|
+
rowDragEndEvent: rowDragEndEvent2,
|
|
104360
|
+
tableProps
|
|
104361
|
+
}) {
|
|
104362
|
+
if (event.target.className.includes("ag-header-cell")) {
|
|
104363
|
+
internalTableContext.onTableConfigChange();
|
|
104364
|
+
}
|
|
104365
|
+
if (moveColumnEvent2) {
|
|
104366
|
+
internalTableContext.analytics?.client.addEvent(
|
|
104367
|
+
"design_system.data_table.column.repositioned",
|
|
104368
|
+
{
|
|
104369
|
+
client: internalTableContext.analytics.clientName,
|
|
104370
|
+
column: moveColumnEvent2.column?.getColId(),
|
|
104371
|
+
position: moveColumnEvent2.toIndex
|
|
104372
|
+
}
|
|
104373
|
+
);
|
|
104374
|
+
if (tableProps.onRowDragEnd) {
|
|
104375
|
+
const allColumns = event.columnApi.getAllGridColumns();
|
|
104376
|
+
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
104377
|
+
(col) => col.isVisible()
|
|
104378
|
+
);
|
|
104379
|
+
if (moveColumnEvent2.toIndex === firstVisibleColumnIndex || moveColumnEvent2.column?.getColDef().rowDrag) {
|
|
104380
|
+
adjustRowDragIcon(event.api, event.columnApi);
|
|
104381
|
+
}
|
|
104382
|
+
}
|
|
104383
|
+
moveColumnEvent2 = void 0;
|
|
104384
|
+
}
|
|
104385
|
+
if (tableProps.onRowDragEnd && rowDragMoveEvent2) {
|
|
104386
|
+
if (rowDragEndEvent2 && rowDragEndEvent2.overIndex >= 0) {
|
|
104387
|
+
tableProps.onRowDragEnd(
|
|
104388
|
+
rowDragEndEvent2.node.data,
|
|
104389
|
+
rowDragEndEvent2.node.rowIndex,
|
|
104390
|
+
rowDragEndEvent2.node,
|
|
104391
|
+
rowDragEndEvent2.overNode
|
|
104392
|
+
);
|
|
104393
|
+
} else if (tableProps.callOnRowDragEndAfterLeave) {
|
|
104394
|
+
tableProps.onRowDragEnd(
|
|
104395
|
+
rowDragMoveEvent2.node.data,
|
|
104396
|
+
rowDragMoveEvent2.node.rowIndex,
|
|
104397
|
+
rowDragMoveEvent2.node,
|
|
104398
|
+
rowDragMoveEvent2.overNode
|
|
104399
|
+
);
|
|
104400
|
+
}
|
|
104401
|
+
if (tableProps.rows && !tableProps.rowDragManaged) {
|
|
104402
|
+
event.api.setRowData(tableProps.rows);
|
|
104403
|
+
}
|
|
104404
|
+
}
|
|
104405
|
+
rowDragMoveEvent2 = void 0;
|
|
104406
|
+
rowDragEndEvent2 = void 0;
|
|
104407
|
+
}
|
|
104408
|
+
|
|
104353
104409
|
// src/utils/expandRows.ts
|
|
104354
104410
|
function getStringifiedRoute(node) {
|
|
104355
104411
|
return node.getRoute()?.map((r) => typeof r === "object" ? JSON.stringify(r) : r);
|
|
@@ -109672,49 +109728,18 @@ var Table = (props) => {
|
|
|
109672
109728
|
}
|
|
109673
109729
|
const onDragStopped = React80.useCallback(
|
|
109674
109730
|
// eslint-disable-next-line complexity
|
|
109675
|
-
(event) => {
|
|
109676
|
-
|
|
109677
|
-
|
|
109678
|
-
|
|
109679
|
-
|
|
109680
|
-
|
|
109681
|
-
|
|
109682
|
-
|
|
109683
|
-
client: internalTableContext.analytics.clientName,
|
|
109684
|
-
column: moveColumnEvent.column?.getColId(),
|
|
109685
|
-
position: moveColumnEvent.toIndex
|
|
109686
|
-
}
|
|
109687
|
-
);
|
|
109688
|
-
if (props.onRowDragEnd) {
|
|
109689
|
-
const allColumns = event.columnApi.getAllGridColumns();
|
|
109690
|
-
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
109691
|
-
(col) => col.isVisible()
|
|
109692
|
-
);
|
|
109693
|
-
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || moveColumnEvent.column?.getColDef().rowDrag) {
|
|
109694
|
-
adjustRowDragIcon(event.api, event.columnApi);
|
|
109695
|
-
}
|
|
109696
|
-
}
|
|
109697
|
-
moveColumnEvent = void 0;
|
|
109698
|
-
}
|
|
109699
|
-
if (props.onRowDragEnd && rowDragMoveEvent) {
|
|
109700
|
-
if (rowDragEndEvent && rowDragEndEvent.overIndex >= 0) {
|
|
109701
|
-
props.onRowDragEnd(
|
|
109702
|
-
rowDragEndEvent.node.data,
|
|
109703
|
-
rowDragEndEvent.node.rowIndex,
|
|
109704
|
-
rowDragEndEvent.node,
|
|
109705
|
-
rowDragEndEvent.overNode
|
|
109706
|
-
);
|
|
109707
|
-
}
|
|
109708
|
-
if (props.rows && !props.rowDragManaged) {
|
|
109709
|
-
event.api.setRowData(props.rows);
|
|
109710
|
-
}
|
|
109711
|
-
}
|
|
109712
|
-
rowDragMoveEvent = void 0;
|
|
109713
|
-
rowDragEndEvent = void 0;
|
|
109714
|
-
},
|
|
109731
|
+
(event) => handleDragStopped({
|
|
109732
|
+
event,
|
|
109733
|
+
internalTableContext,
|
|
109734
|
+
moveColumnEvent,
|
|
109735
|
+
rowDragMoveEvent,
|
|
109736
|
+
rowDragEndEvent,
|
|
109737
|
+
tableProps: props
|
|
109738
|
+
}),
|
|
109715
109739
|
[
|
|
109716
109740
|
internalTableContext.onTableConfigChange,
|
|
109717
109741
|
props.onRowDragEnd,
|
|
109742
|
+
props.callOnRowDragEndAfterLeave,
|
|
109718
109743
|
props.rowDragManaged,
|
|
109719
109744
|
props.rows
|
|
109720
109745
|
]
|
|
@@ -111887,7 +111912,7 @@ var FiltersPanelButton = () => {
|
|
|
111887
111912
|
}
|
|
111888
111913
|
return /* @__PURE__ */ React80.createElement(ClientSideFiltersPanelToggleButton, null);
|
|
111889
111914
|
};
|
|
111890
|
-
var RowGroupSelector = ({ localeText }) => {
|
|
111915
|
+
var RowGroupSelector = ({ localeText, modifyRowGroupFieldsOnSelection }) => {
|
|
111891
111916
|
const {
|
|
111892
111917
|
columnDefinitions: _columnDefinitions,
|
|
111893
111918
|
columnApi,
|
|
@@ -111910,22 +111935,24 @@ var RowGroupSelector = ({ localeText }) => {
|
|
|
111910
111935
|
});
|
|
111911
111936
|
}, [columnDefinitions]);
|
|
111912
111937
|
const selectedColumns = React80.useMemo(
|
|
111913
|
-
() => mapColumnsToOptions(groupedColumns),
|
|
111938
|
+
() => mapColumnsToOptions(groupedColumns.filter((col) => col.enableRowGroup)),
|
|
111914
111939
|
[groupedColumns]
|
|
111915
111940
|
);
|
|
111916
111941
|
const onGroupedClear = React80.useCallback(() => {
|
|
111917
|
-
|
|
111918
|
-
|
|
111942
|
+
const modifiedFields = modifyRowGroupFieldsOnSelection?.([]) ?? [];
|
|
111943
|
+
tableRef?.current?.setRowGrouping(modifiedFields);
|
|
111944
|
+
}, [tableRef, modifyRowGroupFieldsOnSelection]);
|
|
111919
111945
|
const onGroupedRowChange = React80.useCallback(
|
|
111920
111946
|
(newValue) => {
|
|
111921
111947
|
const fields = newValue.map((val) => {
|
|
111922
111948
|
return val.id;
|
|
111923
111949
|
});
|
|
111950
|
+
const modifiedFields = modifyRowGroupFieldsOnSelection?.(fields) ?? fields;
|
|
111924
111951
|
if (!equals(selectedColumns, newValue)) {
|
|
111925
|
-
tableRef?.current?.setRowGrouping(
|
|
111952
|
+
tableRef?.current?.setRowGrouping(modifiedFields);
|
|
111926
111953
|
}
|
|
111927
111954
|
},
|
|
111928
|
-
[selectedColumns]
|
|
111955
|
+
[selectedColumns, modifyRowGroupFieldsOnSelection]
|
|
111929
111956
|
);
|
|
111930
111957
|
React80.useEffect(() => {
|
|
111931
111958
|
function onDisplayedColumnsChanged(event) {
|
|
@@ -112067,7 +112094,8 @@ var QuickControls = (props) => {
|
|
|
112067
112094
|
reset: I18n.t("dataTable.tableSettings.reset"),
|
|
112068
112095
|
placeholder: I18n.t("dataTable.tableSettings.selectColumnGroup"),
|
|
112069
112096
|
selectedItemsPrefix: I18n.t("dataTable.tableSettings.groupBy")
|
|
112070
|
-
}
|
|
112097
|
+
},
|
|
112098
|
+
modifyRowGroupFieldsOnSelection: props.modifyRowGroupFieldsOnSelection
|
|
112071
112099
|
}
|
|
112072
112100
|
), /* @__PURE__ */ React80.createElement(ConfigPanelButton, null))), /* @__PURE__ */ React80.createElement(
|
|
112073
112101
|
QuickFilters,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procore/data-table",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.42.0",
|
|
4
4
|
"description": "Complex data grid built on top of ag-grid, with DST components and styles.",
|
|
5
5
|
"author": "Procore Technologies",
|
|
6
6
|
"homepage": "https://github.com/procore/core/tree/main/packages/data-table",
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@procore/cdn-translations": "0.1.13",
|
|
77
77
|
"@procore/error-pages": "^0.2.3",
|
|
78
|
-
"@procore/labs-datetime-select": "^0.2.
|
|
78
|
+
"@procore/labs-datetime-select": "^0.2.1",
|
|
79
79
|
"@procore/labs-group-by-select": "4.1.0",
|
|
80
|
-
"@procore/toast-alert": "^5.1.
|
|
80
|
+
"@procore/toast-alert": "^5.1.2",
|
|
81
81
|
"@procore/web-sdk-storage": "^0.1.0",
|
|
82
82
|
"classnames": "2.5.1",
|
|
83
83
|
"date-fns": "2.29.1",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@procore/core-css": "10.17.0",
|
|
109
109
|
"@procore/core-icons": "^12.12.0",
|
|
110
110
|
"@procore/core-prettier": "10.2.0",
|
|
111
|
-
"@procore/core-react": "^12.
|
|
111
|
+
"@procore/core-react": "^12.36.0",
|
|
112
112
|
"@procore/eslint-config": "10.0.0",
|
|
113
113
|
"@procore/globalization-toolkit": "3.1.0",
|
|
114
114
|
"@procore/labs-financials-utils": "4.3.1",
|