@redsift/table 9.2.1 → 9.2.2-muiv5
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/index.d.ts +5 -3
- package/index.js +116 -98
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as _mui_x_data_grid_pro from '@mui/x-data-grid-pro';
|
|
2
2
|
import { GridFilterItem, GridCellParams, GridFilterOperator, GridFilterInputMultipleValue, DataGridProProps, GridToolbarExportProps, GridToolbarFilterButtonProps, GridFilterModel, GridToolbarColumnsButton, GridToolbarDensitySelector } from '@mui/x-data-grid-pro';
|
|
3
|
-
export
|
|
4
|
-
export { GridAlignment, GridColDef, GridFilterItem, GridFilterModel, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
3
|
+
export { GridAlignment, GridColDef, GridColumns, GridFilterItem, GridFilterModel, GridSelectionModel, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
5
4
|
import { Comp, IconProps, NotificationsColorPalette, ProductColorPalette, ShieldVariant } from '@redsift/design-system';
|
|
6
5
|
import React, { ReactNode, RefObject, ComponentProps } from 'react';
|
|
6
|
+
import { TablePaginationProps } from '@mui/material';
|
|
7
7
|
|
|
8
8
|
declare const DETAIL_PANEL_TOGGLE_COL_DEF: _mui_x_data_grid_pro.GridColDef<any, any, any>;
|
|
9
9
|
|
|
10
10
|
declare const IS_BETWEEN: {
|
|
11
11
|
label: string;
|
|
12
12
|
value: string;
|
|
13
|
-
getApplyFilterFn: (filterItem: GridFilterItem) => ((params: GridCellParams
|
|
13
|
+
getApplyFilterFn: (filterItem: GridFilterItem) => ((params: GridCellParams) => boolean) | null;
|
|
14
14
|
InputComponent: (props: any) => JSX.Element;
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -66,6 +66,8 @@ interface DataGridProps extends Partial<Pick<DataGridProProps, 'rows'>>, Omit<Da
|
|
|
66
66
|
hideToolbar?: boolean;
|
|
67
67
|
/** Indicates how to display pagination. */
|
|
68
68
|
paginationPlacement?: 'top' | 'bottom' | 'both' | 'none';
|
|
69
|
+
/** Props to forward to the pagination component. */
|
|
70
|
+
paginationProps?: Omit<TablePaginationProps, 'component' | 'count' | 'page' | 'onPageChange' | 'rowsPerPage' | 'onRowsPerPageChange' | 'rowsPerPageOptions'>;
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
type StyledDataGridProps = {
|
package/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport,
|
|
2
|
-
export * from '@mui/x-data-grid-pro';
|
|
1
|
+
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridVisibleSortedRowIdsSelector, useGridApiRef, DataGridPro, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector } from '@mui/x-data-grid-pro';
|
|
3
2
|
export { getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import React__default, { Children, isValidElement, cloneElement, useLayoutEffect, useEffect, useRef, forwardRef, useState, useCallback, createElement } from 'react';
|
|
@@ -17467,7 +17466,7 @@ const isBetweenOperator = {
|
|
|
17467
17466
|
label: 'is between',
|
|
17468
17467
|
value: 'isBetween',
|
|
17469
17468
|
getApplyFilterFn: filterItem => {
|
|
17470
|
-
if (!filterItem.
|
|
17469
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17471
17470
|
return null;
|
|
17472
17471
|
}
|
|
17473
17472
|
if (!Array.isArray(filterItem.value) || filterItem.value.length !== 2) {
|
|
@@ -17480,7 +17479,7 @@ const isBetweenOperator = {
|
|
|
17480
17479
|
return null;
|
|
17481
17480
|
}
|
|
17482
17481
|
return params => {
|
|
17483
|
-
return params.value !== null &&
|
|
17482
|
+
return params.value !== null && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
|
|
17484
17483
|
};
|
|
17485
17484
|
},
|
|
17486
17485
|
InputComponent: InputNumberInterval
|
|
@@ -17493,7 +17492,7 @@ const containsAnyOfOperator = {
|
|
|
17493
17492
|
label: 'contains any of',
|
|
17494
17493
|
value: 'containsAnyOf',
|
|
17495
17494
|
getApplyFilterFn: filterItem => {
|
|
17496
|
-
if (!filterItem.
|
|
17495
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17497
17496
|
return null;
|
|
17498
17497
|
}
|
|
17499
17498
|
return params => {
|
|
@@ -17518,7 +17517,7 @@ const endsWithAnyOfOperator = {
|
|
|
17518
17517
|
label: 'ends with any of',
|
|
17519
17518
|
value: 'endsWithAnyOf',
|
|
17520
17519
|
getApplyFilterFn: filterItem => {
|
|
17521
|
-
if (!filterItem.
|
|
17520
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17522
17521
|
return null;
|
|
17523
17522
|
}
|
|
17524
17523
|
return params => {
|
|
@@ -17545,7 +17544,7 @@ const isAnyOfOperator = {
|
|
|
17545
17544
|
label: 'is any of',
|
|
17546
17545
|
value: 'isAnyOf',
|
|
17547
17546
|
getApplyFilterFn: filterItem => {
|
|
17548
|
-
if (!filterItem.
|
|
17547
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17549
17548
|
return null;
|
|
17550
17549
|
}
|
|
17551
17550
|
return params => {
|
|
@@ -17569,7 +17568,7 @@ const isNotAnyOfOperator = {
|
|
|
17569
17568
|
label: 'is not any of',
|
|
17570
17569
|
value: 'isNotAnyOf',
|
|
17571
17570
|
getApplyFilterFn: filterItem => {
|
|
17572
|
-
if (!filterItem.
|
|
17571
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17573
17572
|
return null;
|
|
17574
17573
|
}
|
|
17575
17574
|
return params => {
|
|
@@ -17593,7 +17592,7 @@ const startsWithAnyOfOperator = {
|
|
|
17593
17592
|
label: 'starts with any of',
|
|
17594
17593
|
value: 'startsWithAnyOf',
|
|
17595
17594
|
getApplyFilterFn: filterItem => {
|
|
17596
|
-
if (!filterItem.
|
|
17595
|
+
if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
|
|
17597
17596
|
return null;
|
|
17598
17597
|
}
|
|
17599
17598
|
return params => {
|
|
@@ -21710,7 +21709,7 @@ const Toolbar$2 = props => {
|
|
|
21710
21709
|
let {
|
|
21711
21710
|
apiRef
|
|
21712
21711
|
} = _ref;
|
|
21713
|
-
return
|
|
21712
|
+
return gridVisibleSortedRowIdsSelector(apiRef);
|
|
21714
21713
|
}
|
|
21715
21714
|
},
|
|
21716
21715
|
printOptions: {
|
|
@@ -21727,7 +21726,7 @@ const Toolbar$2 = props => {
|
|
|
21727
21726
|
}) : null)));
|
|
21728
21727
|
};
|
|
21729
21728
|
|
|
21730
|
-
const _excluded$d = ["displayName"
|
|
21729
|
+
const _excluded$d = ["displayName"];
|
|
21731
21730
|
const muiIconToDSIcon = {
|
|
21732
21731
|
ColumnFilteredIcon: mdiFilterVariant,
|
|
21733
21732
|
ColumnSelectorIcon: mdiViewColumn,
|
|
@@ -21743,13 +21742,12 @@ const muiIconToDSIcon = {
|
|
|
21743
21742
|
};
|
|
21744
21743
|
const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
21745
21744
|
const {
|
|
21746
|
-
displayName
|
|
21747
|
-
fontSize = 'small'
|
|
21745
|
+
displayName
|
|
21748
21746
|
} = props,
|
|
21749
21747
|
forwardedProps = _objectWithoutProperties(props, _excluded$d);
|
|
21750
21748
|
return /*#__PURE__*/React__default.createElement(Icon, _extends$2({}, forwardedProps, forwardedProps.inputProps, {
|
|
21751
21749
|
ref: ref,
|
|
21752
|
-
size: fontSize,
|
|
21750
|
+
size: forwardedProps.fontSize,
|
|
21753
21751
|
icon: muiIconToDSIcon[displayName]
|
|
21754
21752
|
}));
|
|
21755
21753
|
});
|
|
@@ -24166,7 +24164,7 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
24166
24164
|
} : void 0;
|
|
24167
24165
|
var TablePagination$1 = TablePagination;
|
|
24168
24166
|
|
|
24169
|
-
const _excluded$1 = ["apiRef", "autoHeight", "className", "
|
|
24167
|
+
const _excluded$1 = ["apiRef", "autoHeight", "className", "components", "componentsProps", "filterModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "onFilterModelChange", "onPageChange", "onPageSizeChange", "onSelectionModelChange", "page", "pageSize", "pagination", "paginationPlacement", "paginationProps", "rows", "rowsPerPageOptions", "sx"];
|
|
24170
24168
|
const COMPONENT_NAME$1 = 'DataGrid';
|
|
24171
24169
|
const CLASSNAME$1 = 'redsift-datagrid';
|
|
24172
24170
|
const DEFAULT_PROPS = {
|
|
@@ -24188,17 +24186,20 @@ const getSelectableRowsInTable = (apiRef, isRowSelectable) => {
|
|
|
24188
24186
|
return id;
|
|
24189
24187
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
24190
24188
|
};
|
|
24191
|
-
const
|
|
24189
|
+
const ControlledPagination = _ref3 => {
|
|
24192
24190
|
let {
|
|
24193
24191
|
displaySelection = false,
|
|
24194
24192
|
displayRowsPerPage = false,
|
|
24195
24193
|
displayPagination = false,
|
|
24196
24194
|
selectionStatus,
|
|
24197
24195
|
apiRef,
|
|
24198
|
-
|
|
24199
|
-
|
|
24200
|
-
|
|
24201
|
-
|
|
24196
|
+
page,
|
|
24197
|
+
onPageChange,
|
|
24198
|
+
pageSize,
|
|
24199
|
+
onPageSizeChange,
|
|
24200
|
+
rowsPerPageOptions,
|
|
24201
|
+
isRowSelectable,
|
|
24202
|
+
paginationProps
|
|
24202
24203
|
} = _ref3;
|
|
24203
24204
|
const filteredRowsInTable = getSelectableRowsInTable(apiRef);
|
|
24204
24205
|
const selectableRowsInTable = getSelectableRowsInTable(apiRef, isRowSelectable);
|
|
@@ -24223,31 +24224,27 @@ const Pagination = _ref3 => {
|
|
|
24223
24224
|
}
|
|
24224
24225
|
}, "Clear selection.")) : selectionStatus.type === 'other' ? /*#__PURE__*/React__default.createElement(Text, {
|
|
24225
24226
|
fontSize: "14px"
|
|
24226
|
-
}, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, {
|
|
24227
|
+
}, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
|
|
24227
24228
|
component: "div",
|
|
24228
24229
|
count: numberOfFilteredRowsInTable,
|
|
24229
|
-
page:
|
|
24230
|
-
onPageChange: (event,
|
|
24231
|
-
|
|
24232
|
-
|
|
24233
|
-
|
|
24234
|
-
|
|
24235
|
-
|
|
24236
|
-
|
|
24237
|
-
pageSize: parseInt(event.target.value, 10)
|
|
24238
|
-
}),
|
|
24239
|
-
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
24240
|
-
}) : null);
|
|
24230
|
+
page: page,
|
|
24231
|
+
onPageChange: (event, newPage) => onPageChange(newPage),
|
|
24232
|
+
rowsPerPage: pageSize,
|
|
24233
|
+
onRowsPerPageChange: event => {
|
|
24234
|
+
onPageSizeChange(parseInt(event.target.value, 10));
|
|
24235
|
+
},
|
|
24236
|
+
rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
|
|
24237
|
+
}, paginationProps)) : null);
|
|
24241
24238
|
};
|
|
24242
24239
|
const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
24243
|
-
var _initialState$paginat, _initialState$paginat2
|
|
24240
|
+
var _initialState$paginat, _initialState$paginat2;
|
|
24244
24241
|
const datagridRef = ref || useRef();
|
|
24245
24242
|
const {
|
|
24246
24243
|
apiRef: propsApiRef,
|
|
24247
24244
|
autoHeight,
|
|
24248
24245
|
className,
|
|
24249
|
-
|
|
24250
|
-
|
|
24246
|
+
components,
|
|
24247
|
+
componentsProps,
|
|
24251
24248
|
filterModel: propsFilterModel,
|
|
24252
24249
|
height: propsHeight,
|
|
24253
24250
|
hideToolbar,
|
|
@@ -24255,19 +24252,22 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24255
24252
|
isRowSelectable,
|
|
24256
24253
|
license,
|
|
24257
24254
|
onFilterModelChange: propsOnFilterModelChange,
|
|
24258
|
-
|
|
24259
|
-
|
|
24260
|
-
|
|
24255
|
+
onPageChange: propsOnPageChange,
|
|
24256
|
+
onPageSizeChange: propsOnPageSizeChange,
|
|
24257
|
+
onSelectionModelChange,
|
|
24258
|
+
page: propsPage,
|
|
24259
|
+
pageSize: propsPageSize,
|
|
24261
24260
|
pagination,
|
|
24262
24261
|
paginationPlacement,
|
|
24262
|
+
paginationProps,
|
|
24263
24263
|
rows,
|
|
24264
|
-
|
|
24264
|
+
rowsPerPageOptions,
|
|
24265
24265
|
sx
|
|
24266
24266
|
} = props,
|
|
24267
24267
|
forwardedProps = _objectWithoutProperties(props, _excluded$1);
|
|
24268
24268
|
const _apiRef = useGridApiRef();
|
|
24269
24269
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
24270
|
-
const RenderedToolbar =
|
|
24270
|
+
const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$2;
|
|
24271
24271
|
LicenseInfo.setLicenseKey(license);
|
|
24272
24272
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
24273
24273
|
const selectionStatus = useRef({
|
|
@@ -24285,22 +24285,33 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24285
24285
|
setFilterModel(model);
|
|
24286
24286
|
}
|
|
24287
24287
|
};
|
|
24288
|
-
const [
|
|
24289
|
-
|
|
24290
|
-
|
|
24291
|
-
|
|
24292
|
-
|
|
24293
|
-
if (propsOnPaginationModelChange) {
|
|
24294
|
-
propsOnPaginationModelChange(model, undefined);
|
|
24288
|
+
const [page, setPage] = React__default.useState((initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat = initialState.pagination) === null || _initialState$paginat === void 0 ? void 0 : _initialState$paginat.page) || propsPage || 0);
|
|
24289
|
+
const [pageSize, setPageSize] = React__default.useState((initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat2 = initialState.pagination) === null || _initialState$paginat2 === void 0 ? void 0 : _initialState$paginat2.pageSize) || propsPageSize || (rowsPerPageOptions === null || rowsPerPageOptions === void 0 ? void 0 : rowsPerPageOptions[0]) || 100);
|
|
24290
|
+
const onPageChange = page => {
|
|
24291
|
+
if (propsOnPageChange) {
|
|
24292
|
+
propsOnPageChange(page, undefined);
|
|
24295
24293
|
} else {
|
|
24296
|
-
|
|
24294
|
+
setPage(page);
|
|
24297
24295
|
}
|
|
24298
24296
|
};
|
|
24299
24297
|
useEffect(() => {
|
|
24300
|
-
if (
|
|
24301
|
-
|
|
24298
|
+
if (propsPage || propsPage === 0) {
|
|
24299
|
+
setPage(propsPage);
|
|
24300
|
+
}
|
|
24301
|
+
}, [propsPage]);
|
|
24302
|
+
const onPageSizeChange = pageSize => {
|
|
24303
|
+
onPageChange(0);
|
|
24304
|
+
if (propsOnPageSizeChange) {
|
|
24305
|
+
propsOnPageSizeChange(pageSize, undefined);
|
|
24306
|
+
} else {
|
|
24307
|
+
setPageSize(pageSize);
|
|
24302
24308
|
}
|
|
24303
|
-
}
|
|
24309
|
+
};
|
|
24310
|
+
useEffect(() => {
|
|
24311
|
+
if (propsPageSize) {
|
|
24312
|
+
setPageSize(propsPageSize);
|
|
24313
|
+
}
|
|
24314
|
+
}, [propsPageSize]);
|
|
24304
24315
|
if (!Array.isArray(rows)) {
|
|
24305
24316
|
return null;
|
|
24306
24317
|
}
|
|
@@ -24312,76 +24323,81 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24312
24323
|
apiRef: apiRef,
|
|
24313
24324
|
autoHeight: autoHeight,
|
|
24314
24325
|
checkboxSelectionVisibleOnly: Boolean(pagination),
|
|
24315
|
-
|
|
24316
|
-
|
|
24317
|
-
|
|
24318
|
-
//
|
|
24319
|
-
|
|
24320
|
-
|
|
24326
|
+
components: _objectSpread2(_objectSpread2({
|
|
24327
|
+
BaseButton,
|
|
24328
|
+
BaseCheckbox,
|
|
24329
|
+
// BaseTextField,
|
|
24330
|
+
BasePopper,
|
|
24331
|
+
ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24321
24332
|
displayName: "ColumnFilteredIcon"
|
|
24322
24333
|
})),
|
|
24323
|
-
|
|
24334
|
+
ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24324
24335
|
displayName: "ColumnSelectorIcon"
|
|
24325
24336
|
})),
|
|
24326
|
-
|
|
24337
|
+
ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24327
24338
|
displayName: "ColumnSortedAscendingIcon"
|
|
24328
24339
|
})),
|
|
24329
|
-
|
|
24340
|
+
ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24330
24341
|
displayName: "ColumnSortedDescendingIcon"
|
|
24331
24342
|
})),
|
|
24332
|
-
|
|
24343
|
+
DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24333
24344
|
displayName: "DensityCompactIcon"
|
|
24334
24345
|
})),
|
|
24335
|
-
|
|
24346
|
+
DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24336
24347
|
displayName: "DensityStandardIcon"
|
|
24337
24348
|
})),
|
|
24338
|
-
|
|
24349
|
+
DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24339
24350
|
displayName: "DensityComfortableIcon"
|
|
24340
24351
|
})),
|
|
24341
|
-
|
|
24352
|
+
DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24342
24353
|
displayName: "DetailPanelCollapseIcon"
|
|
24343
24354
|
})),
|
|
24344
|
-
|
|
24355
|
+
DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24345
24356
|
displayName: "DetailPanelExpandIcon"
|
|
24346
24357
|
})),
|
|
24347
|
-
|
|
24358
|
+
ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24348
24359
|
displayName: "ExportIcon"
|
|
24349
24360
|
})),
|
|
24350
|
-
|
|
24351
|
-
displayName: "OpenFilterButtonIcon"
|
|
24352
|
-
fontSize: "medium"
|
|
24361
|
+
OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
|
|
24362
|
+
displayName: "OpenFilterButtonIcon"
|
|
24353
24363
|
}, props))
|
|
24354
|
-
},
|
|
24355
|
-
|
|
24364
|
+
}, components), {}, {
|
|
24365
|
+
Toolbar: props => {
|
|
24356
24366
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !hideToolbar ? /*#__PURE__*/React__default.createElement(RenderedToolbar, _extends$2({}, props, {
|
|
24357
24367
|
filterModel: filterModel,
|
|
24358
24368
|
onFilterModelChange: onFilterModelChange
|
|
24359
|
-
})) : null, pagination ? /*#__PURE__*/React__default.createElement(
|
|
24369
|
+
})) : null, pagination ? /*#__PURE__*/React__default.createElement(ControlledPagination, {
|
|
24360
24370
|
displaySelection: true,
|
|
24361
24371
|
displayRowsPerPage: false,
|
|
24362
24372
|
displayPagination: ['top', 'both'].includes(paginationPlacement),
|
|
24363
24373
|
selectionStatus: selectionStatus.current,
|
|
24364
24374
|
apiRef: apiRef,
|
|
24365
|
-
|
|
24366
|
-
|
|
24367
|
-
|
|
24368
|
-
|
|
24375
|
+
isRowSelectable: isRowSelectable,
|
|
24376
|
+
page: page,
|
|
24377
|
+
onPageChange: onPageChange,
|
|
24378
|
+
pageSize: pageSize,
|
|
24379
|
+
onPageSizeChange: onPageSizeChange,
|
|
24380
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
24381
|
+
paginationProps: paginationProps
|
|
24369
24382
|
}) : null);
|
|
24370
24383
|
},
|
|
24371
|
-
|
|
24384
|
+
Pagination: props => pagination ? /*#__PURE__*/React__default.createElement(ControlledPagination, _extends$2({}, props, {
|
|
24372
24385
|
displaySelection: false,
|
|
24373
24386
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
24374
24387
|
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
24375
24388
|
selectionStatus: selectionStatus.current,
|
|
24376
24389
|
apiRef: apiRef,
|
|
24377
|
-
|
|
24378
|
-
|
|
24379
|
-
|
|
24380
|
-
|
|
24390
|
+
isRowSelectable: isRowSelectable,
|
|
24391
|
+
page: page,
|
|
24392
|
+
onPageChange: onPageChange,
|
|
24393
|
+
pageSize: pageSize,
|
|
24394
|
+
onPageSizeChange: onPageSizeChange,
|
|
24395
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
24396
|
+
paginationProps: paginationProps
|
|
24381
24397
|
})) : null
|
|
24382
24398
|
}),
|
|
24383
|
-
|
|
24384
|
-
toolbar: _objectSpread2({},
|
|
24399
|
+
componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
|
|
24400
|
+
toolbar: _objectSpread2({}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
|
|
24385
24401
|
}),
|
|
24386
24402
|
filterModel: filterModel,
|
|
24387
24403
|
initialState: initialState,
|
|
@@ -24389,43 +24405,45 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24389
24405
|
onFilterModelChange: onFilterModelChange,
|
|
24390
24406
|
pagination: pagination,
|
|
24391
24407
|
rows: rows,
|
|
24392
|
-
|
|
24393
|
-
|
|
24394
|
-
|
|
24395
|
-
|
|
24408
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
24409
|
+
page: page,
|
|
24410
|
+
onPageChange: onPageChange,
|
|
24411
|
+
pageSize: pageSize,
|
|
24412
|
+
onPageSizeChange: onPageSizeChange,
|
|
24413
|
+
onSelectionModelChange: (newSelectionModel, details) => {
|
|
24396
24414
|
if (pagination) {
|
|
24397
|
-
const selectableRowsInPage = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(
|
|
24415
|
+
const selectableRowsInPage = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref4 => {
|
|
24398
24416
|
var _props$isRowSelectabl;
|
|
24399
24417
|
let {
|
|
24400
24418
|
model
|
|
24401
|
-
} =
|
|
24419
|
+
} = _ref4;
|
|
24402
24420
|
return (_props$isRowSelectabl = props.isRowSelectable) === null || _props$isRowSelectabl === void 0 ? void 0 : _props$isRowSelectabl.call(props, {
|
|
24403
24421
|
row: model
|
|
24404
24422
|
});
|
|
24405
|
-
}).map(
|
|
24423
|
+
}).map(_ref5 => {
|
|
24406
24424
|
let {
|
|
24407
24425
|
id
|
|
24408
|
-
} =
|
|
24426
|
+
} = _ref5;
|
|
24409
24427
|
return id;
|
|
24410
24428
|
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
24411
24429
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
24412
|
-
const selectableRowsInTable = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(
|
|
24430
|
+
const selectableRowsInTable = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref6 => {
|
|
24413
24431
|
var _props$isRowSelectabl2;
|
|
24414
24432
|
let {
|
|
24415
24433
|
model
|
|
24416
|
-
} =
|
|
24434
|
+
} = _ref6;
|
|
24417
24435
|
return (_props$isRowSelectabl2 = props.isRowSelectable) === null || _props$isRowSelectabl2 === void 0 ? void 0 : _props$isRowSelectabl2.call(props, {
|
|
24418
24436
|
row: model
|
|
24419
24437
|
});
|
|
24420
|
-
}).map(
|
|
24438
|
+
}).map(_ref7 => {
|
|
24421
24439
|
let {
|
|
24422
24440
|
id
|
|
24423
|
-
} =
|
|
24441
|
+
} = _ref7;
|
|
24424
24442
|
return id;
|
|
24425
24443
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
24426
24444
|
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
24427
24445
|
const numberOfSelectedRows = newSelectionModel.length;
|
|
24428
|
-
if (selectionStatus.current.type === 'table' && numberOfSelectedRows === numberOfSelectableRowsInTable - numberOfSelectableRowsInPage) {
|
|
24446
|
+
if (selectionStatus.current.type === 'table' && numberOfSelectedRows === numberOfSelectableRowsInTable - numberOfSelectableRowsInPage || selectionStatus.current.type === 'table' && selectionStatus.current.numberOfSelectedRows === numberOfSelectableRowsInTable || selectionStatus.current.type === 'page' && numberOfSelectedRows === numberOfSelectableRowsInPage) {
|
|
24429
24447
|
setTimeout(() => {
|
|
24430
24448
|
apiRef.current.selectRows([], true, true);
|
|
24431
24449
|
}, 0);
|
|
@@ -24452,7 +24470,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24452
24470
|
};
|
|
24453
24471
|
}
|
|
24454
24472
|
}
|
|
24455
|
-
|
|
24473
|
+
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
|
|
24456
24474
|
},
|
|
24457
24475
|
sx: _objectSpread2(_objectSpread2({}, sx), {}, {
|
|
24458
24476
|
'.MuiDataGrid-columnHeaders': {
|