@redsift/table 9.4.1 → 9.5.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
 
@@ -86,12 +85,12 @@ type StyledDataGridProps = {
86
85
  declare const DataGrid: Comp<DataGridProps, HTMLDivElement>;
87
86
 
88
87
  interface CompletionResponseItem {
89
- field: string;
90
- operator: string;
88
+ columnField: string;
89
+ operatorValue: string;
91
90
  value?: string;
92
91
  }
93
92
  type CompletionResponse = {
94
- logicOperator: 'and' | 'or';
93
+ linkOperator: 'and' | 'or';
95
94
  items: CompletionResponseItem[];
96
95
  };
97
96
  interface LocaleText {
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';
@@ -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 => {
@@ -17647,7 +17646,7 @@ const getGridStringOperators = () => [...getGridStringOperators$1(), ...getGridS
17647
17646
 
17648
17647
  const API_URL = 'https://api.openai.com/v1/chat/completions';
17649
17648
  async function getCompletion(text, role, openai_api_key) {
17650
- let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-1106';
17649
+ let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-0613';
17651
17650
  try {
17652
17651
  const messages = [{
17653
17652
  role: 'system',
@@ -21694,10 +21693,10 @@ const COMPONENT_NAME$2 = 'GridToolbarFilterSemanticField';
21694
21693
  const CLASSNAME$2 = 'redsift-datagrid-toolbar-nlp-filter-field';
21695
21694
  const DEFAULT_PROPS$1 = {
21696
21695
  dateFormat: 'yyyy-mm-dd',
21697
- defaultModel: 'gpt-4-1106-preview',
21696
+ defaultModel: 'gpt-4-0613',
21698
21697
  defaultFilter: {
21699
21698
  items: [],
21700
- logicOperator: 'and'
21699
+ linkOperator: 'and'
21701
21700
  },
21702
21701
  disablePower: false,
21703
21702
  localeText: {
@@ -21738,16 +21737,16 @@ const getRole = (config, dateFormat) => {
21738
21737
  }).join('\n');
21739
21738
  return `The AI assistant parses user input to generate a JSON object that will be used as a row filter for a data table MUI Data Grid.
21740
21739
  The filter supports mulitple conditions using only two logical operator "and", "or". It only allows "and" between all conditions or "or" between all conditions. It can't mix the two types.
21741
- The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "logicOperator" and "items":
21742
- - "logicOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
21743
- - "items": a list of conditions, each is an object with exactly the three keys "field", "operator" and "value":
21744
- - "field": the column name, must be one of ${columns}
21740
+ The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "linkOperator" and "items":
21741
+ - "linkOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
21742
+ - "items": a list of conditions, each is an object with exactly the three keys "columnField", "operatorValue" and "value":
21743
+ - "columnField": the column name, must be one of ${columns}
21745
21744
  - "value":
21746
- - this can be skipped if the "operator" is either "isEmpty" or "isNotEmpty"
21747
- - a list of multiple values if the "operator" ends with "AnyOf"
21745
+ - this can be skipped if the "operatorValue" is either "isEmpty" or "isNotEmpty"
21746
+ - a list of multiple values if the "operatorValue" ends with "AnyOf"
21748
21747
  - otherwise, it's a single value represented as a string: "true" instead of true, "false" instead of false, "0.6" instead of 0.6.
21749
21748
  For "date" data type, use ${dateFormat}. If relative date is input, convert to the actual date given today is ${today}.
21750
- - "operator": the comparison operator, accepted values depend on the data type of the column
21749
+ - "operatorValue": the comparison operator, accepted values depend on the data type of the column
21751
21750
  ${operators}
21752
21751
 
21753
21752
  Below is the datatype in square bracket, constraints on the data range if any, followed by the description of each column used in the data table:
@@ -21859,8 +21858,8 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
21859
21858
  isLoading: isLoading
21860
21859
  }, buttonText)), !disablePower && /*#__PURE__*/React__default.createElement(Tooltip, null, /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, /*#__PURE__*/React__default.createElement(Switch, {
21861
21860
  width: "175px",
21862
- isSelected: modelRef.current === 'gpt-4-1106-preview',
21863
- onChange: value => modelRef.current = value ? 'gpt-4-1106-preview' : 'gpt-3.5-turbo-1106'
21861
+ isSelected: modelRef.current === 'gpt-4-0613',
21862
+ onChange: value => modelRef.current = value ? 'gpt-4-0613' : 'gpt-3.5-turbo-0613'
21864
21863
  }, powerText)), /*#__PURE__*/React__default.createElement(Tooltip.Content, null, powerTooltipContent))), showErrorRef.current && /*#__PURE__*/React__default.createElement(Text, {
21865
21864
  color: "error",
21866
21865
  marginLeft: "8px"
@@ -21916,7 +21915,7 @@ const Toolbar$3 = 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: {
@@ -24368,8 +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 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "ControlledPagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "paginationModel", "onPaginationModelChange", "pageSizeOptions", "paginationProps"],
24372
- _excluded2 = ["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"];
24373
24372
  const COMPONENT_NAME$1 = 'DataGrid';
24374
24373
  const CLASSNAME$1 = 'redsift-datagrid';
24375
24374
  const DEFAULT_PROPS = {
@@ -24398,9 +24397,11 @@ const ControlledPagination = _ref3 => {
24398
24397
  displayPagination = false,
24399
24398
  selectionStatus,
24400
24399
  apiRef,
24401
- paginationModel,
24402
- onPaginationModelChange,
24403
- pageSizeOptions,
24400
+ page,
24401
+ onPageChange,
24402
+ pageSize,
24403
+ onPageSizeChange,
24404
+ rowsPerPageOptions,
24404
24405
  isRowSelectable,
24405
24406
  paginationProps
24406
24407
  } = _ref3;
@@ -24430,17 +24431,13 @@ const ControlledPagination = _ref3 => {
24430
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({
24431
24432
  component: "div",
24432
24433
  count: numberOfFilteredRowsInTable,
24433
- page: paginationModel.page,
24434
- onPageChange: (event, page) => onPaginationModelChange({
24435
- page,
24436
- pageSize: paginationModel.pageSize
24437
- }),
24438
- rowsPerPage: paginationModel.pageSize,
24439
- onRowsPerPageChange: event => onPaginationModelChange({
24440
- page: paginationModel.page,
24441
- pageSize: parseInt(event.target.value, 10)
24442
- }),
24443
- 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 : []
24444
24441
  }, paginationProps)) : null);
24445
24442
  };
24446
24443
  const Toolbar = _ref4 => {
@@ -24455,9 +24452,11 @@ const Toolbar = _ref4 => {
24455
24452
  selectionStatus,
24456
24453
  apiRef,
24457
24454
  isRowSelectable,
24458
- paginationModel,
24459
- onPaginationModelChange,
24460
- pageSizeOptions,
24455
+ page,
24456
+ onPageChange,
24457
+ pageSize,
24458
+ onPageSizeChange,
24459
+ rowsPerPageOptions,
24461
24460
  paginationProps
24462
24461
  } = _ref4,
24463
24462
  forwardedProps = _objectWithoutProperties(_ref4, _excluded$1);
@@ -24471,21 +24470,23 @@ const Toolbar = _ref4 => {
24471
24470
  selectionStatus: selectionStatus.current,
24472
24471
  apiRef: apiRef,
24473
24472
  isRowSelectable: isRowSelectable,
24474
- paginationModel: paginationModel,
24475
- onPaginationModelChange: onPaginationModelChange,
24476
- pageSizeOptions: pageSizeOptions,
24473
+ page: page,
24474
+ onPageChange: onPageChange,
24475
+ pageSize: pageSize,
24476
+ onPageSizeChange: onPageSizeChange,
24477
+ rowsPerPageOptions: rowsPerPageOptions,
24477
24478
  paginationProps: paginationProps
24478
24479
  }) : null);
24479
24480
  };
24480
24481
  const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24481
- var _ref5, _ref6, _initialState$paginat, _initialState$paginat2, _initialState$paginat3, _pageSizeOptions$, _ref7, _initialState$paginat4, _initialState$paginat5, _initialState$paginat6;
24482
+ var _initialState$paginat, _initialState$paginat2;
24482
24483
  const datagridRef = ref || useRef();
24483
24484
  const {
24484
24485
  apiRef: propsApiRef,
24485
24486
  autoHeight,
24486
24487
  className,
24487
- slots,
24488
- slotProps,
24488
+ components,
24489
+ componentsProps,
24489
24490
  filterModel: propsFilterModel,
24490
24491
  height: propsHeight,
24491
24492
  hideToolbar,
@@ -24493,20 +24494,22 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24493
24494
  isRowSelectable,
24494
24495
  license,
24495
24496
  onFilterModelChange: propsOnFilterModelChange,
24496
- paginationModel: propsPaginationModel,
24497
- onPaginationModelChange: propsOnPaginationModelChange,
24498
- onRowSelectionModelChange,
24497
+ onPageChange: propsOnPageChange,
24498
+ onPageSizeChange: propsOnPageSizeChange,
24499
+ onSelectionModelChange,
24500
+ page: propsPage,
24501
+ pageSize: propsPageSize,
24499
24502
  pagination,
24500
24503
  paginationPlacement,
24501
24504
  paginationProps,
24502
24505
  rows,
24503
- pageSizeOptions,
24506
+ rowsPerPageOptions,
24504
24507
  sx
24505
24508
  } = props,
24506
24509
  forwardedProps = _objectWithoutProperties(props, _excluded2);
24507
24510
  const _apiRef = useGridApiRef();
24508
24511
  const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
24509
- const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$3;
24512
+ const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$3;
24510
24513
  LicenseInfo.setLicenseKey(license);
24511
24514
  const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
24512
24515
  const selectionStatus = useRef({
@@ -24524,22 +24527,33 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24524
24527
  setFilterModel(model);
24525
24528
  }
24526
24529
  };
24527
- const [paginationModel, setPaginationModel] = useState({
24528
- pageSize: (_ref5 = (_ref6 = (_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 && _ref6 !== void 0 ? _ref6 : 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 && _ref5 !== void 0 ? _ref5 : 100,
24529
- page: (_ref7 = (_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 && _ref7 !== void 0 ? _ref7 : 0
24530
- });
24531
- const onPaginationModelChange = model => {
24532
- if (propsOnPaginationModelChange) {
24533
- 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);
24534
24548
  } else {
24535
- setPaginationModel(model);
24549
+ setPageSize(pageSize);
24536
24550
  }
24537
24551
  };
24538
24552
  useEffect(() => {
24539
- if (propsPaginationModel) {
24540
- setPaginationModel(propsPaginationModel);
24553
+ if (propsPageSize) {
24554
+ setPageSize(propsPageSize);
24541
24555
  }
24542
- }, [propsPaginationModel]);
24556
+ }, [propsPageSize]);
24543
24557
  if (!Array.isArray(rows)) {
24544
24558
  return null;
24545
24559
  }
@@ -24551,60 +24565,62 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24551
24565
  apiRef: apiRef,
24552
24566
  autoHeight: autoHeight,
24553
24567
  checkboxSelectionVisibleOnly: Boolean(pagination),
24554
- slots: _objectSpread2(_objectSpread2({
24555
- baseButton: BaseButton,
24556
- baseCheckbox: BaseCheckbox,
24557
- // baseTextField,
24558
- basePopper: BasePopper,
24559
- 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, {
24560
24574
  displayName: "ColumnFilteredIcon"
24561
24575
  })),
24562
- columnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24576
+ ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24563
24577
  displayName: "ColumnSelectorIcon"
24564
24578
  })),
24565
- columnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24579
+ ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24566
24580
  displayName: "ColumnSortedAscendingIcon"
24567
24581
  })),
24568
- columnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24582
+ ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24569
24583
  displayName: "ColumnSortedDescendingIcon"
24570
24584
  })),
24571
- densityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24585
+ DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24572
24586
  displayName: "DensityCompactIcon"
24573
24587
  })),
24574
- densityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24588
+ DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24575
24589
  displayName: "DensityStandardIcon"
24576
24590
  })),
24577
- densityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24591
+ DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24578
24592
  displayName: "DensityComfortableIcon"
24579
24593
  })),
24580
- detailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24594
+ DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24581
24595
  displayName: "DetailPanelCollapseIcon"
24582
24596
  })),
24583
- detailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24597
+ DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24584
24598
  displayName: "DetailPanelExpandIcon"
24585
24599
  })),
24586
- exportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24600
+ ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24587
24601
  displayName: "ExportIcon"
24588
24602
  })),
24589
- openFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
24603
+ OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
24590
24604
  displayName: "OpenFilterButtonIcon"
24591
24605
  }, props))
24592
- }, slots), {}, {
24593
- toolbar: Toolbar,
24594
- 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, {
24595
24609
  displaySelection: false,
24596
24610
  displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
24597
24611
  displayPagination: ['bottom', 'both'].includes(paginationPlacement),
24598
24612
  selectionStatus: selectionStatus.current,
24599
24613
  apiRef: apiRef,
24600
24614
  isRowSelectable: isRowSelectable,
24601
- paginationModel: paginationModel,
24602
- onPaginationModelChange: onPaginationModelChange,
24603
- pageSizeOptions: pageSizeOptions,
24615
+ page: page,
24616
+ onPageChange: onPageChange,
24617
+ pageSize: pageSize,
24618
+ onPageSizeChange: onPageSizeChange,
24619
+ rowsPerPageOptions: rowsPerPageOptions,
24604
24620
  paginationProps: paginationProps
24605
24621
  })) : null
24606
24622
  }),
24607
- slotProps: _objectSpread2(_objectSpread2({}, slotProps), {}, {
24623
+ componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
24608
24624
  toolbar: _objectSpread2({
24609
24625
  hideToolbar,
24610
24626
  RenderedToolbar,
@@ -24616,11 +24632,13 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24616
24632
  selectionStatus,
24617
24633
  apiRef,
24618
24634
  isRowSelectable,
24619
- paginationModel,
24620
- onPaginationModelChange,
24621
- pageSizeOptions,
24635
+ page,
24636
+ onPageChange,
24637
+ pageSize,
24638
+ onPageSizeChange,
24639
+ rowsPerPageOptions,
24622
24640
  paginationProps
24623
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar)
24641
+ }, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
24624
24642
  }),
24625
24643
  filterModel: filterModel,
24626
24644
  initialState: initialState,
@@ -24628,38 +24646,40 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24628
24646
  onFilterModelChange: onFilterModelChange,
24629
24647
  pagination: pagination,
24630
24648
  rows: rows,
24631
- pageSizeOptions: pageSizeOptions,
24632
- paginationModel: paginationModel,
24633
- onPaginationModelChange: onPaginationModelChange,
24634
- onRowSelectionModelChange: (newSelectionModel, details) => {
24649
+ rowsPerPageOptions: rowsPerPageOptions,
24650
+ page: page,
24651
+ onPageChange: onPageChange,
24652
+ pageSize: pageSize,
24653
+ onPageSizeChange: onPageSizeChange,
24654
+ onSelectionModelChange: (newSelectionModel, details) => {
24635
24655
  if (pagination) {
24636
- const selectableRowsInPage = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref8 => {
24656
+ const selectableRowsInPage = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref5 => {
24637
24657
  var _props$isRowSelectabl;
24638
24658
  let {
24639
24659
  model
24640
- } = _ref8;
24660
+ } = _ref5;
24641
24661
  return (_props$isRowSelectabl = props.isRowSelectable) === null || _props$isRowSelectabl === void 0 ? void 0 : _props$isRowSelectabl.call(props, {
24642
24662
  row: model
24643
24663
  });
24644
- }).map(_ref9 => {
24664
+ }).map(_ref6 => {
24645
24665
  let {
24646
24666
  id
24647
- } = _ref9;
24667
+ } = _ref6;
24648
24668
  return id;
24649
24669
  }) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
24650
24670
  const numberOfSelectableRowsInPage = selectableRowsInPage.length;
24651
- const selectableRowsInTable = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref10 => {
24671
+ const selectableRowsInTable = props.isRowSelectable && typeof props.isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref7 => {
24652
24672
  var _props$isRowSelectabl2;
24653
24673
  let {
24654
24674
  model
24655
- } = _ref10;
24675
+ } = _ref7;
24656
24676
  return (_props$isRowSelectabl2 = props.isRowSelectable) === null || _props$isRowSelectabl2 === void 0 ? void 0 : _props$isRowSelectabl2.call(props, {
24657
24677
  row: model
24658
24678
  });
24659
- }).map(_ref11 => {
24679
+ }).map(_ref8 => {
24660
24680
  let {
24661
24681
  id
24662
- } = _ref11;
24682
+ } = _ref8;
24663
24683
  return id;
24664
24684
  }) : gridFilteredSortedRowIdsSelector(apiRef);
24665
24685
  const numberOfSelectableRowsInTable = selectableRowsInTable.length;
@@ -24691,7 +24711,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24691
24711
  };
24692
24712
  }
24693
24713
  }
24694
- onRowSelectionModelChange === null || onRowSelectionModelChange === void 0 ? void 0 : onRowSelectionModelChange(newSelectionModel, details);
24714
+ onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
24695
24715
  },
24696
24716
  sx: _objectSpread2(_objectSpread2({}, sx), {}, {
24697
24717
  '.MuiDataGrid-columnHeaders': {