@redsift/table 11.0.0-alpha.0 → 11.0.0-muiv5-alpha.0

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.js CHANGED
@@ -1,5 +1,4 @@
1
- import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputValue, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, GridLogicOperator, GRID_CHECKBOX_SELECTION_COL_DEF, useGridApiRef, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, DataGridPro } 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, GridFilterInputValue, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridVisibleSortedRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, GridLinkOperator, GRID_CHECKBOX_SELECTION_COL_DEF, useGridApiRef, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, DataGridPro } 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, useContext, useState, useCallback, createElement, useMemo } from 'react';
@@ -17640,7 +17639,7 @@ const isBetweenOperator = {
17640
17639
  label: 'is between',
17641
17640
  value: 'isBetween',
17642
17641
  getApplyFilterFn: filterItem => {
17643
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17642
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17644
17643
  return null;
17645
17644
  }
17646
17645
  if (!Array.isArray(filterItem.value) || filterItem.value.length !== 2) {
@@ -17653,7 +17652,7 @@ const isBetweenOperator = {
17653
17652
  return null;
17654
17653
  }
17655
17654
  return params => {
17656
- return params.value !== null && params.value !== undefined && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
17655
+ return params.value !== null && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
17657
17656
  };
17658
17657
  },
17659
17658
  InputComponent: InputNumberInterval
@@ -17666,7 +17665,7 @@ const doesNotEqual = {
17666
17665
  label: 'does not equal',
17667
17666
  value: 'doesNotEqual',
17668
17667
  getApplyFilterFn: filterItem => {
17669
- if (!filterItem.field || !filterItem.value || !filterItem.value) {
17668
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17670
17669
  return null;
17671
17670
  }
17672
17671
  return params => {
@@ -17687,7 +17686,7 @@ const doesNotContain = {
17687
17686
  label: 'does not contain',
17688
17687
  value: 'doesNotContain',
17689
17688
  getApplyFilterFn: filterItem => {
17690
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17689
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17691
17690
  return null;
17692
17691
  }
17693
17692
  return params => {
@@ -17708,7 +17707,7 @@ const containsAnyOfOperator = {
17708
17707
  label: 'contains any of',
17709
17708
  value: 'containsAnyOf',
17710
17709
  getApplyFilterFn: filterItem => {
17711
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17710
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17712
17711
  return null;
17713
17712
  }
17714
17713
  return params => {
@@ -17731,7 +17730,7 @@ const containsAnyOfCIOperator = {
17731
17730
  label: 'contains any of (case insensitive)',
17732
17731
  value: 'containsAnyOf',
17733
17732
  getApplyFilterFn: filterItem => {
17734
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17733
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17735
17734
  return null;
17736
17735
  }
17737
17736
  return params => {
@@ -17758,7 +17757,7 @@ const endsWithAnyOfOperator = {
17758
17757
  label: 'ends with any of',
17759
17758
  value: 'endsWithAnyOf',
17760
17759
  getApplyFilterFn: filterItem => {
17761
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17760
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17762
17761
  return null;
17763
17762
  }
17764
17763
  return params => {
@@ -17785,7 +17784,7 @@ const isAnyOfOperator = {
17785
17784
  label: 'is any of',
17786
17785
  value: 'isAnyOf',
17787
17786
  getApplyFilterFn: filterItem => {
17788
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17787
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17789
17788
  return null;
17790
17789
  }
17791
17790
  return params => {
@@ -17809,7 +17808,7 @@ const isNotAnyOfOperator = {
17809
17808
  label: 'is not any of',
17810
17809
  value: 'isNotAnyOf',
17811
17810
  getApplyFilterFn: filterItem => {
17812
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17811
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17813
17812
  return null;
17814
17813
  }
17815
17814
  return params => {
@@ -17833,7 +17832,7 @@ const startsWithAnyOfOperator = {
17833
17832
  label: 'starts with any of',
17834
17833
  value: 'startsWithAnyOf',
17835
17834
  getApplyFilterFn: filterItem => {
17836
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17835
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17837
17836
  return null;
17838
17837
  }
17839
17838
  return params => {
@@ -17878,7 +17877,7 @@ const operatorList = {
17878
17877
 
17879
17878
  const API_URL = 'https://api.openai.com/v1/chat/completions';
17880
17879
  async function getCompletion(text, role, openai_api_key) {
17881
- let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-1106';
17880
+ let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-0613';
17882
17881
  try {
17883
17882
  const messages = [{
17884
17883
  role: 'system',
@@ -22010,16 +22009,16 @@ const getRole = (config, dateFormat) => {
22010
22009
  }).join('\n');
22011
22010
  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.
22012
22011
  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.
22013
- The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "logicOperator" and "items":
22014
- - "logicOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
22015
- - "items": a list of conditions, each is an object with exactly the three keys "field", "operator" and "value":
22016
- - "field": the column name, must be one of ${columns}
22012
+ The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "linkOperator" and "items":
22013
+ - "linkOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
22014
+ - "items": a list of conditions, each is an object with exactly the three keys "columnField", "operatorValue" and "value":
22015
+ - "columnField": the column name, must be one of ${columns}
22017
22016
  - "value":
22018
- - this can be skipped if the "operator" is either "isEmpty" or "isNotEmpty"
22019
- - a list of multiple values if the "operator" ends with "AnyOf"
22017
+ - this can be skipped if the "operatorValue" is either "isEmpty" or "isNotEmpty"
22018
+ - a list of multiple values if the "operatorValue" ends with "AnyOf"
22020
22019
  - otherwise, it's a single value represented as a string: "true" instead of true, "false" instead of false, "0.6" instead of 0.6.
22021
22020
  For "date" data type, use ${dateFormat}. If relative date is input, convert to the actual date given today is ${today}.
22022
- - "operator": the comparison operator, accepted values depend on the data type of the column
22021
+ - "operatorValue": the comparison operator, accepted values depend on the data type of the column
22023
22022
  ${operators}
22024
22023
 
22025
22024
  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:
@@ -22056,10 +22055,10 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
22056
22055
  nlpFilterConfig,
22057
22056
  onFilterModelChange,
22058
22057
  dateFormat = 'yyyy-mm-dd',
22059
- defaultModel = 'gpt-4-1106-preview',
22058
+ defaultModel = 'gpt-4-0613',
22060
22059
  defaultFilter = {
22061
22060
  items: [],
22062
- logicOperator: 'and'
22061
+ linkOperator: 'and'
22063
22062
  },
22064
22063
  disablePower = false,
22065
22064
  localeText
@@ -22137,7 +22136,7 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
22137
22136
  value: prompt
22138
22137
  }), /*#__PURE__*/React__default.createElement(Button, {
22139
22138
  variant: "primary",
22140
- "aria-label": buttonAriaLabel,
22139
+ "aira-label": buttonAriaLabel,
22141
22140
  type: "submit",
22142
22141
  isLoading: isLoading
22143
22142
  }, buttonText)), !disablePower && /*#__PURE__*/React__default.createElement(Tooltip, null, /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, /*#__PURE__*/React__default.createElement(Switch, {
@@ -22198,7 +22197,7 @@ const Toolbar$2 = props => {
22198
22197
  let {
22199
22198
  apiRef
22200
22199
  } = _ref;
22201
- return gridExpandedSortedRowIdsSelector(apiRef);
22200
+ return gridVisibleSortedRowIdsSelector(apiRef);
22202
22201
  }
22203
22202
  },
22204
22203
  printOptions: {
@@ -22492,6 +22491,23 @@ const BasePopper = /*#__PURE__*/forwardRef((props, ref) => {
22492
22491
  }));
22493
22492
  });
22494
22493
 
22494
+ const getRsStringColumnType = () => {
22495
+ return {
22496
+ extendType: 'string',
22497
+ filterOperators: operatorList.rsString
22498
+ };
22499
+ };
22500
+ const getRsNumberColumnType = () => {
22501
+ return {
22502
+ extendType: 'number',
22503
+ filterOperators: operatorList.rsNumber
22504
+ };
22505
+ };
22506
+ const customColumnTypes = {
22507
+ rsString: getRsStringColumnType(),
22508
+ rsNumber: getRsNumberColumnType()
22509
+ };
22510
+
22495
22511
  function Ripple(props) {
22496
22512
  const {
22497
22513
  className,
@@ -24655,10 +24671,12 @@ const ServerSideControlledPagination = _ref => {
24655
24671
  selectionStatus,
24656
24672
  displaySelection,
24657
24673
  displayPagination,
24658
- paginationModel,
24659
- onPaginationModelChange,
24660
- pageSizeOptions,
24674
+ page,
24675
+ onPageChange,
24676
+ pageSize,
24677
+ onPageSizeChange,
24661
24678
  displayRowsPerPage,
24679
+ rowsPerPageOptions,
24662
24680
  paginationProps,
24663
24681
  rowCount
24664
24682
  } = _ref;
@@ -24677,17 +24695,13 @@ const ServerSideControlledPagination = _ref => {
24677
24695
  }, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
24678
24696
  component: "div",
24679
24697
  count: totalNumberOfRowsInTable,
24680
- page: paginationModel.page,
24681
- onPageChange: (event, page) => onPaginationModelChange({
24682
- page,
24683
- pageSize: paginationModel.pageSize
24684
- }),
24685
- rowsPerPage: paginationModel.pageSize,
24686
- onRowsPerPageChange: event => onPaginationModelChange({
24687
- page: paginationModel.page,
24688
- pageSize: parseInt(event.target.value, 10)
24689
- }),
24690
- rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
24698
+ page: page,
24699
+ onPageChange: (event, newPage) => onPageChange(newPage),
24700
+ rowsPerPage: pageSize,
24701
+ onRowsPerPageChange: event => {
24702
+ onPageSizeChange(parseInt(event.target.value, 10));
24703
+ },
24704
+ rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
24691
24705
  }, paginationProps)) : null);
24692
24706
  };
24693
24707
 
@@ -24713,9 +24727,11 @@ const ControlledPagination = _ref3 => {
24713
24727
  displayPagination = false,
24714
24728
  selectionStatus,
24715
24729
  apiRef,
24716
- paginationModel,
24717
- onPaginationModelChange,
24718
- pageSizeOptions,
24730
+ page,
24731
+ onPageChange,
24732
+ pageSize,
24733
+ onPageSizeChange,
24734
+ rowsPerPageOptions,
24719
24735
  isRowSelectable,
24720
24736
  paginationProps
24721
24737
  } = _ref3;
@@ -24745,21 +24761,17 @@ const ControlledPagination = _ref3 => {
24745
24761
  }, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
24746
24762
  component: "div",
24747
24763
  count: numberOfFilteredRowsInTable,
24748
- page: paginationModel.page,
24749
- onPageChange: (event, page) => onPaginationModelChange({
24750
- page,
24751
- pageSize: paginationModel.pageSize
24752
- }),
24753
- rowsPerPage: paginationModel.pageSize,
24754
- onRowsPerPageChange: event => onPaginationModelChange({
24755
- page: paginationModel.page,
24756
- pageSize: parseInt(event.target.value, 10)
24757
- }),
24758
- rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
24764
+ page: page,
24765
+ onPageChange: (event, newPage) => onPageChange(newPage),
24766
+ rowsPerPage: pageSize,
24767
+ onRowsPerPageChange: event => {
24768
+ onPageSizeChange(parseInt(event.target.value, 10));
24769
+ },
24770
+ rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
24759
24771
  }, paginationProps)) : null);
24760
24772
  };
24761
24773
 
24762
- const _excluded$2 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "paginationModel", "onPaginationModelChange", "pageSizeOptions", "paginationProps", "paginationMode", "rowCount"];
24774
+ const _excluded$2 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "page", "onPageChange", "pageSize", "onPageSizeChange", "rowsPerPageOptions", "paginationProps", "paginationMode", "rowCount"];
24763
24775
  const ToolbarWrapper = _ref => {
24764
24776
  let {
24765
24777
  hideToolbar,
@@ -24771,9 +24783,11 @@ const ToolbarWrapper = _ref => {
24771
24783
  selectionStatus,
24772
24784
  apiRef,
24773
24785
  isRowSelectable,
24774
- paginationModel,
24775
- onPaginationModelChange,
24776
- pageSizeOptions,
24786
+ page,
24787
+ onPageChange,
24788
+ pageSize,
24789
+ onPageSizeChange,
24790
+ rowsPerPageOptions,
24777
24791
  paginationProps,
24778
24792
  paginationMode = 'client',
24779
24793
  rowCount
@@ -24787,9 +24801,11 @@ const ToolbarWrapper = _ref => {
24787
24801
  displayRowsPerPage: false,
24788
24802
  displayPagination: ['top', 'both'].includes(paginationPlacement),
24789
24803
  selectionStatus: selectionStatus.current,
24790
- paginationModel: paginationModel,
24791
- onPaginationModelChange: onPaginationModelChange,
24792
- pageSizeOptions: pageSizeOptions,
24804
+ page: page,
24805
+ onPageChange: onPageChange,
24806
+ pageSize: pageSize,
24807
+ onPageSizeChange: onPageSizeChange,
24808
+ rowsPerPageOptions: rowsPerPageOptions,
24793
24809
  paginationProps: paginationProps,
24794
24810
  rowCount: rowCount
24795
24811
  }) : /*#__PURE__*/React__default.createElement(ControlledPagination, {
@@ -24799,9 +24815,11 @@ const ToolbarWrapper = _ref => {
24799
24815
  selectionStatus: selectionStatus.current,
24800
24816
  apiRef: apiRef,
24801
24817
  isRowSelectable: isRowSelectable,
24802
- paginationModel: paginationModel,
24803
- onPaginationModelChange: onPaginationModelChange,
24804
- pageSizeOptions: pageSizeOptions,
24818
+ page: page,
24819
+ onPageChange: onPageChange,
24820
+ pageSize: pageSize,
24821
+ onPageSizeChange: onPageSizeChange,
24822
+ rowsPerPageOptions: rowsPerPageOptions,
24805
24823
  paginationProps: paginationProps
24806
24824
  }) : null);
24807
24825
  };
@@ -25030,8 +25048,8 @@ const encodeValue = value => {
25030
25048
  const castedValue = String(value);
25031
25049
  return castedValue.replace(/\s|&|=|\?|\[|\]/g, encoded => ENCODER[encoded]);
25032
25050
  };
25033
- const isOperatorValueValid = (field, operator, columns) => {
25034
- const column = columns.find(column => column.field === field);
25051
+ const isOperatorValueValid = (columnField, operatorValue, columns) => {
25052
+ const column = columns.find(column => column.field === columnField);
25035
25053
  if (!column) {
25036
25054
  return false;
25037
25055
  }
@@ -25041,13 +25059,13 @@ const isOperatorValueValid = (field, operator, columns) => {
25041
25059
  return false;
25042
25060
  }
25043
25061
  if ('filterOperators' in operators) {
25044
- return !!operators.filterOperators.find(op => op['value'] === operator);
25062
+ return !!operators.filterOperators.find(op => op['value'] === operatorValue);
25045
25063
  }
25046
- return !!operators.find(op => op['value'] === operator);
25064
+ return !!operators.find(op => op['value'] === operatorValue);
25047
25065
  };
25048
25066
 
25049
25067
  // Check if the value doesn't break
25050
- const isValueValid = (value, field, columns, operator) => {
25068
+ const isValueValid = (value, columnField, columns, operatorValue) => {
25051
25069
  var _column$type;
25052
25070
  // every field accepts undefined as value for default
25053
25071
  if (value === undefined) {
@@ -25056,15 +25074,15 @@ const isValueValid = (value, field, columns, operator) => {
25056
25074
 
25057
25075
  // isAnyOf accepts as value only lists, and we are declearing them in the
25058
25076
  // URL as `list=[...]`
25059
- if (operator === 'isAnyOf') {
25077
+ if (operatorValue === 'isAnyOf') {
25060
25078
  return Array.isArray(value);
25061
25079
  }
25062
25080
 
25063
25081
  // We are accepting arrays only if they are of the 'isAnyOf' type
25064
- if (Array.isArray(value) && operator !== 'isAnyOf') {
25082
+ if (Array.isArray(value) && operatorValue !== 'isAnyOf') {
25065
25083
  return false;
25066
25084
  }
25067
- const column = columns.find(column => column.field === field);
25085
+ const column = columns.find(column => column.field === columnField);
25068
25086
  if (!column) {
25069
25087
  return false;
25070
25088
  }
@@ -25100,17 +25118,17 @@ const getFilterModelFromString = (searchString, columns) => {
25100
25118
  if (!searchString) {
25101
25119
  return {
25102
25120
  items: [],
25103
- logicOperator: GridLogicOperator.And
25121
+ linkOperator: GridLinkOperator.And
25104
25122
  };
25105
25123
  }
25106
- let logicOperator = GridLogicOperator.And;
25124
+ let linkOperator = GridLinkOperator.And;
25107
25125
  const searchParams = new URLSearchParams();
25108
25126
  for (const [key, value] of new URLSearchParams(searchString)) {
25109
25127
  if (key.startsWith('_') && !['_logicOperator', '_sortColumn', '_pinnedColumnsLeft', '_pinnedColumnsRight', '_columnVisibility'].includes(key)) {
25110
25128
  searchParams.set(key, value);
25111
25129
  }
25112
25130
  if (key === '_logicOperator') {
25113
- logicOperator = value;
25131
+ linkOperator = value;
25114
25132
  }
25115
25133
  }
25116
25134
  let id = 5000;
@@ -25143,8 +25161,8 @@ const getFilterModelFromString = (searchString, columns) => {
25143
25161
  return;
25144
25162
  }
25145
25163
  items.push({
25146
- field,
25147
- operator,
25164
+ columnField: field,
25165
+ operatorValue: operator,
25148
25166
  id,
25149
25167
  value: decodedValue
25150
25168
  });
@@ -25156,24 +25174,24 @@ const getFilterModelFromString = (searchString, columns) => {
25156
25174
  if (isInvalid) {
25157
25175
  return {
25158
25176
  items: [],
25159
- logicOperator: GridLogicOperator.And
25177
+ linkOperator: GridLinkOperator.And
25160
25178
  };
25161
25179
  }
25162
25180
  return {
25163
25181
  items,
25164
- logicOperator
25182
+ linkOperator
25165
25183
  };
25166
25184
  };
25167
25185
  const getSearchParamsFromFilterModel = filterModel => {
25168
25186
  const searchParams = new URLSearchParams();
25169
- searchParams.set('_logicOperator', filterModel['logicOperator'] || '');
25187
+ searchParams.set('_logicOperator', filterModel['linkOperator'] || '');
25170
25188
  filterModel['items'].forEach(item => {
25171
25189
  const {
25172
- field,
25173
- operator,
25190
+ columnField,
25191
+ operatorValue,
25174
25192
  value
25175
25193
  } = item;
25176
- searchParams.set(`_${field}[${encodeValue(operator)}]`, encodeValue(value));
25194
+ searchParams.set(`_${columnField}[${encodeValue(operatorValue)}]`, encodeValue(value));
25177
25195
  });
25178
25196
  return searchParams;
25179
25197
  };
@@ -25197,7 +25215,7 @@ const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFil
25197
25215
  }
25198
25216
  return {
25199
25217
  items: [],
25200
- logicOperator: GridLogicOperator.And
25218
+ linkOperator: GridLinkOperator.And
25201
25219
  };
25202
25220
  };
25203
25221
  const getSortingFromString = (notParsed, columns) => {
@@ -25220,9 +25238,9 @@ const getSortingFromString = (notParsed, columns) => {
25220
25238
  if (value === '') {
25221
25239
  return [];
25222
25240
  }
25223
- const fields = columns.map(column => column.field);
25241
+ const columnFields = columns.map(column => column.field);
25224
25242
  const [column, order] = value.split(',');
25225
- if (fields.includes(column) && (order === 'asc' || order === 'desc')) {
25243
+ if (columnFields.includes(column) && (order === 'asc' || order === 'desc')) {
25226
25244
  return [{
25227
25245
  field: column,
25228
25246
  sort: order
@@ -25261,11 +25279,11 @@ const getSortModel = (search, columns, localStorageSorting, setLocalStorageSorti
25261
25279
  };
25262
25280
  const getSearchParamsFromColumnVisibility = (columnVisibility, columns) => {
25263
25281
  const searchParams = new URLSearchParams();
25264
- const fields = columns.map(column => column.field);
25282
+ const columnFields = columns.map(column => column.field);
25265
25283
 
25266
25284
  // if column visibility model is empty, show all columns
25267
25285
  if (Object.keys(columnVisibility).length == 0) {
25268
- searchParams.set('_columnVisibility', `[${fields.join(',')}]`);
25286
+ searchParams.set('_columnVisibility', `[${columnFields.join(',')}]`);
25269
25287
  return searchParams;
25270
25288
  }
25271
25289
  const finalColumnVisibility = columns.filter(c => {
@@ -25315,12 +25333,12 @@ const getColumnVisibilityFromString = (notParsed, tableColumns) => {
25315
25333
  continue;
25316
25334
  }
25317
25335
  exist = true;
25318
- const fields = tableColumns.map(column => column.field);
25336
+ const columnFields = tableColumns.map(column => column.field);
25319
25337
  // TODO: Add validation that , is present
25320
25338
  const columns = encodedValues.split(',').map(value => decodeValue(value));
25321
25339
 
25322
25340
  // for each column, check if it's visible and add it to visibility model
25323
- for (const column of fields) {
25341
+ for (const column of columnFields) {
25324
25342
  const isColumnVisible = columns.includes(column);
25325
25343
  visibility[column] = isColumnVisible;
25326
25344
  if (isColumnVisible) {
@@ -25383,8 +25401,8 @@ const getPinnedColumnsFromString = (notParsed, tableColumns) => {
25383
25401
  if (typeof encodedValues !== 'string') {
25384
25402
  continue;
25385
25403
  }
25386
- const fields = [...tableColumns.map(column => column.field), '__check__'];
25387
- const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' && fields.includes(val));
25404
+ const columnFields = [...tableColumns.map(column => column.field), '__check__'];
25405
+ const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' && columnFields.includes(val));
25388
25406
  if (fieldURL === '_pinnedColumnsLeft') {
25389
25407
  pinnedColumns['left'] = columns;
25390
25408
  }
@@ -25528,7 +25546,8 @@ const useStatefulTable = props => {
25528
25546
  onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
25529
25547
  onColumnWidthChange: propsOnColumnWidthChange,
25530
25548
  onFilterModelChange: propsOnFilterModelChange,
25531
- onPaginationModelChange: propsOnPaginationModelChange,
25549
+ onPageChange: propsOnPageChange,
25550
+ onPageSizeChange: propsOnPageSizeChange,
25532
25551
  onPinnedColumnsChange: propsOnPinnedColumnsChange,
25533
25552
  onSortModelChange: propsOnSortModelChange,
25534
25553
  pinnedCustomColumns = {
@@ -25629,10 +25648,21 @@ const useStatefulTable = props => {
25629
25648
  }, search, historyReplace, columns);
25630
25649
  },
25631
25650
  pinnedColumns: pinnedColumnsModel,
25632
- paginationModel,
25633
- onPaginationModelChange: (model, details) => {
25634
- propsOnPaginationModelChange === null || propsOnPaginationModelChange === void 0 ? void 0 : propsOnPaginationModelChange(model, details);
25635
- setPaginationModel(model);
25651
+ page: paginationModel.page,
25652
+ pageSize: paginationModel.pageSize,
25653
+ onPageChange: (page, details) => {
25654
+ propsOnPageChange === null || propsOnPageChange === void 0 ? void 0 : propsOnPageChange(page, details);
25655
+ setPaginationModel({
25656
+ page,
25657
+ pageSize: paginationModel.pageSize
25658
+ });
25659
+ },
25660
+ onPageSizeChange: (pageSize, details) => {
25661
+ propsOnPageSizeChange === null || propsOnPageSizeChange === void 0 ? void 0 : propsOnPageSizeChange(pageSize, details);
25662
+ setPaginationModel({
25663
+ page: paginationModel.page,
25664
+ pageSize
25665
+ });
25636
25666
  },
25637
25667
  columnVisibilityModel: visibilityModel,
25638
25668
  onColumnVisibilityModelChange: (columnsVisibilityModel, details) => {
@@ -25654,8 +25684,8 @@ const useStatefulTable = props => {
25654
25684
  };
25655
25685
  };
25656
25686
 
25657
- const _excluded$1 = ["apiRef", "columns", "onColumnVisibilityModelChange", "onColumnWidthChange", "onFilterModelChange", "onPaginationModelChange", "onPinnedColumnsChange", "onSortModelChange", "pinnedCustomColumns", "rows", "useRouter"],
25658
- _excluded2 = ["apiRef", "autoHeight", "className", "slots", "slotProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "height", "hideToolbar", "initialState", "isRowSelectable", "isStateful", "license", "onFilterModelChange", "rowSelectionModel", "paginationModel", "onPaginationModelChange", "onRowSelectionModelChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "pagination", "paginationPlacement", "paginationProps", "pinnedCustomColumns", "rows", "pageSizeOptions", "sx", "theme", "useRouter", "paginationMode", "rowCount"];
25687
+ const _excluded$1 = ["apiRef", "columns", "onColumnVisibilityModelChange", "onColumnWidthChange", "onFilterModelChange", "onPageChange", "onPageSizeChange", "onPinnedColumnsChange", "onSortModelChange", "pinnedCustomColumns", "rows", "useRouter"],
25688
+ _excluded2 = ["apiRef", "autoHeight", "className", "columnTypes", "components", "componentsProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "height", "hideToolbar", "initialState", "isRowSelectable", "isStateful", "license", "onFilterModelChange", "onPageChange", "onPageSizeChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "selectionModel", "onSelectionModelChange", "page", "pageSize", "pagination", "paginationPlacement", "paginationProps", "pinnedCustomColumns", "rows", "rowsPerPageOptions", "sx", "theme", "useRouter", "paginationMode", "rowCount"];
25659
25689
  const COMPONENT_NAME$1 = 'DataGrid';
25660
25690
  const CLASSNAME$1 = 'redsift-datagrid';
25661
25691
  const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionStatus, isRowSelectable, page, pageSize) => {
@@ -25721,7 +25751,8 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25721
25751
  onColumnVisibilityModelChange,
25722
25752
  onColumnWidthChange,
25723
25753
  onFilterModelChange,
25724
- onPaginationModelChange,
25754
+ onPageChange,
25755
+ onPageSizeChange,
25725
25756
  onPinnedColumnsChange,
25726
25757
  onSortModelChange,
25727
25758
  pinnedCustomColumns,
@@ -25735,7 +25766,8 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25735
25766
  onFilterModelChange,
25736
25767
  onPinnedColumnsChange,
25737
25768
  onSortModelChange,
25738
- onPaginationModelChange,
25769
+ onPageChange,
25770
+ onPageSizeChange,
25739
25771
  onColumnVisibilityModelChange,
25740
25772
  onColumnWidthChange,
25741
25773
  pinnedCustomColumns,
@@ -25747,14 +25779,15 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25747
25779
  }, forwardedProps, statefulTableProps));
25748
25780
  });
25749
25781
  const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25750
- var _ref3, _ref4, _initialState$paginat, _initialState$paginat2, _initialState$paginat3, _pageSizeOptions$, _ref5, _initialState$paginat4, _initialState$paginat5, _initialState$paginat6;
25782
+ var _initialState$paginat, _initialState$paginat2;
25751
25783
  const datagridRef = ref || useRef();
25752
25784
  const {
25753
25785
  apiRef: propsApiRef,
25754
25786
  autoHeight,
25755
25787
  className,
25756
- slots,
25757
- slotProps,
25788
+ columnTypes: propsColumnTypes,
25789
+ components,
25790
+ componentsProps,
25758
25791
  filterModel: propsFilterModel,
25759
25792
  columnVisibilityModel: propsColumnVisibilityModel,
25760
25793
  pinnedColumns: propsPinnedColumns,
@@ -25766,19 +25799,21 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25766
25799
  isStateful: propsIsStateful,
25767
25800
  license = process.env.MUI_LICENSE_KEY,
25768
25801
  onFilterModelChange: propsOnFilterModelChange,
25769
- rowSelectionModel: propsSelectionModel,
25770
- paginationModel: propsPaginationModel,
25771
- onPaginationModelChange: propsOnPaginationModelChange,
25772
- onRowSelectionModelChange,
25802
+ onPageChange: propsOnPageChange,
25803
+ onPageSizeChange: propsOnPageSizeChange,
25773
25804
  onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
25774
25805
  onPinnedColumnsChange: propsOnPinnedColumnsChange,
25775
25806
  onSortModelChange: propsOnSortModelChange,
25807
+ selectionModel: propsSelectionModel,
25808
+ onSelectionModelChange,
25809
+ page: propsPage,
25810
+ pageSize: propsPageSize,
25776
25811
  pagination,
25777
25812
  paginationPlacement = 'both',
25778
25813
  paginationProps,
25779
25814
  pinnedCustomColumns,
25780
25815
  rows,
25781
- pageSizeOptions,
25816
+ rowsPerPageOptions,
25782
25817
  sx,
25783
25818
  theme: propsTheme,
25784
25819
  useRouter,
@@ -25789,7 +25824,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25789
25824
  const theme = useTheme$4(propsTheme);
25790
25825
  const _apiRef = useGridApiRef();
25791
25826
  const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
25792
- const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$2;
25827
+ const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$2;
25793
25828
  LicenseInfo.setLicenseKey(license);
25794
25829
  const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
25795
25830
  const [filterModel, setFilterModel] = useState(propsFilterModel);
@@ -25836,41 +25871,52 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25836
25871
  setSortModel(model);
25837
25872
  }
25838
25873
  };
25839
- const [rowSelectionModel, setRowSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
25874
+ const [selectionModel, setSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
25840
25875
  useEffect(() => {
25841
- setRowSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
25876
+ setSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
25842
25877
  }, [propsSelectionModel]);
25843
- const [paginationModel, setPaginationModel] = useState({
25844
- pageSize: (_ref3 = (_ref4 = (_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 && _ref4 !== void 0 ? _ref4 : 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 && _ref3 !== void 0 ? _ref3 : 100,
25845
- page: (_ref5 = (_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 && _ref5 !== void 0 ? _ref5 : 0
25878
+ 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);
25879
+ 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);
25880
+ const selectionStatus = useRef({
25881
+ type: 'none',
25882
+ numberOfSelectedRows: 0,
25883
+ numberOfSelectedRowsInPage: 0,
25884
+ page,
25885
+ pageSize
25846
25886
  });
25847
- const onPaginationModelChange = model => {
25848
- if (propsOnPaginationModelChange) {
25849
- propsOnPaginationModelChange(model, undefined);
25887
+ const onPageChange = page => {
25888
+ if (propsOnPageChange) {
25889
+ propsOnPageChange(page, undefined);
25850
25890
  } else {
25851
- setPaginationModel(model);
25891
+ setPage(page);
25852
25892
  }
25853
25893
  };
25854
25894
  useEffect(() => {
25855
- if (propsPaginationModel) {
25856
- setPaginationModel(propsPaginationModel);
25895
+ if (propsPage || propsPage === 0) {
25896
+ setPage(propsPage);
25897
+ }
25898
+ }, [propsPage]);
25899
+ const onPageSizeChange = pageSize => {
25900
+ onPageChange(0);
25901
+ if (propsOnPageSizeChange) {
25902
+ propsOnPageSizeChange(pageSize, undefined);
25903
+ } else {
25904
+ setPageSize(pageSize);
25857
25905
  }
25858
- }, [propsPaginationModel]);
25859
- const selectionStatus = useRef({
25860
- type: 'none',
25861
- numberOfSelectedRows: 0,
25862
- numberOfSelectedRowsInPage: 0,
25863
- page: paginationModel.page,
25864
- pageSize: paginationModel.pageSize
25865
- });
25906
+ };
25907
+ useEffect(() => {
25908
+ if (propsPageSize) {
25909
+ setPageSize(propsPageSize);
25910
+ }
25911
+ }, [propsPageSize]);
25866
25912
 
25867
25913
  // in server-side pagination we want to update the selection status
25868
25914
  // every time we navigate between pages, resize our page or select something
25869
25915
  useEffect(() => {
25870
25916
  if (paginationMode == 'server') {
25871
- onServerSideSelectionStatusChange(Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel], apiRef, selectionStatus, isRowSelectable, paginationModel.page, paginationModel.pageSize);
25917
+ onServerSideSelectionStatusChange(Array.isArray(selectionModel) ? selectionModel : [selectionModel], apiRef, selectionStatus, isRowSelectable, page, pageSize);
25872
25918
  }
25873
- }, [rowSelectionModel, paginationModel.page, paginationModel.pageSize]);
25919
+ }, [selectionModel, page, pageSize]);
25874
25920
  if (!Array.isArray(rows)) {
25875
25921
  return null;
25876
25922
  }
@@ -25906,54 +25952,57 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25906
25952
  apiRef: apiRef,
25907
25953
  autoHeight: autoHeight,
25908
25954
  checkboxSelectionVisibleOnly: Boolean(pagination),
25909
- slots: _objectSpread2(_objectSpread2({
25910
- baseButton: BaseButton,
25911
- baseCheckbox: BaseCheckbox,
25912
- // baseTextField,
25913
- basePopper: BasePopper,
25914
- columnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25955
+ columnTypes: _objectSpread2(_objectSpread2({}, customColumnTypes), propsColumnTypes),
25956
+ components: _objectSpread2(_objectSpread2({
25957
+ BaseButton,
25958
+ BaseCheckbox,
25959
+ // BaseTextField,
25960
+ BasePopper,
25961
+ ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25915
25962
  displayName: "ColumnFilteredIcon"
25916
25963
  })),
25917
- columnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25964
+ ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25918
25965
  displayName: "ColumnSelectorIcon"
25919
25966
  })),
25920
- columnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25967
+ ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25921
25968
  displayName: "ColumnSortedAscendingIcon"
25922
25969
  })),
25923
- columnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25970
+ ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25924
25971
  displayName: "ColumnSortedDescendingIcon"
25925
25972
  })),
25926
- densityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25973
+ DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25927
25974
  displayName: "DensityCompactIcon"
25928
25975
  })),
25929
- densityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25976
+ DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25930
25977
  displayName: "DensityStandardIcon"
25931
25978
  })),
25932
- densityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25979
+ DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25933
25980
  displayName: "DensityComfortableIcon"
25934
25981
  })),
25935
- detailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25982
+ DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25936
25983
  displayName: "DetailPanelCollapseIcon"
25937
25984
  })),
25938
- detailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25985
+ DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25939
25986
  displayName: "DetailPanelExpandIcon"
25940
25987
  })),
25941
- exportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25988
+ ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25942
25989
  displayName: "ExportIcon"
25943
25990
  })),
25944
- openFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
25991
+ OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
25945
25992
  displayName: "OpenFilterButtonIcon"
25946
25993
  }, props))
25947
- }, slots), {}, {
25948
- toolbar: ToolbarWrapper,
25949
- pagination: props => pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$2({}, props, {
25994
+ }, components), {}, {
25995
+ Toolbar: ToolbarWrapper,
25996
+ Pagination: props => pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$2({}, props, {
25950
25997
  displaySelection: false,
25951
25998
  displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
25952
25999
  displayPagination: ['bottom', 'both'].includes(paginationPlacement),
25953
26000
  selectionStatus: selectionStatus.current,
25954
- paginationModel: paginationModel,
25955
- onPaginationModelChange: onPaginationModelChange,
25956
- pageSizeOptions: pageSizeOptions,
26001
+ page: page,
26002
+ onPageChange: onPageChange,
26003
+ pageSize: pageSize,
26004
+ onPageSizeChange: onPageSizeChange,
26005
+ rowsPerPageOptions: rowsPerPageOptions,
25957
26006
  paginationProps: paginationProps,
25958
26007
  paginationMode: paginationMode,
25959
26008
  rowCount: rowCount
@@ -25964,14 +26013,16 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25964
26013
  selectionStatus: selectionStatus.current,
25965
26014
  apiRef: apiRef,
25966
26015
  isRowSelectable: isRowSelectable,
25967
- paginationModel: paginationModel,
25968
- onPaginationModelChange: onPaginationModelChange,
25969
- pageSizeOptions: pageSizeOptions,
26016
+ page: page,
26017
+ onPageChange: onPageChange,
26018
+ pageSize: pageSize,
26019
+ onPageSizeChange: onPageSizeChange,
26020
+ rowsPerPageOptions: rowsPerPageOptions,
25970
26021
  paginationProps: paginationProps,
25971
26022
  paginationMode: paginationMode
25972
26023
  })) : null
25973
26024
  }),
