@redsift/table 9.3.3 → 9.4.0-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 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, GridFilterModel, GridToolbarExportProps, GridToolbarFilterButtonProps, GridToolbarColumnsButton, GridToolbarDensitySelector } from '@mui/x-data-grid-pro';
3
- export * from '@mui/x-data-grid-pro';
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, ComponentProps, RefObject } from 'react';
7
6
  import { TablePaginationProps } from '@mui/material';
@@ -11,7 +10,7 @@ declare const DETAIL_PANEL_TOGGLE_COL_DEF: _mui_x_data_grid_pro.GridColDef<any,
11
10
  declare const IS_BETWEEN: {
12
11
  label: string;
13
12
  value: string;
14
- getApplyFilterFn: (filterItem: GridFilterItem) => ((params: GridCellParams<any, any>) => boolean) | null;
13
+ getApplyFilterFn: (filterItem: GridFilterItem) => ((params: GridCellParams) => boolean) | null;
15
14
  InputComponent: (props: any) => JSX.Element;
16
15
  };
17
16
 
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, gridExpandedSortedRowIdsSelector, useGridApiRef, DataGridPro, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector } from '@mui/x-data-grid-pro';
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';
@@ -8516,7 +8515,7 @@ function getPopperUtilityClass(slot) {
8516
8515
  generateUtilityClasses('MuiPopper', ['root']);
8517
8516
 
8518
8517
  const _excluded$E = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "placement", "popperOptions", "popperRef", "slotProps", "slots", "TransitionProps", "ownerState"],
