@redsift/table 12.5.2-muiv7 → 12.5.3-alpha.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.
@@ -1,2 +1,2 @@
1
- export { C as ControlledPagination, S as ServerSideControlledPagination, f as fixServerSideHeaderCheckboxSelection, g as getSelectableRowIdsInPage, o as onServerSideSelectionStatusChange } from './ControlledPagination.js';
1
+ export { C as ControlledPagination, S as ServerSideControlledPagination, f as fixServerSideHeaderCheckboxSelection, b as getSelectableRowIdsInPage, o as onServerSideSelectionStatusChange } from './ServerSideControlledPagination.js';
2
2
  //# sourceMappingURL=Pagination.js.map
@@ -0,0 +1,318 @@
1
+ import { b as _extends } from './_rollupPluginBabelHelpers.js';
2
+ import React__default from 'react';
3
+ import { Flexbox, Text, LinkButton } from '@redsift/design-system';
4
+ import { gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, gridExpandedSortedRowEntriesSelector } from '@mui/x-data-grid-premium';
5
+ import TablePagination from '@mui/material/TablePagination';
6
+
7
+ /**
8
+ * Type for legacy array-based row selection (v7 and earlier)
9
+ */
10
+
11
+ /**
12
+ * Type that accepts both legacy array format and new v8 object format
13
+ */
14
+
15
+ /**
16
+ * Default empty row selection model for MUI DataGrid v8+
17
+ * In v8, GridRowSelectionModel changed from GridRowId[] to { type: 'include' | 'exclude'; ids: Set<GridRowId> }
18
+ */
19
+ const EMPTY_ROW_SELECTION_MODEL = {
20
+ type: 'include',
21
+ ids: new Set()
22
+ };
23
+
24
+ /**
25
+ * Creates a new row selection model with the given ids
26
+ */
27
+ const createRowSelectionModel = ids => ({
28
+ type: 'include',
29
+ ids: ids instanceof Set ? ids : new Set(ids)
30
+ });
31
+
32
+ /**
33
+ * Normalizes a row selection model input to the v8 GridRowSelectionModel format.
34
+ * Accepts both legacy array format (v7) and new object format (v8).
35
+ * This allows consumers to continue using arrays while internally using the v8 format.
36
+ */
37
+ const normalizeRowSelectionModel = input => {
38
+ if (!input) {
39
+ return EMPTY_ROW_SELECTION_MODEL;
40
+ }
41
+ // If it's an array (legacy v7 format), convert to v8 format
42
+ if (Array.isArray(input)) {
43
+ return createRowSelectionModel(input);
44
+ }
45
+ // Already in v8 format
46
+ return input;
47
+ };
48
+
49
+ /**
50
+ * Gets the size/count of selected rows from a selection model
51
+ */
52
+ const getSelectionCount = model => {
53
+ return model.ids.size;
54
+ };
55
+
56
+ /**
57
+ * Checks if a row is selected in the given selection model
58
+ */
59
+ const isRowSelected = (model, rowId) => {
60
+ if (model.type === 'include') {
61
+ return model.ids.has(rowId);
62
+ }
63
+ // For 'exclude' type, row is selected if it's NOT in the ids set
64
+ return !model.ids.has(rowId);
65
+ };
66
+
67
+ /**
68
+ * Converts a selection model to an array of selected row IDs
69
+ * Note: For 'exclude' type, this only returns the ids that are explicitly excluded,
70
+ * not the actual selected rows (which would require knowing all row ids)
71
+ */
72
+ const getSelectedIds = model => {
73
+ return Array.from(model.ids);
74
+ };
75
+
76
+ const getSelectableRowsInTable = (apiRef, isRowSelectable) => {
77
+ if (!apiRef.current) {
78
+ return [];
79
+ }
80
+ return isRowSelectable && typeof isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref => {
81
+ let {
82
+ model
83
+ } = _ref;
84
+ return isRowSelectable === null || isRowSelectable === void 0 ? void 0 : isRowSelectable({
85
+ row: model
86
+ });
87
+ }).map(_ref2 => {
88
+ let {
89
+ id
90
+ } = _ref2;
91
+ return id;
92
+ }) : gridFilteredSortedRowIdsSelector(apiRef);
93
+ };
94
+ const ControlledPagination = _ref3 => {
95
+ let {
96
+ displaySelection = false,
97
+ displayRowsPerPage = false,
98
+ displayPagination = false,
99
+ selectionStatus,
100
+ apiRef,
101
+ paginationModel,
102
+ onPaginationModelChange,
103
+ pageSizeOptions,
104
+ isRowSelectable,
105
+ paginationProps
106
+ } = _ref3;
107
+ const filteredRowsInTable = getSelectableRowsInTable(apiRef);
108
+ const selectableRowsInTable = getSelectableRowsInTable(apiRef, isRowSelectable);
109
+ const numberOfFilteredRowsInTable = filteredRowsInTable.length;
110
+ const numberOfSelectableRowsInTable = selectableRowsInTable.length;
111
+ return /*#__PURE__*/React__default.createElement(Flexbox, {
112
+ flexDirection: "row",
113
+ alignItems: "center",
114
+ justifyContent: "space-between",
115
+ marginBottom: "7px"
116
+ }, displaySelection ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, selectionStatus.type === 'page' ? /*#__PURE__*/React__default.createElement(Text, {
117
+ fontSize: "14px"
118
+ }, `All ${selectionStatus.numberOfSelectedRows}${numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''} rows on this page are selected. `, /*#__PURE__*/React__default.createElement(LinkButton, {
119
+ onClick: () => {
120
+ var _apiRef$current, _apiRef$current2;
121
+ (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.selectRows(numberOfSelectableRowsInTable ? selectableRowsInTable : (_apiRef$current2 = apiRef.current) === null || _apiRef$current2 === void 0 ? void 0 : _apiRef$current2.getAllRowIds());
122
+ }
123
+ }, "Select all ", numberOfSelectableRowsInTable, numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : '', " rows in the table.")) : selectionStatus.type === 'table' ? /*#__PURE__*/React__default.createElement(Text, {
124
+ fontSize: "14px"
125
+ }, `All ${selectionStatus.numberOfSelectedRows}${numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''} rows in the table are selected. `, /*#__PURE__*/React__default.createElement(LinkButton, {
126
+ onClick: () => {
127
+ var _apiRef$current3;
128
+ (_apiRef$current3 = apiRef.current) === null || _apiRef$current3 === void 0 ? void 0 : _apiRef$current3.selectRows([], false, true);
129
+ }
130
+ }, "Clear selection.")) : selectionStatus.type === 'other' ? /*#__PURE__*/React__default.createElement(Text, {
131
+ fontSize: "14px"
132
+ }, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination, _extends({
133
+ component: "div",
134
+ count: numberOfFilteredRowsInTable,
135
+ page: paginationModel.page,
136
+ onPageChange: (event, page) => {
137
+ onPaginationModelChange({
138
+ page,
139
+ pageSize: paginationModel.pageSize
140
+ }, {
141
+ reason: 'setPaginationModel'
142
+ });
143
+ },
144
+ rowsPerPage: paginationModel.pageSize,
145
+ onRowsPerPageChange: event => {
146
+ onPaginationModelChange({
147
+ page: paginationModel.page,
148
+ pageSize: parseInt(event.target.value, 10)
149
+ }, {
150
+ reason: 'setPaginationModel'
151
+ });
152
+ },
153
+ rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
154
+ }, paginationProps)) : null);
155
+ };
156
+
157
+ /**
158
+ * Get the IDs of all selectable rows currently loaded in the grid (i.e. the current page for server-side).
159
+ */
160
+ const getSelectableRowIdsInPage = (apiRef, isRowSelectable) => {
161
+ const rowsInPage = Array.from(gridExpandedSortedRowEntriesSelector(apiRef));
162
+ return isRowSelectable ? rowsInPage.filter(_ref => {
163
+ let {
164
+ id,
165
+ model
166
+ } = _ref;
167
+ return isRowSelectable({
168
+ id,
169
+ row: model
170
+ });
171
+ }).map(_ref2 => {
172
+ let {
173
+ id
174
+ } = _ref2;
175
+ return id;
176
+ }) : rowsInPage.map(_ref3 => {
177
+ let {
178
+ id
179
+ } = _ref3;
180
+ return id;
181
+ });
182
+ };
183
+
184
+ /**
185
+ * Intercept MUI's `onRowSelectionModelChange` for server-side pagination to fix the
186
+ * header checkbox behavior when cross-page selections exist.
187
+ *
188
+ * Problem: With `checkboxSelectionVisibleOnly=false` and `keepNonExistentRowsSelected`,
189
+ * the header checkbox shows "indeterminate" when rows from other pages are selected but
190
+ * none on the current page. Clicking it makes MUI deselect everything (treating it as a
191
+ * global toggle-off), but the user's intent is to select the current page.
192
+ *
193
+ * Fix: When MUI empties the selection model and the previous status was 'other' (cross-page
194
+ * selections with 0 selected on current page), we merge all current page rows with the
195
+ * existing cross-page selections instead.
196
+ */
197
+ const fixServerSideHeaderCheckboxSelection = (newSelectionModel, previousSelectionModel, selectionStatus, apiRef, isRowSelectable) => {
198
+ // Detect: MUI cleared everything, but we had cross-page selections with 0 on current page.
199
+ // This means the header checkbox was clicked in indeterminate state → user wants to select current page.
200
+ if (getSelectionCount(newSelectionModel) === 0 && getSelectionCount(previousSelectionModel) > 0 && selectionStatus.current.type === 'other' && selectionStatus.current.numberOfSelectedRowsInPage === 0) {
201
+ const selectableInPage = getSelectableRowIdsInPage(apiRef, isRowSelectable);
202
+ // Merge: keep existing cross-page selections + add all current page rows
203
+ const mergedIds = new Set(previousSelectionModel.ids);
204
+ for (const id of selectableInPage) {
205
+ mergedIds.add(id);
206
+ }
207
+ return {
208
+ type: 'include',
209
+ ids: mergedIds
210
+ };
211
+ }
212
+ return newSelectionModel;
213
+ };
214
+ const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionStatus, forceUpdate, isRowSelectable, page, pageSize) => {
215
+ if (!apiRef.current) {
216
+ return;
217
+ }
218
+
219
+ // We can't rely on the gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef) function to fetch the list of visible rows
220
+ // as it doesn't work properly when all rows are selected on a page via checkbox
221
+ // and then navigate to another page.
222
+ // So instead we fetch the visible rows directly from the apiRef state, since the logic in `onServerSideSelectionStatusChange` applies
223
+ // to server-side pagination only and visible rows are all loaded rows.
224
+ // The bug may have been latent for several MUI releases now, as it seems to have been fixed in MUI v7.
225
+ // See https://github.com/mui/mui-x/pull/14083
226
+ const selectableRowsInPage = getSelectableRowIdsInPage(apiRef, isRowSelectable);
227
+ const numberOfSelectableRowsInPage = selectableRowsInPage.length;
228
+ const numberOfSelectedRows = getSelectionCount(newSelectionModel);
229
+ const selectedRowsInPage = selectableRowsInPage.filter(rowId => isRowSelected(newSelectionModel, rowId));
230
+ const numberOfSelectedRowsInPage = selectedRowsInPage.length;
231
+ const isSamePage = (selectionStatus === null || selectionStatus === void 0 ? void 0 : selectionStatus.current.page) == page;
232
+ const isSamePageSize = (selectionStatus === null || selectionStatus === void 0 ? void 0 : selectionStatus.current.pageSize) == pageSize;
233
+
234
+ // if previous status is `page`,
235
+ // if page and pageSize didn't change
236
+ // and all the rows are selected, deselect all row
237
+ if (selectionStatus.current.type === 'page' && isSamePage && isSamePageSize && numberOfSelectedRowsInPage === numberOfSelectableRowsInPage) {
238
+ setTimeout(() => {
239
+ var _apiRef$current;
240
+ (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.selectRows(selectedRowsInPage, false, false);
241
+ }, 0);
242
+ }
243
+ if (numberOfSelectedRowsInPage === numberOfSelectableRowsInPage && numberOfSelectableRowsInPage != 0) {
244
+ selectionStatus.current = {
245
+ type: 'page',
246
+ numberOfSelectedRows,
247
+ numberOfSelectedRowsInPage,
248
+ page,
249
+ pageSize
250
+ };
251
+ } else if (numberOfSelectedRows > 0) {
252
+ selectionStatus.current = {
253
+ type: 'other',
254
+ numberOfSelectedRows,
255
+ numberOfSelectedRowsInPage,
256
+ page,
257
+ pageSize
258
+ };
259
+ } else {
260
+ selectionStatus.current = {
261
+ type: 'none',
262
+ numberOfSelectedRows,
263
+ numberOfSelectedRowsInPage,
264
+ page,
265
+ pageSize
266
+ };
267
+ }
268
+
269
+ // Force a re-render to update the UI with the new selection status
270
+ forceUpdate(v => v + 1);
271
+ };
272
+ const ServerSideControlledPagination = _ref4 => {
273
+ let {
274
+ selectionStatus,
275
+ displaySelection,
276
+ displayPagination,
277
+ paginationModel,
278
+ onPaginationModelChange,
279
+ pageSizeOptions,
280
+ displayRowsPerPage,
281
+ paginationProps,
282
+ rowCount
283
+ } = _ref4;
284
+ const totalNumberOfRowsInTable = rowCount;
285
+ const totalRowsLabel = `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`;
286
+ const pageRowsLabel = `All ${selectionStatus.numberOfSelectedRowsInPage} selectable rows on this page are selected${selectionStatus.numberOfSelectedRows != selectionStatus.numberOfSelectedRowsInPage ? ` (${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected in total)` : ''}.`;
287
+ return /*#__PURE__*/React__default.createElement(Flexbox, {
288
+ flexDirection: "row",
289
+ alignItems: "center",
290
+ justifyContent: "space-between",
291
+ marginBottom: "7px"
292
+ }, displaySelection ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, selectionStatus.type === 'page' && selectionStatus.numberOfSelectedRowsInPage != 0 ? /*#__PURE__*/React__default.createElement(Text, {
293
+ fontSize: "14px"
294
+ }, pageRowsLabel) : selectionStatus.type === 'other' ? /*#__PURE__*/React__default.createElement(Text, {
295
+ fontSize: "14px"
296
+ }, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination, _extends({
297
+ component: "div",
298
+ count: totalNumberOfRowsInTable,
299
+ page: paginationModel.page,
300
+ onPageChange: (event, page) => onPaginationModelChange({
301
+ page,
302
+ pageSize: paginationModel.pageSize
303
+ }, {
304
+ reason: 'setPaginationModel'
305
+ }),
306
+ rowsPerPage: paginationModel.pageSize,
307
+ onRowsPerPageChange: event => onPaginationModelChange({
308
+ page: paginationModel.page,
309
+ pageSize: parseInt(event.target.value, 10)
310
+ }, {
311
+ reason: 'setPaginationModel'
312
+ }),
313
+ rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
314
+ }, paginationProps)) : null);
315
+ };
316
+
317
+ export { ControlledPagination as C, EMPTY_ROW_SELECTION_MODEL as E, ServerSideControlledPagination as S, getSelectedIds as a, getSelectableRowIdsInPage as b, createRowSelectionModel as c, fixServerSideHeaderCheckboxSelection as f, getSelectionCount as g, isRowSelected as i, normalizeRowSelectionModel as n, onServerSideSelectionStatusChange as o };
318
+ //# sourceMappingURL=ServerSideControlledPagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerSideControlledPagination.js","sources":["../../src/utils/rowSelection.ts","../../src/components/Pagination/ControlledPagination.tsx","../../src/components/Pagination/ServerSideControlledPagination.tsx"],"sourcesContent":["import { GridRowId, GridRowSelectionModel } from '@mui/x-data-grid-premium';\n\n/**\n * Type for legacy array-based row selection (v7 and earlier)\n */\nexport type LegacyRowSelectionModel = GridRowId[];\n\n/**\n * Type that accepts both legacy array format and new v8 object format\n */\nexport type RowSelectionModelInput = LegacyRowSelectionModel | GridRowSelectionModel;\n\n/**\n * Default empty row selection model for MUI DataGrid v8+\n * In v8, GridRowSelectionModel changed from GridRowId[] to { type: 'include' | 'exclude'; ids: Set<GridRowId> }\n */\nexport const EMPTY_ROW_SELECTION_MODEL: GridRowSelectionModel = {\n type: 'include',\n ids: new Set(),\n};\n\n/**\n * Creates a new row selection model with the given ids\n */\nexport const createRowSelectionModel = (ids: GridRowId[] | Set<GridRowId>): GridRowSelectionModel => ({\n type: 'include',\n ids: ids instanceof Set ? ids : new Set(ids),\n});\n\n/**\n * Normalizes a row selection model input to the v8 GridRowSelectionModel format.\n * Accepts both legacy array format (v7) and new object format (v8).\n * This allows consumers to continue using arrays while internally using the v8 format.\n */\nexport const normalizeRowSelectionModel = (input: RowSelectionModelInput | undefined | null): GridRowSelectionModel => {\n if (!input) {\n return EMPTY_ROW_SELECTION_MODEL;\n }\n // If it's an array (legacy v7 format), convert to v8 format\n if (Array.isArray(input)) {\n return createRowSelectionModel(input);\n }\n // Already in v8 format\n return input;\n};\n\n/**\n * Gets the size/count of selected rows from a selection model\n */\nexport const getSelectionCount = (model: GridRowSelectionModel): number => {\n return model.ids.size;\n};\n\n/**\n * Checks if a row is selected in the given selection model\n */\nexport const isRowSelected = (model: GridRowSelectionModel, rowId: GridRowId): boolean => {\n if (model.type === 'include') {\n return model.ids.has(rowId);\n }\n // For 'exclude' type, row is selected if it's NOT in the ids set\n return !model.ids.has(rowId);\n};\n\n/**\n * Converts a selection model to an array of selected row IDs\n * Note: For 'exclude' type, this only returns the ids that are explicitly excluded,\n * not the actual selected rows (which would require knowing all row ids)\n */\nexport const getSelectedIds = (model: GridRowSelectionModel): GridRowId[] => {\n return Array.from(model.ids);\n};\n","import React, { MutableRefObject } from 'react';\nimport { Flexbox, LinkButton, Text } from '@redsift/design-system';\nimport {\n GridCallbackDetails,\n gridFilteredSortedRowEntriesSelector,\n gridFilteredSortedRowIdsSelector,\n GridPaginationModel,\n GridRowParams,\n GridApiPremium,\n} from '@mui/x-data-grid-premium';\n\nimport { DataGridProps, SelectionStatus } from '../DataGrid/types';\nimport TablePagination from '@mui/material/TablePagination';\n\nconst getSelectableRowsInTable = (\n apiRef: React.MutableRefObject<GridApiPremium | null>,\n isRowSelectable?: DataGridProps['isRowSelectable']\n) => {\n if (!apiRef.current) {\n return [];\n }\n return isRowSelectable && typeof isRowSelectable === 'function'\n ? gridFilteredSortedRowEntriesSelector(apiRef)\n .filter(({ model }) => isRowSelectable?.({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : gridFilteredSortedRowIdsSelector(apiRef);\n};\n\nexport type ControlledPaginationProps = {\n displaySelection?: boolean;\n displayRowsPerPage?: boolean;\n displayPagination?: boolean;\n selectionStatus: SelectionStatus;\n apiRef: MutableRefObject<GridApiPremium | null>;\n paginationModel: GridPaginationModel;\n onPaginationModelChange: (model: GridPaginationModel, details: GridCallbackDetails<'pagination'>) => void;\n pageSizeOptions?: number[];\n isRowSelectable?: DataGridProps['isRowSelectable'];\n paginationProps?: DataGridProps['paginationProps'];\n};\n\nexport const ControlledPagination: React.FC<ControlledPaginationProps> = ({\n displaySelection = false,\n displayRowsPerPage = false,\n displayPagination = false,\n selectionStatus,\n apiRef,\n paginationModel,\n onPaginationModelChange,\n pageSizeOptions,\n isRowSelectable,\n paginationProps,\n}) => {\n const filteredRowsInTable = getSelectableRowsInTable(apiRef);\n const selectableRowsInTable = getSelectableRowsInTable(apiRef, isRowSelectable);\n const numberOfFilteredRowsInTable = filteredRowsInTable.length;\n const numberOfSelectableRowsInTable = selectableRowsInTable.length;\n\n return (\n <Flexbox flexDirection=\"row\" alignItems=\"center\" justifyContent=\"space-between\" marginBottom=\"7px\">\n {displaySelection ? (\n <>\n {selectionStatus.type === 'page' ? (\n <Text fontSize=\"14px\">\n {`All ${selectionStatus.numberOfSelectedRows}${\n numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''\n } rows on this page are selected. `}\n <LinkButton\n onClick={() => {\n apiRef.current?.selectRows(\n numberOfSelectableRowsInTable ? selectableRowsInTable : apiRef.current?.getAllRowIds()\n );\n }}\n >\n Select all {numberOfSelectableRowsInTable}\n {numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''} rows in the table.\n </LinkButton>\n </Text>\n ) : selectionStatus.type === 'table' ? (\n <Text fontSize=\"14px\">\n {`All ${selectionStatus.numberOfSelectedRows}${\n numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''\n } rows in the table are selected. `}\n <LinkButton\n onClick={() => {\n apiRef.current?.selectRows([], false, true);\n }}\n >\n Clear selection.\n </LinkButton>\n </Text>\n ) : selectionStatus.type === 'other' ? (\n <Text fontSize=\"14px\">{`${selectionStatus.numberOfSelectedRows} row${\n selectionStatus.numberOfSelectedRows > 1 ? 's' : ''\n } selected`}</Text>\n ) : (\n <Text />\n )}\n </>\n ) : null}\n {displayPagination ? (\n <TablePagination\n component=\"div\"\n count={numberOfFilteredRowsInTable}\n page={paginationModel.page}\n onPageChange={(event: React.MouseEvent<HTMLButtonElement> | null, page: number) => {\n onPaginationModelChange({ page, pageSize: paginationModel.pageSize }, {\n reason: 'setPaginationModel',\n } as GridCallbackDetails<'pagination'>);\n }}\n rowsPerPage={paginationModel.pageSize}\n onRowsPerPageChange={(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n onPaginationModelChange({ page: paginationModel.page, pageSize: parseInt(event.target.value, 10) }, {\n reason: 'setPaginationModel',\n } as GridCallbackDetails<'pagination'>);\n }}\n rowsPerPageOptions={displayRowsPerPage ? pageSizeOptions : []}\n {...paginationProps}\n />\n ) : null}\n </Flexbox>\n );\n};\n","import React from 'react';\nimport { Flexbox, Text } from '@redsift/design-system';\n\nimport { DataGridProps, SelectionStatus } from '../DataGrid/types';\nimport TablePagination from '@mui/material/TablePagination';\nimport {\n GridApiPremium,\n GridCallbackDetails,\n gridExpandedSortedRowEntriesSelector,\n GridPaginationModel,\n GridRowId,\n GridRowParams,\n GridRowSelectionModel,\n} from '@mui/x-data-grid-premium';\nimport { getSelectionCount, isRowSelected } from '../../utils/rowSelection';\n\nexport type ServerSideControlledPaginationProps = {\n displaySelection?: boolean;\n displayRowsPerPage?: boolean;\n displayPagination?: boolean;\n selectionStatus: SelectionStatus;\n paginationModel: GridPaginationModel;\n onPaginationModelChange: (model: GridPaginationModel, details: GridCallbackDetails<'pagination'>) => void;\n pageSizeOptions?: number[];\n paginationProps?: DataGridProps['paginationProps'];\n rowCount: number;\n loading?: boolean;\n};\n\n/**\n * Get the IDs of all selectable rows currently loaded in the grid (i.e. the current page for server-side).\n */\nexport const getSelectableRowIdsInPage = (\n apiRef: React.MutableRefObject<GridApiPremium>,\n isRowSelectable: ((params: GridRowParams<any>) => boolean) | undefined\n): GridRowId[] => {\n const rowsInPage = Array.from(gridExpandedSortedRowEntriesSelector(apiRef));\n return isRowSelectable\n ? rowsInPage.filter(({ id, model }) => isRowSelectable({ id, row: model } as GridRowParams)).map(({ id }) => id)\n : rowsInPage.map(({ id }) => id);\n};\n\n/**\n * Intercept MUI's `onRowSelectionModelChange` for server-side pagination to fix the\n * header checkbox behavior when cross-page selections exist.\n *\n * Problem: With `checkboxSelectionVisibleOnly=false` and `keepNonExistentRowsSelected`,\n * the header checkbox shows \"indeterminate\" when rows from other pages are selected but\n * none on the current page. Clicking it makes MUI deselect everything (treating it as a\n * global toggle-off), but the user's intent is to select the current page.\n *\n * Fix: When MUI empties the selection model and the previous status was 'other' (cross-page\n * selections with 0 selected on current page), we merge all current page rows with the\n * existing cross-page selections instead.\n */\nexport const fixServerSideHeaderCheckboxSelection = (\n newSelectionModel: GridRowSelectionModel,\n previousSelectionModel: GridRowSelectionModel,\n selectionStatus: React.MutableRefObject<SelectionStatus>,\n apiRef: React.MutableRefObject<GridApiPremium>,\n isRowSelectable: ((params: GridRowParams<any>) => boolean) | undefined\n): GridRowSelectionModel => {\n // Detect: MUI cleared everything, but we had cross-page selections with 0 on current page.\n // This means the header checkbox was clicked in indeterminate state → user wants to select current page.\n if (\n getSelectionCount(newSelectionModel) === 0 &&\n getSelectionCount(previousSelectionModel) > 0 &&\n selectionStatus.current.type === 'other' &&\n selectionStatus.current.numberOfSelectedRowsInPage === 0\n ) {\n const selectableInPage = getSelectableRowIdsInPage(apiRef, isRowSelectable);\n // Merge: keep existing cross-page selections + add all current page rows\n const mergedIds = new Set(previousSelectionModel.ids);\n for (const id of selectableInPage) {\n mergedIds.add(id);\n }\n return { type: 'include', ids: mergedIds };\n }\n\n return newSelectionModel;\n};\n\nexport const onServerSideSelectionStatusChange = (\n newSelectionModel: GridRowSelectionModel,\n apiRef: React.MutableRefObject<GridApiPremium | null>,\n selectionStatus: React.MutableRefObject<SelectionStatus>,\n forceUpdate: React.Dispatch<React.SetStateAction<number>>,\n isRowSelectable: ((params: GridRowParams<any>) => boolean) | undefined,\n page: number,\n pageSize: number\n) => {\n if (!apiRef.current) {\n return;\n }\n\n // We can't rely on the gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef) function to fetch the list of visible rows\n // as it doesn't work properly when all rows are selected on a page via checkbox\n // and then navigate to another page.\n // So instead we fetch the visible rows directly from the apiRef state, since the logic in `onServerSideSelectionStatusChange` applies\n // to server-side pagination only and visible rows are all loaded rows.\n // The bug may have been latent for several MUI releases now, as it seems to have been fixed in MUI v7.\n // See https://github.com/mui/mui-x/pull/14083\n const selectableRowsInPage = getSelectableRowIdsInPage(\n apiRef as React.MutableRefObject<GridApiPremium>,\n isRowSelectable\n );\n const numberOfSelectableRowsInPage = selectableRowsInPage.length;\n\n const numberOfSelectedRows = getSelectionCount(newSelectionModel);\n\n const selectedRowsInPage = selectableRowsInPage.filter((rowId) => isRowSelected(newSelectionModel, rowId));\n const numberOfSelectedRowsInPage = selectedRowsInPage.length;\n\n const isSamePage = selectionStatus?.current.page == page;\n const isSamePageSize = selectionStatus?.current.pageSize == pageSize;\n\n // if previous status is `page`,\n // if page and pageSize didn't change\n // and all the rows are selected, deselect all row\n if (\n selectionStatus.current.type === 'page' &&\n isSamePage &&\n isSamePageSize &&\n numberOfSelectedRowsInPage === numberOfSelectableRowsInPage\n ) {\n setTimeout(() => {\n apiRef.current?.selectRows(selectedRowsInPage, false, false);\n }, 0);\n }\n\n if (numberOfSelectedRowsInPage === numberOfSelectableRowsInPage && numberOfSelectableRowsInPage != 0) {\n selectionStatus.current = {\n type: 'page',\n numberOfSelectedRows,\n numberOfSelectedRowsInPage,\n page,\n pageSize,\n };\n } else if (numberOfSelectedRows > 0) {\n selectionStatus.current = {\n type: 'other',\n numberOfSelectedRows,\n numberOfSelectedRowsInPage,\n page,\n pageSize,\n };\n } else {\n selectionStatus.current = {\n type: 'none',\n numberOfSelectedRows,\n numberOfSelectedRowsInPage,\n page,\n pageSize,\n };\n }\n\n // Force a re-render to update the UI with the new selection status\n forceUpdate((v) => v + 1);\n};\n\nexport const ServerSideControlledPagination: React.FC<ServerSideControlledPaginationProps> = ({\n selectionStatus,\n displaySelection,\n displayPagination,\n paginationModel,\n onPaginationModelChange,\n pageSizeOptions,\n displayRowsPerPage,\n paginationProps,\n rowCount,\n}) => {\n const totalNumberOfRowsInTable = rowCount;\n\n const totalRowsLabel = `${selectionStatus.numberOfSelectedRows} row${\n selectionStatus.numberOfSelectedRows > 1 ? 's' : ''\n } selected`;\n\n const pageRowsLabel = `All ${selectionStatus.numberOfSelectedRowsInPage} selectable rows on this page are selected${\n selectionStatus.numberOfSelectedRows != selectionStatus.numberOfSelectedRowsInPage\n ? ` (${selectionStatus.numberOfSelectedRows} row${\n selectionStatus.numberOfSelectedRows > 1 ? 's' : ''\n } selected in total)`\n : ''\n }.`;\n\n return (\n <Flexbox flexDirection=\"row\" alignItems=\"center\" justifyContent=\"space-between\" marginBottom=\"7px\">\n {displaySelection ? (\n <>\n {selectionStatus.type === 'page' && selectionStatus.numberOfSelectedRowsInPage != 0 ? (\n <Text fontSize=\"14px\">{pageRowsLabel}</Text>\n ) : selectionStatus.type === 'other' ? (\n <Text fontSize=\"14px\">{totalRowsLabel}</Text>\n ) : (\n <Text />\n )}\n </>\n ) : null}\n {displayPagination ? (\n <TablePagination\n component=\"div\"\n count={totalNumberOfRowsInTable}\n page={paginationModel.page}\n onPageChange={(event: React.MouseEvent<HTMLButtonElement> | null, page: number) =>\n onPaginationModelChange({ page, pageSize: paginationModel.pageSize }, {\n reason: 'setPaginationModel',\n } as GridCallbackDetails<'pagination'>)\n }\n rowsPerPage={paginationModel.pageSize}\n onRowsPerPageChange={(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n onPaginationModelChange({ page: paginationModel.page, pageSize: parseInt(event.target.value, 10) }, {\n reason: 'setPaginationModel',\n } as GridCallbackDetails<'pagination'>)\n }\n rowsPerPageOptions={displayRowsPerPage ? pageSizeOptions : []}\n {...paginationProps}\n />\n ) : null}\n </Flexbox>\n );\n};\n"],"names":["EMPTY_ROW_SELECTION_MODEL","type","ids","Set","createRowSelectionModel","normalizeRowSelectionModel","input","Array","isArray","getSelectionCount","model","size","isRowSelected","rowId","has","getSelectedIds","from","getSelectableRowsInTable","apiRef","isRowSelectable","current","gridFilteredSortedRowEntriesSelector","filter","_ref","row","map","_ref2","id","gridFilteredSortedRowIdsSelector","ControlledPagination","_ref3","displaySelection","displayRowsPerPage","displayPagination","selectionStatus","paginationModel","onPaginationModelChange","pageSizeOptions","paginationProps","filteredRowsInTable","selectableRowsInTable","numberOfFilteredRowsInTable","length","numberOfSelectableRowsInTable","React","createElement","Flexbox","flexDirection","alignItems","justifyContent","marginBottom","Fragment","Text","fontSize","numberOfSelectedRows","LinkButton","onClick","_apiRef$current","_apiRef$current2","selectRows","getAllRowIds","_apiRef$current3","TablePagination","_extends","component","count","page","onPageChange","event","pageSize","reason","rowsPerPage","onRowsPerPageChange","parseInt","target","value","rowsPerPageOptions","getSelectableRowIdsInPage","rowsInPage","gridExpandedSortedRowEntriesSelector","fixServerSideHeaderCheckboxSelection","newSelectionModel","previousSelectionModel","numberOfSelectedRowsInPage","selectableInPage","mergedIds","add","onServerSideSelectionStatusChange","forceUpdate","selectableRowsInPage","numberOfSelectableRowsInPage","selectedRowsInPage","isSamePage","isSamePageSize","setTimeout","v","ServerSideControlledPagination","_ref4","rowCount","totalNumberOfRowsInTable","totalRowsLabel","pageRowsLabel"],"mappings":";;;;;;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACO,MAAMA,yBAAgD,GAAG;AAC9DC,EAAAA,IAAI,EAAE,SAAS;EACfC,GAAG,EAAE,IAAIC,GAAG,EAAC;AACf,EAAC;;AAED;AACA;AACA;AACaC,MAAAA,uBAAuB,GAAIF,GAAiC,KAA6B;AACpGD,EAAAA,IAAI,EAAE,SAAS;EACfC,GAAG,EAAEA,GAAG,YAAYC,GAAG,GAAGD,GAAG,GAAG,IAAIC,GAAG,CAACD,GAAG,CAAA;AAC7C,CAAC,EAAC;;AAEF;AACA;AACA;AACA;AACA;AACaG,MAAAA,0BAA0B,GAAIC,KAAgD,IAA4B;EACrH,IAAI,CAACA,KAAK,EAAE;AACV,IAAA,OAAON,yBAAyB,CAAA;AAClC,GAAA;AACA;AACA,EAAA,IAAIO,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;IACxB,OAAOF,uBAAuB,CAACE,KAAK,CAAC,CAAA;AACvC,GAAA;AACA;AACA,EAAA,OAAOA,KAAK,CAAA;AACd,EAAC;;AAED;AACA;AACA;AACaG,MAAAA,iBAAiB,GAAIC,KAA4B,IAAa;AACzE,EAAA,OAAOA,KAAK,CAACR,GAAG,C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,CAET,CAAC,GACD,IAAI,EACPnB,iBAAiB,gBAChBW,cAAA,CAAAC,aAAA,CAACiB,eAAe,EAAAC,QAAA,CAAA;AACdC,IAAAA,SAAS,EAAC,KAAK;AACfC,IAAAA,KAAK,EAAEkC,wBAAyB;IAChCjC,IAAI,EAAE/B,eAAe,CAAC+B,IAAK;AAC3BC,IAAAA,YAAY,EAAEA,CAACC,KAAiD,EAAEF,IAAY,KAC5E9B,uBAAuB,CAAC;MAAE8B,IAAI;MAAEG,QAAQ,EAAElC,eAAe,CAACkC,QAAAA;AAAS,KAAC,EAAE;AACpEC,MAAAA,MAAM,EAAE,oBAAA;AACV,KAAsC,CACvC;IACDC,WAAW,EAAEpC,eAAe,CAACkC,QAAS;AACtCG,IAAAA,mBAAmB,EAAGJ,KAAgE,IACpFhC,uBAAuB,CAAC;MAAE8B,IAAI,EAAE/B,eAAe,CAAC+B,IAAI;MAAEG,QAAQ,EAAEI,QAAQ,CAACL,KAAK,CAACM,MAAM,CAACC,KAAK,EAAE,EAAE,CAAA;AAAE,KAAC,EAAE;AAClGL,MAAAA,MAAM,EAAE,oBAAA;AACV,KAAsC,CACvC;AACDM,IAAAA,kBAAkB,EAAE5C,kBAAkB,GAAGK,eAAe,GAAG,EAAA;AAAG,GAAA,EAC1DC,eAAe,CACpB,CAAC,GACA,IACG,CAAC,CAAA;AAEd;;;;"}
@@ -1,2 +1,2 @@
1
- export { au as StatefulDataGrid } from './StatefulDataGrid2.js';
1
+ export { aB as StatefulDataGrid } from './StatefulDataGrid2.js';
2
2
  //# sourceMappingURL=StatefulDataGrid.js.map