@redsift/table 10.8.2 → 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.
Files changed (4) hide show
  1. package/index.d.ts +43 -8
  2. package/index.js +1331 -280
  3. package/index.js.map +1 -1
  4. package/package.json +6 -6
package/index.js CHANGED
@@ -1,9 +1,8 @@
1
- import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, useGridApiRef, DataGridPro, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector } from '@mui/x-data-grid-pro';
2
- export * from '@mui/x-data-grid-pro';
1
+ import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, 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';
6
- import { Icon, baseContainer, Theme, AppContainerContext, useTheme as useTheme$4, useId as useId$2, partitionComponents, isComponent, Flexbox, TextField as TextField$2, Button, Switch, Text, ButtonsColorPalette, IconButton as IconButton$2, Checkbox, ThemeProvider as ThemeProvider$4, LinkButton, RedsiftColorBlueN, RedsiftColorNeutralXDarkGrey, RedsiftColorNeutralWhite, Shield } from '@redsift/design-system';
5
+ import { Icon, baseContainer, Theme, AppContainerContext, useTheme as useTheme$4, useId as useId$2, partitionComponents, isComponent, Flexbox, TextField as TextField$2, Button, Switch, Text, ButtonsColorPalette, IconButton as IconButton$2, Checkbox, LinkButton, ThemeProvider as ThemeProvider$4, RedsiftColorBlueN, RedsiftColorNeutralXDarkGrey, RedsiftColorNeutralWhite, Shield } from '@redsift/design-system';
7
6
  import { mdiSync, mdiFilterVariant, mdiViewColumn, mdiChevronUp, mdiChevronDown, mdiViewHeadline, mdiViewSequential, mdiViewStream, mdiChevronRight, mdiTrayArrowDown } from '@redsift/icons';
8
7
  import emStyled from '@emotion/styled';
9
8
  import { Global, ThemeContext as ThemeContext$3, keyframes } from '@emotion/react';
@@ -3625,7 +3624,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
3625
3624
  return target;
3626
3625
  }
3627
3626
 