8519
- _excluded2$2 = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition", "slotProps", "slots"];
8518
+ _excluded2$3 = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition", "slotProps", "slots"];
8520
8519
  function flipPlacement(placement, direction) {
8521
8520
  if (direction === 'ltr') {
8522
8521
  return placement;
@@ -8700,7 +8699,7 @@ const Popper$2 = /*#__PURE__*/React.forwardRef(function Popper(props, forwardedR
8700
8699
  slotProps = {},
8701
8700
  slots = {}
8702
8701
  } = props,
8703
- other = _objectWithoutPropertiesLoose(props, _excluded2$2);
8702
+ other = _objectWithoutPropertiesLoose(props, _excluded2$3);
8704
8703
  const [exited, setExited] = React.useState(true);
8705
8704
  const handleEnter = () => {
8706
8705
  setExited(false);
@@ -14961,7 +14960,7 @@ function getPopoverUtilityClass(slot) {
14961
14960
  generateUtilityClasses('MuiPopover', ['root', 'paper']);
14962
14961
 
14963
14962
  const _excluded$l = ["onEntering"],
14964
- _excluded2$1 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
14963
+ _excluded2$2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
14965
14964
  _excluded3 = ["slotProps"];
14966
14965
  function getOffsetTop(rect, vertical) {
14967
14966
  let offset = 0;
@@ -15058,7 +15057,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
15058
15057
  } = {}
15059
15058
  } = props,
15060
15059
  TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$l),
15061
- other = _objectWithoutPropertiesLoose(props, _excluded2$1);
15060
+ other = _objectWithoutPropertiesLoose(props, _excluded2$2);
15062
15061
  const externalPaperSlotProps = (_slotProps$paper = slotProps == null ? void 0 : slotProps.paper) != null ? _slotProps$paper : PaperPropsProp;
15063
15062
  const paperRef = React.useRef();
15064
15063
  const handlePaperRef = useForkRef(paperRef, externalPaperSlotProps.ref);
@@ -15464,7 +15463,7 @@ function getMenuUtilityClass(slot) {
15464
15463
  generateUtilityClasses('MuiMenu', ['root', 'paper', 'list']);
15465
15464
 
15466
15465
  const _excluded$k = ["onEntering"],
15467
- _excluded2 = ["autoFocus", "children", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant"];
15466
+ _excluded2$1 = ["autoFocus", "children", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant"];
15468
15467
  const RTL_ORIGIN = {
15469
15468
  vertical: 'top',
15470
15469
  horizontal: 'right'
@@ -15531,7 +15530,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
15531
15530
  variant = 'selectedMenu'
15532
15531
  } = props,
15533
15532
  TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$k),
15534
- other = _objectWithoutPropertiesLoose(props, _excluded2);
15533
+ other = _objectWithoutPropertiesLoose(props, _excluded2$1);
15535
15534
  const theme = useTheme();
15536
15535
  const isRtl = theme.direction === 'rtl';
15537
15536
  const ownerState = _extends$1({}, props, {
@@ -17467,7 +17466,7 @@ const isBetweenOperator = {
17467
17466
  label: 'is between',
17468
17467
  value: 'isBetween',
17469
17468
  getApplyFilterFn: filterItem => {
17470
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
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 && params.value !== undefined && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
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.field || !filterItem.value || !filterItem.operator) {
17495
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17497
17496
  return null;
17498
17497
  }
17499
17498
  return params => {
@@ -17516,7 +17515,7 @@ const containsAnyOfCIOperator = {
17516
17515
  label: 'contains any of (case insensitive)',
17517
17516
  value: 'containsAnyOf',
17518
17517
  getApplyFilterFn: filterItem => {
17519
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17518
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17520
17519
  return null;
17521
17520
  }
17522
17521
  return params => {
@@ -17543,7 +17542,7 @@ const endsWithAnyOfOperator = {
17543
17542
  label: 'ends with any of',
17544
17543
  value: 'endsWithAnyOf',
17545
17544
  getApplyFilterFn: filterItem => {
17546
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17545
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17547
17546
  return null;
17548
17547
  }
17549
17548
  return params => {
@@ -17570,7 +17569,7 @@ const isAnyOfOperator = {
17570
17569
  label: 'is any of',
17571
17570
  value: 'isAnyOf',
17572
17571
  getApplyFilterFn: filterItem => {
17573
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17572
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17574
17573
  return null;
17575
17574
  }
17576
17575
  return params => {
@@ -17594,7 +17593,7 @@ const isNotAnyOfOperator = {
17594
17593
  label: 'is not any of',
17595
17594
  value: 'isNotAnyOf',
17596
17595
  getApplyFilterFn: filterItem => {
17597
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17596
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17598
17597
  return null;
17599
17598
  }
17600
17599
  return params => {
@@ -17618,7 +17617,7 @@ const startsWithAnyOfOperator = {
17618
17617
  label: 'starts with any of',
17619
17618
  value: 'startsWithAnyOf',
17620
17619
  getApplyFilterFn: filterItem => {
17621
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17620
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17622
17621
  return null;
17623
17622
  }
17624
17623
  return params => {
@@ -21877,7 +21876,7 @@ GridToolbarFilterSemanticField.displayName = COMPONENT_NAME$2;
21877
21876
 
21878
21877
  /** ------ */
21879
21878
 
21880
- const Toolbar$2 = props => {
21879
+ const Toolbar$3 = props => {
21881
21880
  const {
21882
21881
  hasExportButton = true,
21883
21882
  exportButtonProps,
@@ -21916,7 +21915,7 @@ const Toolbar$2 = props => {
21916
21915
  let {
21917
21916
  apiRef
21918
21917
  } = _ref;
21919
- return gridExpandedSortedRowIdsSelector(apiRef);
21918
+ return gridVisibleSortedRowIdsSelector(apiRef);
21920
21919
  }
21921
21920
  },
21922
21921
  printOptions: {
@@ -23607,7 +23606,7 @@ const ToolbarRoot = styled$1('div', {
23607
23606
  theme,
23608
23607
  ownerState
23609
23608
  }) => ownerState.variant === 'regular' && theme.mixins.toolbar);
23610
- const Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
23609
+ const Toolbar$1 = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
23611
23610
  const props = useThemeProps({
23612
23611
  props: inProps,
23613
23612
  name: 'MuiToolbar'
@@ -23632,7 +23631,7 @@ const Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
23632
23631
  ownerState: ownerState
23633
23632
  }, other));
23634
23633
  });
23635
- process.env.NODE_ENV !== "production" ? Toolbar.propTypes /* remove-proptypes */ = {
23634
+ process.env.NODE_ENV !== "production" ? Toolbar$1.propTypes /* remove-proptypes */ = {
23636
23635
  // ----------------------------- Warning --------------------------------
23637
23636
  // | These PropTypes are generated from the TypeScript type definitions |
23638
23637
  // | To update them edit the d.ts file and run "yarn proptypes" |
@@ -23670,7 +23669,7 @@ process.env.NODE_ENV !== "production" ? Toolbar.propTypes /* remove-proptypes */
23670
23669
  */
23671
23670
  variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['dense', 'regular']), PropTypes.string])
23672
23671
  } : void 0;
23673
- var Toolbar$1 = Toolbar;
23672
+ var Toolbar$2 = Toolbar$1;
23674
23673
 
23675
23674
  var KeyboardArrowLeft = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
23676
23675
  d: "M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"
@@ -24018,7 +24017,7 @@ const TablePaginationRoot = styled$1(TableCell$1, {
24018
24017
  padding: 0
24019
24018
  }
24020
24019
  }));
24021
- const TablePaginationToolbar = styled$1(Toolbar$1, {
24020
+ const TablePaginationToolbar = styled$1(Toolbar$2, {
24022
24021
  name: 'MuiTablePagination',
24023
24022
  slot: 'Toolbar',
24024
24023
  overridesResolver: (props, styles) => _extends$1({
@@ -24368,7 +24367,8 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
24368
24367
  } : void 0;
24369
24368
  var TablePagination$1 = TablePagination;
24370
24369
 
24371
- const _excluded$1 = ["apiRef", "autoHeight", "className", "slots", "slotProps", "filterModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "onFilterModelChange", "paginationModel", "onPaginationModelChange", "onRowSelectionModelChange", "pagination", "paginationPlacement", "paginationProps", "rows", "pageSizeOptions", "sx"];
24370
+ const _excluded$1 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "ControlledPagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "page", "onPageChange", "pageSize", "onPageSizeChange", "rowsPerPageOptions", "paginationProps"],
24371
+ _excluded2 = ["apiRef", "autoHeight", "className", "components", "componentsProps", "filterModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "onFilterModelChange", "onPageChange", "onPageSizeChange", "onSelectionModelChange", "page", "pageSize", "pagination", "paginationPlacement", "paginationProps", "rows", "rowsPerPageOptions", "sx"];
24372
24372
  const COMPONENT_NAME$1 = 'DataGrid';
24373
24373
  const CLASSNAME$1 = 'redsift-datagrid';
24374
24374
  const DEFAULT_PROPS = {
@@ -24397,9 +24397,11 @@ const ControlledPagination = _ref3 => {
24397
24397
  displayPagination = false,
24398
24398
  selectionStatus,
24399
24399
  apiRef,
24400
- paginationModel,
24401
- onPaginationModelChange,
24402
- pageSizeOptions,
24400
+ page,
24401
+ onPageChange,
24402
+ pageSize,
24403
+ onPageSizeChange,
24404
+ rowsPerPageOptions,
24403
24405
  isRowSelectable,
24404
24406
  paginationProps
24405
24407
  } = _ref3;
@@ -24429,28 +24431,62 @@ const ControlledPagination = _ref3 => {
24429
24431
  }, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
24430
24432
  component: "div",
24431
24433
  count: numberOfFilteredRowsInTable,
24432
- page: paginationModel.page,
24433
- onPageChange: (event, page) => onPaginationModelChange({
24434
- page,
24435
- pageSize: paginationModel.pageSize
24436
- }),
24437
- rowsPerPage: paginationModel.pageSize,
24438
- onRowsPerPageChange: event => onPaginationModelChange({
24439
- page: paginationModel.page,
24440
- pageSize: parseInt(event.target.value, 10)
24441
- }),
24442
- rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
24434
+ page: page,
24435
+ onPageChange: (event, newPage) => onPageChange(newPage),
24436
+ rowsPerPage: pageSize,
24437
+ onRowsPerPageChange: event => {
24438
+ onPageSizeChange(parseInt(event.target.value, 10));
24439
+ },
24440
+ rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
24443
24441
  }, paginationProps)) : null);
24444
24442
  };
24443
+ const Toolbar = _ref4 => {
24444
+ let {
24445
+ hideToolbar,
24446
+ RenderedToolbar,
24447
+ filterModel,
24448
+ onFilterModelChange,
24449
+ pagination,
24450
+ ControlledPagination,
24451
+ paginationPlacement,
24452
+ selectionStatus,
24453
+ apiRef,
24454
+ isRowSelectable,
24455
+ page,
24456
+ onPageChange,
24457
+ pageSize,
24458
+ onPageSizeChange,
24459
+ rowsPerPageOptions,
24460
+ paginationProps
24461
+ } = _ref4,
24462
+ forwardedProps = _objectWithoutProperties(_ref4, _excluded$1);
24463
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !hideToolbar ? /*#__PURE__*/React__default.createElement(RenderedToolbar, _extends$2({}, forwardedProps, {
24464
+ filterModel: filterModel,
24465
+ onFilterModelChange: onFilterModelChange
24466
+ })) : null, pagination ? /*#__PURE__*/React__default.createElement(ControlledPagination, {
24467
+ displaySelection: true,
24468
+ displayRowsPerPage: false,
24469
+ displayPagination: ['top', 'both'].includes(paginationPlacement),
24470
+ selectionStatus: selectionStatus.current,
24471
+ apiRef: apiRef,
24472
+ isRowSelectable: isRowSelectable,
24473
+ page: page,
24474
+ onPageChange: onPageChange,
24475
+ pageSize: pageSize,
24476
+ onPageSizeChange: onPageSizeChange,
24477
+ rowsPerPageOptions: rowsPerPageOptions,
24478
+ paginationProps: paginationProps
24479
+ }) : null);
24480
+ };
24445
24481
  const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24446
- var _ref4, _ref5, _initialState$paginat, _initialState$paginat2, _initialState$paginat3, _pageSizeOptions$, _ref6, _initialState$paginat4, _initialState$paginat5, _initialState$paginat6;
24482
+ var _initialState$paginat, _initialState$paginat2;
24447
24483
  const datagridRef = ref || useRef();
24448
24484
  const {
24449
24485
  apiRef: propsApiRef,
24450
24486
  autoHeight,
24451
24487
  className,
24452
- slots,
24453
- slotProps,
24488
+ components,
24489
+ componentsProps,
24454
24490
  filterModel: propsFilterModel,
24455
24491
  height: propsHeight,
24456
24492
  hideToolbar,
@@ -24458,20 +24494,22 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24458
24494
  isRowSelectable,
24459
24495
  license,
24460
24496
  onFilterModelChange: propsOnFilterModelChange,
24461
- paginationModel: propsPaginationModel,
24462
- onPaginationModelChange: propsOnPaginationModelChange,
24463
- onRowSelectionModelChange,
24497
+ onPageChange: propsOnPageChange,
24498
+ onPageSizeChange: propsOnPageSizeChange,
24499
+ onSelectionModelChange,
24500
+ page: propsPage,
24501
+ pageSize: propsPageSize,
24464
24502
  pagination,
24465
24503
  paginationPlacement,
24466
24504
  paginationProps,
24467
24505
  rows,
24468
- pageSizeOptions,
24506
+ rowsPerPageOptions,
24469
24507
  sx
24470
24508
  } = props,
24471
- forwardedProps = _objectWithoutProperties(props, _excluded$1);
24509
+ forwardedProps = _objectWithoutProperties(props, _excluded2);
24472
24510
  const _apiRef = useGridApiRef();
24473
24511
  const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
24474
- const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$2;
24512
+ const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$3;
24475
24513
  LicenseInfo.setLicenseKey(license);
24476
24514
  const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
24477
24515
  const selectionStatus = useRef({
@@ -24489,22 +24527,33 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24489
24527
  setFilterModel(model);
24490
24528
  }
24491
24529
  };
24492
- const [paginationModel, setPaginationModel] = useState({
24493
- pageSize: (_ref4 = (_ref5 = (_initialState$paginat = initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat2 = initialState.pagination) === null || _initialState$paginat2 === void 0 ? void 0 : (_initialState$paginat3 = _initialState$paginat2.paginationModel) === null || _initialState$paginat3 === void 0 ? void 0 : _initialState$paginat3.pageSize) !== null && _initialState$paginat !== void 0 ? _initialState$paginat : propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.pageSize) !== null && _ref5 !== void 0 ? _ref5 : typeof (pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0]) === 'number' ? pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0] : pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : (_pageSizeOptions$ = pageSizeOptions[0]) === null || _pageSizeOptions$ === void 0 ? void 0 : _pageSizeOptions$.value) !== null && _ref4 !== void 0 ? _ref4 : 100,
24494
- page: (_ref6 = (_initialState$paginat4 = initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat5 = initialState.pagination) === null || _initialState$paginat5 === void 0 ? void 0 : (_initialState$paginat6 = _initialState$paginat5.paginationModel) === null || _initialState$paginat6 === void 0 ? void 0 : _initialState$paginat6.page) !== null && _initialState$paginat4 !== void 0 ? _initialState$paginat4 : propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.page) !== null && _ref6 !== void 0 ? _ref6 : 0
24495
- });
24496
- const onPaginationModelChange = model => {
24497
- if (propsOnPaginationModelChange) {
24498
- propsOnPaginationModelChange(model, undefined);
24530
+ 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);
24531
+ 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);
24532
+ const onPageChange = page => {
24533
+ if (propsOnPageChange) {
24534
+ propsOnPageChange(page, undefined);
24535
+ } else {
24536
+ setPage(page);
24537
+ }
24538
+ };
24539
+ useEffect(() => {
24540
+ if (propsPage || propsPage === 0) {
24541
+ setPage(propsPage);
24542
+ }
24543
+ }, [propsPage]);
24544
+ const onPageSizeChange = pageSize => {
24545
+ onPageChange(0);
24546
+ if (propsOnPageSizeChange) {
24547
+ propsOnPageSizeChange(pageSize, undefined);
24499
24548
  } else {
24500
- setPaginationModel(model);
24549
+ setPageSize(pageSize);
24501
24550
  }
24502
24551
  };
24503
24552
  useEffect(() => {
24504
- if (propsPaginationModel) {
24505
- setPaginationModel(propsPaginationModel);
24553
+ if (propsPageSize) {
24554
+ setPageSize(propsPageSize);
24506
24555
  }
24507
- }, [propsPaginationModel]);
24556
+ }, [propsPageSize]);
24508
24557
  if (!Array.isArray(rows)) {
24509
24558
  return null;
24510
24559
  }
@@ -24516,77 +24565,80 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24516
24565
  apiRef: apiRef,
24517
24566
  autoHeight: autoHeight,
24518
24567
  checkboxSelectionVisibleOnly: Boolean(pagination),
24519
- slots: _objectSpread2(_objectSpread2({
24520
- baseButton: BaseButton,
24521
- baseCheckbox: BaseCheckbox,
24522
- // baseTextField,
24523
- basePopper: BasePopper,
24524
- columnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24568
+ components: _objectSpread2(_objectSpread2({
24569
+ BaseButton,
24570
+ BaseCheckbox,
24571
+ // BaseTextField,
24572
+ BasePopper,
24573
+ ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24525
24574
  displayName: "ColumnFilteredIcon"
24526
24575
  })),
24527
- columnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24576
+ ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24528
24577
  displayName: "ColumnSelectorIcon"
24529
24578
  })),
24530
- columnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24579
+ ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24531
24580
  displayName: "ColumnSortedAscendingIcon"
24532
24581
  })),
24533
- columnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24582
+ ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24534
24583
  displayName: "ColumnSortedDescendingIcon"
24535
24584
  })),
24536
- densityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24585
+ DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24537
24586
  displayName: "DensityCompactIcon"
24538
24587
  })),
24539
- densityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24588
+ DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24540
24589
  displayName: "DensityStandardIcon"
24541
24590
  })),
