@redsift/table 10.8.2 → 11.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +122 -3
- package/index.js +1271 -178
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector,
|
|
1
|
+
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputValue, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators, GridLogicOperator, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, GRID_CHECKBOX_SELECTION_COL_DEF, useGridApiRef, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, DataGridPro } from '@mui/x-data-grid-pro';
|
|
2
2
|
export * from '@mui/x-data-grid-pro';
|
|
3
3
|
export { getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
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,
|
|
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, LinkButton, ThemeProvider as ThemeProvider$4, RedsiftColorBlueN, RedsiftColorNeutralXDarkGrey, RedsiftColorNeutralWhite, Shield } from '@redsift/design-system';
|
|
7
7
|
import { mdiSync, mdiFilterVariant, mdiViewColumn, mdiChevronUp, mdiChevronDown, mdiViewHeadline, mdiViewSequential, mdiViewStream, mdiChevronRight, mdiTrayArrowDown } from '@redsift/icons';
|
|
8
8
|
import emStyled from '@emotion/styled';
|
|
9
9
|
import { Global, ThemeContext as ThemeContext$3, keyframes } from '@emotion/react';
|
|
@@ -3625,7 +3625,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
3625
3625
|
return target;
|
|
3626
3626
|
}
|
|
3627
3627
|
|
|
3628
|
-
const _excluded$
|
|
3628
|
+
const _excluded$R = ["values", "unit", "step"];
|
|
3629
3629
|
const sortBreakpointsValues = values => {
|
|
3630
3630
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
3631
3631
|
key,
|
|
@@ -3660,7 +3660,7 @@ function createBreakpoints(breakpoints) {
|
|
|
3660
3660
|
unit = 'px',
|
|
3661
3661
|
step = 5
|
|
3662
3662
|
} = breakpoints,
|
|
3663
|
-
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$
|
|
3663
|
+
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$R);
|
|
3664
3664
|
const sortedValues = sortBreakpointsValues(values);
|
|
3665
3665
|
const keys = Object.keys(sortedValues);
|
|
3666
3666
|
function up(key) {
|
|
@@ -4689,7 +4689,7 @@ const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
|
4689
4689
|
styleFunctionSx.filterProps = ['sx'];
|
|
4690
4690
|
var styleFunctionSx$1 = styleFunctionSx;
|
|
4691
4691
|
|
|
4692
|
-
const _excluded$
|
|
4692
|
+
const _excluded$Q = ["breakpoints", "palette", "spacing", "shape"];
|
|
4693
4693
|
function createTheme$1(options = {}, ...args) {
|
|
4694
4694
|
const {
|
|
4695
4695
|
breakpoints: breakpointsInput = {},
|
|
@@ -4697,7 +4697,7 @@ function createTheme$1(options = {}, ...args) {
|
|
|
4697
4697
|
spacing: spacingInput,
|
|
4698
4698
|
shape: shapeInput = {}
|
|
4699
4699
|
} = options,
|
|
4700
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
4700
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$Q);
|
|
4701
4701
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
4702
4702
|
const spacing = createSpacing(spacingInput);
|
|
4703
4703
|
let muiTheme = deepmerge({
|
|
@@ -4765,7 +4765,7 @@ process.env.NODE_ENV !== "production" ? GlobalStyles$1.propTypes /* remove-propt
|
|
|
4765
4765
|
themeId: PropTypes.string
|
|
4766
4766
|
} : void 0;
|
|
4767
4767
|
|
|
4768
|
-
const _excluded$
|
|
4768
|
+
const _excluded$P = ["sx"];
|
|
4769
4769
|
const splitProps = props => {
|
|
4770
4770
|
var _props$theme$unstable, _props$theme;
|
|
4771
4771
|
const result = {
|
|
@@ -4786,7 +4786,7 @@ function extendSxProp(props) {
|
|
|
4786
4786
|
const {
|
|
4787
4787
|
sx: inSx
|
|
4788
4788
|
} = props,
|
|
4789
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4789
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$P);
|
|
4790
4790
|
const {
|
|
4791
4791
|
systemProps,
|
|
4792
4792
|
otherProps
|
|
@@ -4812,7 +4812,7 @@ function extendSxProp(props) {
|
|
|
4812
4812
|
|
|
4813
4813
|
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
4814
|
|
|
4815
|
-
const _excluded$
|
|
4815
|
+
const _excluded$O = ["className", "component"];
|
|
4816
4816
|
function createBox(options = {}) {
|
|
4817
4817
|
const {
|
|
4818
4818
|
themeId,
|
|
@@ -4830,7 +4830,7 @@ function createBox(options = {}) {
|
|
|
4830
4830
|
className,
|
|
4831
4831
|
component = 'div'
|
|
4832
4832
|
} = _extendSxProp,
|
|
4833
|
-
other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$
|
|
4833
|
+
other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$O);
|
|
4834
4834
|
return /*#__PURE__*/jsxRuntimeExports.jsx(BoxRoot, _extends$1({
|
|
4835
4835
|
as: component,
|
|
4836
4836
|
ref: ref,
|
|
@@ -4841,7 +4841,7 @@ function createBox(options = {}) {
|
|
|
4841
4841
|
return Box;
|
|
4842
4842
|
}
|
|
4843
4843
|
|
|
4844
|
-
const _excluded$
|
|
4844
|
+
const _excluded$N = ["variant"];
|
|
4845
4845
|
function isEmpty$3(string) {
|
|
4846
4846
|
return string.length === 0;
|
|
4847
4847
|
}
|
|
@@ -4855,7 +4855,7 @@ function propsToClassKey(props) {
|
|
|
4855
4855
|
const {
|
|
4856
4856
|
variant
|
|
4857
4857
|
} = props,
|
|
4858
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4858
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$N);
|
|
4859
4859
|
let classKey = variant || '';
|
|
4860
4860
|
Object.keys(other).sort().forEach(key => {
|
|
4861
4861
|
if (key === 'color') {
|
|
@@ -4867,7 +4867,7 @@ function propsToClassKey(props) {
|
|
|
4867
4867
|
return classKey;
|
|
4868
4868
|
}
|
|
4869
4869
|
|
|
4870
|
-
const _excluded$
|
|
4870
|
+
const _excluded$M = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
4871
4871
|
function isEmpty$2(obj) {
|
|
4872
4872
|
return Object.keys(obj).length === 0;
|
|
4873
4873
|
}
|
|
@@ -4962,7 +4962,7 @@ function createStyled(input = {}) {
|
|
|
4962
4962
|
skipSx: inputSkipSx,
|
|
4963
4963
|
overridesResolver
|
|
4964
4964
|
} = inputOptions,
|
|
4965
|
-
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$
|
|
4965
|
+
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$M);
|
|
4966
4966
|
|
|
4967
4967
|
// if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
4968
4968
|
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
|
|
@@ -5639,7 +5639,7 @@ const green = {
|
|
|
5639
5639
|
};
|
|
5640
5640
|
var green$1 = green;
|
|
5641
5641
|
|
|
5642
|
-
const _excluded$
|
|
5642
|
+
const _excluded$L = ["mode", "contrastThreshold", "tonalOffset"];
|
|
5643
5643
|
const light = {
|
|
5644
5644
|
// The colors used to style the text.
|
|
5645
5645
|
text: {
|
|
@@ -5808,7 +5808,7 @@ function createPalette(palette) {
|
|
|
5808
5808
|
contrastThreshold = 3,
|
|
5809
5809
|
tonalOffset = 0.2
|
|
5810
5810
|
} = palette,
|
|
5811
|
-
other = _objectWithoutPropertiesLoose(palette, _excluded$
|
|
5811
|
+
other = _objectWithoutPropertiesLoose(palette, _excluded$L);
|
|
5812
5812
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
5813
5813
|
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
5814
5814
|
const error = palette.error || getDefaultError(mode);
|
|
@@ -5932,7 +5932,7 @@ const theme2 = createTheme({ palette: {
|
|
|
5932
5932
|
return paletteOutput;
|
|
5933
5933
|
}
|
|
5934
5934
|
|
|
5935
|
-
const _excluded$
|
|
5935
|
+
const _excluded$K = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
5936
5936
|
function round$2(value) {
|
|
5937
5937
|
return Math.round(value * 1e5) / 1e5;
|
|
5938
5938
|
}
|
|
@@ -5963,7 +5963,7 @@ function createTypography(palette, typography) {
|
|
|
5963
5963
|
allVariants,
|
|
5964
5964
|
pxToRem: pxToRem2
|
|
5965
5965
|
} = _ref,
|
|
5966
|
-
other = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5966
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded$K);
|
|
5967
5967
|
if (process.env.NODE_ENV !== 'production') {
|
|
5968
5968
|
if (typeof fontSize !== 'number') {
|
|
5969
5969
|
console.error('MUI: `fontSize` is required to be a number.');
|
|
@@ -6030,7 +6030,7 @@ function createShadow(...px) {
|
|
|
6030
6030
|
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
6031
|
var shadows$1 = shadows;
|
|
6032
6032
|
|
|
6033
|
-
const _excluded$
|
|
6033
|
+
const _excluded$J = ["duration", "easing", "delay"];
|
|
6034
6034
|
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
6035
6035
|
// to learn the context in which each easing should be used.
|
|
6036
6036
|
const easing = {
|
|
@@ -6081,7 +6081,7 @@ function createTransitions(inputTransitions) {
|
|
|
6081
6081
|
easing: easingOption = mergedEasing.easeInOut,
|
|
6082
6082
|
delay = 0
|
|
6083
6083
|
} = options,
|
|
6084
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
6084
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$J);
|
|
6085
6085
|
if (process.env.NODE_ENV !== 'production') {
|
|
6086
6086
|
const isString = value => typeof value === 'string';
|
|
6087
6087
|
// IE11 support, replace with Number.isNaN
|
|
@@ -6128,7 +6128,7 @@ const zIndex = {
|
|
|
6128
6128
|
};
|
|
6129
6129
|
var zIndex$1 = zIndex;
|
|
6130
6130
|
|
|
6131
|
-
const _excluded$
|
|
6131
|
+
const _excluded$I = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
6132
6132
|
function createTheme(options = {}, ...args) {
|
|
6133
6133
|
const {
|
|
6134
6134
|
mixins: mixinsInput = {},
|
|
@@ -6136,7 +6136,7 @@ function createTheme(options = {}, ...args) {
|
|
|
6136
6136
|
transitions: transitionsInput = {},
|
|
6137
6137
|
typography: typographyInput = {}
|
|
6138
6138
|
} = options,
|
|
6139
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
6139
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$I);
|
|
6140
6140
|
if (options.vars) {
|
|
6141
6141
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`vars\` is a private field used for CSS variables support.
|
|
6142
6142
|
Please use another name.` : formatMuiErrorMessage(18));
|
|
@@ -6227,12 +6227,12 @@ const styled = createStyled({
|
|
|
6227
6227
|
});
|
|
6228
6228
|
var styled$1 = styled;
|
|
6229
6229
|
|
|
6230
|
-
const _excluded$
|
|
6230
|
+
const _excluded$H = ["theme"];
|
|
6231
6231
|
function ThemeProvider$1(_ref) {
|
|
6232
6232
|
let {
|
|
6233
6233
|
theme: themeInput
|
|
6234
6234
|
} = _ref,
|
|
6235
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
6235
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$H);
|
|
6236
6236
|
const scopedTheme = themeInput[THEME_ID];
|
|
6237
6237
|
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$2, _extends$1({}, props, {
|
|
6238
6238
|
themeId: scopedTheme ? THEME_ID : undefined,
|
|
@@ -6456,7 +6456,7 @@ function mergeSlotProps(parameters) {
|
|
|
6456
6456
|
};
|
|
6457
6457
|
}
|
|
6458
6458
|
|
|
6459
|
-
const _excluded$
|
|
6459
|
+
const _excluded$G = ["elementType", "externalSlotProps", "ownerState"];
|
|
6460
6460
|
/**
|
|
6461
6461
|
* @ignore - do not document.
|
|
6462
6462
|
* Builds the props to be passed into the slot of an unstyled component.
|
|
@@ -6472,7 +6472,7 @@ function useSlotProps(parameters) {
|
|
|
6472
6472
|
externalSlotProps,
|
|
6473
6473
|
ownerState
|
|
6474
6474
|
} = parameters,
|
|
6475
|
-
rest = _objectWithoutPropertiesLoose(parameters, _excluded$
|
|
6475
|
+
rest = _objectWithoutPropertiesLoose(parameters, _excluded$G);
|
|
6476
6476
|
const resolvedComponentsProps = resolveComponentProps(externalSlotProps, ownerState);
|
|
6477
6477
|
const {
|
|
6478
6478
|
props: mergedProps,
|
|
@@ -8688,7 +8688,7 @@ function getPopperUtilityClass(slot) {
|
|
|
8688
8688
|
}
|
|
8689
8689
|
generateUtilityClasses('MuiPopper', ['root']);
|
|
8690
8690
|
|
|
8691
|
-
const _excluded$
|
|
8691
|
+
const _excluded$F = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "placement", "popperOptions", "popperRef", "slotProps", "slots", "TransitionProps", "ownerState"],
|
|
8692
8692
|
_excluded2$3 = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition", "slotProps", "slots"];
|
|
8693
8693
|
function flipPlacement(placement, direction) {
|
|
8694
8694
|
if (direction === 'ltr') {
|
|
@@ -8741,7 +8741,7 @@ const PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props
|
|
|
8741
8741
|
// @ts-ignore internal logic
|
|
8742
8742
|
// prevent from spreading to DOM, it can come from the parent component e.g. Select.
|
|
8743
8743
|
} = props,
|
|
8744
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
8744
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$F);
|
|
8745
8745
|
const tooltipRef = React.useRef(null);
|
|
8746
8746
|
const ownRef = useForkRef(tooltipRef, forwardedRef);
|
|
8747
8747
|
const popperRef = React.useRef(null);
|
|
@@ -9268,7 +9268,7 @@ function getModalUtilityClass(slot) {
|
|
|
9268
9268
|
}
|
|
9269
9269
|
generateUtilityClasses('MuiModal', ['root', 'hidden', 'backdrop']);
|
|
9270
9270
|
|
|
9271
|
-
const _excluded$
|
|
9271
|
+
const _excluded$E = ["children", "closeAfterTransition", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onKeyDown", "open", "onTransitionEnter", "onTransitionExited", "slotProps", "slots"];
|
|
9272
9272
|
const useUtilityClasses$o = ownerState => {
|
|
9273
9273
|
const {
|
|
9274
9274
|
open,
|
|
@@ -9337,7 +9337,7 @@ const Modal$2 = /*#__PURE__*/React.forwardRef(function Modal(props, forwardedRef
|
|
|
9337
9337
|
slotProps = {},
|
|
9338
9338
|
slots = {}
|
|
9339
9339
|
} = props,
|
|
9340
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
9340
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$E);
|
|
9341
9341
|
// TODO: `modal`` must change its type in this file to match the type of methods
|
|
9342
9342
|
// provided by `ModalManager`
|
|
9343
9343
|
const manager = managerProp;
|
|
@@ -9627,7 +9627,7 @@ process.env.NODE_ENV !== "production" ? Modal$2.propTypes /* remove-proptypes */
|
|
|
9627
9627
|
} : void 0;
|
|
9628
9628
|
var ModalUnstyled = Modal$2;
|
|
9629
9629
|
|
|
9630
|
-
const _excluded$
|
|
9630
|
+
const _excluded$D = ["onChange", "maxRows", "minRows", "style", "value"];
|
|
9631
9631
|
function getStyleValue(value) {
|
|
9632
9632
|
return parseInt(value, 10) || 0;
|
|
9633
9633
|
}
|
|
@@ -9669,7 +9669,7 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
|
|
|
9669
9669
|
style,
|
|
9670
9670
|
value
|
|
9671
9671
|
} = props,
|
|
9672
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
9672
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$D);
|
|
9673
9673
|
const {
|
|
9674
9674
|
current: isControlled
|
|
9675
9675
|
} = React.useRef(value != null);
|
|
@@ -9963,7 +9963,7 @@ function getInputBaseUtilityClass(slot) {
|
|
|
9963
9963
|
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
9964
|
var inputBaseClasses$1 = inputBaseClasses;
|
|
9965
9965
|
|
|
9966
|
-
const _excluded$
|
|
9966
|
+
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
9967
|
const rootOverridesResolver = (props, styles) => {
|
|
9968
9968
|
const {
|
|
9969
9969
|
ownerState
|
|
@@ -10194,7 +10194,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
10194
10194
|
type = 'text',
|
|
10195
10195
|
value: valueProp
|
|
10196
10196
|
} = props,
|
|
10197
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
10197
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$C);
|
|
10198
10198
|
const value = inputPropsProp.value != null ? inputPropsProp.value : valueProp;
|
|
10199
10199
|
const {
|
|
10200
10200
|
current: isControlled
|
|
@@ -10656,7 +10656,7 @@ function getInputUtilityClass(slot) {
|
|
|
10656
10656
|
const inputClasses = _extends$1({}, inputBaseClasses$1, generateUtilityClasses('MuiInput', ['root', 'underline', 'input']));
|
|
10657
10657
|
var inputClasses$1 = inputClasses;
|
|
10658
10658
|
|
|
10659
|
-
const _excluded$
|
|
10659
|
+
const _excluded$B = ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "slotProps", "slots", "type"];
|
|
10660
10660
|
const useUtilityClasses$m = ownerState => {
|
|
10661
10661
|
const {
|
|
10662
10662
|
classes,
|
|
@@ -10769,7 +10769,7 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
|
|
|
10769
10769
|
slots = {},
|
|
10770
10770
|
type = 'text'
|
|
10771
10771
|
} = props,
|
|
10772
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
10772
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$B);
|
|
10773
10773
|
const classes = useUtilityClasses$m(props);
|
|
10774
10774
|
const ownerState = {
|
|
10775
10775
|
disableUnderline
|
|
@@ -10992,7 +10992,7 @@ function getFilledInputUtilityClass(slot) {
|
|
|
10992
10992
|
const filledInputClasses = _extends$1({}, inputBaseClasses$1, generateUtilityClasses('MuiFilledInput', ['root', 'underline', 'input']));
|
|
10993
10993
|
var filledInputClasses$1 = filledInputClasses;
|
|
10994
10994
|
|
|
10995
|
-
const _excluded$
|
|
10995
|
+
const _excluded$A = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "slotProps", "slots", "type"];
|
|
10996
10996
|
const useUtilityClasses$l = ownerState => {
|
|
10997
10997
|
const {
|
|
10998
10998
|
classes,
|
|
@@ -11176,7 +11176,7 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
|
|
|
11176
11176
|
slots = {},
|
|
11177
11177
|
type = 'text'
|
|
11178
11178
|
} = props,
|
|
11179
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
11179
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$A);
|
|
11180
11180
|
const ownerState = _extends$1({}, props, {
|
|
11181
11181
|
fullWidth,
|
|
11182
11182
|
inputComponent,
|
|
@@ -11407,7 +11407,7 @@ FilledInput.muiName = 'Input';
|
|
|
11407
11407
|
var FilledInput$1 = FilledInput;
|
|
11408
11408
|
|
|
11409
11409
|
var _span$2;
|
|
11410
|
-
const _excluded$
|
|
11410
|
+
const _excluded$z = ["children", "classes", "className", "label", "notched"];
|
|
11411
11411
|
const NotchedOutlineRoot$1 = styled$1('fieldset')({
|
|
11412
11412
|
textAlign: 'left',
|
|
11413
11413
|
position: 'absolute',
|
|
@@ -11480,7 +11480,7 @@ function NotchedOutline(props) {
|
|
|
11480
11480
|
label,
|
|
11481
11481
|
notched
|
|
11482
11482
|
} = props,
|
|
11483
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
11483
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$z);
|
|
11484
11484
|
const withLabel = label != null && label !== '';
|
|
11485
11485
|
const ownerState = _extends$1({}, props, {
|
|
11486
11486
|
notched,
|
|
@@ -11537,7 +11537,7 @@ function getOutlinedInputUtilityClass(slot) {
|
|
|
11537
11537
|
const outlinedInputClasses = _extends$1({}, inputBaseClasses$1, generateUtilityClasses('MuiOutlinedInput', ['root', 'notchedOutline', 'input']));
|
|
11538
11538
|
var outlinedInputClasses$1 = outlinedInputClasses;
|
|
11539
11539
|
|
|
11540
|
-
const _excluded$
|
|
11540
|
+
const _excluded$y = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"];
|
|
11541
11541
|
const useUtilityClasses$k = ownerState => {
|
|
11542
11542
|
const {
|
|
11543
11543
|
classes
|
|
@@ -11656,7 +11656,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
11656
11656
|
slots = {},
|
|
11657
11657
|
type = 'text'
|
|
11658
11658
|
} = props,
|
|
11659
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
11659
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$y);
|
|
11660
11660
|
const classes = useUtilityClasses$k(props);
|
|
11661
11661
|
const muiFormControl = useFormControl();
|
|
11662
11662
|
const fcs = formControlState({
|
|
@@ -11877,7 +11877,7 @@ function getFormLabelUtilityClasses(slot) {
|
|
|
11877
11877
|
const formLabelClasses = generateUtilityClasses('MuiFormLabel', ['root', 'colorSecondary', 'focused', 'disabled', 'error', 'filled', 'required', 'asterisk']);
|
|
11878
11878
|
var formLabelClasses$1 = formLabelClasses;
|
|
11879
11879
|
|
|
11880
|
-
const _excluded$
|
|
11880
|
+
const _excluded$x = ["children", "className", "color", "component", "disabled", "error", "filled", "focused", "required"];
|
|
11881
11881
|
const useUtilityClasses$j = ownerState => {
|
|
11882
11882
|
const {
|
|
11883
11883
|
classes,
|
|
@@ -11942,7 +11942,7 @@ const FormLabel = /*#__PURE__*/React.forwardRef(function FormLabel(inProps, ref)
|
|
|
11942
11942
|
className,
|
|
11943
11943
|
component = 'label'
|
|
11944
11944
|
} = props,
|
|
11945
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
11945
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$x);
|
|
11946
11946
|
const muiFormControl = useFormControl();
|
|
11947
11947
|
const fcs = formControlState({
|
|
11948
11948
|
props,
|
|
@@ -12033,7 +12033,7 @@ function getInputLabelUtilityClasses(slot) {
|
|
|
12033
12033
|
}
|
|
12034
12034
|
generateUtilityClasses('MuiInputLabel', ['root', 'focused', 'disabled', 'error', 'required', 'asterisk', 'formControl', 'sizeSmall', 'shrink', 'animated', 'standard', 'filled', 'outlined']);
|
|
12035
12035
|
|
|
12036
|
-
const _excluded$
|
|
12036
|
+
const _excluded$w = ["disableAnimation", "margin", "shrink", "variant", "className"];
|
|
12037
12037
|
const useUtilityClasses$i = ownerState => {
|
|
12038
12038
|
const {
|
|
12039
12039
|
classes,
|
|
@@ -12135,7 +12135,7 @@ const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, re
|
|
|
12135
12135
|
shrink: shrinkProp,
|
|
12136
12136
|
className
|
|
12137
12137
|
} = props,
|
|
12138
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
12138
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$w);
|
|
12139
12139
|
const muiFormControl = useFormControl();
|
|
12140
12140
|
let shrink = shrinkProp;
|
|
12141
12141
|
if (typeof shrink === 'undefined' && muiFormControl) {
|
|
@@ -12238,7 +12238,7 @@ function getFormControlUtilityClasses(slot) {
|
|
|
12238
12238
|
}
|
|
12239
12239
|
generateUtilityClasses('MuiFormControl', ['root', 'marginNone', 'marginNormal', 'marginDense', 'fullWidth', 'disabled']);
|
|
12240
12240
|
|
|
12241
|
-
const _excluded$
|
|
12241
|
+
const _excluded$v = ["children", "className", "color", "component", "disabled", "error", "focused", "fullWidth", "hiddenLabel", "margin", "required", "size", "variant"];
|
|
12242
12242
|
const useUtilityClasses$h = ownerState => {
|
|
12243
12243
|
const {
|
|
12244
12244
|
classes,
|
|
@@ -12324,7 +12324,7 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
12324
12324
|
size = 'medium',
|
|
12325
12325
|
variant = 'outlined'
|
|
12326
12326
|
} = props,
|
|
12327
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
12327
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$v);
|
|
12328
12328
|
const ownerState = _extends$1({}, props, {
|
|
12329
12329
|
color,
|
|
12330
12330
|
component,
|
|
@@ -12520,7 +12520,7 @@ const formHelperTextClasses = generateUtilityClasses('MuiFormHelperText', ['root
|
|
|
12520
12520
|
var formHelperTextClasses$1 = formHelperTextClasses;
|
|
12521
12521
|
|
|
12522
12522
|
var _span$1;
|
|
12523
|
-
const _excluded$
|
|
12523
|
+
const _excluded$u = ["children", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"];
|
|
12524
12524
|
const useUtilityClasses$g = ownerState => {
|
|
12525
12525
|
const {
|
|
12526
12526
|
classes,
|
|
@@ -12579,7 +12579,7 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
|
|
|
12579
12579
|
className,
|
|
12580
12580
|
component = 'p'
|
|
12581
12581
|
} = props,
|
|
12582
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
12582
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$u);
|
|
12583
12583
|
const muiFormControl = useFormControl();
|
|
12584
12584
|
const fcs = formControlState({
|
|
12585
12585
|
props,
|
|
@@ -12685,7 +12685,7 @@ function getListUtilityClass(slot) {
|
|
|
12685
12685
|
}
|
|
12686
12686
|
generateUtilityClasses('MuiList', ['root', 'padding', 'dense', 'subheader']);
|
|
12687
12687
|
|
|
12688
|
-
const _excluded$
|
|
12688
|
+
const _excluded$t = ["children", "className", "component", "dense", "disablePadding", "subheader"];
|
|
12689
12689
|
const useUtilityClasses$f = ownerState => {
|
|
12690
12690
|
const {
|
|
12691
12691
|
classes,
|
|
@@ -12733,7 +12733,7 @@ const List = /*#__PURE__*/React.forwardRef(function List(inProps, ref) {
|
|
|
12733
12733
|
disablePadding = false,
|
|
12734
12734
|
subheader
|
|
12735
12735
|
} = props,
|
|
12736
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
12736
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$t);
|
|
12737
12737
|
const context = React.useMemo(() => ({
|
|
12738
12738
|
dense
|
|
12739
12739
|
}), [dense]);
|
|
@@ -12800,7 +12800,7 @@ process.env.NODE_ENV !== "production" ? List.propTypes /* remove-proptypes */ =
|
|
|
12800
12800
|
} : void 0;
|
|
12801
12801
|
var List$1 = List;
|
|
12802
12802
|
|
|
12803
|
-
const _excluded$
|
|
12803
|
+
const _excluded$s = ["actions", "autoFocus", "autoFocusItem", "children", "className", "disabledItemsFocusable", "disableListWrap", "onKeyDown", "variant"];
|
|
12804
12804
|
function nextItem(list, item, disableListWrap) {
|
|
12805
12805
|
if (list === item) {
|
|
12806
12806
|
return list.firstChild;
|
|
@@ -12882,7 +12882,7 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
|
|
|
12882
12882
|
onKeyDown,
|
|
12883
12883
|
variant = 'selectedMenu'
|
|
12884
12884
|
} = props,
|
|
12885
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
12885
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$s);
|
|
12886
12886
|
const listRef = React.useRef(null);
|
|
12887
12887
|
const textCriteriaRef = React.useRef({
|
|
12888
12888
|
keys: [],
|
|
@@ -14072,7 +14072,7 @@ function getTransitionProps(props, options) {
|
|
|
14072
14072
|
};
|
|
14073
14073
|
}
|
|
14074
14074
|
|
|
14075
|
-
const _excluded$
|
|
14075
|
+
const _excluded$r = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
|
|
14076
14076
|
function getScale$1(value) {
|
|
14077
14077
|
return `scale(${value}, ${value ** 2})`;
|
|
14078
14078
|
}
|
|
@@ -14116,7 +14116,7 @@ const Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {
|
|
|
14116
14116
|
// eslint-disable-next-line react/prop-types
|
|
14117
14117
|
TransitionComponent = Transition$1
|
|
14118
14118
|
} = props,
|
|
14119
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14119
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$r);
|
|
14120
14120
|
const timer = React.useRef();
|
|
14121
14121
|
const autoTimeout = React.useRef();
|
|
14122
14122
|
const theme = useTheme();
|
|
@@ -14320,7 +14320,7 @@ process.env.NODE_ENV !== "production" ? Grow.propTypes /* remove-proptypes */ =
|
|
|
14320
14320
|
Grow.muiSupportAuto = true;
|
|
14321
14321
|
var Grow$1 = Grow;
|
|
14322
14322
|
|
|
14323
|
-
const _excluded$
|
|
14323
|
+
const _excluded$q = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
|
|
14324
14324
|
const styles = {
|
|
14325
14325
|
entering: {
|
|
14326
14326
|
opacity: 1
|
|
@@ -14357,7 +14357,7 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
14357
14357
|
// eslint-disable-next-line react/prop-types
|
|
14358
14358
|
TransitionComponent = Transition$1
|
|
14359
14359
|
} = props,
|
|
14360
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14360
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$q);
|
|
14361
14361
|
const nodeRef = React.useRef(null);
|
|
14362
14362
|
const handleRef = useForkRef(nodeRef, children.ref, ref);
|
|
14363
14363
|
const normalizedTransitionCallback = callback => maybeIsAppearing => {
|
|
@@ -14518,7 +14518,7 @@ function getBackdropUtilityClass(slot) {
|
|
|
14518
14518
|
}
|
|
14519
14519
|
generateUtilityClasses('MuiBackdrop', ['root', 'invisible']);
|
|
14520
14520
|
|
|
14521
|
-
const _excluded$
|
|
14521
|
+
const _excluded$p = ["children", "className", "component", "components", "componentsProps", "invisible", "open", "slotProps", "slots", "TransitionComponent", "transitionDuration"];
|
|
14522
14522
|
const useUtilityClasses$e = ownerState => {
|
|
14523
14523
|
const {
|
|
14524
14524
|
classes,
|
|
@@ -14573,7 +14573,7 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
|
|
|
14573
14573
|
TransitionComponent = Fade$1,
|
|
14574
14574
|
transitionDuration
|
|
14575
14575
|
} = props,
|
|
14576
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14576
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$p);
|
|
14577
14577
|
const ownerState = _extends$1({}, props, {
|
|
14578
14578
|
component,
|
|
14579
14579
|
invisible
|
|
@@ -14694,7 +14694,7 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes /* remove-proptypes *
|
|
|
14694
14694
|
} : void 0;
|
|
14695
14695
|
var Backdrop$1 = Backdrop;
|
|
14696
14696
|
|
|
14697
|
-
const _excluded$
|
|
14697
|
+
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
14698
|
const ModalRoot = styled$1('div', {
|
|
14699
14699
|
name: 'MuiModal',
|
|
14700
14700
|
slot: 'Root',
|
|
@@ -14773,7 +14773,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
14773
14773
|
// eslint-disable-next-line react/prop-types
|
|
14774
14774
|
theme
|
|
14775
14775
|
} = props,
|
|
14776
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14776
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$o);
|
|
14777
14777
|
const [exited, setExited] = React.useState(true);
|
|
14778
14778
|
const commonProps = {
|
|
14779
14779
|
container,
|
|
@@ -14997,7 +14997,7 @@ function getPaperUtilityClass(slot) {
|
|
|
14997
14997
|
}
|
|
14998
14998
|
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
14999
|
|
|
15000
|
-
const _excluded$
|
|
15000
|
+
const _excluded$n = ["className", "component", "elevation", "square", "variant"];
|
|
15001
15001
|
const useUtilityClasses$d = ownerState => {
|
|
15002
15002
|
const {
|
|
15003
15003
|
square,
|
|
@@ -15052,7 +15052,7 @@ const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
|
|
|
15052
15052
|
square = false,
|
|
15053
15053
|
variant = 'elevation'
|
|
15054
15054
|
} = props,
|
|
15055
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
15055
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$n);
|
|
15056
15056
|
const ownerState = _extends$1({}, props, {
|
|
15057
15057
|
component,
|
|
15058
15058
|
elevation,
|
|
@@ -15133,7 +15133,7 @@ function getPopoverUtilityClass(slot) {
|
|
|
15133
15133
|
}
|
|
15134
15134
|
generateUtilityClasses('MuiPopover', ['root', 'paper']);
|
|
15135
15135
|
|
|
15136
|
-
const _excluded$
|
|
15136
|
+
const _excluded$m = ["onEntering"],
|
|
15137
15137
|
_excluded2$2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
|
|
15138
15138
|
_excluded3 = ["slotProps"];
|
|
15139
15139
|
function getOffsetTop(rect, vertical) {
|
|
@@ -15230,7 +15230,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
15230
15230
|
onEntering
|
|
15231
15231
|
} = {}
|
|
15232
15232
|
} = props,
|
|
15233
|
-
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$
|
|
15233
|
+
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$m),
|
|
15234
15234
|
other = _objectWithoutPropertiesLoose(props, _excluded2$2);
|
|
15235
15235
|
const externalPaperSlotProps = (_slotProps$paper = slotProps == null ? void 0 : slotProps.paper) != null ? _slotProps$paper : PaperPropsProp;
|
|
15236
15236
|
const paperRef = React.useRef();
|
|
@@ -15636,7 +15636,7 @@ function getMenuUtilityClass(slot) {
|
|
|
15636
15636
|
}
|
|
15637
15637
|
generateUtilityClasses('MuiMenu', ['root', 'paper', 'list']);
|
|
15638
15638
|
|
|
15639
|
-
const _excluded$
|
|
15639
|
+
const _excluded$l = ["onEntering"],
|
|
15640
15640
|
_excluded2$1 = ["autoFocus", "children", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant"];
|
|
15641
15641
|
const RTL_ORIGIN = {
|
|
15642
15642
|
vertical: 'top',
|
|
@@ -15703,7 +15703,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
15703
15703
|
} = {},
|
|
15704
15704
|
variant = 'selectedMenu'
|
|
15705
15705
|
} = props,
|
|
15706
|
-
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$
|
|
15706
|
+
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$l),
|
|
15707
15707
|
other = _objectWithoutPropertiesLoose(props, _excluded2$1);
|
|
15708
15708
|
const theme = useTheme();
|
|
15709
15709
|
const isRtl = theme.direction === 'rtl';
|
|
@@ -15893,7 +15893,7 @@ function getNativeSelectUtilityClasses(slot) {
|
|
|
15893
15893
|
const nativeSelectClasses = generateUtilityClasses('MuiNativeSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
|
|
15894
15894
|
var nativeSelectClasses$1 = nativeSelectClasses;
|
|
15895
15895
|
|
|
15896
|
-
const _excluded$
|
|
15896
|
+
const _excluded$k = ["className", "disabled", "error", "IconComponent", "inputRef", "variant"];
|
|
15897
15897
|
const useUtilityClasses$a = ownerState => {
|
|
15898
15898
|
const {
|
|
15899
15899
|
classes,
|
|
@@ -16022,7 +16022,7 @@ const NativeSelectInput = /*#__PURE__*/React.forwardRef(function NativeSelectInp
|
|
|
16022
16022
|
inputRef,
|
|
16023
16023
|
variant = 'standard'
|
|
16024
16024
|
} = props,
|
|
16025
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
16025
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$k);
|
|
16026
16026
|
const ownerState = _extends$1({}, props, {
|
|
16027
16027
|
disabled,
|
|
16028
16028
|
variant,
|
|
@@ -16107,7 +16107,7 @@ const selectClasses = generateUtilityClasses('MuiSelect', ['select', 'multiple',
|
|
|
16107
16107
|
var selectClasses$1 = selectClasses;
|
|
16108
16108
|
|
|
16109
16109
|
var _span;
|
|
16110
|
-
const _excluded$
|
|
16110
|
+
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
16111
|
const SelectSelect = styled$1('div', {
|
|
16112
16112
|
name: 'MuiSelect',
|
|
16113
16113
|
slot: 'Select',
|
|
@@ -16229,7 +16229,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
16229
16229
|
value: valueProp,
|
|
16230
16230
|
variant = 'standard'
|
|
16231
16231
|
} = props,
|
|
16232
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
16232
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$j);
|
|
16233
16233
|
const [value, setValueState] = useControlled({
|
|
16234
16234
|
controlled: valueProp,
|
|
16235
16235
|
default: defaultValue,
|
|
@@ -16740,7 +16740,7 @@ function getSvgIconUtilityClass(slot) {
|
|
|
16740
16740
|
}
|
|
16741
16741
|
generateUtilityClasses('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);
|
|
16742
16742
|
|
|
16743
|
-
const _excluded$
|
|
16743
|
+
const _excluded$i = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
|
|
16744
16744
|
const useUtilityClasses$8 = ownerState => {
|
|
16745
16745
|
const {
|
|
16746
16746
|
color,
|
|
@@ -16806,7 +16806,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
16806
16806
|
titleAccess,
|
|
16807
16807
|
viewBox = '0 0 24 24'
|
|
16808
16808
|
} = props,
|
|
16809
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
16809
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$i);
|
|
16810
16810
|
const ownerState = _extends$1({}, props, {
|
|
16811
16811
|
color,
|
|
16812
16812
|
component,
|
|
@@ -16932,7 +16932,7 @@ var ArrowDropDownIcon = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path"
|
|
|
16932
16932
|
d: "M7 10l5 5 5-5z"
|
|
16933
16933
|
}), 'ArrowDropDown');
|
|
16934
16934
|
|
|
16935
|
-
const _excluded$
|
|
16935
|
+
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
16936
|
const useUtilityClasses$7 = ownerState => {
|
|
16937
16937
|
const {
|
|
16938
16938
|
classes
|
|
@@ -16976,7 +16976,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
16976
16976
|
SelectDisplayProps,
|
|
16977
16977
|
variant: variantProp = 'outlined'
|
|
16978
16978
|
} = props,
|
|
16979
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
16979
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$h);
|
|
16980
16980
|
const inputComponent = native ? NativeSelectInput$1 : SelectInput$1;
|
|
16981
16981
|
const muiFormControl = useFormControl();
|
|
16982
16982
|
const fcs = formControlState({
|
|
@@ -17199,7 +17199,7 @@ function getTextFieldUtilityClass(slot) {
|
|
|
17199
17199
|
}
|
|
17200
17200
|
generateUtilityClasses('MuiTextField', ['root']);
|
|
17201
17201
|
|
|
17202
|
-
const _excluded$
|
|
17202
|
+
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
17203
|
const variantComponent = {
|
|
17204
17204
|
standard: Input$1,
|
|
17205
17205
|
filled: FilledInput$1,
|
|
@@ -17292,7 +17292,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
17292
17292
|
value,
|
|
17293
17293
|
variant = 'outlined'
|
|
17294
17294
|
} = props,
|
|
17295
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
17295
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$g);
|
|
17296
17296
|
const ownerState = _extends$1({}, props, {
|
|
17297
17297
|
autoFocus,
|
|
17298
17298
|
color,
|
|
@@ -17662,6 +17662,48 @@ const IS_BETWEEN = isBetweenOperator;
|
|
|
17662
17662
|
|
|
17663
17663
|
const getGridNumericOperators = () => [...getGridNumericOperators$1(), IS_BETWEEN];
|
|
17664
17664
|
|
|
17665
|
+
const doesNotEqual = {
|
|
17666
|
+
label: 'does not equal',
|
|
17667
|
+
value: 'doesNotEqual',
|
|
17668
|
+
getApplyFilterFn: filterItem => {
|
|
17669
|
+
if (!filterItem.field || !filterItem.value || !filterItem.value) {
|
|
17670
|
+
return null;
|
|
17671
|
+
}
|
|
17672
|
+
return params => {
|
|
17673
|
+
if (filterItem.value.length === 0) {
|
|
17674
|
+
return true;
|
|
17675
|
+
}
|
|
17676
|
+
if (params.value === filterItem.value) {
|
|
17677
|
+
return false;
|
|
17678
|
+
}
|
|
17679
|
+
return true;
|
|
17680
|
+
};
|
|
17681
|
+
},
|
|
17682
|
+
InputComponent: GridFilterInputValue
|
|
17683
|
+
};
|
|
17684
|
+
const DOES_NOT_EQUAL = doesNotEqual;
|
|
17685
|
+
|
|
17686
|
+
const doesNotContain = {
|
|
17687
|
+
label: 'does not contain',
|
|
17688
|
+
value: 'doesNotContain',
|
|
17689
|
+
getApplyFilterFn: filterItem => {
|
|
17690
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17691
|
+
return null;
|
|
17692
|
+
}
|
|
17693
|
+
return params => {
|
|
17694
|
+
if (filterItem.value.length === 0) {
|
|
17695
|
+
return true;
|
|
17696
|
+
}
|
|
17697
|
+
if (params.value.indexOf(filterItem.value) !== -1) {
|
|
17698
|
+
return false;
|
|
17699
|
+
}
|
|
17700
|
+
return true;
|
|
17701
|
+
};
|
|
17702
|
+
},
|
|
17703
|
+
InputComponent: GridFilterInputValue
|
|
17704
|
+
};
|
|
17705
|
+
const DOES_NOT_CONTAIN = doesNotContain;
|
|
17706
|
+
|
|
17665
17707
|
const containsAnyOfOperator = {
|
|
17666
17708
|
label: 'contains any of',
|
|
17667
17709
|
value: 'containsAnyOf',
|
|
@@ -17816,7 +17858,40 @@ const STARTS_WITH_ANY_OF = startsWithAnyOfOperator;
|
|
|
17816
17858
|
|
|
17817
17859
|
const getGridStringArrayOperators = () => [CONTAINS_ANY_OF, ENDS_WITH_ANY_OF, IS_ANY_OF, IS_NOT_ANY_OF, STARTS_WITH_ANY_OF];
|
|
17818
17860
|
|
|
17819
|
-
const getGridStringOperators = () => [...getGridStringOperators$1(), ...getGridStringArrayOperators()];
|
|
17861
|
+
const getGridStringOperators = () => [...getGridStringOperators$1().filter(operator => !['isAnyOf'].includes(operator.value)), DOES_NOT_CONTAIN, DOES_NOT_EQUAL, ...getGridStringArrayOperators()];
|
|
17862
|
+
|
|
17863
|
+
// istanbul ignore file
|
|
17864
|
+
const operatorList = {
|
|
17865
|
+
// Default types
|
|
17866
|
+
string: getGridStringOperators$1(),
|
|
17867
|
+
number: getGridNumericOperators$1(),
|
|
17868
|
+
boolean: getGridBooleanOperators(),
|
|
17869
|
+
date: getGridDateOperators(),
|
|
17870
|
+
dateTime: getGridDateOperators(true),
|
|
17871
|
+
singleSelect: getGridSingleSelectOperators(),
|
|
17872
|
+
// Extended types
|
|
17873
|
+
rsString: getGridStringOperators(),
|
|
17874
|
+
rsNumber: getGridNumericOperators(),
|
|
17875
|
+
// Custom types
|
|
17876
|
+
rsStringArray: getGridStringArrayOperators()
|
|
17877
|
+
};
|
|
17878
|
+
|
|
17879
|
+
const getRsStringColumnType = () => {
|
|
17880
|
+
return {
|
|
17881
|
+
type: 'string',
|
|
17882
|
+
filterOperators: operatorList.rsString
|
|
17883
|
+
};
|
|
17884
|
+
};
|
|
17885
|
+
const getRsNumberColumnType = () => {
|
|
17886
|
+
return {
|
|
17887
|
+
type: 'number',
|
|
17888
|
+
filterOperators: operatorList.rsNumber
|
|
17889
|
+
};
|
|
17890
|
+
};
|
|
17891
|
+
const customColumnTypes = {
|
|
17892
|
+
rsString: getRsStringColumnType(),
|
|
17893
|
+
rsNumber: getRsNumberColumnType()
|
|
17894
|
+
};
|
|
17820
17895
|
|
|
17821
17896
|
const API_URL = 'https://api.openai.com/v1/chat/completions';
|
|
17822
17897
|
async function getCompletion(text, role, openai_api_key) {
|
|
@@ -17849,6 +17924,699 @@ async function getCompletion(text, role, openai_api_key) {
|
|
|
17849
17924
|
}
|
|
17850
17925
|
}
|
|
17851
17926
|
|
|
17927
|
+
const PAGINATION_MODEL_KEY = 'paginationModel';
|
|
17928
|
+
const FILTER_MODEL_KEY = 'filterModel';
|
|
17929
|
+
const SORT_MODEL_KEY = 'sortModel';
|
|
17930
|
+
const VISIBILITY_MODEL_KEY = 'visibilityModel';
|
|
17931
|
+
const PINNED_COLUMNS = 'pinnedColumns';
|
|
17932
|
+
const DIMENSION_MODEL_KEY = 'dimension';
|
|
17933
|
+
const FILTER_SEARCH_KEY = 'searchModel';
|
|
17934
|
+
const CATEGORIES = [PAGINATION_MODEL_KEY, FILTER_MODEL_KEY, SORT_MODEL_KEY, VISIBILITY_MODEL_KEY, DIMENSION_MODEL_KEY, FILTER_SEARCH_KEY, PINNED_COLUMNS];
|
|
17935
|
+
const buildStorageKey = _ref => {
|
|
17936
|
+
let {
|
|
17937
|
+
id,
|
|
17938
|
+
version,
|
|
17939
|
+
category
|
|
17940
|
+
} = _ref;
|
|
17941
|
+
return `${id}:${version}:${category}`;
|
|
17942
|
+
};
|
|
17943
|
+
const clearPreviousVersionStorage = (id, currentVersion) => {
|
|
17944
|
+
const previousVersion = currentVersion - 1;
|
|
17945
|
+
if (previousVersion < 1) {
|
|
17946
|
+
return;
|
|
17947
|
+
}
|
|
17948
|
+
const keysToDelete = [buildStorageKey({
|
|
17949
|
+
id,
|
|
17950
|
+
version: previousVersion,
|
|
17951
|
+
category: PAGINATION_MODEL_KEY
|
|
17952
|
+
}), buildStorageKey({
|
|
17953
|
+
id,
|
|
17954
|
+
version: previousVersion,
|
|
17955
|
+
category: SORT_MODEL_KEY
|
|
17956
|
+
}), buildStorageKey({
|
|
17957
|
+
id,
|
|
17958
|
+
version: previousVersion,
|
|
17959
|
+
category: FILTER_MODEL_KEY
|
|
17960
|
+
}), buildStorageKey({
|
|
17961
|
+
id,
|
|
17962
|
+
version: previousVersion,
|
|
17963
|
+
category: VISIBILITY_MODEL_KEY
|
|
17964
|
+
}), buildStorageKey({
|
|
17965
|
+
id,
|
|
17966
|
+
version: previousVersion,
|
|
17967
|
+
category: PINNED_COLUMNS
|
|
17968
|
+
}), buildStorageKey({
|
|
17969
|
+
id,
|
|
17970
|
+
version: previousVersion,
|
|
17971
|
+
category: FILTER_SEARCH_KEY
|
|
17972
|
+
}), buildStorageKey({
|
|
17973
|
+
id,
|
|
17974
|
+
version: previousVersion,
|
|
17975
|
+
category: DIMENSION_MODEL_KEY
|
|
17976
|
+
})];
|
|
17977
|
+
for (const keyToDelete of keysToDelete) {
|
|
17978
|
+
try {
|
|
17979
|
+
window.localStorage.removeItem(keyToDelete);
|
|
17980
|
+
} catch (e) {
|
|
17981
|
+
// Ignore
|
|
17982
|
+
}
|
|
17983
|
+
}
|
|
17984
|
+
};
|
|
17985
|
+
|
|
17986
|
+
// reference value: https://www.w3schools.com/tags/ref_urlencode.ASP
|
|
17987
|
+
const DECODER = {
|
|
17988
|
+
'%20': ' ',
|
|
17989
|
+
'%26': '&',
|
|
17990
|
+
'%3D': '=',
|
|
17991
|
+
'%3F': '?',
|
|
17992
|
+
'%5B': '[',
|
|
17993
|
+
'%5D': ']',
|
|
17994
|
+
'%2C': ',',
|
|
17995
|
+
'%3C': '<',
|
|
17996
|
+
'%3E': '>',
|
|
17997
|
+
'%21': '!',
|
|
17998
|
+
'%22': '"'
|
|
17999
|
+
};
|
|
18000
|
+
const ENCODER = {
|
|
18001
|
+
' ': '%20',
|
|
18002
|
+
'&': '%26',
|
|
18003
|
+
'=': '%3D',
|
|
18004
|
+
'?': '%3F',
|
|
18005
|
+
'[': '%5B',
|
|
18006
|
+
']': '%5D',
|
|
18007
|
+
',': '%2C',
|
|
18008
|
+
'<': '%3C',
|
|
18009
|
+
'>': '%3E',
|
|
18010
|
+
'!': '%21',
|
|
18011
|
+
'"': '%22'
|
|
18012
|
+
};
|
|
18013
|
+
const decodeValue = value => {
|
|
18014
|
+
if (value === '') {
|
|
18015
|
+
return '';
|
|
18016
|
+
}
|
|
18017
|
+
const re = new RegExp(Object.keys(DECODER).reduce((acc, curr) => `${acc}|${curr}`), 'g');
|
|
18018
|
+
// decodeValue for lists:
|
|
18019
|
+
if (value.startsWith('list[')) {
|
|
18020
|
+
const arrayValues = value.split('[')[1].split(']')[0];
|
|
18021
|
+
const arrayList = arrayValues.split(',').map(v => v.replace(re, encoded => DECODER[encoded])).filter(item => item);
|
|
18022
|
+
return arrayList.length > 0 ? arrayList : [];
|
|
18023
|
+
}
|
|
18024
|
+
return value.replace(re, encoded => DECODER[encoded]);
|
|
18025
|
+
};
|
|
18026
|
+
const encodeValue = value => {
|
|
18027
|
+
if (!value) {
|
|
18028
|
+
return '';
|
|
18029
|
+
}
|
|
18030
|
+
|
|
18031
|
+
// Array encoding for value:
|
|
18032
|
+
// we are representing it as list[encoded], where encoded is the list comma separated
|
|
18033
|
+
if (Array.isArray(value)) {
|
|
18034
|
+
const encodedArray = value.map(entry => {
|
|
18035
|
+
return String(entry).replace(/\s|&|=|\?|\[|\]/g, encoded => ENCODER[encoded]);
|
|
18036
|
+
}).join(',');
|
|
18037
|
+
return `list[${encodedArray}]`;
|
|
18038
|
+
}
|
|
18039
|
+
|
|
18040
|
+
// we might also pass integers
|
|
18041
|
+
const castedValue = String(value);
|
|
18042
|
+
return castedValue.replace(/\s|&|=|\?|\[|\]/g, encoded => ENCODER[encoded]);
|
|
18043
|
+
};
|
|
18044
|
+
const urlSearchParamsToString = searchParams => {
|
|
18045
|
+
let searchString = '';
|
|
18046
|
+
for (const [key, value] of searchParams) {
|
|
18047
|
+
searchString = searchString + `${key}=${value}&`;
|
|
18048
|
+
}
|
|
18049
|
+
return searchString.slice(0, searchString.length - 1);
|
|
18050
|
+
};
|
|
18051
|
+
const numberOperatorEncoder = {
|
|
18052
|
+
'=': 'eq',
|
|
18053
|
+
'!=': 'ne',
|
|
18054
|
+
'>': 'gt',
|
|
18055
|
+
'>=': 'gte',
|
|
18056
|
+
'<': 'lt',
|
|
18057
|
+
'<=': 'lte'
|
|
18058
|
+
};
|
|
18059
|
+
const numberOperatorDecoder = {
|
|
18060
|
+
eq: '=',
|
|
18061
|
+
ne: '!=',
|
|
18062
|
+
gt: '>',
|
|
18063
|
+
gte: '>=',
|
|
18064
|
+
lt: '<',
|
|
18065
|
+
lte: '<='
|
|
18066
|
+
};
|
|
18067
|
+
const isOperatorValueValid = (field, operator, columns) => {
|
|
18068
|
+
const column = columns.find(column => column.field === field);
|
|
18069
|
+
if (!column) {
|
|
18070
|
+
return false;
|
|
18071
|
+
}
|
|
18072
|
+
const columnType = (column === null || column === void 0 ? void 0 : column.type) || 'string';
|
|
18073
|
+
const operators = column.filterOperators || operatorList[columnType];
|
|
18074
|
+
if (!operators) {
|
|
18075
|
+
return false;
|
|
18076
|
+
}
|
|
18077
|
+
return !!operators.find(op => columnType === 'number' && Object.keys(numberOperatorEncoder).includes(op.value) ? numberOperatorEncoder[op.value] === operator : op.value === operator);
|
|
18078
|
+
};
|
|
18079
|
+
const listOperators = ['containsAnyOf', 'endsWithAnyOf', 'isAnyOf', 'isNotAnyOf', 'startsWithAnyOf'];
|
|
18080
|
+
|
|
18081
|
+
// Check if the value doesn't break
|
|
18082
|
+
const isValueValid = (value, field, columns, operator) => {
|
|
18083
|
+
var _column$type;
|
|
18084
|
+
// every field accepts undefined as value for default
|
|
18085
|
+
if (value === undefined) {
|
|
18086
|
+
return true;
|
|
18087
|
+
}
|
|
18088
|
+
|
|
18089
|
+
// xxxAnyOf accepts as value only lists, and we are declaring them in the
|
|
18090
|
+
// URL as `list=[...]`
|
|
18091
|
+
if (listOperators.includes(operator)) {
|
|
18092
|
+
return Array.isArray(value) || value === '';
|
|
18093
|
+
}
|
|
18094
|
+
|
|
18095
|
+
// We are accepting arrays only if they are of the 'xxxAnyOf' type
|
|
18096
|
+
if (Array.isArray(value) && !listOperators.includes(operator)) {
|
|
18097
|
+
return false;
|
|
18098
|
+
}
|
|
18099
|
+
const column = columns.find(column => column.field === field);
|
|
18100
|
+
if (!column) {
|
|
18101
|
+
return false;
|
|
18102
|
+
}
|
|
18103
|
+
const type = (_column$type = column['type']) !== null && _column$type !== void 0 ? _column$type : 'string';
|
|
18104
|
+
|
|
18105
|
+
// Only date and rating fail with 500s, other set themselves as undefined
|
|
18106
|
+
if (type !== 'date' && type !== 'rating') {
|
|
18107
|
+
return true;
|
|
18108
|
+
}
|
|
18109
|
+
|
|
18110
|
+
// just checking that rating is a number.
|
|
18111
|
+
if (type === 'rating') {
|
|
18112
|
+
return !isNaN(Number(value));
|
|
18113
|
+
}
|
|
18114
|
+
|
|
18115
|
+
// format: YYYY-MM-DD
|
|
18116
|
+
// just verifying that the 3 values are numbers to avoid 500s,
|
|
18117
|
+
// If the value is invalid the form will appear as undefined
|
|
18118
|
+
if (type === 'date') {
|
|
18119
|
+
const dateSplitted = value.split('-');
|
|
18120
|
+
if (dateSplitted.length !== 3) {
|
|
18121
|
+
return false;
|
|
18122
|
+
}
|
|
18123
|
+
const [YYYY, MM, DD] = dateSplitted;
|
|
18124
|
+
return !isNaN(parseInt(YYYY)) && !isNaN(parseInt(MM)) && !isNaN(parseInt(DD));
|
|
18125
|
+
}
|
|
18126
|
+
return false;
|
|
18127
|
+
};
|
|
18128
|
+
|
|
18129
|
+
// example:
|
|
18130
|
+
// unicodeDomain[contains]=a&unicodeDomain[contains]=dsa&logicOperator=and&tab=ignored
|
|
18131
|
+
const getFilterModelFromString = (searchString, columns) => {
|
|
18132
|
+
if (!searchString) {
|
|
18133
|
+
return {
|
|
18134
|
+
items: [],
|
|
18135
|
+
logicOperator: GridLogicOperator.And
|
|
18136
|
+
};
|
|
18137
|
+
}
|
|
18138
|
+
let logicOperator = GridLogicOperator.And;
|
|
18139
|
+
const searchParams = new URLSearchParams();
|
|
18140
|
+
for (const [key, value] of new URLSearchParams(searchString)) {
|
|
18141
|
+
if (key.startsWith('_') && !['_logicOperator', '_sortColumn', '_pinnedColumnsLeft', '_pinnedColumnsRight', '_columnVisibility'].includes(key)) {
|
|
18142
|
+
searchParams.set(key, value);
|
|
18143
|
+
}
|
|
18144
|
+
if (key === '_logicOperator') {
|
|
18145
|
+
logicOperator = value;
|
|
18146
|
+
}
|
|
18147
|
+
}
|
|
18148
|
+
let id = 5000;
|
|
18149
|
+
const fields = columns.map(column => column.field);
|
|
18150
|
+
let isInvalid = false;
|
|
18151
|
+
const items = [];
|
|
18152
|
+
searchParams.forEach((value, key) => {
|
|
18153
|
+
var _columns$find;
|
|
18154
|
+
if (isInvalid) {
|
|
18155
|
+
return;
|
|
18156
|
+
}
|
|
18157
|
+
const field = key.split('[')[0].slice(1); // Slice to remove the _ at the beginning
|
|
18158
|
+
if (!fields.includes(field)) {
|
|
18159
|
+
return;
|
|
18160
|
+
}
|
|
18161
|
+
const columnType = (_columns$find = columns.find(column => column.field === field)) === null || _columns$find === void 0 ? void 0 : _columns$find.type;
|
|
18162
|
+
const left = key.split(']')[0];
|
|
18163
|
+
if (left.split('[').length < 2) {
|
|
18164
|
+
isInvalid = true;
|
|
18165
|
+
return;
|
|
18166
|
+
}
|
|
18167
|
+
const operator = decodeValue(key.split('[')[1].split(']')[0]);
|
|
18168
|
+
// if the operator is not part of the valid operators invalidate the URL
|
|
18169
|
+
if (!isOperatorValueValid(field, operator, columns) || Array.isArray(operator)) {
|
|
18170
|
+
isInvalid = true;
|
|
18171
|
+
return;
|
|
18172
|
+
}
|
|
18173
|
+
id += 1;
|
|
18174
|
+
const decodedValue = decodeValue(value);
|
|
18175
|
+
if (!isValueValid(decodedValue, field, columns, operator)) {
|
|
18176
|
+
isInvalid = true;
|
|
18177
|
+
return;
|
|
18178
|
+
}
|
|
18179
|
+
items.push({
|
|
18180
|
+
field,
|
|
18181
|
+
operator: columnType === 'number' && Object.keys(numberOperatorDecoder).includes(operator) ? numberOperatorDecoder[operator] : operator,
|
|
18182
|
+
id,
|
|
18183
|
+
value: listOperators.includes(operator) && decodedValue === '' ? [] : decodedValue
|
|
18184
|
+
});
|
|
18185
|
+
});
|
|
18186
|
+
|
|
18187
|
+
// If we found some condition that results in an invalid URL,
|
|
18188
|
+
// return the empty filterModel (this will trigger the localStorage)
|
|
18189
|
+
// and will pick up the last valid search
|
|
18190
|
+
if (isInvalid) {
|
|
18191
|
+
return {
|
|
18192
|
+
items: [],
|
|
18193
|
+
logicOperator: GridLogicOperator.And
|
|
18194
|
+
};
|
|
18195
|
+
}
|
|
18196
|
+
return {
|
|
18197
|
+
items,
|
|
18198
|
+
logicOperator
|
|
18199
|
+
};
|
|
18200
|
+
};
|
|
18201
|
+
const getSearchParamsFromFilterModel = filterModel => {
|
|
18202
|
+
const searchParams = new URLSearchParams();
|
|
18203
|
+
searchParams.set('_logicOperator', filterModel['logicOperator'] || '');
|
|
18204
|
+
filterModel['items'].forEach(item => {
|
|
18205
|
+
const {
|
|
18206
|
+
field,
|
|
18207
|
+
operator,
|
|
18208
|
+
value
|
|
18209
|
+
} = item;
|
|
18210
|
+
if (Object.keys(numberOperatorEncoder).includes(operator)) {
|
|
18211
|
+
searchParams.set(`_${field}[${numberOperatorEncoder[operator]}]`, encodeValue(value));
|
|
18212
|
+
} else {
|
|
18213
|
+
searchParams.set(`_${field}[${encodeValue(operator)}]`, encodeValue(value));
|
|
18214
|
+
}
|
|
18215
|
+
});
|
|
18216
|
+
return searchParams;
|
|
18217
|
+
};
|
|
18218
|
+
|
|
18219
|
+
// Rules:
|
|
18220
|
+
// - if we have something in the URL, use that info
|
|
18221
|
+
// - if we don't have that, use the localStorage and update the URL
|
|
18222
|
+
// - if we don't have that, return an empty FilterModel
|
|
18223
|
+
const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFilters) => {
|
|
18224
|
+
const filterModelFromSearch = getFilterModelFromString(search, columns);
|
|
18225
|
+
if (filterModelFromSearch.items.length > 0) {
|
|
18226
|
+
const searchFromFilterModel = getSearchParamsFromFilterModel(filterModelFromSearch);
|
|
18227
|
+
const searchString = urlSearchParamsToString(searchFromFilterModel);
|
|
18228
|
+
if (searchString !== localStorageFilters) {
|
|
18229
|
+
setLocalStorageFilters(searchString);
|
|
18230
|
+
}
|
|
18231
|
+
return filterModelFromSearch;
|
|
18232
|
+
}
|
|
18233
|
+
const filterModelFromLocalStorage = getFilterModelFromString(localStorageFilters, columns);
|
|
18234
|
+
if (filterModelFromLocalStorage) {
|
|
18235
|
+
return filterModelFromLocalStorage;
|
|
18236
|
+
}
|
|
18237
|
+
return {
|
|
18238
|
+
items: [],
|
|
18239
|
+
logicOperator: GridLogicOperator.And
|
|
18240
|
+
};
|
|
18241
|
+
};
|
|
18242
|
+
const getSortingFromString = (notParsed, columns) => {
|
|
18243
|
+
// If the string is empty return the default model
|
|
18244
|
+
if (!notParsed) {
|
|
18245
|
+
return null;
|
|
18246
|
+
}
|
|
18247
|
+
// remove the initial ? if present
|
|
18248
|
+
const parsed = notParsed[0] === '?' ? notParsed.slice(1) : notParsed;
|
|
18249
|
+
for (const item of parsed.split('&')) {
|
|
18250
|
+
const fieldURL = item.split('=')[0];
|
|
18251
|
+
if (fieldURL !== '_sortColumn') {
|
|
18252
|
+
continue;
|
|
18253
|
+
}
|
|
18254
|
+
const left = item.split(']')[0];
|
|
18255
|
+
if (left.split('[').length < 2) {
|
|
18256
|
+
continue;
|
|
18257
|
+
}
|
|
18258
|
+
const value = item.split('[')[1].split(']')[0];
|
|
18259
|
+
if (value === '') {
|
|
18260
|
+
return [];
|
|
18261
|
+
}
|
|
18262
|
+
const fields = columns.map(column => column.field);
|
|
18263
|
+
const [column, order] = value.split(',');
|
|
18264
|
+
if (fields.includes(column) && (order === 'asc' || order === 'desc')) {
|
|
18265
|
+
return [{
|
|
18266
|
+
field: column,
|
|
18267
|
+
sort: order
|
|
18268
|
+
}];
|
|
18269
|
+
}
|
|
18270
|
+
continue;
|
|
18271
|
+
}
|
|
18272
|
+
|
|
18273
|
+
// No information was found about the sorting model in the URL
|
|
18274
|
+
return null;
|
|
18275
|
+
};
|
|
18276
|
+
const getSearchParamsFromSorting = sorting => {
|
|
18277
|
+
const searchParams = new URLSearchParams();
|
|
18278
|
+
searchParams.set('_sortColumn', sorting.length > 0 && sorting[0].sort ? `[${encodeValue(sorting[0].field)},${encodeValue(sorting[0].sort)}]` : '[]');
|
|
18279
|
+
return searchParams;
|
|
18280
|
+
};
|
|
18281
|
+
|
|
18282
|
+
// Rules:
|
|
18283
|
+
// - if we have something in the URL, use that info
|
|
18284
|
+
// - if we don't have that, use the localStorage and update the URL
|
|
18285
|
+
// - if we don't have that, return an empty SortModel
|
|
18286
|
+
const getSortModel = (search, columns, localStorageSorting, setLocalStorageSorting) => {
|
|
18287
|
+
const sorting = getSortingFromString(search, columns);
|
|
18288
|
+
if (sorting) {
|
|
18289
|
+
const searchFromSortModel = getSearchParamsFromSorting(sorting);
|
|
18290
|
+
if (searchFromSortModel.toString() !== localStorageSorting) {
|
|
18291
|
+
setLocalStorageSorting(searchFromSortModel.toString());
|
|
18292
|
+
}
|
|
18293
|
+
return sorting;
|
|
18294
|
+
}
|
|
18295
|
+
const sortModelFromLocalStorage = getSortingFromString(localStorageSorting, columns);
|
|
18296
|
+
if (sortModelFromLocalStorage) {
|
|
18297
|
+
return sortModelFromLocalStorage;
|
|
18298
|
+
}
|
|
18299
|
+
return [];
|
|
18300
|
+
};
|
|
18301
|
+
const getSearchParamsFromColumnVisibility = (columnVisibility, columns) => {
|
|
18302
|
+
const searchParams = new URLSearchParams();
|
|
18303
|
+
const fields = columns.map(column => column.field);
|
|
18304
|
+
|
|
18305
|
+
// if column visibility model is empty, show all columns
|
|
18306
|
+
if (Object.keys(columnVisibility).length == 0) {
|
|
18307
|
+
searchParams.set('_columnVisibility', `[${fields.join(',')}]`);
|
|
18308
|
+
return searchParams;
|
|
18309
|
+
}
|
|
18310
|
+
const finalColumnVisibility = columns.filter(c => {
|
|
18311
|
+
var _c$hideable;
|
|
18312
|
+
return !((_c$hideable = c === null || c === void 0 ? void 0 : c.hideable) !== null && _c$hideable !== void 0 ? _c$hideable : true);
|
|
18313
|
+
}).map(c => c.field).reduce((acc, colName) => {
|
|
18314
|
+
return _objectSpread2(_objectSpread2({}, acc), {}, {
|
|
18315
|
+
[colName]: true
|
|
18316
|
+
});
|
|
18317
|
+
}, columnVisibility);
|
|
18318
|
+
const visibleColumns = Object.entries(finalColumnVisibility)
|
|
18319
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18320
|
+
.filter(_ref => {
|
|
18321
|
+
let [_, visible] = _ref;
|
|
18322
|
+
return visible;
|
|
18323
|
+
})
|
|
18324
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18325
|
+
.map(_ref2 => {
|
|
18326
|
+
let [column, _] = _ref2;
|
|
18327
|
+
return encodeValue(column);
|
|
18328
|
+
});
|
|
18329
|
+
searchParams.set('_columnVisibility', `[${visibleColumns.join(',')}]`);
|
|
18330
|
+
return searchParams;
|
|
18331
|
+
};
|
|
18332
|
+
const getColumnVisibilityFromString = (notParsed, tableColumns) => {
|
|
18333
|
+
if (!notParsed || notParsed.length === 1 && notParsed[0] === '?') {
|
|
18334
|
+
return null;
|
|
18335
|
+
}
|
|
18336
|
+
// remove the initial ? if present
|
|
18337
|
+
const parsed = notParsed[0] === '?' ? notParsed.slice(1) : notParsed;
|
|
18338
|
+
const visibility = {};
|
|
18339
|
+
let exist = false;
|
|
18340
|
+
let visibleColumnsCount = 0;
|
|
18341
|
+
for (const item of parsed.split('&')) {
|
|
18342
|
+
// if it's not column visibility field, skip
|
|
18343
|
+
const fieldURL = item.split('=')[0];
|
|
18344
|
+
if (fieldURL !== '_columnVisibility') {
|
|
18345
|
+
continue;
|
|
18346
|
+
}
|
|
18347
|
+
// e.g. item = _columnVisibility[abc,def]
|
|
18348
|
+
const left = item.split(']')[0];
|
|
18349
|
+
if (left.split('[').length < 2) {
|
|
18350
|
+
continue;
|
|
18351
|
+
}
|
|
18352
|
+
const encodedValues = item.split('[')[1].split(']')[0];
|
|
18353
|
+
if (typeof encodedValues !== 'string') {
|
|
18354
|
+
continue;
|
|
18355
|
+
}
|
|
18356
|
+
exist = true;
|
|
18357
|
+
const fields = tableColumns.map(column => column.field);
|
|
18358
|
+
// TODO: Add validation that , is present
|
|
18359
|
+
const columns = encodedValues.split(',').map(value => decodeValue(value));
|
|
18360
|
+
|
|
18361
|
+
// for each column, check if it's visible and add it to visibility model
|
|
18362
|
+
for (const column of fields) {
|
|
18363
|
+
const isColumnVisible = columns.includes(column);
|
|
18364
|
+
visibility[column] = isColumnVisible;
|
|
18365
|
+
if (isColumnVisible) {
|
|
18366
|
+
visibleColumnsCount += 1;
|
|
18367
|
+
}
|
|
18368
|
+
}
|
|
18369
|
+
}
|
|
18370
|
+
if (visibleColumnsCount === 0 && !exist) {
|
|
18371
|
+
return null;
|
|
18372
|
+
}
|
|
18373
|
+
return visibility;
|
|
18374
|
+
};
|
|
18375
|
+
|
|
18376
|
+
// Rules:
|
|
18377
|
+
// - if we have something in the URL, use that info
|
|
18378
|
+
// - if we don't have that, use the localStorage and update the URL
|
|
18379
|
+
// - if we don't have that, return an empty ColumnVisibilityModel (which is all columns)
|
|
18380
|
+
// NOTE: the `defaultHidden` is a custom field and not standard DataGrid
|
|
18381
|
+
// The reason is the following bug: https://github.com/mui/mui-x/issues/8407
|
|
18382
|
+
const getColumnsVisibility = (search, columns, localStorageColumnsVisibility, setLocalStorageColumnsVisibility) => {
|
|
18383
|
+
const columnVisibility = getColumnVisibilityFromString(search, columns);
|
|
18384
|
+
if (columnVisibility) {
|
|
18385
|
+
const searchColumnVisibility = getSearchParamsFromColumnVisibility(columnVisibility, columns);
|
|
18386
|
+
if (searchColumnVisibility.toString() !== localStorageColumnsVisibility) {
|
|
18387
|
+
setLocalStorageColumnsVisibility(searchColumnVisibility.toString());
|
|
18388
|
+
}
|
|
18389
|
+
return columnVisibility;
|
|
18390
|
+
}
|
|
18391
|
+
const columnVisibilityFromLocalStorage = getColumnVisibilityFromString(localStorageColumnsVisibility, columns);
|
|
18392
|
+
if (columnVisibilityFromLocalStorage) {
|
|
18393
|
+
return columnVisibilityFromLocalStorage;
|
|
18394
|
+
}
|
|
18395
|
+
|
|
18396
|
+
// No columns in URL or localStorage, just show them all expect the hidden ones
|
|
18397
|
+
const res = {};
|
|
18398
|
+
for (const column of columns) {
|
|
18399
|
+
const field = column.field;
|
|
18400
|
+
res[field] = column.defaultHidden !== true; // undefined will be true
|
|
18401
|
+
}
|
|
18402
|
+
|
|
18403
|
+
return res;
|
|
18404
|
+
};
|
|
18405
|
+
const getPinnedColumnsFromString = (notParsed, tableColumns) => {
|
|
18406
|
+
if (!notParsed || notParsed.length === 1 && notParsed[0] === '?') {
|
|
18407
|
+
return null;
|
|
18408
|
+
}
|
|
18409
|
+
// remove the initial ? if present
|
|
18410
|
+
const parsed = notParsed[0] === '?' ? notParsed.slice(1) : notParsed;
|
|
18411
|
+
const pinnedColumns = {};
|
|
18412
|
+
for (const item of parsed.split('&')) {
|
|
18413
|
+
const fieldURL = item.split('=')[0];
|
|
18414
|
+
if (fieldURL !== '_pinnedColumnsLeft' && fieldURL !== '_pinnedColumnsRight') {
|
|
18415
|
+
continue;
|
|
18416
|
+
}
|
|
18417
|
+
const left = item.split(']')[0];
|
|
18418
|
+
if (left.split('[').length < 2) {
|
|
18419
|
+
continue;
|
|
18420
|
+
}
|
|
18421
|
+
const encodedValues = item.split('[')[1].split(']')[0];
|
|
18422
|
+
if (typeof encodedValues !== 'string') {
|
|
18423
|
+
continue;
|
|
18424
|
+
}
|
|
18425
|
+
const fields = [...tableColumns.map(column => column.field), '__check__'];
|
|
18426
|
+
const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' && fields.includes(val));
|
|
18427
|
+
if (fieldURL === '_pinnedColumnsLeft') {
|
|
18428
|
+
pinnedColumns['left'] = columns;
|
|
18429
|
+
}
|
|
18430
|
+
if (fieldURL === '_pinnedColumnsRight') {
|
|
18431
|
+
pinnedColumns['right'] = columns;
|
|
18432
|
+
}
|
|
18433
|
+
}
|
|
18434
|
+
if (pinnedColumns.left || pinnedColumns.right) {
|
|
18435
|
+
return {
|
|
18436
|
+
left: pinnedColumns['left'] || [],
|
|
18437
|
+
right: pinnedColumns['right'] || []
|
|
18438
|
+
};
|
|
18439
|
+
}
|
|
18440
|
+
return null;
|
|
18441
|
+
};
|
|
18442
|
+
const getSearchParamsFromPinnedColumns = pinnedColumns => {
|
|
18443
|
+
var _pinnedColumns$left, _pinnedColumns$right;
|
|
18444
|
+
const searchParams = new URLSearchParams();
|
|
18445
|
+
const pinnedColumnLeft = ((_pinnedColumns$left = pinnedColumns.left) === null || _pinnedColumns$left === void 0 ? void 0 : _pinnedColumns$left.map(val => encodeValue(val))) || [];
|
|
18446
|
+
const pinnedColumnRight = ((_pinnedColumns$right = pinnedColumns.right) === null || _pinnedColumns$right === void 0 ? void 0 : _pinnedColumns$right.map(val => encodeValue(val))) || [];
|
|
18447
|
+
searchParams.set('_pinnedColumnsLeft', `[${pinnedColumnLeft.join(',')}]`);
|
|
18448
|
+
searchParams.set('_pinnedColumnsRight', `[${pinnedColumnRight.join(',')}]`);
|
|
18449
|
+
return searchParams;
|
|
18450
|
+
};
|
|
18451
|
+
|
|
18452
|
+
// Rules:
|
|
18453
|
+
// - if we have something in the URL, use that info
|
|
18454
|
+
// - if we don't have that, use the localStorage and update the URL
|
|
18455
|
+
// - if we don't have that, return an empty ColumnVisibilityModel (which is all columns)
|
|
18456
|
+
const getPinnedColumns = (search, columns, localStoragePinnedColumns, setLocalStoragePinnedColumns) => {
|
|
18457
|
+
const pinnedColumns = getPinnedColumnsFromString(search, columns);
|
|
18458
|
+
if (pinnedColumns) {
|
|
18459
|
+
const searchPinnedColumns = getSearchParamsFromPinnedColumns(pinnedColumns);
|
|
18460
|
+
if (searchPinnedColumns.toString() !== localStoragePinnedColumns) {
|
|
18461
|
+
setLocalStoragePinnedColumns(searchPinnedColumns.toString());
|
|
18462
|
+
}
|
|
18463
|
+
return pinnedColumns;
|
|
18464
|
+
}
|
|
18465
|
+
const pinnedColumnsFromLocalStorage = getPinnedColumnsFromString(localStoragePinnedColumns, columns);
|
|
18466
|
+
if (pinnedColumnsFromLocalStorage) {
|
|
18467
|
+
return pinnedColumnsFromLocalStorage;
|
|
18468
|
+
}
|
|
18469
|
+
|
|
18470
|
+
// No pinnedColumn in URL or localStorage, TODO: decide what is the default state
|
|
18471
|
+
const res = {
|
|
18472
|
+
left: [],
|
|
18473
|
+
right: []
|
|
18474
|
+
};
|
|
18475
|
+
return res;
|
|
18476
|
+
};
|
|
18477
|
+
const getSearchParamsFromTab = search => {
|
|
18478
|
+
const searchParams = new URLSearchParams();
|
|
18479
|
+
const openTab = new URLSearchParams(search).get('tab');
|
|
18480
|
+
if (openTab) {
|
|
18481
|
+
searchParams.set('tab', openTab);
|
|
18482
|
+
}
|
|
18483
|
+
return searchParams;
|
|
18484
|
+
};
|
|
18485
|
+
const getFinalSearch = _ref3 => {
|
|
18486
|
+
let {
|
|
18487
|
+
search,
|
|
18488
|
+
filterModel,
|
|
18489
|
+
sortModel,
|
|
18490
|
+
columnsVisibilityModel,
|
|
18491
|
+
pinnedColumnsModel,
|
|
18492
|
+
columns
|
|
18493
|
+
} = _ref3;
|
|
18494
|
+
const filterModelSearch = getSearchParamsFromFilterModel(filterModel);
|
|
18495
|
+
const sortModelSearch = getSearchParamsFromSorting(sortModel);
|
|
18496
|
+
const columnVisibilityModelSearch = getSearchParamsFromColumnVisibility(columnsVisibilityModel, columns);
|
|
18497
|
+
const pinnedColumnsModelSearch = getSearchParamsFromPinnedColumns(pinnedColumnsModel);
|
|
18498
|
+
const tabSearch = getSearchParamsFromTab(search);
|
|
18499
|
+
const searchParams = new URLSearchParams();
|
|
18500
|
+
for (const [key, value] of new URLSearchParams(search)) {
|
|
18501
|
+
if (!key.startsWith('_')) {
|
|
18502
|
+
searchParams.set(key, value);
|
|
18503
|
+
}
|
|
18504
|
+
}
|
|
18505
|
+
return new URLSearchParams([...searchParams, ...filterModelSearch, ...sortModelSearch, ...tabSearch, ...pinnedColumnsModelSearch, ...columnVisibilityModelSearch]);
|
|
18506
|
+
};
|
|
18507
|
+
/** Return the state of the table given the URL and the local storage state */
|
|
18508
|
+
const getModelsParsedOrUpdateLocalStorage = (search, columns, historyReplace, localStorage) => {
|
|
18509
|
+
const {
|
|
18510
|
+
localStorageFilters,
|
|
18511
|
+
setLocalStorageFilters,
|
|
18512
|
+
localStorageSorting,
|
|
18513
|
+
setLocalStorageSorting,
|
|
18514
|
+
localStorageColumnsVisibility,
|
|
18515
|
+
setLocalStorageColumnsVisibility,
|
|
18516
|
+
localStoragePinnedColumns,
|
|
18517
|
+
setLocalStoragePinnedColumns
|
|
18518
|
+
} = localStorage;
|
|
18519
|
+
const filterModel = getFilterModel(search, columns, localStorageFilters, setLocalStorageFilters);
|
|
18520
|
+
const sortModel = getSortModel(search, columns, localStorageSorting, setLocalStorageSorting);
|
|
18521
|
+
const columnVisibilityModel = getColumnsVisibility(search, columns, localStorageColumnsVisibility, setLocalStorageColumnsVisibility);
|
|
18522
|
+
const pinnedColumnsModel = getPinnedColumns(search, columns, localStoragePinnedColumns, setLocalStoragePinnedColumns);
|
|
18523
|
+
const finalSearch = getFinalSearch({
|
|
18524
|
+
search,
|
|
18525
|
+
filterModel,
|
|
18526
|
+
sortModel,
|
|
18527
|
+
columnsVisibilityModel: columnVisibilityModel,
|
|
18528
|
+
pinnedColumnsModel,
|
|
18529
|
+
columns
|
|
18530
|
+
});
|
|
18531
|
+
const searchString = urlSearchParamsToString(finalSearch);
|
|
18532
|
+
if (searchString !== search) {
|
|
18533
|
+
historyReplace(searchString);
|
|
18534
|
+
}
|
|
18535
|
+
return {
|
|
18536
|
+
filterModel,
|
|
18537
|
+
sortModel,
|
|
18538
|
+
columnVisibilityModel,
|
|
18539
|
+
pinnedColumnsModel
|
|
18540
|
+
};
|
|
18541
|
+
};
|
|
18542
|
+
const updateUrl = (_ref4, search, historyReplace, columns) => {
|
|
18543
|
+
let {
|
|
18544
|
+
filterModel,
|
|
18545
|
+
sortModel,
|
|
18546
|
+
columnsModel: columnsVisibilityModel,
|
|
18547
|
+
pinnedColumnsModel
|
|
18548
|
+
} = _ref4;
|
|
18549
|
+
const newSearch = getFinalSearch({
|
|
18550
|
+
search,
|
|
18551
|
+
filterModel,
|
|
18552
|
+
sortModel,
|
|
18553
|
+
columnsVisibilityModel,
|
|
18554
|
+
pinnedColumnsModel,
|
|
18555
|
+
columns
|
|
18556
|
+
});
|
|
18557
|
+
const searchString = urlSearchParamsToString(newSearch);
|
|
18558
|
+
if (searchString !== search) {
|
|
18559
|
+
historyReplace(searchString);
|
|
18560
|
+
}
|
|
18561
|
+
};
|
|
18562
|
+
|
|
18563
|
+
// Note: this is a comparator to sort the filters, not pure comparison
|
|
18564
|
+
// do not use it for equivalence (e.g. with value `3` and undefined we
|
|
18565
|
+
// will get 0).
|
|
18566
|
+
const compareFilters = (firstFilter, secondFilter) => {
|
|
18567
|
+
if (firstFilter.field < secondFilter.field) {
|
|
18568
|
+
return -1;
|
|
18569
|
+
} else if (firstFilter.field > secondFilter.field) {
|
|
18570
|
+
return 1;
|
|
18571
|
+
}
|
|
18572
|
+
if (firstFilter.operator === undefined || secondFilter.operator === undefined) {
|
|
18573
|
+
return 0;
|
|
18574
|
+
}
|
|
18575
|
+
if (firstFilter.operator < secondFilter.operator) {
|
|
18576
|
+
return -1;
|
|
18577
|
+
} else if (firstFilter.operator > secondFilter.operator) {
|
|
18578
|
+
return 1;
|
|
18579
|
+
}
|
|
18580
|
+
if (firstFilter.value < secondFilter.value) {
|
|
18581
|
+
return -1;
|
|
18582
|
+
} else if (firstFilter.value > secondFilter.value) {
|
|
18583
|
+
return 1;
|
|
18584
|
+
}
|
|
18585
|
+
return 0;
|
|
18586
|
+
};
|
|
18587
|
+
const areFiltersEquivalent = (firstFilter, secondFilter) => {
|
|
18588
|
+
return firstFilter.field === secondFilter.field && firstFilter.operator === secondFilter.operator && firstFilter.value === secondFilter.value;
|
|
18589
|
+
};
|
|
18590
|
+
const areFilterModelsEquivalent = (filterModel, filterModelToMatch) => {
|
|
18591
|
+
const {
|
|
18592
|
+
items,
|
|
18593
|
+
logicOperator
|
|
18594
|
+
} = filterModel;
|
|
18595
|
+
const {
|
|
18596
|
+
items: itemsToMatch,
|
|
18597
|
+
logicOperator: logicOperatorToMatch
|
|
18598
|
+
} = filterModelToMatch;
|
|
18599
|
+
if (logicOperator !== logicOperatorToMatch) {
|
|
18600
|
+
return false;
|
|
18601
|
+
}
|
|
18602
|
+
if (items.length !== itemsToMatch.length) {
|
|
18603
|
+
return false;
|
|
18604
|
+
}
|
|
18605
|
+
items.sort(compareFilters);
|
|
18606
|
+
itemsToMatch.sort(compareFilters);
|
|
18607
|
+
for (let i = 0; i < items.length; i++) {
|
|
18608
|
+
const filter = items[i];
|
|
18609
|
+
const filterToCompare = itemsToMatch[i];
|
|
18610
|
+
|
|
18611
|
+
// compareFilters return 0 if and only if the filters have the same
|
|
18612
|
+
// field, operator, and value
|
|
18613
|
+
if (!areFiltersEquivalent(filter, filterToCompare)) {
|
|
18614
|
+
return false;
|
|
18615
|
+
}
|
|
18616
|
+
}
|
|
18617
|
+
return true;
|
|
18618
|
+
};
|
|
18619
|
+
|
|
17852
18620
|
// Store the license information in a global, so it can be shared
|
|
17853
18621
|
// when module duplication occurs. The duplication of the modules can happen
|
|
17854
18622
|
// if using multiple version of MUI X at the same time of the bundler
|
|
@@ -21921,7 +22689,7 @@ const StyledGridToolbarFilterSemanticField = styled$3.form`
|
|
|
21921
22689
|
}
|
|
21922
22690
|
`;
|
|
21923
22691
|
|
|
21924
|
-
const _excluded$
|
|
22692
|
+
const _excluded$f = ["className", "nlpFilterConfig", "onFilterModelChange", "dateFormat", "defaultModel", "defaultFilter", "disablePower", "localeText"];
|
|
21925
22693
|
const COMPONENT_NAME$2 = 'GridToolbarFilterSemanticField';
|
|
21926
22694
|
const CLASSNAME$2 = 'redsift-datagrid-toolbar-nlp-filter-field';
|
|
21927
22695
|
const DEFAULT_OPERATORS = {
|
|
@@ -22006,7 +22774,7 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22006
22774
|
disablePower = false,
|
|
22007
22775
|
localeText
|
|
22008
22776
|
} = props,
|
|
22009
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22777
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$f);
|
|
22010
22778
|
const {
|
|
22011
22779
|
textLabel,
|
|
22012
22780
|
textPlaceholder,
|
|
@@ -22101,7 +22869,7 @@ GridToolbarFilterSemanticField.displayName = COMPONENT_NAME$2;
|
|
|
22101
22869
|
|
|
22102
22870
|
/** ------ */
|
|
22103
22871
|
|
|
22104
|
-
const Toolbar$
|
|
22872
|
+
const Toolbar$2 = props => {
|
|
22105
22873
|
const {
|
|
22106
22874
|
hasExportButton = true,
|
|
22107
22875
|
exportButtonProps,
|
|
@@ -22154,7 +22922,7 @@ const Toolbar$3 = props => {
|
|
|
22154
22922
|
}, semanticFilterProps ? /*#__PURE__*/React__default.createElement(GridToolbarFilterSemanticField, semanticFilterProps) : null)));
|
|
22155
22923
|
};
|
|
22156
22924
|
|
|
22157
|
-
const _excluded$
|
|
22925
|
+
const _excluded$e = ["displayName"];
|
|
22158
22926
|
const muiIconToDSIcon = {
|
|
22159
22927
|
ColumnFilteredIcon: mdiFilterVariant,
|
|
22160
22928
|
ColumnSelectorIcon: mdiViewColumn,
|
|
@@ -22172,7 +22940,7 @@ const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22172
22940
|
const {
|
|
22173
22941
|
displayName
|
|
22174
22942
|
} = props,
|
|
22175
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22943
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$e);
|
|
22176
22944
|
return /*#__PURE__*/React__default.createElement(Icon, _extends$2({}, forwardedProps, forwardedProps.inputProps, {
|
|
22177
22945
|
ref: ref,
|
|
22178
22946
|
size: forwardedProps.fontSize,
|
|
@@ -22180,7 +22948,7 @@ const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22180
22948
|
}));
|
|
22181
22949
|
});
|
|
22182
22950
|
|
|
22183
|
-
const _excluded$
|
|
22951
|
+
const _excluded$d = ["children", "color", "onClick", "startIcon"];
|
|
22184
22952
|
const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
22185
22953
|
var _props$className;
|
|
22186
22954
|
const {
|
|
@@ -22189,7 +22957,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22189
22957
|
onClick,
|
|
22190
22958
|
startIcon
|
|
22191
22959
|
} = props,
|
|
22192
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22960
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$d);
|
|
22193
22961
|
const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
|
|
22194
22962
|
if ((_props$className = props.className) !== null && _props$className !== void 0 && _props$className.includes('redsift-condensed')) {
|
|
22195
22963
|
return /*#__PURE__*/React__default.createElement(IconButton$2, _extends$2({}, forwardedProps, {
|
|
@@ -22215,7 +22983,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22215
22983
|
}), children);
|
|
22216
22984
|
});
|
|
22217
22985
|
|
|
22218
|
-
const _excluded$
|
|
22986
|
+
const _excluded$c = ["checked", "indeterminate", "disabled", "onChange"];
|
|
22219
22987
|
const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
22220
22988
|
const {
|
|
22221
22989
|
checked,
|
|
@@ -22223,7 +22991,7 @@ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22223
22991
|
disabled,
|
|
22224
22992
|
onChange
|
|
22225
22993
|
} = props,
|
|
22226
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22994
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$c);
|
|
22227
22995
|
return /*#__PURE__*/React__default.createElement(Checkbox, _extends$2({}, forwardedProps, forwardedProps.inputProps, {
|
|
22228
22996
|
isSelected: checked && !indeterminate,
|
|
22229
22997
|
isDisabled: disabled,
|
|
@@ -22233,7 +23001,7 @@ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22233
23001
|
}));
|
|
22234
23002
|
});
|
|
22235
23003
|
|
|
22236
|
-
const _excluded$
|
|
23004
|
+
const _excluded$b = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
|
|
22237
23005
|
const PopperRoot = styled$1(BasePopper$1, {
|
|
22238
23006
|
name: 'MuiPopper',
|
|
22239
23007
|
slot: 'Root',
|
|
@@ -22276,7 +23044,7 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
|
22276
23044
|
slots,
|
|
22277
23045
|
slotProps
|
|
22278
23046
|
} = props,
|
|
22279
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
23047
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$b);
|
|
22280
23048
|
const RootComponent = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components == null ? void 0 : components.Root;
|
|
22281
23049
|
const otherProps = _extends$1({
|
|
22282
23050
|
anchorEl,
|
|
@@ -22516,7 +23284,7 @@ process.env.NODE_ENV !== "production" ? Ripple.propTypes = {
|
|
|
22516
23284
|
const touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);
|
|
22517
23285
|
var touchRippleClasses$1 = touchRippleClasses;
|
|
22518
23286
|
|
|
22519
|
-
const _excluded$
|
|
23287
|
+
const _excluded$a = ["center", "classes", "className"];
|
|
22520
23288
|
let _ = t => t,
|
|
22521
23289
|
_t,
|
|
22522
23290
|
_t2,
|
|
@@ -22645,7 +23413,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
|
|
|
22645
23413
|
classes = {},
|
|
22646
23414
|
className
|
|
22647
23415
|
} = props,
|
|
22648
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
23416
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$a);
|
|
22649
23417
|
const [ripples, setRipples] = React.useState([]);
|
|
22650
23418
|
const nextKey = React.useRef(0);
|
|
22651
23419
|
const rippleCallback = React.useRef(null);
|
|
@@ -22846,7 +23614,7 @@ function getButtonBaseUtilityClass(slot) {
|
|
|
22846
23614
|
const buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);
|
|
22847
23615
|
var buttonBaseClasses$1 = buttonBaseClasses;
|
|
22848
23616
|
|
|
22849
|
-
const _excluded$
|
|
23617
|
+
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
23618
|
const useUtilityClasses$5 = ownerState => {
|
|
22851
23619
|
const {
|
|
22852
23620
|
disabled,
|
|
@@ -22948,7 +23716,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
22948
23716
|
touchRippleRef,
|
|
22949
23717
|
type
|
|
22950
23718
|
} = props,
|
|
22951
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
23719
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$9);
|
|
22952
23720
|
const buttonRef = React.useRef(null);
|
|
22953
23721
|
const rippleRef = React.useRef(null);
|
|
22954
23722
|
const handleRippleRef = useForkRef(rippleRef, touchRippleRef);
|
|
@@ -23321,7 +24089,7 @@ function getMenuItemUtilityClass(slot) {
|
|
|
23321
24089
|
const menuItemClasses = generateUtilityClasses('MuiMenuItem', ['root', 'focusVisible', 'dense', 'disabled', 'divider', 'gutters', 'selected']);
|
|
23322
24090
|
var menuItemClasses$1 = menuItemClasses;
|
|
23323
24091
|
|
|
23324
|
-
const _excluded$
|
|
24092
|
+
const _excluded$8 = ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex", "className"];
|
|
23325
24093
|
const overridesResolver = (props, styles) => {
|
|
23326
24094
|
const {
|
|
23327
24095
|
ownerState
|
|
@@ -23443,7 +24211,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
|
|
|
23443
24211
|
tabIndex: tabIndexProp,
|
|
23444
24212
|
className
|
|
23445
24213
|
} = props,
|
|
23446
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
24214
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$8);
|
|
23447
24215
|
const context = React.useContext(ListContext$1);
|
|
23448
24216
|
const childContext = React.useMemo(() => ({
|
|
23449
24217
|
dense: dense || context.dense || false,
|
|
@@ -23586,7 +24354,7 @@ function getTableCellUtilityClass(slot) {
|
|
|
23586
24354
|
const tableCellClasses = generateUtilityClasses('MuiTableCell', ['root', 'head', 'body', 'footer', 'sizeSmall', 'sizeMedium', 'paddingCheckbox', 'paddingNone', 'alignLeft', 'alignCenter', 'alignRight', 'alignJustify', 'stickyHeader']);
|
|
23587
24355
|
var tableCellClasses$1 = tableCellClasses;
|
|
23588
24356
|
|
|
23589
|
-
const _excluded$
|
|
24357
|
+
const _excluded$7 = ["align", "className", "component", "padding", "scope", "size", "sortDirection", "variant"];
|
|
23590
24358
|
const useUtilityClasses$3 = ownerState => {
|
|
23591
24359
|
const {
|
|
23592
24360
|
classes,
|
|
@@ -23683,7 +24451,7 @@ const TableCell = /*#__PURE__*/React.forwardRef(function TableCell(inProps, ref)
|
|
|
23683
24451
|
sortDirection,
|
|
23684
24452
|
variant: variantProp
|
|
23685
24453
|
} = props,
|
|
23686
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
24454
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$7);
|
|
23687
24455
|
const table = React.useContext(TableContext$1);
|
|
23688
24456
|
const tablelvl2 = React.useContext(Tablelvl2Context$1);
|
|
23689
24457
|
const isHeadCell = tablelvl2 && tablelvl2.variant === 'head';
|
|
@@ -23790,7 +24558,7 @@ function getToolbarUtilityClass(slot) {
|
|
|
23790
24558
|
}
|
|
23791
24559
|
generateUtilityClasses('MuiToolbar', ['root', 'gutters', 'regular', 'dense']);
|
|
23792
24560
|
|
|
23793
|
-
const _excluded$
|
|
24561
|
+
const _excluded$6 = ["className", "component", "disableGutters", "variant"];
|
|
23794
24562
|
const useUtilityClasses$2 = ownerState => {
|
|
23795
24563
|
const {
|
|
23796
24564
|
classes,
|
|
@@ -23831,7 +24599,7 @@ const ToolbarRoot = styled$1('div', {
|
|
|
23831
24599
|
theme,
|
|
23832
24600
|
ownerState
|
|
23833
24601
|
}) => ownerState.variant === 'regular' && theme.mixins.toolbar);
|
|
23834
|
-
const Toolbar
|
|
24602
|
+
const Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
|
|
23835
24603
|
const props = useThemeProps({
|
|
23836
24604
|
props: inProps,
|
|
23837
24605
|
name: 'MuiToolbar'
|
|
@@ -23842,7 +24610,7 @@ const Toolbar$1 = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
|
|
|
23842
24610
|
disableGutters = false,
|
|
23843
24611
|
variant = 'regular'
|
|
23844
24612
|
} = props,
|
|
23845
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
24613
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$6);
|
|
23846
24614
|
const ownerState = _extends$1({}, props, {
|
|
23847
24615
|
component,
|
|
23848
24616
|
disableGutters,
|
|
@@ -23856,7 +24624,7 @@ const Toolbar$1 = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
|
|
|
23856
24624
|
ownerState: ownerState
|
|
23857
24625
|
}, other));
|
|
23858
24626
|
});
|
|
23859
|
-
process.env.NODE_ENV !== "production" ? Toolbar
|
|
24627
|
+
process.env.NODE_ENV !== "production" ? Toolbar.propTypes /* remove-proptypes */ = {
|
|
23860
24628
|
// ----------------------------- Warning --------------------------------
|
|
23861
24629
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
23862
24630
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -23894,7 +24662,7 @@ process.env.NODE_ENV !== "production" ? Toolbar$1.propTypes /* remove-proptypes
|
|
|
23894
24662
|
*/
|
|
23895
24663
|
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['dense', 'regular']), PropTypes.string])
|
|
23896
24664
|
} : void 0;
|
|
23897
|
-
var Toolbar$
|
|
24665
|
+
var Toolbar$1 = Toolbar;
|
|
23898
24666
|
|
|
23899
24667
|
var KeyboardArrowLeft = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
23900
24668
|
d: "M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"
|
|
@@ -23910,7 +24678,7 @@ function getIconButtonUtilityClass(slot) {
|
|
|
23910
24678
|
const iconButtonClasses = generateUtilityClasses('MuiIconButton', ['root', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning', 'edgeStart', 'edgeEnd', 'sizeSmall', 'sizeMedium', 'sizeLarge']);
|
|
23911
24679
|
var iconButtonClasses$1 = iconButtonClasses;
|
|
23912
24680
|
|
|
23913
|
-
const _excluded$
|
|
24681
|
+
const _excluded$5 = ["edge", "children", "className", "color", "disabled", "disableFocusRipple", "size"];
|
|
23914
24682
|
const useUtilityClasses$1 = ownerState => {
|
|
23915
24683
|
const {
|
|
23916
24684
|
classes,
|
|
@@ -24011,7 +24779,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
24011
24779
|
disableFocusRipple = false,
|
|
24012
24780
|
size = 'medium'
|
|
24013
24781
|
} = props,
|
|
24014
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
24782
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$5);
|
|
24015
24783
|
const ownerState = _extends$1({}, props, {
|
|
24016
24784
|
edge,
|
|
24017
24785
|
color,
|
|
@@ -24109,7 +24877,7 @@ var FirstPageIcon = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
|
24109
24877
|
}), 'FirstPage');
|
|
24110
24878
|
|
|
24111
24879
|
var _LastPageIcon, _FirstPageIcon, _KeyboardArrowRight, _KeyboardArrowLeft, _KeyboardArrowLeft2, _KeyboardArrowRight2, _FirstPageIcon2, _LastPageIcon2;
|
|
24112
|
-
const _excluded$
|
|
24880
|
+
const _excluded$4 = ["backIconButtonProps", "count", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton"];
|
|
24113
24881
|
const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginationActions(props, ref) {
|
|
24114
24882
|
const {
|
|
24115
24883
|
backIconButtonProps,
|
|
@@ -24122,7 +24890,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
24122
24890
|
showFirstButton,
|
|
24123
24891
|
showLastButton
|
|
24124
24892
|
} = props,
|
|
24125
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
24893
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$4);
|
|
24126
24894
|
const theme = useTheme();
|
|
24127
24895
|
const handleFirstPageButtonClick = event => {
|
|
24128
24896
|
onPageChange(event, 0);
|
|
@@ -24226,7 +24994,7 @@ const tablePaginationClasses = generateUtilityClasses('MuiTablePagination', ['ro
|
|
|
24226
24994
|
var tablePaginationClasses$1 = tablePaginationClasses;
|
|
24227
24995
|
|
|
24228
24996
|
var _InputBase;
|
|
24229
|
-
const _excluded$
|
|
24997
|
+
const _excluded$3 = ["ActionsComponent", "backIconButtonProps", "className", "colSpan", "component", "count", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton"];
|
|
24230
24998
|
const TablePaginationRoot = styled$1(TableCell$1, {
|
|
24231
24999
|
name: 'MuiTablePagination',
|
|
24232
25000
|
slot: 'Root',
|
|
@@ -24242,7 +25010,7 @@ const TablePaginationRoot = styled$1(TableCell$1, {
|
|
|
24242
25010
|
padding: 0
|
|
24243
25011
|
}
|
|
24244
25012
|
}));
|
|
24245
|
-
const TablePaginationToolbar = styled$1(Toolbar$
|
|
25013
|
+
const TablePaginationToolbar = styled$1(Toolbar$1, {
|
|
24246
25014
|
name: 'MuiTablePagination',
|
|
24247
25015
|
slot: 'Toolbar',
|
|
24248
25016
|
overridesResolver: (props, styles) => _extends$1({
|
|
@@ -24373,7 +25141,7 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
24373
25141
|
showFirstButton = false,
|
|
24374
25142
|
showLastButton = false
|
|
24375
25143
|
} = props,
|
|
24376
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
25144
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$3);
|
|
24377
25145
|
const ownerState = props;
|
|
24378
25146
|
const classes = useUtilityClasses(ownerState);
|
|
24379
25147
|
const MenuItemComponent = SelectProps.native ? 'option' : TablePaginationMenuItem;
|
|
@@ -24592,10 +25360,47 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
24592
25360
|
} : void 0;
|
|
24593
25361
|
var TablePagination$1 = TablePagination;
|
|
24594
25362
|
|
|
24595
|
-
const
|
|
24596
|
-
|
|
24597
|
-
|
|
24598
|
-
|
|
25363
|
+
const ServerSideControlledPagination = _ref => {
|
|
25364
|
+
let {
|
|
25365
|
+
selectionStatus,
|
|
25366
|
+
displaySelection,
|
|
25367
|
+
displayPagination,
|
|
25368
|
+
paginationModel,
|
|
25369
|
+
onPaginationModelChange,
|
|
25370
|
+
pageSizeOptions,
|
|
25371
|
+
displayRowsPerPage,
|
|
25372
|
+
paginationProps,
|
|
25373
|
+
rowCount
|
|
25374
|
+
} = _ref;
|
|
25375
|
+
const totalNumberOfRowsInTable = rowCount;
|
|
25376
|
+
const totalRowsLabel = `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`;
|
|
25377
|
+
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)` : ''}.`;
|
|
25378
|
+
return /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
25379
|
+
flexDirection: "row",
|
|
25380
|
+
alignItems: "center",
|
|
25381
|
+
justifyContent: "space-between",
|
|
25382
|
+
marginBottom: "7px"
|
|
25383
|
+
}, displaySelection ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, selectionStatus.type === 'page' && selectionStatus.numberOfSelectedRowsInPage != 0 ? /*#__PURE__*/React__default.createElement(Text, {
|
|
25384
|
+
fontSize: "14px"
|
|
25385
|
+
}, pageRowsLabel) : selectionStatus.type === 'other' ? /*#__PURE__*/React__default.createElement(Text, {
|
|
25386
|
+
fontSize: "14px"
|
|
25387
|
+
}, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
|
|
25388
|
+
component: "div",
|
|
25389
|
+
count: totalNumberOfRowsInTable,
|
|
25390
|
+
page: paginationModel.page,
|
|
25391
|
+
onPageChange: (event, page) => onPaginationModelChange({
|
|
25392
|
+
page,
|
|
25393
|
+
pageSize: paginationModel.pageSize
|
|
25394
|
+
}),
|
|
25395
|
+
rowsPerPage: paginationModel.pageSize,
|
|
25396
|
+
onRowsPerPageChange: event => onPaginationModelChange({
|
|
25397
|
+
page: paginationModel.page,
|
|
25398
|
+
pageSize: parseInt(event.target.value, 10)
|
|
25399
|
+
}),
|
|
25400
|
+
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
25401
|
+
}, paginationProps)) : null);
|
|
25402
|
+
};
|
|
25403
|
+
|
|
24599
25404
|
const getSelectableRowsInTable = (apiRef, isRowSelectable) => {
|
|
24600
25405
|
return isRowSelectable && typeof isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref => {
|
|
24601
25406
|
let {
|
|
@@ -24663,54 +25468,15 @@ const ControlledPagination = _ref3 => {
|
|
|
24663
25468
|
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
24664
25469
|
}, paginationProps)) : null);
|
|
24665
25470
|
};
|
|
24666
|
-
|
|
24667
|
-
|
|
24668
|
-
|
|
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 : []
|
|
24704
|
-
}, paginationProps)) : null);
|
|
24705
|
-
};
|
|
24706
|
-
const Toolbar = _ref5 => {
|
|
25471
|
+
|
|
25472
|
+
const _excluded$2 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "paginationModel", "onPaginationModelChange", "pageSizeOptions", "paginationProps", "paginationMode", "rowCount"];
|
|
25473
|
+
const ToolbarWrapper = _ref => {
|
|
24707
25474
|
let {
|
|
24708
25475
|
hideToolbar,
|
|
24709
25476
|
RenderedToolbar,
|
|
24710
25477
|
filterModel,
|
|
24711
25478
|
onFilterModelChange,
|
|
24712
25479
|
pagination,
|
|
24713
|
-
ControlledPagination,
|
|
24714
25480
|
paginationPlacement,
|
|
24715
25481
|
selectionStatus,
|
|
24716
25482
|
apiRef,
|
|
@@ -24721,8 +25487,8 @@ const Toolbar = _ref5 => {
|
|
|
24721
25487
|
paginationProps,
|
|
24722
25488
|
paginationMode = 'client',
|
|
24723
25489
|
rowCount
|
|
24724
|
-
} =
|
|
24725
|
-
forwardedProps = _objectWithoutProperties(
|
|
25490
|
+
} = _ref,
|
|
25491
|
+
forwardedProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
24726
25492
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !hideToolbar ? /*#__PURE__*/React__default.createElement(RenderedToolbar, _extends$2({}, forwardedProps, {
|
|
24727
25493
|
filterModel: filterModel,
|
|
24728
25494
|
onFilterModelChange: onFilterModelChange
|
|
@@ -24749,18 +25515,258 @@ const Toolbar = _ref5 => {
|
|
|
24749
25515
|
paginationProps: paginationProps
|
|
24750
25516
|
}) : null);
|
|
24751
25517
|
};
|
|
25518
|
+
|
|
25519
|
+
// Get and Set data from LocalStorage WITHOUT useState
|
|
25520
|
+
|
|
25521
|
+
// triggering a state update and consecutive re-render
|
|
25522
|
+
const useFetchState = (defaultValue, key) => {
|
|
25523
|
+
let stickyValue = null;
|
|
25524
|
+
try {
|
|
25525
|
+
stickyValue = window.localStorage.getItem(key);
|
|
25526
|
+
} catch (e) {
|
|
25527
|
+
console.error('StatefulDataGrid: error getting item from local storage: ', e);
|
|
25528
|
+
}
|
|
25529
|
+
let parsedValue = stickyValue !== null && stickyValue !== undefined && stickyValue !== 'undefined' ? JSON.parse(stickyValue) : defaultValue;
|
|
25530
|
+
|
|
25531
|
+
// TODO: temporary workaround to avoid clashes when someone had sorting on the now-removed screenshot field (renamed to num_annotations)
|
|
25532
|
+
// 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
|
|
25533
|
+
if (parsedValue instanceof Array) {
|
|
25534
|
+
const fields = (parsedValue || []).map(item => item.field);
|
|
25535
|
+
if (fields.includes('screenshot') || fields.includes('diffs')) {
|
|
25536
|
+
parsedValue = defaultValue;
|
|
25537
|
+
}
|
|
25538
|
+
}
|
|
25539
|
+
const updateValue = useCallback(value => {
|
|
25540
|
+
try {
|
|
25541
|
+
window.localStorage.setItem(key, JSON.stringify(value));
|
|
25542
|
+
} catch (e) {
|
|
25543
|
+
console.error('StatefulDataGrid: error setting item into local storage: ', e);
|
|
25544
|
+
}
|
|
25545
|
+
}, [key]);
|
|
25546
|
+
return [parsedValue, updateValue];
|
|
25547
|
+
};
|
|
25548
|
+
|
|
25549
|
+
function useLocalStorage(key, defaultValue) {
|
|
25550
|
+
const [value, setValue] = useState(() => {
|
|
25551
|
+
let currentValue;
|
|
25552
|
+
try {
|
|
25553
|
+
currentValue = JSON.parse(localStorage.getItem(key) || String(defaultValue));
|
|
25554
|
+
} catch (error) {
|
|
25555
|
+
currentValue = defaultValue;
|
|
25556
|
+
}
|
|
25557
|
+
return currentValue;
|
|
25558
|
+
});
|
|
25559
|
+
useEffect(() => {
|
|
25560
|
+
try {
|
|
25561
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
25562
|
+
} catch (e) {
|
|
25563
|
+
console.error('local-storage: error setting item into local storage: ', e);
|
|
25564
|
+
}
|
|
25565
|
+
}, [value, key]);
|
|
25566
|
+
return [value, setValue];
|
|
25567
|
+
}
|
|
25568
|
+
|
|
25569
|
+
const useTableStates = (id, version, customDefaults) => {
|
|
25570
|
+
const [paginationModel, setPaginationModel] = useLocalStorage(buildStorageKey({
|
|
25571
|
+
id,
|
|
25572
|
+
version,
|
|
25573
|
+
category: PAGINATION_MODEL_KEY
|
|
25574
|
+
}), {
|
|
25575
|
+
page: 0,
|
|
25576
|
+
pageSize: 10
|
|
25577
|
+
});
|
|
25578
|
+
const [sortModel, setSortModel] = useFetchState(customDefaults && customDefaults[SORT_MODEL_KEY] ? customDefaults[SORT_MODEL_KEY] : '', buildStorageKey({
|
|
25579
|
+
id,
|
|
25580
|
+
version,
|
|
25581
|
+
category: SORT_MODEL_KEY
|
|
25582
|
+
}));
|
|
25583
|
+
const [localStorageFilters, setLocalStorageFilters] = useFetchState('', buildStorageKey({
|
|
25584
|
+
id,
|
|
25585
|
+
version,
|
|
25586
|
+
category: FILTER_SEARCH_KEY
|
|
25587
|
+
}));
|
|
25588
|
+
const [visibilityModelLocalStorage, setVisibilityModelLocalStorage] = useFetchState('', buildStorageKey({
|
|
25589
|
+
id,
|
|
25590
|
+
version,
|
|
25591
|
+
category: VISIBILITY_MODEL_KEY
|
|
25592
|
+
}));
|
|
25593
|
+
const [pinnedColumns, setPinnedColumns] = useFetchState(customDefaults ? customDefaults[PINNED_COLUMNS] : '_pinnedColumnsLeft=[]&_pinnedColumnsRight=[]', buildStorageKey({
|
|
25594
|
+
id,
|
|
25595
|
+
version,
|
|
25596
|
+
category: PINNED_COLUMNS
|
|
25597
|
+
}));
|
|
25598
|
+
const [dimensionModel, setDimensionModel] = useFetchState({}, buildStorageKey({
|
|
25599
|
+
id,
|
|
25600
|
+
version,
|
|
25601
|
+
category: DIMENSION_MODEL_KEY
|
|
25602
|
+
}));
|
|
25603
|
+
return {
|
|
25604
|
+
paginationModel,
|
|
25605
|
+
setPaginationModel,
|
|
25606
|
+
sortModel,
|
|
25607
|
+
setSortModel,
|
|
25608
|
+
localStorageFilters,
|
|
25609
|
+
setLocalStorageFilters,
|
|
25610
|
+
visibilityModelLocalStorage,
|
|
25611
|
+
setVisibilityModelLocalStorage,
|
|
25612
|
+
pinnedColumns,
|
|
25613
|
+
setPinnedColumns,
|
|
25614
|
+
dimensionModel,
|
|
25615
|
+
setDimensionModel
|
|
25616
|
+
};
|
|
25617
|
+
};
|
|
25618
|
+
|
|
25619
|
+
const DATAGRID_VERSION = 1;
|
|
25620
|
+
const useStatefulTable = props => {
|
|
25621
|
+
const {
|
|
25622
|
+
// density = 'standard',
|
|
25623
|
+
apiRef,
|
|
25624
|
+
columns: propsColumns,
|
|
25625
|
+
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
25626
|
+
onColumnWidthChange: propsOnColumnWidthChange,
|
|
25627
|
+
onFilterModelChange: propsOnFilterModelChange,
|
|
25628
|
+
onPaginationModelChange: propsOnPaginationModelChange,
|
|
25629
|
+
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
25630
|
+
onSortModelChange: propsOnSortModelChange,
|
|
25631
|
+
pinnedCustomColumns = {
|
|
25632
|
+
left: [],
|
|
25633
|
+
right: []
|
|
25634
|
+
},
|
|
25635
|
+
useRouter,
|
|
25636
|
+
version = DATAGRID_VERSION
|
|
25637
|
+
} = props;
|
|
25638
|
+
const {
|
|
25639
|
+
search,
|
|
25640
|
+
pathname,
|
|
25641
|
+
historyReplace
|
|
25642
|
+
} = useRouter();
|
|
25643
|
+
const id = pathname;
|
|
25644
|
+
const customDefaults = useMemo(() => {
|
|
25645
|
+
return {
|
|
25646
|
+
pinnedColumns: `_pinnedColumnsLeft=[${[GRID_CHECKBOX_SELECTION_COL_DEF.field, ...pinnedCustomColumns.left].join(',')}]&_pinnedColumnsRight=[${pinnedCustomColumns.right.join(',')}]`
|
|
25647
|
+
};
|
|
25648
|
+
}, [pinnedCustomColumns]);
|
|
25649
|
+
|
|
25650
|
+
// States and setters persisted in the local storage for this table
|
|
25651
|
+
const {
|
|
25652
|
+
paginationModel,
|
|
25653
|
+
setPaginationModel,
|
|
25654
|
+
sortModel,
|
|
25655
|
+
setSortModel,
|
|
25656
|
+
localStorageFilters,
|
|
25657
|
+
setLocalStorageFilters,
|
|
25658
|
+
visibilityModelLocalStorage,
|
|
25659
|
+
setVisibilityModelLocalStorage,
|
|
25660
|
+
pinnedColumns,
|
|
25661
|
+
setPinnedColumns,
|
|
25662
|
+
dimensionModel,
|
|
25663
|
+
setDimensionModel
|
|
25664
|
+
} = useTableStates(id, version, customDefaults);
|
|
25665
|
+
|
|
25666
|
+
// clearing up old version keys, triggering only on first render
|
|
25667
|
+
useEffect(() => clearPreviousVersionStorage(id, version), [id, version]);
|
|
25668
|
+
const onColumnDimensionChange = useCallback(_ref => {
|
|
25669
|
+
let {
|
|
25670
|
+
newWidth,
|
|
25671
|
+
field
|
|
25672
|
+
} = _ref;
|
|
25673
|
+
setDimensionModel(_objectSpread2(_objectSpread2({}, dimensionModel), {}, {
|
|
25674
|
+
[field]: newWidth
|
|
25675
|
+
}));
|
|
25676
|
+
}, [dimensionModel, setDimensionModel]);
|
|
25677
|
+
const {
|
|
25678
|
+
filterModel: filterParsed,
|
|
25679
|
+
sortModel: sortModelParsed,
|
|
25680
|
+
columnVisibilityModel: visibilityModel,
|
|
25681
|
+
pinnedColumnsModel
|
|
25682
|
+
} = getModelsParsedOrUpdateLocalStorage(search || '', propsColumns, historyReplace, {
|
|
25683
|
+
localStorageFilters,
|
|
25684
|
+
setLocalStorageFilters,
|
|
25685
|
+
localStorageSorting: sortModel,
|
|
25686
|
+
setLocalStorageSorting: setSortModel,
|
|
25687
|
+
localStorageColumnsVisibility: visibilityModelLocalStorage,
|
|
25688
|
+
setLocalStorageColumnsVisibility: setVisibilityModelLocalStorage,
|
|
25689
|
+
localStoragePinnedColumns: pinnedColumns,
|
|
25690
|
+
setLocalStoragePinnedColumns: setPinnedColumns
|
|
25691
|
+
});
|
|
25692
|
+
const columns = useMemo(() => propsColumns.map(column => {
|
|
25693
|
+
column.width = dimensionModel[column.field] || column.width || 100;
|
|
25694
|
+
return column;
|
|
25695
|
+
}), [propsColumns, dimensionModel]);
|
|
25696
|
+
return {
|
|
25697
|
+
apiRef,
|
|
25698
|
+
columns,
|
|
25699
|
+
onFilterModelChange: (model, details) => {
|
|
25700
|
+
propsOnFilterModelChange === null || propsOnFilterModelChange === void 0 ? void 0 : propsOnFilterModelChange(model, details);
|
|
25701
|
+
updateUrl({
|
|
25702
|
+
filterModel: model,
|
|
25703
|
+
sortModel: sortModelParsed,
|
|
25704
|
+
columnsModel: apiRef.current.state.columns.columnVisibilityModel,
|
|
25705
|
+
pinnedColumnsModel: pinnedColumnsModel
|
|
25706
|
+
}, search, historyReplace, columns);
|
|
25707
|
+
},
|
|
25708
|
+
filterModel: filterParsed,
|
|
25709
|
+
onSortModelChange: (model, details) => {
|
|
25710
|
+
propsOnSortModelChange === null || propsOnSortModelChange === void 0 ? void 0 : propsOnSortModelChange(model, details);
|
|
25711
|
+
updateUrl({
|
|
25712
|
+
filterModel: filterParsed,
|
|
25713
|
+
sortModel: model,
|
|
25714
|
+
columnsModel: apiRef.current.state.columns.columnVisibilityModel,
|
|
25715
|
+
pinnedColumnsModel: pinnedColumnsModel
|
|
25716
|
+
}, search, historyReplace, columns);
|
|
25717
|
+
},
|
|
25718
|
+
sortModel: sortModelParsed,
|
|
25719
|
+
onPinnedColumnsChange: (pinnedColumns, details) => {
|
|
25720
|
+
propsOnPinnedColumnsChange === null || propsOnPinnedColumnsChange === void 0 ? void 0 : propsOnPinnedColumnsChange(pinnedColumns, details);
|
|
25721
|
+
updateUrl({
|
|
25722
|
+
filterModel: filterParsed,
|
|
25723
|
+
sortModel: sortModelParsed,
|
|
25724
|
+
columnsModel: apiRef.current.state.columns.columnVisibilityModel,
|
|
25725
|
+
pinnedColumnsModel: pinnedColumns
|
|
25726
|
+
}, search, historyReplace, columns);
|
|
25727
|
+
},
|
|
25728
|
+
pinnedColumns: pinnedColumnsModel,
|
|
25729
|
+
paginationModel,
|
|
25730
|
+
onPaginationModelChange: (model, details) => {
|
|
25731
|
+
propsOnPaginationModelChange === null || propsOnPaginationModelChange === void 0 ? void 0 : propsOnPaginationModelChange(model, details);
|
|
25732
|
+
setPaginationModel(model);
|
|
25733
|
+
},
|
|
25734
|
+
columnVisibilityModel: visibilityModel,
|
|
25735
|
+
onColumnVisibilityModelChange: (columnsVisibilityModel, details) => {
|
|
25736
|
+
propsOnColumnVisibilityModelChange === null || propsOnColumnVisibilityModelChange === void 0 ? void 0 : propsOnColumnVisibilityModelChange(columnsVisibilityModel, details);
|
|
25737
|
+
updateUrl({
|
|
25738
|
+
filterModel: filterParsed,
|
|
25739
|
+
sortModel: sortModelParsed,
|
|
25740
|
+
columnsModel: columnsVisibilityModel,
|
|
25741
|
+
pinnedColumnsModel: pinnedColumnsModel
|
|
25742
|
+
}, search, historyReplace, columns);
|
|
25743
|
+
},
|
|
25744
|
+
onColumnWidthChange: (params, event, details) => {
|
|
25745
|
+
propsOnColumnWidthChange === null || propsOnColumnWidthChange === void 0 ? void 0 : propsOnColumnWidthChange(params, event, details);
|
|
25746
|
+
onColumnDimensionChange({
|
|
25747
|
+
newWidth: params.width,
|
|
25748
|
+
field: params.colDef.field
|
|
25749
|
+
});
|
|
25750
|
+
}
|
|
25751
|
+
};
|
|
25752
|
+
};
|
|
25753
|
+
|
|
25754
|
+
const _excluded$1 = ["apiRef", "columns", "onColumnVisibilityModelChange", "onColumnWidthChange", "onFilterModelChange", "onPaginationModelChange", "onPinnedColumnsChange", "onSortModelChange", "pinnedCustomColumns", "rows", "useRouter"],
|
|
25755
|
+
_excluded2 = ["apiRef", "autoHeight", "className", "slots", "slotProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "height", "hideToolbar", "initialState", "isRowSelectable", "isStateful", "license", "onFilterModelChange", "rowSelectionModel", "paginationModel", "onPaginationModelChange", "onRowSelectionModelChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "pagination", "paginationPlacement", "paginationProps", "pinnedCustomColumns", "rows", "pageSizeOptions", "sx", "theme", "useRouter", "paginationMode", "rowCount"];
|
|
25756
|
+
const COMPONENT_NAME$1 = 'DataGrid';
|
|
25757
|
+
const CLASSNAME$1 = 'redsift-datagrid';
|
|
24752
25758
|
const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionStatus, isRowSelectable, page, pageSize) => {
|
|
24753
|
-
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(
|
|
25759
|
+
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref => {
|
|
24754
25760
|
let {
|
|
24755
25761
|
model
|
|
24756
|
-
} =
|
|
25762
|
+
} = _ref;
|
|
24757
25763
|
return isRowSelectable({
|
|
24758
25764
|
row: model
|
|
24759
25765
|
});
|
|
24760
|
-
}).map(
|
|
25766
|
+
}).map(_ref2 => {
|
|
24761
25767
|
let {
|
|
24762
25768
|
id
|
|
24763
|
-
} =
|
|
25769
|
+
} = _ref2;
|
|
24764
25770
|
return id;
|
|
24765
25771
|
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
24766
25772
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
@@ -24804,8 +25810,41 @@ const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionS
|
|
|
24804
25810
|
};
|
|
24805
25811
|
}
|
|
24806
25812
|
};
|
|
25813
|
+
const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
25814
|
+
const {
|
|
25815
|
+
// density = 'standard',
|
|
25816
|
+
apiRef,
|
|
25817
|
+
columns,
|
|
25818
|
+
onColumnVisibilityModelChange,
|
|
25819
|
+
onColumnWidthChange,
|
|
25820
|
+
onFilterModelChange,
|
|
25821
|
+
onPaginationModelChange,
|
|
25822
|
+
onPinnedColumnsChange,
|
|
25823
|
+
onSortModelChange,
|
|
25824
|
+
pinnedCustomColumns,
|
|
25825
|
+
rows,
|
|
25826
|
+
useRouter
|
|
25827
|
+
} = props,
|
|
25828
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1);
|
|
25829
|
+
const statefulTableProps = useStatefulTable({
|
|
25830
|
+
apiRef: apiRef,
|
|
25831
|
+
columns,
|
|
25832
|
+
onFilterModelChange,
|
|
25833
|
+
onPinnedColumnsChange,
|
|
25834
|
+
onSortModelChange,
|
|
25835
|
+
onPaginationModelChange,
|
|
25836
|
+
onColumnVisibilityModelChange,
|
|
25837
|
+
onColumnWidthChange,
|
|
25838
|
+
pinnedCustomColumns,
|
|
25839
|
+
useRouter: useRouter
|
|
25840
|
+
});
|
|
25841
|
+
return /*#__PURE__*/React__default.createElement(DataGridPro, _extends$2({
|
|
25842
|
+
ref: ref,
|
|
25843
|
+
rows: rows
|
|
25844
|
+
}, forwardedProps, statefulTableProps));
|
|
25845
|
+
});
|
|
24807
25846
|
const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
24808
|
-
var
|
|
25847
|
+
var _ref3, _ref4, _initialState$paginat, _initialState$paginat2, _initialState$paginat3, _pageSizeOptions$, _ref5, _initialState$paginat4, _initialState$paginat5, _initialState$paginat6;
|
|
24809
25848
|
const datagridRef = ref || useRef();
|
|
24810
25849
|
const {
|
|
24811
25850
|
apiRef: propsApiRef,
|
|
@@ -24814,23 +25853,32 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24814
25853
|
slots,
|
|
24815
25854
|
slotProps,
|
|
24816
25855
|
filterModel: propsFilterModel,
|
|
25856
|
+
columnVisibilityModel: propsColumnVisibilityModel,
|
|
25857
|
+
pinnedColumns: propsPinnedColumns,
|
|
25858
|
+
sortModel: propsSortModel,
|
|
24817
25859
|
height: propsHeight,
|
|
24818
25860
|
hideToolbar,
|
|
24819
25861
|
initialState,
|
|
24820
25862
|
isRowSelectable,
|
|
25863
|
+
isStateful: propsIsStateful,
|
|
24821
25864
|
license = process.env.MUI_LICENSE_KEY,
|
|
24822
25865
|
onFilterModelChange: propsOnFilterModelChange,
|
|
24823
25866
|
rowSelectionModel: propsSelectionModel,
|
|
24824
25867
|
paginationModel: propsPaginationModel,
|
|
24825
25868
|
onPaginationModelChange: propsOnPaginationModelChange,
|
|
24826
25869
|
onRowSelectionModelChange,
|
|
25870
|
+
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
25871
|
+
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
25872
|
+
onSortModelChange: propsOnSortModelChange,
|
|
24827
25873
|
pagination,
|
|
24828
25874
|
paginationPlacement = 'both',
|
|
24829
25875
|
paginationProps,
|
|
25876
|
+
pinnedCustomColumns,
|
|
24830
25877
|
rows,
|
|
24831
25878
|
pageSizeOptions,
|
|
24832
25879
|
sx,
|
|
24833
25880
|
theme: propsTheme,
|
|
25881
|
+
useRouter,
|
|
24834
25882
|
paginationMode = 'client',
|
|
24835
25883
|
rowCount
|
|
24836
25884
|
} = props,
|
|
@@ -24838,7 +25886,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24838
25886
|
const theme = useTheme$4(propsTheme);
|
|
24839
25887
|
const _apiRef = useGridApiRef();
|
|
24840
25888
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
24841
|
-
const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$
|
|
25889
|
+
const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$2;
|
|
24842
25890
|
LicenseInfo.setLicenseKey(license);
|
|
24843
25891
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
24844
25892
|
const [filterModel, setFilterModel] = useState(propsFilterModel);
|
|
@@ -24852,13 +25900,46 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24852
25900
|
setFilterModel(model);
|
|
24853
25901
|
}
|
|
24854
25902
|
};
|
|
25903
|
+
const [columnVisibilityModel, setColumnVisibilityModel] = useState(propsColumnVisibilityModel);
|
|
25904
|
+
useEffect(() => {
|
|
25905
|
+
setColumnVisibilityModel(propsColumnVisibilityModel);
|
|
25906
|
+
}, [propsColumnVisibilityModel]);
|
|
25907
|
+
const onColumnVisibilityModelChange = (model, details) => {
|
|
25908
|
+
if (propsOnColumnVisibilityModelChange) {
|
|
25909
|
+
propsOnColumnVisibilityModelChange(model, details);
|
|
25910
|
+
} else {
|
|
25911
|
+
setColumnVisibilityModel(model);
|
|
25912
|
+
}
|
|
25913
|
+
};
|
|
25914
|
+
const [pinnedColumns, setPinnedColumns] = useState(propsPinnedColumns);
|
|
25915
|
+
useEffect(() => {
|
|
25916
|
+
setPinnedColumns(propsPinnedColumns);
|
|
25917
|
+
}, [propsPinnedColumns]);
|
|
25918
|
+
const onPinnedColumnsChange = (model, details) => {
|
|
25919
|
+
if (propsOnPinnedColumnsChange) {
|
|
25920
|
+
propsOnPinnedColumnsChange(model, details);
|
|
25921
|
+
} else {
|
|
25922
|
+
setPinnedColumns(model);
|
|
25923
|
+
}
|
|
25924
|
+
};
|
|
25925
|
+
const [sortModel, setSortModel] = useState(propsSortModel);
|
|
25926
|
+
useEffect(() => {
|
|
25927
|
+
setSortModel(propsSortModel);
|
|
25928
|
+
}, [propsSortModel]);
|
|
25929
|
+
const onSortModelChange = (model, details) => {
|
|
25930
|
+
if (propsOnSortModelChange) {
|
|
25931
|
+
propsOnSortModelChange(model, details);
|
|
25932
|
+
} else {
|
|
25933
|
+
setSortModel(model);
|
|
25934
|
+
}
|
|
25935
|
+
};
|
|
24855
25936
|
const [rowSelectionModel, setRowSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
24856
25937
|
useEffect(() => {
|
|
24857
25938
|
setRowSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
24858
25939
|
}, [propsSelectionModel]);
|
|
24859
25940
|
const [paginationModel, setPaginationModel] = useState({
|
|
24860
|
-
pageSize: (
|
|
24861
|
-
page: (
|
|
25941
|
+
pageSize: (_ref3 = (_ref4 = (_initialState$paginat = initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat2 = initialState.pagination) === null || _initialState$paginat2 === void 0 ? void 0 : (_initialState$paginat3 = _initialState$paginat2.paginationModel) === null || _initialState$paginat3 === void 0 ? void 0 : _initialState$paginat3.pageSize) !== null && _initialState$paginat !== void 0 ? _initialState$paginat : propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.pageSize) !== null && _ref4 !== void 0 ? _ref4 : typeof (pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0]) === 'number' ? pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0] : pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : (_pageSizeOptions$ = pageSizeOptions[0]) === null || _pageSizeOptions$ === void 0 ? void 0 : _pageSizeOptions$.value) !== null && _ref3 !== void 0 ? _ref3 : 100,
|
|
25942
|
+
page: (_ref5 = (_initialState$paginat4 = initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat5 = initialState.pagination) === null || _initialState$paginat5 === void 0 ? void 0 : (_initialState$paginat6 = _initialState$paginat5.paginationModel) === null || _initialState$paginat6 === void 0 ? void 0 : _initialState$paginat6.page) !== null && _initialState$paginat4 !== void 0 ? _initialState$paginat4 : propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.page) !== null && _ref5 !== void 0 ? _ref5 : 0
|
|
24862
25943
|
});
|
|
24863
25944
|
const onPaginationModelChange = model => {
|
|
24864
25945
|
if (propsOnPaginationModelChange) {
|
|
@@ -24902,6 +25983,8 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24902
25983
|
}
|
|
24903
25984
|
}
|
|
24904
25985
|
}), [theme]);
|
|
25986
|
+
const isStateful = propsIsStateful && useRouter;
|
|
25987
|
+
const RenderedDataGrid = isStateful ? StatefulDataGrid : DataGridPro;
|
|
24905
25988
|
return /*#__PURE__*/React__default.createElement(ThemeProvider$4, {
|
|
24906
25989
|
value: {
|
|
24907
25990
|
theme
|
|
@@ -24912,7 +25995,10 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24912
25995
|
ref: datagridRef,
|
|
24913
25996
|
className: classNames(DataGrid.className, className),
|
|
24914
25997
|
$height: height
|
|
24915
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
25998
|
+
}, /*#__PURE__*/React__default.createElement(RenderedDataGrid, _extends$2({}, isStateful ? {
|
|
25999
|
+
pinnedCustomColumns,
|
|
26000
|
+
useRouter
|
|
26001
|
+
} : {}, forwardedProps, {
|
|
24916
26002
|
rowCount: rowCount,
|
|
24917
26003
|
apiRef: apiRef,
|
|
24918
26004
|
autoHeight: autoHeight,
|
|
@@ -24956,7 +26042,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24956
26042
|
displayName: "OpenFilterButtonIcon"
|
|
24957
26043
|
}, props))
|
|
24958
26044
|
}, slots), {}, {
|
|
24959
|
-
toolbar:
|
|
26045
|
+
toolbar: ToolbarWrapper,
|
|
24960
26046
|
pagination: props => pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$2({}, props, {
|
|
24961
26047
|
displaySelection: false,
|
|
24962
26048
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
@@ -24989,7 +26075,6 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24989
26075
|
filterModel,
|
|
24990
26076
|
onFilterModelChange,
|
|
24991
26077
|
pagination,
|
|
24992
|
-
ControlledPagination: paginationMode == 'server' ? ServerSideControlledPagination : ControlledPagination,
|
|
24993
26078
|
paginationPlacement,
|
|
24994
26079
|
selectionStatus,
|
|
24995
26080
|
apiRef,
|
|
@@ -25003,9 +26088,17 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25003
26088
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar)
|
|
25004
26089
|
}),
|
|
25005
26090
|
filterModel: filterModel,
|
|
26091
|
+
columnVisibilityModel: columnVisibilityModel,
|
|
26092
|
+
pinnedColumns: pinnedColumns,
|
|
26093
|
+
sortModel: sortModel,
|
|
25006
26094
|
initialState: initialState,
|
|
25007
26095
|
isRowSelectable: isRowSelectable,
|
|
25008
26096
|
onFilterModelChange: onFilterModelChange,
|
|
26097
|
+
onColumnVisibilityModelChange: onColumnVisibilityModelChange
|
|
26098
|
+
// onColumnWidthChange={onColumnWidthChange}
|
|
26099
|
+
,
|
|
26100
|
+
onPinnedColumnsChange: onPinnedColumnsChange,
|
|
26101
|
+
onSortModelChange: onSortModelChange,
|
|
25009
26102
|
pagination: pagination,
|
|
25010
26103
|
paginationMode: paginationMode,
|
|
25011
26104
|
keepNonExistentRowsSelected: paginationMode == 'server',
|
|
@@ -25016,31 +26109,31 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25016
26109
|
rowSelectionModel: rowSelectionModel,
|
|
25017
26110
|
onRowSelectionModelChange: (newSelectionModel, details) => {
|
|
25018
26111
|
if (pagination && paginationMode != 'server') {
|
|
25019
|
-
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(
|
|
26112
|
+
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref6 => {
|
|
25020
26113
|
let {
|
|
25021
26114
|
model
|
|
25022
|
-
} =
|
|
26115
|
+
} = _ref6;
|
|
25023
26116
|
return isRowSelectable({
|
|
25024
26117
|
row: model
|
|
25025
26118
|
});
|
|
25026
|
-
}).map(
|
|
26119
|
+
}).map(_ref7 => {
|
|
25027
26120
|
let {
|
|
25028
26121
|
id
|
|
25029
|
-
} =
|
|
26122
|
+
} = _ref7;
|
|
25030
26123
|
return id;
|
|
25031
26124
|
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
25032
26125
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
25033
|
-
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(
|
|
26126
|
+
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref8 => {
|
|
25034
26127
|
let {
|
|
25035
26128
|
model
|
|
25036
|
-
} =
|
|
26129
|
+
} = _ref8;
|
|
25037
26130
|
return isRowSelectable({
|
|
25038
26131
|
row: model
|
|
25039
26132
|
});
|
|
25040
|
-
}).map(
|
|
26133
|
+
}).map(_ref9 => {
|
|
25041
26134
|
let {
|
|
25042
26135
|
id
|
|
25043
|
-
} =
|
|
26136
|
+
} = _ref9;
|
|
25044
26137
|
return id;
|
|
25045
26138
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
25046
26139
|
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
@@ -25146,5 +26239,5 @@ const TextCell = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25146
26239
|
TextCell.className = CLASSNAME;
|
|
25147
26240
|
TextCell.displayName = COMPONENT_NAME;
|
|
25148
26241
|
|
|
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$
|
|
26242
|
+
export { CATEGORIES, CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DIMENSION_MODEL_KEY, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DataGrid, ENDS_WITH_ANY_OF, FILTER_MODEL_KEY, FILTER_SEARCH_KEY, GridToolbarFilterSemanticField, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, PAGINATION_MODEL_KEY, PINNED_COLUMNS, SORT_MODEL_KEY, STARTS_WITH_ANY_OF, TextCell, Toolbar$2 as Toolbar, VISIBILITY_MODEL_KEY, areFilterModelsEquivalent, buildStorageKey, clearPreviousVersionStorage, customColumnTypes, decodeValue, encodeValue, getColumnVisibilityFromString, getCompletion, getFilterModelFromString, getFinalSearch, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, getModelsParsedOrUpdateLocalStorage, getPinnedColumnsFromString, getRsNumberColumnType, getRsStringColumnType, getSearchParamsFromColumnVisibility, getSearchParamsFromFilterModel, getSearchParamsFromPinnedColumns, getSearchParamsFromSorting, getSearchParamsFromTab, getSortingFromString, isOperatorValueValid, isValueValid, numberOperatorDecoder, numberOperatorEncoder, operatorList, updateUrl, urlSearchParamsToString };
|
|
25150
26243
|
//# sourceMappingURL=index.js.map
|