@procore/data-table 14.39.1 → 14.41.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 +43 -18
- package/dist/legacy/index.d.cts +11 -2
- package/dist/legacy/index.d.ts +11 -2
- package/dist/legacy/index.js +43 -18
- package/dist/modern/index.cjs +43 -18
- package/dist/modern/index.d.cts +11 -2
- package/dist/modern/index.d.ts +11 -2
- package/dist/modern/index.js +43 -18
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 14.41.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f1804f1: Support using required and optional groups at the same time
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 83c2765: Fixed variable name conflicting with type name that leads to an error on storybook.
|
|
12
|
+
- Updated dependencies [27c6ad8]
|
|
13
|
+
- @procore/toast-alert@5.1.2
|
|
14
|
+
|
|
15
|
+
## 14.40.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 1c27b3d: Added `suppressBulkEditToasts` prop in order to allow consumers to use their own notifications when desired, for Bulk Editing.
|
|
20
|
+
|
|
3
21
|
## 14.39.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/legacy/index.cjs
CHANGED
|
@@ -57852,6 +57852,7 @@ var InternalTableContext = React80__default.default.createContext({
|
|
|
57852
57852
|
onExpandOrCollapseAll: () => {
|
|
57853
57853
|
},
|
|
57854
57854
|
onServerSideDataRequest: void 0,
|
|
57855
|
+
suppressBulkEditToasts: false,
|
|
57855
57856
|
onTableConfigChange: () => {
|
|
57856
57857
|
},
|
|
57857
57858
|
updateServerSideDataSource: () => {
|
|
@@ -103538,13 +103539,13 @@ var BulkEditInput = (props) => {
|
|
|
103538
103539
|
);
|
|
103539
103540
|
case "peopleMultiSelect":
|
|
103540
103541
|
const {
|
|
103541
|
-
placeholder:
|
|
103542
|
-
...
|
|
103542
|
+
placeholder: peopleMultiSelectPlaceholder,
|
|
103543
|
+
...peopleMultiSelectParams
|
|
103543
103544
|
} = props.editorParams;
|
|
103544
103545
|
return /* @__PURE__ */ React80__default.default.createElement(
|
|
103545
103546
|
coreReact.Form.MultiSelect,
|
|
103546
103547
|
{
|
|
103547
|
-
...
|
|
103548
|
+
...peopleMultiSelectParams,
|
|
103548
103549
|
beforeShow: getBulkEditorOptions,
|
|
103549
103550
|
colWidth: 12,
|
|
103550
103551
|
"data-qa": `data-table-bulk-edit-input-${props.name}`,
|
|
@@ -103556,7 +103557,7 @@ var BulkEditInput = (props) => {
|
|
|
103556
103557
|
name: field.input.name,
|
|
103557
103558
|
optionRenderer: personOptionRenderer(props.editorParams),
|
|
103558
103559
|
options,
|
|
103559
|
-
placeholder:
|
|
103560
|
+
placeholder: peopleMultiSelectPlaceholder ?? placeholderForField
|
|
103560
103561
|
}
|
|
103561
103562
|
);
|
|
103562
103563
|
case "radio":
|
|
@@ -103662,7 +103663,7 @@ var BulkEditInput = (props) => {
|
|
|
103662
103663
|
}
|
|
103663
103664
|
};
|
|
103664
103665
|
var BulkEdit = React80__default.default.forwardRef(
|
|
103665
|
-
({ onReset = noop4 }, ref) => {
|
|
103666
|
+
({ onReset = noop4, suppressBulkEditToasts = false }, ref) => {
|
|
103666
103667
|
var _a;
|
|
103667
103668
|
const {
|
|
103668
103669
|
analytics,
|
|
@@ -103767,14 +103768,18 @@ var BulkEdit = React80__default.default.forwardRef(
|
|
|
103767
103768
|
await (onBulkEditUpdate == null ? void 0 : onBulkEditUpdate(bulkEditedRows).then((result) => {
|
|
103768
103769
|
if (result === void 0) {
|
|
103769
103770
|
gridApi == null ? void 0 : gridApi.refreshServerSide({ purge: true });
|
|
103770
|
-
|
|
103771
|
+
if (!suppressBulkEditToasts) {
|
|
103772
|
+
showToast.success(I18n.t("dataTable.bulkActions.success"));
|
|
103773
|
+
}
|
|
103771
103774
|
resetForm({});
|
|
103772
103775
|
onReset();
|
|
103773
103776
|
} else {
|
|
103774
103777
|
throw new Error(result);
|
|
103775
103778
|
}
|
|
103776
103779
|
}).catch(() => {
|
|
103777
|
-
|
|
103780
|
+
if (!suppressBulkEditToasts) {
|
|
103781
|
+
showToast.error(I18n.t("dataTable.bulkActions.error"));
|
|
103782
|
+
}
|
|
103778
103783
|
}));
|
|
103779
103784
|
} else {
|
|
103780
103785
|
try {
|
|
@@ -103782,11 +103787,15 @@ var BulkEdit = React80__default.default.forwardRef(
|
|
|
103782
103787
|
{ update: clientSideItemsToUpdate },
|
|
103783
103788
|
() => onBulkEditUpdate == null ? void 0 : onBulkEditUpdate(bulkEditedRows)
|
|
103784
103789
|
);
|
|
103785
|
-
|
|
103790
|
+
if (!suppressBulkEditToasts) {
|
|
103791
|
+
showToast.success(I18n.t("dataTable.bulkActions.success"));
|
|
103792
|
+
}
|
|
103786
103793
|
resetForm({});
|
|
103787
103794
|
onReset();
|
|
103788
103795
|
} catch (error2) {
|
|
103789
|
-
|
|
103796
|
+
if (!suppressBulkEditToasts) {
|
|
103797
|
+
showToast.error(I18n.t("dataTable.bulkActions.error"));
|
|
103798
|
+
}
|
|
103790
103799
|
}
|
|
103791
103800
|
}
|
|
103792
103801
|
};
|
|
@@ -103820,7 +103829,7 @@ var BulkEdit = React80__default.default.forwardRef(
|
|
|
103820
103829
|
}
|
|
103821
103830
|
);
|
|
103822
103831
|
var BulkEditPanel = ({}) => {
|
|
103823
|
-
const { contextPanel } = useInternalTableContext();
|
|
103832
|
+
const { contextPanel, suppressBulkEditToasts } = useInternalTableContext();
|
|
103824
103833
|
const I18n = coreReact.useI18nContext();
|
|
103825
103834
|
const bulkEditRef = React80__default.default.useRef(null);
|
|
103826
103835
|
return /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel, null, /* @__PURE__ */ React80__default.default.createElement(
|
|
@@ -103833,7 +103842,14 @@ var BulkEditPanel = ({}) => {
|
|
|
103833
103842
|
}
|
|
103834
103843
|
},
|
|
103835
103844
|
/* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Title, null, I18n.t("dataTable.bulkActions.editValues"))
|
|
103836
|
-
), /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Body, null, /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Section, null, /* @__PURE__ */ React80__default.default.createElement(
|
|
103845
|
+
), /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Body, null, /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Section, null, /* @__PURE__ */ React80__default.default.createElement(
|
|
103846
|
+
BulkEdit,
|
|
103847
|
+
{
|
|
103848
|
+
ref: bulkEditRef,
|
|
103849
|
+
onReset: contextPanel.hide,
|
|
103850
|
+
suppressBulkEditToasts
|
|
103851
|
+
}
|
|
103852
|
+
))), /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Footer, null, /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.FooterActions, null, /* @__PURE__ */ React80__default.default.createElement(
|
|
103837
103853
|
coreReact.Button,
|
|
103838
103854
|
{
|
|
103839
103855
|
key: "cancel",
|
|
@@ -108997,6 +109013,7 @@ var DataTable = ({
|
|
|
108997
109013
|
onServerSideDataRequest,
|
|
108998
109014
|
onTableConfigChange,
|
|
108999
109015
|
showExpandCollapseAllToggle,
|
|
109016
|
+
suppressBulkEditToasts,
|
|
109000
109017
|
translations: translations2 = {},
|
|
109001
109018
|
enableCellTextSelection,
|
|
109002
109019
|
localStoragePersistenceKey,
|
|
@@ -109246,6 +109263,7 @@ var DataTable = ({
|
|
|
109246
109263
|
onBulkEditUpdate,
|
|
109247
109264
|
onExpandOrCollapseAll,
|
|
109248
109265
|
onServerSideDataRequest,
|
|
109266
|
+
suppressBulkEditToasts,
|
|
109249
109267
|
onTableConfigChange: internalOnTableConfigChange,
|
|
109250
109268
|
rowSelectionRef,
|
|
109251
109269
|
expandCollapseStateRef,
|
|
@@ -112108,7 +112126,7 @@ var FiltersPanelButton = () => {
|
|
|
112108
112126
|
}
|
|
112109
112127
|
return /* @__PURE__ */ React80__default.default.createElement(ClientSideFiltersPanelToggleButton, null);
|
|
112110
112128
|
};
|
|
112111
|
-
var RowGroupSelector = ({ localeText }) => {
|
|
112129
|
+
var RowGroupSelector = ({ localeText, modifyRowGroupFieldsOnSelection }) => {
|
|
112112
112130
|
const {
|
|
112113
112131
|
columnDefinitions: _columnDefinitions,
|
|
112114
112132
|
columnApi,
|
|
@@ -112131,24 +112149,26 @@ var RowGroupSelector = ({ localeText }) => {
|
|
|
112131
112149
|
});
|
|
112132
112150
|
}, [columnDefinitions]);
|
|
112133
112151
|
const selectedColumns = React80__default.default.useMemo(
|
|
112134
|
-
() => mapColumnsToOptions(groupedColumns),
|
|
112152
|
+
() => mapColumnsToOptions(groupedColumns.filter((col) => col.enableRowGroup)),
|
|
112135
112153
|
[groupedColumns]
|
|
112136
112154
|
);
|
|
112137
112155
|
const onGroupedClear = React80__default.default.useCallback(() => {
|
|
112138
112156
|
var _a;
|
|
112139
|
-
|
|
112140
|
-
|
|
112157
|
+
const modifiedFields = (modifyRowGroupFieldsOnSelection == null ? void 0 : modifyRowGroupFieldsOnSelection([])) ?? [];
|
|
112158
|
+
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(modifiedFields);
|
|
112159
|
+
}, [tableRef, modifyRowGroupFieldsOnSelection]);
|
|
112141
112160
|
const onGroupedRowChange = React80__default.default.useCallback(
|
|
112142
112161
|
(newValue) => {
|
|
112143
112162
|
var _a;
|
|
112144
112163
|
const fields = newValue.map((val) => {
|
|
112145
112164
|
return val.id;
|
|
112146
112165
|
});
|
|
112166
|
+
const modifiedFields = (modifyRowGroupFieldsOnSelection == null ? void 0 : modifyRowGroupFieldsOnSelection(fields)) ?? fields;
|
|
112147
112167
|
if (!ramda.equals(selectedColumns, newValue)) {
|
|
112148
|
-
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(
|
|
112168
|
+
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(modifiedFields);
|
|
112149
112169
|
}
|
|
112150
112170
|
},
|
|
112151
|
-
[selectedColumns]
|
|
112171
|
+
[selectedColumns, modifyRowGroupFieldsOnSelection]
|
|
112152
112172
|
);
|
|
112153
112173
|
React80__default.default.useEffect(() => {
|
|
112154
112174
|
function onDisplayedColumnsChanged(event) {
|
|
@@ -112292,7 +112312,8 @@ var QuickControls = (props) => {
|
|
|
112292
112312
|
reset: I18n.t("dataTable.tableSettings.reset"),
|
|
112293
112313
|
placeholder: I18n.t("dataTable.tableSettings.selectColumnGroup"),
|
|
112294
112314
|
selectedItemsPrefix: I18n.t("dataTable.tableSettings.groupBy")
|
|
112295
|
-
}
|
|
112315
|
+
},
|
|
112316
|
+
modifyRowGroupFieldsOnSelection: props.modifyRowGroupFieldsOnSelection
|
|
112296
112317
|
}
|
|
112297
112318
|
), /* @__PURE__ */ React80__default.default.createElement(ConfigPanelButton, null))), /* @__PURE__ */ React80__default.default.createElement(
|
|
112298
112319
|
QuickFilters,
|
|
@@ -112325,6 +112346,7 @@ var ClientSideDataTable = ({
|
|
|
112325
112346
|
onBulkEditUpdate,
|
|
112326
112347
|
onExpandOrCollapseAll,
|
|
112327
112348
|
onTableConfigChange,
|
|
112349
|
+
suppressBulkEditToasts,
|
|
112328
112350
|
translations: translations2 = {},
|
|
112329
112351
|
enableCellTextSelection,
|
|
112330
112352
|
localStoragePersistenceKey,
|
|
@@ -112344,6 +112366,7 @@ var ClientSideDataTable = ({
|
|
|
112344
112366
|
onExpandOrCollapseAll,
|
|
112345
112367
|
onTableConfigChange,
|
|
112346
112368
|
showExpandCollapseAllToggle: true,
|
|
112369
|
+
suppressBulkEditToasts,
|
|
112347
112370
|
translations: translations2,
|
|
112348
112371
|
localStoragePersistenceKey,
|
|
112349
112372
|
customBulkEditorFields,
|
|
@@ -116739,6 +116762,7 @@ var ServerSideDataTable = ({
|
|
|
116739
116762
|
onTableConfigChange,
|
|
116740
116763
|
enableCellTextSelection,
|
|
116741
116764
|
showExpandCollapseAllToggle,
|
|
116765
|
+
suppressBulkEditToasts,
|
|
116742
116766
|
translations: translations2 = {},
|
|
116743
116767
|
localStoragePersistenceKey,
|
|
116744
116768
|
enableCDN
|
|
@@ -116758,6 +116782,7 @@ var ServerSideDataTable = ({
|
|
|
116758
116782
|
onServerSideDataRequest,
|
|
116759
116783
|
onTableConfigChange,
|
|
116760
116784
|
showExpandCollapseAllToggle,
|
|
116785
|
+
suppressBulkEditToasts,
|
|
116761
116786
|
translations: translations2,
|
|
116762
116787
|
customBulkEditorFields,
|
|
116763
116788
|
enableCellTextSelection,
|
package/dist/legacy/index.d.cts
CHANGED
|
@@ -1162,6 +1162,11 @@ interface DataTableProps {
|
|
|
1162
1162
|
* the updated values
|
|
1163
1163
|
*/
|
|
1164
1164
|
onBulkEditUpdate?: (rows: BulkEditResult[]) => Promise<void>;
|
|
1165
|
+
/**
|
|
1166
|
+
* When true, suppresses the success and error toast messages
|
|
1167
|
+
* that are normally shown after bulk edit operations
|
|
1168
|
+
*/
|
|
1169
|
+
suppressBulkEditToasts?: boolean;
|
|
1165
1170
|
localStoragePersistenceKey?: string;
|
|
1166
1171
|
showExpandCollapseAllToggle?: boolean;
|
|
1167
1172
|
translations?: DataTableTranslations;
|
|
@@ -1380,6 +1385,7 @@ interface InternalTableContext {
|
|
|
1380
1385
|
filterStorage: IFilterStorage;
|
|
1381
1386
|
onBulkEditUpdate: DataTableProps['onBulkEditUpdate'];
|
|
1382
1387
|
onServerSideDataRequest?: DataTableProps['onServerSideDataRequest'];
|
|
1388
|
+
suppressBulkEditToasts?: DataTableProps['suppressBulkEditToasts'];
|
|
1383
1389
|
updateServerSideDataSource: (params: UpdateServerSideDataSourceParams) => void;
|
|
1384
1390
|
localStoragePersistenceKey?: string;
|
|
1385
1391
|
onExpandOrCollapseAll?: (expanded: boolean) => void;
|
|
@@ -1446,6 +1452,7 @@ interface QuickControlsProps extends Omit<SearchProps, 'disabled'> {
|
|
|
1446
1452
|
style?: React__default.CSSProperties;
|
|
1447
1453
|
disabledSearch?: boolean;
|
|
1448
1454
|
filterOverlayMatchesTriggerWidth?: boolean;
|
|
1455
|
+
modifyRowGroupFieldsOnSelection?: (userSelection: string[]) => string[];
|
|
1449
1456
|
}
|
|
1450
1457
|
|
|
1451
1458
|
interface ActionButtonProps {
|
|
@@ -1463,7 +1470,7 @@ interface BulkActionProps {
|
|
|
1463
1470
|
style?: React__default.CSSProperties;
|
|
1464
1471
|
}
|
|
1465
1472
|
|
|
1466
|
-
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1473
|
+
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onTableConfigChange, suppressBulkEditToasts, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1467
1474
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1468
1475
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1469
1476
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1478,6 +1485,7 @@ declare const _default$1: (({ analytics, children, columnDefinitions: _columnDef
|
|
|
1478
1485
|
placeholder: string;
|
|
1479
1486
|
selectedItemsPrefix?: string | undefined;
|
|
1480
1487
|
};
|
|
1488
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1481
1489
|
}>;
|
|
1482
1490
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1483
1491
|
Table: React__default.FC<Omit<TableProps<any, any>, "selectionSSREnabled" | "modules">>;
|
|
@@ -1500,7 +1508,7 @@ declare const MultiSelectQuickFilterRenderer: (props: FilterProps<any[]>) => Rea
|
|
|
1500
1508
|
|
|
1501
1509
|
declare const SingleSelectQuickFilterRenderer: (props: FilterProps<any[]>) => React__default.JSX.Element;
|
|
1502
1510
|
|
|
1503
|
-
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1511
|
+
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, suppressBulkEditToasts, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1504
1512
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1505
1513
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1506
1514
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1515,6 +1523,7 @@ declare const _default: (({ analytics, children, columnDefinitions: _columnDefin
|
|
|
1515
1523
|
placeholder: string;
|
|
1516
1524
|
selectedItemsPrefix?: string | undefined;
|
|
1517
1525
|
};
|
|
1526
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1518
1527
|
}>;
|
|
1519
1528
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1520
1529
|
Table: React__default.FC<Omit<TableProps<any, any>, "rows" | "modules">>;
|
package/dist/legacy/index.d.ts
CHANGED
|
@@ -1162,6 +1162,11 @@ interface DataTableProps {
|
|
|
1162
1162
|
* the updated values
|
|
1163
1163
|
*/
|
|
1164
1164
|
onBulkEditUpdate?: (rows: BulkEditResult[]) => Promise<void>;
|
|
1165
|
+
/**
|
|
1166
|
+
* When true, suppresses the success and error toast messages
|
|
1167
|
+
* that are normally shown after bulk edit operations
|
|
1168
|
+
*/
|
|
1169
|
+
suppressBulkEditToasts?: boolean;
|
|
1165
1170
|
localStoragePersistenceKey?: string;
|
|
1166
1171
|
showExpandCollapseAllToggle?: boolean;
|
|
1167
1172
|
translations?: DataTableTranslations;
|
|
@@ -1380,6 +1385,7 @@ interface InternalTableContext {
|
|
|
1380
1385
|
filterStorage: IFilterStorage;
|
|
1381
1386
|
onBulkEditUpdate: DataTableProps['onBulkEditUpdate'];
|
|
1382
1387
|
onServerSideDataRequest?: DataTableProps['onServerSideDataRequest'];
|
|
1388
|
+
suppressBulkEditToasts?: DataTableProps['suppressBulkEditToasts'];
|
|
1383
1389
|
updateServerSideDataSource: (params: UpdateServerSideDataSourceParams) => void;
|
|
1384
1390
|
localStoragePersistenceKey?: string;
|
|
1385
1391
|
onExpandOrCollapseAll?: (expanded: boolean) => void;
|
|
@@ -1446,6 +1452,7 @@ interface QuickControlsProps extends Omit<SearchProps, 'disabled'> {
|
|
|
1446
1452
|
style?: React__default.CSSProperties;
|
|
1447
1453
|
disabledSearch?: boolean;
|
|
1448
1454
|
filterOverlayMatchesTriggerWidth?: boolean;
|
|
1455
|
+
modifyRowGroupFieldsOnSelection?: (userSelection: string[]) => string[];
|
|
1449
1456
|
}
|
|
1450
1457
|
|
|
1451
1458
|
interface ActionButtonProps {
|
|
@@ -1463,7 +1470,7 @@ interface BulkActionProps {
|
|
|
1463
1470
|
style?: React__default.CSSProperties;
|
|
1464
1471
|
}
|
|
1465
1472
|
|
|
1466
|
-
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1473
|
+
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onTableConfigChange, suppressBulkEditToasts, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1467
1474
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1468
1475
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1469
1476
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1478,6 +1485,7 @@ declare const _default$1: (({ analytics, children, columnDefinitions: _columnDef
|
|
|
1478
1485
|
placeholder: string;
|
|
1479
1486
|
selectedItemsPrefix?: string | undefined;
|
|
1480
1487
|
};
|
|
1488
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1481
1489
|
}>;
|
|
1482
1490
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1483
1491
|
Table: React__default.FC<Omit<TableProps<any, any>, "selectionSSREnabled" | "modules">>;
|
|
@@ -1500,7 +1508,7 @@ declare const MultiSelectQuickFilterRenderer: (props: FilterProps<any[]>) => Rea
|
|
|
1500
1508
|
|
|
1501
1509
|
declare const SingleSelectQuickFilterRenderer: (props: FilterProps<any[]>) => React__default.JSX.Element;
|
|
1502
1510
|
|
|
1503
|
-
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1511
|
+
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, suppressBulkEditToasts, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1504
1512
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1505
1513
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1506
1514
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1515,6 +1523,7 @@ declare const _default: (({ analytics, children, columnDefinitions: _columnDefin
|
|
|
1515
1523
|
placeholder: string;
|
|
1516
1524
|
selectedItemsPrefix?: string | undefined;
|
|
1517
1525
|
};
|
|
1526
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1518
1527
|
}>;
|
|
1519
1528
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1520
1529
|
Table: React__default.FC<Omit<TableProps<any, any>, "rows" | "modules">>;
|
package/dist/legacy/index.js
CHANGED
|
@@ -57839,6 +57839,7 @@ var InternalTableContext = React80.createContext({
|
|
|
57839
57839
|
onExpandOrCollapseAll: () => {
|
|
57840
57840
|
},
|
|
57841
57841
|
onServerSideDataRequest: void 0,
|
|
57842
|
+
suppressBulkEditToasts: false,
|
|
57842
57843
|
onTableConfigChange: () => {
|
|
57843
57844
|
},
|
|
57844
57845
|
updateServerSideDataSource: () => {
|
|
@@ -103525,13 +103526,13 @@ var BulkEditInput = (props) => {
|
|
|
103525
103526
|
);
|
|
103526
103527
|
case "peopleMultiSelect":
|
|
103527
103528
|
const {
|
|
103528
|
-
placeholder:
|
|
103529
|
-
...
|
|
103529
|
+
placeholder: peopleMultiSelectPlaceholder,
|
|
103530
|
+
...peopleMultiSelectParams
|
|
103530
103531
|
} = props.editorParams;
|
|
103531
103532
|
return /* @__PURE__ */ React80.createElement(
|
|
103532
103533
|
Form.MultiSelect,
|
|
103533
103534
|
{
|
|
103534
|
-
...
|
|
103535
|
+
...peopleMultiSelectParams,
|
|
103535
103536
|
beforeShow: getBulkEditorOptions,
|
|
103536
103537
|
colWidth: 12,
|
|
103537
103538
|
"data-qa": `data-table-bulk-edit-input-${props.name}`,
|
|
@@ -103543,7 +103544,7 @@ var BulkEditInput = (props) => {
|
|
|
103543
103544
|
name: field.input.name,
|
|
103544
103545
|
optionRenderer: personOptionRenderer(props.editorParams),
|
|
103545
103546
|
options,
|
|
103546
|
-
placeholder:
|
|
103547
|
+
placeholder: peopleMultiSelectPlaceholder ?? placeholderForField
|
|
103547
103548
|
}
|
|
103548
103549
|
);
|
|
103549
103550
|
case "radio":
|
|
@@ -103649,7 +103650,7 @@ var BulkEditInput = (props) => {
|
|
|
103649
103650
|
}
|
|
103650
103651
|
};
|
|
103651
103652
|
var BulkEdit = React80.forwardRef(
|
|
103652
|
-
({ onReset = noop4 }, ref) => {
|
|
103653
|
+
({ onReset = noop4, suppressBulkEditToasts = false }, ref) => {
|
|
103653
103654
|
var _a;
|
|
103654
103655
|
const {
|
|
103655
103656
|
analytics,
|
|
@@ -103754,14 +103755,18 @@ var BulkEdit = React80.forwardRef(
|
|
|
103754
103755
|
await (onBulkEditUpdate == null ? void 0 : onBulkEditUpdate(bulkEditedRows).then((result) => {
|
|
103755
103756
|
if (result === void 0) {
|
|
103756
103757
|
gridApi == null ? void 0 : gridApi.refreshServerSide({ purge: true });
|
|
103757
|
-
|
|
103758
|
+
if (!suppressBulkEditToasts) {
|
|
103759
|
+
showToast.success(I18n.t("dataTable.bulkActions.success"));
|
|
103760
|
+
}
|
|
103758
103761
|
resetForm({});
|
|
103759
103762
|
onReset();
|
|
103760
103763
|
} else {
|
|
103761
103764
|
throw new Error(result);
|
|
103762
103765
|
}
|
|
103763
103766
|
}).catch(() => {
|
|
103764
|
-
|
|
103767
|
+
if (!suppressBulkEditToasts) {
|
|
103768
|
+
showToast.error(I18n.t("dataTable.bulkActions.error"));
|
|
103769
|
+
}
|
|
103765
103770
|
}));
|
|
103766
103771
|
} else {
|
|
103767
103772
|
try {
|
|
@@ -103769,11 +103774,15 @@ var BulkEdit = React80.forwardRef(
|
|
|
103769
103774
|
{ update: clientSideItemsToUpdate },
|
|
103770
103775
|
() => onBulkEditUpdate == null ? void 0 : onBulkEditUpdate(bulkEditedRows)
|
|
103771
103776
|
);
|
|
103772
|
-
|
|
103777
|
+
if (!suppressBulkEditToasts) {
|
|
103778
|
+
showToast.success(I18n.t("dataTable.bulkActions.success"));
|
|
103779
|
+
}
|
|
103773
103780
|
resetForm({});
|
|
103774
103781
|
onReset();
|
|
103775
103782
|
} catch (error2) {
|
|
103776
|
-
|
|
103783
|
+
if (!suppressBulkEditToasts) {
|
|
103784
|
+
showToast.error(I18n.t("dataTable.bulkActions.error"));
|
|
103785
|
+
}
|
|
103777
103786
|
}
|
|
103778
103787
|
}
|
|
103779
103788
|
};
|
|
@@ -103807,7 +103816,7 @@ var BulkEdit = React80.forwardRef(
|
|
|
103807
103816
|
}
|
|
103808
103817
|
);
|
|
103809
103818
|
var BulkEditPanel = ({}) => {
|
|
103810
|
-
const { contextPanel } = useInternalTableContext();
|
|
103819
|
+
const { contextPanel, suppressBulkEditToasts } = useInternalTableContext();
|
|
103811
103820
|
const I18n = useI18nContext();
|
|
103812
103821
|
const bulkEditRef = React80.useRef(null);
|
|
103813
103822
|
return /* @__PURE__ */ React80.createElement(Panel, null, /* @__PURE__ */ React80.createElement(
|
|
@@ -103820,7 +103829,14 @@ var BulkEditPanel = ({}) => {
|
|
|
103820
103829
|
}
|
|
103821
103830
|
},
|
|
103822
103831
|
/* @__PURE__ */ React80.createElement(Panel.Title, null, I18n.t("dataTable.bulkActions.editValues"))
|
|
103823
|
-
), /* @__PURE__ */ React80.createElement(Panel.Body, null, /* @__PURE__ */ React80.createElement(Panel.Section, null, /* @__PURE__ */ React80.createElement(
|
|
103832
|
+
), /* @__PURE__ */ React80.createElement(Panel.Body, null, /* @__PURE__ */ React80.createElement(Panel.Section, null, /* @__PURE__ */ React80.createElement(
|
|
103833
|
+
BulkEdit,
|
|
103834
|
+
{
|
|
103835
|
+
ref: bulkEditRef,
|
|
103836
|
+
onReset: contextPanel.hide,
|
|
103837
|
+
suppressBulkEditToasts
|
|
103838
|
+
}
|
|
103839
|
+
))), /* @__PURE__ */ React80.createElement(Panel.Footer, null, /* @__PURE__ */ React80.createElement(Panel.FooterActions, null, /* @__PURE__ */ React80.createElement(
|
|
103824
103840
|
Button,
|
|
103825
103841
|
{
|
|
103826
103842
|
key: "cancel",
|
|
@@ -108984,6 +109000,7 @@ var DataTable = ({
|
|
|
108984
109000
|
onServerSideDataRequest,
|
|
108985
109001
|
onTableConfigChange,
|
|
108986
109002
|
showExpandCollapseAllToggle,
|
|
109003
|
+
suppressBulkEditToasts,
|
|
108987
109004
|
translations: translations2 = {},
|
|
108988
109005
|
enableCellTextSelection,
|
|
108989
109006
|
localStoragePersistenceKey,
|
|
@@ -109233,6 +109250,7 @@ var DataTable = ({
|
|
|
109233
109250
|
onBulkEditUpdate,
|
|
109234
109251
|
onExpandOrCollapseAll,
|
|
109235
109252
|
onServerSideDataRequest,
|
|
109253
|
+
suppressBulkEditToasts,
|
|
109236
109254
|
onTableConfigChange: internalOnTableConfigChange,
|
|
109237
109255
|
rowSelectionRef,
|
|
109238
109256
|
expandCollapseStateRef,
|
|
@@ -112095,7 +112113,7 @@ var FiltersPanelButton = () => {
|
|
|
112095
112113
|
}
|
|
112096
112114
|
return /* @__PURE__ */ React80.createElement(ClientSideFiltersPanelToggleButton, null);
|
|
112097
112115
|
};
|
|
112098
|
-
var RowGroupSelector = ({ localeText }) => {
|
|
112116
|
+
var RowGroupSelector = ({ localeText, modifyRowGroupFieldsOnSelection }) => {
|
|
112099
112117
|
const {
|
|
112100
112118
|
columnDefinitions: _columnDefinitions,
|
|
112101
112119
|
columnApi,
|
|
@@ -112118,24 +112136,26 @@ var RowGroupSelector = ({ localeText }) => {
|
|
|
112118
112136
|
});
|
|
112119
112137
|
}, [columnDefinitions]);
|
|
112120
112138
|
const selectedColumns = React80.useMemo(
|
|
112121
|
-
() => mapColumnsToOptions(groupedColumns),
|
|
112139
|
+
() => mapColumnsToOptions(groupedColumns.filter((col) => col.enableRowGroup)),
|
|
112122
112140
|
[groupedColumns]
|
|
112123
112141
|
);
|
|
112124
112142
|
const onGroupedClear = React80.useCallback(() => {
|
|
112125
112143
|
var _a;
|
|
112126
|
-
|
|
112127
|
-
|
|
112144
|
+
const modifiedFields = (modifyRowGroupFieldsOnSelection == null ? void 0 : modifyRowGroupFieldsOnSelection([])) ?? [];
|
|
112145
|
+
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(modifiedFields);
|
|
112146
|
+
}, [tableRef, modifyRowGroupFieldsOnSelection]);
|
|
112128
112147
|
const onGroupedRowChange = React80.useCallback(
|
|
112129
112148
|
(newValue) => {
|
|
112130
112149
|
var _a;
|
|
112131
112150
|
const fields = newValue.map((val) => {
|
|
112132
112151
|
return val.id;
|
|
112133
112152
|
});
|
|
112153
|
+
const modifiedFields = (modifyRowGroupFieldsOnSelection == null ? void 0 : modifyRowGroupFieldsOnSelection(fields)) ?? fields;
|
|
112134
112154
|
if (!equals(selectedColumns, newValue)) {
|
|
112135
|
-
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(
|
|
112155
|
+
(_a = tableRef == null ? void 0 : tableRef.current) == null ? void 0 : _a.setRowGrouping(modifiedFields);
|
|
112136
112156
|
}
|
|
112137
112157
|
},
|
|
112138
|
-
[selectedColumns]
|
|
112158
|
+
[selectedColumns, modifyRowGroupFieldsOnSelection]
|
|
112139
112159
|
);
|
|
112140
112160
|
React80.useEffect(() => {
|
|
112141
112161
|
function onDisplayedColumnsChanged(event) {
|
|
@@ -112279,7 +112299,8 @@ var QuickControls = (props) => {
|
|
|
112279
112299
|
reset: I18n.t("dataTable.tableSettings.reset"),
|
|
112280
112300
|
placeholder: I18n.t("dataTable.tableSettings.selectColumnGroup"),
|
|
112281
112301
|
selectedItemsPrefix: I18n.t("dataTable.tableSettings.groupBy")
|
|
112282
|
-
}
|
|
112302
|
+
},
|
|
112303
|
+
modifyRowGroupFieldsOnSelection: props.modifyRowGroupFieldsOnSelection
|
|
112283
112304
|
}
|
|
112284
112305
|
), /* @__PURE__ */ React80.createElement(ConfigPanelButton, null))), /* @__PURE__ */ React80.createElement(
|
|
112285
112306
|
QuickFilters,
|
|
@@ -112312,6 +112333,7 @@ var ClientSideDataTable = ({
|
|
|
112312
112333
|
onBulkEditUpdate,
|
|
112313
112334
|
onExpandOrCollapseAll,
|
|
112314
112335
|
onTableConfigChange,
|
|
112336
|
+
suppressBulkEditToasts,
|
|
112315
112337
|
translations: translations2 = {},
|
|
112316
112338
|
enableCellTextSelection,
|
|
112317
112339
|
localStoragePersistenceKey,
|
|
@@ -112331,6 +112353,7 @@ var ClientSideDataTable = ({
|
|
|
112331
112353
|
onExpandOrCollapseAll,
|
|
112332
112354
|
onTableConfigChange,
|
|
112333
112355
|
showExpandCollapseAllToggle: true,
|
|
112356
|
+
suppressBulkEditToasts,
|
|
112334
112357
|
translations: translations2,
|
|
112335
112358
|
localStoragePersistenceKey,
|
|
112336
112359
|
customBulkEditorFields,
|
|
@@ -116726,6 +116749,7 @@ var ServerSideDataTable = ({
|
|
|
116726
116749
|
onTableConfigChange,
|
|
116727
116750
|
enableCellTextSelection,
|
|
116728
116751
|
showExpandCollapseAllToggle,
|
|
116752
|
+
suppressBulkEditToasts,
|
|
116729
116753
|
translations: translations2 = {},
|
|
116730
116754
|
localStoragePersistenceKey,
|
|
116731
116755
|
enableCDN
|
|
@@ -116745,6 +116769,7 @@ var ServerSideDataTable = ({
|
|
|
116745
116769
|
onServerSideDataRequest,
|
|
116746
116770
|
onTableConfigChange,
|
|
116747
116771
|
showExpandCollapseAllToggle,
|
|
116772
|
+
suppressBulkEditToasts,
|
|
116748
116773
|
translations: translations2,
|
|
116749
116774
|
customBulkEditorFields,
|
|
116750
116775
|
enableCellTextSelection,
|
package/dist/modern/index.cjs
CHANGED
|
@@ -57750,6 +57750,7 @@ var InternalTableContext = React80__default.default.createContext({
|
|
|
57750
57750
|
onExpandOrCollapseAll: () => {
|
|
57751
57751
|
},
|
|
57752
57752
|
onServerSideDataRequest: void 0,
|
|
57753
|
+
suppressBulkEditToasts: false,
|
|
57753
57754
|
onTableConfigChange: () => {
|
|
57754
57755
|
},
|
|
57755
57756
|
updateServerSideDataSource: () => {
|
|
@@ -103426,13 +103427,13 @@ var BulkEditInput = (props) => {
|
|
|
103426
103427
|
);
|
|
103427
103428
|
case "peopleMultiSelect":
|
|
103428
103429
|
const {
|
|
103429
|
-
placeholder:
|
|
103430
|
-
...
|
|
103430
|
+
placeholder: peopleMultiSelectPlaceholder,
|
|
103431
|
+
...peopleMultiSelectParams
|
|
103431
103432
|
} = props.editorParams;
|
|
103432
103433
|
return /* @__PURE__ */ React80__default.default.createElement(
|
|
103433
103434
|
coreReact.Form.MultiSelect,
|
|
103434
103435
|
{
|
|
103435
|
-
...
|
|
103436
|
+
...peopleMultiSelectParams,
|
|
103436
103437
|
beforeShow: getBulkEditorOptions,
|
|
103437
103438
|
colWidth: 12,
|
|
103438
103439
|
"data-qa": `data-table-bulk-edit-input-${props.name}`,
|
|
@@ -103444,7 +103445,7 @@ var BulkEditInput = (props) => {
|
|
|
103444
103445
|
name: field.input.name,
|
|
103445
103446
|
optionRenderer: personOptionRenderer(props.editorParams),
|
|
103446
103447
|
options,
|
|
103447
|
-
placeholder:
|
|
103448
|
+
placeholder: peopleMultiSelectPlaceholder ?? placeholderForField
|
|
103448
103449
|
}
|
|
103449
103450
|
);
|
|
103450
103451
|
case "radio":
|
|
@@ -103550,7 +103551,7 @@ var BulkEditInput = (props) => {
|
|
|
103550
103551
|
}
|
|
103551
103552
|
};
|
|
103552
103553
|
var BulkEdit = React80__default.default.forwardRef(
|
|
103553
|
-
({ onReset = noop4 }, ref) => {
|
|
103554
|
+
({ onReset = noop4, suppressBulkEditToasts = false }, ref) => {
|
|
103554
103555
|
const {
|
|
103555
103556
|
analytics,
|
|
103556
103557
|
columnApi,
|
|
@@ -103652,14 +103653,18 @@ var BulkEdit = React80__default.default.forwardRef(
|
|
|
103652
103653
|
await onBulkEditUpdate?.(bulkEditedRows).then((result) => {
|
|
103653
103654
|
if (result === void 0) {
|
|
103654
103655
|
gridApi?.refreshServerSide({ purge: true });
|
|
103655
|
-
|
|
103656
|
+
if (!suppressBulkEditToasts) {
|
|
103657
|
+
showToast.success(I18n.t("dataTable.bulkActions.success"));
|
|
103658
|
+
}
|
|
103656
103659
|
resetForm({});
|
|
103657
103660
|
onReset();
|
|
103658
103661
|
} else {
|
|
103659
103662
|
throw new Error(result);
|
|
103660
103663
|
}
|
|
103661
103664
|
}).catch(() => {
|
|
103662
|
-
|
|
103665
|
+
if (!suppressBulkEditToasts) {
|
|
103666
|
+
showToast.error(I18n.t("dataTable.bulkActions.error"));
|
|
103667
|
+
}
|
|
103663
103668
|
});
|
|
103664
103669
|
} else {
|
|
103665
103670
|
try {
|
|
@@ -103667,11 +103672,15 @@ var BulkEdit = React80__default.default.forwardRef(
|
|
|
103667
103672
|
{ update: clientSideItemsToUpdate },
|
|
103668
103673
|
() => onBulkEditUpdate?.(bulkEditedRows)
|
|
103669
103674
|
);
|
|
103670
|
-
|
|
103675
|
+
if (!suppressBulkEditToasts) {
|
|
103676
|
+
showToast.success(I18n.t("dataTable.bulkActions.success"));
|
|
103677
|
+
}
|
|
103671
103678
|
resetForm({});
|
|
103672
103679
|
onReset();
|
|
103673
103680
|
} catch (error2) {
|
|
103674
|
-
|
|
103681
|
+
if (!suppressBulkEditToasts) {
|
|
103682
|
+
showToast.error(I18n.t("dataTable.bulkActions.error"));
|
|
103683
|
+
}
|
|
103675
103684
|
}
|
|
103676
103685
|
}
|
|
103677
103686
|
};
|
|
@@ -103699,7 +103708,7 @@ var BulkEdit = React80__default.default.forwardRef(
|
|
|
103699
103708
|
}
|
|
103700
103709
|
);
|
|
103701
103710
|
var BulkEditPanel = ({}) => {
|
|
103702
|
-
const { contextPanel } = useInternalTableContext();
|
|
103711
|
+
const { contextPanel, suppressBulkEditToasts } = useInternalTableContext();
|
|
103703
103712
|
const I18n = coreReact.useI18nContext();
|
|
103704
103713
|
const bulkEditRef = React80__default.default.useRef(null);
|
|
103705
103714
|
return /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel, null, /* @__PURE__ */ React80__default.default.createElement(
|
|
@@ -103711,7 +103720,14 @@ var BulkEditPanel = ({}) => {
|
|
|
103711
103720
|
}
|
|
103712
103721
|
},
|
|
103713
103722
|
/* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Title, null, I18n.t("dataTable.bulkActions.editValues"))
|
|
103714
|
-
), /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Body, null, /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Section, null, /* @__PURE__ */ React80__default.default.createElement(
|
|
103723
|
+
), /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Body, null, /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Section, null, /* @__PURE__ */ React80__default.default.createElement(
|
|
103724
|
+
BulkEdit,
|
|
103725
|
+
{
|
|
103726
|
+
ref: bulkEditRef,
|
|
103727
|
+
onReset: contextPanel.hide,
|
|
103728
|
+
suppressBulkEditToasts
|
|
103729
|
+
}
|
|
103730
|
+
))), /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.Footer, null, /* @__PURE__ */ React80__default.default.createElement(coreReact.Panel.FooterActions, null, /* @__PURE__ */ React80__default.default.createElement(
|
|
103715
103731
|
coreReact.Button,
|
|
103716
103732
|
{
|
|
103717
103733
|
key: "cancel",
|
|
@@ -108846,6 +108862,7 @@ var DataTable = ({
|
|
|
108846
108862
|
onServerSideDataRequest,
|
|
108847
108863
|
onTableConfigChange,
|
|
108848
108864
|
showExpandCollapseAllToggle,
|
|
108865
|
+
suppressBulkEditToasts,
|
|
108849
108866
|
translations: translations2 = {},
|
|
108850
108867
|
enableCellTextSelection,
|
|
108851
108868
|
localStoragePersistenceKey,
|
|
@@ -109091,6 +109108,7 @@ var DataTable = ({
|
|
|
109091
109108
|
onBulkEditUpdate,
|
|
109092
109109
|
onExpandOrCollapseAll,
|
|
109093
109110
|
onServerSideDataRequest,
|
|
109111
|
+
suppressBulkEditToasts,
|
|
109094
109112
|
onTableConfigChange: internalOnTableConfigChange,
|
|
109095
109113
|
rowSelectionRef,
|
|
109096
109114
|
expandCollapseStateRef,
|
|
@@ -111882,7 +111900,7 @@ var FiltersPanelButton = () => {
|
|
|
111882
111900
|
}
|
|
111883
111901
|
return /* @__PURE__ */ React80__default.default.createElement(ClientSideFiltersPanelToggleButton, null);
|
|
111884
111902
|
};
|
|
111885
|
-
var RowGroupSelector = ({ localeText }) => {
|
|
111903
|
+
var RowGroupSelector = ({ localeText, modifyRowGroupFieldsOnSelection }) => {
|
|
111886
111904
|
const {
|
|
111887
111905
|
columnDefinitions: _columnDefinitions,
|
|
111888
111906
|
columnApi,
|
|
@@ -111905,22 +111923,24 @@ var RowGroupSelector = ({ localeText }) => {
|
|
|
111905
111923
|
});
|
|
111906
111924
|
}, [columnDefinitions]);
|
|
111907
111925
|
const selectedColumns = React80__default.default.useMemo(
|
|
111908
|
-
() => mapColumnsToOptions(groupedColumns),
|
|
111926
|
+
() => mapColumnsToOptions(groupedColumns.filter((col) => col.enableRowGroup)),
|
|
111909
111927
|
[groupedColumns]
|
|
111910
111928
|
);
|
|
111911
111929
|
const onGroupedClear = React80__default.default.useCallback(() => {
|
|
111912
|
-
|
|
111913
|
-
|
|
111930
|
+
const modifiedFields = modifyRowGroupFieldsOnSelection?.([]) ?? [];
|
|
111931
|
+
tableRef?.current?.setRowGrouping(modifiedFields);
|
|
111932
|
+
}, [tableRef, modifyRowGroupFieldsOnSelection]);
|
|
111914
111933
|
const onGroupedRowChange = React80__default.default.useCallback(
|
|
111915
111934
|
(newValue) => {
|
|
111916
111935
|
const fields = newValue.map((val) => {
|
|
111917
111936
|
return val.id;
|
|
111918
111937
|
});
|
|
111938
|
+
const modifiedFields = modifyRowGroupFieldsOnSelection?.(fields) ?? fields;
|
|
111919
111939
|
if (!ramda.equals(selectedColumns, newValue)) {
|
|
111920
|
-
tableRef?.current?.setRowGrouping(
|
|
111940
|
+
tableRef?.current?.setRowGrouping(modifiedFields);
|
|
111921
111941
|
}
|
|
111922
111942
|
},
|
|
111923
|
-
[selectedColumns]
|
|
111943
|
+
[selectedColumns, modifyRowGroupFieldsOnSelection]
|
|
111924
111944
|
);
|
|
111925
111945
|
React80__default.default.useEffect(() => {
|
|
111926
111946
|
function onDisplayedColumnsChanged(event) {
|
|
@@ -112062,7 +112082,8 @@ var QuickControls = (props) => {
|
|
|
112062
112082
|
reset: I18n.t("dataTable.tableSettings.reset"),
|
|
112063
112083
|
placeholder: I18n.t("dataTable.tableSettings.selectColumnGroup"),
|
|
112064
112084
|
selectedItemsPrefix: I18n.t("dataTable.tableSettings.groupBy")
|
|
112065
|
-
}
|
|
112085
|
+
},
|
|
112086
|
+
modifyRowGroupFieldsOnSelection: props.modifyRowGroupFieldsOnSelection
|
|
112066
112087
|
}
|
|
112067
112088
|
), /* @__PURE__ */ React80__default.default.createElement(ConfigPanelButton, null))), /* @__PURE__ */ React80__default.default.createElement(
|
|
112068
112089
|
QuickFilters,
|
|
@@ -112095,6 +112116,7 @@ var ClientSideDataTable = ({
|
|
|
112095
112116
|
onBulkEditUpdate,
|
|
112096
112117
|
onExpandOrCollapseAll,
|
|
112097
112118
|
onTableConfigChange,
|
|
112119
|
+
suppressBulkEditToasts,
|
|
112098
112120
|
translations: translations2 = {},
|
|
112099
112121
|
enableCellTextSelection,
|
|
112100
112122
|
localStoragePersistenceKey,
|
|
@@ -112114,6 +112136,7 @@ var ClientSideDataTable = ({
|
|
|
112114
112136
|
onExpandOrCollapseAll,
|
|
112115
112137
|
onTableConfigChange,
|
|
112116
112138
|
showExpandCollapseAllToggle: true,
|
|
112139
|
+
suppressBulkEditToasts,
|
|
112117
112140
|
translations: translations2,
|
|
112118
112141
|
localStoragePersistenceKey,
|
|
112119
112142
|
customBulkEditorFields,
|
|
@@ -116508,6 +116531,7 @@ var ServerSideDataTable = ({
|
|
|
116508
116531
|
onTableConfigChange,
|
|
116509
116532
|
enableCellTextSelection,
|
|
116510
116533
|
showExpandCollapseAllToggle,
|
|
116534
|
+
suppressBulkEditToasts,
|
|
116511
116535
|
translations: translations2 = {},
|
|
116512
116536
|
localStoragePersistenceKey,
|
|
116513
116537
|
enableCDN
|
|
@@ -116527,6 +116551,7 @@ var ServerSideDataTable = ({
|
|
|
116527
116551
|
onServerSideDataRequest,
|
|
116528
116552
|
onTableConfigChange,
|
|
116529
116553
|
showExpandCollapseAllToggle,
|
|
116554
|
+
suppressBulkEditToasts,
|
|
116530
116555
|
translations: translations2,
|
|
116531
116556
|
customBulkEditorFields,
|
|
116532
116557
|
enableCellTextSelection,
|
package/dist/modern/index.d.cts
CHANGED
|
@@ -1162,6 +1162,11 @@ interface DataTableProps {
|
|
|
1162
1162
|
* the updated values
|
|
1163
1163
|
*/
|
|
1164
1164
|
onBulkEditUpdate?: (rows: BulkEditResult[]) => Promise<void>;
|
|
1165
|
+
/**
|
|
1166
|
+
* When true, suppresses the success and error toast messages
|
|
1167
|
+
* that are normally shown after bulk edit operations
|
|
1168
|
+
*/
|
|
1169
|
+
suppressBulkEditToasts?: boolean;
|
|
1165
1170
|
localStoragePersistenceKey?: string;
|
|
1166
1171
|
showExpandCollapseAllToggle?: boolean;
|
|
1167
1172
|
translations?: DataTableTranslations;
|
|
@@ -1380,6 +1385,7 @@ interface InternalTableContext {
|
|
|
1380
1385
|
filterStorage: IFilterStorage;
|
|
1381
1386
|
onBulkEditUpdate: DataTableProps['onBulkEditUpdate'];
|
|
1382
1387
|
onServerSideDataRequest?: DataTableProps['onServerSideDataRequest'];
|
|
1388
|
+
suppressBulkEditToasts?: DataTableProps['suppressBulkEditToasts'];
|
|
1383
1389
|
updateServerSideDataSource: (params: UpdateServerSideDataSourceParams) => void;
|
|
1384
1390
|
localStoragePersistenceKey?: string;
|
|
1385
1391
|
onExpandOrCollapseAll?: (expanded: boolean) => void;
|
|
@@ -1446,6 +1452,7 @@ interface QuickControlsProps extends Omit<SearchProps, 'disabled'> {
|
|
|
1446
1452
|
style?: React__default.CSSProperties;
|
|
1447
1453
|
disabledSearch?: boolean;
|
|
1448
1454
|
filterOverlayMatchesTriggerWidth?: boolean;
|
|
1455
|
+
modifyRowGroupFieldsOnSelection?: (userSelection: string[]) => string[];
|
|
1449
1456
|
}
|
|
1450
1457
|
|
|
1451
1458
|
interface ActionButtonProps {
|
|
@@ -1463,7 +1470,7 @@ interface BulkActionProps {
|
|
|
1463
1470
|
style?: React__default.CSSProperties;
|
|
1464
1471
|
}
|
|
1465
1472
|
|
|
1466
|
-
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1473
|
+
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onTableConfigChange, suppressBulkEditToasts, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1467
1474
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1468
1475
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1469
1476
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1478,6 +1485,7 @@ declare const _default$1: (({ analytics, children, columnDefinitions: _columnDef
|
|
|
1478
1485
|
placeholder: string;
|
|
1479
1486
|
selectedItemsPrefix?: string | undefined;
|
|
1480
1487
|
};
|
|
1488
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1481
1489
|
}>;
|
|
1482
1490
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1483
1491
|
Table: React__default.FC<Omit<TableProps<any, any>, "selectionSSREnabled" | "modules">>;
|
|
@@ -1500,7 +1508,7 @@ declare const MultiSelectQuickFilterRenderer: (props: FilterProps<any[]>) => Rea
|
|
|
1500
1508
|
|
|
1501
1509
|
declare const SingleSelectQuickFilterRenderer: (props: FilterProps<any[]>) => React__default.JSX.Element;
|
|
1502
1510
|
|
|
1503
|
-
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1511
|
+
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, suppressBulkEditToasts, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1504
1512
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1505
1513
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1506
1514
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1515,6 +1523,7 @@ declare const _default: (({ analytics, children, columnDefinitions: _columnDefin
|
|
|
1515
1523
|
placeholder: string;
|
|
1516
1524
|
selectedItemsPrefix?: string | undefined;
|
|
1517
1525
|
};
|
|
1526
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1518
1527
|
}>;
|
|
1519
1528
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1520
1529
|
Table: React__default.FC<Omit<TableProps<any, any>, "rows" | "modules">>;
|
package/dist/modern/index.d.ts
CHANGED
|
@@ -1162,6 +1162,11 @@ interface DataTableProps {
|
|
|
1162
1162
|
* the updated values
|
|
1163
1163
|
*/
|
|
1164
1164
|
onBulkEditUpdate?: (rows: BulkEditResult[]) => Promise<void>;
|
|
1165
|
+
/**
|
|
1166
|
+
* When true, suppresses the success and error toast messages
|
|
1167
|
+
* that are normally shown after bulk edit operations
|
|
1168
|
+
*/
|
|
1169
|
+
suppressBulkEditToasts?: boolean;
|
|
1165
1170
|
localStoragePersistenceKey?: string;
|
|
1166
1171
|
showExpandCollapseAllToggle?: boolean;
|
|
1167
1172
|
translations?: DataTableTranslations;
|
|
@@ -1380,6 +1385,7 @@ interface InternalTableContext {
|
|
|
1380
1385
|
filterStorage: IFilterStorage;
|
|
1381
1386
|
onBulkEditUpdate: DataTableProps['onBulkEditUpdate'];
|
|
1382
1387
|
onServerSideDataRequest?: DataTableProps['onServerSideDataRequest'];
|
|
1388
|
+
suppressBulkEditToasts?: DataTableProps['suppressBulkEditToasts'];
|
|
1383
1389
|
updateServerSideDataSource: (params: UpdateServerSideDataSourceParams) => void;
|
|
1384
1390
|
localStoragePersistenceKey?: string;
|
|
1385
1391
|
onExpandOrCollapseAll?: (expanded: boolean) => void;
|
|
@@ -1446,6 +1452,7 @@ interface QuickControlsProps extends Omit<SearchProps, 'disabled'> {
|
|
|
1446
1452
|
style?: React__default.CSSProperties;
|
|
1447
1453
|
disabledSearch?: boolean;
|
|
1448
1454
|
filterOverlayMatchesTriggerWidth?: boolean;
|
|
1455
|
+
modifyRowGroupFieldsOnSelection?: (userSelection: string[]) => string[];
|
|
1449
1456
|
}
|
|
1450
1457
|
|
|
1451
1458
|
interface ActionButtonProps {
|
|
@@ -1463,7 +1470,7 @@ interface BulkActionProps {
|
|
|
1463
1470
|
style?: React__default.CSSProperties;
|
|
1464
1471
|
}
|
|
1465
1472
|
|
|
1466
|
-
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1473
|
+
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onTableConfigChange, suppressBulkEditToasts, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1467
1474
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1468
1475
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1469
1476
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1478,6 +1485,7 @@ declare const _default$1: (({ analytics, children, columnDefinitions: _columnDef
|
|
|
1478
1485
|
placeholder: string;
|
|
1479
1486
|
selectedItemsPrefix?: string | undefined;
|
|
1480
1487
|
};
|
|
1488
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1481
1489
|
}>;
|
|
1482
1490
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1483
1491
|
Table: React__default.FC<Omit<TableProps<any, any>, "selectionSSREnabled" | "modules">>;
|
|
@@ -1500,7 +1508,7 @@ declare const MultiSelectQuickFilterRenderer: (props: FilterProps<any[]>) => Rea
|
|
|
1500
1508
|
|
|
1501
1509
|
declare const SingleSelectQuickFilterRenderer: (props: FilterProps<any[]>) => React__default.JSX.Element;
|
|
1502
1510
|
|
|
1503
|
-
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1511
|
+
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onExpandOrCollapseAll, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, suppressBulkEditToasts, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1504
1512
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1505
1513
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1506
1514
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1515,6 +1523,7 @@ declare const _default: (({ analytics, children, columnDefinitions: _columnDefin
|
|
|
1515
1523
|
placeholder: string;
|
|
1516
1524
|
selectedItemsPrefix?: string | undefined;
|
|
1517
1525
|
};
|
|
1526
|
+
modifyRowGroupFieldsOnSelection?: ((userSelection: string[]) => string[]) | undefined;
|
|
1518
1527
|
}>;
|
|
1519
1528
|
Search: React__default.FunctionComponent<SearchProps>;
|
|
1520
1529
|
Table: React__default.FC<Omit<TableProps<any, any>, "rows" | "modules">>;
|
package/dist/modern/index.js
CHANGED
|
@@ -57737,6 +57737,7 @@ var InternalTableContext = React80.createContext({
|
|
|
57737
57737
|
onExpandOrCollapseAll: () => {
|
|
57738
57738
|
},
|
|
57739
57739
|
onServerSideDataRequest: void 0,
|
|
57740
|
+
suppressBulkEditToasts: false,
|
|
57740
57741
|
onTableConfigChange: () => {
|
|
57741
57742
|
},
|
|
57742
57743
|
updateServerSideDataSource: () => {
|
|
@@ -103413,13 +103414,13 @@ var BulkEditInput = (props) => {
|
|
|
103413
103414
|
);
|
|
103414
103415
|
case "peopleMultiSelect":
|
|
103415
103416
|
const {
|
|
103416
|
-
placeholder:
|
|
103417
|
-
...
|
|
103417
|
+
placeholder: peopleMultiSelectPlaceholder,
|
|
103418
|
+
...peopleMultiSelectParams
|
|
103418
103419
|
} = props.editorParams;
|
|
103419
103420
|
return /* @__PURE__ */ React80.createElement(
|
|
103420
103421
|
Form.MultiSelect,
|
|
103421
103422
|
{
|
|
103422
|
-
...
|
|
103423
|
+
...peopleMultiSelectParams,
|
|
103423
103424
|
beforeShow: getBulkEditorOptions,
|
|
103424
103425
|
colWidth: 12,
|
|
103425
103426
|
"data-qa": `data-table-bulk-edit-input-${props.name}`,
|
|
@@ -103431,7 +103432,7 @@ var BulkEditInput = (props) => {
|
|
|
103431
103432
|
name: field.input.name,
|
|
103432
103433
|
optionRenderer: personOptionRenderer(props.editorParams),
|
|
103433
103434
|
options,
|
|
103434
|
-
placeholder:
|
|
103435
|
+
placeholder: peopleMultiSelectPlaceholder ?? placeholderForField
|
|
103435
103436
|
}
|
|
103436
103437
|
);
|
|
103437
103438
|
case "radio":
|
|
@@ -103537,7 +103538,7 @@ var BulkEditInput = (props) => {
|
|
|
103537
103538
|
}
|
|
103538
103539
|
};
|
|
103539
103540
|
var BulkEdit = React80.forwardRef(
|
|
103540
|
-
({ onReset = noop4 }, ref) => {
|
|
103541
|
+
({ onReset = noop4, suppressBulkEditToasts = false }, ref) => {
|
|
103541
103542
|
const {
|
|
103542
103543
|
analytics,
|
|
103543
103544
|
columnApi,
|
|
@@ -103639,14 +103640,18 @@ var BulkEdit = React80.forwardRef(
|
|
|
103639
103640
|
await onBulkEditUpdate?.(bulkEditedRows).then((result) => {
|
|
103640
103641
|
if (result === void 0) {
|
|
103641
103642
|
gridApi?.refreshServerSide({ purge: true });
|
|
103642
|
-
|
|
103643
|
+
if (!suppressBulkEditToasts) {
|
|
103644
|
+
showToast.success(I18n.t("dataTable.bulkActions.success"));
|
|
103645
|
+
}
|
|
103643
103646
|
resetForm({});
|
|
103644
103647
|
onReset();
|
|
103645
103648
|
} else {
|
|
103646
103649
|
throw new Error(result);
|
|
103647
103650
|
}
|
|
103648
103651
|
}).catch(() => {
|
|
103649
|
-
|
|
103652
|
+
if (!suppressBulkEditToasts) {
|
|
103653
|
+
showToast.error(I18n.t("dataTable.bulkActions.error"));
|
|
103654
|
+
}
|
|
103650
103655
|
});
|
|
103651
103656
|
} else {
|
|
103652
103657
|
try {
|
|
@@ -103654,11 +103659,15 @@ var BulkEdit = React80.forwardRef(
|
|
|
103654
103659
|
{ update: clientSideItemsToUpdate },
|
|
103655
103660
|
() => onBulkEditUpdate?.(bulkEditedRows)
|
|
103656
103661
|
);
|
|
103657
|
-
|
|
103662
|
+
if (!suppressBulkEditToasts) {
|
|
103663
|
+
showToast.success(I18n.t("dataTable.bulkActions.success"));
|
|
103664
|
+
}
|
|
103658
103665
|
resetForm({});
|
|
103659
103666
|
onReset();
|
|
103660
103667
|
} catch (error2) {
|
|
103661
|
-
|
|
103668
|
+
if (!suppressBulkEditToasts) {
|
|
103669
|
+
showToast.error(I18n.t("dataTable.bulkActions.error"));
|
|
103670
|
+
}
|
|
103662
103671
|
}
|
|
103663
103672
|
}
|
|
103664
103673
|
};
|
|
@@ -103686,7 +103695,7 @@ var BulkEdit = React80.forwardRef(
|
|
|
103686
103695
|
}
|
|
103687
103696
|
);
|
|
103688
103697
|
var BulkEditPanel = ({}) => {
|
|
103689
|
-
const { contextPanel } = useInternalTableContext();
|
|
103698
|
+
const { contextPanel, suppressBulkEditToasts } = useInternalTableContext();
|
|
103690
103699
|
const I18n = useI18nContext();
|
|
103691
103700
|
const bulkEditRef = React80.useRef(null);
|
|
103692
103701
|
return /* @__PURE__ */ React80.createElement(Panel, null, /* @__PURE__ */ React80.createElement(
|
|
@@ -103698,7 +103707,14 @@ var BulkEditPanel = ({}) => {
|
|
|
103698
103707
|
}
|
|
103699
103708
|
},
|
|
103700
103709
|
/* @__PURE__ */ React80.createElement(Panel.Title, null, I18n.t("dataTable.bulkActions.editValues"))
|
|
103701
|
-
), /* @__PURE__ */ React80.createElement(Panel.Body, null, /* @__PURE__ */ React80.createElement(Panel.Section, null, /* @__PURE__ */ React80.createElement(
|
|
103710
|
+
), /* @__PURE__ */ React80.createElement(Panel.Body, null, /* @__PURE__ */ React80.createElement(Panel.Section, null, /* @__PURE__ */ React80.createElement(
|
|
103711
|
+
BulkEdit,
|
|
103712
|
+
{
|
|
103713
|
+
ref: bulkEditRef,
|
|
103714
|
+
onReset: contextPanel.hide,
|
|
103715
|
+
suppressBulkEditToasts
|
|
103716
|
+
}
|
|
103717
|
+
))), /* @__PURE__ */ React80.createElement(Panel.Footer, null, /* @__PURE__ */ React80.createElement(Panel.FooterActions, null, /* @__PURE__ */ React80.createElement(
|
|
103702
103718
|
Button,
|
|
103703
103719
|
{
|
|
103704
103720
|
key: "cancel",
|
|
@@ -108833,6 +108849,7 @@ var DataTable = ({
|
|
|
108833
108849
|
onServerSideDataRequest,
|
|
108834
108850
|
onTableConfigChange,
|
|
108835
108851
|
showExpandCollapseAllToggle,
|
|
108852
|
+
suppressBulkEditToasts,
|
|
108836
108853
|
translations: translations2 = {},
|
|
108837
108854
|
enableCellTextSelection,
|
|
108838
108855
|
localStoragePersistenceKey,
|
|
@@ -109078,6 +109095,7 @@ var DataTable = ({
|
|
|
109078
109095
|
onBulkEditUpdate,
|
|
109079
109096
|
onExpandOrCollapseAll,
|
|
109080
109097
|
onServerSideDataRequest,
|
|
109098
|
+
suppressBulkEditToasts,
|
|
109081
109099
|
onTableConfigChange: internalOnTableConfigChange,
|
|
109082
109100
|
rowSelectionRef,
|
|
109083
109101
|
expandCollapseStateRef,
|
|
@@ -111869,7 +111887,7 @@ var FiltersPanelButton = () => {
|
|
|
111869
111887
|
}
|
|
111870
111888
|
return /* @__PURE__ */ React80.createElement(ClientSideFiltersPanelToggleButton, null);
|
|
111871
111889
|
};
|
|
111872
|
-
var RowGroupSelector = ({ localeText }) => {
|
|
111890
|
+
var RowGroupSelector = ({ localeText, modifyRowGroupFieldsOnSelection }) => {
|
|
111873
111891
|
const {
|
|
111874
111892
|
columnDefinitions: _columnDefinitions,
|
|
111875
111893
|
columnApi,
|
|
@@ -111892,22 +111910,24 @@ var RowGroupSelector = ({ localeText }) => {
|
|
|
111892
111910
|
});
|
|
111893
111911
|
}, [columnDefinitions]);
|
|
111894
111912
|
const selectedColumns = React80.useMemo(
|
|
111895
|
-
() => mapColumnsToOptions(groupedColumns),
|
|
111913
|
+
() => mapColumnsToOptions(groupedColumns.filter((col) => col.enableRowGroup)),
|
|
111896
111914
|
[groupedColumns]
|
|
111897
111915
|
);
|
|
111898
111916
|
const onGroupedClear = React80.useCallback(() => {
|
|
111899
|
-
|
|
111900
|
-
|
|
111917
|
+
const modifiedFields = modifyRowGroupFieldsOnSelection?.([]) ?? [];
|
|
111918
|
+
tableRef?.current?.setRowGrouping(modifiedFields);
|
|
111919
|
+
}, [tableRef, modifyRowGroupFieldsOnSelection]);
|
|
111901
111920
|
const onGroupedRowChange = React80.useCallback(
|
|
111902
111921
|
(newValue) => {
|
|
111903
111922
|
const fields = newValue.map((val) => {
|
|
111904
111923
|
return val.id;
|
|
111905
111924
|
});
|
|
111925
|
+
const modifiedFields = modifyRowGroupFieldsOnSelection?.(fields) ?? fields;
|
|
111906
111926
|
if (!equals(selectedColumns, newValue)) {
|
|
111907
|
-
tableRef?.current?.setRowGrouping(
|
|
111927
|
+
tableRef?.current?.setRowGrouping(modifiedFields);
|
|
111908
111928
|
}
|
|
111909
111929
|
},
|
|
111910
|
-
[selectedColumns]
|
|
111930
|
+
[selectedColumns, modifyRowGroupFieldsOnSelection]
|
|
111911
111931
|
);
|
|
111912
111932
|
React80.useEffect(() => {
|
|
111913
111933
|
function onDisplayedColumnsChanged(event) {
|
|
@@ -112049,7 +112069,8 @@ var QuickControls = (props) => {
|
|
|
112049
112069
|
reset: I18n.t("dataTable.tableSettings.reset"),
|
|
112050
112070
|
placeholder: I18n.t("dataTable.tableSettings.selectColumnGroup"),
|
|
112051
112071
|
selectedItemsPrefix: I18n.t("dataTable.tableSettings.groupBy")
|
|
112052
|
-
}
|
|
112072
|
+
},
|
|
112073
|
+
modifyRowGroupFieldsOnSelection: props.modifyRowGroupFieldsOnSelection
|
|
112053
112074
|
}
|
|
112054
112075
|
), /* @__PURE__ */ React80.createElement(ConfigPanelButton, null))), /* @__PURE__ */ React80.createElement(
|
|
112055
112076
|
QuickFilters,
|
|
@@ -112082,6 +112103,7 @@ var ClientSideDataTable = ({
|
|
|
112082
112103
|
onBulkEditUpdate,
|
|
112083
112104
|
onExpandOrCollapseAll,
|
|
112084
112105
|
onTableConfigChange,
|
|
112106
|
+
suppressBulkEditToasts,
|
|
112085
112107
|
translations: translations2 = {},
|
|
112086
112108
|
enableCellTextSelection,
|
|
112087
112109
|
localStoragePersistenceKey,
|
|
@@ -112101,6 +112123,7 @@ var ClientSideDataTable = ({
|
|
|
112101
112123
|
onExpandOrCollapseAll,
|
|
112102
112124
|
onTableConfigChange,
|
|
112103
112125
|
showExpandCollapseAllToggle: true,
|
|
112126
|
+
suppressBulkEditToasts,
|
|
112104
112127
|
translations: translations2,
|
|
112105
112128
|
localStoragePersistenceKey,
|
|
112106
112129
|
customBulkEditorFields,
|
|
@@ -116495,6 +116518,7 @@ var ServerSideDataTable = ({
|
|
|
116495
116518
|
onTableConfigChange,
|
|
116496
116519
|
enableCellTextSelection,
|
|
116497
116520
|
showExpandCollapseAllToggle,
|
|
116521
|
+
suppressBulkEditToasts,
|
|
116498
116522
|
translations: translations2 = {},
|
|
116499
116523
|
localStoragePersistenceKey,
|
|
116500
116524
|
enableCDN
|
|
@@ -116514,6 +116538,7 @@ var ServerSideDataTable = ({
|
|
|
116514
116538
|
onServerSideDataRequest,
|
|
116515
116539
|
onTableConfigChange,
|
|
116516
116540
|
showExpandCollapseAllToggle,
|
|
116541
|
+
suppressBulkEditToasts,
|
|
116517
116542
|
translations: translations2,
|
|
116518
116543
|
customBulkEditorFields,
|
|
116519
116544
|
enableCellTextSelection,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procore/data-table",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.41.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",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@procore/error-pages": "^0.2.3",
|
|
78
78
|
"@procore/labs-datetime-select": "^0.2.0",
|
|
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.35.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",
|