@redsift/table 11.0.0-muiv5-alpha.4 → 11.0.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.
Files changed (4) hide show
  1. package/index.d.ts +25 -41
  2. package/index.js +256 -327
  3. package/index.js.map +1 -1
  4. package/package.json +4 -4
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputValue, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators, GridLinkOperator, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridVisibleSortedRowIdsSelector, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, useGridApiRef, DataGridPro, GRID_CHECKBOX_SELECTION_COL_DEF } 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, GridLogicOperator, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, useGridApiRef, DataGridPro, GRID_CHECKBOX_SELECTION_COL_DEF } from '@mui/x-data-grid-pro';
2
2
  export { getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
3
3
  import * as React from 'react';
4
4
  import React__default, { Children, isValidElement, cloneElement, forwardRef, useLayoutEffect, useEffect, useRef, useContext, useState, useCallback, createElement, useMemo } from 'react';
@@ -17639,7 +17639,7 @@ const isBetweenOperator = {
17639
17639
  label: 'is between',
17640
17640
  value: 'isBetween',
17641
17641
  getApplyFilterFn: filterItem => {
17642
- if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17642
+ if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17643
17643
  return null;
17644
17644
  }
17645
17645
  if (!Array.isArray(filterItem.value) || filterItem.value.length !== 2) {
@@ -17652,7 +17652,7 @@ const isBetweenOperator = {
17652
17652
  return null;
17653
17653
  }
17654
17654
  return params => {
17655
- return params.value !== null && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
17655
+ return params.value !== null && params.value !== undefined && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
17656
17656
  };
17657
17657
  },
17658
17658
  InputComponent: InputNumberInterval
@@ -17665,7 +17665,7 @@ const doesNotEqual = {
17665
17665
  label: 'does not equal',
17666
17666
  value: 'doesNotEqual',
17667
17667
  getApplyFilterFn: filterItem => {
17668
- if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17668
+ if (!filterItem.field || !filterItem.value || !filterItem.value) {
17669
17669
  return null;
17670
17670
  }
17671
17671
  return params => {
@@ -17686,7 +17686,7 @@ const doesNotContain = {
17686
17686
  label: 'does not contain',
17687
17687
  value: 'doesNotContain',
17688
17688
  getApplyFilterFn: filterItem => {
17689
- if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17689
+ if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17690
17690
  return null;
17691
17691
  }
17692
17692
  return params => {
@@ -17707,7 +17707,7 @@ const containsAnyOfOperator = {
17707
17707
  label: 'contains any of',
17708
17708
  value: 'containsAnyOf',
17709
17709
  getApplyFilterFn: filterItem => {
17710
- if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17710
+ if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17711
17711
  return null;
17712
17712
  }
17713
17713
  return params => {
@@ -17730,7 +17730,7 @@ const containsAnyOfCIOperator = {
17730
17730
  label: 'contains any of (case insensitive)',
17731
17731
  value: 'containsAnyOf',
17732
17732
  getApplyFilterFn: filterItem => {
17733
- if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17733
+ if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17734
17734
  return null;
17735
17735
  }
17736
17736
  return params => {
@@ -17757,7 +17757,7 @@ const endsWithAnyOfOperator = {
17757
17757
  label: 'ends with any of',
17758
17758
  value: 'endsWithAnyOf',
17759
17759
  getApplyFilterFn: filterItem => {
17760
- if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17760
+ if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17761
17761
  return null;
17762
17762
  }
17763
17763
  return params => {
@@ -17784,7 +17784,7 @@ const isAnyOfOperator = {
17784
17784
  label: 'is any of',
17785
17785
  value: 'isAnyOf',
17786
17786
  getApplyFilterFn: filterItem => {
17787
- if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17787
+ if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17788
17788
  return null;
17789
17789
  }
17790
17790
  return params => {
@@ -17808,7 +17808,7 @@ const isNotAnyOfOperator = {
17808
17808
  label: 'is not any of',
17809
17809
  value: 'isNotAnyOf',
17810
17810
  getApplyFilterFn: filterItem => {
17811
- if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17811
+ if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17812
17812
  return null;
17813
17813
  }
17814
17814
  return params => {
@@ -17832,7 +17832,7 @@ const startsWithAnyOfOperator = {
17832
17832
  label: 'starts with any of',
17833
17833
  value: 'startsWithAnyOf',
17834
17834
  getApplyFilterFn: filterItem => {
17835
- if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17835
+ if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17836
17836
  return null;
17837
17837
  }
17838
17838
  return params => {
@@ -17877,13 +17877,13 @@ const operatorList = {
17877
17877
 
17878
17878
  const getRsStringColumnType = () => {
17879
17879
  return {
17880
- extendType: 'string',
17880
+ type: 'string',
17881
17881
  filterOperators: operatorList.rsString
17882
17882
  };
17883
17883
  };
17884
17884
  const getRsNumberColumnType = () => {
17885
17885
  return {
17886
- extendType: 'number',
17886
+ type: 'number',
17887
17887
  filterOperators: operatorList.rsNumber
17888
17888
  };
17889
17889
  };
@@ -17894,7 +17894,7 @@ const customColumnTypes = {
17894
17894
 
17895
17895
  const API_URL = 'https://api.openai.com/v1/chat/completions';
17896
17896
  async function getCompletion(text, role, openai_api_key) {
17897
- let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-0613';
17897
+ let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-1106';
17898
17898
  try {
17899
17899
  const messages = [{
17900
17900
  role: 'system',
@@ -18063,42 +18063,39 @@ const numberOperatorDecoder = {
18063
18063
  lt: '<',
18064
18064
  lte: '<='
18065
18065
  };
18066
- const isOperatorValueValid = (columnField, operatorValue, columns) => {
18067
- const column = columns.find(column => column.field === columnField);
18066
+ const isOperatorValueValid = (field, operator, columns) => {
18067
+ const column = columns.find(column => column.field === field);
18068
18068
  if (!column) {
18069
18069
  return false;
18070
18070
  }
18071
18071
  const columnType = (column === null || column === void 0 ? void 0 : column.type) || 'string';
18072
- const operators = operatorList[columnType];
18072
+ const operators = column.filterOperators || operatorList[columnType];
18073
18073
  if (!operators) {
18074
18074
  return false;
18075
18075
  }
18076
- if ('filterOperators' in operators) {
18077
- return !!operators.filterOperators.find(op => columnType === 'number' && Object.keys(numberOperatorEncoder).includes(op.value) ? numberOperatorEncoder[op.value] === operatorValue : op['value'] === operatorValue);
18078
- }
18079
- return !!operators.find(op => ['number', 'rsNumber'].includes(columnType) && Object.keys(numberOperatorEncoder).includes(op.value) ? numberOperatorEncoder[op.value] === operatorValue : op['value'] === operatorValue);
18076
+ return !!operators.find(op => columnType === 'number' && Object.keys(numberOperatorEncoder).includes(op.value) ? numberOperatorEncoder[op.value] === operator : op.value === operator);
18080
18077
  };
18081
18078
  const listOperators = ['containsAnyOf', 'endsWithAnyOf', 'isAnyOf', 'isNotAnyOf', 'startsWithAnyOf'];
18082
18079
 
18083
18080
  // Check if the value doesn't break
18084
- const isValueValid = (value, columnField, columns, operatorValue) => {
18081
+ const isValueValid = (value, field, columns, operator) => {
18085
18082
  var _column$type;
18086
18083
  // every field accepts undefined as value for default
18087
18084
  if (value === undefined || value === '') {
18088
18085
  return true;
18089
18086
  }
18090
18087
 
18091
- // xxxAnyOf accepts as value only lists, and we are declearing them in the
18088
+ // xxxAnyOf accepts as value only lists, and we are declaring them in the
18092
18089
  // URL as `list=[...]`
18093
- if (listOperators.includes(operatorValue)) {
18090
+ if (listOperators.includes(operator)) {
18094
18091
  return Array.isArray(value) || value === '';
18095
18092
  }
18096
18093
 
18097
18094
  // We are accepting arrays only if they are of the 'xxxAnyOf' type
18098
- if (Array.isArray(value) && !listOperators.includes(operatorValue)) {
18095
+ if (Array.isArray(value) && !listOperators.includes(operator)) {
18099
18096
  return false;
18100
18097
  }
18101
- const column = columns.find(column => column.field === columnField);
18098
+ const column = columns.find(column => column.field === field);
18102
18099
  if (!column) {
18103
18100
  return false;
18104
18101
  }
@@ -18136,17 +18133,17 @@ const getFilterModelFromString = (searchString, columns) => {
18136
18133
  if (!searchString) {
18137
18134
  return {
18138
18135
  items: [],
18139
- linkOperator: GridLinkOperator.And
18136
+ logicOperator: GridLogicOperator.And
18140
18137
  };
18141
18138
  }
18142
- let linkOperator = GridLinkOperator.And;
18139
+ let logicOperator = GridLogicOperator.And;
18143
18140
  const searchParams = new URLSearchParams();
18144
18141
  for (const [key, value] of new URLSearchParams(searchString)) {
18145
18142
  if (key.startsWith('_') && !['_logicOperator', '_sortColumn', '_pinnedColumnsLeft', '_pinnedColumnsRight', '_columnVisibility', '_pagination'].includes(key)) {
18146
18143
  searchParams.set(key, value);
18147
18144
  }
18148
18145
  if (key === '_logicOperator') {
18149
- linkOperator = value;
18146
+ logicOperator = value;
18150
18147
  }
18151
18148
  }
18152
18149
  let id = 5000;
@@ -18187,8 +18184,8 @@ const getFilterModelFromString = (searchString, columns) => {
18187
18184
  return;
18188
18185
  }
18189
18186
  items.push({
18190
- columnField: field,
18191
- operatorValue: ['number', 'rsNumber'].includes(columnType) && Object.keys(numberOperatorDecoder).includes(operator) ? numberOperatorDecoder[operator] : operator,
18187
+ field,
18188
+ operator: columnType === 'number' && Object.keys(numberOperatorDecoder).includes(operator) ? numberOperatorDecoder[operator] : operator,
18192
18189
  id,
18193
18190
  value: listOperators.includes(operator) && decodedValue === '' ? [] : decodedValue,
18194
18191
  type
@@ -18201,28 +18198,28 @@ const getFilterModelFromString = (searchString, columns) => {
18201
18198
  if (isInvalid) {
18202
18199
  return {
18203
18200
  items: [],
18204
- linkOperator: GridLinkOperator.And
18201
+ logicOperator: GridLogicOperator.And
18205
18202
  };
18206
18203
  }
18207
18204
  return {
18208
18205
  items,
18209
- linkOperator
18206
+ logicOperator
18210
18207
  };
18211
18208
  };
18212
18209
  const getSearchParamsFromFilterModel = filterModel => {
18213
18210
  const searchParams = new URLSearchParams();
18214
- searchParams.set('_logicOperator', filterModel['linkOperator'] || '');
18211
+ searchParams.set('_logicOperator', filterModel['logicOperator'] || '');
18215
18212
  filterModel['items'].forEach(item => {
18216
18213
  const {
18217
- columnField,
18218
- operatorValue,
18214
+ field,
18215
+ operator,
18219
18216
  value,
18220
18217
  type
18221
18218
  } = item;
18222
- if (Object.keys(numberOperatorEncoder).includes(operatorValue)) {
18223
- searchParams.set(`_${columnField}[${numberOperatorEncoder[operatorValue]},${encodeValue(type)}]`, encodeValue(value));
18219
+ if (Object.keys(numberOperatorEncoder).includes(operator)) {
18220
+ searchParams.set(`_${field}[${numberOperatorEncoder[operator]},${encodeValue(type)}]`, encodeValue(value));
18224
18221
  } else {
18225
- searchParams.set(`_${columnField}[${encodeValue(operatorValue)},${encodeValue(type)}]`, encodeValue(value));
18222
+ searchParams.set(`_${field}[${encodeValue(operator)},${encodeValue(type)}]`, encodeValue(value));
18226
18223
  }
18227
18224
  });
18228
18225
  return searchParams;
@@ -18248,7 +18245,7 @@ const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFil
18248
18245
  }
18249
18246
  return {
18250
18247
  items: [],
18251
- linkOperator: GridLinkOperator.And
18248
+ logicOperator: GridLogicOperator.And
18252
18249
  };
18253
18250
  };
18254
18251
 
@@ -18371,11 +18368,11 @@ const getPaginationModel = (search, localStoragePagination, setLocalStoragePagin
18371
18368
 
18372
18369
  const getSearchParamsFromColumnVisibility = (columnVisibility, columns) => {
18373
18370
  const searchParams = new URLSearchParams();
18374
- const columnFields = columns.map(column => column.field);
18371
+ const fields = columns.map(column => column.field);
18375
18372
 
18376
18373
  // if column visibility model is empty, show all columns
18377
18374
  if (Object.keys(columnVisibility).length == 0) {
18378
- searchParams.set('_columnVisibility', `[${columnFields.join(',')}]`);
18375
+ searchParams.set('_columnVisibility', `[${fields.join(',')}]`);
18379
18376
  return searchParams;
18380
18377
  }
18381
18378
  const finalColumnVisibility = columns.filter(c => {
@@ -18425,12 +18422,12 @@ const getColumnVisibilityFromString = (notParsed, tableColumns) => {
18425
18422
  continue;
18426
18423
  }
18427
18424
  exist = true;
18428
- const columnFields = tableColumns.map(column => column.field);
18425
+ const fields = tableColumns.map(column => column.field);
18429
18426
  // TODO: Add validation that , is present
18430
18427
  const columns = encodedValues.split(',').map(value => decodeValue(value));
18431
18428
 
18432
18429
  // for each column, check if it's visible and add it to visibility model
18433
- for (const column of columnFields) {
18430
+ for (const column of fields) {
18434
18431
  const isColumnVisible = columns.includes(column);
18435
18432
  visibility[column] = isColumnVisible;
18436
18433
  if (isColumnVisible) {
@@ -18493,8 +18490,8 @@ const getPinnedColumnsFromString = (notParsed, tableColumns) => {
18493
18490
  if (typeof encodedValues !== 'string') {
18494
18491
  continue;
18495
18492
  }
18496
- const columnFields = [...tableColumns.map(column => column.field), '__check__'];
18497
- const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' && columnFields.includes(val));
18493
+ const fields = [...tableColumns.map(column => column.field), '__check__'];
18494
+ const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' && fields.includes(val));
18498
18495
  if (fieldURL === '_pinnedColumnsLeft') {
18499
18496
  pinnedColumns['left'] = columns;
18500
18497
  }
@@ -18644,17 +18641,17 @@ const updateUrl = (_ref4, search, historyReplace, columns) => {
18644
18641
  // do not use it for equivalence (e.g. with value `3` and undefined we
18645
18642
  // will get 0).
18646
18643
  const compareFilters = (firstFilter, secondFilter) => {
18647
- if (firstFilter.columnField < secondFilter.columnField) {
18644
+ if (firstFilter.field < secondFilter.field) {
18648
18645
  return -1;
18649
- } else if (firstFilter.columnField > secondFilter.columnField) {
18646
+ } else if (firstFilter.field > secondFilter.field) {
18650
18647
  return 1;
18651
18648
  }
18652
- if (firstFilter.operatorValue === undefined || secondFilter.operatorValue === undefined) {
18649
+ if (firstFilter.operator === undefined || secondFilter.operator === undefined) {
18653
18650
  return 0;
18654
18651
  }
18655
- if (firstFilter.operatorValue < secondFilter.operatorValue) {
18652
+ if (firstFilter.operator < secondFilter.operator) {
18656
18653
  return -1;
18657
- } else if (firstFilter.operatorValue > secondFilter.operatorValue) {
18654
+ } else if (firstFilter.operator > secondFilter.operator) {
18658
18655
  return 1;
18659
18656
  }
18660
18657
  if (firstFilter.value < secondFilter.value) {
@@ -18665,18 +18662,18 @@ const compareFilters = (firstFilter, secondFilter) => {
18665
18662
  return 0;
18666
18663
  };
18667
18664
  const areFiltersEquivalent = (firstFilter, secondFilter) => {
18668
- return firstFilter.columnField === secondFilter.columnField && firstFilter.operatorValue === secondFilter.operatorValue && firstFilter.value === secondFilter.value;
18665
+ return firstFilter.field === secondFilter.field && firstFilter.operator === secondFilter.operator && firstFilter.value === secondFilter.value;
18669
18666
  };
18670
18667
  const areFilterModelsEquivalent = (filterModel, filterModelToMatch) => {
18671
18668
  const {
18672
18669
  items,
18673
- linkOperator
18670
+ logicOperator
18674
18671
  } = filterModel;
18675
18672
  const {
18676
18673
  items: itemsToMatch,
18677
- linkOperator: linkOperatorToMatch
18674
+ logicOperator: logicOperatorToMatch
18678
18675
  } = filterModelToMatch;
18679
- if (linkOperator !== linkOperatorToMatch) {
18676
+ if (logicOperator !== logicOperatorToMatch) {
18680
18677
  return false;
18681
18678
  }
18682
18679
  if (items.length !== itemsToMatch.length) {
@@ -18689,7 +18686,7 @@ const areFilterModelsEquivalent = (filterModel, filterModelToMatch) => {
18689
18686
  const filterToCompare = itemsToMatch[i];
18690
18687
 
18691
18688
  // compareFilters return 0 if and only if the filters have the same
18692
- // columnField, operatorValue, and value
18689
+ // field, operator, and value
18693
18690
  if (!areFiltersEquivalent(filter, filterToCompare)) {
18694
18691
  return false;
18695
18692
  }
@@ -23101,16 +23098,16 @@ const getRole = (config, dateFormat) => {
23101
23098
  }).join('\n');
23102
23099
  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.
23103
23100
  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.
23104
- The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "linkOperator" and "items":
23105
- - "linkOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
23106
- - "items": a list of conditions, each is an object with exactly the three keys "columnField", "operatorValue" and "value":
23107
- - "columnField": the column name, must be one of ${columns}
23101
+ The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "logicOperator" and "items":
23102
+ - "logicOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
23103
+ - "items": a list of conditions, each is an object with exactly the three keys "field", "operator" and "value":
23104
+ - "field": the column name, must be one of ${columns}
23108
23105
  - "value":
23109
- - this can be skipped if the "operatorValue" is either "isEmpty" or "isNotEmpty"
23110
- - a list of multiple values if the "operatorValue" ends with "AnyOf"
23106
+ - this can be skipped if the "operator" is either "isEmpty" or "isNotEmpty"
23107
+ - a list of multiple values if the "operator" ends with "AnyOf"
23111
23108
  - otherwise, it's a single value represented as a string: "true" instead of true, "false" instead of false, "0.6" instead of 0.6.
23112
23109
  For "date" data type, use ${dateFormat}. If relative date is input, convert to the actual date given today is ${today}.
23113
- - "operatorValue": the comparison operator, accepted values depend on the data type of the column
23110
+ - "operator": the comparison operator, accepted values depend on the data type of the column
23114
23111
  ${operators}
23115
23112
 
23116
23113
  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:
@@ -23147,10 +23144,10 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
23147
23144
  nlpFilterConfig,
23148
23145
  onFilterModelChange,
23149
23146
  dateFormat = 'yyyy-mm-dd',
23150
- defaultModel = 'gpt-4-0613',
23147
+ defaultModel = 'gpt-4-1106-preview',
23151
23148
  defaultFilter = {
23152
23149
  items: [],
23153
- linkOperator: 'and'
23150
+ logicOperator: 'and'
23154
23151
  },
23155
23152
  disablePower = false,
23156
23153
  localeText
@@ -23228,7 +23225,7 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
23228
23225
  value: prompt
23229
23226
  }), /*#__PURE__*/React__default.createElement(Button, {
23230
23227
  variant: "primary",
23231
- "aira-label": buttonAriaLabel,
23228
+ "aria-label": buttonAriaLabel,
23232
23229
  type: "submit",
23233
23230
  isLoading: isLoading
23234
23231
  }, buttonText)), !disablePower && /*#__PURE__*/React__default.createElement(Tooltip, null, /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, /*#__PURE__*/React__default.createElement(Switch, {
@@ -23289,7 +23286,7 @@ const Toolbar$2 = props => {
23289
23286
  let {
23290
23287
  apiRef
23291
23288
  } = _ref;
23292
- return gridVisibleSortedRowIdsSelector(apiRef);
23289
+ return gridExpandedSortedRowIdsSelector(apiRef);
23293
23290
  }
23294
23291
  },
23295
23292
  printOptions: {
@@ -25521,12 +25518,10 @@ const ServerSideControlledPagination = _ref3 => {
25521
25518
  selectionStatus,
25522
25519
  displaySelection,
25523
25520
  displayPagination,
25524
- page,
25525
- onPageChange,
25526
- pageSize,
25527
- onPageSizeChange,
25521
+ paginationModel,
25522
+ onPaginationModelChange,
25523
+ pageSizeOptions,
25528
25524
  displayRowsPerPage,
25529
- rowsPerPageOptions,
25530
25525
  paginationProps,
25531
25526
  rowCount
25532
25527
  } = _ref3;
@@ -25545,13 +25540,17 @@ const ServerSideControlledPagination = _ref3 => {
25545
25540
  }, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
25546
25541
  component: "div",
25547
25542
  count: totalNumberOfRowsInTable,
25548
- page: page,
25549
- onPageChange: (event, newPage) => onPageChange(newPage),
25550
- rowsPerPage: pageSize,
25551
- onRowsPerPageChange: event => {
25552
- onPageSizeChange(parseInt(event.target.value, 10));
25553
- },
25554
- rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
25543
+ page: paginationModel.page,
25544
+ onPageChange: (event, page) => onPaginationModelChange({
25545
+ page,
25546
+ pageSize: paginationModel.pageSize
25547
+ }),
25548
+ rowsPerPage: paginationModel.pageSize,
25549
+ onRowsPerPageChange: event => onPaginationModelChange({
25550
+ page: paginationModel.page,
25551
+ pageSize: parseInt(event.target.value, 10)
25552
+ }),
25553
+ rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
25555
25554
  }, paginationProps)) : null);
25556
25555
  };
25557
25556
 
@@ -25577,11 +25576,9 @@ const ControlledPagination = _ref3 => {
25577
25576
  displayPagination = false,
25578
25577
  selectionStatus,
25579
25578
  apiRef,
25580
- page,
25581
- onPageChange,
25582
- pageSize,
25583
- onPageSizeChange,
25584
- rowsPerPageOptions,
25579
+ paginationModel,
25580
+ onPaginationModelChange,
25581
+ pageSizeOptions,
25585
25582
  isRowSelectable,
25586
25583
  paginationProps
25587
25584
  } = _ref3;
@@ -25611,17 +25608,25 @@ const ControlledPagination = _ref3 => {
25611
25608
  }, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
25612
25609
  component: "div",
25613
25610
  count: numberOfFilteredRowsInTable,
25614
- page: page,
25615
- onPageChange: (event, newPage) => onPageChange(newPage),
25616
- rowsPerPage: pageSize,
25611
+ page: paginationModel.page,
25612
+ onPageChange: (event, page) => {
25613
+ onPaginationModelChange({
25614
+ page,
25615
+ pageSize: paginationModel.pageSize
25616
+ });
25617
+ },
25618
+ rowsPerPage: paginationModel.pageSize,
25617
25619
  onRowsPerPageChange: event => {
25618
- onPageSizeChange(parseInt(event.target.value, 10));
25620
+ onPaginationModelChange({
25621
+ page: paginationModel.page,
25622
+ pageSize: parseInt(event.target.value, 10)
25623
+ });
25619
25624
  },
25620
- rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
25625
+ rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
25621
25626
  }, paginationProps)) : null);
25622
25627
  };
25623
25628
 
25624
- const _excluded$3 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "page", "onPageChange", "pageSize", "onPageSizeChange", "rowsPerPageOptions", "paginationProps", "paginationMode", "rowCount"];
25629
+ const _excluded$3 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "paginationModel", "onPaginationModelChange", "pageSizeOptions", "paginationProps", "paginationMode", "rowCount"];
25625
25630
  const ToolbarWrapper = _ref => {
25626
25631
  let {
25627
25632
  hideToolbar,
@@ -25633,11 +25638,9 @@ const ToolbarWrapper = _ref => {
25633
25638
  selectionStatus,
25634
25639
  apiRef,
25635
25640
  isRowSelectable,
25636
- page,
25637
- onPageChange,
25638
- pageSize,
25639
- onPageSizeChange,
25640
- rowsPerPageOptions,
25641
+ paginationModel,
25642
+ onPaginationModelChange,
25643
+ pageSizeOptions,
25641
25644
  paginationProps,
25642
25645
  paginationMode = 'client',
25643
25646
  rowCount
@@ -25651,11 +25654,9 @@ const ToolbarWrapper = _ref => {
25651
25654
  displayRowsPerPage: false,
25652
25655
  displayPagination: ['top', 'both'].includes(paginationPlacement),
25653
25656
  selectionStatus: selectionStatus.current,
25654
- page: page,
25655
- onPageChange: onPageChange,
25656
- pageSize: pageSize,
25657
- onPageSizeChange: onPageSizeChange,
25658
- rowsPerPageOptions: rowsPerPageOptions,
25657
+ paginationModel: paginationModel,
25658
+ onPaginationModelChange: onPaginationModelChange,
25659
+ pageSizeOptions: pageSizeOptions,
25659
25660
  paginationProps: paginationProps,
25660
25661
  rowCount: rowCount
25661
25662
  }) : /*#__PURE__*/React__default.createElement(ControlledPagination, {
@@ -25665,30 +25666,26 @@ const ToolbarWrapper = _ref => {
25665
25666
  selectionStatus: selectionStatus.current,
25666
25667
  apiRef: apiRef,
25667
25668
  isRowSelectable: isRowSelectable,
25668
- page: page,
25669
- onPageChange: onPageChange,
25670
- pageSize: pageSize,
25671
- onPageSizeChange: onPageSizeChange,
25672
- rowsPerPageOptions: rowsPerPageOptions,
25669
+ paginationModel: paginationModel,
25670
+ onPaginationModelChange: onPaginationModelChange,
25671
+ pageSizeOptions: pageSizeOptions,
25673
25672
  paginationProps: paginationProps
25674
25673
  }) : null);
25675
25674
  };
25676
25675
 
25677
25676
  const useControlledDatagridState = _ref => {
25678
- var _initialState$paginat, _initialState$paginat2;
25677
+ var _ref2, _ref3, _propsPaginationModel, _initialState$paginat, _initialState$paginat2, _pageSizeOptions$, _ref4, _propsPaginationModel2, _initialState$paginat3, _initialState$paginat4;
25679
25678
  let {
25680
25679
  initialState,
25681
- rowsPerPageOptions,
25680
+ pageSizeOptions,
25682
25681
  propsColumnVisibilityModel,
25683
25682
  propsFilterModel,
25684
25683
  propsOnColumnVisibilityModelChange,
25685
25684
  propsOnFilterModelChange,
25686
- propsOnPageChange,
25687
- propsOnPageSizeChange,
25685
+ propsOnPaginationModelChange,
25688
25686
  propsOnPinnedColumnsChange,
25689
25687
  propsOnSortModelChange,
25690
- propsPage,
25691
- propsPageSize,
25688
+ propsPaginationModel,
25692
25689
  propsPinnedColumns,
25693
25690
  propsSortModel
25694
25691
  } = _ref;
@@ -25736,33 +25733,22 @@ const useControlledDatagridState = _ref => {
25736
25733
  setSortModel(model);
25737
25734
  }
25738
25735
  };
25739
- const [page, setPage] = useState((initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat = initialState.pagination) === null || _initialState$paginat === void 0 ? void 0 : _initialState$paginat.page) || propsPage || 0);
25740
- const [pageSize, setPageSize] = 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]) || 25);
25741
- const onPageChange = page => {
25742
- if (propsOnPageChange) {
25743
- propsOnPageChange(page, undefined);
25744
- } else {
25745
- setPage(page);
25746
- }
25747
- };
25748
- useEffect(() => {
25749
- if (propsPage || propsPage === 0) {
25750
- setPage(propsPage);
25751
- }
25752
- }, [propsPage]);
25753
- const onPageSizeChange = pageSize => {
25754
- onPageChange(0);
25755
- if (propsOnPageSizeChange) {
25756
- propsOnPageSizeChange(pageSize, undefined);
25736
+ const [paginationModel, setPaginationModel] = useState({
25737
+ pageSize: (_ref2 = (_ref3 = (_propsPaginationModel = propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.pageSize) !== null && _propsPaginationModel !== void 0 ? _propsPaginationModel : initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat = initialState.pagination) === null || _initialState$paginat === void 0 ? void 0 : (_initialState$paginat2 = _initialState$paginat.paginationModel) === null || _initialState$paginat2 === void 0 ? void 0 : _initialState$paginat2.pageSize) !== null && _ref3 !== void 0 ? _ref3 : 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 && _ref2 !== void 0 ? _ref2 : 25,
25738
+ page: (_ref4 = (_propsPaginationModel2 = propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.page) !== null && _propsPaginationModel2 !== void 0 ? _propsPaginationModel2 : initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat3 = initialState.pagination) === null || _initialState$paginat3 === void 0 ? void 0 : (_initialState$paginat4 = _initialState$paginat3.paginationModel) === null || _initialState$paginat4 === void 0 ? void 0 : _initialState$paginat4.page) !== null && _ref4 !== void 0 ? _ref4 : 0
25739
+ });
25740
+ const onPaginationModelChange = (model, details) => {
25741
+ if (propsOnPaginationModelChange) {
25742
+ propsOnPaginationModelChange(model, details);
25757
25743
  } else {
25758
- setPageSize(pageSize);
25744
+ setPaginationModel(model);
25759
25745
  }
25760
25746
  };
25761
25747
  useEffect(() => {
25762
- if (propsPageSize) {
25763
- setPageSize(propsPageSize);
25748
+ if (propsPaginationModel) {
25749
+ setPaginationModel(propsPaginationModel);
25764
25750
  }
25765
- }, [propsPageSize]);
25751
+ }, [propsPaginationModel]);
25766
25752
  return {
25767
25753
  filterModel,
25768
25754
  onFilterModelChange,
@@ -25772,14 +25758,12 @@ const useControlledDatagridState = _ref => {
25772
25758
  onPinnedColumnsChange,
25773
25759
  sortModel,
25774
25760
  onSortModelChange,
25775
- page,
25776
- pageSize,
25777
- onPageChange,
25778
- onPageSizeChange
25761
+ paginationModel,
25762
+ onPaginationModelChange
25779
25763
  };
25780
25764
  };
25781
25765
 
25782
- const _excluded$2 = ["apiRef", "autoHeight", "className", "columnTypes", "components", "componentsProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "onFilterModelChange", "onPageChange", "onPageSizeChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "selectionModel", "onSelectionModelChange", "page", "pageSize", "pagination", "paginationPlacement", "paginationProps", "rows", "rowsPerPageOptions", "sx", "theme", "paginationMode", "rowCount"];
25766
+ const _excluded$2 = ["apiRef", "autoHeight", "className", "slots", "slotProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "paginationModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "onFilterModelChange", "rowSelectionModel", "onPaginationModelChange", "onRowSelectionModelChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "pagination", "paginationPlacement", "paginationProps", "rows", "pageSizeOptions", "sx", "theme", "paginationMode", "rowCount"];
25783
25767
  const COMPONENT_NAME$2 = 'DataGrid';
25784
25768
  const CLASSNAME$2 = 'redsift-datagrid';
25785
25769
  const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
@@ -25788,33 +25772,30 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25788
25772
  apiRef: propsApiRef,
25789
25773
  autoHeight,
25790
25774
  className,
25791
- columnTypes: propsColumnTypes,
25792
- components,
25793
- componentsProps,
25775
+ slots,
25776
+ slotProps,
25794
25777
  filterModel: propsFilterModel,
25795
25778
  columnVisibilityModel: propsColumnVisibilityModel,
25796
25779
  pinnedColumns: propsPinnedColumns,
25797
25780
  sortModel: propsSortModel,
25781
+ paginationModel: propsPaginationModel,
25798
25782
  height: propsHeight,
25799
25783
  hideToolbar,
25800
25784
  initialState,
25801
25785
  isRowSelectable,
25802
25786
  license = process.env.MUI_LICENSE_KEY,
25803
25787
  onFilterModelChange: propsOnFilterModelChange,
25804
- onPageChange: propsOnPageChange,
25805
- onPageSizeChange: propsOnPageSizeChange,
25788
+ rowSelectionModel: propsRowSelectionModel,
25789
+ onPaginationModelChange: propsOnPaginationModelChange,
25790
+ onRowSelectionModelChange: propsOnRowSelectionModelChange,
25806
25791
  onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
25807
25792
  onPinnedColumnsChange: propsOnPinnedColumnsChange,
25808
25793
  onSortModelChange: propsOnSortModelChange,
25809
- selectionModel: propsSelectionModel,
25810
- onSelectionModelChange,
25811
- page: propsPage,
25812
- pageSize: propsPageSize,
25813
25794
  pagination,
25814
25795
  paginationPlacement = 'both',
25815
25796
  paginationProps,
25816
25797
  rows,
25817
- rowsPerPageOptions,
25798
+ pageSizeOptions,
25818
25799
  sx,
25819
25800
  theme: propsTheme,
25820
25801
  paginationMode = 'client',
@@ -25824,7 +25805,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25824
25805
  const theme = useTheme$4(propsTheme);
25825
25806
  const _apiRef = useGridApiRef();
25826
25807
  const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
25827
- const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$2;
25808
+ const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$2;
25828
25809
  LicenseInfo.setLicenseKey(license);
25829
25810
  const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
25830
25811
  const {
@@ -25832,49 +25813,52 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25832
25813
  filterModel,
25833
25814
  onColumnVisibilityModelChange,
25834
25815
  onFilterModelChange,
25835
- onPageChange,
25836
- onPageSizeChange,
25816
+ onPaginationModelChange,
25837
25817
  onPinnedColumnsChange,
25838
25818
  onSortModelChange,
25839
- page,
25840
- pageSize,
25819
+ paginationModel,
25841
25820
  pinnedColumns,
25842
25821
  sortModel
25843
25822
  } = useControlledDatagridState({
25844
25823
  initialState,
25845
- rowsPerPageOptions,
25824
+ pageSizeOptions,
25846
25825
  propsColumnVisibilityModel,
25847
25826
  propsFilterModel,
25848
25827
  propsOnColumnVisibilityModelChange,
25849
25828
  propsOnFilterModelChange,
25850
25829
  propsOnPinnedColumnsChange,
25851
25830
  propsOnSortModelChange,
25852
- propsPage,
25853
- propsPageSize,
25831
+ propsPaginationModel,
25854
25832
  propsPinnedColumns,
25855
25833
  propsSortModel,
25856
- propsOnPageChange,
25857
- propsOnPageSizeChange
25834
+ propsOnPaginationModelChange
25858
25835
  });
25859
- const [selectionModel, setSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
25836
+ const [rowSelectionModel, setRowSelectionModel] = useState(propsRowSelectionModel !== null && propsRowSelectionModel !== void 0 ? propsRowSelectionModel : []);
25860
25837
  useEffect(() => {
25861
- setSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
25862
- }, [propsSelectionModel]);
25838
+ setRowSelectionModel(propsRowSelectionModel !== null && propsRowSelectionModel !== void 0 ? propsRowSelectionModel : []);
25839
+ }, [propsRowSelectionModel]);
25840
+ const onRowSelectionModelChange = (selectionModel, details) => {
25841
+ if (propsOnRowSelectionModelChange) {
25842
+ propsOnRowSelectionModelChange(selectionModel, details);
25843
+ } else {
25844
+ setRowSelectionModel(selectionModel);
25845
+ }
25846
+ };
25863
25847
  const selectionStatus = useRef({
25864
25848
  type: 'none',
25865
25849
  numberOfSelectedRows: 0,
25866
25850
  numberOfSelectedRowsInPage: 0,
25867
- page,
25868
- pageSize
25851
+ page: paginationModel.page,
25852
+ pageSize: paginationModel.pageSize
25869
25853
  });
25870
25854
 
25871
25855
  // in server-side pagination we want to update the selection status
25872
25856
  // every time we navigate between pages, resize our page or select something
25873
25857
  useEffect(() => {
25874
25858
  if (paginationMode == 'server') {
25875
- onServerSideSelectionStatusChange(Array.isArray(selectionModel) ? selectionModel : [selectionModel], apiRef, selectionStatus, isRowSelectable, page, pageSize);
25859
+ onServerSideSelectionStatusChange(Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel], apiRef, selectionStatus, isRowSelectable, paginationModel.page, paginationModel.pageSize);
25876
25860
  }
25877
- }, [selectionModel, page, pageSize]);
25861
+ }, [rowSelectionModel, paginationModel.page, paginationModel.pageSize]);
25878
25862
  if (!Array.isArray(rows)) {
25879
25863
  return null;
25880
25864
  }
@@ -25905,57 +25889,54 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25905
25889
  apiRef: apiRef,
25906
25890
  autoHeight: autoHeight,
25907
25891
  checkboxSelectionVisibleOnly: Boolean(pagination),
25908
- columnTypes: _objectSpread2(_objectSpread2({}, customColumnTypes), propsColumnTypes),
25909
- components: _objectSpread2(_objectSpread2({
25910
- BaseButton,
25911
- BaseCheckbox,
25912
- // BaseTextField,
25913
- BasePopper,
25914
- ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25892
+ slots: _objectSpread2(_objectSpread2({
25893
+ baseButton: BaseButton,
25894
+ baseCheckbox: BaseCheckbox,
25895
+ // baseTextField,
25896
+ basePopper: BasePopper,
25897
+ columnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25915
25898
  displayName: "ColumnFilteredIcon"
25916
25899
  })),
25917
- ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25900
+ columnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25918
25901
  displayName: "ColumnSelectorIcon"
25919
25902
  })),
25920
- ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25903
+ columnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25921
25904
  displayName: "ColumnSortedAscendingIcon"
25922
25905
  })),
25923
- ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25906
+ columnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25924
25907
  displayName: "ColumnSortedDescendingIcon"
25925
25908
  })),
25926
- DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25909
+ densityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25927
25910
  displayName: "DensityCompactIcon"
25928
25911
  })),
25929
- DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25912
+ densityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25930
25913
  displayName: "DensityStandardIcon"
25931
25914
  })),
25932
- DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25915
+ densityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25933
25916
  displayName: "DensityComfortableIcon"
25934
25917
  })),
25935
- DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25918
+ detailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25936
25919
  displayName: "DetailPanelCollapseIcon"
25937
25920
  })),
25938
- DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25921
+ detailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25939
25922
  displayName: "DetailPanelExpandIcon"
25940
25923
  })),
25941
- ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25924
+ exportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25942
25925
  displayName: "ExportIcon"
25943
25926
  })),
25944
- OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
25927
+ openFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
25945
25928
  displayName: "OpenFilterButtonIcon"
25946
25929
  }, props))
25947
- }, components), {}, {
25948
- Toolbar: ToolbarWrapper,
25949
- Pagination: props => pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$2({}, props, {
25930
+ }, slots), {}, {
25931
+ toolbar: ToolbarWrapper,
25932
+ pagination: props => pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$2({}, props, {
25950
25933
  displaySelection: false,
25951
25934
  displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
25952
25935
  displayPagination: ['bottom', 'both'].includes(paginationPlacement),
25953
25936
  selectionStatus: selectionStatus.current,
25954
- page: page,
25955
- onPageChange: onPageChange,
25956
- pageSize: pageSize,
25957
- onPageSizeChange: onPageSizeChange,
25958
- rowsPerPageOptions: rowsPerPageOptions,
25937
+ paginationModel: paginationModel,
25938
+ onPaginationModelChange: onPaginationModelChange,
25939
+ pageSizeOptions: pageSizeOptions,
25959
25940
  paginationProps: paginationProps,
25960
25941
  paginationMode: paginationMode,
25961
25942
  rowCount: rowCount
@@ -25966,16 +25947,14 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25966
25947
  selectionStatus: selectionStatus.current,
25967
25948
  apiRef: apiRef,
25968
25949
  isRowSelectable: isRowSelectable,
25969
- page: page,
25970
- onPageChange: onPageChange,
25971
- pageSize: pageSize,
25972
- onPageSizeChange: onPageSizeChange,
25973
- rowsPerPageOptions: rowsPerPageOptions,
25950
+ paginationModel: paginationModel,
25951
+ onPaginationModelChange: onPaginationModelChange,
25952
+ pageSizeOptions: pageSizeOptions,
25974
25953
  paginationProps: paginationProps,
25975
25954
  paginationMode: paginationMode
25976
25955
  })) : null
25977
25956
  }),
25978
- componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
25957
+ slotProps: _objectSpread2(_objectSpread2({}, slotProps), {}, {
25979
25958
  toolbar: _objectSpread2({
25980
25959
  hideToolbar,
25981
25960
  RenderedToolbar,
@@ -25986,15 +25965,13 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25986
25965
  selectionStatus,
25987
25966
  apiRef,
25988
25967
  isRowSelectable,
25989
- page,
25990
- onPageChange,
25991
- pageSize,
25992
- onPageSizeChange,
25993
- rowsPerPageOptions,
25968
+ paginationModel,
25969
+ onPaginationModelChange,
25970
+ pageSizeOptions,
25994
25971
  paginationProps,
25995
25972
  paginationMode,
25996
25973
  rowCount
25997
- }, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
25974
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar)
25998
25975
  }),
25999
25976
  filterModel: filterModel,
26000
25977
  columnVisibilityModel: columnVisibilityModel,
@@ -26010,13 +25987,11 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26010
25987
  paginationMode: paginationMode,
26011
25988
  keepNonExistentRowsSelected: paginationMode == 'server',
26012
25989
  rows: rows,
26013
- rowsPerPageOptions: rowsPerPageOptions,
26014
- page: page,
26015
- onPageChange: onPageChange,
26016
- pageSize: pageSize,
26017
- onPageSizeChange: onPageSizeChange,
26018
- selectionModel: selectionModel,
26019
- onSelectionModelChange: (newSelectionModel, details) => {
25990
+ pageSizeOptions: pageSizeOptions,
25991
+ paginationModel: paginationModel,
25992
+ onPaginationModelChange: onPaginationModelChange,
25993
+ rowSelectionModel: rowSelectionModel,
25994
+ onRowSelectionModelChange: (newSelectionModel, details) => {
26020
25995
  if (pagination && paginationMode != 'server') {
26021
25996
  const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref => {
26022
25997
  let {
@@ -26074,7 +26049,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26074
26049
  };
26075
26050
  }
26076
26051
  }
26077
- onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
26052
+ onRowSelectionModelChange === null || onRowSelectionModelChange === void 0 ? void 0 : onRowSelectionModelChange(newSelectionModel, details);
26078
26053
  },
26079
26054
  sx: _objectSpread2(_objectSpread2({}, sx), {}, {
26080
26055
  '.MuiDataGrid-columnHeaders': {
@@ -26091,8 +26066,6 @@ DataGrid.className = CLASSNAME$2;
26091
26066
  DataGrid.displayName = COMPONENT_NAME$2;
26092
26067
 
26093
26068
  // Get and Set data from LocalStorage WITHOUT useState
26094
-
26095
- // triggering a state update and consecutive re-render
26096
26069
  const useFetchState = (defaultValue, key) => {
26097
26070
  let stickyValue = null;
26098
26071
  try {
@@ -26100,16 +26073,7 @@ const useFetchState = (defaultValue, key) => {
26100
26073
  } catch (e) {
26101
26074
  console.error('StatefulDataGrid: error getting item from local storage: ', e);
26102
26075
  }
26103
- let parsedValue = stickyValue !== null && stickyValue !== undefined && stickyValue !== 'undefined' ? JSON.parse(stickyValue) : defaultValue;
26104
-
26105
- // TODO: temporary workaround to avoid clashes when someone had sorting on the now-removed screenshot field (renamed to num_annotations)
26106
- // Consider upgrading the Datagrid component library as the exception handling was added in this PR: https://github.com/mui-org/material-ui-x/pull/3224
26107
- if (parsedValue instanceof Array) {
26108
- const fields = (parsedValue || []).map(item => item.field);
26109
- if (fields.includes('screenshot') || fields.includes('diffs')) {
26110
- parsedValue = defaultValue;
26111
- }
26112
- }
26076
+ const parsedValue = stickyValue !== null && stickyValue !== undefined && stickyValue !== 'undefined' ? JSON.parse(stickyValue) : defaultValue;
26113
26077
  const updateValue = useCallback(value => {
26114
26078
  try {
26115
26079
  window.localStorage.setItem(key, JSON.stringify(value));
@@ -26120,6 +26084,8 @@ const useFetchState = (defaultValue, key) => {
26120
26084
  return [parsedValue, updateValue];
26121
26085
  };
26122
26086
 
26087
+ // import useLocalStorage from './useLocalStorage';
26088
+
26123
26089
  const useTableStates = (id, version, customDefaults) => {
26124
26090
  const [paginationModel, setPaginationModel] = useFetchState('', buildStorageKey({
26125
26091
  id,
@@ -26175,8 +26141,7 @@ const useStatefulTable = props => {
26175
26141
  onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
26176
26142
  onColumnWidthChange: propsOnColumnWidthChange,
26177
26143
  onFilterModelChange: propsOnFilterModelChange,
26178
- onPageChange: propsOnPageChange,
26179
- onPageSizeChange: propsOnPageSizeChange,
26144
+ onPaginationModelChange: propsOnPaginationModelChange,
26180
26145
  onPinnedColumnsChange: propsOnPinnedColumnsChange,
26181
26146
  onSortModelChange: propsOnSortModelChange,
26182
26147
  pinnedCustomColumns = {
@@ -26247,7 +26212,6 @@ const useStatefulTable = props => {
26247
26212
  column.width = dimensionModel[column.field] || column.width || 100;
26248
26213
  return column;
26249
26214
  }), [propsColumns, dimensionModel]);
26250
-
26251
26215
  /** Add resetPage method to apiRef. */
26252
26216
  apiRef.current.resetPage = () => {
26253
26217
  apiRef.current.setPage(0);
@@ -26258,7 +26222,7 @@ const useStatefulTable = props => {
26258
26222
  onFilterModelChange: (model, details) => {
26259
26223
  const filterModel = _objectSpread2(_objectSpread2({}, model), {}, {
26260
26224
  items: model.items.map(item => {
26261
- const column = apiRef.current.getColumn(item.columnField);
26225
+ const column = apiRef.current.getColumn(item.field);
26262
26226
  item.type = column.type || 'string';
26263
26227
  return item;
26264
26228
  })
@@ -26295,33 +26259,16 @@ const useStatefulTable = props => {
26295
26259
  }, search, historyReplace, columns);
26296
26260
  },
26297
26261
  pinnedColumns: pinnedColumnsModel,
26298
- page: paginationModelParsed.page,
26299
- pageSize: paginationModelParsed.pageSize,
26300
- onPageChange: (page, details) => {
26301
- const direction = paginationModelParsed.page < page ? 'next' : 'back';
26302
- propsOnPageChange === null || propsOnPageChange === void 0 ? void 0 : propsOnPageChange(page, details);
26303
- updateUrl({
26304
- filterModel: filterParsed,
26305
- sortModel: sortModelParsed,
26306
- paginationModel: {
26307
- page,
26308
- pageSize: paginationModelParsed.pageSize,
26309
- direction
26310
- },
26311
- columnsModel: apiRef.current.state.columns.columnVisibilityModel,
26312
- pinnedColumnsModel: pinnedColumnsModel
26313
- }, search, historyReplace, columns);
26314
- },
26315
- onPageSizeChange: (pageSize, details) => {
26316
- propsOnPageSizeChange === null || propsOnPageSizeChange === void 0 ? void 0 : propsOnPageSizeChange(pageSize, details);
26262
+ paginationModel: paginationModelParsed,
26263
+ onPaginationModelChange: (model, details) => {
26264
+ const paginationModel = _objectSpread2(_objectSpread2({}, model), {}, {
26265
+ direction: paginationModelParsed.page < model.page ? 'next' : 'back'
26266
+ });
26267
+ propsOnPaginationModelChange === null || propsOnPaginationModelChange === void 0 ? void 0 : propsOnPaginationModelChange(paginationModel, details);
26317
26268
  updateUrl({
26318
26269
  filterModel: filterParsed,
26319
26270
  sortModel: sortModelParsed,
26320
- paginationModel: {
26321
- page: paginationModelParsed.page,
26322
- pageSize,
26323
- direction: paginationModelParsed.direction
26324
- },
26271
+ paginationModel: paginationModel,
26325
26272
  columnsModel: apiRef.current.state.columns.columnVisibilityModel,
26326
26273
  pinnedColumnsModel: pinnedColumnsModel
26327
26274
  }, search, historyReplace, columns);
@@ -26347,7 +26294,7 @@ const useStatefulTable = props => {
26347
26294
  };
26348
26295
  };
26349
26296
 
26350
- const _excluded$1 = ["apiRef", "autoHeight", "className", "columns", "columnTypes", "components", "componentsProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "page", "pageSize", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "localStorageVersion", "onFilterModelChange", "selectionModel", "onColumnWidthChange", "onPageChange", "onPageSizeChange", "onSelectionModelChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "pagination", "paginationPlacement", "paginationProps", "pinnedCustomColumns", "rows", "rowsPerPageOptions", "sx", "theme", "useRouter", "paginationMode", "rowCount"];
26297
+ const _excluded$1 = ["apiRef", "autoHeight", "className", "columns", "slots", "slotProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "paginationModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "localStorageVersion", "onFilterModelChange", "rowSelectionModel", "onColumnWidthChange", "onPaginationModelChange", "onRowSelectionModelChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "pagination", "paginationPlacement", "paginationProps", "pinnedCustomColumns", "rows", "pageSizeOptions", "sx", "theme", "useRouter", "paginationMode", "rowCount"];
26351
26298
  const COMPONENT_NAME$1 = 'DataGrid';
26352
26299
  const CLASSNAME$1 = 'redsift-datagrid';
26353
26300
  const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
@@ -26357,15 +26304,13 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26357
26304
  autoHeight,
26358
26305
  className,
26359
26306
  columns,
26360
- columnTypes: propsColumnTypes,
26361
- components,
26362
- componentsProps,
26307
+ slots,
26308
+ slotProps,
26363
26309
  filterModel: propsFilterModel,
26364
26310
  columnVisibilityModel: propsColumnVisibilityModel,
26365
26311
  pinnedColumns: propsPinnedColumns,
26366
26312
  sortModel: propsSortModel,
26367
- page: propsPage,
26368
- pageSize: propsPageSize,
26313
+ paginationModel: propsPaginationModel,
26369
26314
  height: propsHeight,
26370
26315
  hideToolbar,
26371
26316
  initialState,
@@ -26373,11 +26318,10 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26373
26318
  license = process.env.MUI_LICENSE_KEY,
26374
26319
  localStorageVersion,
26375
26320
  onFilterModelChange: propsOnFilterModelChange,
26376
- selectionModel: propsSelectionModel,
26321
+ rowSelectionModel: propsSelectionModel,
26377
26322
  onColumnWidthChange: propsOnColumnWidthChange,
26378
- onPageChange: propsOnPageChange,
26379
- onPageSizeChange: propsOnPageSizeChange,
26380
- onSelectionModelChange,
26323
+ onPaginationModelChange: propsOnPaginationModelChange,
26324
+ onRowSelectionModelChange,
26381
26325
  onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
26382
26326
  onPinnedColumnsChange: propsOnPinnedColumnsChange,
26383
26327
  onSortModelChange: propsOnSortModelChange,
@@ -26386,7 +26330,7 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26386
26330
  paginationProps,
26387
26331
  pinnedCustomColumns,
26388
26332
  rows,
26389
- rowsPerPageOptions,
26333
+ pageSizeOptions,
26390
26334
  sx,
26391
26335
  theme: propsTheme,
26392
26336
  useRouter,
@@ -26397,43 +26341,38 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26397
26341
  const theme = useTheme$4(propsTheme);
26398
26342
  const _apiRef = useGridApiRef();
26399
26343
  const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
26400
- const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$2;
26344
+ const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$2;
26401
26345
  LicenseInfo.setLicenseKey(license);
26402
26346
  const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
26403
26347
  const {
26404
26348
  onColumnVisibilityModelChange: controlledOnColumnVisibilityModelChange,
26405
26349
  onFilterModelChange: controlledOnFilterModelChange,
26406
- onPageChange: controlledOnPageChange,
26407
- onPageSizeChange: controlledOnPageSizeChange,
26350
+ onPaginationModelChange: controlledOnPaginationModelChange,
26408
26351
  onPinnedColumnsChange: controlledOnPinnedColumnsChange,
26409
26352
  onSortModelChange: controlledOnSortModelChange
26410
26353
  } = useControlledDatagridState({
26411
26354
  initialState,
26412
- rowsPerPageOptions,
26355
+ pageSizeOptions,
26413
26356
  propsColumnVisibilityModel,
26414
26357
  propsFilterModel,
26415
26358
  propsOnColumnVisibilityModelChange,
26416
26359
  propsOnFilterModelChange,
26417
26360
  propsOnPinnedColumnsChange,
26418
26361
  propsOnSortModelChange,
26419
- propsPage,
26420
- propsPageSize,
26362
+ propsPaginationModel,
26421
26363
  propsPinnedColumns,
26422
26364
  propsSortModel,
26423
- propsOnPageChange,
26424
- propsOnPageSizeChange
26365
+ propsOnPaginationModelChange
26425
26366
  });
26426
26367
  const {
26427
26368
  columnVisibilityModel,
26428
26369
  filterModel,
26429
26370
  onColumnVisibilityModelChange,
26430
26371
  onFilterModelChange,
26431
- onPageChange,
26432
- onPageSizeChange,
26372
+ onPaginationModelChange,
26433
26373
  onPinnedColumnsChange,
26434
26374
  onSortModelChange,
26435
- page,
26436
- pageSize,
26375
+ paginationModel,
26437
26376
  pinnedColumns,
26438
26377
  sortModel,
26439
26378
  onColumnWidthChange
@@ -26443,33 +26382,32 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26443
26382
  onColumnVisibilityModelChange: controlledOnColumnVisibilityModelChange,
26444
26383
  onColumnWidthChange: propsOnColumnWidthChange,
26445
26384
  onFilterModelChange: controlledOnFilterModelChange,
26446
- onPageChange: controlledOnPageChange,
26447
- onPageSizeChange: controlledOnPageSizeChange,
26385
+ onPaginationModelChange: controlledOnPaginationModelChange,
26448
26386
  onPinnedColumnsChange: controlledOnPinnedColumnsChange,
26449
26387
  onSortModelChange: controlledOnSortModelChange,
26450
26388
  pinnedCustomColumns,
26451
26389
  useRouter: useRouter,
26452
26390
  localStorageVersion
26453
26391
  });
26454
- const [selectionModel, setSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
26392
+ const [rowSelectionModel, setRowSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
26455
26393
  useEffect(() => {
26456
- setSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
26394
+ setRowSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
26457
26395
  }, [propsSelectionModel]);
26458
26396
  const selectionStatus = useRef({
26459
26397
  type: 'none',
26460
26398
  numberOfSelectedRows: 0,
26461
26399
  numberOfSelectedRowsInPage: 0,
26462
- page,
26463
- pageSize: pageSize
26400
+ page: paginationModel.page,
26401
+ pageSize: paginationModel.pageSize
26464
26402
  });
26465
26403
 
26466
26404
  // in server-side pagination we want to update the selection status
26467
26405
  // every time we navigate between pages, resize our page or select something
26468
26406
  useEffect(() => {
26469
26407
  if (paginationMode == 'server') {
26470
- onServerSideSelectionStatusChange(Array.isArray(selectionModel) ? selectionModel : [selectionModel], apiRef, selectionStatus, isRowSelectable, page, pageSize);
26408
+ onServerSideSelectionStatusChange(Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel], apiRef, selectionStatus, isRowSelectable, paginationModel.page, paginationModel.pageSize);
26471
26409
  }
26472
- }, [selectionModel, page, pageSize]);
26410
+ }, [rowSelectionModel, paginationModel.page, paginationModel.pageSize]);
26473
26411
  if (!Array.isArray(rows)) {
26474
26412
  return null;
26475
26413
  }
@@ -26502,15 +26440,13 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26502
26440
  filterModel: filterModel,
26503
26441
  onColumnVisibilityModelChange: onColumnVisibilityModelChange,
26504
26442
  onFilterModelChange: onFilterModelChange,
26505
- onPageChange: onPageChange,
26506
- onPageSizeChange: onPageSizeChange,
26443
+ onPaginationModelChange: onPaginationModelChange,
26507
26444
  onPinnedColumnsChange: onPinnedColumnsChange,
26508
26445
  onSortModelChange: onSortModelChange,
26509
- page: page,
26510
- pageSize: pageSize,
26446
+ paginationModel: paginationModel,
26511
26447
  pinnedColumns: pinnedColumns,
26512
26448
  sortModel: sortModel,
26513
- rowsPerPageOptions: rowsPerPageOptions,
26449
+ pageSizeOptions: pageSizeOptions,
26514
26450
  onColumnWidthChange: onColumnWidthChange,
26515
26451
  initialState: initialState,
26516
26452
  isRowSelectable: isRowSelectable,
@@ -26521,58 +26457,55 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26521
26457
  rowCount: rowCount,
26522
26458
  autoHeight: autoHeight,
26523
26459
  checkboxSelectionVisibleOnly: Boolean(pagination),
26524
- columnTypes: _objectSpread2(_objectSpread2({}, customColumnTypes), propsColumnTypes),
26525
- components: _objectSpread2(_objectSpread2({
26526
- BaseButton,
26527
- BaseCheckbox,
26528
- // BaseTextField,
26529
- BasePopper,
26530
- ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26460
+ slots: _objectSpread2(_objectSpread2({
26461
+ baseButton: BaseButton,
26462
+ baseCheckbox: BaseCheckbox,
26463
+ // baseTextField,
26464
+ basePopper: BasePopper,
26465
+ columnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26531
26466
  displayName: "ColumnFilteredIcon"
26532
26467
  })),
26533
- ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26468
+ columnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26534
26469
  displayName: "ColumnSelectorIcon"
26535
26470
  })),
26536
- ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26471
+ columnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26537
26472
  displayName: "ColumnSortedAscendingIcon"
26538
26473
  })),
26539
- ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26474
+ columnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26540
26475
  displayName: "ColumnSortedDescendingIcon"
26541
26476
  })),
26542
- DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26477
+ densityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26543
26478
  displayName: "DensityCompactIcon"
26544
26479
  })),
26545
- DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26480
+ densityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26546
26481
  displayName: "DensityStandardIcon"
26547
26482
  })),
26548
- DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26483
+ densityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26549
26484
  displayName: "DensityComfortableIcon"
26550
26485
  })),
26551
- DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26486
+ detailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26552
26487
  displayName: "DetailPanelCollapseIcon"
26553
26488
  })),