3628
- const _excluded$Q = ["values", "unit", "step"];
3627
+ const _excluded$R = ["values", "unit", "step"];
3629
3628
  const sortBreakpointsValues = values => {
3630
3629
  const breakpointsAsArray = Object.keys(values).map(key => ({
3631
3630
  key,
@@ -3660,7 +3659,7 @@ function createBreakpoints(breakpoints) {
3660
3659
  unit = 'px',
3661
3660
  step = 5
3662
3661
  } = breakpoints,
3663
- other = _objectWithoutPropertiesLoose(breakpoints, _excluded$Q);
3662
+ other = _objectWithoutPropertiesLoose(breakpoints, _excluded$R);
3664
3663
  const sortedValues = sortBreakpointsValues(values);
3665
3664
  const keys = Object.keys(sortedValues);
3666
3665
  function up(key) {
@@ -4689,7 +4688,7 @@ const styleFunctionSx = unstable_createStyleFunctionSx();
4689
4688
  styleFunctionSx.filterProps = ['sx'];
4690
4689
  var styleFunctionSx$1 = styleFunctionSx;
4691
4690
 
4692
- const _excluded$P = ["breakpoints", "palette", "spacing", "shape"];
4691
+ const _excluded$Q = ["breakpoints", "palette", "spacing", "shape"];
4693
4692
  function createTheme$1(options = {}, ...args) {
4694
4693
  const {
4695
4694
  breakpoints: breakpointsInput = {},
@@ -4697,7 +4696,7 @@ function createTheme$1(options = {}, ...args) {
4697
4696
  spacing: spacingInput,
4698
4697
  shape: shapeInput = {}
4699
4698
  } = options,
4700
- other = _objectWithoutPropertiesLoose(options, _excluded$P);
4699
+ other = _objectWithoutPropertiesLoose(options, _excluded$Q);
4701
4700
  const breakpoints = createBreakpoints(breakpointsInput);
4702
4701
  const spacing = createSpacing(spacingInput);
4703
4702
  let muiTheme = deepmerge({
@@ -4765,7 +4764,7 @@ process.env.NODE_ENV !== "production" ? GlobalStyles$1.propTypes /* remove-propt
4765
4764
  themeId: PropTypes.string
4766
4765
  } : void 0;
4767
4766
 
4768
- const _excluded$O = ["sx"];
4767
+ const _excluded$P = ["sx"];
4769
4768
  const splitProps = props => {
4770
4769
  var _props$theme$unstable, _props$theme;
4771
4770
  const result = {
@@ -4786,7 +4785,7 @@ function extendSxProp(props) {
4786
4785
  const {
4787
4786
  sx: inSx
4788
4787
  } = props,
4789
- other = _objectWithoutPropertiesLoose(props, _excluded$O);
4788
+ other = _objectWithoutPropertiesLoose(props, _excluded$P);
4790
4789
  const {
4791
4790
  systemProps,
4792
4791
  otherProps
@@ -4812,7 +4811,7 @@ function extendSxProp(props) {
4812
4811
 
4813
4812
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
4814
4813
 
4815
- const _excluded$N = ["className", "component"];
4814
+ const _excluded$O = ["className", "component"];
4816
4815
  function createBox(options = {}) {
4817
4816
  const {
4818
4817
  themeId,
@@ -4830,7 +4829,7 @@ function createBox(options = {}) {
4830
4829
  className,
4831
4830
  component = 'div'
4832
4831
  } = _extendSxProp,
4833
- other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$N);
4832
+ other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$O);
4834
4833
  return /*#__PURE__*/jsxRuntimeExports.jsx(BoxRoot, _extends$1({
4835
4834
  as: component,
4836
4835
  ref: ref,
@@ -4841,7 +4840,7 @@ function createBox(options = {}) {
4841
4840
  return Box;
4842
4841
  }
4843
4842
 
4844
- const _excluded$M = ["variant"];
4843
+ const _excluded$N = ["variant"];
4845
4844
  function isEmpty$3(string) {
4846
4845
  return string.length === 0;
4847
4846
  }
@@ -4855,7 +4854,7 @@ function propsToClassKey(props) {
4855
4854
  const {
4856
4855
  variant
4857
4856
  } = props,
4858
- other = _objectWithoutPropertiesLoose(props, _excluded$M);
4857
+ other = _objectWithoutPropertiesLoose(props, _excluded$N);
4859
4858
  let classKey = variant || '';
4860
4859
  Object.keys(other).sort().forEach(key => {
4861
4860
  if (key === 'color') {
@@ -4867,7 +4866,7 @@ function propsToClassKey(props) {
4867
4866
  return classKey;
4868
4867
  }
4869
4868
 
4870
- const _excluded$L = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
4869
+ const _excluded$M = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
4871
4870
  function isEmpty$2(obj) {
4872
4871
  return Object.keys(obj).length === 0;
4873
4872
  }
@@ -4962,7 +4961,7 @@ function createStyled(input = {}) {
4962
4961
  skipSx: inputSkipSx,
4963
4962
  overridesResolver
4964
4963
  } = inputOptions,
4965
- options = _objectWithoutPropertiesLoose(inputOptions, _excluded$L);
4964
+ options = _objectWithoutPropertiesLoose(inputOptions, _excluded$M);
4966
4965
 
4967
4966
  // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
4968
4967
  const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
@@ -5639,7 +5638,7 @@ const green = {
5639
5638
  };
5640
5639
  var green$1 = green;
5641
5640
 
5642
- const _excluded$K = ["mode", "contrastThreshold", "tonalOffset"];
5641
+ const _excluded$L = ["mode", "contrastThreshold", "tonalOffset"];
5643
5642
  const light = {
5644
5643
  // The colors used to style the text.
5645
5644
  text: {
@@ -5808,7 +5807,7 @@ function createPalette(palette) {
5808
5807
  contrastThreshold = 3,
5809
5808
  tonalOffset = 0.2
5810
5809
  } = palette,
5811
- other = _objectWithoutPropertiesLoose(palette, _excluded$K);
5810
+ other = _objectWithoutPropertiesLoose(palette, _excluded$L);
5812
5811
  const primary = palette.primary || getDefaultPrimary(mode);
5813
5812
  const secondary = palette.secondary || getDefaultSecondary(mode);
5814
5813
  const error = palette.error || getDefaultError(mode);
@@ -5932,7 +5931,7 @@ const theme2 = createTheme({ palette: {
5932
5931
  return paletteOutput;
5933
5932
  }
5934
5933
 
5935
- const _excluded$J = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
5934
+ const _excluded$K = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
5936
5935
  function round$2(value) {
5937
5936
  return Math.round(value * 1e5) / 1e5;
5938
5937
  }
@@ -5963,7 +5962,7 @@ function createTypography(palette, typography) {
5963
5962
  allVariants,
5964
5963
  pxToRem: pxToRem2
5965
5964
  } = _ref,
5966
- other = _objectWithoutPropertiesLoose(_ref, _excluded$J);
5965
+ other = _objectWithoutPropertiesLoose(_ref, _excluded$K);
5967
5966
  if (process.env.NODE_ENV !== 'production') {
5968
5967
  if (typeof fontSize !== 'number') {
5969
5968
  console.error('MUI: `fontSize` is required to be a number.');
@@ -6030,7 +6029,7 @@ function createShadow(...px) {
6030
6029
  const shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
6031
6030
  var shadows$1 = shadows;
6032
6031
 
6033
- const _excluded$I = ["duration", "easing", "delay"];
6032
+ const _excluded$J = ["duration", "easing", "delay"];
6034
6033
  // Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
6035
6034
  // to learn the context in which each easing should be used.
6036
6035
  const easing = {
@@ -6081,7 +6080,7 @@ function createTransitions(inputTransitions) {
6081
6080
  easing: easingOption = mergedEasing.easeInOut,
6082
6081
  delay = 0
6083
6082
  } = options,
6084
- other = _objectWithoutPropertiesLoose(options, _excluded$I);
6083
+ other = _objectWithoutPropertiesLoose(options, _excluded$J);
6085
6084
  if (process.env.NODE_ENV !== 'production') {
6086
6085
  const isString = value => typeof value === 'string';
6087
6086
  // IE11 support, replace with Number.isNaN
@@ -6128,7 +6127,7 @@ const zIndex = {
6128
6127
  };
6129
6128
  var zIndex$1 = zIndex;
6130
6129
 
6131
- const _excluded$H = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
6130
+ const _excluded$I = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
6132
6131
  function createTheme(options = {}, ...args) {
6133
6132
  const {
6134
6133
  mixins: mixinsInput = {},
@@ -6136,7 +6135,7 @@ function createTheme(options = {}, ...args) {
6136
6135
  transitions: transitionsInput = {},
6137
6136
  typography: typographyInput = {}
6138
6137
  } = options,
6139
- other = _objectWithoutPropertiesLoose(options, _excluded$H);
6138
+ other = _objectWithoutPropertiesLoose(options, _excluded$I);
6140
6139
  if (options.vars) {
6141
6140
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`vars\` is a private field used for CSS variables support.
6142
6141
  Please use another name.` : formatMuiErrorMessage(18));
@@ -6227,12 +6226,12 @@ const styled = createStyled({
6227
6226
  });
6228
6227
  var styled$1 = styled;
6229
6228
 
6230
- const _excluded$G = ["theme"];
6229
+ const _excluded$H = ["theme"];
6231
6230
  function ThemeProvider$1(_ref) {
6232
6231
  let {
6233
6232
  theme: themeInput
6234
6233
  } = _ref,
6235
- props = _objectWithoutPropertiesLoose(_ref, _excluded$G);
6234
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$H);
6236
6235
  const scopedTheme = themeInput[THEME_ID];
6237
6236
  return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$2, _extends$1({}, props, {
6238
6237
  themeId: scopedTheme ? THEME_ID : undefined,
@@ -6456,7 +6455,7 @@ function mergeSlotProps(parameters) {
6456
6455
  };
6457
6456
  }
6458
6457
 
6459
- const _excluded$F = ["elementType", "externalSlotProps", "ownerState"];
6458
+ const _excluded$G = ["elementType", "externalSlotProps", "ownerState"];
6460
6459
  /**
6461
6460
  * @ignore - do not document.
6462
6461
  * Builds the props to be passed into the slot of an unstyled component.
@@ -6472,7 +6471,7 @@ function useSlotProps(parameters) {
6472
6471
  externalSlotProps,
6473
6472
  ownerState
6474
6473
  } = parameters,
6475
- rest = _objectWithoutPropertiesLoose(parameters, _excluded$F);
6474
+ rest = _objectWithoutPropertiesLoose(parameters, _excluded$G);
6476
6475
  const resolvedComponentsProps = resolveComponentProps(externalSlotProps, ownerState);
6477
6476
  const {
6478
6477
  props: mergedProps,
@@ -8688,7 +8687,7 @@ function getPopperUtilityClass(slot) {
8688
8687
  }
8689
8688
  generateUtilityClasses('MuiPopper', ['root']);
8690
8689
 
8691
- const _excluded$E = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "placement", "popperOptions", "popperRef", "slotProps", "slots", "TransitionProps", "ownerState"],
8690
+ const _excluded$F = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "placement", "popperOptions", "popperRef", "slotProps", "slots", "TransitionProps", "ownerState"],
8692
8691
  _excluded2$3 = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition", "slotProps", "slots"];
8693
8692
  function flipPlacement(placement, direction) {
8694
8693
  if (direction === 'ltr') {
@@ -8741,7 +8740,7 @@ const PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props
8741
8740
  // @ts-ignore internal logic
8742
8741
  // prevent from spreading to DOM, it can come from the parent component e.g. Select.
8743
8742
  } = props,
8744
- other = _objectWithoutPropertiesLoose(props, _excluded$E);
8743
+ other = _objectWithoutPropertiesLoose(props, _excluded$F);
8745
8744
  const tooltipRef = React.useRef(null);
8746
8745
  const ownRef = useForkRef(tooltipRef, forwardedRef);
8747
8746
  const popperRef = React.useRef(null);
@@ -9268,7 +9267,7 @@ function getModalUtilityClass(slot) {
9268
9267
  }
9269
9268
  generateUtilityClasses('MuiModal', ['root', 'hidden', 'backdrop']);
9270
9269
 
9271
- const _excluded$D = ["children", "closeAfterTransition", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onKeyDown", "open", "onTransitionEnter", "onTransitionExited", "slotProps", "slots"];
9270
+ const _excluded$E = ["children", "closeAfterTransition", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onKeyDown", "open", "onTransitionEnter", "onTransitionExited", "slotProps", "slots"];
9272
9271
  const useUtilityClasses$o = ownerState => {
9273
9272
  const {
9274
9273
  open,
@@ -9337,7 +9336,7 @@ const Modal$2 = /*#__PURE__*/React.forwardRef(function Modal(props, forwardedRef
9337
9336
  slotProps = {},
9338
9337
  slots = {}
9339
9338
  } = props,
9340
- other = _objectWithoutPropertiesLoose(props, _excluded$D);
9339
+ other = _objectWithoutPropertiesLoose(props, _excluded$E);
9341
9340
  // TODO: `modal`` must change its type in this file to match the type of methods
9342
9341
  // provided by `ModalManager`
9343
9342
  const manager = managerProp;
@@ -9627,7 +9626,7 @@ process.env.NODE_ENV !== "production" ? Modal$2.propTypes /* remove-proptypes */
9627
9626
  } : void 0;
9628
9627
  var ModalUnstyled = Modal$2;
9629
9628
 
9630
- const _excluded$C = ["onChange", "maxRows", "minRows", "style", "value"];
9629
+ const _excluded$D = ["onChange", "maxRows", "minRows", "style", "value"];
9631
9630
  function getStyleValue(value) {
9632
9631
  return parseInt(value, 10) || 0;
9633
9632
  }
@@ -9669,7 +9668,7 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
9669
9668
  style,
9670
9669
  value
9671
9670
  } = props,
9672
- other = _objectWithoutPropertiesLoose(props, _excluded$C);
9671
+ other = _objectWithoutPropertiesLoose(props, _excluded$D);
9673
9672
  const {
9674
9673
  current: isControlled
9675
9674
  } = React.useRef(value != null);
@@ -9963,7 +9962,7 @@ function getInputBaseUtilityClass(slot) {
9963
9962
  const inputBaseClasses = generateUtilityClasses('MuiInputBase', ['root', 'formControl', 'focused', 'disabled', 'adornedStart', 'adornedEnd', 'error', 'sizeSmall', 'multiline', 'colorSecondary', 'fullWidth', 'hiddenLabel', 'readOnly', 'input', 'inputSizeSmall', 'inputMultiline', 'inputTypeSearch', 'inputAdornedStart', 'inputAdornedEnd', 'inputHiddenLabel']);
9964
9963
  var inputBaseClasses$1 = inputBaseClasses;
9965
9964
 
9966
- const _excluded$B = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "slotProps", "slots", "startAdornment", "type", "value"];
9965
+ const _excluded$C = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "slotProps", "slots", "startAdornment", "type", "value"];
9967
9966
  const rootOverridesResolver = (props, styles) => {
9968
9967
  const {
9969
9968
  ownerState
@@ -10194,7 +10193,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
10194
10193
  type = 'text',
10195
10194
  value: valueProp
10196
10195
  } = props,
10197
- other = _objectWithoutPropertiesLoose(props, _excluded$B);
10196
+ other = _objectWithoutPropertiesLoose(props, _excluded$C);
10198
10197
  const value = inputPropsProp.value != null ? inputPropsProp.value : valueProp;
10199
10198
  const {
10200
10199
  current: isControlled
@@ -10656,7 +10655,7 @@ function getInputUtilityClass(slot) {
10656
10655
  const inputClasses = _extends$1({}, inputBaseClasses$1, generateUtilityClasses('MuiInput', ['root', 'underline', 'input']));
10657
10656
  var inputClasses$1 = inputClasses;
10658
10657
 
10659
- const _excluded$A = ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "slotProps", "slots", "type"];
10658
+ const _excluded$B = ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "slotProps", "slots", "type"];
10660
10659
  const useUtilityClasses$m = ownerState => {
10661
10660
  const {
10662
10661
  classes,
@@ -10769,7 +10768,7 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
10769
10768
  slots = {},
10770
10769
  type = 'text'
10771
10770
  } = props,
10772
- other = _objectWithoutPropertiesLoose(props, _excluded$A);
10771
+ other = _objectWithoutPropertiesLoose(props, _excluded$B);
10773
10772
  const classes = useUtilityClasses$m(props);
10774
10773
  const ownerState = {
10775
10774
  disableUnderline
@@ -10992,7 +10991,7 @@ function getFilledInputUtilityClass(slot) {
10992
10991
  const filledInputClasses = _extends$1({}, inputBaseClasses$1, generateUtilityClasses('MuiFilledInput', ['root', 'underline', 'input']));
10993
10992
  var filledInputClasses$1 = filledInputClasses;
10994
10993
 
10995
- const _excluded$z = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "slotProps", "slots", "type"];
10994
+ const _excluded$A = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "slotProps", "slots", "type"];
10996
10995
  const useUtilityClasses$l = ownerState => {
10997
10996
  const {
10998
10997
  classes,
@@ -11176,7 +11175,7 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
11176
11175
  slots = {},
11177
11176
  type = 'text'
11178
11177
  } = props,
11179
- other = _objectWithoutPropertiesLoose(props, _excluded$z);
11178
+ other = _objectWithoutPropertiesLoose(props, _excluded$A);
11180
11179
  const ownerState = _extends$1({}, props, {
11181
11180
  fullWidth,
11182
11181
  inputComponent,
@@ -11407,7 +11406,7 @@ FilledInput.muiName = 'Input';
11407
11406
  var FilledInput$1 = FilledInput;
11408
11407
 
11409
11408
  var _span$2;
11410
- const _excluded$y = ["children", "classes", "className", "label", "notched"];
11409
+ const _excluded$z = ["children", "classes", "className", "label", "notched"];
11411
11410
  const NotchedOutlineRoot$1 = styled$1('fieldset')({
11412
11411
  textAlign: 'left',
11413
11412
  position: 'absolute',
@@ -11480,7 +11479,7 @@ function NotchedOutline(props) {
11480
11479
  label,
11481
11480
  notched
11482
11481
  } = props,
11483
- other = _objectWithoutPropertiesLoose(props, _excluded$y);
11482
+ other = _objectWithoutPropertiesLoose(props, _excluded$z);
11484
11483
  const withLabel = label != null && label !== '';
11485
11484
  const ownerState = _extends$1({}, props, {
11486
11485
  notched,
@@ -11537,7 +11536,7 @@ function getOutlinedInputUtilityClass(slot) {
11537
11536
  const outlinedInputClasses = _extends$1({}, inputBaseClasses$1, generateUtilityClasses('MuiOutlinedInput', ['root', 'notchedOutline', 'input']));
11538
11537
  var outlinedInputClasses$1 = outlinedInputClasses;
11539
11538
 
11540
- const _excluded$x = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"];
11539
+ const _excluded$y = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"];
11541
11540
  const useUtilityClasses$k = ownerState => {
11542
11541
  const {
11543
11542
  classes
@@ -11656,7 +11655,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
11656
11655
  slots = {},
11657
11656
  type = 'text'
11658
11657
  } = props,
11659
- other = _objectWithoutPropertiesLoose(props, _excluded$x);
11658
+ other = _objectWithoutPropertiesLoose(props, _excluded$y);
11660
11659
  const classes = useUtilityClasses$k(props);
11661
11660
  const muiFormControl = useFormControl();
11662
11661
  const fcs = formControlState({
@@ -11877,7 +11876,7 @@ function getFormLabelUtilityClasses(slot) {
11877
11876
  const formLabelClasses = generateUtilityClasses('MuiFormLabel', ['root', 'colorSecondary', 'focused', 'disabled', 'error', 'filled', 'required', 'asterisk']);
11878
11877
  var formLabelClasses$1 = formLabelClasses;
11879
11878
 
11880
- const _excluded$w = ["children", "className", "color", "component", "disabled", "error", "filled", "focused", "required"];
11879
+ const _excluded$x = ["children", "className", "color", "component", "disabled", "error", "filled", "focused", "required"];
11881
11880
  const useUtilityClasses$j = ownerState => {
11882
11881
  const {
11883
11882
  classes,
@@ -11942,7 +11941,7 @@ const FormLabel = /*#__PURE__*/React.forwardRef(function FormLabel(inProps, ref)
11942
11941
  className,
11943
11942
  component = 'label'
11944
11943
  } = props,
11945
- other = _objectWithoutPropertiesLoose(props, _excluded$w);
11944
+ other = _objectWithoutPropertiesLoose(props, _excluded$x);
11946
11945
  const muiFormControl = useFormControl();
11947
11946
  const fcs = formControlState({
11948
11947
  props,
@@ -12033,7 +12032,7 @@ function getInputLabelUtilityClasses(slot) {
12033
12032
  }
12034
12033
  generateUtilityClasses('MuiInputLabel', ['root', 'focused', 'disabled', 'error', 'required', 'asterisk', 'formControl', 'sizeSmall', 'shrink', 'animated', 'standard', 'filled', 'outlined']);
12035
12034
 
12036
- const _excluded$v = ["disableAnimation", "margin", "shrink", "variant", "className"];
12035
+ const _excluded$w = ["disableAnimation", "margin", "shrink", "variant", "className"];
12037
12036
  const useUtilityClasses$i = ownerState => {
12038
12037
  const {
12039
12038
  classes,
@@ -12135,7 +12134,7 @@ const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, re
12135
12134
  shrink: shrinkProp,
12136
12135
  className
12137
12136
  } = props,
12138
- other = _objectWithoutPropertiesLoose(props, _excluded$v);
12137
+ other = _objectWithoutPropertiesLoose(props, _excluded$w);
12139
12138
  const muiFormControl = useFormControl();
12140
12139
  let shrink = shrinkProp;
12141
12140
  if (typeof shrink === 'undefined' && muiFormControl) {
@@ -12238,7 +12237,7 @@ function getFormControlUtilityClasses(slot) {
12238
12237
  }
12239
12238
  generateUtilityClasses('MuiFormControl', ['root', 'marginNone', 'marginNormal', 'marginDense', 'fullWidth', 'disabled']);
12240
12239
 
12241
- const _excluded$u = ["children", "className", "color", "component", "disabled", "error", "focused", "fullWidth", "hiddenLabel", "margin", "required", "size", "variant"];
12240
+ const _excluded$v = ["children", "className", "color", "component", "disabled", "error", "focused", "fullWidth", "hiddenLabel", "margin", "required", "size", "variant"];
12242
12241
  const useUtilityClasses$h = ownerState => {
12243
12242
  const {
12244
12243
  classes,
@@ -12324,7 +12323,7 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
12324
12323
  size = 'medium',
12325
12324
  variant = 'outlined'
12326
12325
  } = props,
12327
- other = _objectWithoutPropertiesLoose(props, _excluded$u);
12326
+ other = _objectWithoutPropertiesLoose(props, _excluded$v);
12328
12327
  const ownerState = _extends$1({}, props, {
12329
12328
  color,
12330
12329
  component,
@@ -12520,7 +12519,7 @@ const formHelperTextClasses = generateUtilityClasses('MuiFormHelperText', ['root
12520
12519
  var formHelperTextClasses$1 = formHelperTextClasses;
12521
12520
 
12522
12521
  var _span$1;
12523
- const _excluded$t = ["children", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"];
12522
+ const _excluded$u = ["children", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"];
12524
12523
  const useUtilityClasses$g = ownerState => {
12525
12524
  const {
12526
12525
  classes,
@@ -12579,7 +12578,7 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
12579
12578
  className,
12580
12579
  component = 'p'
12581
12580
  } = props,
12582
- other = _objectWithoutPropertiesLoose(props, _excluded$t);
12581
+ other = _objectWithoutPropertiesLoose(props, _excluded$u);
12583
12582
  const muiFormControl = useFormControl();
12584
12583
  const fcs = formControlState({
12585
12584
  props,
@@ -12685,7 +12684,7 @@ function getListUtilityClass(slot) {
12685
12684
  }
12686
12685
  generateUtilityClasses('MuiList', ['root', 'padding', 'dense', 'subheader']);
12687
12686
 
12688
- const _excluded$s = ["children", "className", "component", "dense", "disablePadding", "subheader"];
12687
+ const _excluded$t = ["children", "className", "component", "dense", "disablePadding", "subheader"];
12689
12688
  const useUtilityClasses$f = ownerState => {
12690
12689
  const {
12691
12690
  classes,
@@ -12733,7 +12732,7 @@ const List = /*#__PURE__*/React.forwardRef(function List(inProps, ref) {
12733
12732
  disablePadding = false,
12734
12733
  subheader
12735
12734
  } = props,
12736
- other = _objectWithoutPropertiesLoose(props, _excluded$s);
12735
+ other = _objectWithoutPropertiesLoose(props, _excluded$t);
12737
12736
  const context = React.useMemo(() => ({
12738
12737
  dense
12739
12738
  }), [dense]);
@@ -12800,7 +12799,7 @@ process.env.NODE_ENV !== "production" ? List.propTypes /* remove-proptypes */ =
12800
12799
  } : void 0;
12801
12800
  var List$1 = List;
12802
12801
 
12803
- const _excluded$r = ["actions", "autoFocus", "autoFocusItem", "children", "className", "disabledItemsFocusable", "disableListWrap", "onKeyDown", "variant"];
12802
+ const _excluded$s = ["actions", "autoFocus", "autoFocusItem", "children", "className", "disabledItemsFocusable", "disableListWrap", "onKeyDown", "variant"];
12804
12803
  function nextItem(list, item, disableListWrap) {
12805
12804
  if (list === item) {
12806
12805
  return list.firstChild;
@@ -12882,7 +12881,7 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
12882
12881
  onKeyDown,
12883
12882
  variant = 'selectedMenu'
12884
12883
  } = props,
12885
- other = _objectWithoutPropertiesLoose(props, _excluded$r);
12884
+ other = _objectWithoutPropertiesLoose(props, _excluded$s);
12886
12885
  const listRef = React.useRef(null);
12887
12886
  const textCriteriaRef = React.useRef({
12888
12887
  keys: [],
@@ -14072,7 +14071,7 @@ function getTransitionProps(props, options) {
14072
14071
  };
14073
14072
  }
14074
14073
 
14075
- const _excluded$q = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
14074
+ const _excluded$r = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
14076
14075
  function getScale$1(value) {
14077
14076
  return `scale(${value}, ${value ** 2})`;
14078
14077
  }
@@ -14116,7 +14115,7 @@ const Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {
14116
14115
  // eslint-disable-next-line react/prop-types
14117
14116
  TransitionComponent = Transition$1
14118
14117
  } = props,
14119
- other = _objectWithoutPropertiesLoose(props, _excluded$q);
14118
+ other = _objectWithoutPropertiesLoose(props, _excluded$r);
14120
14119
  const timer = React.useRef();
14121
14120
  const autoTimeout = React.useRef();
14122
14121
  const theme = useTheme();
@@ -14320,7 +14319,7 @@ process.env.NODE_ENV !== "production" ? Grow.propTypes /* remove-proptypes */ =
14320
14319
  Grow.muiSupportAuto = true;
14321
14320
  var Grow$1 = Grow;
14322
14321
 
14323
- const _excluded$p = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
14322
+ const _excluded$q = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
14324
14323
  const styles = {
14325
14324
  entering: {
14326
14325
  opacity: 1
@@ -14357,7 +14356,7 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
14357
14356
  // eslint-disable-next-line react/prop-types
14358
14357
  TransitionComponent = Transition$1
14359
14358
  } = props,
14360
- other = _objectWithoutPropertiesLoose(props, _excluded$p);
14359
+ other = _objectWithoutPropertiesLoose(props, _excluded$q);
14361
14360
  const nodeRef = React.useRef(null);
14362
14361
  const handleRef = useForkRef(nodeRef, children.ref, ref);
14363
14362
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
@@ -14518,7 +14517,7 @@ function getBackdropUtilityClass(slot) {
14518
14517
  }
14519
14518
  generateUtilityClasses('MuiBackdrop', ['root', 'invisible']);
14520
14519
 
14521
- const _excluded$o = ["children", "className", "component", "components", "componentsProps", "invisible", "open", "slotProps", "slots", "TransitionComponent", "transitionDuration"];
14520
+ const _excluded$p = ["children", "className", "component", "components", "componentsProps", "invisible", "open", "slotProps", "slots", "TransitionComponent", "transitionDuration"];
14522
14521
  const useUtilityClasses$e = ownerState => {
14523
14522
  const {
14524
14523
  classes,
@@ -14573,7 +14572,7 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
14573
14572
  TransitionComponent = Fade$1,
14574
14573
  transitionDuration
14575
14574
  } = props,
14576
- other = _objectWithoutPropertiesLoose(props, _excluded$o);
14575
+ other = _objectWithoutPropertiesLoose(props, _excluded$p);
14577
14576
  const ownerState = _extends$1({}, props, {
14578
14577
  component,
14579
14578
  invisible
@@ -14694,7 +14693,7 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes /* remove-proptypes *
14694
14693
  } : void 0;
14695
14694
  var Backdrop$1 = Backdrop;
14696
14695
 
14697
- const _excluded$n = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "open", "slotProps", "slots", "theme"];
14696
+ const _excluded$o = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "open", "slotProps", "slots", "theme"];
14698
14697
  const ModalRoot = styled$1('div', {
14699
14698
  name: 'MuiModal',
14700
14699
  slot: 'Root',
@@ -14773,7 +14772,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
14773
14772
  // eslint-disable-next-line react/prop-types
14774
14773
  theme
14775
14774
  } = props,
14776
- other = _objectWithoutPropertiesLoose(props, _excluded$n);
14775
+ other = _objectWithoutPropertiesLoose(props, _excluded$o);
14777
14776
  const [exited, setExited] = React.useState(true);
14778
14777
  const commonProps = {
14779
14778
  container,
@@ -14997,7 +14996,7 @@ function getPaperUtilityClass(slot) {
14997
14996
  }
14998
14997
  generateUtilityClasses('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']);
14999
14998
 
15000
- const _excluded$m = ["className", "component", "elevation", "square", "variant"];
14999
+ const _excluded$n = ["className", "component", "elevation", "square", "variant"];
15001
15000
  const useUtilityClasses$d = ownerState => {
15002
15001
  const {
15003
15002
  square,
@@ -15052,7 +15051,7 @@ const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
15052
15051
  square = false,
15053
15052
  variant = 'elevation'
15054
15053
  } = props,
15055
- other = _objectWithoutPropertiesLoose(props, _excluded$m);
15054
+ other = _objectWithoutPropertiesLoose(props, _excluded$n);
15056
15055
  const ownerState = _extends$1({}, props, {
15057
15056
  component,
15058
15057
  elevation,
@@ -15133,7 +15132,7 @@ function getPopoverUtilityClass(slot) {
15133
15132
  }
15134
15133
  generateUtilityClasses('MuiPopover', ['root', 'paper']);
15135
15134
 
15136
- const _excluded$l = ["onEntering"],
15135
+ const _excluded$m = ["onEntering"],
15137
15136
  _excluded2$2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
15138
15137
  _excluded3 = ["slotProps"];
15139
15138
  function getOffsetTop(rect, vertical) {
@@ -15230,7 +15229,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
15230
15229
  onEntering
15231
15230
  } = {}
15232
15231
  } = props,
15233
- TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$l),
15232
+ TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$m),
15234
15233
  other = _objectWithoutPropertiesLoose(props, _excluded2$2);
15235
15234
  const externalPaperSlotProps = (_slotProps$paper = slotProps == null ? void 0 : slotProps.paper) != null ? _slotProps$paper : PaperPropsProp;
15236
15235
  const paperRef = React.useRef();
@@ -15636,7 +15635,7 @@ function getMenuUtilityClass(slot) {
15636
15635
  }
15637
15636
  generateUtilityClasses('MuiMenu', ['root', 'paper', 'list']);
15638
15637
 
15639
- const _excluded$k = ["onEntering"],
15638
+ const _excluded$l = ["onEntering"],
15640
15639
  _excluded2$1 = ["autoFocus", "children", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant"];
15641
15640
  const RTL_ORIGIN = {
15642
15641
  vertical: 'top',
@@ -15703,7 +15702,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
15703
15702
  } = {},
15704
15703
  variant = 'selectedMenu'
15705
15704
  } = props,
15706
- TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$k),
15705
+ TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$l),
15707
15706
  other = _objectWithoutPropertiesLoose(props, _excluded2$1);
15708
15707
  const theme = useTheme();
15709
15708
  const isRtl = theme.direction === 'rtl';
@@ -15893,7 +15892,7 @@ function getNativeSelectUtilityClasses(slot) {
15893
15892
  const nativeSelectClasses = generateUtilityClasses('MuiNativeSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
15894
15893
  var nativeSelectClasses$1 = nativeSelectClasses;
15895
15894
 
15896
- const _excluded$j = ["className", "disabled", "error", "IconComponent", "inputRef", "variant"];
15895
+ const _excluded$k = ["className", "disabled", "error", "IconComponent", "inputRef", "variant"];
15897
15896
  const useUtilityClasses$a = ownerState => {
15898
15897
  const {
15899
15898
  classes,
@@ -16022,7 +16021,7 @@ const NativeSelectInput = /*#__PURE__*/React.forwardRef(function NativeSelectInp
16022
16021
  inputRef,
16023
16022
  variant = 'standard'
16024
16023
  } = props,
16025
- other = _objectWithoutPropertiesLoose(props, _excluded$j);
16024
+ other = _objectWithoutPropertiesLoose(props, _excluded$k);
16026
16025
  const ownerState = _extends$1({}, props, {
16027
16026
  disabled,
16028
16027
  variant,
@@ -16107,7 +16106,7 @@ const selectClasses = generateUtilityClasses('MuiSelect', ['select', 'multiple',
16107
16106
  var selectClasses$1 = selectClasses;
16108
16107
 
16109
16108
  var _span;
16110
- const _excluded$i = ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "error", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"];
16109
+ const _excluded$j = ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "error", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"];
16111
16110
  const SelectSelect = styled$1('div', {
16112
16111
  name: 'MuiSelect',
16113
16112
  slot: 'Select',
@@ -16229,7 +16228,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
16229
16228
  value: valueProp,
16230
16229
  variant = 'standard'
16231
16230
  } = props,
16232
- other = _objectWithoutPropertiesLoose(props, _excluded$i);
16231
+ other = _objectWithoutPropertiesLoose(props, _excluded$j);
16233
16232
  const [value, setValueState] = useControlled({
16234
16233
  controlled: valueProp,
16235
16234
  default: defaultValue,
@@ -16740,7 +16739,7 @@ function getSvgIconUtilityClass(slot) {
16740
16739
  }
16741
16740
  generateUtilityClasses('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);
16742
16741
 
16743
- const _excluded$h = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
16742
+ const _excluded$i = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
16744
16743
  const useUtilityClasses$8 = ownerState => {
16745
16744
  const {
16746
16745
  color,
@@ -16806,7 +16805,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
16806
16805
  titleAccess,
16807
16806
  viewBox = '0 0 24 24'
16808
16807
  } = props,
16809
- other = _objectWithoutPropertiesLoose(props, _excluded$h);
16808
+ other = _objectWithoutPropertiesLoose(props, _excluded$i);
16810
16809
  const ownerState = _extends$1({}, props, {
16811
16810
  color,
16812
16811
  component,
@@ -16932,7 +16931,7 @@ var ArrowDropDownIcon = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path"
16932
16931
  d: "M7 10l5 5 5-5z"
16933
16932
  }), 'ArrowDropDown');
16934
16933
 
16935
- const _excluded$g = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
16934
+ const _excluded$h = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
16936
16935
  const useUtilityClasses$7 = ownerState => {
16937
16936
  const {
16938
16937
  classes
@@ -16976,7 +16975,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
16976
16975
  SelectDisplayProps,
16977
16976
  variant: variantProp = 'outlined'
16978
16977
  } = props,
16979
- other = _objectWithoutPropertiesLoose(props, _excluded$g);
16978
+ other = _objectWithoutPropertiesLoose(props, _excluded$h);
16980
16979
  const inputComponent = native ? NativeSelectInput$1 : SelectInput$1;
16981
16980
  const muiFormControl = useFormControl();
16982
16981
  const fcs = formControlState({
@@ -17199,7 +17198,7 @@ function getTextFieldUtilityClass(slot) {
17199
17198
  }
17200
17199
  generateUtilityClasses('MuiTextField', ['root']);
17201
17200
 
17202
- const _excluded$f = ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"];
17201
+ const _excluded$g = ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"];
17203
17202
  const variantComponent = {
17204
17203
  standard: Input$1,
17205
17204
  filled: FilledInput$1,
@@ -17292,7 +17291,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
17292
17291
  value,
17293
17292
  variant = 'outlined'
17294
17293
  } = props,
17295
- other = _objectWithoutPropertiesLoose(props, _excluded$f);
17294
+ other = _objectWithoutPropertiesLoose(props, _excluded$g);
17296
17295
  const ownerState = _extends$1({}, props, {
17297
17296
  autoFocus,
17298
17297
  color,
@@ -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
@@ -17662,11 +17661,53 @@ const IS_BETWEEN = isBetweenOperator;
17662
17661
 
17663
17662
  const getGridNumericOperators = () => [...getGridNumericOperators$1(), IS_BETWEEN];
17664
17663
 
17664
+ const doesNotEqual = {
17665
+ label: 'does not equal',
17666
+ value: 'doesNotEqual',
17667
+ getApplyFilterFn: filterItem => {
17668
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17669
+ return null;
17670
+ }
17671
+ return params => {
17672
+ if (filterItem.value.length === 0) {
17673
+ return true;
17674
+ }
17675
+ if (params.value === filterItem.value) {
17676
+ return false;
17677
+ }
17678
+ return true;
17679
+ };
17680
+ },
17681
+ InputComponent: GridFilterInputValue
17682
+ };
17683
+ const DOES_NOT_EQUAL = doesNotEqual;
17684
+
17685
+ const doesNotContain = {
17686
+ label: 'does not contain',
17687
+ value: 'doesNotContain',
17688
+ getApplyFilterFn: filterItem => {
17689
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17690
+ return null;
17691
+ }
17692
+ return params => {
17693
+ if (filterItem.value.length === 0) {
17694
+ return true;
17695
+ }
17696
+ if (params.value.indexOf(filterItem.value) !== -1) {
17697
+ return false;
17698
+ }
17699
+ return true;
17700
+ };
17701
+ },
17702
+ InputComponent: GridFilterInputValue
17703
+ };
17704
+ const DOES_NOT_CONTAIN = doesNotContain;
17705
+
17665
17706
  const containsAnyOfOperator = {
17666
17707
  label: 'contains any of',
17667
17708
  value: 'containsAnyOf',
17668
17709
  getApplyFilterFn: filterItem => {
17669
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17710
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17670
17711
  return null;
17671
17712
  }
17672
17713
  return params => {
@@ -17689,7 +17730,7 @@ const containsAnyOfCIOperator = {
17689
17730
  label: 'contains any of (case insensitive)',
17690
17731
  value: 'containsAnyOf',
17691
17732
  getApplyFilterFn: filterItem => {
17692
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17733
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17693
17734
  return null;
17694
17735
  }
17695
17736
  return params => {
@@ -17716,7 +17757,7 @@ const endsWithAnyOfOperator = {
17716
17757
  label: 'ends with any of',
17717
17758
  value: 'endsWithAnyOf',
17718
17759
  getApplyFilterFn: filterItem => {
17719
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17760
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17720
17761
  return null;
17721
17762
  }
17722
17763
  return params => {
@@ -17743,7 +17784,7 @@ const isAnyOfOperator = {
17743
17784
  label: 'is any of',
17744
17785
  value: 'isAnyOf',
17745
17786
  getApplyFilterFn: filterItem => {
17746
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17787
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17747
17788
  return null;
17748
17789
  }
17749
17790
  return params => {
@@ -17767,7 +17808,7 @@ const isNotAnyOfOperator = {
17767
17808
  label: 'is not any of',
17768
17809
  value: 'isNotAnyOf',
17769
17810
  getApplyFilterFn: filterItem => {
17770
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17811
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17771
17812
  return null;
17772
17813
  }
17773
17814
  return params => {
@@ -17791,7 +17832,7 @@ const startsWithAnyOfOperator = {
17791
17832
  label: 'starts with any of',
17792
17833
  value: 'startsWithAnyOf',
17793
17834
  getApplyFilterFn: filterItem => {
17794
- if (!filterItem.field || !filterItem.value || !filterItem.operator) {
17835
+ if (!filterItem.columnField || !filterItem.value || !filterItem.operatorValue) {
17795
17836
  return null;
17796
17837
  }
17797
17838
  return params => {
@@ -17816,11 +17857,27 @@ const STARTS_WITH_ANY_OF = startsWithAnyOfOperator;
17816
17857
 
17817
17858
  const getGridStringArrayOperators = () => [CONTAINS_ANY_OF, ENDS_WITH_ANY_OF, IS_ANY_OF, IS_NOT_ANY_OF, STARTS_WITH_ANY_OF];
17818
17859
 
17819
- const getGridStringOperators = () => [...getGridStringOperators$1(), ...getGridStringArrayOperators()];
17860
+ const getGridStringOperators = () => [...getGridStringOperators$1().filter(operator => !['isAnyOf'].includes(operator.value)), DOES_NOT_CONTAIN, DOES_NOT_EQUAL, ...getGridStringArrayOperators()];
17861
+
17862
+ // istanbul ignore file
17863
+ const operatorList = {
17864
+ // Default types
17865
+ string: getGridStringOperators$1(),
17866
+ number: getGridNumericOperators$1(),
17867
+ boolean: getGridBooleanOperators(),
17868
+ date: getGridDateOperators(),
17869
+ dateTime: getGridDateOperators(true),
17870
+ singleSelect: getGridSingleSelectOperators(),
17871
+ // Extended types
17872
+ rsString: getGridStringOperators(),
17873
+ rsNumber: getGridNumericOperators(),
17874
+ // Custom types
17875
+ rsStringArray: getGridStringArrayOperators()
17876
+ };
17820
17877
 
17821
17878
  const API_URL = 'https://api.openai.com/v1/chat/completions';
17822
17879
  async function getCompletion(text, role, openai_api_key) {
17823
- 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';
17824
17881
  try {
17825
17882
  const messages = [{
17826
17883
  role: 'system',
@@ -21921,7 +21978,7 @@ const StyledGridToolbarFilterSemanticField = styled$3.form`
21921
21978
  }
21922
21979
  `;
21923
21980
 
21924
- const _excluded$e = ["className", "nlpFilterConfig", "onFilterModelChange", "dateFormat", "defaultModel", "defaultFilter", "disablePower", "localeText"];
21981
+ const _excluded$f = ["className", "nlpFilterConfig", "onFilterModelChange", "dateFormat", "defaultModel", "defaultFilter", "disablePower", "localeText"];
21925
21982
  const COMPONENT_NAME$2 = 'GridToolbarFilterSemanticField';
21926
21983
  const CLASSNAME$2 = 'redsift-datagrid-toolbar-nlp-filter-field';
21927
21984
  const DEFAULT_OPERATORS = {
@@ -21952,16 +22009,16 @@ const getRole = (config, dateFormat) => {
21952
22009
  }).join('\n');
21953
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.
21954
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.
21955
- The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "logicOperator" and "items":
21956
- - "logicOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
21957
- - "items": a list of conditions, each is an object with exactly the three keys "field", "operator" and "value":
21958
- - "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}
21959
22016
  - "value":
21960
- - this can be skipped if the "operator" is either "isEmpty" or "isNotEmpty"
21961
- - 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"
21962
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.
21963
22020
  For "date" data type, use ${dateFormat}. If relative date is input, convert to the actual date given today is ${today}.
21964
- - "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
21965
22022
  ${operators}
21966
22023
 
21967
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:
@@ -21998,15 +22055,15 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
21998
22055
  nlpFilterConfig,
21999
22056
  onFilterModelChange,
22000
22057
  dateFormat = 'yyyy-mm-dd',
22001
- defaultModel = 'gpt-4-1106-preview',
22058
+ defaultModel = 'gpt-4-0613',
22002
22059
  defaultFilter = {
22003
22060
  items: [],
22004
- logicOperator: 'and'
22061
+ linkOperator: 'and'
22005
22062
  },
22006
22063
  disablePower = false,
22007
22064
  localeText
22008
22065
  } = props,
22009
- forwardedProps = _objectWithoutProperties(props, _excluded$e);
22066
+ forwardedProps = _objectWithoutProperties(props, _excluded$f);
22010
22067
  const {
22011
22068
  textLabel,
22012
22069
  textPlaceholder,
@@ -22079,7 +22136,7 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
22079
22136
  value: prompt
22080
22137
  }), /*#__PURE__*/React__default.createElement(Button, {
22081
22138
  variant: "primary",
22082
- "aria-label": buttonAriaLabel,
22139
+ "aira-label": buttonAriaLabel,
22083
22140
  type: "submit",
22084
22141
  isLoading: isLoading
22085
22142
  }, buttonText)), !disablePower && /*#__PURE__*/React__default.createElement(Tooltip, null, /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, /*#__PURE__*/React__default.createElement(Switch, {
@@ -22101,7 +22158,7 @@ GridToolbarFilterSemanticField.displayName = COMPONENT_NAME$2;
22101
22158
 
22102
22159
  /** ------ */
22103
22160
 
22104
- const Toolbar$3 = props => {
22161
+ const Toolbar$2 = props => {
22105
22162
  const {
22106
22163
  hasExportButton = true,
22107
22164
  exportButtonProps,
@@ -22140,7 +22197,7 @@ const Toolbar$3 = props => {
22140
22197
  let {
22141
22198
  apiRef
22142
22199
  } = _ref;
22143
- return gridExpandedSortedRowIdsSelector(apiRef);
22200
+ return gridVisibleSortedRowIdsSelector(apiRef);
22144
22201
  }
22145
22202
  },
22146
22203
  printOptions: {
@@ -22154,7 +22211,7 @@ const Toolbar$3 = props => {
22154
22211
  }, semanticFilterProps ? /*#__PURE__*/React__default.createElement(GridToolbarFilterSemanticField, semanticFilterProps) : null)));
22155
22212
  };
22156
22213
 
22157
- const _excluded$d = ["displayName"];
22214
+ const _excluded$e = ["displayName"];
22158
22215
  const muiIconToDSIcon = {
22159
22216
  ColumnFilteredIcon: mdiFilterVariant,
22160
22217
  ColumnSelectorIcon: mdiViewColumn,
@@ -22172,7 +22229,7 @@ const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
22172
22229
  const {
22173
22230
  displayName
22174
22231
  } = props,
22175
- forwardedProps = _objectWithoutProperties(props, _excluded$d);
22232
+ forwardedProps = _objectWithoutProperties(props, _excluded$e);
22176
22233
  return /*#__PURE__*/React__default.createElement(Icon, _extends$2({}, forwardedProps, forwardedProps.inputProps, {
22177
22234
  ref: ref,
22178
22235
  size: forwardedProps.fontSize,
@@ -22180,7 +22237,7 @@ const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
22180
22237
  }));
22181
22238
  });
22182
22239
 
22183
- const _excluded$c = ["children", "color", "onClick", "startIcon"];
22240
+ const _excluded$d = ["children", "color", "onClick", "startIcon"];
22184
22241
  const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
22185
22242
  var _props$className;
22186
22243
  const {
@@ -22189,7 +22246,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
22189
22246
  onClick,
22190
22247
  startIcon
22191
22248
  } = props,
22192
- forwardedProps = _objectWithoutProperties(props, _excluded$c);
22249
+ forwardedProps = _objectWithoutProperties(props, _excluded$d);
22193
22250
  const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
22194
22251
  if ((_props$className = props.className) !== null && _props$className !== void 0 && _props$className.includes('redsift-condensed')) {
22195
22252
  return /*#__PURE__*/React__default.createElement(IconButton$2, _extends$2({}, forwardedProps, {
@@ -22215,7 +22272,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
22215
22272
  }), children);
22216
22273
  });
22217
22274
 
22218
- const _excluded$b = ["checked", "indeterminate", "disabled", "onChange"];
22275
+ const _excluded$c = ["checked", "indeterminate", "disabled", "onChange"];
22219
22276
  const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
22220
22277
  const {
22221
22278
  checked,
@@ -22223,7 +22280,7 @@ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
22223
22280
  disabled,
22224
22281
  onChange
22225
22282
  } = props,
22226
- forwardedProps = _objectWithoutProperties(props, _excluded$b);
22283
+ forwardedProps = _objectWithoutProperties(props, _excluded$c);
22227
22284
  return /*#__PURE__*/React__default.createElement(Checkbox, _extends$2({}, forwardedProps, forwardedProps.inputProps, {
22228
22285
  isSelected: checked && !indeterminate,
22229
22286
  isDisabled: disabled,
@@ -22233,7 +22290,7 @@ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
22233
22290
  }));
22234
22291
  });
22235
22292
 
22236
- const _excluded$a = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
22293
+ const _excluded$b = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
22237
22294
  const PopperRoot = styled$1(BasePopper$1, {
22238
22295
  name: 'MuiPopper',
22239
22296
  slot: 'Root',
@@ -22276,7 +22333,7 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
22276
22333
  slots,
22277
22334
  slotProps
22278
22335
  } = props,
22279
- other = _objectWithoutPropertiesLoose(props, _excluded$a);
22336
+ other = _objectWithoutPropertiesLoose(props, _excluded$b);
22280
22337
  const RootComponent = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components == null ? void 0 : components.Root;
22281
22338
  const otherProps = _extends$1({
22282
22339
  anchorEl,
@@ -22434,6 +22491,23 @@ const BasePopper = /*#__PURE__*/forwardRef((props, ref) => {
22434
22491
  }));
22435
22492
  });
22436
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
+
22437
22511
  function Ripple(props) {
22438
22512
  const {
22439
22513
  className,
@@ -22516,7 +22590,7 @@ process.env.NODE_ENV !== "production" ? Ripple.propTypes = {
22516
22590
  const touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);
22517
22591
  var touchRippleClasses$1 = touchRippleClasses;
22518
22592
 
22519
- const _excluded$9 = ["center", "classes", "className"];
22593
+ const _excluded$a = ["center", "classes", "className"];
22520
22594
  let _ = t => t,
22521
22595
  _t,
22522
22596
  _t2,
@@ -22645,7 +22719,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
22645
22719
  classes = {},
22646
22720
  className
22647
22721
  } = props,
22648
- other = _objectWithoutPropertiesLoose(props, _excluded$9);
22722
+ other = _objectWithoutPropertiesLoose(props, _excluded$a);
22649
22723
  const [ripples, setRipples] = React.useState([]);
22650
22724
  const nextKey = React.useRef(0);
22651
22725
  const rippleCallback = React.useRef(null);
@@ -22846,7 +22920,7 @@ function getButtonBaseUtilityClass(slot) {
22846
22920
  const buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);
22847
22921
  var buttonBaseClasses$1 = buttonBaseClasses;
22848
22922
 
22849
- const _excluded$8 = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"];
22923
+ const _excluded$9 = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"];
22850
22924
  const useUtilityClasses$5 = ownerState => {
22851
22925
  const {
22852
22926
  disabled,
@@ -22948,7 +23022,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
22948
23022
  touchRippleRef,
22949
23023
  type
22950
23024
  } = props,
22951
- other = _objectWithoutPropertiesLoose(props, _excluded$8);
23025
+ other = _objectWithoutPropertiesLoose(props, _excluded$9);
22952
23026
  const buttonRef = React.useRef(null);
22953
23027
  const rippleRef = React.useRef(null);
22954
23028
  const handleRippleRef = useForkRef(rippleRef, touchRippleRef);
@@ -23321,7 +23395,7 @@ function getMenuItemUtilityClass(slot) {
23321
23395
  const menuItemClasses = generateUtilityClasses('MuiMenuItem', ['root', 'focusVisible', 'dense', 'disabled', 'divider', 'gutters', 'selected']);
23322
23396
  var menuItemClasses$1 = menuItemClasses;
23323
23397
 
23324
- const _excluded$7 = ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex", "className"];
23398
+ const _excluded$8 = ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex", "className"];
23325
23399
  const overridesResolver = (props, styles) => {
23326
23400
  const {
23327
23401
  ownerState
@@ -23443,7 +23517,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
23443
23517
  tabIndex: tabIndexProp,
23444
23518
  className
23445
23519
  } = props,
23446
- other = _objectWithoutPropertiesLoose(props, _excluded$7);
23520
+ other = _objectWithoutPropertiesLoose(props, _excluded$8);
23447
23521
  const context = React.useContext(ListContext$1);
23448
23522
  const childContext = React.useMemo(() => ({
23449
23523
  dense: dense || context.dense || false,
@@ -23586,7 +23660,7 @@ function getTableCellUtilityClass(slot) {
23586
23660
  const tableCellClasses = generateUtilityClasses('MuiTableCell', ['root', 'head', 'body', 'footer', 'sizeSmall', 'sizeMedium', 'paddingCheckbox', 'paddingNone', 'alignLeft', 'alignCenter', 'alignRight', 'alignJustify', 'stickyHeader']);
23587
23661
  var tableCellClasses$1 = tableCellClasses;
23588
23662
 
23589
- const _excluded$6 = ["align", "className", "component", "padding", "scope", "size", "sortDirection", "variant"];
23663
+ const _excluded$7 = ["align", "className", "component", "padding", "scope", "size", "sortDirection", "variant"];
23590
23664
  const useUtilityClasses$3 = ownerState => {
23591
23665
  const {
23592
23666
  classes,
@@ -23683,7 +23757,7 @@ const TableCell = /*#__PURE__*/React.forwardRef(function TableCell(inProps, ref)
23683
23757
  sortDirection,
23684
23758
  variant: variantProp
23685
23759
  } = props,
23686
- other = _objectWithoutPropertiesLoose(props, _excluded$6);
23760
+ other = _objectWithoutPropertiesLoose(props, _excluded$7);
23687
23761
  const table = React.useContext(TableContext$1);
23688
23762
  const tablelvl2 = React.useContext(Tablelvl2Context$1);
23689
23763
  const isHeadCell = tablelvl2 && tablelvl2.variant === 'head';
@@ -23790,7 +23864,7 @@ function getToolbarUtilityClass(slot) {
23790
23864
  }
23791
23865
  generateUtilityClasses('MuiToolbar', ['root', 'gutters', 'regular', 'dense']);
23792
23866
 
23793
- const _excluded$5 = ["className", "component", "disableGutters", "variant"];
23867
+ const _excluded$6 = ["className", "component", "disableGutters", "variant"];
23794
23868
  const useUtilityClasses$2 = ownerState => {
23795
23869
  const {
23796
23870
  classes,
@@ -23831,7 +23905,7 @@ const ToolbarRoot = styled$1('div', {
23831
23905
  theme,
23832
23906
  ownerState
23833
23907
  }) => ownerState.variant === 'regular' && theme.mixins.toolbar);
23834
- const Toolbar$1 = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
23908
+ const Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
23835
23909
  const props = useThemeProps({
23836
23910
  props: inProps,
23837
23911
  name: 'MuiToolbar'
@@ -23842,7 +23916,7 @@ const Toolbar$1 = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
23842
23916
  disableGutters = false,
23843
23917
  variant = 'regular'
23844
23918
  } = props,
23845
- other = _objectWithoutPropertiesLoose(props, _excluded$5);
23919
+ other = _objectWithoutPropertiesLoose(props, _excluded$6);
23846
23920
  const ownerState = _extends$1({}, props, {
23847
23921
  component,
23848
23922
  disableGutters,
@@ -23856,7 +23930,7 @@ const Toolbar$1 = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
23856
23930
  ownerState: ownerState
23857
23931
  }, other));
23858
23932
  });
23859
- process.env.NODE_ENV !== "production" ? Toolbar$1.propTypes /* remove-proptypes */ = {
23933
+ process.env.NODE_ENV !== "production" ? Toolbar.propTypes /* remove-proptypes */ = {
23860
23934
  // ----------------------------- Warning --------------------------------
23861
23935
  // | These PropTypes are generated from the TypeScript type definitions |
23862
23936
  // | To update them edit the d.ts file and run "yarn proptypes" |
@@ -23894,7 +23968,7 @@ process.env.NODE_ENV !== "production" ? Toolbar$1.propTypes /* remove-proptypes
23894
23968
  */
23895
23969
  variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['dense', 'regular']), PropTypes.string])
23896
23970
  } : void 0;
23897
- var Toolbar$2 = Toolbar$1;
23971
+ var Toolbar$1 = Toolbar;
23898
23972
 
23899
23973
  var KeyboardArrowLeft = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
23900
23974
  d: "M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"
@@ -23910,7 +23984,7 @@ function getIconButtonUtilityClass(slot) {
23910
23984
  const iconButtonClasses = generateUtilityClasses('MuiIconButton', ['root', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning', 'edgeStart', 'edgeEnd', 'sizeSmall', 'sizeMedium', 'sizeLarge']);
23911
23985
  var iconButtonClasses$1 = iconButtonClasses;
23912
23986
 
23913
- const _excluded$4 = ["edge", "children", "className", "color", "disabled", "disableFocusRipple", "size"];
23987
+ const _excluded$5 = ["edge", "children", "className", "color", "disabled", "disableFocusRipple", "size"];
23914
23988
  const useUtilityClasses$1 = ownerState => {
23915
23989
  const {
23916
23990
  classes,
@@ -24011,7 +24085,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
24011
24085
  disableFocusRipple = false,
24012
24086
  size = 'medium'
24013
24087
  } = props,
24014
- other = _objectWithoutPropertiesLoose(props, _excluded$4);
24088
+ other = _objectWithoutPropertiesLoose(props, _excluded$5);
24015
24089
  const ownerState = _extends$1({}, props, {
24016
24090
  edge,
24017
24091
  color,
@@ -24109,7 +24183,7 @@ var FirstPageIcon = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
24109
24183
  }), 'FirstPage');
24110
24184
 
24111
24185
  var _LastPageIcon, _FirstPageIcon, _KeyboardArrowRight, _KeyboardArrowLeft, _KeyboardArrowLeft2, _KeyboardArrowRight2, _FirstPageIcon2, _LastPageIcon2;
24112
- const _excluded$3 = ["backIconButtonProps", "count", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton"];
24186
+ const _excluded$4 = ["backIconButtonProps", "count", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton"];
24113
24187
  const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginationActions(props, ref) {
24114
24188
  const {
24115
24189
  backIconButtonProps,
@@ -24122,7 +24196,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
24122
24196
  showFirstButton,
24123
24197
  showLastButton
24124
24198
  } = props,
24125
- other = _objectWithoutPropertiesLoose(props, _excluded$3);
24199
+ other = _objectWithoutPropertiesLoose(props, _excluded$4);
24126
24200
  const theme = useTheme();
24127
24201
  const handleFirstPageButtonClick = event => {
24128
24202
  onPageChange(event, 0);
@@ -24226,7 +24300,7 @@ const tablePaginationClasses = generateUtilityClasses('MuiTablePagination', ['ro
24226
24300
  var tablePaginationClasses$1 = tablePaginationClasses;
24227
24301
 
24228
24302
  var _InputBase;
24229
- const _excluded$2 = ["ActionsComponent", "backIconButtonProps", "className", "colSpan", "component", "count", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton"];
24303
+ const _excluded$3 = ["ActionsComponent", "backIconButtonProps", "className", "colSpan", "component", "count", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton"];
24230
24304
  const TablePaginationRoot = styled$1(TableCell$1, {
24231
24305
  name: 'MuiTablePagination',
24232
24306
  slot: 'Root',
@@ -24242,7 +24316,7 @@ const TablePaginationRoot = styled$1(TableCell$1, {
24242
24316
  padding: 0
24243
24317
  }
24244
24318
  }));
24245
- const TablePaginationToolbar = styled$1(Toolbar$2, {
24319
+ const TablePaginationToolbar = styled$1(Toolbar$1, {
24246
24320
  name: 'MuiTablePagination',
24247
24321
  slot: 'Toolbar',
24248
24322
  overridesResolver: (props, styles) => _extends$1({
@@ -24373,7 +24447,7 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
24373
24447
  showFirstButton = false,
24374
24448
  showLastButton = false
24375
24449
  } = props,
24376
- other = _objectWithoutPropertiesLoose(props, _excluded$2);
24450
+ other = _objectWithoutPropertiesLoose(props, _excluded$3);
24377
24451
  const ownerState = props;
24378
24452
  const classes = useUtilityClasses(ownerState);
24379
24453
  const MenuItemComponent = SelectProps.native ? 'option' : TablePaginationMenuItem;
@@ -24592,10 +24666,45 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
24592
24666
  } : void 0;
24593
24667
  var TablePagination$1 = TablePagination;
24594
24668
 
24595
- const _excluded$1 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "ControlledPagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "paginationModel", "onPaginationModelChange", "pageSizeOptions", "paginationProps", "paginationMode", "rowCount"],
24596
- _excluded2 = ["apiRef", "autoHeight", "className", "slots", "slotProps", "filterModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "onFilterModelChange", "rowSelectionModel", "paginationModel", "onPaginationModelChange", "onRowSelectionModelChange", "pagination", "paginationPlacement", "paginationProps", "rows", "pageSizeOptions", "sx", "theme", "paginationMode", "rowCount"];
24597
- const COMPONENT_NAME$1 = 'DataGrid';
24598
- const CLASSNAME$1 = 'redsift-datagrid';
24669
+ const ServerSideControlledPagination = _ref => {
24670
+ let {
24671
+ selectionStatus,
24672
+ displaySelection,
24673
+ displayPagination,
24674
+ page,
24675
+ onPageChange,
24676
+ pageSize,
24677
+ onPageSizeChange,
24678
+ displayRowsPerPage,
24679
+ rowsPerPageOptions,
24680
+ paginationProps,
24681
+ rowCount
24682
+ } = _ref;
24683
+ const totalNumberOfRowsInTable = rowCount;
24684
+ const totalRowsLabel = `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`;
24685
+ const pageRowsLabel = `All ${selectionStatus.numberOfSelectedRowsInPage} selectable rows on this page are selected${selectionStatus.numberOfSelectedRows != selectionStatus.numberOfSelectedRowsInPage ? ` (${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected in total)` : ''}.`;
24686
+ return /*#__PURE__*/React__default.createElement(Flexbox, {
24687
+ flexDirection: "row",
24688
+ alignItems: "center",
24689
+ justifyContent: "space-between",
24690
+ marginBottom: "7px"
24691
+ }, displaySelection ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, selectionStatus.type === 'page' && selectionStatus.numberOfSelectedRowsInPage != 0 ? /*#__PURE__*/React__default.createElement(Text, {
24692
+ fontSize: "14px"
24693
+ }, pageRowsLabel) : selectionStatus.type === 'other' ? /*#__PURE__*/React__default.createElement(Text, {
24694
+ fontSize: "14px"
24695
+ }, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
24696
+ component: "div",
24697
+ count: totalNumberOfRowsInTable,
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 : []
24705
+ }, paginationProps)) : null);
24706
+ };
24707
+
24599
24708
  const getSelectableRowsInTable = (apiRef, isRowSelectable) => {
24600
24709
  return isRowSelectable && typeof isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref => {
24601
24710
  let {
@@ -24618,9 +24727,11 @@ const ControlledPagination = _ref3 => {
24618
24727
  displayPagination = false,
24619
24728
  selectionStatus,
24620
24729
  apiRef,
24621
- paginationModel,
24622
- onPaginationModelChange,
24623
- pageSizeOptions,
24730
+ page,
24731
+ onPageChange,
24732
+ pageSize,
24733
+ onPageSizeChange,
24734
+ rowsPerPageOptions,
24624
24735
  isRowSelectable,
24625
24736
  paginationProps
24626
24737
  } = _ref3;
@@ -24650,79 +24761,38 @@ const ControlledPagination = _ref3 => {
24650
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({
24651
24762
  component: "div",
24652
24763
  count: numberOfFilteredRowsInTable,
24653
- page: paginationModel.page,
24654
- onPageChange: (event, page) => onPaginationModelChange({
24655
- page,
24656
- pageSize: paginationModel.pageSize
24657
- }),
24658
- rowsPerPage: paginationModel.pageSize,
24659
- onRowsPerPageChange: event => onPaginationModelChange({
24660
- page: paginationModel.page,
24661
- pageSize: parseInt(event.target.value, 10)
24662
- }),
24663
- rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
24664
- }, paginationProps)) : null);
24665
- };
24666
- const ServerSideControlledPagination = _ref4 => {
24667
- let {
24668
- selectionStatus,
24669
- displaySelection,
24670
- displayPagination,
24671
- paginationModel,
24672
- onPaginationModelChange,
24673
- pageSizeOptions,
24674
- displayRowsPerPage,
24675
- paginationProps,
24676
- rowCount
24677
- } = _ref4;
24678
- const totalNumberOfRowsInTable = rowCount;
24679
- const totalRowsLabel = `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`;
24680
- const pageRowsLabel = `All ${selectionStatus.numberOfSelectedRowsInPage} selectable rows on this page are selected${selectionStatus.numberOfSelectedRows != selectionStatus.numberOfSelectedRowsInPage ? ` (${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected in total)` : ''}.`;
24681
- return /*#__PURE__*/React__default.createElement(Flexbox, {
24682
- flexDirection: "row",
24683
- alignItems: "center",
24684
- justifyContent: "space-between",
24685
- marginBottom: "7px"
24686
- }, displaySelection ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, selectionStatus.type === 'page' && selectionStatus.numberOfSelectedRowsInPage != 0 ? /*#__PURE__*/React__default.createElement(Text, {
24687
- fontSize: "14px"
24688
- }, pageRowsLabel) : selectionStatus.type === 'other' ? /*#__PURE__*/React__default.createElement(Text, {
24689
- fontSize: "14px"
24690
- }, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
24691
- component: "div",
24692
- count: totalNumberOfRowsInTable,
24693
- page: paginationModel.page,
24694
- onPageChange: (event, page) => onPaginationModelChange({
24695
- page,
24696
- pageSize: paginationModel.pageSize
24697
- }),
24698
- rowsPerPage: paginationModel.pageSize,
24699
- onRowsPerPageChange: event => onPaginationModelChange({
24700
- page: paginationModel.page,
24701
- pageSize: parseInt(event.target.value, 10)
24702
- }),
24703
- 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 : []
24704
24771
  }, paginationProps)) : null);
24705
24772
  };
24706
- const Toolbar = _ref5 => {
24773
+
24774
+ const _excluded$2 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "page", "onPageChange", "pageSize", "onPageSizeChange", "rowsPerPageOptions", "paginationProps", "paginationMode", "rowCount"];
24775
+ const ToolbarWrapper = _ref => {
24707
24776
  let {
24708
24777
  hideToolbar,
24709
24778
  RenderedToolbar,
24710
24779
  filterModel,
24711
24780
  onFilterModelChange,
24712
24781
  pagination,
24713
- ControlledPagination,
24714
24782
  paginationPlacement,
24715
24783
  selectionStatus,
24716
24784
  apiRef,
24717
24785
  isRowSelectable,
24718
- paginationModel,
24719
- onPaginationModelChange,
24720
- pageSizeOptions,
24786
+ page,
24787
+ onPageChange,
24788
+ pageSize,
24789
+ onPageSizeChange,
24790
+ rowsPerPageOptions,
24721
24791
  paginationProps,
24722
24792
  paginationMode = 'client',
24723
24793
  rowCount
24724
- } = _ref5,
24725
- forwardedProps = _objectWithoutProperties(_ref5, _excluded$1);
24794
+ } = _ref,
24795
+ forwardedProps = _objectWithoutProperties(_ref, _excluded$2);
24726
24796
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !hideToolbar ? /*#__PURE__*/React__default.createElement(RenderedToolbar, _extends$2({}, forwardedProps, {
24727
24797
  filterModel: filterModel,
24728
24798
  onFilterModelChange: onFilterModelChange
@@ -24731,9 +24801,11 @@ const Toolbar = _ref5 => {
24731
24801
  displayRowsPerPage: false,
24732
24802
  displayPagination: ['top', 'both'].includes(paginationPlacement),
24733
24803
  selectionStatus: selectionStatus.current,
24734
- paginationModel: paginationModel,
24735
- onPaginationModelChange: onPaginationModelChange,
24736
- pageSizeOptions: pageSizeOptions,
24804
+ page: page,
24805
+ onPageChange: onPageChange,
24806
+ pageSize: pageSize,
24807
+ onPageSizeChange: onPageSizeChange,
24808
+ rowsPerPageOptions: rowsPerPageOptions,
24737
24809
  paginationProps: paginationProps,
24738
24810
  rowCount: rowCount
24739
24811
  }) : /*#__PURE__*/React__default.createElement(ControlledPagination, {
@@ -24743,24 +24815,891 @@ const Toolbar = _ref5 => {
24743
24815
  selectionStatus: selectionStatus.current,
24744
24816
  apiRef: apiRef,
24745
24817
  isRowSelectable: isRowSelectable,
24746
- paginationModel: paginationModel,
24747
- onPaginationModelChange: onPaginationModelChange,
24748
- pageSizeOptions: pageSizeOptions,
24818
+ page: page,
24819
+ onPageChange: onPageChange,
24820
+ pageSize: pageSize,
24821
+ onPageSizeChange: onPageSizeChange,
24822
+ rowsPerPageOptions: rowsPerPageOptions,
24749
24823
  paginationProps: paginationProps
24750
24824
  }) : null);
24751
24825
  };
24826
+
24827
+ const PAGINATION_MODEL_KEY = 'paginationModel';
24828
+ const FILTER_MODEL_KEY = 'filterModel';
24829
+ const SORT_MODEL_KEY = 'sortModel';
24830
+ const VISIBILITY_MODEL_KEY = 'visibilityModel';
24831
+ const PINNED_COLUMNS = 'pinnedColumns';
24832
+ const DIMENSION_MODEL_KEY = 'dimension';
24833
+ const FILTER_SEARCH_KEY = 'searchModel';
24834
+ const buildStorageKey = _ref => {
24835
+ let {
24836
+ id,
24837
+ version,
24838
+ category
24839
+ } = _ref;
24840
+ return `${id}:${version}:${category}`;
24841
+ };
24842
+ const clearPreviousVersionStorage = (id, currentVersion) => {
24843
+ const previousVersion = currentVersion - 1;
24844
+ if (previousVersion < 1) {
24845
+ return;
24846
+ }
24847
+ const keysToDelete = [buildStorageKey({
24848
+ id,
24849
+ version: previousVersion,
24850
+ category: PAGINATION_MODEL_KEY
24851
+ }), buildStorageKey({
24852
+ id,
24853
+ version: previousVersion,
24854
+ category: SORT_MODEL_KEY
24855
+ }), buildStorageKey({
24856
+ id,
24857
+ version: previousVersion,
24858
+ category: FILTER_MODEL_KEY
24859
+ }), buildStorageKey({
24860
+ id,
24861
+ version: previousVersion,
24862
+ category: VISIBILITY_MODEL_KEY
24863
+ }), buildStorageKey({
24864
+ id,
24865
+ version: previousVersion,
24866
+ category: PINNED_COLUMNS
24867
+ }), buildStorageKey({
24868
+ id,
24869
+ version: previousVersion,
24870
+ category: FILTER_SEARCH_KEY
24871
+ }), buildStorageKey({
24872
+ id,
24873
+ version: previousVersion,
24874
+ category: DIMENSION_MODEL_KEY
24875
+ })];
24876
+ for (const keyToDelete of keysToDelete) {
24877
+ try {
24878
+ window.localStorage.removeItem(keyToDelete);
24879
+ } catch (e) {
24880
+ // Ignore
24881
+ }
24882
+ }
24883
+ };
24884
+
24885
+ // Get and Set data from LocalStorage WITHOUT useState
24886
+
24887
+ // triggering a state update and consecutive re-render
24888
+ const useFetchState = (defaultValue, key) => {
24889
+ let stickyValue = null;
24890
+ try {
24891
+ stickyValue = window.localStorage.getItem(key);
24892
+ } catch (e) {
24893
+ console.error('StatefulDataGrid: error getting item from local storage: ', e);
24894
+ }
24895
+ let parsedValue = stickyValue !== null && stickyValue !== undefined && stickyValue !== 'undefined' ? JSON.parse(stickyValue) : defaultValue;
24896
+
24897
+ // TODO: temporary workaround to avoid clashes when someone had sorting on the now-removed screenshot field (renamed to num_annotations)
24898
+ // 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
24899
+ if (parsedValue instanceof Array) {
24900
+ const fields = (parsedValue || []).map(item => item.field);
24901
+ if (fields.includes('screenshot') || fields.includes('diffs')) {
24902
+ parsedValue = defaultValue;
24903
+ }
24904
+ }
24905
+ const updateValue = useCallback(value => {
24906
+ try {
24907
+ window.localStorage.setItem(key, JSON.stringify(value));
24908
+ } catch (e) {
24909
+ console.error('StatefulDataGrid: error setting item into local storage: ', e);
24910
+ }
24911
+ }, [key]);
24912
+ return [parsedValue, updateValue];
24913
+ };
24914
+
24915
+ function useLocalStorage(key, defaultValue) {
24916
+ const [value, setValue] = useState(() => {
24917
+ let currentValue;
24918
+ try {
24919
+ currentValue = JSON.parse(localStorage.getItem(key) || String(defaultValue));
24920
+ } catch (error) {
24921
+ currentValue = defaultValue;
24922
+ }
24923
+ return currentValue;
24924
+ });
24925
+ useEffect(() => {
24926
+ try {
24927
+ localStorage.setItem(key, JSON.stringify(value));
24928
+ } catch (e) {
24929
+ console.error('local-storage: error setting item into local storage: ', e);
24930
+ }
24931
+ }, [value, key]);
24932
+ return [value, setValue];
24933
+ }
24934
+
24935
+ const useTableStates = (id, version, customDefaults) => {
24936
+ const [paginationModel, setPaginationModel] = useLocalStorage(buildStorageKey({
24937
+ id,
24938
+ version,
24939
+ category: PAGINATION_MODEL_KEY
24940
+ }), {
24941
+ page: 0,
24942
+ pageSize: 10
24943
+ });
24944
+ const [sortModel, setSortModel] = useFetchState(customDefaults && customDefaults[SORT_MODEL_KEY] ? customDefaults[SORT_MODEL_KEY] : '', buildStorageKey({
24945
+ id,
24946
+ version,
24947
+ category: SORT_MODEL_KEY
24948
+ }));
24949
+ const [localStorageFilters, setLocalStorageFilters] = useFetchState('', buildStorageKey({
24950
+ id,
24951
+ version,
24952
+ category: FILTER_SEARCH_KEY
24953
+ }));
24954
+ const [visibilityModelLocalStorage, setVisibilityModelLocalStorage] = useFetchState('', buildStorageKey({
24955
+ id,
24956
+ version,
24957
+ category: VISIBILITY_MODEL_KEY
24958
+ }));
24959
+ const [pinnedColumns, setPinnedColumns] = useFetchState(customDefaults ? customDefaults[PINNED_COLUMNS] : '_pinnedColumnsLeft=[]&_pinnedColumnsRight=[]', buildStorageKey({
24960
+ id,
24961
+ version,
24962
+ category: PINNED_COLUMNS
24963
+ }));
24964
+ const [dimensionModel, setDimensionModel] = useFetchState({}, buildStorageKey({
24965
+ id,
24966
+ version,
24967
+ category: DIMENSION_MODEL_KEY
24968
+ }));
24969
+ return {
24970
+ paginationModel,
24971
+ setPaginationModel,
24972
+ sortModel,
24973
+ setSortModel,
24974
+ localStorageFilters,
24975
+ setLocalStorageFilters,
24976
+ visibilityModelLocalStorage,
24977
+ setVisibilityModelLocalStorage,
24978
+ pinnedColumns,
24979
+ setPinnedColumns,
24980
+ dimensionModel,
24981
+ setDimensionModel
24982
+ };
24983
+ };
24984
+
24985
+ const urlSearchParamsToString = searchParams => {
24986
+ let searchString = '';
24987
+ for (const [key, value] of searchParams) {
24988
+ searchString = searchString + `${key}=${value}&`;
24989
+ }
24990
+ return searchString.slice(0, searchString.length - 1);
24991
+ };
24992
+
24993
+ // reference value: https://www.w3schools.com/tags/ref_urlencode.ASP
24994
+ const DECODER = {
24995
+ '%20': ' ',
24996
+ '%26': '&',
24997
+ '%3D': '=',
24998
+ '%3F': '?',
24999
+ '%5B': '[',
25000
+ '%5D': ']',
25001
+ '%2C': ',',
25002
+ '%3C': '<',
25003
+ '%3E': '>',
25004
+ '%21': '!',
25005
+ '%22': '"'
25006
+ };
25007
+ const ENCODER = {
25008
+ ' ': '%20',
25009
+ '&': '%26',
25010
+ '=': '%3D',
25011
+ '?': '%3F',
25012
+ '[': '%5B',
25013
+ ']': '%5D',
25014
+ ',': '%2C',
25015
+ '<': '%3C',
25016
+ '>': '%3E',
25017
+ '!': '%21',
25018
+ '"': '%22'
25019
+ };
25020
+ const decodeValue = value => {
25021
+ if (value === '') {
25022
+ return '';
25023
+ }
25024
+ const re = new RegExp(Object.keys(DECODER).reduce((acc, curr) => `${acc}|${curr}`), 'g');
25025
+ // decodeValue for lists:
25026
+ if (value.startsWith('list[')) {
25027
+ const arrayValues = value.split('[')[1].split(']')[0];
25028
+ const arrayList = arrayValues.split(',').map(v => v.replace(re, encoded => DECODER[encoded])).filter(item => item);
25029
+ return arrayList.length > 0 ? arrayList : [];
25030
+ }
25031
+ return value.replace(re, encoded => DECODER[encoded]);
25032
+ };
25033
+ const encodeValue = value => {
25034
+ if (!value) {
25035
+ return '';
25036
+ }
25037
+
25038
+ // Array encoding for value:
25039
+ // we are representing it as list[encoded], where encoded is the list comma separated
25040
+ if (Array.isArray(value)) {
25041
+ const encodedArray = value.map(entry => {
25042
+ return String(entry).replace(/\s|&|=|\?|\[|\]/g, encoded => ENCODER[encoded]);
25043
+ }).join(',');
25044
+ return `list[${encodedArray}]`;
25045
+ }
25046
+
25047
+ // we might also pass integers
25048
+ const castedValue = String(value);
25049
+ return castedValue.replace(/\s|&|=|\?|\[|\]/g, encoded => ENCODER[encoded]);
25050
+ };
25051
+ const isOperatorValueValid = (columnField, operatorValue, columns) => {
25052
+ const column = columns.find(column => column.field === columnField);
25053
+ if (!column) {
25054
+ return false;
25055
+ }
25056
+ const columnType = (column === null || column === void 0 ? void 0 : column.type) || 'string';
25057
+ const operators = operatorList[columnType];
25058
+ if (!operators) {
25059
+ return false;
25060
+ }
25061
+ if ('filterOperators' in operators) {
25062
+ return !!operators.filterOperators.find(op => op['value'] === operatorValue);
25063
+ }
25064
+ return !!operators.find(op => op['value'] === operatorValue);
25065
+ };
25066
+
25067
+ // Check if the value doesn't break
25068
+ const isValueValid = (value, columnField, columns, operatorValue) => {
25069
+ var _column$type;
25070
+ // every field accepts undefined as value for default
25071
+ if (value === undefined) {
25072
+ return true;
25073
+ }
25074
+
25075
+ // isAnyOf accepts as value only lists, and we are declearing them in the
25076
+ // URL as `list=[...]`
25077
+ if (operatorValue === 'isAnyOf') {
25078
+ return Array.isArray(value);
25079
+ }
25080
+
25081
+ // We are accepting arrays only if they are of the 'isAnyOf' type
25082
+ if (Array.isArray(value) && operatorValue !== 'isAnyOf') {
25083
+ return false;
25084
+ }
25085
+ const column = columns.find(column => column.field === columnField);
25086
+ if (!column) {
25087
+ return false;
25088
+ }
25089
+ const type = (_column$type = column['type']) !== null && _column$type !== void 0 ? _column$type : 'string';
25090
+
25091
+ // Only date and rating fail with 500s, other set themselves as undefined
25092
+ if (type !== 'date' && type !== 'rating') {
25093
+ return true;
25094
+ }
25095
+
25096
+ // just checking that rating is a number.
25097
+ if (type === 'rating') {
25098
+ return !isNaN(Number(value));
25099
+ }
25100
+
25101
+ // format: YYYY-MM-DD
25102
+ // just verifying that the 3 values are numbers to avoid 500s,
25103
+ // If the value is invalid the form will appear as undefined
25104
+ if (type === 'date') {
25105
+ const dateSplitted = value.split('-');
25106
+ if (dateSplitted.length !== 3) {
25107
+ return false;
25108
+ }
25109
+ const [YYYY, MM, DD] = dateSplitted;
25110
+ return !isNaN(parseInt(YYYY)) && !isNaN(parseInt(MM)) && !isNaN(parseInt(DD));
25111
+ }
25112
+ return false;
25113
+ };
25114
+
25115
+ // example:
25116
+ // unicodeDomain[contains]=a&unicodeDomain[contains]=dsa&logicOperator=and&tab=ignored
25117
+ const getFilterModelFromString = (searchString, columns) => {
25118
+ if (!searchString) {
25119
+ return {
25120
+ items: [],
25121
+ linkOperator: GridLinkOperator.And
25122
+ };
25123
+ }
25124
+ let linkOperator = GridLinkOperator.And;
25125
+ const searchParams = new URLSearchParams();
25126
+ for (const [key, value] of new URLSearchParams(searchString)) {
25127
+ if (key.startsWith('_') && !['_logicOperator', '_sortColumn', '_pinnedColumnsLeft', '_pinnedColumnsRight', '_columnVisibility'].includes(key)) {
25128
+ searchParams.set(key, value);
25129
+ }
25130
+ if (key === '_logicOperator') {
25131
+ linkOperator = value;
25132
+ }
25133
+ }
25134
+ let id = 5000;
25135
+ const fields = columns.map(column => column.field);
25136
+ let isInvalid = false;
25137
+ const items = [];
25138
+ searchParams.forEach((value, key) => {
25139
+ if (isInvalid) {
25140
+ return;
25141
+ }
25142
+ const field = key.split('[')[0].slice(1); // Slice to remove the _ at the beginning
25143
+ if (!fields.includes(field)) {
25144
+ return;
25145
+ }
25146
+ const left = key.split(']')[0];
25147
+ if (left.split('[').length < 2) {
25148
+ isInvalid = true;
25149
+ return;
25150
+ }
25151
+ const operator = decodeValue(key.split('[')[1].split(']')[0]);
25152
+ // if the operator is not part of the valid operators invalidate the URL
25153
+ if (!isOperatorValueValid(field, operator, columns) || Array.isArray(operator)) {
25154
+ isInvalid = true;
25155
+ return;
25156
+ }
25157
+ id += 1;
25158
+ const decodedValue = decodeValue(value);
25159
+ if (!isValueValid(decodedValue, field, columns, operator)) {
25160
+ isInvalid = true;
25161
+ return;
25162
+ }
25163
+ items.push({
25164
+ columnField: field,
25165
+ operatorValue: operator,
25166
+ id,
25167
+ value: decodedValue
25168
+ });
25169
+ });
25170
+
25171
+ // If we found some condition that results in an invalid URL,
25172
+ // return the empty filterModel (this will trigger the localStorage)
25173
+ // and will pick up the last valid search
25174
+ if (isInvalid) {
25175
+ return {
25176
+ items: [],
25177
+ linkOperator: GridLinkOperator.And
25178
+ };
25179
+ }
25180
+ return {
25181
+ items,
25182
+ linkOperator
25183
+ };
25184
+ };
25185
+ const getSearchParamsFromFilterModel = filterModel => {
25186
+ const searchParams = new URLSearchParams();
25187
+ searchParams.set('_logicOperator', filterModel['linkOperator'] || '');
25188
+ filterModel['items'].forEach(item => {
25189
+ const {
25190
+ columnField,
25191
+ operatorValue,
25192
+ value
25193
+ } = item;
25194
+ searchParams.set(`_${columnField}[${encodeValue(operatorValue)}]`, encodeValue(value));
25195
+ });
25196
+ return searchParams;
25197
+ };
25198
+
25199
+ // Rules:
25200
+ // - if we have something in the URL, use that info
25201
+ // - if we don't have that, use the localStorage and update the URL
25202
+ // - if we don't have that, return an empty FilterModel
25203
+ const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFilters) => {
25204
+ const filterModelFromSearch = getFilterModelFromString(search, columns);
25205
+ if (filterModelFromSearch.items.length > 0) {
25206
+ const searchFromFilterModel = getSearchParamsFromFilterModel(filterModelFromSearch);
25207
+ if (urlSearchParamsToString(searchFromFilterModel) !== localStorageFilters) {
25208
+ setLocalStorageFilters(urlSearchParamsToString(searchFromFilterModel));
25209
+ }
25210
+ return filterModelFromSearch;
25211
+ }
25212
+ const filterModelFromLocalStorage = getFilterModelFromString(localStorageFilters, columns);
25213
+ if (filterModelFromLocalStorage) {
25214
+ return filterModelFromLocalStorage;
25215
+ }
25216
+ return {
25217
+ items: [],
25218
+ linkOperator: GridLinkOperator.And
25219
+ };
25220
+ };
25221
+ const getSortingFromString = (notParsed, columns) => {
25222
+ // If the string is empty return the default model
25223
+ if (!notParsed) {
25224
+ return null;
25225
+ }
25226
+ // remove the initial ? if present
25227
+ const parsed = notParsed[0] === '?' ? notParsed.slice(1) : notParsed;
25228
+ for (const item of parsed.split('&')) {
25229
+ const fieldURL = item.split('=')[0];
25230
+ if (fieldURL !== '_sortColumn') {
25231
+ continue;
25232
+ }
25233
+ const left = item.split(']')[0];
25234
+ if (left.split('[').length < 2) {
25235
+ continue;
25236
+ }
25237
+ const value = item.split('[')[1].split(']')[0];
25238
+ if (value === '') {
25239
+ return [];
25240
+ }
25241
+ const columnFields = columns.map(column => column.field);
25242
+ const [column, order] = value.split(',');
25243
+ if (columnFields.includes(column) && (order === 'asc' || order === 'desc')) {
25244
+ return [{
25245
+ field: column,
25246
+ sort: order
25247
+ }];
25248
+ }
25249
+ continue;
25250
+ }
25251
+
25252
+ // No information was found about the sorting model in the URL
25253
+ return null;
25254
+ };
25255
+ const getSearchParamsFromSorting = sorting => {
25256
+ const searchParams = new URLSearchParams();
25257
+ searchParams.set('_sortColumn', sorting.length > 0 && sorting[0].sort ? `[${encodeValue(sorting[0].field)},${encodeValue(sorting[0].sort)}]` : '[]');
25258
+ return searchParams;
25259
+ };
25260
+
25261
+ // Rules:
25262
+ // - if we have something in the URL, use that info
25263
+ // - if we don't have that, use the localStorage and update the URL
25264
+ // - if we don't have that, return an empty SortModel
25265
+ const getSortModel = (search, columns, localStorageSorting, setLocalStorageSorting) => {
25266
+ const sorting = getSortingFromString(search, columns);
25267
+ if (sorting) {
25268
+ const searchFromSortModel = getSearchParamsFromSorting(sorting);
25269
+ if (searchFromSortModel.toString() !== localStorageSorting) {
25270
+ setLocalStorageSorting(searchFromSortModel.toString());
25271
+ }
25272
+ return sorting;
25273
+ }
25274
+ const sortModelFromLocalStorage = getSortingFromString(localStorageSorting, columns);
25275
+ if (sortModelFromLocalStorage) {
25276
+ return sortModelFromLocalStorage;
25277
+ }
25278
+ return [];
25279
+ };
25280
+ const getSearchParamsFromColumnVisibility = (columnVisibility, columns) => {
25281
+ const searchParams = new URLSearchParams();
25282
+ const columnFields = columns.map(column => column.field);
25283
+
25284
+ // if column visibility model is empty, show all columns
25285
+ if (Object.keys(columnVisibility).length == 0) {
25286
+ searchParams.set('_columnVisibility', `[${columnFields.join(',')}]`);
25287
+ return searchParams;
25288
+ }
25289
+ const finalColumnVisibility = columns.filter(c => {
25290
+ var _c$hideable;
25291
+ return !((_c$hideable = c === null || c === void 0 ? void 0 : c.hideable) !== null && _c$hideable !== void 0 ? _c$hideable : true);
25292
+ }).map(c => c.field).reduce((acc, colName) => {
25293
+ return _objectSpread2(_objectSpread2({}, acc), {}, {
25294
+ [colName]: true
25295
+ });
25296
+ }, columnVisibility);
25297
+ const visibleColumns = Object.entries(finalColumnVisibility)
25298
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
25299
+ .filter(_ref => {
25300
+ let [_, visible] = _ref;
25301
+ return visible;
25302
+ })
25303
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
25304
+ .map(_ref2 => {
25305
+ let [column, _] = _ref2;
25306
+ return encodeValue(column);
25307
+ });
25308
+ searchParams.set('_columnVisibility', `[${visibleColumns.join(',')}]`);
25309
+ return searchParams;
25310
+ };
25311
+ const getColumnVisibilityFromString = (notParsed, tableColumns) => {
25312
+ if (!notParsed || notParsed.length === 1 && notParsed[0] === '?') {
25313
+ return null;
25314
+ }
25315
+ // remove the initial ? if present
25316
+ const parsed = notParsed[0] === '?' ? notParsed.slice(1) : notParsed;
25317
+ const visibility = {};
25318
+ let exist = false;
25319
+ let visibleColumnsCount = 0;
25320
+ for (const item of parsed.split('&')) {
25321
+ // if it's not column visibility field, skip
25322
+ const fieldURL = item.split('=')[0];
25323
+ if (fieldURL !== '_columnVisibility') {
25324
+ continue;
25325
+ }
25326
+ // e.g. item = _columnVisibility[abc,def]
25327
+ const left = item.split(']')[0];
25328
+ if (left.split('[').length < 2) {
25329
+ continue;
25330
+ }
25331
+ const encodedValues = item.split('[')[1].split(']')[0];
25332
+ if (typeof encodedValues !== 'string') {
25333
+ continue;
25334
+ }
25335
+ exist = true;
25336
+ const columnFields = tableColumns.map(column => column.field);
25337
+ // TODO: Add validation that , is present
25338
+ const columns = encodedValues.split(',').map(value => decodeValue(value));
25339
+
25340
+ // for each column, check if it's visible and add it to visibility model
25341
+ for (const column of columnFields) {
25342
+ const isColumnVisible = columns.includes(column);
25343
+ visibility[column] = isColumnVisible;
25344
+ if (isColumnVisible) {
25345
+ visibleColumnsCount += 1;
25346
+ }
25347
+ }
25348
+ }
25349
+ if (visibleColumnsCount === 0 && !exist) {
25350
+ return null;
25351
+ }
25352
+ return visibility;
25353
+ };
25354
+
25355
+ // Rules:
25356
+ // - if we have something in the URL, use that info
25357
+ // - if we don't have that, use the localStorage and update the URL
25358
+ // - if we don't have that, return an empty ColumnVisibilityModel (which is all columns)
25359
+ // NOTE: the `defaultHidden` is a custom field and not standard DataGrid
25360
+ // The reason is the following bug: https://github.com/mui/mui-x/issues/8407
25361
+ const getColumnsVisibility = (search, columns, localStorageColumnsVisibility, setLocalStorageColumnsVisibility) => {
25362
+ const columnVisibility = getColumnVisibilityFromString(search, columns);
25363
+ if (columnVisibility) {
25364
+ const searchColumnVisibility = getSearchParamsFromColumnVisibility(columnVisibility, columns);
25365
+ if (searchColumnVisibility.toString() !== localStorageColumnsVisibility) {
25366
+ setLocalStorageColumnsVisibility(searchColumnVisibility.toString());
25367
+ }
25368
+ return columnVisibility;
25369
+ }
25370
+ const columnVisibilityFromLocalStorage = getColumnVisibilityFromString(localStorageColumnsVisibility, columns);
25371
+ if (columnVisibilityFromLocalStorage) {
25372
+ return columnVisibilityFromLocalStorage;
25373
+ }
25374
+
25375
+ // No columns in URL or localStorage, just show them all expect the hidden ones
25376
+ const res = {};
25377
+ for (const column of columns) {
25378
+ const field = column.field;
25379
+ res[field] = column.defaultHidden !== true; // undefined will be true
25380
+ }
25381
+
25382
+ return res;
25383
+ };
25384
+ const getPinnedColumnsFromString = (notParsed, tableColumns) => {
25385
+ if (!notParsed || notParsed.length === 1 && notParsed[0] === '?') {
25386
+ return null;
25387
+ }
25388
+ // remove the initial ? if present
25389
+ const parsed = notParsed[0] === '?' ? notParsed.slice(1) : notParsed;
25390
+ const pinnedColumns = {};
25391
+ for (const item of parsed.split('&')) {
25392
+ const fieldURL = item.split('=')[0];
25393
+ if (fieldURL !== '_pinnedColumnsLeft' && fieldURL !== '_pinnedColumnsRight') {
25394
+ continue;
25395
+ }
25396
+ const left = item.split(']')[0];
25397
+ if (left.split('[').length < 2) {
25398
+ continue;
25399
+ }
25400
+ const encodedValues = item.split('[')[1].split(']')[0];
25401
+ if (typeof encodedValues !== 'string') {
25402
+ continue;
25403
+ }
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));
25406
+ if (fieldURL === '_pinnedColumnsLeft') {
25407
+ pinnedColumns['left'] = columns;
25408
+ }
25409
+ if (fieldURL === '_pinnedColumnsRight') {
25410
+ pinnedColumns['right'] = columns;
25411
+ }
25412
+ }
25413
+ if (pinnedColumns.left || pinnedColumns.right) {
25414
+ return {
25415
+ left: pinnedColumns['left'] || [],
25416
+ right: pinnedColumns['right'] || []
25417
+ };
25418
+ }
25419
+ return null;
25420
+ };
25421
+ const getSearchParamsFromPinnedColumns = pinnedColumns => {
25422
+ var _pinnedColumns$left, _pinnedColumns$right;
25423
+ const searchParams = new URLSearchParams();
25424
+ const pinnedColumnLeft = ((_pinnedColumns$left = pinnedColumns.left) === null || _pinnedColumns$left === void 0 ? void 0 : _pinnedColumns$left.map(val => encodeValue(val))) || [];
25425
+ const pinnedColumnRight = ((_pinnedColumns$right = pinnedColumns.right) === null || _pinnedColumns$right === void 0 ? void 0 : _pinnedColumns$right.map(val => encodeValue(val))) || [];
25426
+ searchParams.set('_pinnedColumnsLeft', `[${pinnedColumnLeft.join(',')}]`);
25427
+ searchParams.set('_pinnedColumnsRight', `[${pinnedColumnRight.join(',')}]`);
25428
+ return searchParams;
25429
+ };
25430
+
25431
+ // Rules:
25432
+ // - if we have something in the URL, use that info
25433
+ // - if we don't have that, use the localStorage and update the URL
25434
+ // - if we don't have that, return an empty ColumnVisibilityModel (which is all columns)
25435
+ const getPinnedColumns = (search, columns, localStoragePinnedColumns, setLocalStoragePinnedColumns) => {
25436
+ const pinnedColumns = getPinnedColumnsFromString(search, columns);
25437
+ if (pinnedColumns) {
25438
+ const searchPinnedColumns = getSearchParamsFromPinnedColumns(pinnedColumns);
25439
+ if (searchPinnedColumns.toString() !== localStoragePinnedColumns) {
25440
+ setLocalStoragePinnedColumns(searchPinnedColumns.toString());
25441
+ }
25442
+ return pinnedColumns;
25443
+ }
25444
+ const pinnedColumnsFromLocalStorage = getPinnedColumnsFromString(localStoragePinnedColumns, columns);
25445
+ if (pinnedColumnsFromLocalStorage) {
25446
+ return pinnedColumnsFromLocalStorage;
25447
+ }
25448
+
25449
+ // No pinnedColumn in URL or localStorage, TODO: decide what is the default state
25450
+ const res = {
25451
+ left: [],
25452
+ right: []
25453
+ };
25454
+ return res;
25455
+ };
25456
+ const getSearchParamsFromTab = search => {
25457
+ const searchParams = new URLSearchParams();
25458
+ const openTab = new URLSearchParams(search).get('tab');
25459
+ if (openTab) {
25460
+ searchParams.set('tab', openTab);
25461
+ }
25462
+ return searchParams;
25463
+ };
25464
+ const getFinalSearch = _ref3 => {
25465
+ let {
25466
+ search,
25467
+ filterModel,
25468
+ sortModel,
25469
+ columnsVisibilityModel,
25470
+ pinnedColumnsModel,
25471
+ columns
25472
+ } = _ref3;
25473
+ const filterModelSearch = getSearchParamsFromFilterModel(filterModel);
25474
+ const sortModelSearch = getSearchParamsFromSorting(sortModel);
25475
+ const columnVisibilityModelSearch = getSearchParamsFromColumnVisibility(columnsVisibilityModel, columns);
25476
+ const pinnedColumnsModelSearch = getSearchParamsFromPinnedColumns(pinnedColumnsModel);
25477
+ const tabSearch = getSearchParamsFromTab(search);
25478
+ const searchParams = new URLSearchParams();
25479
+ for (const [key, value] of new URLSearchParams(search)) {
25480
+ if (!key.startsWith('_')) {
25481
+ searchParams.set(key, value);
25482
+ }
25483
+ }
25484
+ return new URLSearchParams([...searchParams, ...filterModelSearch, ...sortModelSearch, ...tabSearch, ...pinnedColumnsModelSearch, ...columnVisibilityModelSearch]);
25485
+ };
25486
+ /** Return the state of the table given the URL and the local storage state */
25487
+ const getModelsParsedOrUpdateLocalStorage = (search, columns, historyReplace, localStorage) => {
25488
+ const {
25489
+ localStorageFilters,
25490
+ setLocalStorageFilters,
25491
+ localStorageSorting,
25492
+ setLocalStorageSorting,
25493
+ localStorageColumnsVisibility,
25494
+ setLocalStorageColumnsVisibility,
25495
+ localStoragePinnedColumns,
25496
+ setLocalStoragePinnedColumns
25497
+ } = localStorage;
25498
+ const filterModel = getFilterModel(search, columns, localStorageFilters, setLocalStorageFilters);
25499
+ const sortModel = getSortModel(search, columns, localStorageSorting, setLocalStorageSorting);
25500
+ const columnVisibilityModel = getColumnsVisibility(search, columns, localStorageColumnsVisibility, setLocalStorageColumnsVisibility);
25501
+ const pinnedColumnsModel = getPinnedColumns(search, columns, localStoragePinnedColumns, setLocalStoragePinnedColumns);
25502
+ const finalSearch = getFinalSearch({
25503
+ search,
25504
+ filterModel,
25505
+ sortModel,
25506
+ columnsVisibilityModel: columnVisibilityModel,
25507
+ pinnedColumnsModel,
25508
+ columns
25509
+ });
25510
+ if (urlSearchParamsToString(finalSearch) !== search) {
25511
+ historyReplace(urlSearchParamsToString(finalSearch));
25512
+ }
25513
+ return {
25514
+ filterModel,
25515
+ sortModel,
25516
+ columnVisibilityModel,
25517
+ pinnedColumnsModel
25518
+ };
25519
+ };
25520
+ const updateUrl = (_ref4, search, historyReplace, columns) => {
25521
+ let {
25522
+ filterModel,
25523
+ sortModel,
25524
+ columnsModel: columnsVisibilityModel,
25525
+ pinnedColumnsModel
25526
+ } = _ref4;
25527
+ const newSearch = getFinalSearch({
25528
+ search,
25529
+ filterModel,
25530
+ sortModel,
25531
+ columnsVisibilityModel,
25532
+ pinnedColumnsModel,
25533
+ columns
25534
+ });
25535
+ if (urlSearchParamsToString(newSearch) !== search) {
25536
+ historyReplace(urlSearchParamsToString(newSearch));
25537
+ }
25538
+ };
25539
+
25540
+ const DATAGRID_VERSION = 1;
25541
+ const useStatefulTable = props => {
25542
+ const {
25543
+ // density = 'standard',
25544
+ apiRef,
25545
+ columns: propsColumns,
25546
+ onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
25547
+ onColumnWidthChange: propsOnColumnWidthChange,
25548
+ onFilterModelChange: propsOnFilterModelChange,
25549
+ onPageChange: propsOnPageChange,
25550
+ onPageSizeChange: propsOnPageSizeChange,
25551
+ onPinnedColumnsChange: propsOnPinnedColumnsChange,
25552
+ onSortModelChange: propsOnSortModelChange,
25553
+ pinnedCustomColumns = {
25554
+ left: [],
25555
+ right: []
25556
+ },
25557
+ useRouter,
25558
+ version = DATAGRID_VERSION
25559
+ } = props;
25560
+ const {
25561
+ search,
25562
+ pathname,
25563
+ historyReplace
25564
+ } = useRouter();
25565
+ const id = pathname;
25566
+ const customDefaults = useMemo(() => {
25567
+ return {
25568
+ pinnedColumns: `_pinnedColumnsLeft=[${[GRID_CHECKBOX_SELECTION_COL_DEF.field, ...pinnedCustomColumns.left].join(',')}]&_pinnedColumnsRight=[${pinnedCustomColumns.right.join(',')}]`
25569
+ };
25570
+ }, [pinnedCustomColumns]);
25571
+
25572
+ // States and setters persisted in the local storage for this table
25573
+ const {
25574
+ paginationModel,
25575
+ setPaginationModel,
25576
+ sortModel,
25577
+ setSortModel,
25578
+ localStorageFilters,
25579
+ setLocalStorageFilters,
25580
+ visibilityModelLocalStorage,
25581
+ setVisibilityModelLocalStorage,
25582
+ pinnedColumns,
25583
+ setPinnedColumns,
25584
+ dimensionModel,
25585
+ setDimensionModel
25586
+ } = useTableStates(id, version, customDefaults);
25587
+
25588
+ // clearing up old version keys, triggering only on first render
25589
+ useEffect(() => clearPreviousVersionStorage(id, version), [id, version]);
25590
+ const onColumnDimensionChange = useCallback(_ref => {
25591
+ let {
25592
+ newWidth,
25593
+ field
25594
+ } = _ref;
25595
+ setDimensionModel(_objectSpread2(_objectSpread2({}, dimensionModel), {}, {
25596
+ [field]: newWidth
25597
+ }));
25598
+ }, [dimensionModel, setDimensionModel]);
25599
+ const {
25600
+ filterModel: filterParsed,
25601
+ sortModel: sortModelParsed,
25602
+ columnVisibilityModel: visibilityModel,
25603
+ pinnedColumnsModel
25604
+ } = getModelsParsedOrUpdateLocalStorage(search || '', propsColumns, historyReplace, {
25605
+ localStorageFilters,
25606
+ setLocalStorageFilters,
25607
+ localStorageSorting: sortModel,
25608
+ setLocalStorageSorting: setSortModel,
25609
+ localStorageColumnsVisibility: visibilityModelLocalStorage,
25610
+ setLocalStorageColumnsVisibility: setVisibilityModelLocalStorage,
25611
+ localStoragePinnedColumns: pinnedColumns,
25612
+ setLocalStoragePinnedColumns: setPinnedColumns
25613
+ });
25614
+ const columns = useMemo(() => propsColumns.map(column => {
25615
+ column.width = dimensionModel[column.field] || column.width || 100;
25616
+ return column;
25617
+ }), [propsColumns, dimensionModel]);
25618
+ return {
25619
+ apiRef,
25620
+ columns,
25621
+ onFilterModelChange: (model, details) => {
25622
+ propsOnFilterModelChange === null || propsOnFilterModelChange === void 0 ? void 0 : propsOnFilterModelChange(model, details);
25623
+ updateUrl({
25624
+ filterModel: model,
25625
+ sortModel: sortModelParsed,
25626
+ columnsModel: apiRef.current.state.columns.columnVisibilityModel,
25627
+ pinnedColumnsModel: pinnedColumnsModel
25628
+ }, search, historyReplace, columns);
25629
+ },
25630
+ filterModel: filterParsed,
25631
+ onSortModelChange: (model, details) => {
25632
+ propsOnSortModelChange === null || propsOnSortModelChange === void 0 ? void 0 : propsOnSortModelChange(model, details);
25633
+ updateUrl({
25634
+ filterModel: filterParsed,
25635
+ sortModel: model,
25636
+ columnsModel: apiRef.current.state.columns.columnVisibilityModel,
25637
+ pinnedColumnsModel: pinnedColumnsModel
25638
+ }, search, historyReplace, columns);
25639
+ },
25640
+ sortModel: sortModelParsed,
25641
+ onPinnedColumnsChange: (pinnedColumns, details) => {
25642
+ propsOnPinnedColumnsChange === null || propsOnPinnedColumnsChange === void 0 ? void 0 : propsOnPinnedColumnsChange(pinnedColumns, details);
25643
+ updateUrl({
25644
+ filterModel: filterParsed,
25645
+ sortModel: sortModelParsed,
25646
+ columnsModel: apiRef.current.state.columns.columnVisibilityModel,
25647
+ pinnedColumnsModel: pinnedColumns
25648
+ }, search, historyReplace, columns);
25649
+ },
25650
+ pinnedColumns: pinnedColumnsModel,
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
+ });
25666
+ },
25667
+ columnVisibilityModel: visibilityModel,
25668
+ onColumnVisibilityModelChange: (columnsVisibilityModel, details) => {
25669
+ propsOnColumnVisibilityModelChange === null || propsOnColumnVisibilityModelChange === void 0 ? void 0 : propsOnColumnVisibilityModelChange(columnsVisibilityModel, details);
25670
+ updateUrl({
25671
+ filterModel: filterParsed,
25672
+ sortModel: sortModelParsed,
25673
+ columnsModel: columnsVisibilityModel,
25674
+ pinnedColumnsModel: pinnedColumnsModel
25675
+ }, search, historyReplace, columns);
25676
+ },
25677
+ onColumnWidthChange: (params, event, details) => {
25678
+ propsOnColumnWidthChange === null || propsOnColumnWidthChange === void 0 ? void 0 : propsOnColumnWidthChange(params, event, details);
25679
+ onColumnDimensionChange({
25680
+ newWidth: params.width,
25681
+ field: params.colDef.field
25682
+ });
25683
+ }
25684
+ };
25685
+ };
25686
+
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"];
25689
+ const COMPONENT_NAME$1 = 'DataGrid';
25690
+ const CLASSNAME$1 = 'redsift-datagrid';
24752
25691
  const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionStatus, isRowSelectable, page, pageSize) => {
24753
- const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref6 => {
25692
+ const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref => {
24754
25693
  let {
24755
25694
  model
24756
- } = _ref6;
25695
+ } = _ref;
24757
25696
  return isRowSelectable({
24758
25697
  row: model
24759
25698
  });
24760
- }).map(_ref7 => {
25699
+ }).map(_ref2 => {
24761
25700
  let {
24762
25701
  id
24763
- } = _ref7;
25702
+ } = _ref2;
24764
25703
  return id;
24765
25704
  }) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
24766
25705
  const numberOfSelectableRowsInPage = selectableRowsInPage.length;
@@ -24804,33 +25743,80 @@ const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionS
24804
25743
  };
24805
25744
  }
24806
25745
  };
25746
+ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25747
+ const {
25748
+ // density = 'standard',
25749
+ apiRef,
25750
+ columns,
25751
+ onColumnVisibilityModelChange,
25752
+ onColumnWidthChange,
25753
+ onFilterModelChange,
25754
+ onPageChange,
25755
+ onPageSizeChange,
25756
+ onPinnedColumnsChange,
25757
+ onSortModelChange,
25758
+ pinnedCustomColumns,
25759
+ rows,
25760
+ useRouter
25761
+ } = props,
25762
+ forwardedProps = _objectWithoutProperties(props, _excluded$1);
25763
+ const statefulTableProps = useStatefulTable({
25764
+ apiRef: apiRef,
25765
+ columns,
25766
+ onFilterModelChange,
25767
+ onPinnedColumnsChange,
25768
+ onSortModelChange,
25769
+ onPageChange,
25770
+ onPageSizeChange,
25771
+ onColumnVisibilityModelChange,
25772
+ onColumnWidthChange,
25773
+ pinnedCustomColumns,
25774
+ useRouter: useRouter
25775
+ });
25776
+ return /*#__PURE__*/React__default.createElement(DataGridPro, _extends$2({
25777
+ ref: ref,
25778
+ rows: rows
25779
+ }, forwardedProps, statefulTableProps));
25780
+ });
24807
25781
  const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24808
- var _ref8, _ref9, _initialState$paginat, _initialState$paginat2, _initialState$paginat3, _pageSizeOptions$, _ref10, _initialState$paginat4, _initialState$paginat5, _initialState$paginat6;
25782
+ var _initialState$paginat, _initialState$paginat2;
24809
25783
  const datagridRef = ref || useRef();
24810
25784
  const {
24811
25785
  apiRef: propsApiRef,
24812
25786
  autoHeight,
24813
25787
  className,
24814
- slots,
24815
- slotProps,
25788
+ columnTypes: propsColumnTypes,
25789
+ components,
25790
+ componentsProps,
24816
25791
  filterModel: propsFilterModel,
25792
+ columnVisibilityModel: propsColumnVisibilityModel,
25793
+ pinnedColumns: propsPinnedColumns,
25794
+ sortModel: propsSortModel,
24817
25795
  height: propsHeight,
24818
25796
  hideToolbar,
24819
25797
  initialState,
24820
25798
  isRowSelectable,
25799
+ isStateful: propsIsStateful,
24821
25800
  license = process.env.MUI_LICENSE_KEY,
24822
25801
  onFilterModelChange: propsOnFilterModelChange,
24823
- rowSelectionModel: propsSelectionModel,
24824
- paginationModel: propsPaginationModel,
24825
- onPaginationModelChange: propsOnPaginationModelChange,
24826
- onRowSelectionModelChange,
25802
+ onPageChange: propsOnPageChange,
25803
+ onPageSizeChange: propsOnPageSizeChange,
25804
+ onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
25805
+ onPinnedColumnsChange: propsOnPinnedColumnsChange,
25806
+ onSortModelChange: propsOnSortModelChange,
25807
+ selectionModel: propsSelectionModel,
25808
+ onSelectionModelChange,
25809
+ page: propsPage,
25810
+ pageSize: propsPageSize,
24827
25811
  pagination,
24828
25812
  paginationPlacement = 'both',
24829
25813
  paginationProps,
25814
+ pinnedCustomColumns,
24830
25815
  rows,
24831
- pageSizeOptions,
25816
+ rowsPerPageOptions,
24832
25817
  sx,
24833
25818
  theme: propsTheme,
25819
+ useRouter,
24834
25820
  paginationMode = 'client',
24835
25821
  rowCount
24836
25822
  } = props,
@@ -24838,7 +25824,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24838
25824
  const theme = useTheme$4(propsTheme);
24839
25825
  const _apiRef = useGridApiRef();
24840
25826
  const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
24841
- const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$3;
25827
+ const RenderedToolbar = components !== null && components !== void 0 && components.Toolbar ? components.Toolbar : Toolbar$2;
24842
25828
  LicenseInfo.setLicenseKey(license);
24843
25829
  const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
24844
25830
  const [filterModel, setFilterModel] = useState(propsFilterModel);
@@ -24852,41 +25838,85 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24852
25838
  setFilterModel(model);
24853
25839
  }
24854
25840
  };
24855
- const [rowSelectionModel, setRowSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
25841
+ const [columnVisibilityModel, setColumnVisibilityModel] = useState(propsColumnVisibilityModel);
24856
25842
  useEffect(() => {
24857
- setRowSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
24858
- }, [propsSelectionModel]);
24859
- const [paginationModel, setPaginationModel] = useState({
24860
- pageSize: (_ref8 = (_ref9 = (_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 && _ref9 !== void 0 ? _ref9 : 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 && _ref8 !== void 0 ? _ref8 : 100,
24861
- page: (_ref10 = (_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 && _ref10 !== void 0 ? _ref10 : 0
24862
- });
24863
- const onPaginationModelChange = model => {
24864
- if (propsOnPaginationModelChange) {
24865
- propsOnPaginationModelChange(model, undefined);
25843
+ setColumnVisibilityModel(propsColumnVisibilityModel);
25844
+ }, [propsColumnVisibilityModel]);
25845
+ const onColumnVisibilityModelChange = (model, details) => {
25846
+ if (propsOnColumnVisibilityModelChange) {
25847
+ propsOnColumnVisibilityModelChange(model, details);
24866
25848
  } else {
24867
- setPaginationModel(model);
25849
+ setColumnVisibilityModel(model);
24868
25850
  }
24869
25851
  };
25852
+ const [pinnedColumns, setPinnedColumns] = useState(propsPinnedColumns);
24870
25853
  useEffect(() => {
24871
- if (propsPaginationModel) {
24872
- setPaginationModel(propsPaginationModel);
25854
+ setPinnedColumns(propsPinnedColumns);
25855
+ }, [propsPinnedColumns]);
25856
+ const onPinnedColumnsChange = (model, details) => {
25857
+ if (propsOnPinnedColumnsChange) {
25858
+ propsOnPinnedColumnsChange(model, details);
25859
+ } else {
25860
+ setPinnedColumns(model);
24873
25861
  }
24874
- }, [propsPaginationModel]);
25862
+ };
25863
+ const [sortModel, setSortModel] = useState(propsSortModel);
25864
+ useEffect(() => {
25865
+ setSortModel(propsSortModel);
25866
+ }, [propsSortModel]);
25867
+ const onSortModelChange = (model, details) => {
25868
+ if (propsOnSortModelChange) {
25869
+ propsOnSortModelChange(model, details);
25870
+ } else {
25871
+ setSortModel(model);
25872
+ }
25873
+ };
25874
+ const [selectionModel, setSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
25875
+ useEffect(() => {
25876
+ setSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
25877
+ }, [propsSelectionModel]);
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);
24875
25880
  const selectionStatus = useRef({
24876
25881
  type: 'none',
24877
25882
  numberOfSelectedRows: 0,
24878
25883
  numberOfSelectedRowsInPage: 0,
24879
- page: paginationModel.page,
24880
- pageSize: paginationModel.pageSize
25884
+ page,
25885
+ pageSize
24881
25886
  });
25887
+ const onPageChange = page => {
25888
+ if (propsOnPageChange) {
25889
+ propsOnPageChange(page, undefined);
25890
+ } else {
25891
+ setPage(page);
25892
+ }
25893
+ };
25894
+ useEffect(() => {
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);
25905
+ }
25906
+ };
25907
+ useEffect(() => {
25908
+ if (propsPageSize) {
25909
+ setPageSize(propsPageSize);
25910
+ }
25911
+ }, [propsPageSize]);
24882
25912
 
24883
25913
  // in server-side pagination we want to update the selection status
24884
25914
  // every time we navigate between pages, resize our page or select something
24885
25915
  useEffect(() => {
24886
25916
  if (paginationMode == 'server') {
24887
- 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);
24888
25918
  }
24889
- }, [rowSelectionModel, paginationModel.page, paginationModel.pageSize]);
25919
+ }, [selectionModel, page, pageSize]);
24890
25920
  if (!Array.isArray(rows)) {
24891
25921
  return null;
24892
25922
  }
@@ -24902,6 +25932,8 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24902
25932
  }
24903
25933
  }
24904
25934
  }), [theme]);
25935
+ const isStateful = propsIsStateful && useRouter;
25936
+ const RenderedDataGrid = isStateful ? StatefulDataGrid : DataGridPro;
24905
25937
  return /*#__PURE__*/React__default.createElement(ThemeProvider$4, {
24906
25938
  value: {
24907
25939
  theme
@@ -24912,59 +25944,65 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24912
25944
  ref: datagridRef,
24913
25945
  className: classNames(DataGrid.className, className),
24914
25946
  $height: height
24915
- }, /*#__PURE__*/React__default.createElement(DataGridPro, _extends$2({}, forwardedProps, {
25947
+ }, /*#__PURE__*/React__default.createElement(RenderedDataGrid, _extends$2({}, isStateful ? {
25948
+ pinnedCustomColumns,
25949
+ useRouter
25950
+ } : {}, forwardedProps, {
24916
25951
  rowCount: rowCount,
24917
25952
  apiRef: apiRef,
24918
25953
  autoHeight: autoHeight,
24919
25954
  checkboxSelectionVisibleOnly: Boolean(pagination),
24920
- slots: _objectSpread2(_objectSpread2({
24921
- baseButton: BaseButton,
24922
- baseCheckbox: BaseCheckbox,
24923
- // baseTextField,
24924
- basePopper: BasePopper,
24925
- 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, {
24926
25962
  displayName: "ColumnFilteredIcon"
24927
25963
  })),
24928
- columnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25964
+ ColumnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24929
25965
  displayName: "ColumnSelectorIcon"
24930
25966
  })),
24931
- columnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25967
+ ColumnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24932
25968
  displayName: "ColumnSortedAscendingIcon"
24933
25969
  })),
24934
- columnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25970
+ ColumnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24935
25971
  displayName: "ColumnSortedDescendingIcon"
24936
25972
  })),
24937
- densityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25973
+ DensityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24938
25974
  displayName: "DensityCompactIcon"
24939
25975
  })),
24940
- densityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25976
+ DensityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24941
25977
  displayName: "DensityStandardIcon"
24942
25978
  })),
24943
- densityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25979
+ DensityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24944
25980
  displayName: "DensityComfortableIcon"
24945
25981
  })),
24946
- detailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25982
+ DetailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24947
25983
  displayName: "DetailPanelCollapseIcon"
24948
25984
  })),
24949
- detailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25985
+ DetailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24950
25986
  displayName: "DetailPanelExpandIcon"
24951
25987
  })),
24952
- exportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
25988
+ ExportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
24953
25989
  displayName: "ExportIcon"
24954
25990
  })),
24955
- openFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
25991
+ OpenFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
24956
25992
  displayName: "OpenFilterButtonIcon"
24957
25993
  }, props))
24958
- }, slots), {}, {
24959
- toolbar: Toolbar,
24960
- 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, {
24961
25997
  displaySelection: false,
24962
25998
  displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
24963
25999
  displayPagination: ['bottom', 'both'].includes(paginationPlacement),
24964
26000
  selectionStatus: selectionStatus.current,
24965
- paginationModel: paginationModel,
24966
- onPaginationModelChange: onPaginationModelChange,
24967
- pageSizeOptions: pageSizeOptions,
26001
+ page: page,
26002
+ onPageChange: onPageChange,
26003
+ pageSize: pageSize,
26004
+ onPageSizeChange: onPageSizeChange,
26005
+ rowsPerPageOptions: rowsPerPageOptions,
24968
26006
  paginationProps: paginationProps,
24969
26007
  paginationMode: paginationMode,
24970
26008
  rowCount: rowCount
@@ -24975,72 +26013,85 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
24975
26013
  selectionStatus: selectionStatus.current,
24976
26014
  apiRef: apiRef,
24977
26015
  isRowSelectable: isRowSelectable,
24978
- paginationModel: paginationModel,
24979
- onPaginationModelChange: onPaginationModelChange,
24980
- pageSizeOptions: pageSizeOptions,
26016
+ page: page,
26017
+ onPageChange: onPageChange,
26018
+ pageSize: pageSize,
26019
+ onPageSizeChange: onPageSizeChange,
26020
+ rowsPerPageOptions: rowsPerPageOptions,
24981
26021
  paginationProps: paginationProps,
24982
26022
  paginationMode: paginationMode
24983
26023
  })) : null
24984
26024
  }),
24985
- slotProps: _objectSpread2(_objectSpread2({}, slotProps), {}, {
26025
+ componentsProps: _objectSpread2(_objectSpread2({}, componentsProps), {}, {
24986
26026
  toolbar: _objectSpread2({
24987
26027
  hideToolbar,
24988
26028
  RenderedToolbar,
24989
26029
  filterModel,
24990
26030
  onFilterModelChange,
24991
26031
  pagination,
24992
- ControlledPagination: paginationMode == 'server' ? ServerSideControlledPagination : ControlledPagination,
24993
26032
  paginationPlacement,
24994
26033
  selectionStatus,
24995
26034
  apiRef,
24996
26035
  isRowSelectable,
24997
- paginationModel,
24998
- onPaginationModelChange,
24999
- pageSizeOptions,
26036
+ page,
26037
+ onPageChange,
26038
+ pageSize,
26039
+ onPageSizeChange,
26040
+ rowsPerPageOptions,
25000
26041
  paginationProps,
25001
26042
  paginationMode,
25002
26043
  rowCount
25003
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar)
26044
+ }, componentsProps === null || componentsProps === void 0 ? void 0 : componentsProps.toolbar)
25004
26045
  }),
25005
26046
  filterModel: filterModel,
26047
+ columnVisibilityModel: columnVisibilityModel,
26048
+ pinnedColumns: pinnedColumns,
26049
+ sortModel: sortModel,
25006
26050
  initialState: initialState,
25007
26051
  isRowSelectable: isRowSelectable,
25008
26052
  onFilterModelChange: onFilterModelChange,
26053
+ onColumnVisibilityModelChange: onColumnVisibilityModelChange
26054
+ // onColumnWidthChange={onColumnWidthChange}
26055
+ ,
26056
+ onPinnedColumnsChange: onPinnedColumnsChange,
26057
+ onSortModelChange: onSortModelChange,
25009
26058
  pagination: pagination,
25010
26059
  paginationMode: paginationMode,
25011
26060
  keepNonExistentRowsSelected: paginationMode == 'server',
25012
26061
  rows: rows,
25013
- pageSizeOptions: pageSizeOptions,
25014
- paginationModel: paginationModel,
25015
- onPaginationModelChange: onPaginationModelChange,
25016
- rowSelectionModel: rowSelectionModel,
25017
- 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) => {
25018
26069
  if (pagination && paginationMode != 'server') {
25019
- const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref11 => {
26070
+ const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref3 => {
25020
26071
  let {
25021
26072
  model
25022
- } = _ref11;
26073
+ } = _ref3;
25023
26074
  return isRowSelectable({
25024
26075
  row: model
25025
26076
  });
25026
- }).map(_ref12 => {
26077
+ }).map(_ref4 => {
25027
26078
  let {
25028
26079
  id
25029
- } = _ref12;
26080
+ } = _ref4;
25030
26081
  return id;
25031
26082
  }) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
25032
26083
  const numberOfSelectableRowsInPage = selectableRowsInPage.length;
25033
- const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref13 => {
26084
+ const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref5 => {
25034
26085
  let {
25035
26086
  model
25036
- } = _ref13;
26087
+ } = _ref5;
25037
26088
  return isRowSelectable({
25038
26089
  row: model
25039
26090
  });
25040
- }).map(_ref14 => {
26091
+ }).map(_ref6 => {
25041
26092
  let {
25042
26093
  id
25043
- } = _ref14;
26094
+ } = _ref6;
25044
26095
  return id;
25045
26096
  }) : gridFilteredSortedRowIdsSelector(apiRef);
25046
26097
  const numberOfSelectableRowsInTable = selectableRowsInTable.length;
@@ -25072,7 +26123,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
25072
26123
  };
25073
26124
  }
25074
26125
  }
25075
- onRowSelectionModelChange === null || onRowSelectionModelChange === void 0 ? void 0 : onRowSelectionModelChange(newSelectionModel, details);
26126
+ onSelectionModelChange === null || onSelectionModelChange === void 0 ? void 0 : onSelectionModelChange(newSelectionModel, details);
25076
26127
  },
25077
26128
  sx: _objectSpread2(_objectSpread2({}, sx), {}, {
25078
26129
  '.MuiDataGrid-columnHeaders': {
@@ -25146,5 +26197,5 @@ const TextCell = /*#__PURE__*/forwardRef((props, ref) => {
25146
26197
  TextCell.className = CLASSNAME;
25147
26198
  TextCell.displayName = COMPONENT_NAME;
25148
26199
 
25149
- export { CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DataGrid, ENDS_WITH_ANY_OF, GridToolbarFilterSemanticField, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, STARTS_WITH_ANY_OF, TextCell, Toolbar$3 as Toolbar, getCompletion, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators };
26200
+ export { CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DataGrid, ENDS_WITH_ANY_OF, GridToolbarFilterSemanticField, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, STARTS_WITH_ANY_OF, TextCell, Toolbar$2 as Toolbar, getCompletion, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, operatorList };
25150
26201
  //# sourceMappingURL=index.js.map