@redsift/table 12.5.6 → 12.5.7-muiv6
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/CONTRIBUTING.md +6 -0
- package/_internal/BaseComponents.js +1 -1
- package/_internal/BasePopper.js +2469 -0
- package/_internal/BasePopper.js.map +1 -0
- package/_internal/ControlledPagination.js +11004 -0
- package/_internal/ControlledPagination.js.map +1 -0
- package/_internal/DataGrid2.js +81 -149
- package/_internal/DataGrid2.js.map +1 -1
- package/_internal/GridToolbarFilterSemanticField2.js +3 -1340
- package/_internal/GridToolbarFilterSemanticField2.js.map +1 -1
- package/_internal/Pagination.js +1 -1
- package/_internal/Portal.js +6538 -0
- package/_internal/Portal.js.map +1 -0
- package/_internal/StatefulDataGrid.js +1 -1
- package/_internal/StatefulDataGrid2.js +1512 -1071
- package/_internal/StatefulDataGrid2.js.map +1 -1
- package/_internal/Toolbar2.js +6 -23
- package/_internal/Toolbar2.js.map +1 -1
- package/_internal/ToolbarWrapper2.js +1 -1
- package/_internal/jsx-runtime.js +1342 -0
- package/_internal/jsx-runtime.js.map +1 -0
- package/_internal/useControlledDatagridState.js +308 -43
- package/_internal/useControlledDatagridState.js.map +1 -1
- package/index.d.ts +354 -519
- package/index.js +15 -46
- 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 -337
- package/_internal/ServerSideControlledPagination.js.map +0 -1
package/_internal/DataGrid2.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { a as _objectWithoutProperties, b as _extends, _ as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React__default, { forwardRef, useRef, useState, useEffect, useMemo } from 'react';
|
|
3
|
-
import { createTheme, ThemeProvider as ThemeProvider$1 } from '@mui/material/styles';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { u as useControlledDatagridState, S as StyledDataGrid, B as BottomPagination, b as baseGridSlots, a as BelowToolbar } from './useControlledDatagridState.js';
|
|
9
|
-
import { n as normalizeRowSelectionModel, o as onServerSideSelectionStatusChange, g as getSelectionCount, i as isRowSelected, S as ServerSideControlledPagination, C as ControlledPagination, f as fixServerSideHeaderCheckboxSelection } from './ServerSideControlledPagination.js';
|
|
4
|
+
import { useTheme, ThemeProvider, RedsiftColorBlueN, RedsiftColorNeutralXDarkGrey, RedsiftColorNeutralWhite } from '@redsift/design-system';
|
|
5
|
+
import { useGridApiRef, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, DataGridPro } from '@mui/x-data-grid-pro';
|
|
6
|
+
import { L as LicenseInfo, u as useControlledDatagridState, T as ThemeProvider$1, S as StyledDataGrid, B as BottomPagination, b as baseGridSlots } from './useControlledDatagridState.js';
|
|
10
7
|
import { T as Toolbar } from './Toolbar2.js';
|
|
8
|
+
import { o as onServerSideSelectionStatusChange, f as fixServerSideHeaderCheckboxSelection } from './ControlledPagination.js';
|
|
9
|
+
import { c as createTheme } from './Portal.js';
|
|
10
|
+
import { T as ToolbarWrapper } from './ToolbarWrapper2.js';
|
|
11
11
|
|
|
12
|
-
const _excluded = ["apiRef", "autoHeight", "className", "slots", "slotProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "paginationModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "onFilterModelChange", "rowSelectionModel", "onPaginationModelChange", "onRowSelectionModelChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "pagination", "paginationPlacement", "selectionBannerPlacement", "paginationProps", "rows", "pageSizeOptions", "sx", "theme", "paginationMode", "rowCount"
|
|
12
|
+
const _excluded = ["apiRef", "autoHeight", "className", "slots", "slotProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "paginationModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "onFilterModelChange", "rowSelectionModel", "onPaginationModelChange", "onRowSelectionModelChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "pagination", "paginationPlacement", "selectionBannerPlacement", "paginationProps", "rows", "pageSizeOptions", "sx", "theme", "paginationMode", "rowCount"];
|
|
13
13
|
const COMPONENT_NAME = 'DataGrid';
|
|
14
14
|
const CLASSNAME = 'redsift-datagrid';
|
|
15
15
|
|
|
@@ -86,7 +86,6 @@ const CLASSNAME = 'redsift-datagrid';
|
|
|
86
86
|
*/
|
|
87
87
|
|
|
88
88
|
const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
89
|
-
var _ref6, _ref7;
|
|
90
89
|
const datagridRef = ref || useRef();
|
|
91
90
|
const {
|
|
92
91
|
apiRef: propsApiRef,
|
|
@@ -116,17 +115,17 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
116
115
|
selectionBannerPlacement = 'top',
|
|
117
116
|
paginationProps,
|
|
118
117
|
rows,
|
|
119
|
-
pageSizeOptions
|
|
118
|
+
pageSizeOptions,
|
|
120
119
|
sx,
|
|
121
120
|
theme: propsTheme,
|
|
122
121
|
paginationMode = 'client',
|
|
123
|
-
rowCount
|
|
124
|
-
density
|
|
122
|
+
rowCount
|
|
125
123
|
} = props,
|
|
126
124
|
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
127
125
|
const theme = useTheme(propsTheme);
|
|
128
126
|
const _apiRef = useGridApiRef();
|
|
129
127
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
128
|
+
const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar;
|
|
130
129
|
LicenseInfo.setLicenseKey(license);
|
|
131
130
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
132
131
|
const {
|
|
@@ -154,9 +153,9 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
154
153
|
propsSortModel,
|
|
155
154
|
propsOnPaginationModelChange
|
|
156
155
|
});
|
|
157
|
-
const [rowSelectionModel, setRowSelectionModel] = useState(
|
|
156
|
+
const [rowSelectionModel, setRowSelectionModel] = useState(propsRowSelectionModel !== null && propsRowSelectionModel !== void 0 ? propsRowSelectionModel : []);
|
|
158
157
|
useEffect(() => {
|
|
159
|
-
setRowSelectionModel(
|
|
158
|
+
setRowSelectionModel(propsRowSelectionModel !== null && propsRowSelectionModel !== void 0 ? propsRowSelectionModel : []);
|
|
160
159
|
}, [propsRowSelectionModel]);
|
|
161
160
|
const onRowSelectionModelChange = (selectionModel, details) => {
|
|
162
161
|
setRowSelectionModel(selectionModel);
|
|
@@ -172,36 +171,22 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
172
171
|
pageSize: paginationModel.pageSize
|
|
173
172
|
});
|
|
174
173
|
|
|
175
|
-
// Version counter to force re-renders when selectionStatus ref changes
|
|
176
|
-
const [, forceSelectionUpdate] = useState(0);
|
|
177
|
-
|
|
178
|
-
// Track when the grid API is ready to ensure top pagination renders correctly
|
|
179
|
-
const [gridReady, setGridReady] = useState(false);
|
|
180
|
-
|
|
181
174
|
// The checkboxSelectionVisibleOnly should only be applied to client-side pagination,
|
|
182
175
|
// for server-side pagination it produces inconsistent behavior when selecting all rows in pages 2 and beyond
|
|
183
176
|
const checkboxSelectionVisibleOnly = Boolean(pagination) && Boolean(paginationMode != 'server');
|
|
184
177
|
|
|
185
178
|
// Banner and pager placements are independent. `belowToolbar` (for either) renders
|
|
186
|
-
// in
|
|
179
|
+
// in the toolbar-slot row, and only applies when pagination is on.
|
|
187
180
|
const bannerAtTop = selectionBannerPlacement === 'top';
|
|
188
181
|
const bannerAtBottom = selectionBannerPlacement === 'bottom';
|
|
189
182
|
const bannerBelowToolbar = selectionBannerPlacement === 'belowToolbar' && Boolean(pagination);
|
|
190
183
|
const pagerBelowToolbar = paginationPlacement === 'belowToolbar' && Boolean(pagination);
|
|
191
|
-
const belowToolbarActive = bannerBelowToolbar || pagerBelowToolbar;
|
|
192
|
-
|
|
193
|
-
// Force re-render when the grid API becomes ready (for top pagination)
|
|
194
|
-
useEffect(() => {
|
|
195
|
-
if (apiRef.current && !gridReady) {
|
|
196
|
-
setGridReady(true);
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
184
|
|
|
200
185
|
// in server-side pagination we want to update the selection status
|
|
201
186
|
// every time we navigate between pages, resize our page or select something
|
|
202
187
|
useEffect(() => {
|
|
203
188
|
if (paginationMode == 'server') {
|
|
204
|
-
onServerSideSelectionStatusChange(rowSelectionModel, apiRef, selectionStatusRef,
|
|
189
|
+
onServerSideSelectionStatusChange(Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel], apiRef, selectionStatusRef, isRowSelectable, paginationModel.page, paginationModel.pageSize);
|
|
205
190
|
}
|
|
206
191
|
}, [rowSelectionModel, paginationModel.page, paginationModel.pageSize, rows]);
|
|
207
192
|
if (!Array.isArray(rows)) {
|
|
@@ -213,15 +198,9 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
213
198
|
// receive the fresh value in the same render cycle — no extra re-render needed.
|
|
214
199
|
// The ref is kept in sync for the onRowSelectionModelChange callback's deselect logic.
|
|
215
200
|
let selectionStatus = selectionStatusRef.current;
|
|
216
|
-
if (pagination && paginationMode !== 'server' &&
|
|
201
|
+
if (pagination && paginationMode !== 'server' && Array.isArray(rowSelectionModel) && rowSelectionModel.length > 0) {
|
|
217
202
|
try {
|
|
218
|
-
|
|
219
|
-
// MUI's paginated selectors use apiRef internal state which may be stale when
|
|
220
|
-
// paginationModel prop changes — our React state is always up to date.
|
|
221
|
-
const allFilteredEntries = gridFilteredSortedRowEntriesSelector(apiRef);
|
|
222
|
-
const pageStart = paginationModel.page * paginationModel.pageSize;
|
|
223
|
-
const pageEntries = allFilteredEntries.slice(pageStart, pageStart + paginationModel.pageSize);
|
|
224
|
-
const selectableRowsInPage = isRowSelectable ? pageEntries.filter(_ref => {
|
|
203
|
+
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref => {
|
|
225
204
|
let {
|
|
226
205
|
model
|
|
227
206
|
} = _ref;
|
|
@@ -233,29 +212,24 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
233
212
|
id
|
|
234
213
|
} = _ref2;
|
|
235
214
|
return id;
|
|
236
|
-
}) :
|
|
237
|
-
let {
|
|
238
|
-
id
|
|
239
|
-
} = _ref3;
|
|
240
|
-
return id;
|
|
241
|
-
});
|
|
215
|
+
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
242
216
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
243
|
-
const selectableRowsInTable = isRowSelectable ?
|
|
217
|
+
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref3 => {
|
|
244
218
|
let {
|
|
245
219
|
model
|
|
246
|
-
} =
|
|
220
|
+
} = _ref3;
|
|
247
221
|
return isRowSelectable({
|
|
248
222
|
row: model
|
|
249
223
|
});
|
|
250
|
-
}).map(
|
|
224
|
+
}).map(_ref4 => {
|
|
251
225
|
let {
|
|
252
226
|
id
|
|
253
|
-
} =
|
|
227
|
+
} = _ref4;
|
|
254
228
|
return id;
|
|
255
229
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
256
230
|
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
257
|
-
const numberOfSelectedRows =
|
|
258
|
-
const selectedOnCurrentPage = selectableRowsInPage.filter(id =>
|
|
231
|
+
const numberOfSelectedRows = rowSelectionModel.length;
|
|
232
|
+
const selectedOnCurrentPage = selectableRowsInPage.filter(id => rowSelectionModel.includes(id));
|
|
259
233
|
if (numberOfSelectedRows === numberOfSelectableRowsInTable && numberOfSelectableRowsInPage < numberOfSelectableRowsInTable) {
|
|
260
234
|
selectionStatus = {
|
|
261
235
|
type: 'table',
|
|
@@ -299,48 +273,6 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
299
273
|
}
|
|
300
274
|
}
|
|
301
275
|
}), [theme]);
|
|
302
|
-
|
|
303
|
-
// Per-render data for the belowToolbar layout, handed to the stable `BelowToolbar` slot
|
|
304
|
-
// via `slotProps.toolbar` (see BelowToolbar) so the slot identity stays constant and the
|
|
305
|
-
// toolbar is re-rendered, not remounted. Typed as ToolbarWrapper props so mistakes are
|
|
306
|
-
// caught here; cast to MUI's slot type only at the injection site below.
|
|
307
|
-
const belowToolbarSlotProps = {
|
|
308
|
-
RenderedToolbar: (_ref6 = slots === null || slots === void 0 ? void 0 : slots.toolbar) !== null && _ref6 !== void 0 ? _ref6 : Toolbar,
|
|
309
|
-
hideToolbar,
|
|
310
|
-
filterModel,
|
|
311
|
-
onFilterModelChange,
|
|
312
|
-
pagination,
|
|
313
|
-
paginationMode,
|
|
314
|
-
displaySelection: bannerBelowToolbar,
|
|
315
|
-
displayPagination: pagerBelowToolbar,
|
|
316
|
-
displayRowsPerPage: pagerBelowToolbar,
|
|
317
|
-
selectionStatus,
|
|
318
|
-
apiRef,
|
|
319
|
-
isRowSelectable,
|
|
320
|
-
paginationModel,
|
|
321
|
-
onPaginationModelChange,
|
|
322
|
-
pageSizeOptions: pageSizeOptions,
|
|
323
|
-
paginationProps,
|
|
324
|
-
rowCount
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
// Per-render data for the bottom pagination slot, handed to the stable `BottomPagination`
|
|
328
|
-
// slot via `slotProps.pagination` for the same reason as the toolbar above.
|
|
329
|
-
const bottomPaginationSlotProps = {
|
|
330
|
-
pagination,
|
|
331
|
-
paginationMode,
|
|
332
|
-
displaySelection: bannerAtBottom,
|
|
333
|
-
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
334
|
-
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
335
|
-
selectionStatus,
|
|
336
|
-
paginationModel,
|
|
337
|
-
onPaginationModelChange,
|
|
338
|
-
apiRef,
|
|
339
|
-
isRowSelectable,
|
|
340
|
-
pageSizeOptions: pageSizeOptions,
|
|
341
|
-
paginationProps,
|
|
342
|
-
rowCount
|
|
343
|
-
};
|
|
344
276
|
return /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
345
277
|
value: {
|
|
346
278
|
theme
|
|
@@ -351,51 +283,63 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
351
283
|
ref: datagridRef,
|
|
352
284
|
className: classNames(DataGrid.className, className),
|
|
353
285
|
$height: height
|
|
354
|
-
},
|
|
355
|
-
displaySelection: bannerAtTop,
|
|
356
|
-
displayRowsPerPage: ['top', 'both'].includes(paginationPlacement),
|
|
357
|
-
displayPagination: ['top', 'both'].includes(paginationPlacement),
|
|
358
|
-
selectionStatus: selectionStatus,
|
|
359
|
-
paginationModel: paginationModel,
|
|
360
|
-
onPaginationModelChange: onPaginationModelChange,
|
|
361
|
-
pageSizeOptions: pageSizeOptions,
|
|
362
|
-
paginationProps: paginationProps,
|
|
363
|
-
rowCount: rowCount
|
|
364
|
-
}) : /*#__PURE__*/React__default.createElement(ControlledPagination, {
|
|
365
|
-
displaySelection: bannerAtTop,
|
|
366
|
-
displayRowsPerPage: ['top', 'both'].includes(paginationPlacement),
|
|
367
|
-
displayPagination: ['top', 'both'].includes(paginationPlacement),
|
|
368
|
-
selectionStatus: selectionStatus,
|
|
369
|
-
apiRef: apiRef,
|
|
370
|
-
isRowSelectable: isRowSelectable,
|
|
371
|
-
paginationModel: paginationModel,
|
|
372
|
-
onPaginationModelChange: onPaginationModelChange,
|
|
373
|
-
pageSizeOptions: pageSizeOptions,
|
|
374
|
-
paginationProps: paginationProps
|
|
375
|
-
}) : null, /*#__PURE__*/React__default.createElement(DataGridPremium, _extends({}, forwardedProps, {
|
|
286
|
+
}, /*#__PURE__*/React__default.createElement(DataGridPro, _extends({}, forwardedProps, {
|
|
376
287
|
rowCount: rowCount,
|
|
377
288
|
apiRef: apiRef,
|
|
378
289
|
autoHeight: autoHeight,
|
|
379
290
|
checkboxSelectionVisibleOnly: checkboxSelectionVisibleOnly,
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
291
|
+
slots: _objectSpread2(_objectSpread2(_objectSpread2({}, baseGridSlots), slots), {}, {
|
|
292
|
+
// The toolbar is already a stable module-level component (ToolbarWrapper) with its
|
|
293
|
+
// per-render data injected via `slotProps.toolbar` below. `BottomPagination` is
|
|
294
|
+
// likewise stable; a fresh inline function here would remount the slot's subtree
|
|
295
|
+
// every render.
|
|
296
|
+
toolbar: ToolbarWrapper,
|
|
385
297
|
pagination: BottomPagination
|
|
386
298
|
}),
|
|
387
|
-
slotProps: _objectSpread2(_objectSpread2(
|
|
388
|
-
toolbar: _objectSpread2(
|
|
389
|
-
|
|
390
|
-
|
|
299
|
+
slotProps: _objectSpread2(_objectSpread2({}, slotProps), {}, {
|
|
300
|
+
toolbar: _objectSpread2({
|
|
301
|
+
hideToolbar,
|
|
302
|
+
RenderedToolbar,
|
|
303
|
+
filterModel,
|
|
304
|
+
onFilterModelChange,
|
|
305
|
+
pagination,
|
|
306
|
+
displaySelection: bannerAtTop || bannerBelowToolbar,
|
|
307
|
+
displayPagination: ['top', 'both'].includes(paginationPlacement) || pagerBelowToolbar,
|
|
308
|
+
displayRowsPerPage: pagerBelowToolbar,
|
|
309
|
+
selectionStatus,
|
|
310
|
+
apiRef,
|
|
311
|
+
isRowSelectable,
|
|
312
|
+
paginationModel,
|
|
313
|
+
onPaginationModelChange,
|
|
314
|
+
pageSizeOptions,
|
|
315
|
+
paginationProps,
|
|
316
|
+
paginationMode,
|
|
317
|
+
rowCount
|
|
318
|
+
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar),
|
|
319
|
+
// Per-render data for the stable `BottomPagination` slot. Consumer slot props are
|
|
320
|
+
// spread first; the DS layout data wins. Cast at the MUI boundary because these are
|
|
321
|
+
// ToolbarWrapper props, not the MUI slot prop types.
|
|
322
|
+
pagination: _objectSpread2(_objectSpread2({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.pagination), {}, {
|
|
323
|
+
pagination,
|
|
324
|
+
paginationMode,
|
|
325
|
+
displaySelection: bannerAtBottom,
|
|
326
|
+
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
327
|
+
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
328
|
+
selectionStatus,
|
|
329
|
+
paginationModel,
|
|
330
|
+
onPaginationModelChange,
|
|
331
|
+
apiRef,
|
|
332
|
+
isRowSelectable,
|
|
333
|
+
pageSizeOptions,
|
|
334
|
+
paginationProps,
|
|
335
|
+
rowCount
|
|
336
|
+
})
|
|
391
337
|
}),
|
|
392
338
|
filterModel: filterModel,
|
|
393
339
|
columnVisibilityModel: columnVisibilityModel,
|
|
394
340
|
pinnedColumns: pinnedColumns,
|
|
395
341
|
sortModel: sortModel,
|
|
396
|
-
initialState:
|
|
397
|
-
density: (_ref7 = density !== null && density !== void 0 ? density : initialState === null || initialState === void 0 ? void 0 : initialState.density) !== null && _ref7 !== void 0 ? _ref7 : 'standard'
|
|
398
|
-
}),
|
|
342
|
+
initialState: initialState,
|
|
399
343
|
isRowSelectable: isRowSelectable,
|
|
400
344
|
onFilterModelChange: onFilterModelChange,
|
|
401
345
|
onColumnVisibilityModelChange: onColumnVisibilityModelChange,
|
|
@@ -415,52 +359,41 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
415
359
|
// Fix server-side header checkbox: when MUI deselects all due to indeterminate
|
|
416
360
|
// state (cross-page selections exist, 0 on current page), convert to "select page".
|
|
417
361
|
if (pagination && paginationMode === 'server') {
|
|
418
|
-
effectiveSelectionModel = fixServerSideHeaderCheckboxSelection(newSelectionModel, rowSelectionModel, selectionStatusRef, apiRef, isRowSelectable);
|
|
362
|
+
effectiveSelectionModel = fixServerSideHeaderCheckboxSelection(newSelectionModel, Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel], selectionStatusRef, apiRef, isRowSelectable);
|
|
419
363
|
}
|
|
420
364
|
if (pagination && paginationMode != 'server') {
|
|
421
|
-
|
|
422
|
-
// to avoid stale apiRef pagination state.
|
|
423
|
-
const allFilteredEntries = gridFilteredSortedRowEntriesSelector(apiRef);
|
|
424
|
-
const pageStart = paginationModel.page * paginationModel.pageSize;
|
|
425
|
-
const pageEntries = allFilteredEntries.slice(pageStart, pageStart + paginationModel.pageSize);
|
|
426
|
-
const selectableRowsInPage = isRowSelectable ? pageEntries.filter(_ref8 => {
|
|
365
|
+
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref5 => {
|
|
427
366
|
let {
|
|
428
367
|
model
|
|
429
|
-
} =
|
|
368
|
+
} = _ref5;
|
|
430
369
|
return isRowSelectable({
|
|
431
370
|
row: model
|
|
432
371
|
});
|
|
433
|
-
}).map(
|
|
372
|
+
}).map(_ref6 => {
|
|
434
373
|
let {
|
|
435
374
|
id
|
|
436
|
-
} =
|
|
375
|
+
} = _ref6;
|
|
437
376
|
return id;
|
|
438
|
-
}) :
|
|
439
|
-
let {
|
|
440
|
-
id
|
|
441
|
-
} = _ref10;
|
|
442
|
-
return id;
|
|
443
|
-
});
|
|
377
|
+
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
444
378
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
445
|
-
const selectableRowsInTable = isRowSelectable ?
|
|
379
|
+
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref7 => {
|
|
446
380
|
let {
|
|
447
381
|
model
|
|
448
|
-
} =
|
|
382
|
+
} = _ref7;
|
|
449
383
|
return isRowSelectable({
|
|
450
384
|
row: model
|
|
451
385
|
});
|
|
452
|
-
}).map(
|
|
386
|
+
}).map(_ref8 => {
|
|
453
387
|
let {
|
|
454
388
|
id
|
|
455
|
-
} =
|
|
389
|
+
} = _ref8;
|
|
456
390
|
return id;
|
|
457
391
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
458
392
|
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
459
|
-
const numberOfSelectedRows =
|
|
393
|
+
const numberOfSelectedRows = newSelectionModel.length;
|
|
460
394
|
if (selectionStatusRef.current.type === 'table' && numberOfSelectedRows === numberOfSelectableRowsInTable - numberOfSelectableRowsInPage || selectionStatusRef.current.type === 'table' && numberOfSelectedRows === numberOfSelectableRowsInTable || selectionStatusRef.current.type === 'page' && numberOfSelectedRows === numberOfSelectableRowsInPage) {
|
|
461
395
|
setTimeout(() => {
|
|
462
|
-
|
|
463
|
-
(_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.selectRows([], true, true);
|
|
396
|
+
apiRef.current.selectRows([], true, true);
|
|
464
397
|
}, 0);
|
|
465
398
|
}
|
|
466
399
|
if (numberOfSelectedRows === numberOfSelectableRowsInPage && numberOfSelectableRowsInPage < numberOfSelectableRowsInTable) {
|
|
@@ -484,7 +417,6 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
484
417
|
numberOfSelectedRows
|
|
485
418
|
};
|
|
486
419
|
}
|
|
487
|
-
forceSelectionUpdate(v => v + 1);
|
|
488
420
|
}
|
|
489
421
|
onRowSelectionModelChange === null || onRowSelectionModelChange === void 0 ? void 0 : onRowSelectionModelChange(effectiveSelectionModel, details);
|
|
490
422
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid2.js","sources":["../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["import React, { forwardRef, RefObject, useEffect, useMemo, useRef, useState } from 'react';\nimport { ThemeProvider as MuiThemeProvider, createTheme } from '@mui/material/styles';\nimport classNames from 'classnames';\nimport { LicenseInfo } from '@mui/x-license';\nimport {\n Comp,\n RedsiftColorBlueN,\n RedsiftColorNeutralWhite,\n RedsiftColorNeutralXDarkGrey,\n ThemeProvider,\n useTheme,\n} from '@redsift/design-system';\nimport {\n DataGridPremium,\n GridApiPremium,\n GridCallbackDetails,\n gridFilteredSortedRowEntriesSelector,\n gridFilteredSortedRowIdsSelector,\n GridRowParams,\n GridRowSelectionModel,\n useGridApiRef,\n} from '@mui/x-data-grid-premium';\n\nimport { StyledDataGrid } from './styles';\nimport { DataGridProps, SelectionStatus } from './types';\nimport {\n onServerSideSelectionStatusChange,\n fixServerSideHeaderCheckboxSelection,\n ServerSideControlledPagination,\n ControlledPagination,\n} from '../Pagination';\nimport { ToolbarWrapperProps } from '../ToolbarWrapper';\nimport { Toolbar } from '../Toolbar';\nimport { baseGridSlots, BelowToolbar, BottomPagination } from './defaultSlots';\nimport { useControlledDatagridState } from '../../hooks/useControlledDatagridState';\nimport { getSelectionCount, isRowSelected, normalizeRowSelectionModel } from '../../utils/rowSelection';\n\nconst COMPONENT_NAME = 'DataGrid';\nconst CLASSNAME = 'redsift-datagrid';\n\n/**\n * DataGrid displays tabular data with sorting, filtering, pagination, and row selection.\n * Built on MUI X DataGrid Pro with Red Sift styling and theming.\n *\n * Requires MUI Premium license key (set via `MUI_LICENSE_KEY` env variable).\n *\n * Use `createColumn()` to get pre-configured column definitions with typed filter operators.\n * Supported types: `string`, `number`, `date`, `dateTime`, `singleSelect`, `multiSelect`, `tags`.\n * For `boolean` columns, use `type: 'boolean'` directly (no createColumn wrapper needed).\n *\n * @example\n * // Basic data grid with typed columns\n * <DataGrid\n * columns={[\n * { ...createColumn('number'), field: 'id', headerName: 'ID', width: 90 },\n * { ...createColumn('string'), field: 'name', headerName: 'Name', width: 150 },\n * { ...createColumn('string'), field: 'email', headerName: 'Email', flex: 1 },\n * ]}\n * rows={users}\n * />\n *\n * @example\n * // Custom cell renderer with Shield component\n * const columns = [\n * { field: 'domain', headerName: 'Domain' },\n * {\n * field: 'status',\n * headerName: 'Status',\n * renderCell: ({ value }) => (\n * <Shield variant={value === 'active' ? 'success' : 'fail'}>\n * {value}\n * </Shield>\n * ),\n * },\n * ];\n * <DataGrid columns={columns} rows={data} />\n *\n * @example\n * // With pagination and sorting\n * <DataGrid\n * columns={columns}\n * rows={data}\n * pagination\n * paginationModel={{ page: 0, pageSize: 25 }}\n * pageSizeOptions={[10, 25, 50]}\n * sortModel={[{ field: 'createdAt', sort: 'desc' }]}\n * />\n *\n * @example\n * // With row selection and checkbox\n * <DataGrid\n * columns={columns}\n * rows={data}\n * checkboxSelection\n * rowSelectionModel={selectedIds}\n * onRowSelectionModelChange={setSelectedIds}\n * />\n *\n * @example\n * // Server-side pagination\n * <DataGrid\n * columns={columns}\n * rows={pageData}\n * pagination\n * paginationMode=\"server\"\n * rowCount={totalRows}\n * paginationModel={{ page, pageSize }}\n * pageSizeOptions={[10, 25, 50]}\n * onPaginationModelChange={setPaginationModel}\n * />\n */\n\nexport const DataGrid: Comp<DataGridProps, HTMLDivElement> = forwardRef((props, ref) => {\n const datagridRef = ref || useRef<HTMLDivElement>();\n\n const {\n apiRef: propsApiRef,\n autoHeight,\n className,\n slots,\n slotProps,\n filterModel: propsFilterModel,\n columnVisibilityModel: propsColumnVisibilityModel,\n pinnedColumns: propsPinnedColumns,\n sortModel: propsSortModel,\n paginationModel: propsPaginationModel,\n height: propsHeight,\n hideToolbar,\n initialState,\n isRowSelectable,\n license = process.env.MUI_LICENSE_KEY,\n onFilterModelChange: propsOnFilterModelChange,\n rowSelectionModel: propsRowSelectionModel,\n onPaginationModelChange: propsOnPaginationModelChange,\n onRowSelectionModelChange: propsOnRowSelectionModelChange,\n onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,\n onPinnedColumnsChange: propsOnPinnedColumnsChange,\n onSortModelChange: propsOnSortModelChange,\n pagination,\n paginationPlacement = 'both',\n selectionBannerPlacement = 'top',\n paginationProps,\n rows,\n pageSizeOptions = [5, 10, 25, 50],\n sx,\n theme: propsTheme,\n paginationMode = 'client',\n rowCount,\n density,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n\n const _apiRef = useGridApiRef();\n const apiRef = propsApiRef ?? _apiRef;\n\n LicenseInfo.setLicenseKey(license!);\n\n const height = propsHeight ?? (autoHeight ? undefined : '500px');\n\n const {\n columnVisibilityModel,\n filterModel,\n onColumnVisibilityModelChange,\n onFilterModelChange,\n onPaginationModelChange,\n onPinnedColumnsChange,\n onSortModelChange,\n paginationModel,\n pinnedColumns,\n sortModel,\n } = useControlledDatagridState({\n initialState,\n pageSizeOptions,\n propsColumnVisibilityModel,\n propsFilterModel,\n propsOnColumnVisibilityModelChange,\n propsOnFilterModelChange,\n propsOnPinnedColumnsChange,\n propsOnSortModelChange,\n propsPaginationModel,\n propsPinnedColumns,\n propsSortModel,\n propsOnPaginationModelChange,\n });\n\n const [rowSelectionModel, setRowSelectionModel] = useState(() => normalizeRowSelectionModel(propsRowSelectionModel));\n useEffect(() => {\n setRowSelectionModel(normalizeRowSelectionModel(propsRowSelectionModel));\n }, [propsRowSelectionModel]);\n\n const onRowSelectionModelChange = (selectionModel: GridRowSelectionModel, details: GridCallbackDetails) => {\n setRowSelectionModel(selectionModel);\n if (propsOnRowSelectionModelChange) {\n propsOnRowSelectionModelChange(selectionModel, details);\n }\n };\n\n const selectionStatusRef = useRef<SelectionStatus>({\n type: 'none',\n numberOfSelectedRows: 0,\n numberOfSelectedRowsInPage: 0,\n page: paginationModel.page,\n pageSize: paginationModel.pageSize,\n });\n\n // Version counter to force re-renders when selectionStatus ref changes\n const [, forceSelectionUpdate] = useState(0);\n\n // Track when the grid API is ready to ensure top pagination renders correctly\n const [gridReady, setGridReady] = useState(false);\n\n // The checkboxSelectionVisibleOnly should only be applied to client-side pagination,\n // for server-side pagination it produces inconsistent behavior when selecting all rows in pages 2 and beyond\n const checkboxSelectionVisibleOnly = Boolean(pagination) && Boolean(paginationMode != 'server');\n\n // Banner and pager placements are independent. `belowToolbar` (for either) renders\n // in a row inside the toolbar slot, and only applies when pagination is on.\n const bannerAtTop = selectionBannerPlacement === 'top';\n const bannerAtBottom = selectionBannerPlacement === 'bottom';\n const bannerBelowToolbar = selectionBannerPlacement === 'belowToolbar' && Boolean(pagination);\n const pagerBelowToolbar = paginationPlacement === 'belowToolbar' && Boolean(pagination);\n const belowToolbarActive = bannerBelowToolbar || pagerBelowToolbar;\n\n // Force re-render when the grid API becomes ready (for top pagination)\n useEffect(() => {\n if (apiRef.current && !gridReady) {\n setGridReady(true);\n }\n });\n\n // in server-side pagination we want to update the selection status\n // every time we navigate between pages, resize our page or select something\n useEffect(() => {\n if (paginationMode == 'server') {\n onServerSideSelectionStatusChange(\n rowSelectionModel,\n apiRef,\n selectionStatusRef,\n forceSelectionUpdate,\n isRowSelectable,\n paginationModel.page,\n paginationModel.pageSize\n );\n }\n }, [rowSelectionModel, paginationModel.page, paginationModel.pageSize, rows]);\n\n if (!Array.isArray(rows)) {\n return null;\n }\n\n // Compute selection status synchronously during render for client-side pagination.\n // This value is passed directly to ToolbarWrapper and ControlledPagination, so slots\n // receive the fresh value in the same render cycle — no extra re-render needed.\n // The ref is kept in sync for the onRowSelectionModelChange callback's deselect logic.\n let selectionStatus: SelectionStatus = selectionStatusRef.current;\n if (pagination && paginationMode !== 'server' && getSelectionCount(rowSelectionModel) > 0) {\n try {\n // Use manual page slicing instead of gridPaginatedVisibleSorted* selectors.\n // MUI's paginated selectors use apiRef internal state which may be stale when\n // paginationModel prop changes — our React state is always up to date.\n const allFilteredEntries = gridFilteredSortedRowEntriesSelector(apiRef);\n const pageStart = paginationModel.page * paginationModel.pageSize;\n const pageEntries = allFilteredEntries.slice(pageStart, pageStart + paginationModel.pageSize);\n\n const selectableRowsInPage = isRowSelectable\n ? pageEntries\n .filter(({ model }) => isRowSelectable({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : pageEntries.map(({ id }) => id);\n const numberOfSelectableRowsInPage = selectableRowsInPage.length;\n\n const selectableRowsInTable = isRowSelectable\n ? allFilteredEntries\n .filter(({ model }) => isRowSelectable({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : gridFilteredSortedRowIdsSelector(apiRef);\n const numberOfSelectableRowsInTable = selectableRowsInTable.length;\n\n const numberOfSelectedRows = getSelectionCount(rowSelectionModel);\n const selectedOnCurrentPage = selectableRowsInPage.filter((id) => isRowSelected(rowSelectionModel, id));\n\n if (\n numberOfSelectedRows === numberOfSelectableRowsInTable &&\n numberOfSelectableRowsInPage < numberOfSelectableRowsInTable\n ) {\n selectionStatus = { type: 'table', numberOfSelectedRows };\n } else if (\n selectedOnCurrentPage.length === numberOfSelectableRowsInPage &&\n numberOfSelectableRowsInPage > 0 &&\n numberOfSelectableRowsInPage < numberOfSelectableRowsInTable\n ) {\n selectionStatus = { type: 'page', numberOfSelectedRows: selectedOnCurrentPage.length };\n } else if (numberOfSelectedRows > 0) {\n selectionStatus = { type: 'other', numberOfSelectedRows };\n } else {\n selectionStatus = { type: 'none', numberOfSelectedRows: 0 };\n }\n } catch {\n // apiRef may not be initialized on first render\n }\n } else if (pagination && paginationMode !== 'server') {\n selectionStatus = { type: 'none', numberOfSelectedRows: 0 };\n }\n selectionStatusRef.current = selectionStatus;\n\n const muiTheme = useMemo(\n () =>\n createTheme({\n palette: {\n mode: theme as 'light' | 'dark',\n primary: { main: RedsiftColorBlueN },\n background: {\n default: theme === 'dark' ? RedsiftColorNeutralXDarkGrey : RedsiftColorNeutralWhite,\n paper: theme === 'dark' ? RedsiftColorNeutralXDarkGrey : RedsiftColorNeutralWhite,\n },\n },\n }),\n [theme]\n );\n\n // Per-render data for the belowToolbar layout, handed to the stable `BelowToolbar` slot\n // via `slotProps.toolbar` (see BelowToolbar) so the slot identity stays constant and the\n // toolbar is re-rendered, not remounted. Typed as ToolbarWrapper props so mistakes are\n // caught here; cast to MUI's slot type only at the injection site below.\n const belowToolbarSlotProps: Partial<ToolbarWrapperProps> = {\n RenderedToolbar: (slots?.toolbar as React.JSXElementConstructor<any>) ?? Toolbar,\n hideToolbar,\n filterModel,\n onFilterModelChange,\n pagination,\n paginationMode,\n displaySelection: bannerBelowToolbar,\n displayPagination: pagerBelowToolbar,\n displayRowsPerPage: pagerBelowToolbar,\n selectionStatus,\n apiRef,\n isRowSelectable,\n paginationModel,\n onPaginationModelChange,\n pageSizeOptions: pageSizeOptions as any as number[],\n paginationProps,\n rowCount,\n };\n\n // Per-render data for the bottom pagination slot, handed to the stable `BottomPagination`\n // slot via `slotProps.pagination` for the same reason as the toolbar above.\n const bottomPaginationSlotProps: Partial<ToolbarWrapperProps> = {\n pagination,\n paginationMode,\n displaySelection: bannerAtBottom,\n displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement!),\n displayPagination: ['bottom', 'both'].includes(paginationPlacement!),\n selectionStatus,\n paginationModel,\n onPaginationModelChange,\n apiRef,\n isRowSelectable,\n pageSizeOptions: pageSizeOptions as any as number[],\n paginationProps,\n rowCount,\n };\n\n return (\n <ThemeProvider value={{ theme }}>\n <MuiThemeProvider theme={muiTheme}>\n {/* <pre>{JSON.stringify(selectionStatus, null, 2)}</pre> */}\n <StyledDataGrid\n ref={datagridRef as RefObject<HTMLDivElement>}\n className={classNames(DataGrid.className, className)}\n $height={height}\n >\n {pagination && gridReady && (bannerAtTop || ['top', 'both'].includes(paginationPlacement!)) ? (\n paginationMode == 'server' ? (\n <ServerSideControlledPagination\n displaySelection={bannerAtTop}\n displayRowsPerPage={['top', 'both'].includes(paginationPlacement!)}\n displayPagination={['top', 'both'].includes(paginationPlacement!)}\n selectionStatus={selectionStatus}\n paginationModel={paginationModel}\n onPaginationModelChange={onPaginationModelChange}\n pageSizeOptions={pageSizeOptions as any as number[]}\n paginationProps={paginationProps}\n rowCount={rowCount!}\n />\n ) : (\n <ControlledPagination\n displaySelection={bannerAtTop}\n displayRowsPerPage={['top', 'both'].includes(paginationPlacement!)}\n displayPagination={['top', 'both'].includes(paginationPlacement!)}\n selectionStatus={selectionStatus}\n apiRef={apiRef}\n isRowSelectable={isRowSelectable}\n paginationModel={paginationModel}\n onPaginationModelChange={onPaginationModelChange}\n pageSizeOptions={pageSizeOptions as any as number[]}\n paginationProps={paginationProps}\n />\n )\n ) : null}\n <DataGridPremium\n {...forwardedProps}\n rowCount={rowCount!}\n apiRef={apiRef}\n autoHeight={autoHeight}\n checkboxSelectionVisibleOnly={checkboxSelectionVisibleOnly}\n disableRowSelectionExcludeModel\n showToolbar={!hideToolbar || belowToolbarActive}\n slots={{\n // Stable base/icon slots (created once) — see defaultSlots.\n ...baseGridSlots,\n ...slots,\n // When the banner and/or pager is placed below the toolbar, wrap the resolved\n // toolbar (consumer-provided slot, or the default DS Toolbar) so the banner (left)\n // and/or pager (right) render directly beneath it. `showToolbar` is forced on\n // above so this slot still renders when `hideToolbar` is set.\n //\n // `BelowToolbar` and `BottomPagination` are stable module-level components; their\n // per-render data is injected via `slotProps` below. A fresh inline function here\n // would remount the slot's subtree every render — for the toolbar that dropped\n // quick-search focus on every keystroke.\n ...(belowToolbarActive ? { toolbar: BelowToolbar } : {}),\n pagination: BottomPagination,\n }}\n slotProps={{\n ...slotProps,\n // Inject the per-render slot data (built above) here rather than closing over it\n // in inline slots, so the `toolbar`/`pagination` slot identities stay stable.\n // Consumer slot props are spread first; the DS layout data wins (and, for the\n // toolbar, is forwarded on to `RenderedToolbar` by ToolbarWrapper). Cast at the\n // MUI boundary because these are ToolbarWrapper props, not the MUI slot prop types.\n ...(belowToolbarActive\n ? {\n toolbar: { ...slotProps?.toolbar, ...belowToolbarSlotProps } as unknown as NonNullable<\n DataGridProps['slotProps']\n >['toolbar'],\n }\n : {}),\n pagination: { ...slotProps?.pagination, ...bottomPaginationSlotProps } as unknown as NonNullable<\n DataGridProps['slotProps']\n >['pagination'],\n }}\n filterModel={filterModel}\n columnVisibilityModel={columnVisibilityModel}\n pinnedColumns={pinnedColumns}\n sortModel={sortModel}\n initialState={{ ...initialState, density: density ?? initialState?.density ?? 'standard' }}\n isRowSelectable={isRowSelectable}\n onFilterModelChange={onFilterModelChange}\n onColumnVisibilityModelChange={onColumnVisibilityModelChange}\n onPinnedColumnsChange={onPinnedColumnsChange}\n onSortModelChange={onSortModelChange}\n pagination={pagination}\n paginationMode={paginationMode}\n keepNonExistentRowsSelected={paginationMode == 'server'}\n rows={rows}\n pageSizeOptions={pageSizeOptions}\n paginationModel={paginationModel}\n onPaginationModelChange={onPaginationModelChange}\n rowSelectionModel={rowSelectionModel}\n onRowSelectionModelChange={(newSelectionModel, details) => {\n let effectiveSelectionModel = newSelectionModel;\n\n // Fix server-side header checkbox: when MUI deselects all due to indeterminate\n // state (cross-page selections exist, 0 on current page), convert to \"select page\".\n if (pagination && paginationMode === 'server') {\n effectiveSelectionModel = fixServerSideHeaderCheckboxSelection(\n newSelectionModel,\n rowSelectionModel,\n selectionStatusRef,\n apiRef as React.MutableRefObject<GridApiPremium>,\n isRowSelectable\n );\n }\n\n if (pagination && paginationMode != 'server') {\n // Use manual page slicing instead of gridPaginatedVisibleSorted* selectors\n // to avoid stale apiRef pagination state.\n const allFilteredEntries = gridFilteredSortedRowEntriesSelector(apiRef);\n const pageStart = paginationModel.page * paginationModel.pageSize;\n const pageEntries = allFilteredEntries.slice(pageStart, pageStart + paginationModel.pageSize);\n\n const selectableRowsInPage = isRowSelectable\n ? pageEntries\n .filter(({ model }) => isRowSelectable({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : pageEntries.map(({ id }) => id);\n const numberOfSelectableRowsInPage = selectableRowsInPage.length;\n\n const selectableRowsInTable = isRowSelectable\n ? allFilteredEntries\n .filter(({ model }) => isRowSelectable({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : gridFilteredSortedRowIdsSelector(apiRef);\n const numberOfSelectableRowsInTable = selectableRowsInTable.length;\n\n const numberOfSelectedRows = getSelectionCount(newSelectionModel);\n\n if (\n (selectionStatusRef.current.type === 'table' &&\n numberOfSelectedRows === numberOfSelectableRowsInTable - numberOfSelectableRowsInPage) ||\n (selectionStatusRef.current.type === 'table' &&\n numberOfSelectedRows === numberOfSelectableRowsInTable) ||\n (selectionStatusRef.current.type === 'page' && numberOfSelectedRows === numberOfSelectableRowsInPage)\n ) {\n setTimeout(() => {\n apiRef.current?.selectRows([], true, true);\n }, 0);\n }\n\n if (\n numberOfSelectedRows === numberOfSelectableRowsInPage &&\n numberOfSelectableRowsInPage < numberOfSelectableRowsInTable\n ) {\n selectionStatusRef.current = {\n type: 'page',\n numberOfSelectedRows,\n };\n } else if (\n numberOfSelectedRows === numberOfSelectableRowsInTable &&\n numberOfSelectableRowsInPage < numberOfSelectableRowsInTable\n ) {\n selectionStatusRef.current = {\n type: 'table',\n numberOfSelectedRows,\n };\n } else if (numberOfSelectedRows > 0) {\n selectionStatusRef.current = {\n type: 'other',\n numberOfSelectedRows,\n };\n } else {\n selectionStatusRef.current = {\n type: 'none',\n numberOfSelectedRows,\n };\n }\n forceSelectionUpdate((v) => v + 1);\n }\n onRowSelectionModelChange?.(effectiveSelectionModel, details);\n }}\n sx={{\n ...sx,\n '.MuiDataGrid-columnHeaders': {\n flexDirection: 'column',\n alignItems: 'normal',\n },\n '.MuiDataGrid-selectedRowCount': {\n margin: 'none',\n },\n }}\n />\n </StyledDataGrid>\n </MuiThemeProvider>\n </ThemeProvider>\n );\n});\nDataGrid.className = CLASSNAME;\nDataGrid.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","DataGrid","forwardRef","props","ref","_ref6","_ref7","datagridRef","useRef","apiRef","propsApiRef","autoHeight","className","slots","slotProps","filterModel","propsFilterModel","columnVisibilityModel","propsColumnVisibilityModel","pinnedColumns","propsPinnedColumns","sortModel","propsSortModel","paginationModel","propsPaginationModel","height","propsHeight","hideToolbar","initialState","isRowSelectable","license","process","env","MUI_LICENSE_KEY","onFilterModelChange","propsOnFilterModelChange","rowSelectionModel","propsRowSelectionModel","onPaginationModelChange","propsOnPaginationModelChange","onRowSelectionModelChange","propsOnRowSelectionModelChange","onColumnVisibilityModelChange","propsOnColumnVisibilityModelChange","onPinnedColumnsChange","propsOnPinnedColumnsChange","onSortModelChange","propsOnSortModelChange","pagination","paginationPlacement","selectionBannerPlacement","paginationProps","rows","pageSizeOptions","sx","theme","propsTheme","paginationMode","rowCount","density","forwardedProps","_objectWithoutProperties","_excluded","useTheme","_apiRef","useGridApiRef","LicenseInfo","setLicenseKey","undefined","useControlledDatagridState","setRowSelectionModel","useState","normalizeRowSelectionModel","useEffect","selectionModel","details","selectionStatusRef","type","numberOfSelectedRows","numberOfSelectedRowsInPage","page","pageSize","forceSelectionUpdate","gridReady","setGridReady","checkboxSelectionVisibleOnly","Boolean","bannerAtTop","bannerAtBottom","bannerBelowToolbar","pagerBelowToolbar","belowToolbarActive","current","onServerSideSelectionStatusChange","Array","isArray","selectionStatus","getSelectionCount","allFilteredEntries","gridFilteredSortedRowEntriesSelector","pageStart","pageEntries","slice","selectableRowsInPage","filter","_ref","model","row","map","_ref2","id","_ref3","numberOfSelectableRowsInPage","length","selectableRowsInTable","_ref4","_ref5","gridFilteredSortedRowIdsSelector","numberOfSelectableRowsInTable","selectedOnCurrentPage","isRowSelected","muiTheme","useMemo","createTheme","palette","mode","primary","main","RedsiftColorBlueN","background","default","RedsiftColorNeutralXDarkGrey","RedsiftColorNeutralWhite","paper","belowToolbarSlotProps","RenderedToolbar","toolbar","Toolbar","displaySelection","displayPagination","displayRowsPerPage","bottomPaginationSlotProps","includes","React","createElement","ThemeProvider","value","MuiThemeProvider","StyledDataGrid","classNames","$height","ServerSideControlledPagination","ControlledPagination","DataGridPremium","_extends","disableRowSelectionExcludeModel","showToolbar","_objectSpread","baseGridSlots","BelowToolbar","BottomPagination","keepNonExistentRowsSelected","newSelectionModel","effectiveSelectionModel","fixServerSideHeaderCheckboxSelection","_ref8","_ref9","_ref10","_ref11","_ref12","setTimeout","_apiRef$current","selectRows","v","flexDirection","alignItems","margin","displayName"],"mappings":";;;;;;;;;;;;AAqCA,MAAMA,cAAc,GAAG,UAAU,CAAA;AACjC,MAAMC,S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FrB,IAAAA,EAAE,EAAAuG,cAAA,CAAAA,cAAA,KACGvG,EAAE,CAAA,EAAA,EAAA,EAAA;AACL,MAAA,4BAA4B,EAAE;AAC5BwH,QAAAA,aAAa,EAAE,QAAQ;AACvBC,QAAAA,UAAU,EAAE,QAAA;OACb;AACD,MAAA,+BAA+B,EAAE;AAC/BC,QAAAA,MAAM,EAAE,MAAA;AACV,OAAA;AAAC,KAAA,CAAA;GAEJ,CAAA,CACa,CACA,CACL,CAAC,CAAA;AAEpB,CAAC,EAAC;AACF/K,QAAQ,CAACW,SAAS,GAAGZ,SAAS,CAAA;AAC9BC,QAAQ,CAACgL,WAAW,GAAGlL,cAAc;;;;"}
|
|
1
|
+
{"version":3,"file":"DataGrid2.js","sources":["../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["import React, { forwardRef, RefObject, useEffect, useMemo, useRef, useState } from 'react';\nimport { ThemeProvider as MuiThemeProvider, createTheme } from '@mui/material/styles';\nimport classNames from 'classnames';\nimport { LicenseInfo } from '@mui/x-license-pro';\nimport {\n Comp,\n RedsiftColorBlueN,\n RedsiftColorNeutralWhite,\n RedsiftColorNeutralXDarkGrey,\n ThemeProvider,\n useTheme,\n} from '@redsift/design-system';\nimport {\n DataGridPro,\n GridCallbackDetails,\n gridFilteredSortedRowEntriesSelector,\n gridFilteredSortedRowIdsSelector,\n gridPaginatedVisibleSortedGridRowEntriesSelector,\n gridPaginatedVisibleSortedGridRowIdsSelector,\n GridRowParams,\n GridRowSelectionModel,\n useGridApiRef,\n} from '@mui/x-data-grid-pro';\n\nimport { StyledDataGrid } from './styles';\nimport { DataGridProps, SelectionStatus } from './types';\nimport { Toolbar as DefaultToolbar } from '../Toolbar';\nimport { ToolbarWrapper } from '../ToolbarWrapper';\nimport { baseGridSlots, BottomPagination } from './defaultSlots';\nimport { onServerSideSelectionStatusChange, fixServerSideHeaderCheckboxSelection } from '../Pagination';\nimport { useControlledDatagridState } from '../../hooks/useControlledDatagridState';\n\nconst COMPONENT_NAME = 'DataGrid';\nconst CLASSNAME = 'redsift-datagrid';\n\n/**\n * DataGrid displays tabular data with sorting, filtering, pagination, and row selection.\n * Built on MUI X DataGrid Pro with Red Sift styling and theming.\n *\n * Requires MUI Premium license key (set via `MUI_LICENSE_KEY` env variable).\n *\n * Use `createColumn()` to get pre-configured column definitions with typed filter operators.\n * Supported types: `string`, `number`, `date`, `dateTime`, `singleSelect`, `multiSelect`, `tags`.\n * For `boolean` columns, use `type: 'boolean'` directly (no createColumn wrapper needed).\n *\n * @example\n * // Basic data grid with typed columns\n * <DataGrid\n * columns={[\n * { ...createColumn('number'), field: 'id', headerName: 'ID', width: 90 },\n * { ...createColumn('string'), field: 'name', headerName: 'Name', width: 150 },\n * { ...createColumn('string'), field: 'email', headerName: 'Email', flex: 1 },\n * ]}\n * rows={users}\n * />\n *\n * @example\n * // Custom cell renderer with Shield component\n * const columns = [\n * { field: 'domain', headerName: 'Domain' },\n * {\n * field: 'status',\n * headerName: 'Status',\n * renderCell: ({ value }) => (\n * <Shield variant={value === 'active' ? 'success' : 'fail'}>\n * {value}\n * </Shield>\n * ),\n * },\n * ];\n * <DataGrid columns={columns} rows={data} />\n *\n * @example\n * // With pagination and sorting\n * <DataGrid\n * columns={columns}\n * rows={data}\n * pagination\n * paginationModel={{ page: 0, pageSize: 25 }}\n * pageSizeOptions={[10, 25, 50]}\n * sortModel={[{ field: 'createdAt', sort: 'desc' }]}\n * />\n *\n * @example\n * // With row selection and checkbox\n * <DataGrid\n * columns={columns}\n * rows={data}\n * checkboxSelection\n * rowSelectionModel={selectedIds}\n * onRowSelectionModelChange={setSelectedIds}\n * />\n *\n * @example\n * // Server-side pagination\n * <DataGrid\n * columns={columns}\n * rows={pageData}\n * pagination\n * paginationMode=\"server\"\n * rowCount={totalRows}\n * paginationModel={{ page, pageSize }}\n * pageSizeOptions={[10, 25, 50]}\n * onPaginationModelChange={setPaginationModel}\n * />\n */\n\nexport const DataGrid: Comp<DataGridProps, HTMLDivElement> = forwardRef((props, ref) => {\n const datagridRef = ref || useRef<HTMLDivElement>();\n\n const {\n apiRef: propsApiRef,\n autoHeight,\n className,\n slots,\n slotProps,\n filterModel: propsFilterModel,\n columnVisibilityModel: propsColumnVisibilityModel,\n pinnedColumns: propsPinnedColumns,\n sortModel: propsSortModel,\n paginationModel: propsPaginationModel,\n height: propsHeight,\n hideToolbar,\n initialState,\n isRowSelectable,\n license = process.env.MUI_LICENSE_KEY,\n onFilterModelChange: propsOnFilterModelChange,\n rowSelectionModel: propsRowSelectionModel,\n onPaginationModelChange: propsOnPaginationModelChange,\n onRowSelectionModelChange: propsOnRowSelectionModelChange,\n onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,\n onPinnedColumnsChange: propsOnPinnedColumnsChange,\n onSortModelChange: propsOnSortModelChange,\n pagination,\n paginationPlacement = 'both',\n selectionBannerPlacement = 'top',\n paginationProps,\n rows,\n pageSizeOptions,\n sx,\n theme: propsTheme,\n paginationMode = 'client',\n rowCount,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n\n const _apiRef = useGridApiRef();\n const apiRef = propsApiRef ?? _apiRef;\n\n const RenderedToolbar = slots?.toolbar ? slots.toolbar : DefaultToolbar;\n\n LicenseInfo.setLicenseKey(license!);\n\n const height = propsHeight ?? (autoHeight ? undefined : '500px');\n\n const {\n columnVisibilityModel,\n filterModel,\n onColumnVisibilityModelChange,\n onFilterModelChange,\n onPaginationModelChange,\n onPinnedColumnsChange,\n onSortModelChange,\n paginationModel,\n pinnedColumns,\n sortModel,\n } = useControlledDatagridState({\n initialState,\n pageSizeOptions,\n propsColumnVisibilityModel,\n propsFilterModel,\n propsOnColumnVisibilityModelChange,\n propsOnFilterModelChange,\n propsOnPinnedColumnsChange,\n propsOnSortModelChange,\n propsPaginationModel,\n propsPinnedColumns,\n propsSortModel,\n propsOnPaginationModelChange,\n });\n\n const [rowSelectionModel, setRowSelectionModel] = useState(propsRowSelectionModel ?? []);\n useEffect(() => {\n setRowSelectionModel(propsRowSelectionModel ?? []);\n }, [propsRowSelectionModel]);\n\n const onRowSelectionModelChange = (selectionModel: GridRowSelectionModel, details: GridCallbackDetails) => {\n setRowSelectionModel(selectionModel);\n if (propsOnRowSelectionModelChange) {\n propsOnRowSelectionModelChange(selectionModel, details);\n }\n };\n\n const selectionStatusRef = useRef<SelectionStatus>({\n type: 'none',\n numberOfSelectedRows: 0,\n numberOfSelectedRowsInPage: 0,\n page: paginationModel.page,\n pageSize: paginationModel.pageSize,\n });\n\n // The checkboxSelectionVisibleOnly should only be applied to client-side pagination,\n // for server-side pagination it produces inconsistent behavior when selecting all rows in pages 2 and beyond\n const checkboxSelectionVisibleOnly = Boolean(pagination) && Boolean(paginationMode != 'server');\n\n // Banner and pager placements are independent. `belowToolbar` (for either) renders\n // in the toolbar-slot row, and only applies when pagination is on.\n const bannerAtTop = selectionBannerPlacement === 'top';\n const bannerAtBottom = selectionBannerPlacement === 'bottom';\n const bannerBelowToolbar = selectionBannerPlacement === 'belowToolbar' && Boolean(pagination);\n const pagerBelowToolbar = paginationPlacement === 'belowToolbar' && Boolean(pagination);\n\n // in server-side pagination we want to update the selection status\n // every time we navigate between pages, resize our page or select something\n useEffect(() => {\n if (paginationMode == 'server') {\n onServerSideSelectionStatusChange(\n Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel],\n apiRef,\n selectionStatusRef,\n isRowSelectable,\n paginationModel.page,\n paginationModel.pageSize\n );\n }\n }, [rowSelectionModel, paginationModel.page, paginationModel.pageSize, rows]);\n\n if (!Array.isArray(rows)) {\n return null;\n }\n\n // Compute selection status synchronously during render for client-side pagination.\n // This value is passed directly to ToolbarWrapper and ControlledPagination, so slots\n // receive the fresh value in the same render cycle — no extra re-render needed.\n // The ref is kept in sync for the onRowSelectionModelChange callback's deselect logic.\n let selectionStatus: SelectionStatus = selectionStatusRef.current;\n if (pagination && paginationMode !== 'server' && Array.isArray(rowSelectionModel) && rowSelectionModel.length > 0) {\n try {\n const selectableRowsInPage = isRowSelectable\n ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef)\n .filter(({ model }) => isRowSelectable({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);\n const numberOfSelectableRowsInPage = selectableRowsInPage.length;\n\n const selectableRowsInTable = isRowSelectable\n ? gridFilteredSortedRowEntriesSelector(apiRef)\n .filter(({ model }) => isRowSelectable({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : gridFilteredSortedRowIdsSelector(apiRef);\n const numberOfSelectableRowsInTable = selectableRowsInTable.length;\n\n const numberOfSelectedRows = rowSelectionModel.length;\n const selectedOnCurrentPage = selectableRowsInPage.filter((id) => rowSelectionModel.includes(id));\n\n if (\n numberOfSelectedRows === numberOfSelectableRowsInTable &&\n numberOfSelectableRowsInPage < numberOfSelectableRowsInTable\n ) {\n selectionStatus = { type: 'table', numberOfSelectedRows };\n } else if (\n selectedOnCurrentPage.length === numberOfSelectableRowsInPage &&\n numberOfSelectableRowsInPage > 0 &&\n numberOfSelectableRowsInPage < numberOfSelectableRowsInTable\n ) {\n selectionStatus = { type: 'page', numberOfSelectedRows: selectedOnCurrentPage.length };\n } else if (numberOfSelectedRows > 0) {\n selectionStatus = { type: 'other', numberOfSelectedRows };\n } else {\n selectionStatus = { type: 'none', numberOfSelectedRows: 0 };\n }\n } catch {\n // apiRef may not be initialized on first render\n }\n } else if (pagination && paginationMode !== 'server') {\n selectionStatus = { type: 'none', numberOfSelectedRows: 0 };\n }\n selectionStatusRef.current = selectionStatus;\n\n const muiTheme = useMemo(\n () =>\n createTheme({\n palette: {\n mode: theme,\n primary: { main: RedsiftColorBlueN },\n background: {\n default: theme === 'dark' ? RedsiftColorNeutralXDarkGrey : RedsiftColorNeutralWhite,\n paper: theme === 'dark' ? RedsiftColorNeutralXDarkGrey : RedsiftColorNeutralWhite,\n },\n },\n }),\n [theme]\n );\n\n return (\n <ThemeProvider value={{ theme }}>\n <MuiThemeProvider theme={muiTheme}>\n {/* <pre>{JSON.stringify(selectionStatus, null, 2)}</pre> */}\n <StyledDataGrid\n ref={datagridRef as RefObject<HTMLDivElement>}\n className={classNames(DataGrid.className, className)}\n $height={height}\n >\n <DataGridPro\n {...forwardedProps}\n rowCount={rowCount!}\n apiRef={apiRef}\n autoHeight={autoHeight}\n checkboxSelectionVisibleOnly={checkboxSelectionVisibleOnly}\n slots={{\n // Stable base/icon slots (created once) — see defaultSlots.\n ...baseGridSlots,\n ...slots,\n // The toolbar is already a stable module-level component (ToolbarWrapper) with its\n // per-render data injected via `slotProps.toolbar` below. `BottomPagination` is\n // likewise stable; a fresh inline function here would remount the slot's subtree\n // every render.\n toolbar: ToolbarWrapper,\n pagination: BottomPagination,\n }}\n slotProps={{\n ...slotProps,\n toolbar: {\n hideToolbar,\n RenderedToolbar,\n filterModel,\n onFilterModelChange,\n pagination,\n displaySelection: bannerAtTop || bannerBelowToolbar,\n displayPagination: ['top', 'both'].includes(paginationPlacement!) || pagerBelowToolbar,\n displayRowsPerPage: pagerBelowToolbar,\n selectionStatus,\n apiRef,\n isRowSelectable,\n paginationModel,\n onPaginationModelChange,\n pageSizeOptions,\n paginationProps,\n paginationMode,\n rowCount,\n ...slotProps?.toolbar,\n },\n // Per-render data for the stable `BottomPagination` slot. Consumer slot props are\n // spread first; the DS layout data wins. Cast at the MUI boundary because these are\n // ToolbarWrapper props, not the MUI slot prop types.\n pagination: {\n ...slotProps?.pagination,\n pagination,\n paginationMode,\n displaySelection: bannerAtBottom,\n displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement!),\n displayPagination: ['bottom', 'both'].includes(paginationPlacement!),\n selectionStatus,\n paginationModel,\n onPaginationModelChange,\n apiRef,\n isRowSelectable,\n pageSizeOptions,\n paginationProps,\n rowCount,\n } as unknown as NonNullable<DataGridProps['slotProps']>['pagination'],\n }}\n filterModel={filterModel}\n columnVisibilityModel={columnVisibilityModel}\n pinnedColumns={pinnedColumns}\n sortModel={sortModel}\n initialState={initialState}\n isRowSelectable={isRowSelectable}\n onFilterModelChange={onFilterModelChange}\n onColumnVisibilityModelChange={onColumnVisibilityModelChange}\n onPinnedColumnsChange={onPinnedColumnsChange}\n onSortModelChange={onSortModelChange}\n pagination={pagination}\n paginationMode={paginationMode}\n keepNonExistentRowsSelected={paginationMode == 'server'}\n rows={rows}\n pageSizeOptions={pageSizeOptions}\n paginationModel={paginationModel}\n onPaginationModelChange={onPaginationModelChange}\n rowSelectionModel={rowSelectionModel}\n onRowSelectionModelChange={(newSelectionModel, details) => {\n let effectiveSelectionModel = newSelectionModel;\n\n // Fix server-side header checkbox: when MUI deselects all due to indeterminate\n // state (cross-page selections exist, 0 on current page), convert to \"select page\".\n if (pagination && paginationMode === 'server') {\n effectiveSelectionModel = fixServerSideHeaderCheckboxSelection(\n newSelectionModel,\n Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel],\n selectionStatusRef,\n apiRef,\n isRowSelectable\n );\n }\n\n if (pagination && paginationMode != 'server') {\n const selectableRowsInPage = isRowSelectable\n ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef)\n .filter(({ model }) => isRowSelectable({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);\n const numberOfSelectableRowsInPage = selectableRowsInPage.length;\n\n const selectableRowsInTable = isRowSelectable\n ? gridFilteredSortedRowEntriesSelector(apiRef)\n .filter(({ model }) => isRowSelectable({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : gridFilteredSortedRowIdsSelector(apiRef);\n const numberOfSelectableRowsInTable = selectableRowsInTable.length;\n\n const numberOfSelectedRows = newSelectionModel.length;\n\n if (\n (selectionStatusRef.current.type === 'table' &&\n numberOfSelectedRows === numberOfSelectableRowsInTable - numberOfSelectableRowsInPage) ||\n (selectionStatusRef.current.type === 'table' &&\n numberOfSelectedRows === numberOfSelectableRowsInTable) ||\n (selectionStatusRef.current.type === 'page' && numberOfSelectedRows === numberOfSelectableRowsInPage)\n ) {\n setTimeout(() => {\n apiRef.current.selectRows([], true, true);\n }, 0);\n }\n\n if (\n numberOfSelectedRows === numberOfSelectableRowsInPage &&\n numberOfSelectableRowsInPage < numberOfSelectableRowsInTable\n ) {\n selectionStatusRef.current = {\n type: 'page',\n numberOfSelectedRows,\n };\n } else if (\n numberOfSelectedRows === numberOfSelectableRowsInTable &&\n numberOfSelectableRowsInPage < numberOfSelectableRowsInTable\n ) {\n selectionStatusRef.current = {\n type: 'table',\n numberOfSelectedRows,\n };\n } else if (numberOfSelectedRows > 0) {\n selectionStatusRef.current = {\n type: 'other',\n numberOfSelectedRows,\n };\n } else {\n selectionStatusRef.current = {\n type: 'none',\n numberOfSelectedRows,\n };\n }\n }\n onRowSelectionModelChange?.(effectiveSelectionModel, details);\n }}\n sx={{\n ...sx,\n '.MuiDataGrid-columnHeaders': {\n flexDirection: 'column',\n alignItems: 'normal',\n },\n '.MuiDataGrid-selectedRowCount': {\n margin: 'none',\n },\n }}\n />\n </StyledDataGrid>\n </MuiThemeProvider>\n </ThemeProvider>\n );\n});\nDataGrid.className = CLASSNAME;\nDataGrid.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","DataGrid","forwardRef","props","ref","datagridRef","useRef","apiRef","propsApiRef","autoHeight","className","slots","slotProps","filterModel","propsFilterModel","columnVisibilityModel","propsColumnVisibilityModel","pinnedColumns","propsPinnedColumns","sortModel","propsSortModel","paginationModel","propsPaginationModel","height","propsHeight","hideToolbar","initialState","isRowSelectable","license","process","env","MUI_LICENSE_KEY","onFilterModelChange","propsOnFilterModelChange","rowSelectionModel","propsRowSelectionModel","onPaginationModelChange","propsOnPaginationModelChange","onRowSelectionModelChange","propsOnRowSelectionModelChange","onColumnVisibilityModelChange","propsOnColumnVisibilityModelChange","onPinnedColumnsChange","propsOnPinnedColumnsChange","onSortModelChange","propsOnSortModelChange","pagination","paginationPlacement","selectionBannerPlacement","paginationProps","rows","pageSizeOptions","sx","theme","propsTheme","paginationMode","rowCount","forwardedProps","_objectWithoutProperties","_excluded","useTheme","_apiRef","useGridApiRef","RenderedToolbar","toolbar","DefaultToolbar","LicenseInfo","setLicenseKey","undefined","useControlledDatagridState","setRowSelectionModel","useState","useEffect","selectionModel","details","selectionStatusRef","type","numberOfSelectedRows","numberOfSelectedRowsInPage","page","pageSize","checkboxSelectionVisibleOnly","Boolean","bannerAtTop","bannerAtBottom","bannerBelowToolbar","pagerBelowToolbar","onServerSideSelectionStatusChange","Array","isArray","selectionStatus","current","length","selectableRowsInPage","gridPaginatedVisibleSortedGridRowEntriesSelector","filter","_ref","model","row","map","_ref2","id","gridPaginatedVisibleSortedGridRowIdsSelector","numberOfSelectableRowsInPage","selectableRowsInTable","gridFilteredSortedRowEntriesSelector","_ref3","_ref4","gridFilteredSortedRowIdsSelector","numberOfSelectableRowsInTable","selectedOnCurrentPage","includes","muiTheme","useMemo","createTheme","palette","mode","primary","main","RedsiftColorBlueN","background","default","RedsiftColorNeutralXDarkGrey","RedsiftColorNeutralWhite","paper","React","createElement","ThemeProvider","value","MuiThemeProvider","StyledDataGrid","classNames","$height","DataGridPro","_extends","_objectSpread","baseGridSlots","ToolbarWrapper","BottomPagination","displaySelection","displayPagination","displayRowsPerPage","keepNonExistentRowsSelected","newSelectionModel","effectiveSelectionModel","fixServerSideHeaderCheckboxSelection","_ref5","_ref6","_ref7","_ref8","setTimeout","selectRows","flexDirection","alignItems","margin","displayName"],"mappings":";;;;;;;;;;;;AAgCA,MAAMA,cAAc,GAAG,UAAU,CAAA;AACjC,MAAMC,SAAS,GAAG,kBAAkB,CAAA;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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