26554
- DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26489
+ detailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26555
26490
  displayName: "DetailPanelExpandIcon"
26556
26491
  })),
26557
- ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26492
+ exportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
26558
26493
  displayName: "ExportIcon"
26559
26494
  })),
26560
- OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
26495
+ openFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
26561
26496
  displayName: "OpenFilterButtonIcon"
26562
26497
  }, props))
26563
- }, components), {}, {
26564
- Toolbar: ToolbarWrapper,
26565
- Pagination: props => {
26498
+ }, slots), {}, {
26499
+ toolbar: ToolbarWrapper,
26500
+ pagination: props => {
26566
26501
  return pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$2({}, props, {
26567
26502
  displaySelection: false,
26568
26503
  displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
26569
26504
  displayPagination: ['bottom', 'both'].includes(paginationPlacement),
26570
26505
  selectionStatus: selectionStatus.current,
26571
- page: page,
26572
- pageSize: pageSize,
26573
- onPageChange: onPageChange,
26574
- onPageSizeChange: onPageSizeChange,
26575
- rowsPerPageOptions: rowsPerPageOptions,
26506
+ paginationModel: paginationModel,
26507
+ onPaginationModelChange: onPaginationModelChange,
26508
+ pageSizeOptions: pageSizeOptions,
26576
26509
  paginationProps: paginationProps,
26577
26510
  paginationMode: paginationMode,
26578
26511
  rowCount: rowCount
@@ -26583,17 +26516,15 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26583
26516
  selectionStatus: selectionStatus.current,
26584
26517
  apiRef: apiRef,
26585
26518
  isRowSelectable: isRowSelectable,
26586
- page: page,
26587
- pageSize: pageSize,
26588
- onPageChange: onPageChange,
26589
- onPageSizeChange: onPageSizeChange,
26590
- rowsPerPageOptions: rowsPerPageOptions,
26519
+ paginationModel: paginationModel,
26520
+ onPaginationModelChange: onPaginationModelChange,
26521
+ pageSizeOptions: pageSizeOptions,
26591
26522
  paginationProps: paginationProps,
26592
26523
  paginationMode: paginationMode
26593
26524
  })) : null;
26594
26525
  }
