@redsift/table 12.5.7 → 12.5.8-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/DataGrid2.js +70 -113
- 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/ServerSideControlledPagination.js +11710 -70
- package/_internal/ServerSideControlledPagination.js.map +1 -1
- package/_internal/StatefulDataGrid.js +1 -1
- package/_internal/StatefulDataGrid2.js +1681 -905
- package/_internal/StatefulDataGrid2.js.map +1 -1
- package/_internal/Toolbar2.js +1 -1
- package/_internal/Toolbar2.js.map +1 -1
- 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 +1129 -11
- package/_internal/useControlledDatagridState.js.map +1 -1
- package/index.d.ts +211 -504
- package/index.js +143 -177
- 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/DataGrid2.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
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 { LicenseInfo } from '@mui/x-license';
|
|
6
4
|
import { useTheme, RedsiftColorBlueN, RedsiftColorNeutralXDarkGrey, RedsiftColorNeutralWhite, ThemeProvider } from '@redsift/design-system';
|
|
7
|
-
import { useGridApiRef, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector,
|
|
8
|
-
import { u as useControlledDatagridState, S as StyledDataGrid, B as
|
|
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';
|
|
5
|
+
import { useGridApiRef, 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 BelowToolbar, a 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 './ServerSideControlledPagination.js';
|
|
9
|
+
import { b as createTheme } from './Portal.js';
|
|
11
10
|
|
|
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"
|
|
11
|
+
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
12
|
const COMPONENT_NAME = 'DataGrid';
|
|
14
13
|
const CLASSNAME = 'redsift-datagrid';
|
|
15
14
|
|
|
@@ -86,7 +85,6 @@ const CLASSNAME = 'redsift-datagrid';
|
|
|
86
85
|
*/
|
|
87
86
|
|
|
88
87
|
const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
89
|
-
var _ref6, _ref7;
|
|
90
88
|
const datagridRef = ref || useRef();
|
|
91
89
|
const {
|
|
92
90
|
apiRef: propsApiRef,
|
|
@@ -116,17 +114,17 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
116
114
|
selectionBannerPlacement = 'top',
|
|
117
115
|
paginationProps,
|
|
118
116
|
rows,
|
|
119
|
-
pageSizeOptions
|
|
117
|
+
pageSizeOptions,
|
|
120
118
|
sx,
|
|
121
119
|
theme: propsTheme,
|
|
122
120
|
paginationMode = 'client',
|
|
123
|
-
rowCount
|
|
124
|
-
density
|
|
121
|
+
rowCount
|
|
125
122
|
} = props,
|
|
126
123
|
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
127
124
|
const theme = useTheme(propsTheme);
|
|
128
125
|
const _apiRef = useGridApiRef();
|
|
129
126
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
127
|
+
const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar;
|
|
130
128
|
LicenseInfo.setLicenseKey(license);
|
|
131
129
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
132
130
|
const {
|
|
@@ -154,9 +152,9 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
154
152
|
propsSortModel,
|
|
155
153
|
propsOnPaginationModelChange
|
|
156
154
|
});
|
|
157
|
-
const [rowSelectionModel, setRowSelectionModel] = useState(
|
|
155
|
+
const [rowSelectionModel, setRowSelectionModel] = useState(propsRowSelectionModel !== null && propsRowSelectionModel !== void 0 ? propsRowSelectionModel : []);
|
|
158
156
|
useEffect(() => {
|
|
159
|
-
setRowSelectionModel(
|
|
157
|
+
setRowSelectionModel(propsRowSelectionModel !== null && propsRowSelectionModel !== void 0 ? propsRowSelectionModel : []);
|
|
160
158
|
}, [propsRowSelectionModel]);
|
|
161
159
|
const onRowSelectionModelChange = (selectionModel, details) => {
|
|
162
160
|
setRowSelectionModel(selectionModel);
|
|
@@ -175,33 +173,22 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
175
173
|
// Version counter to force re-renders when selectionStatus ref changes
|
|
176
174
|
const [, forceSelectionUpdate] = useState(0);
|
|
177
175
|
|
|
178
|
-
// Track when the grid API is ready to ensure top pagination renders correctly
|
|
179
|
-
const [gridReady, setGridReady] = useState(false);
|
|
180
|
-
|
|
181
176
|
// The checkboxSelectionVisibleOnly should only be applied to client-side pagination,
|
|
182
177
|
// for server-side pagination it produces inconsistent behavior when selecting all rows in pages 2 and beyond
|
|
183
178
|
const checkboxSelectionVisibleOnly = Boolean(pagination) && Boolean(paginationMode != 'server');
|
|
184
179
|
|
|
185
180
|
// Banner and pager placements are independent. `belowToolbar` (for either) renders
|
|
186
|
-
// in
|
|
181
|
+
// in the toolbar-slot row, and only applies when pagination is on.
|
|
187
182
|
const bannerAtTop = selectionBannerPlacement === 'top';
|
|
188
183
|
const bannerAtBottom = selectionBannerPlacement === 'bottom';
|
|
189
184
|
const bannerBelowToolbar = selectionBannerPlacement === 'belowToolbar' && Boolean(pagination);
|
|
190
185
|
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
186
|
|
|
200
187
|
// in server-side pagination we want to update the selection status
|
|
201
188
|
// every time we navigate between pages, resize our page or select something
|
|
202
189
|
useEffect(() => {
|
|
203
190
|
if (paginationMode == 'server') {
|
|
204
|
-
onServerSideSelectionStatusChange(rowSelectionModel, apiRef, selectionStatusRef, forceSelectionUpdate, isRowSelectable, paginationModel.page, paginationModel.pageSize);
|
|
191
|
+
onServerSideSelectionStatusChange(Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel], apiRef, selectionStatusRef, forceSelectionUpdate, isRowSelectable, paginationModel.page, paginationModel.pageSize);
|
|
205
192
|
}
|
|
206
193
|
}, [rowSelectionModel, paginationModel.page, paginationModel.pageSize, rows]);
|
|
207
194
|
if (!Array.isArray(rows)) {
|
|
@@ -213,15 +200,15 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
213
200
|
// receive the fresh value in the same render cycle — no extra re-render needed.
|
|
214
201
|
// The ref is kept in sync for the onRowSelectionModelChange callback's deselect logic.
|
|
215
202
|
let selectionStatus = selectionStatusRef.current;
|
|
216
|
-
if (pagination && paginationMode !== 'server' &&
|
|
203
|
+
if (pagination && paginationMode !== 'server' && Array.isArray(rowSelectionModel) && rowSelectionModel.length > 0) {
|
|
217
204
|
try {
|
|
218
|
-
// Use manual page slicing instead of
|
|
219
|
-
//
|
|
220
|
-
//
|
|
221
|
-
|
|
205
|
+
// Use manual page slicing with our React state's paginationModel instead of
|
|
206
|
+
// gridPaginatedVisibleSortedGridRow*Selector(apiRef). In MUI v7, the apiRef's
|
|
207
|
+
// internal pagination state can lag behind the React state after a page change,
|
|
208
|
+
// causing the selection status to be one page behind.
|
|
222
209
|
const pageStart = paginationModel.page * paginationModel.pageSize;
|
|
223
|
-
const
|
|
224
|
-
const selectableRowsInPage = isRowSelectable ?
|
|
210
|
+
const pageEnd = pageStart + paginationModel.pageSize;
|
|
211
|
+
const selectableRowsInPage = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).slice(pageStart, pageEnd).filter(_ref => {
|
|
225
212
|
let {
|
|
226
213
|
model
|
|
227
214
|
} = _ref;
|
|
@@ -233,29 +220,24 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
233
220
|
id
|
|
234
221
|
} = _ref2;
|
|
235
222
|
return id;
|
|
236
|
-
}) :
|
|
237
|
-
let {
|
|
238
|
-
id
|
|
239
|
-
} = _ref3;
|
|
240
|
-
return id;
|
|
241
|
-
});
|
|
223
|
+
}) : gridFilteredSortedRowIdsSelector(apiRef).slice(pageStart, pageEnd);
|
|
242
224
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
243
|
-
const selectableRowsInTable = isRowSelectable ?
|
|
225
|
+
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref3 => {
|
|
244
226
|
let {
|
|
245
227
|
model
|
|
246
|
-
} =
|
|
228
|
+
} = _ref3;
|
|
247
229
|
return isRowSelectable({
|
|
248
230
|
row: model
|
|
249
231
|
});
|
|
250
|
-
}).map(
|
|
232
|
+
}).map(_ref4 => {
|
|
251
233
|
let {
|
|
252
234
|
id
|
|
253
|
-
} =
|
|
235
|
+
} = _ref4;
|
|
254
236
|
return id;
|
|
255
237
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
256
238
|
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
257
|
-
const numberOfSelectedRows =
|
|
258
|
-
const selectedOnCurrentPage = selectableRowsInPage.filter(id =>
|
|
239
|
+
const numberOfSelectedRows = rowSelectionModel.length;
|
|
240
|
+
const selectedOnCurrentPage = selectableRowsInPage.filter(id => rowSelectionModel.includes(id));
|
|
259
241
|
if (numberOfSelectedRows === numberOfSelectableRowsInTable && numberOfSelectableRowsInPage < numberOfSelectableRowsInTable) {
|
|
260
242
|
selectionStatus = {
|
|
261
243
|
type: 'table',
|
|
@@ -300,32 +282,33 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
300
282
|
}
|
|
301
283
|
}), [theme]);
|
|
302
284
|
|
|
303
|
-
// Per-render data for the
|
|
304
|
-
// via `slotProps.toolbar`
|
|
305
|
-
// toolbar is re-rendered, not remounted. Typed as
|
|
306
|
-
// caught here; cast to MUI's slot type only at the
|
|
307
|
-
|
|
308
|
-
|
|
285
|
+
// Per-render data for the stable `BelowToolbar` slot (which wraps the resolved toolbar and,
|
|
286
|
+
// depending on placement, the banner/pager), injected via `slotProps.toolbar` so the slot
|
|
287
|
+
// identity stays constant and the toolbar is re-rendered, not remounted. Typed as
|
|
288
|
+
// ToolbarWrapper props so mistakes are caught here; cast to MUI's slot type only at the
|
|
289
|
+
// injection site below.
|
|
290
|
+
const toolbarSlotProps = {
|
|
309
291
|
hideToolbar,
|
|
292
|
+
RenderedToolbar,
|
|
310
293
|
filterModel,
|
|
311
294
|
onFilterModelChange,
|
|
312
295
|
pagination,
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
displayPagination: pagerBelowToolbar,
|
|
296
|
+
displaySelection: bannerAtTop || bannerBelowToolbar,
|
|
297
|
+
displayPagination: ['top', 'both'].includes(paginationPlacement) || pagerBelowToolbar,
|
|
316
298
|
displayRowsPerPage: pagerBelowToolbar,
|
|
317
299
|
selectionStatus,
|
|
318
300
|
apiRef,
|
|
319
301
|
isRowSelectable,
|
|
320
302
|
paginationModel,
|
|
321
303
|
onPaginationModelChange,
|
|
322
|
-
pageSizeOptions
|
|
304
|
+
pageSizeOptions,
|
|
323
305
|
paginationProps,
|
|
306
|
+
paginationMode,
|
|
324
307
|
rowCount
|
|
325
308
|
};
|
|
326
309
|
|
|
327
|
-
// Per-render data for the bottom
|
|
328
|
-
//
|
|
310
|
+
// Per-render data for the stable bottom `BottomPagination` slot, handed over via
|
|
311
|
+
// `slotProps.pagination` for the same reason as the toolbar above.
|
|
329
312
|
const bottomPaginationSlotProps = {
|
|
330
313
|
pagination,
|
|
331
314
|
paginationMode,
|
|
@@ -337,7 +320,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
337
320
|
onPaginationModelChange,
|
|
338
321
|
apiRef,
|
|
339
322
|
isRowSelectable,
|
|
340
|
-
pageSizeOptions
|
|
323
|
+
pageSizeOptions,
|
|
341
324
|
paginationProps,
|
|
342
325
|
rowCount
|
|
343
326
|
};
|
|
@@ -351,51 +334,34 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
351
334
|
ref: datagridRef,
|
|
352
335
|
className: classNames(DataGrid.className, className),
|
|
353
336
|
$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, {
|
|
337
|
+
}, /*#__PURE__*/React__default.createElement(DataGridPro, _extends({}, forwardedProps, {
|
|
376
338
|
rowCount: rowCount,
|
|
377
339
|
apiRef: apiRef,
|
|
378
340
|
autoHeight: autoHeight,
|
|
379
341
|
checkboxSelectionVisibleOnly: checkboxSelectionVisibleOnly,
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
toolbar
|
|
384
|
-
|
|
342
|
+
slots: _objectSpread2(_objectSpread2(_objectSpread2({}, baseGridSlots), slots), {}, {
|
|
343
|
+
// `BelowToolbar` and `BottomPagination` are stable module-level components; their
|
|
344
|
+
// per-render data is injected via `slotProps` below. A fresh inline function here
|
|
345
|
+
// would remount the slot's subtree every render — for the toolbar that dropped
|
|
346
|
+
// quick-search focus on every keystroke. The consumer's `slots.toolbar` (or the
|
|
347
|
+
// default DS Toolbar) is preserved via `RenderedToolbar` inside ToolbarWrapper.
|
|
348
|
+
toolbar: BelowToolbar,
|
|
385
349
|
pagination: BottomPagination
|
|
386
350
|
}),
|
|
387
|
-
slotProps: _objectSpread2(_objectSpread2(
|
|
388
|
-
|
|
389
|
-
|
|
351
|
+
slotProps: _objectSpread2(_objectSpread2({}, slotProps), {}, {
|
|
352
|
+
// Inject the per-render slot data (built above) here rather than closing over it
|
|
353
|
+
// in inline slots, so the `toolbar`/`pagination` slot identities stay stable.
|
|
354
|
+
// Consumer slot props are spread first; the DS layout data wins (and, for the
|
|
355
|
+
// toolbar, is forwarded on to `RenderedToolbar` by ToolbarWrapper). Cast at the
|
|
356
|
+
// MUI boundary because these are ToolbarWrapper props, not the MUI slot prop types.
|
|
357
|
+
toolbar: _objectSpread2(_objectSpread2({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar), toolbarSlotProps),
|
|
390
358
|
pagination: _objectSpread2(_objectSpread2({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.pagination), bottomPaginationSlotProps)
|
|
391
359
|
}),
|
|
392
360
|
filterModel: filterModel,
|
|
393
361
|
columnVisibilityModel: columnVisibilityModel,
|
|
394
362
|
pinnedColumns: pinnedColumns,
|
|
395
363
|
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
|
-
}),
|
|
364
|
+
initialState: initialState,
|
|
399
365
|
isRowSelectable: isRowSelectable,
|
|
400
366
|
onFilterModelChange: onFilterModelChange,
|
|
401
367
|
onColumnVisibilityModelChange: onColumnVisibilityModelChange,
|
|
@@ -415,52 +381,43 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
415
381
|
// Fix server-side header checkbox: when MUI deselects all due to indeterminate
|
|
416
382
|
// state (cross-page selections exist, 0 on current page), convert to "select page".
|
|
417
383
|
if (pagination && paginationMode === 'server') {
|
|
418
|
-
effectiveSelectionModel = fixServerSideHeaderCheckboxSelection(newSelectionModel, rowSelectionModel, selectionStatusRef, apiRef, isRowSelectable);
|
|
384
|
+
effectiveSelectionModel = fixServerSideHeaderCheckboxSelection(newSelectionModel, Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel], selectionStatusRef, apiRef, isRowSelectable);
|
|
419
385
|
}
|
|
420
386
|
if (pagination && paginationMode != 'server') {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
const
|
|
424
|
-
const pageStart = paginationModel.page * paginationModel.pageSize;
|
|
425
|
-
const pageEntries = allFilteredEntries.slice(pageStart, pageStart + paginationModel.pageSize);
|
|
426
|
-
const selectableRowsInPage = isRowSelectable ? pageEntries.filter(_ref8 => {
|
|
387
|
+
const cbPageStart = paginationModel.page * paginationModel.pageSize;
|
|
388
|
+
const cbPageEnd = cbPageStart + paginationModel.pageSize;
|
|
389
|
+
const selectableRowsInPage = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).slice(cbPageStart, cbPageEnd).filter(_ref5 => {
|
|
427
390
|
let {
|
|
428
391
|
model
|
|
429
|
-
} =
|
|
392
|
+
} = _ref5;
|
|
430
393
|
return isRowSelectable({
|
|
431
394
|
row: model
|
|
432
395
|
});
|
|
433
|
-
}).map(
|
|
434
|
-
let {
|
|
435
|
-
id
|
|
436
|
-
} = _ref9;
|
|
437
|
-
return id;
|
|
438
|
-
}) : pageEntries.map(_ref10 => {
|
|
396
|
+
}).map(_ref6 => {
|
|
439
397
|
let {
|
|
440
398
|
id
|
|
441
|
-
} =
|
|
399
|
+
} = _ref6;
|
|
442
400
|
return id;
|
|
443
|
-
});
|
|
401
|
+
}) : gridFilteredSortedRowIdsSelector(apiRef).slice(cbPageStart, cbPageEnd);
|
|
444
402
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
445
|
-
const selectableRowsInTable = isRowSelectable ?
|
|
403
|
+
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref7 => {
|
|
446
404
|
let {
|
|
447
405
|
model
|
|
448
|
-
} =
|
|
406
|
+
} = _ref7;
|
|
449
407
|
return isRowSelectable({
|
|
450
408
|
row: model
|
|
451
409
|
});
|
|
452
|
-
}).map(
|
|
410
|
+
}).map(_ref8 => {
|
|
453
411
|
let {
|
|
454
412
|
id
|
|
455
|
-
} =
|
|
413
|
+
} = _ref8;
|
|
456
414
|
return id;
|
|
457
415
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
458
416
|
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
459
|
-
const numberOfSelectedRows =
|
|
417
|
+
const numberOfSelectedRows = newSelectionModel.length;
|
|
460
418
|
if (selectionStatusRef.current.type === 'table' && numberOfSelectedRows === numberOfSelectableRowsInTable - numberOfSelectableRowsInPage || selectionStatusRef.current.type === 'table' && numberOfSelectedRows === numberOfSelectableRowsInTable || selectionStatusRef.current.type === 'page' && numberOfSelectedRows === numberOfSelectableRowsInPage) {
|
|
461
419
|
setTimeout(() => {
|
|
462
|
-
|
|
463
|
-
(_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.selectRows([], true, true);
|
|
420
|
+
apiRef.current.selectRows([], true, true);
|
|
464
421
|
}, 0);
|
|
465
422
|
}
|
|
466
423
|
if (numberOfSelectedRows === numberOfSelectableRowsInPage && numberOfSelectableRowsInPage < numberOfSelectableRowsInTable) {
|
|
@@ -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,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMC,QAA6C,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAAA,IAAAC,KAAA,EAAAC,KAAA,CAAA;AACtF,EAAA,MAAMC,WAAW,GAAGH,GAAG,IAAII,MAAM,EAAkB,CAAA;EAEnD,MAAM;AACJC,MAAAA,MAAM,EAAEC,WAAW;MACnBC,UAAU;MACVC,SAAS;MACTC,KAAK;MACLC,SAAS;AACTC,MAAAA,WAAW,EAAEC,gBAAgB;AAC7BC,MAAAA,qBAAqB,EAAEC,0BAA0B;AACjDC,MAAAA,aAAa,EAAEC,kBAAkB;AACjCC,MAAAA,SAAS,EAAEC,cAAc;AACzBC,MAAAA,eAAe,EAAEC,oBAAoB;AACrCC,M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AACbC,YAAAA,oBAAAA;WACD,CAAA;AACH,SAAC,MAAM;UACLF,kBAAkB,CAACgB,OAAO,GAAG;AAC3Bf,YAAAA,IAAI,EAAE,MAAM;AACZC,YAAAA,oBAAAA;WACD,CAAA;AACH,SAAA;AACAI,QAAAA,oBAAoB,CAAE2F,CAAC,IAAKA,CAAC,GAAG,CAAC,CAAC,CAAA;AACpC,OAAA;MACArI,yBAAyB,KAAA,IAAA,IAAzBA,yBAAyB,KAAzBA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,yBAAyB,CAAG2H,uBAAuB,EAAExF,OAAO,CAAC,CAAA;KAC7D;AACFrB,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';\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 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 { ToolbarWrapperProps } from '../ToolbarWrapper';\nimport { baseGridSlots, BelowToolbar, 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 // Version counter to force re-renders when selectionStatus ref changes\n const [, forceSelectionUpdate] = useState(0);\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 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' && Array.isArray(rowSelectionModel) && rowSelectionModel.length > 0) {\n try {\n // Use manual page slicing with our React state's paginationModel instead of\n // gridPaginatedVisibleSortedGridRow*Selector(apiRef). In MUI v7, the apiRef's\n // internal pagination state can lag behind the React state after a page change,\n // causing the selection status to be one page behind.\n const pageStart = paginationModel.page * paginationModel.pageSize;\n const pageEnd = pageStart + paginationModel.pageSize;\n\n const selectableRowsInPage = isRowSelectable\n ? gridFilteredSortedRowEntriesSelector(apiRef)\n .slice(pageStart, pageEnd)\n .filter(({ model }) => isRowSelectable({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : gridFilteredSortedRowIdsSelector(apiRef).slice(pageStart, pageEnd);\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 // Per-render data for the stable `BelowToolbar` slot (which wraps the resolved toolbar and,\n // depending on placement, the banner/pager), injected via `slotProps.toolbar` so the slot\n // identity stays constant and the toolbar is re-rendered, not remounted. Typed as\n // ToolbarWrapper props so mistakes are caught here; cast to MUI's slot type only at the\n // injection site below.\n const toolbarSlotProps: Partial<ToolbarWrapperProps> = {\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 };\n\n // Per-render data for the stable bottom `BottomPagination` slot, handed over via\n // `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,\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 <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 // `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. The consumer's `slots.toolbar` (or the\n // default DS Toolbar) is preserved via `RenderedToolbar` inside ToolbarWrapper.\n 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 toolbar: { ...slotProps?.toolbar, ...toolbarSlotProps } as unknown as NonNullable<\n DataGridProps['slotProps']\n >['toolbar'],\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}\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 cbPageStart = paginationModel.page * paginationModel.pageSize;\n const cbPageEnd = cbPageStart + paginationModel.pageSize;\n\n const selectableRowsInPage = isRowSelectable\n ? gridFilteredSortedRowEntriesSelector(apiRef)\n .slice(cbPageStart, cbPageEnd)\n .filter(({ model }) => isRowSelectable({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : gridFilteredSortedRowIdsSelector(apiRef).slice(cbPageStart, cbPageEnd);\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 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","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","forceSelectionUpdate","checkboxSelectionVisibleOnly","Boolean","bannerAtTop","bannerAtBottom","bannerBelowToolbar","pagerBelowToolbar","onServerSideSelectionStatusChange","Array","isArray","selectionStatus","current","length","pageStart","pageEnd","selectableRowsInPage","gridFilteredSortedRowEntriesSelector","slice","filter","_ref","model","row","map","_ref2","id","gridFilteredSortedRowIdsSelector","numberOfSelectableRowsInPage","selectableRowsInTable","_ref3","_ref4","numberOfSelectableRowsInTable","selectedOnCurrentPage","includes","muiTheme","useMemo","createTheme","palette","mode","primary","main","RedsiftColorBlueN","background","default","RedsiftColorNeutralXDarkGrey","RedsiftColorNeutralWhite","paper","toolbarSlotProps","displaySelection","displayPagination","displayRowsPerPage","bottomPaginationSlotProps","React","createElement","ThemeProvider","value","MuiThemeProvider","StyledDataGrid","classNames","$height","DataGridPro","_extends","_objectSpread","baseGridSlots","BelowToolbar","BottomPagination","keepNonExistentRowsSelected","newSelectionModel","effectiveSelectionModel","fixServerSideHeaderCheckboxSelection","cbPageStart","cbPageEnd","_ref5","_ref6","_ref7","_ref8","setTimeout","selectRows","v","flexDirection","alignItems","margin","displayName"],"mappings":";;;;;;;;;;;AA8BA,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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