24542
- densityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24591
+ DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24543
24592
  displayName: "DensityComfortableIcon"
24544
24593
  })),
24545
- detailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24594
+ DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24546
24595
  displayName: "DetailPanelCollapseIcon"
24547
24596
  })),
24548
- detailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24597
+ DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24549
24598
  displayName: "DetailPanelExpandIcon"
24550
24599
  })),
24551
- exportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24600
+ ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24552
24601
  displayName: "ExportIcon"
24553
24602
  })),
24554
- openFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
24603
+ OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
24555
24604
  displayName: "OpenFilterButtonIcon"
24556
24605
  }, props))
24557
- }, slots), {}, {
24558
- toolbar: props => {
24559
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !hideToolbar ? /*#__PURE__*/React__default.createElement(RenderedToolbar, _extends$2({}, props, {
24560
- filterModel: filterModel,
24561
- onFilterModelChange: onFilterModelChange
24562
- })) : null, pagination ? /*#__PURE__*/React__default.createElement(ControlledPagination, {
24563
- displaySelection: true,
24564
- displayRowsPerPage: false,
24565
- displayPagination: ['top', 'both'].includes(paginationPlacement),
24566
- selectionStatus: selectionStatus.current,
24567
- apiRef: apiRef,
24568
- isRowSelectable: isRowSelectable,
24569
- paginationModel: paginationModel,
24570
- onPaginationModelChange: onPaginationModelChange,
24571
- pageSizeOptions: pageSizeOptions,
24572
- paginationProps: paginationProps
24573
- }) : null);
24574
- },
24575
- pagination: props => pagination ? /*#__PURE__*/React__default.createElement(ControlledPagination, _extends$2({}, props, {
24606
+ }, components), {}, {
24607
+ Toolbar: Toolbar,
24608
+ Pagination: props => pagination ? /*#__PURE__*/React__default.createElement(ControlledPagination, _extends$2({}, props, {
24576
24609
  displaySelection: false,
24577
24610
  displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
24578
24611
  displayPagination: ['bottom', 'both'].includes(paginationPlacement),
24579
24612
  selectionStatus: selectionStatus.current,
24580
24613
  apiRef: apiRef,
24581
24614
  isRowSelectable: isRowSelectable,
24582
- paginationModel: paginationModel,
24583
- onPaginationModelChange: onPaginationModelChange,
24584
- pageSizeOptions: pageSizeOptions,
24615
+ page: page,
24616
+ onPageChange: onPageChange,
24617
+ pageSize: pageSize,
24618
+ onPageSizeChange: onPageSizeChange,
24619
+ rowsPerPageOptions: rowsPerPageOptions,
24585
24620
  paginationProps: paginationProps
24586
24621
  })) : null
24587
24622
  }),