26595
26526
  }),
26596
- componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
26527
+ slotProps: _objectSpread2(_objectSpread2({}, slotProps), {}, {
26597
26528
  toolbar: _objectSpread2({
26598
26529
  hideToolbar,
26599
26530
  RenderedToolbar,
@@ -26604,18 +26535,16 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26604
26535
  selectionStatus,
26605
26536
  apiRef,
26606
26537
  isRowSelectable,
26607
- page,
26608
- pageSize,
26609
- onPageChange,
26610
- onPageSizeChange,
26611
- rowsPerPageOptions,
26538
+ paginationModel,
26539
+ onPaginationModelChange,
26540
+ pageSizeOptions,
26612
26541
  paginationProps,
26613
26542
  paginationMode,
26614
26543
  rowCount
26615
- }, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
26544
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar)
26616
26545
  }),
26617
- selectionModel: selectionModel,
26618
- onSelectionModelChange: (newSelectionModel, details) => {
26546
+ rowSelectionModel: rowSelectionModel,
26547
+ onRowSelectionModelChange: (newSelectionModel, details) => {
26619
26548
  if (pagination && paginationMode != 'server') {
26620
26549
  const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref => {
26621
26550
  let {
@@ -26673,7 +26602,7 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
26673
26602
  };
26674
26603
  }
26675
26604
  }
26676
- onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
26605
+ onRowSelectionModelChange === null || onRowSelectionModelChange === void 0 ? void 0 : onRowSelectionModelChange(newSelectionModel, details);
26677
26606
  },
26678
26607
  sx: _objectSpread2(_objectSpread2({}, sx), {}, {
26679
26608
  '.MuiDataGrid-columnHeaders': {
@@ -26747,5 +26676,5 @@ const TextCell = /*#__PURE__*/forwardRef((props, ref) => {
26747
26676
  TextCell.className = CLASSNAME;
26748
26677
  TextCell.displayName = COMPONENT_NAME;
26749
26678
 
26750
- export { BaseButton, BaseCheckbox, BaseIcon, BasePopper, BaseTextField, CATEGORIES, CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, ControlledPagination, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DIMENSION_MODEL_KEY, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DataGrid, ENDS_WITH_ANY_OF, FILTER_MODEL_KEY, FILTER_SEARCH_KEY, GridToolbarFilterSemanticField, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, PAGINATION_MODEL_KEY, PINNED_COLUMNS, SORT_MODEL_KEY, STARTS_WITH_ANY_OF, ServerSideControlledPagination, StatefulDataGrid, TextCell, Toolbar$2 as Toolbar, ToolbarWrapper, VISIBILITY_MODEL_KEY, areFilterModelsEquivalent, buildStorageKey, clearPreviousVersionStorage, customColumnTypes, decodeValue, encodeValue, getColumnVisibilityFromString, getCompletion, getFilterModelFromString, getFinalSearch, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, getModelsParsedOrUpdateLocalStorage, getPaginationFromString, getPinnedColumnsFromString, getRsNumberColumnType, getRsStringColumnType, getSearchParamsFromColumnVisibility, getSearchParamsFromFilterModel, getSearchParamsFromPagination, getSearchParamsFromPinnedColumns, getSearchParamsFromSorting, getSearchParamsFromTab, getSortingFromString, muiIconToDSIcon, numberOperatorDecoder, numberOperatorEncoder, onServerSideSelectionStatusChange, operatorList, updateUrl, urlSearchParamsToString };
26679
+ export { BaseButton, BaseCheckbox, BaseIcon, BasePopper, BaseTextField, CATEGORIES, CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, ControlledPagination, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DIMENSION_MODEL_KEY, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DataGrid, ENDS_WITH_ANY_OF, FILTER_MODEL_KEY, FILTER_SEARCH_KEY, GridToolbarFilterSemanticField, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, PAGINATION_MODEL_KEY, PINNED_COLUMNS, SORT_MODEL_KEY, STARTS_WITH_ANY_OF, ServerSideControlledPagination, StatefulDataGrid, TextCell, Toolbar$2 as Toolbar, ToolbarWrapper, VISIBILITY_MODEL_KEY, areFilterModelsEquivalent, buildStorageKey, clearPreviousVersionStorage, customColumnTypes, decodeValue, encodeValue, getColumnVisibilityFromString, getCompletion, getFilterModelFromString, getFinalSearch, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, getModelsParsedOrUpdateLocalStorage, getPaginationFromString, getPinnedColumnsFromString, getRsNumberColumnType, getRsStringColumnType, getSearchParamsFromColumnVisibility, getSearchParamsFromFilterModel, getSearchParamsFromPagination, getSearchParamsFromPinnedColumns, getSearchParamsFromSorting, getSearchParamsFromTab, getSortingFromString, isOperatorValueValid, isValueValid, muiIconToDSIcon, numberOperatorDecoder, numberOperatorEncoder, onServerSideSelectionStatusChange, operatorList, updateUrl, urlSearchParamsToString };
26751
26680
  //# sourceMappingURL=index.js.map