25974
- slotProps: _objectSpread2(_objectSpread2({}, slotProps), {}, {
26025
+ componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
25975
26026
  toolbar: _objectSpread2({
25976
26027
  hideToolbar,
25977
26028
  RenderedToolbar,
@@ -25982,13 +26033,15 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25982
26033
  selectionStatus,
25983
26034
  apiRef,
25984
26035
  isRowSelectable,
25985
- paginationModel,
25986
- onPaginationModelChange,
25987
- pageSizeOptions,
26036
+ page,
26037
+ onPageChange,
26038
+ pageSize,
26039
+ onPageSizeChange,
26040
+ rowsPerPageOptions,
25988
26041
  paginationProps,
25989
26042
  paginationMode,
25990
26043
  rowCount
25991
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar)
26044
+ }, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
25992
26045
  }),
25993
26046
  filterModel: filterModel,
25994
26047
  columnVisibilityModel: columnVisibilityModel,
@@ -26006,37 +26059,39 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26006
26059
  paginationMode: paginationMode,
26007
26060
  keepNonExistentRowsSelected: paginationMode == 'server',
26008
26061
  rows: rows,
26009
- pageSizeOptions: pageSizeOptions,
26010
- paginationModel: paginationModel,
26011
- onPaginationModelChange: onPaginationModelChange,
26012
- rowSelectionModel: rowSelectionModel,
26013
- onRowSelectionModelChange: (newSelectionModel, details) => {
26062
+ rowsPerPageOptions: rowsPerPageOptions,
26063
+ page: page,
26064
+ onPageChange: onPageChange,
26065
+ pageSize: pageSize,
26066
+ onPageSizeChange: onPageSizeChange,
26067
+ selectionModel: selectionModel,
26068
+ onSelectionModelChange: (newSelectionModel, details) => {
26014
26069
  if (pagination && paginationMode != 'server') {
26015
- const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref6 => {
26070
+ const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref3 => {
26016
26071
  let {
26017
26072
  model
26018
- } = _ref6;
26073
+ } = _ref3;
26019
26074
  return isRowSelectable({
26020
26075
  row: model
26021
26076
  });
26022
- }).map(_ref7 => {
26077
+ }).map(_ref4 => {
26023
26078
  let {
26024
26079
  id
26025
- } = _ref7;
26080
+ } = _ref4;
26026
26081
  return id;
26027
26082
  }) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
26028
26083
  const numberOfSelectableRowsInPage = selectableRowsInPage.length;
26029
- const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref8 => {
26084
+ const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref5 => {
26030
26085
  let {
26031
26086
  model
26032
- } = _ref8;
26087
+ } = _ref5;
26033
26088
  return isRowSelectable({
26034
26089
  row: model
26035
26090
  });
26036
- }).map(_ref9 => {
26091
+ }).map(_ref6 => {
26037
26092
  let {
26038
26093
  id
26039
- } = _ref9;
26094
+ } = _ref6;
26040
26095
  return id;
26041
26096
  }) : gridFilteredSortedRowIdsSelector(apiRef);
26042
26097
  const numberOfSelectableRowsInTable = selectableRowsInTable.length;
@@ -26068,7 +26123,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26068
26123
  };
26069
26124
  }
26070
26125
  }
26071
- onRowSelectionModelChange === null || onRowSelectionModelChange === void 0 ? void 0 : onRowSelectionModelChange(newSelectionModel, details);
26126
+ onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
26072
26127
  },
26073
26128
  sx: _objectSpread2(_objectSpread2({}, sx), {}, {
26074
26129
  '.MuiDataGrid-columnHeaders': {