24588
- slotProps: _objectSpread2(_objectSpread2({}, slotProps), {}, {
24589
- toolbar: _objectSpread2({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar)
24623
+ componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
24624
+ toolbar: _objectSpread2({
24625
+ hideToolbar,
24626
+ RenderedToolbar,
24627
+ filterModel,
24628
+ onFilterModelChange,
24629
+ pagination,
24630
+ ControlledPagination,
24631
+ paginationPlacement,
24632
+ selectionStatus,
24633
+ apiRef,
24634
+ isRowSelectable,
24635
+ page,
24636
+ onPageChange,
24637
+ pageSize,
24638
+ onPageSizeChange,
24639
+ rowsPerPageOptions,
24640
+ paginationProps
24641
+ }, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
24590
24642
  }),
24591
24643
  filterModel: filterModel,
24592
24644
  initialState: initialState,
@@ -24594,38 +24646,40 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24594
24646
  onFilterModelChange: onFilterModelChange,
24595
24647
  pagination: pagination,
24596
24648
  rows: rows,
24597
- pageSizeOptions: pageSizeOptions,
24598
- paginationModel: paginationModel,
24599
- onPaginationModelChange: onPaginationModelChange,
24600
- onRowSelectionModelChange: (newSelectionModel, details) => {
24649
+ rowsPerPageOptions: rowsPerPageOptions,
24650
+ page: page,
24651
+ onPageChange: onPageChange,
24652
+ pageSize: pageSize,
24653
+ onPageSizeChange: onPageSizeChange,
24654
+ onSelectionModelChange: (newSelectionModel, details) => {
24601
24655
  if (pagination) {
24602
- const selectableRowsInPage = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref7 => {
24656
+ const selectableRowsInPage = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref5 => {
24603
24657
  var _props$isRowSelectabl;
24604
24658
  let {
24605
24659
  model
24606
- } = _ref7;
24660
+ } = _ref5;
24607
24661
  return (_props$isRowSelectabl = props.isRowSelectable) === null || _props$isRowSelectabl === void 0 ? void 0 : _props$isRowSelectabl.call(props, {
24608
24662
  row: model
24609
24663
  });
24610
- }).map(_ref8 => {
24664
+ }).map(_ref6 => {
24611
24665
  let {
24612
24666
  id
24613
- } = _ref8;
24667
+ } = _ref6;
24614
24668
  return id;
24615
24669
  }) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
24616
24670
  const numberOfSelectableRowsInPage = selectableRowsInPage.length;
24617
- const selectableRowsInTable = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref9 => {
24671
+ const selectableRowsInTable = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref7 => {
24618
24672
  var _props$isRowSelectabl2;
24619
24673
  let {
24620
24674
  model
24621
- } = _ref9;
24675
+ } = _ref7;
24622
24676
  return (_props$isRowSelectabl2 = props.isRowSelectable) === null || _props$isRowSelectabl2 === void 0 ? void 0 : _props$isRowSelectabl2.call(props, {
24623
24677
  row: model
24624
24678
  });
24625
- }).map(_ref10 => {
24679
+ }).map(_ref8 => {
24626
24680
  let {
24627
24681
  id
24628
- } = _ref10;
24682
+ } = _ref8;
24629
24683
  return id;
24630
24684
  }) : gridFilteredSortedRowIdsSelector(apiRef);
24631
24685
  const numberOfSelectableRowsInTable = selectableRowsInTable.length;
@@ -24657,7 +24711,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24657
24711
  };
24658
24712
  }
24659
24713
  }
24660
- onRowSelectionModelChange === null || onRowSelectionModelChange === void 0 ? void 0 : onRowSelectionModelChange(newSelectionModel, details);
24714
+ onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
24661
24715
  },
24662
24716
  sx: _objectSpread2(_objectSpread2({}, sx), {}, {
24663
24717
  '.MuiDataGrid-columnHeaders': {
@@ -24732,5 +24786,5 @@ const TextCell = /*#__PURE__*/forwardRef((props, ref) => {
24732
24786
  TextCell.className = CLASSNAME;
24733
24787
  TextCell.displayName = COMPONENT_NAME;
24734
24788
 
24735
- export { CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DataGrid, ENDS_WITH_ANY_OF, GridToolbarFilterSemanticField, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, STARTS_WITH_ANY_OF, TextCell, Toolbar$2 as Toolbar, getCompletion, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators };
24789
+ export { CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DataGrid, ENDS_WITH_ANY_OF, GridToolbarFilterSemanticField, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, STARTS_WITH_ANY_OF, TextCell, Toolbar$3 as Toolbar, getCompletion, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators };
24736
24790
  //# sourceMappingURL=index.js.map