@redsift/table 12.4.0 → 12.5.0-muiv7
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/_internal/BaseComponents.js +1 -1
- package/_internal/BasePopper.js +2453 -0
- package/_internal/BasePopper.js.map +1 -0
- package/_internal/ControlledPagination.js +11958 -0
- package/_internal/ControlledPagination.js.map +1 -0
- package/_internal/DataGrid2.js +138 -71
- package/_internal/DataGrid2.js.map +1 -1
- package/_internal/GridToolbarFilterSemanticField2.js +2 -1339
- package/_internal/GridToolbarFilterSemanticField2.js.map +1 -1
- package/_internal/Pagination.js +1 -1
- package/_internal/Portal.js +6563 -0
- package/_internal/Portal.js.map +1 -0
- package/_internal/StatefulDataGrid.js +1 -1
- package/_internal/StatefulDataGrid2.js +1766 -178
- package/_internal/StatefulDataGrid2.js.map +1 -1
- package/_internal/Toolbar2.js +1 -1
- package/_internal/Toolbar2.js.map +1 -1
- package/_internal/ToolbarWrapper2.js +3 -3
- package/_internal/ToolbarWrapper2.js.map +1 -1
- package/_internal/jsx-runtime.js +1342 -0
- package/_internal/jsx-runtime.js.map +1 -0
- package/_internal/useControlledDatagridState.js +1125 -6
- package/_internal/useControlledDatagridState.js.map +1 -1
- package/index.d.ts +173 -386
- package/index.js +10 -44
- package/index.js.map +1 -1
- package/package.json +10 -9
- package/_internal/BaseIconButton.js +0 -126
- package/_internal/BaseIconButton.js.map +0 -1
- package/_internal/ServerSideControlledPagination.js +0 -281
- package/_internal/ServerSideControlledPagination.js.map +0 -1
|
@@ -1,281 +0,0 @@
|
|
|
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
|
-
const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionStatus, forceUpdate, isRowSelectable, page, pageSize) => {
|
|
158
|
-
if (!apiRef.current) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// We can't rely on the gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef) function to fetch the list of visible rows
|
|
163
|
-
// as it doesn't work properly when all rows are selected on a page via checkbox
|
|
164
|
-
// and then navigate to another page.
|
|
165
|
-
// So instead we fetch the visible rows directly from the apiRef state, since the logic in `onServerSideSelectionStatusChange` applies
|
|
166
|
-
// to server-side pagination only and visible rows are all loaded rows.
|
|
167
|
-
// The bug may have been latent for several MUI releases now, as it seems to have been fixed in MUI v7.
|
|
168
|
-
// See https://github.com/mui/mui-x/pull/14083
|
|
169
|
-
const rowsInPage = Array.from(gridExpandedSortedRowEntriesSelector(apiRef));
|
|
170
|
-
const selectableRowsInPage = isRowSelectable ? rowsInPage.filter(_ref => {
|
|
171
|
-
let {
|
|
172
|
-
id,
|
|
173
|
-
model
|
|
174
|
-
} = _ref;
|
|
175
|
-
return isRowSelectable({
|
|
176
|
-
id,
|
|
177
|
-
row: model
|
|
178
|
-
});
|
|
179
|
-
}).map(_ref2 => {
|
|
180
|
-
let {
|
|
181
|
-
id
|
|
182
|
-
} = _ref2;
|
|
183
|
-
return id;
|
|
184
|
-
}) : rowsInPage.map(_ref3 => {
|
|
185
|
-
let {
|
|
186
|
-
id
|
|
187
|
-
} = _ref3;
|
|
188
|
-
return id;
|
|
189
|
-
});
|
|
190
|
-
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
191
|
-
const numberOfSelectedRows = getSelectionCount(newSelectionModel);
|
|
192
|
-
const selectedRowsInPage = selectableRowsInPage.filter(rowId => isRowSelected(newSelectionModel, rowId));
|
|
193
|
-
const numberOfSelectedRowsInPage = selectedRowsInPage.length;
|
|
194
|
-
const isSamePage = (selectionStatus === null || selectionStatus === void 0 ? void 0 : selectionStatus.current.page) == page;
|
|
195
|
-
const isSamePageSize = (selectionStatus === null || selectionStatus === void 0 ? void 0 : selectionStatus.current.pageSize) == pageSize;
|
|
196
|
-
|
|
197
|
-
// if previous status is `page`,
|
|
198
|
-
// if page and pageSize didn't change
|
|
199
|
-
// and all the rows are selected, deselect all row
|
|
200
|
-
if (selectionStatus.current.type === 'page' && isSamePage && isSamePageSize && numberOfSelectedRowsInPage === numberOfSelectableRowsInPage) {
|
|
201
|
-
setTimeout(() => {
|
|
202
|
-
var _apiRef$current;
|
|
203
|
-
(_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.selectRows(selectedRowsInPage, false, false);
|
|
204
|
-
}, 0);
|
|
205
|
-
}
|
|
206
|
-
if (numberOfSelectedRowsInPage === numberOfSelectableRowsInPage && numberOfSelectableRowsInPage != 0) {
|
|
207
|
-
selectionStatus.current = {
|
|
208
|
-
type: 'page',
|
|
209
|
-
numberOfSelectedRows,
|
|
210
|
-
numberOfSelectedRowsInPage,
|
|
211
|
-
page,
|
|
212
|
-
pageSize
|
|
213
|
-
};
|
|
214
|
-
} else if (numberOfSelectedRows > 0) {
|
|
215
|
-
selectionStatus.current = {
|
|
216
|
-
type: 'other',
|
|
217
|
-
numberOfSelectedRows,
|
|
218
|
-
numberOfSelectedRowsInPage,
|
|
219
|
-
page,
|
|
220
|
-
pageSize
|
|
221
|
-
};
|
|
222
|
-
} else {
|
|
223
|
-
selectionStatus.current = {
|
|
224
|
-
type: 'none',
|
|
225
|
-
numberOfSelectedRows,
|
|
226
|
-
numberOfSelectedRowsInPage,
|
|
227
|
-
page,
|
|
228
|
-
pageSize
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Force a re-render to update the UI with the new selection status
|
|
233
|
-
forceUpdate(v => v + 1);
|
|
234
|
-
};
|
|
235
|
-
const ServerSideControlledPagination = _ref4 => {
|
|
236
|
-
let {
|
|
237
|
-
selectionStatus,
|
|
238
|
-
displaySelection,
|
|
239
|
-
displayPagination,
|
|
240
|
-
paginationModel,
|
|
241
|
-
onPaginationModelChange,
|
|
242
|
-
pageSizeOptions,
|
|
243
|
-
displayRowsPerPage,
|
|
244
|
-
paginationProps,
|
|
245
|
-
rowCount
|
|
246
|
-
} = _ref4;
|
|
247
|
-
const totalNumberOfRowsInTable = rowCount;
|
|
248
|
-
const totalRowsLabel = `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`;
|
|
249
|
-
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)` : ''}.`;
|
|
250
|
-
return /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
251
|
-
flexDirection: "row",
|
|
252
|
-
alignItems: "center",
|
|
253
|
-
justifyContent: "space-between",
|
|
254
|
-
marginBottom: "7px"
|
|
255
|
-
}, displaySelection ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, selectionStatus.type === 'page' && selectionStatus.numberOfSelectedRowsInPage != 0 ? /*#__PURE__*/React__default.createElement(Text, {
|
|
256
|
-
fontSize: "14px"
|
|
257
|
-
}, pageRowsLabel) : selectionStatus.type === 'other' ? /*#__PURE__*/React__default.createElement(Text, {
|
|
258
|
-
fontSize: "14px"
|
|
259
|
-
}, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination, _extends({
|
|
260
|
-
component: "div",
|
|
261
|
-
count: totalNumberOfRowsInTable,
|
|
262
|
-
page: paginationModel.page,
|
|
263
|
-
onPageChange: (event, page) => onPaginationModelChange({
|
|
264
|
-
page,
|
|
265
|
-
pageSize: paginationModel.pageSize
|
|
266
|
-
}, {
|
|
267
|
-
reason: 'setPaginationModel'
|
|
268
|
-
}),
|
|
269
|
-
rowsPerPage: paginationModel.pageSize,
|
|
270
|
-
onRowsPerPageChange: event => onPaginationModelChange({
|
|
271
|
-
page: paginationModel.page,
|
|
272
|
-
pageSize: parseInt(event.target.value, 10)
|
|
273
|
-
}, {
|
|
274
|
-
reason: 'setPaginationModel'
|
|
275
|
-
}),
|
|
276
|
-
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
277
|
-
}, paginationProps)) : null);
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
export { ControlledPagination as C, EMPTY_ROW_SELECTION_MODEL as E, ServerSideControlledPagination as S, getSelectedIds as a, createRowSelectionModel as c, getSelectionCount as g, isRowSelected as i, normalizeRowSelectionModel as n, onServerSideSelectionStatusChange as o };
|
|
281
|
-
//# sourceMappingURL=ServerSideControlledPagination.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 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\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 rowsInPage = Array.from(gridExpandedSortedRowEntriesSelector(apiRef));\n\n const selectableRowsInPage = isRowSelectable\n ? rowsInPage.filter(({ id, model }) => isRowSelectable({ id, row: model } as GridRowParams)).map(({ id }) => id)\n : rowsInPage.map(({ id }) => id);\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","onServerSideSelectionStatusChange","newSelectionModel","forceUpdate","rowsInPage","gridExpandedSortedRowEntriesSelector","selectableRowsInPage","numberOfSelectableRowsInPage","selectedRowsInPage","numberOfSelectedRowsInPage","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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