@redsift/table 9.2.0 → 9.2.1-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 +2 -3
- package/index.js +135 -133
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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';
|
|
7
6
|
|
|
@@ -10,7 +9,7 @@ declare const DETAIL_PANEL_TOGGLE_COL_DEF: _mui_x_data_grid_pro.GridColDef<any,
|
|
|
10
9
|
declare const IS_BETWEEN: {
|
|
11
10
|
label: string;
|
|
12
11
|
value: string;
|
|
13
|
-
getApplyFilterFn: (filterItem: GridFilterItem) => ((params: GridCellParams
|
|
12
|
+
getApplyFilterFn: (filterItem: GridFilterItem) => ((params: GridCellParams) => boolean) | null;
|
|
14
13
|
InputComponent: (props: any) => JSX.Element;
|
|
15
14
|
};
|
|
16
15
|
|
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: {
|
|
@@ -24166,25 +24165,46 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
24166
24165
|
} : void 0;
|
|
24167
24166
|
var TablePagination$1 = TablePagination;
|
|
24168
24167
|
|
|
24169
|
-
const _excluded$1 = ["apiRef", "autoHeight", "className", "
|
|
24168
|
+
const _excluded$1 = ["apiRef", "autoHeight", "className", "components", "componentsProps", "filterModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "onFilterModelChange", "onPageChange", "onPageSizeChange", "onSelectionModelChange", "page", "pageSize", "pagination", "paginationPlacement", "rows", "rowsPerPageOptions", "sx"];
|
|
24170
24169
|
const COMPONENT_NAME$1 = 'DataGrid';
|
|
24171
24170
|
const CLASSNAME$1 = 'redsift-datagrid';
|
|
24172
24171
|
const DEFAULT_PROPS = {
|
|
24173
24172
|
license: process.env.MUI_LICENSE_KEY,
|
|
24174
24173
|
paginationPlacement: 'both'
|
|
24175
24174
|
};
|
|
24176
|
-
const
|
|
24175
|
+
const getSelectableRowsInTable = (apiRef, isRowSelectable) => {
|
|
24176
|
+
return isRowSelectable && typeof isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref => {
|
|
24177
|
+
let {
|
|
24178
|
+
model
|
|
24179
|
+
} = _ref;
|
|
24180
|
+
return isRowSelectable === null || isRowSelectable === void 0 ? void 0 : isRowSelectable({
|
|
24181
|
+
row: model
|
|
24182
|
+
});
|
|
24183
|
+
}).map(_ref2 => {
|
|
24184
|
+
let {
|
|
24185
|
+
id
|
|
24186
|
+
} = _ref2;
|
|
24187
|
+
return id;
|
|
24188
|
+
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
24189
|
+
};
|
|
24190
|
+
const Pagination = _ref3 => {
|
|
24177
24191
|
let {
|
|
24178
24192
|
displaySelection = false,
|
|
24179
24193
|
displayRowsPerPage = false,
|
|
24180
24194
|
displayPagination = false,
|
|
24181
24195
|
selectionStatus,
|
|
24182
24196
|
apiRef,
|
|
24183
|
-
|
|
24184
|
-
|
|
24185
|
-
|
|
24186
|
-
|
|
24187
|
-
|
|
24197
|
+
page,
|
|
24198
|
+
onPageChange,
|
|
24199
|
+
pageSize,
|
|
24200
|
+
onPageSizeChange,
|
|
24201
|
+
rowsPerPageOptions,
|
|
24202
|
+
isRowSelectable
|
|
24203
|
+
} = _ref3;
|
|
24204
|
+
const filteredRowsInTable = getSelectableRowsInTable(apiRef);
|
|
24205
|
+
const selectableRowsInTable = getSelectableRowsInTable(apiRef, isRowSelectable);
|
|
24206
|
+
const numberOfFilteredRowsInTable = filteredRowsInTable.length;
|
|
24207
|
+
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
24188
24208
|
return /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
24189
24209
|
flexDirection: "row",
|
|
24190
24210
|
alignItems: "center",
|
|
@@ -24192,13 +24212,13 @@ const Pagination = _ref => {
|
|
|
24192
24212
|
marginBottom: "7px"
|
|
24193
24213
|
}, displaySelection ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, selectionStatus.type === 'page' ? /*#__PURE__*/React__default.createElement(Text, {
|
|
24194
24214
|
fontSize: "14px"
|
|
24195
|
-
}, `All ${selectionStatus.numberOfSelectedRows}${
|
|
24215
|
+
}, `All ${selectionStatus.numberOfSelectedRows}${numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''} rows on this page are selected. `, /*#__PURE__*/React__default.createElement(LinkButton, {
|
|
24196
24216
|
onClick: () => {
|
|
24197
|
-
apiRef.current.selectRows(
|
|
24217
|
+
apiRef.current.selectRows(numberOfSelectableRowsInTable ? selectableRowsInTable : apiRef.current.getAllRowIds());
|
|
24198
24218
|
}
|
|
24199
|
-
}, "Select all ",
|
|
24219
|
+
}, "Select all ", numberOfSelectableRowsInTable, numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : '', " rows in the table.")) : selectionStatus.type === 'table' ? /*#__PURE__*/React__default.createElement(Text, {
|
|
24200
24220
|
fontSize: "14px"
|
|
24201
|
-
}, `All ${selectionStatus.numberOfSelectedRows}${
|
|
24221
|
+
}, `All ${selectionStatus.numberOfSelectedRows}${numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''} rows in the table are selected. `, /*#__PURE__*/React__default.createElement(LinkButton, {
|
|
24202
24222
|
onClick: () => {
|
|
24203
24223
|
apiRef.current.selectRows([], false, true);
|
|
24204
24224
|
}
|
|
@@ -24206,56 +24226,52 @@ const Pagination = _ref => {
|
|
|
24206
24226
|
fontSize: "14px"
|
|
24207
24227
|
}, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, {
|
|
24208
24228
|
component: "div",
|
|
24209
|
-
count:
|
|
24210
|
-
page:
|
|
24211
|
-
onPageChange: (event,
|
|
24212
|
-
|
|
24213
|
-
|
|
24214
|
-
|
|
24215
|
-
|
|
24216
|
-
|
|
24217
|
-
page: paginationModel.page,
|
|
24218
|
-
pageSize: parseInt(event.target.value, 10)
|
|
24219
|
-
}),
|
|
24220
|
-
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions || [] : []
|
|
24229
|
+
count: numberOfFilteredRowsInTable,
|
|
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 : []
|
|
24221
24237
|
}) : null);
|
|
24222
24238
|
};
|
|
24223
24239
|
const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
24224
|
-
var _initialState$paginat, _initialState$paginat2
|
|
24240
|
+
var _initialState$paginat, _initialState$paginat2;
|
|
24225
24241
|
const datagridRef = ref || useRef();
|
|
24226
24242
|
const {
|
|
24227
24243
|
apiRef: propsApiRef,
|
|
24228
24244
|
autoHeight,
|
|
24229
24245
|
className,
|
|
24230
|
-
|
|
24231
|
-
|
|
24246
|
+
components,
|
|
24247
|
+
componentsProps,
|
|
24232
24248
|
filterModel: propsFilterModel,
|
|
24233
24249
|
height: propsHeight,
|
|
24234
24250
|
hideToolbar,
|
|
24235
24251
|
initialState,
|
|
24252
|
+
isRowSelectable,
|
|
24236
24253
|
license,
|
|
24237
24254
|
onFilterModelChange: propsOnFilterModelChange,
|
|
24238
|
-
|
|
24239
|
-
|
|
24240
|
-
|
|
24255
|
+
onPageChange: propsOnPageChange,
|
|
24256
|
+
onPageSizeChange: propsOnPageSizeChange,
|
|
24257
|
+
onSelectionModelChange,
|
|
24258
|
+
page: propsPage,
|
|
24259
|
+
pageSize: propsPageSize,
|
|
24241
24260
|
pagination,
|
|
24242
24261
|
paginationPlacement,
|
|
24243
24262
|
rows,
|
|
24244
|
-
|
|
24263
|
+
rowsPerPageOptions,
|
|
24245
24264
|
sx
|
|
24246
24265
|
} = props,
|
|
24247
24266
|
forwardedProps = _objectWithoutProperties(props, _excluded$1);
|
|
24248
24267
|
const _apiRef = useGridApiRef();
|
|
24249
24268
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
24250
|
-
const RenderedToolbar =
|
|
24269
|
+
const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$2;
|
|
24251
24270
|
LicenseInfo.setLicenseKey(license);
|
|
24252
24271
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
24253
24272
|
const selectionStatus = useRef({
|
|
24254
24273
|
type: 'none',
|
|
24255
|
-
numberOfSelectedRows: 0
|
|
24256
|
-
numberOfSelectableRowsInPage: 0,
|
|
24257
|
-
numberOfSelectableRowsInTable: 0,
|
|
24258
|
-
selectableRowsInTable: []
|
|
24274
|
+
numberOfSelectedRows: 0
|
|
24259
24275
|
});
|
|
24260
24276
|
const [filterModel, setFilterModel] = useState(propsFilterModel);
|
|
24261
24277
|
useEffect(() => {
|
|
@@ -24267,40 +24283,29 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24267
24283
|
} else {
|
|
24268
24284
|
setFilterModel(model);
|
|
24269
24285
|
}
|
|
24270
|
-
const selectableRowsInTable = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref2 => {
|
|
24271
|
-
var _props$isRowSelectabl;
|
|
24272
|
-
let {
|
|
24273
|
-
model
|
|
24274
|
-
} = _ref2;
|
|
24275
|
-
return (_props$isRowSelectabl = props.isRowSelectable) === null || _props$isRowSelectabl === void 0 ? void 0 : _props$isRowSelectabl.call(props, {
|
|
24276
|
-
row: model
|
|
24277
|
-
});
|
|
24278
|
-
}).map(_ref3 => {
|
|
24279
|
-
let {
|
|
24280
|
-
id
|
|
24281
|
-
} = _ref3;
|
|
24282
|
-
return id;
|
|
24283
|
-
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
24284
|
-
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
24285
|
-
selectionStatus.current.selectableRowsInTable = selectableRowsInTable;
|
|
24286
|
-
selectionStatus.current.numberOfSelectableRowsInTable = numberOfSelectableRowsInTable;
|
|
24287
24286
|
};
|
|
24288
|
-
const [
|
|
24289
|
-
|
|
24290
|
-
|
|
24291
|
-
|
|
24292
|
-
|
|
24293
|
-
|
|
24294
|
-
|
|
24287
|
+
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);
|
|
24288
|
+
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);
|
|
24289
|
+
const onPageChange = page => {
|
|
24290
|
+
if (propsOnPageChange) {
|
|
24291
|
+
propsOnPageChange(page, undefined);
|
|
24292
|
+
} else {
|
|
24293
|
+
setPage(page);
|
|
24294
|
+
}
|
|
24295
|
+
};
|
|
24296
|
+
const onPageSizeChange = pageSize => {
|
|
24297
|
+
onPageChange(0);
|
|
24298
|
+
if (propsOnPageSizeChange) {
|
|
24299
|
+
propsOnPageSizeChange(pageSize, undefined);
|
|
24295
24300
|
} else {
|
|
24296
|
-
|
|
24301
|
+
setPageSize(pageSize);
|
|
24297
24302
|
}
|
|
24298
24303
|
};
|
|
24299
24304
|
useEffect(() => {
|
|
24300
|
-
if (
|
|
24301
|
-
|
|
24305
|
+
if (propsPageSize) {
|
|
24306
|
+
setPageSize(propsPageSize);
|
|
24302
24307
|
}
|
|
24303
|
-
}, [
|
|
24308
|
+
}, [propsPageSize]);
|
|
24304
24309
|
if (!Array.isArray(rows)) {
|
|
24305
24310
|
return null;
|
|
24306
24311
|
}
|
|
@@ -24312,47 +24317,47 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24312
24317
|
apiRef: apiRef,
|
|
24313
24318
|
autoHeight: autoHeight,
|
|
24314
24319
|
checkboxSelectionVisibleOnly: Boolean(pagination),
|
|
24315
|
-
|
|
24316
|
-
|
|
24317
|
-
|
|
24318
|
-
//
|
|
24319
|
-
|
|
24320
|
-
|
|
24320
|
+
components: _objectSpread2(_objectSpread2({
|
|
24321
|
+
BaseButton,
|
|
24322
|
+
BaseCheckbox,
|
|
24323
|
+
// BaseTextField,
|
|
24324
|
+
BasePopper,
|
|
24325
|
+
ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24321
24326
|
displayName: "ColumnFilteredIcon"
|
|
24322
24327
|
})),
|
|
24323
|
-
|
|
24328
|
+
ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24324
24329
|
displayName: "ColumnSelectorIcon"
|
|
24325
24330
|
})),
|
|
24326
|
-
|
|
24331
|
+
ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24327
24332
|
displayName: "ColumnSortedAscendingIcon"
|
|
24328
24333
|
})),
|
|
24329
|
-
|
|
24334
|
+
ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24330
24335
|
displayName: "ColumnSortedDescendingIcon"
|
|
24331
24336
|
})),
|
|
24332
|
-
|
|
24337
|
+
DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24333
24338
|
displayName: "DensityCompactIcon"
|
|
24334
24339
|
})),
|
|
24335
|
-
|
|
24340
|
+
DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24336
24341
|
displayName: "DensityStandardIcon"
|
|
24337
24342
|
})),
|
|
24338
|
-
|
|
24343
|
+
DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24339
24344
|
displayName: "DensityComfortableIcon"
|
|
24340
24345
|
})),
|
|
24341
|
-
|
|
24346
|
+
DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24342
24347
|
displayName: "DetailPanelCollapseIcon"
|
|
24343
24348
|
})),
|
|
24344
|
-
|
|
24349
|
+
DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24345
24350
|
displayName: "DetailPanelExpandIcon"
|
|
24346
24351
|
})),
|
|
24347
|
-
|
|
24352
|
+
ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24348
24353
|
displayName: "ExportIcon"
|
|
24349
24354
|
})),
|
|
24350
|
-
|
|
24355
|
+
OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
|
|
24351
24356
|
displayName: "OpenFilterButtonIcon",
|
|
24352
24357
|
fontSize: "medium"
|
|
24353
24358
|
}, props))
|
|
24354
|
-
},
|
|
24355
|
-
|
|
24359
|
+
}, components), {}, {
|
|
24360
|
+
Toolbar: props => {
|
|
24356
24361
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !hideToolbar ? /*#__PURE__*/React__default.createElement(RenderedToolbar, _extends$2({}, props, {
|
|
24357
24362
|
filterModel: filterModel,
|
|
24358
24363
|
onFilterModelChange: onFilterModelChange
|
|
@@ -24362,62 +24367,71 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24362
24367
|
displayPagination: ['top', 'both'].includes(paginationPlacement),
|
|
24363
24368
|
selectionStatus: selectionStatus.current,
|
|
24364
24369
|
apiRef: apiRef,
|
|
24365
|
-
|
|
24366
|
-
|
|
24367
|
-
|
|
24370
|
+
page: page,
|
|
24371
|
+
onPageChange: onPageChange,
|
|
24372
|
+
pageSize: pageSize,
|
|
24373
|
+
onPageSizeChange: onPageSizeChange,
|
|
24374
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
24375
|
+
isRowSelectable: isRowSelectable
|
|
24368
24376
|
}) : null);
|
|
24369
24377
|
},
|
|
24370
|
-
|
|
24378
|
+
Pagination: props => pagination ? /*#__PURE__*/React__default.createElement(Pagination, _extends$2({}, props, {
|
|
24371
24379
|
displaySelection: false,
|
|
24372
24380
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
24373
24381
|
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
24374
24382
|
selectionStatus: selectionStatus.current,
|
|
24375
24383
|
apiRef: apiRef,
|
|
24376
|
-
|
|
24377
|
-
|
|
24378
|
-
|
|
24384
|
+
page: page,
|
|
24385
|
+
onPageChange: onPageChange,
|
|
24386
|
+
pageSize: pageSize,
|
|
24387
|
+
onPageSizeChange: onPageSizeChange,
|
|
24388
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
24389
|
+
isRowSelectable: isRowSelectable
|
|
24379
24390
|
})) : null
|
|
24380
24391
|
}),
|
|
24381
|
-
|
|
24382
|
-
toolbar: _objectSpread2({},
|
|
24392
|
+
componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
|
|
24393
|
+
toolbar: _objectSpread2({}, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
|
|
24383
24394
|
}),
|
|
24384
24395
|
filterModel: filterModel,
|
|
24385
24396
|
initialState: initialState,
|
|
24397
|
+
isRowSelectable: isRowSelectable,
|
|
24386
24398
|
onFilterModelChange: onFilterModelChange,
|
|
24387
24399
|
pagination: pagination,
|
|
24388
24400
|
rows: rows,
|
|
24389
|
-
|
|
24390
|
-
|
|
24391
|
-
|
|
24392
|
-
|
|
24401
|
+
rowsPerPageOptions: rowsPerPageOptions,
|
|
24402
|
+
page: page,
|
|
24403
|
+
onPageChange: onPageChange,
|
|
24404
|
+
pageSize: pageSize,
|
|
24405
|
+
onPageSizeChange: onPageSizeChange,
|
|
24406
|
+
onSelectionModelChange: (newSelectionModel, details) => {
|
|
24393
24407
|
if (pagination) {
|
|
24394
|
-
const selectableRowsInPage = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(
|
|
24395
|
-
var _props$
|
|
24408
|
+
const selectableRowsInPage = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref4 => {
|
|
24409
|
+
var _props$isRowSelectabl;
|
|
24396
24410
|
let {
|
|
24397
24411
|
model
|
|
24398
|
-
} =
|
|
24399
|
-
return (_props$
|
|
24412
|
+
} = _ref4;
|
|
24413
|
+
return (_props$isRowSelectabl = props.isRowSelectable) === null || _props$isRowSelectabl === void 0 ? void 0 : _props$isRowSelectabl.call(props, {
|
|
24400
24414
|
row: model
|
|
24401
24415
|
});
|
|
24402
|
-
}).map(
|
|
24416
|
+
}).map(_ref5 => {
|
|
24403
24417
|
let {
|
|
24404
24418
|
id
|
|
24405
|
-
} =
|
|
24419
|
+
} = _ref5;
|
|
24406
24420
|
return id;
|
|
24407
24421
|
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
24408
24422
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
24409
|
-
const selectableRowsInTable = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(
|
|
24410
|
-
var _props$
|
|
24423
|
+
const selectableRowsInTable = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref6 => {
|
|
24424
|
+
var _props$isRowSelectabl2;
|
|
24411
24425
|
let {
|
|
24412
24426
|
model
|
|
24413
|
-
} =
|
|
24414
|
-
return (_props$
|
|
24427
|
+
} = _ref6;
|
|
24428
|
+
return (_props$isRowSelectabl2 = props.isRowSelectable) === null || _props$isRowSelectabl2 === void 0 ? void 0 : _props$isRowSelectabl2.call(props, {
|
|
24415
24429
|
row: model
|
|
24416
24430
|
});
|
|
24417
|
-
}).map(
|
|
24431
|
+
}).map(_ref7 => {
|
|
24418
24432
|
let {
|
|
24419
24433
|
id
|
|
24420
|
-
} =
|
|
24434
|
+
} = _ref7;
|
|
24421
24435
|
return id;
|
|
24422
24436
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
24423
24437
|
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
@@ -24430,38 +24444,26 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24430
24444
|
if (numberOfSelectedRows === numberOfSelectableRowsInPage && numberOfSelectableRowsInPage < numberOfSelectableRowsInTable) {
|
|
24431
24445
|
selectionStatus.current = {
|
|
24432
24446
|
type: 'page',
|
|
24433
|
-
numberOfSelectedRows
|
|
24434
|
-
numberOfSelectableRowsInPage,
|
|
24435
|
-
numberOfSelectableRowsInTable,
|
|
24436
|
-
selectableRowsInTable
|
|
24447
|
+
numberOfSelectedRows
|
|
24437
24448
|
};
|
|
24438
24449
|
} else if (numberOfSelectedRows === numberOfSelectableRowsInTable && numberOfSelectableRowsInPage < numberOfSelectableRowsInTable) {
|
|
24439
24450
|
selectionStatus.current = {
|
|
24440
24451
|
type: 'table',
|
|
24441
|
-
numberOfSelectedRows
|
|
24442
|
-
numberOfSelectableRowsInPage,
|
|
24443
|
-
numberOfSelectableRowsInTable,
|
|
24444
|
-
selectableRowsInTable
|
|
24452
|
+
numberOfSelectedRows
|
|
24445
24453
|
};
|
|
24446
24454
|
} else if (numberOfSelectedRows > 0) {
|
|
24447
24455
|
selectionStatus.current = {
|
|
24448
24456
|
type: 'other',
|
|
24449
|
-
numberOfSelectedRows
|
|
24450
|
-
numberOfSelectableRowsInPage,
|
|
24451
|
-
numberOfSelectableRowsInTable,
|
|
24452
|
-
selectableRowsInTable
|
|
24457
|
+
numberOfSelectedRows
|
|
24453
24458
|
};
|
|
24454
24459
|
} else {
|
|
24455
24460
|
selectionStatus.current = {
|
|
24456
24461
|
type: 'none',
|
|
24457
|
-
numberOfSelectedRows
|
|
24458
|
-
numberOfSelectableRowsInPage,
|
|
24459
|
-
numberOfSelectableRowsInTable,
|
|
24460
|
-
selectableRowsInTable
|
|
24462
|
+
numberOfSelectedRows
|
|
24461
24463
|
};
|
|
24462
24464
|
}
|
|
24463
24465
|
}
|
|
24464
|
-
|
|
24466
|
+
onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
|
|
24465
24467
|
},
|
|
24466
24468
|
sx: _objectSpread2(_objectSpread2({}, sx), {}, {
|
|
24467
24469
|
'.MuiDataGrid-columnHeaders': {
|