@redsift/table 10.8.2 → 11.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +38 -2
- package/index.js +1174 -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, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, GridLogicOperator, GRID_CHECKBOX_SELECTION_COL_DEF, useGridApiRef, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, DataGridPro } from '@mui/x-data-grid-pro';
|
|
2
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,23 @@ 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
|
+
};
|
|
17820
17878
|
|
|
17821
17879
|
const API_URL = 'https://api.openai.com/v1/chat/completions';
|
|
17822
17880
|
async function getCompletion(text, role, openai_api_key) {
|
|
@@ -21921,7 +21979,7 @@ const StyledGridToolbarFilterSemanticField = styled$3.form`
|
|
|
21921
21979
|
}
|
|
21922
21980
|
`;
|
|
21923
21981
|
|
|
21924
|
-
const _excluded$
|
|
21982
|
+
const _excluded$f = ["className", "nlpFilterConfig", "onFilterModelChange", "dateFormat", "defaultModel", "defaultFilter", "disablePower", "localeText"];
|
|
21925
21983
|
const COMPONENT_NAME$2 = 'GridToolbarFilterSemanticField';
|
|
21926
21984
|
const CLASSNAME$2 = 'redsift-datagrid-toolbar-nlp-filter-field';
|
|
21927
21985
|
const DEFAULT_OPERATORS = {
|
|
@@ -22006,7 +22064,7 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22006
22064
|
disablePower = false,
|
|
22007
22065
|
localeText
|
|
22008
22066
|
} = props,
|
|
22009
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22067
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$f);
|
|
22010
22068
|
const {
|
|
22011
22069
|
textLabel,
|
|
22012
22070
|
textPlaceholder,
|
|
@@ -22101,7 +22159,7 @@ GridToolbarFilterSemanticField.displayName = COMPONENT_NAME$2;
|
|
|
22101
22159
|
|
|
22102
22160
|
/** ------ */
|
|
22103
22161
|
|
|
22104
|
-
const Toolbar$
|
|
22162
|
+
const Toolbar$2 = props => {
|
|
22105
22163
|
const {
|
|
22106
22164
|
hasExportButton = true,
|
|
22107
22165
|
exportButtonProps,
|
|
@@ -22154,7 +22212,7 @@ const Toolbar$3 = props => {
|
|
|
22154
22212
|
}, semanticFilterProps ? /*#__PURE__*/React__default.createElement(GridToolbarFilterSemanticField, semanticFilterProps) : null)));
|
|
22155
22213
|
};
|
|
22156
22214
|
|
|
22157
|
-
const _excluded$
|
|
22215
|
+
const _excluded$e = ["displayName"];
|
|
22158
22216
|
const muiIconToDSIcon = {
|
|
22159
22217
|
ColumnFilteredIcon: mdiFilterVariant,
|
|
22160
22218
|
ColumnSelectorIcon: mdiViewColumn,
|
|
@@ -22172,7 +22230,7 @@ const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22172
22230
|
const {
|
|
22173
22231
|
displayName
|
|
22174
22232
|
} = props,
|
|
22175
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22233
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$e);
|
|
22176
22234
|
return /*#__PURE__*/React__default.createElement(Icon, _extends$2({}, forwardedProps, forwardedProps.inputProps, {
|
|
22177
22235
|
ref: ref,
|
|
22178
22236
|
size: forwardedProps.fontSize,
|
|
@@ -22180,7 +22238,7 @@ const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22180
22238
|
}));
|
|
22181
22239
|
});
|
|
22182
22240
|
|
|
22183
|
-
const _excluded$
|
|
22241
|
+
const _excluded$d = ["children", "color", "onClick", "startIcon"];
|
|
22184
22242
|
const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
22185
22243
|
var _props$className;
|
|
22186
22244
|
const {
|
|
@@ -22189,7 +22247,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22189
22247
|
onClick,
|
|
22190
22248
|
startIcon
|
|
22191
22249
|
} = props,
|
|
22192
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22250
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$d);
|
|
22193
22251
|
const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
|
|
22194
22252
|
if ((_props$className = props.className) !== null && _props$className !== void 0 && _props$className.includes('redsift-condensed')) {
|
|
22195
22253
|
return /*#__PURE__*/React__default.createElement(IconButton$2, _extends$2({}, forwardedProps, {
|
|
@@ -22215,7 +22273,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22215
22273
|
}), children);
|
|
22216
22274
|
});
|
|
22217
22275
|
|
|
22218
|
-
const _excluded$
|
|
22276
|
+
const _excluded$c = ["checked", "indeterminate", "disabled", "onChange"];
|
|
22219
22277
|
const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
22220
22278
|
const {
|
|
22221
22279
|
checked,
|
|
@@ -22223,7 +22281,7 @@ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22223
22281
|
disabled,
|
|
22224
22282
|
onChange
|
|
22225
22283
|
} = props,
|
|
22226
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22284
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$c);
|
|
22227
22285
|
return /*#__PURE__*/React__default.createElement(Checkbox, _extends$2({}, forwardedProps, forwardedProps.inputProps, {
|
|
22228
22286
|
isSelected: checked && !indeterminate,
|
|
22229
22287
|
isDisabled: disabled,
|
|
@@ -22233,7 +22291,7 @@ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22233
22291
|
}));
|
|
22234
22292
|
});
|
|
22235
22293
|
|
|
22236
|
-
const _excluded$
|
|
22294
|
+
const _excluded$b = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
|
|
22237
22295
|
const PopperRoot = styled$1(BasePopper$1, {
|
|
22238
22296
|
name: 'MuiPopper',
|
|
22239
22297
|
slot: 'Root',
|
|
@@ -22276,7 +22334,7 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
|
22276
22334
|
slots,
|
|
22277
22335
|
slotProps
|
|
22278
22336
|
} = props,
|
|
22279
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
22337
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$b);
|
|
22280
22338
|
const RootComponent = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components == null ? void 0 : components.Root;
|
|
22281
22339
|
const otherProps = _extends$1({
|
|
22282
22340
|
anchorEl,
|
|
@@ -22516,7 +22574,7 @@ process.env.NODE_ENV !== "production" ? Ripple.propTypes = {
|
|
|
22516
22574
|
const touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);
|
|
22517
22575
|
var touchRippleClasses$1 = touchRippleClasses;
|
|
22518
22576
|
|
|
22519
|
-
const _excluded$
|
|
22577
|
+
const _excluded$a = ["center", "classes", "className"];
|
|
22520
22578
|
let _ = t => t,
|
|
22521
22579
|
_t,
|
|
22522
22580
|
_t2,
|
|
@@ -22645,7 +22703,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
|
|
|
22645
22703
|
classes = {},
|
|
22646
22704
|
className
|
|
22647
22705
|
} = props,
|
|
22648
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
22706
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$a);
|
|
22649
22707
|
const [ripples, setRipples] = React.useState([]);
|
|
22650
22708
|
const nextKey = React.useRef(0);
|
|
22651
22709
|
const rippleCallback = React.useRef(null);
|
|
@@ -22846,7 +22904,7 @@ function getButtonBaseUtilityClass(slot) {
|
|
|
22846
22904
|
const buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);
|
|
22847
22905
|
var buttonBaseClasses$1 = buttonBaseClasses;
|
|
22848
22906
|
|
|
22849
|
-
const _excluded$
|
|
22907
|
+
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
22908
|
const useUtilityClasses$5 = ownerState => {
|
|
22851
22909
|
const {
|
|
22852
22910
|
disabled,
|
|
@@ -22948,7 +23006,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
22948
23006
|
touchRippleRef,
|
|
22949
23007
|
type
|
|
22950
23008
|
} = props,
|
|
22951
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
23009
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$9);
|
|
22952
23010
|
const buttonRef = React.useRef(null);
|
|
22953
23011
|
const rippleRef = React.useRef(null);
|
|
22954
23012
|
const handleRippleRef = useForkRef(rippleRef, touchRippleRef);
|
|
@@ -23321,7 +23379,7 @@ function getMenuItemUtilityClass(slot) {
|
|
|
23321
23379
|
const menuItemClasses = generateUtilityClasses('MuiMenuItem', ['root', 'focusVisible', 'dense', 'disabled', 'divider', 'gutters', 'selected']);
|
|
23322
23380
|
var menuItemClasses$1 = menuItemClasses;
|
|
23323
23381
|
|
|
23324
|
-
const _excluded$
|
|
23382
|
+
const _excluded$8 = ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex", "className"];
|
|
23325
23383
|
const overridesResolver = (props, styles) => {
|
|
23326
23384
|
const {
|
|
23327
23385
|
ownerState
|
|
@@ -23443,7 +23501,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
|
|
|
23443
23501
|
tabIndex: tabIndexProp,
|
|
23444
23502
|
className
|
|
23445
23503
|
} = props,
|
|
23446
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
23504
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$8);
|
|
23447
23505
|
const context = React.useContext(ListContext$1);
|
|
23448
23506
|
const childContext = React.useMemo(() => ({
|
|
23449
23507
|
dense: dense || context.dense || false,
|
|
@@ -23586,7 +23644,7 @@ function getTableCellUtilityClass(slot) {
|
|
|
23586
23644
|
const tableCellClasses = generateUtilityClasses('MuiTableCell', ['root', 'head', 'body', 'footer', 'sizeSmall', 'sizeMedium', 'paddingCheckbox', 'paddingNone', 'alignLeft', 'alignCenter', 'alignRight', 'alignJustify', 'stickyHeader']);
|
|
23587
23645
|
var tableCellClasses$1 = tableCellClasses;
|
|
23588
23646
|
|
|
23589
|
-
const _excluded$
|
|
23647
|
+
const _excluded$7 = ["align", "className", "component", "padding", "scope", "size", "sortDirection", "variant"];
|
|
23590
23648
|
const useUtilityClasses$3 = ownerState => {
|
|
23591
23649
|
const {
|
|
23592
23650
|
classes,
|
|
@@ -23683,7 +23741,7 @@ const TableCell = /*#__PURE__*/React.forwardRef(function TableCell(inProps, ref)
|
|
|
23683
23741
|
sortDirection,
|
|
23684
23742
|
variant: variantProp
|
|
23685
23743
|
} = props,
|
|
23686
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
23744
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$7);
|
|
23687
23745
|
const table = React.useContext(TableContext$1);
|
|
23688
23746
|
const tablelvl2 = React.useContext(Tablelvl2Context$1);
|
|
23689
23747
|
const isHeadCell = tablelvl2 && tablelvl2.variant === 'head';
|
|
@@ -23790,7 +23848,7 @@ function getToolbarUtilityClass(slot) {
|
|
|
23790
23848
|
}
|
|
23791
23849
|
generateUtilityClasses('MuiToolbar', ['root', 'gutters', 'regular', 'dense']);
|
|
23792
23850
|
|
|
23793
|
-
const _excluded$
|
|
23851
|
+
const _excluded$6 = ["className", "component", "disableGutters", "variant"];
|
|
23794
23852
|
const useUtilityClasses$2 = ownerState => {
|
|
23795
23853
|
const {
|
|
23796
23854
|
classes,
|
|
@@ -23831,7 +23889,7 @@ const ToolbarRoot = styled$1('div', {
|
|
|
23831
23889
|
theme,
|
|
23832
23890
|
ownerState
|
|
23833
23891
|
}) => ownerState.variant === 'regular' && theme.mixins.toolbar);
|
|
23834
|
-
const Toolbar
|
|
23892
|
+
const Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
|
|
23835
23893
|
const props = useThemeProps({
|
|
23836
23894
|
props: inProps,
|
|
23837
23895
|
name: 'MuiToolbar'
|
|
@@ -23842,7 +23900,7 @@ const Toolbar$1 = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
|
|
|
23842
23900
|
disableGutters = false,
|
|
23843
23901
|
variant = 'regular'
|
|
23844
23902
|
} = props,
|
|
23845
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
23903
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$6);
|
|
23846
23904
|
const ownerState = _extends$1({}, props, {
|
|
23847
23905
|
component,
|
|
23848
23906
|
disableGutters,
|
|
@@ -23856,7 +23914,7 @@ const Toolbar$1 = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
|
|
|
23856
23914
|
ownerState: ownerState
|
|
23857
23915
|
}, other));
|
|
23858
23916
|
});
|
|
23859
|
-
process.env.NODE_ENV !== "production" ? Toolbar
|
|
23917
|
+
process.env.NODE_ENV !== "production" ? Toolbar.propTypes /* remove-proptypes */ = {
|
|
23860
23918
|
// ----------------------------- Warning --------------------------------
|
|
23861
23919
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
23862
23920
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -23894,7 +23952,7 @@ process.env.NODE_ENV !== "production" ? Toolbar$1.propTypes /* remove-proptypes
|
|
|
23894
23952
|
*/
|
|
23895
23953
|
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['dense', 'regular']), PropTypes.string])
|
|
23896
23954
|
} : void 0;
|
|
23897
|
-
var Toolbar$
|
|
23955
|
+
var Toolbar$1 = Toolbar;
|
|
23898
23956
|
|
|
23899
23957
|
var KeyboardArrowLeft = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
23900
23958
|
d: "M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"
|
|
@@ -23910,7 +23968,7 @@ function getIconButtonUtilityClass(slot) {
|
|
|
23910
23968
|
const iconButtonClasses = generateUtilityClasses('MuiIconButton', ['root', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning', 'edgeStart', 'edgeEnd', 'sizeSmall', 'sizeMedium', 'sizeLarge']);
|
|
23911
23969
|
var iconButtonClasses$1 = iconButtonClasses;
|
|
23912
23970
|
|
|
23913
|
-
const _excluded$
|
|
23971
|
+
const _excluded$5 = ["edge", "children", "className", "color", "disabled", "disableFocusRipple", "size"];
|
|
23914
23972
|
const useUtilityClasses$1 = ownerState => {
|
|
23915
23973
|
const {
|
|
23916
23974
|
classes,
|
|
@@ -24011,7 +24069,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
24011
24069
|
disableFocusRipple = false,
|
|
24012
24070
|
size = 'medium'
|
|
24013
24071
|
} = props,
|
|
24014
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
24072
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$5);
|
|
24015
24073
|
const ownerState = _extends$1({}, props, {
|
|
24016
24074
|
edge,
|
|
24017
24075
|
color,
|
|
@@ -24109,7 +24167,7 @@ var FirstPageIcon = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
|
24109
24167
|
}), 'FirstPage');
|
|
24110
24168
|
|
|
24111
24169
|
var _LastPageIcon, _FirstPageIcon, _KeyboardArrowRight, _KeyboardArrowLeft, _KeyboardArrowLeft2, _KeyboardArrowRight2, _FirstPageIcon2, _LastPageIcon2;
|
|
24112
|
-
const _excluded$
|
|
24170
|
+
const _excluded$4 = ["backIconButtonProps", "count", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton"];
|
|
24113
24171
|
const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginationActions(props, ref) {
|
|
24114
24172
|
const {
|
|
24115
24173
|
backIconButtonProps,
|
|
@@ -24122,7 +24180,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
24122
24180
|
showFirstButton,
|
|
24123
24181
|
showLastButton
|
|
24124
24182
|
} = props,
|
|
24125
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
24183
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$4);
|
|
24126
24184
|
const theme = useTheme();
|
|
24127
24185
|
const handleFirstPageButtonClick = event => {
|
|
24128
24186
|
onPageChange(event, 0);
|
|
@@ -24226,7 +24284,7 @@ const tablePaginationClasses = generateUtilityClasses('MuiTablePagination', ['ro
|
|
|
24226
24284
|
var tablePaginationClasses$1 = tablePaginationClasses;
|
|
24227
24285
|
|
|
24228
24286
|
var _InputBase;
|
|
24229
|
-
const _excluded$
|
|
24287
|
+
const _excluded$3 = ["ActionsComponent", "backIconButtonProps", "className", "colSpan", "component", "count", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton"];
|
|
24230
24288
|
const TablePaginationRoot = styled$1(TableCell$1, {
|
|
24231
24289
|
name: 'MuiTablePagination',
|
|
24232
24290
|
slot: 'Root',
|
|
@@ -24242,7 +24300,7 @@ const TablePaginationRoot = styled$1(TableCell$1, {
|
|
|
24242
24300
|
padding: 0
|
|
24243
24301
|
}
|
|
24244
24302
|
}));
|
|
24245
|
-
const TablePaginationToolbar = styled$1(Toolbar$
|
|
24303
|
+
const TablePaginationToolbar = styled$1(Toolbar$1, {
|
|
24246
24304
|
name: 'MuiTablePagination',
|
|
24247
24305
|
slot: 'Toolbar',
|
|
24248
24306
|
overridesResolver: (props, styles) => _extends$1({
|
|
@@ -24373,7 +24431,7 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
24373
24431
|
showFirstButton = false,
|
|
24374
24432
|
showLastButton = false
|
|
24375
24433
|
} = props,
|
|
24376
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
24434
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$3);
|
|
24377
24435
|
const ownerState = props;
|
|
24378
24436
|
const classes = useUtilityClasses(ownerState);
|
|
24379
24437
|
const MenuItemComponent = SelectProps.native ? 'option' : TablePaginationMenuItem;
|
|
@@ -24592,10 +24650,47 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
24592
24650
|
} : void 0;
|
|
24593
24651
|
var TablePagination$1 = TablePagination;
|
|
24594
24652
|
|
|
24595
|
-
const
|
|
24596
|
-
|
|
24597
|
-
|
|
24598
|
-
|
|
24653
|
+
const ServerSideControlledPagination = _ref => {
|
|
24654
|
+
let {
|
|
24655
|
+
selectionStatus,
|
|
24656
|
+
displaySelection,
|
|
24657
|
+
displayPagination,
|
|
24658
|
+
paginationModel,
|
|
24659
|
+
onPaginationModelChange,
|
|
24660
|
+
pageSizeOptions,
|
|
24661
|
+
displayRowsPerPage,
|
|
24662
|
+
paginationProps,
|
|
24663
|
+
rowCount
|
|
24664
|
+
} = _ref;
|
|
24665
|
+
const totalNumberOfRowsInTable = rowCount;
|
|
24666
|
+
const totalRowsLabel = `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`;
|
|
24667
|
+
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)` : ''}.`;
|
|
24668
|
+
return /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
24669
|
+
flexDirection: "row",
|
|
24670
|
+
alignItems: "center",
|
|
24671
|
+
justifyContent: "space-between",
|
|
24672
|
+
marginBottom: "7px"
|
|
24673
|
+
}, displaySelection ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, selectionStatus.type === 'page' && selectionStatus.numberOfSelectedRowsInPage != 0 ? /*#__PURE__*/React__default.createElement(Text, {
|
|
24674
|
+
fontSize: "14px"
|
|
24675
|
+
}, pageRowsLabel) : selectionStatus.type === 'other' ? /*#__PURE__*/React__default.createElement(Text, {
|
|
24676
|
+
fontSize: "14px"
|
|
24677
|
+
}, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
|
|
24678
|
+
component: "div",
|
|
24679
|
+
count: totalNumberOfRowsInTable,
|
|
24680
|
+
page: paginationModel.page,
|
|
24681
|
+
onPageChange: (event, page) => onPaginationModelChange({
|
|
24682
|
+
page,
|
|
24683
|
+
pageSize: paginationModel.pageSize
|
|
24684
|
+
}),
|
|
24685
|
+
rowsPerPage: paginationModel.pageSize,
|
|
24686
|
+
onRowsPerPageChange: event => onPaginationModelChange({
|
|
24687
|
+
page: paginationModel.page,
|
|
24688
|
+
pageSize: parseInt(event.target.value, 10)
|
|
24689
|
+
}),
|
|
24690
|
+
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
24691
|
+
}, paginationProps)) : null);
|
|
24692
|
+
};
|
|
24693
|
+
|
|
24599
24694
|
const getSelectableRowsInTable = (apiRef, isRowSelectable) => {
|
|
24600
24695
|
return isRowSelectable && typeof isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref => {
|
|
24601
24696
|
let {
|
|
@@ -24663,54 +24758,15 @@ const ControlledPagination = _ref3 => {
|
|
|
24663
24758
|
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
24664
24759
|
}, paginationProps)) : null);
|
|
24665
24760
|
};
|
|
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 => {
|
|
24761
|
+
|
|
24762
|
+
const _excluded$2 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "paginationModel", "onPaginationModelChange", "pageSizeOptions", "paginationProps", "paginationMode", "rowCount"];
|
|
24763
|
+
const ToolbarWrapper = _ref => {
|
|
24707
24764
|
let {
|
|
24708
24765
|
hideToolbar,
|
|
24709
24766
|
RenderedToolbar,
|
|
24710
24767
|
filterModel,
|
|
24711
24768
|
onFilterModelChange,
|
|
24712
24769
|
pagination,
|
|
24713
|
-
ControlledPagination,
|
|
24714
24770
|
paginationPlacement,
|
|
24715
24771
|
selectionStatus,
|
|
24716
24772
|
apiRef,
|
|
@@ -24721,8 +24777,8 @@ const Toolbar = _ref5 => {
|
|
|
24721
24777
|
paginationProps,
|
|
24722
24778
|
paginationMode = 'client',
|
|
24723
24779
|
rowCount
|
|
24724
|
-
} =
|
|
24725
|
-
forwardedProps = _objectWithoutProperties(
|
|
24780
|
+
} = _ref,
|
|
24781
|
+
forwardedProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
24726
24782
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !hideToolbar ? /*#__PURE__*/React__default.createElement(RenderedToolbar, _extends$2({}, forwardedProps, {
|
|
24727
24783
|
filterModel: filterModel,
|
|
24728
24784
|
onFilterModelChange: onFilterModelChange
|
|
@@ -24749,18 +24805,871 @@ const Toolbar = _ref5 => {
|
|
|
24749
24805
|
paginationProps: paginationProps
|
|
24750
24806
|
}) : null);
|
|
24751
24807
|
};
|
|
24808
|
+
|
|
24809
|
+
const PAGINATION_MODEL_KEY = 'paginationModel';
|
|
24810
|
+
const FILTER_MODEL_KEY = 'filterModel';
|
|
24811
|
+
const SORT_MODEL_KEY = 'sortModel';
|
|
24812
|
+
const VISIBILITY_MODEL_KEY = 'visibilityModel';
|
|
24813
|
+
const PINNED_COLUMNS = 'pinnedColumns';
|
|
24814
|
+
const DIMENSION_MODEL_KEY = 'dimension';
|
|
24815
|
+
const FILTER_SEARCH_KEY = 'searchModel';
|
|
24816
|
+
const buildStorageKey = _ref => {
|
|
24817
|
+
let {
|
|
24818
|
+
id,
|
|
24819
|
+
version,
|
|
24820
|
+
category
|
|
24821
|
+
} = _ref;
|
|
24822
|
+
return `${id}:${version}:${category}`;
|
|
24823
|
+
};
|
|
24824
|
+
const clearPreviousVersionStorage = (id, currentVersion) => {
|
|
24825
|
+
const previousVersion = currentVersion - 1;
|
|
24826
|
+
if (previousVersion < 1) {
|
|
24827
|
+
return;
|
|
24828
|
+
}
|
|
24829
|
+
const keysToDelete = [buildStorageKey({
|
|
24830
|
+
id,
|
|
24831
|
+
version: previousVersion,
|
|
24832
|
+
category: PAGINATION_MODEL_KEY
|
|
24833
|
+
}), buildStorageKey({
|
|
24834
|
+
id,
|
|
24835
|
+
version: previousVersion,
|
|
24836
|
+
category: SORT_MODEL_KEY
|
|
24837
|
+
}), buildStorageKey({
|
|
24838
|
+
id,
|
|
24839
|
+
version: previousVersion,
|
|
24840
|
+
category: FILTER_MODEL_KEY
|
|
24841
|
+
}), buildStorageKey({
|
|
24842
|
+
id,
|
|
24843
|
+
version: previousVersion,
|
|
24844
|
+
category: VISIBILITY_MODEL_KEY
|
|
24845
|
+
}), buildStorageKey({
|
|
24846
|
+
id,
|
|
24847
|
+
version: previousVersion,
|
|
24848
|
+
category: PINNED_COLUMNS
|
|
24849
|
+
}), buildStorageKey({
|
|
24850
|
+
id,
|
|
24851
|
+
version: previousVersion,
|
|
24852
|
+
category: FILTER_SEARCH_KEY
|
|
24853
|
+
}), buildStorageKey({
|
|
24854
|
+
id,
|
|
24855
|
+
version: previousVersion,
|
|
24856
|
+
category: DIMENSION_MODEL_KEY
|
|
24857
|
+
})];
|
|
24858
|
+
for (const keyToDelete of keysToDelete) {
|
|
24859
|
+
try {
|
|
24860
|
+
window.localStorage.removeItem(keyToDelete);
|
|
24861
|
+
} catch (e) {
|
|
24862
|
+
// Ignore
|
|
24863
|
+
}
|
|
24864
|
+
}
|
|
24865
|
+
};
|
|
24866
|
+
|
|
24867
|
+
// Get and Set data from LocalStorage WITHOUT useState
|
|
24868
|
+
|
|
24869
|
+
// triggering a state update and consecutive re-render
|
|
24870
|
+
const useFetchState = (defaultValue, key) => {
|
|
24871
|
+
let stickyValue = null;
|
|
24872
|
+
try {
|
|
24873
|
+
stickyValue = window.localStorage.getItem(key);
|
|
24874
|
+
} catch (e) {
|
|
24875
|
+
console.error('StatefulDataGrid: error getting item from local storage: ', e);
|
|
24876
|
+
}
|
|
24877
|
+
let parsedValue = stickyValue !== null && stickyValue !== undefined && stickyValue !== 'undefined' ? JSON.parse(stickyValue) : defaultValue;
|
|
24878
|
+
|
|
24879
|
+
// TODO: temporary workaround to avoid clashes when someone had sorting on the now-removed screenshot field (renamed to num_annotations)
|
|
24880
|
+
// 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
|
|
24881
|
+
if (parsedValue instanceof Array) {
|
|
24882
|
+
const fields = (parsedValue || []).map(item => item.field);
|
|
24883
|
+
if (fields.includes('screenshot') || fields.includes('diffs')) {
|
|
24884
|
+
parsedValue = defaultValue;
|
|
24885
|
+
}
|
|
24886
|
+
}
|
|
24887
|
+
const updateValue = useCallback(value => {
|
|
24888
|
+
try {
|
|
24889
|
+
window.localStorage.setItem(key, JSON.stringify(value));
|
|
24890
|
+
} catch (e) {
|
|
24891
|
+
console.error('StatefulDataGrid: error setting item into local storage: ', e);
|
|
24892
|
+
}
|
|
24893
|
+
}, [key]);
|
|
24894
|
+
return [parsedValue, updateValue];
|
|
24895
|
+
};
|
|
24896
|
+
|
|
24897
|
+
function useLocalStorage(key, defaultValue) {
|
|
24898
|
+
const [value, setValue] = useState(() => {
|
|
24899
|
+
let currentValue;
|
|
24900
|
+
try {
|
|
24901
|
+
currentValue = JSON.parse(localStorage.getItem(key) || String(defaultValue));
|
|
24902
|
+
} catch (error) {
|
|
24903
|
+
currentValue = defaultValue;
|
|
24904
|
+
}
|
|
24905
|
+
return currentValue;
|
|
24906
|
+
});
|
|
24907
|
+
useEffect(() => {
|
|
24908
|
+
try {
|
|
24909
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
24910
|
+
} catch (e) {
|
|
24911
|
+
console.error('local-storage: error setting item into local storage: ', e);
|
|
24912
|
+
}
|
|
24913
|
+
}, [value, key]);
|
|
24914
|
+
return [value, setValue];
|
|
24915
|
+
}
|
|
24916
|
+
|
|
24917
|
+
const useTableStates = (id, version, customDefaults) => {
|
|
24918
|
+
const [paginationModel, setPaginationModel] = useLocalStorage(buildStorageKey({
|
|
24919
|
+
id,
|
|
24920
|
+
version,
|
|
24921
|
+
category: PAGINATION_MODEL_KEY
|
|
24922
|
+
}), {
|
|
24923
|
+
page: 0,
|
|
24924
|
+
pageSize: 10
|
|
24925
|
+
});
|
|
24926
|
+
const [sortModel, setSortModel] = useFetchState(customDefaults && customDefaults[SORT_MODEL_KEY] ? customDefaults[SORT_MODEL_KEY] : '', buildStorageKey({
|
|
24927
|
+
id,
|
|
24928
|
+
version,
|
|
24929
|
+
category: SORT_MODEL_KEY
|
|
24930
|
+
}));
|
|
24931
|
+
const [localStorageFilters, setLocalStorageFilters] = useFetchState('', buildStorageKey({
|
|
24932
|
+
id,
|
|
24933
|
+
version,
|
|
24934
|
+
category: FILTER_SEARCH_KEY
|
|
24935
|
+
}));
|
|
24936
|
+
const [visibilityModelLocalStorage, setVisibilityModelLocalStorage] = useFetchState('', buildStorageKey({
|
|
24937
|
+
id,
|
|
24938
|
+
version,
|
|
24939
|
+
category: VISIBILITY_MODEL_KEY
|
|
24940
|
+
}));
|
|
24941
|
+
const [pinnedColumns, setPinnedColumns] = useFetchState(customDefaults ? customDefaults[PINNED_COLUMNS] : '_pinnedColumnsLeft=[]&_pinnedColumnsRight=[]', buildStorageKey({
|
|
24942
|
+
id,
|
|
24943
|
+
version,
|
|
24944
|
+
category: PINNED_COLUMNS
|
|
24945
|
+
}));
|
|
24946
|
+
const [dimensionModel, setDimensionModel] = useFetchState({}, buildStorageKey({
|
|
24947
|
+
id,
|
|
24948
|
+
version,
|
|
24949
|
+
category: DIMENSION_MODEL_KEY
|
|
24950
|
+
}));
|
|
24951
|
+
return {
|
|
24952
|
+
paginationModel,
|
|
24953
|
+
setPaginationModel,
|
|
24954
|
+
sortModel,
|
|
24955
|
+
setSortModel,
|
|
24956
|
+
localStorageFilters,
|
|
24957
|
+
setLocalStorageFilters,
|
|
24958
|
+
visibilityModelLocalStorage,
|
|
24959
|
+
setVisibilityModelLocalStorage,
|
|
24960
|
+
pinnedColumns,
|
|
24961
|
+
setPinnedColumns,
|
|
24962
|
+
dimensionModel,
|
|
24963
|
+
setDimensionModel
|
|
24964
|
+
};
|
|
24965
|
+
};
|
|
24966
|
+
|
|
24967
|
+
const urlSearchParamsToString = searchParams => {
|
|
24968
|
+
let searchString = '';
|
|
24969
|
+
for (const [key, value] of searchParams) {
|
|
24970
|
+
searchString = searchString + `${key}=${value}&`;
|
|
24971
|
+
}
|
|
24972
|
+
return searchString.slice(0, searchString.length - 1);
|
|
24973
|
+
};
|
|
24974
|
+
|
|
24975
|
+
// reference value: https://www.w3schools.com/tags/ref_urlencode.ASP
|
|
24976
|
+
const DECODER = {
|
|
24977
|
+
'%20': ' ',
|
|
24978
|
+
'%26': '&',
|
|
24979
|
+
'%3D': '=',
|
|
24980
|
+
'%3F': '?',
|
|
24981
|
+
'%5B': '[',
|
|
24982
|
+
'%5D': ']',
|
|
24983
|
+
'%2C': ',',
|
|
24984
|
+
'%3C': '<',
|
|
24985
|
+
'%3E': '>',
|
|
24986
|
+
'%21': '!',
|
|
24987
|
+
'%22': '"'
|
|
24988
|
+
};
|
|
24989
|
+
const ENCODER = {
|
|
24990
|
+
' ': '%20',
|
|
24991
|
+
'&': '%26',
|
|
24992
|
+
'=': '%3D',
|
|
24993
|
+
'?': '%3F',
|
|
24994
|
+
'[': '%5B',
|
|
24995
|
+
']': '%5D',
|
|
24996
|
+
',': '%2C',
|
|
24997
|
+
'<': '%3C',
|
|
24998
|
+
'>': '%3E',
|
|
24999
|
+
'!': '%21',
|
|
25000
|
+
'"': '%22'
|
|
25001
|
+
};
|
|
25002
|
+
const decodeValue = value => {
|
|
25003
|
+
if (value === '') {
|
|
25004
|
+
return '';
|
|
25005
|
+
}
|
|
25006
|
+
const re = new RegExp(Object.keys(DECODER).reduce((acc, curr) => `${acc}|${curr}`), 'g');
|
|
25007
|
+
// decodeValue for lists:
|
|
25008
|
+
if (value.startsWith('list[')) {
|
|
25009
|
+
const arrayValues = value.split('[')[1].split(']')[0];
|
|
25010
|
+
const arrayList = arrayValues.split(',').map(v => v.replace(re, encoded => DECODER[encoded])).filter(item => item);
|
|
25011
|
+
return arrayList.length > 0 ? arrayList : [];
|
|
25012
|
+
}
|
|
25013
|
+
return value.replace(re, encoded => DECODER[encoded]);
|
|
25014
|
+
};
|
|
25015
|
+
const encodeValue = value => {
|
|
25016
|
+
if (!value) {
|
|
25017
|
+
return '';
|
|
25018
|
+
}
|
|
25019
|
+
|
|
25020
|
+
// Array encoding for value:
|
|
25021
|
+
// we are representing it as list[encoded], where encoded is the list comma separated
|
|
25022
|
+
if (Array.isArray(value)) {
|
|
25023
|
+
const encodedArray = value.map(entry => {
|
|
25024
|
+
return String(entry).replace(/\s|&|=|\?|\[|\]/g, encoded => ENCODER[encoded]);
|
|
25025
|
+
}).join(',');
|
|
25026
|
+
return `list[${encodedArray}]`;
|
|
25027
|
+
}
|
|
25028
|
+
|
|
25029
|
+
// we might also pass integers
|
|
25030
|
+
const castedValue = String(value);
|
|
25031
|
+
return castedValue.replace(/\s|&|=|\?|\[|\]/g, encoded => ENCODER[encoded]);
|
|
25032
|
+
};
|
|
25033
|
+
const isOperatorValueValid = (field, operator, columns) => {
|
|
25034
|
+
const column = columns.find(column => column.field === field);
|
|
25035
|
+
if (!column) {
|
|
25036
|
+
return false;
|
|
25037
|
+
}
|
|
25038
|
+
const columnType = (column === null || column === void 0 ? void 0 : column.type) || 'string';
|
|
25039
|
+
const operators = operatorList[columnType];
|
|
25040
|
+
if (!operators) {
|
|
25041
|
+
return false;
|
|
25042
|
+
}
|
|
25043
|
+
if ('filterOperators' in operators) {
|
|
25044
|
+
return !!operators.filterOperators.find(op => op['value'] === operator);
|
|
25045
|
+
}
|
|
25046
|
+
return !!operators.find(op => op['value'] === operator);
|
|
25047
|
+
};
|
|
25048
|
+
|
|
25049
|
+
// Check if the value doesn't break
|
|
25050
|
+
const isValueValid = (value, field, columns, operator) => {
|
|
25051
|
+
var _column$type;
|
|
25052
|
+
// every field accepts undefined as value for default
|
|
25053
|
+
if (value === undefined) {
|
|
25054
|
+
return true;
|
|
25055
|
+
}
|
|
25056
|
+
|
|
25057
|
+
// isAnyOf accepts as value only lists, and we are declearing them in the
|
|
25058
|
+
// URL as `list=[...]`
|
|
25059
|
+
if (operator === 'isAnyOf') {
|
|
25060
|
+
return Array.isArray(value);
|
|
25061
|
+
}
|
|
25062
|
+
|
|
25063
|
+
// We are accepting arrays only if they are of the 'isAnyOf' type
|
|
25064
|
+
if (Array.isArray(value) && operator !== 'isAnyOf') {
|
|
25065
|
+
return false;
|
|
25066
|
+
}
|
|
25067
|
+
const column = columns.find(column => column.field === field);
|
|
25068
|
+
if (!column) {
|
|
25069
|
+
return false;
|
|
25070
|
+
}
|
|
25071
|
+
const type = (_column$type = column['type']) !== null && _column$type !== void 0 ? _column$type : 'string';
|
|
25072
|
+
|
|
25073
|
+
// Only date and rating fail with 500s, other set themselves as undefined
|
|
25074
|
+
if (type !== 'date' && type !== 'rating') {
|
|
25075
|
+
return true;
|
|
25076
|
+
}
|
|
25077
|
+
|
|
25078
|
+
// just checking that rating is a number.
|
|
25079
|
+
if (type === 'rating') {
|
|
25080
|
+
return !isNaN(Number(value));
|
|
25081
|
+
}
|
|
25082
|
+
|
|
25083
|
+
// format: YYYY-MM-DD
|
|
25084
|
+
// just verifying that the 3 values are numbers to avoid 500s,
|
|
25085
|
+
// If the value is invalid the form will appear as undefined
|
|
25086
|
+
if (type === 'date') {
|
|
25087
|
+
const dateSplitted = value.split('-');
|
|
25088
|
+
if (dateSplitted.length !== 3) {
|
|
25089
|
+
return false;
|
|
25090
|
+
}
|
|
25091
|
+
const [YYYY, MM, DD] = dateSplitted;
|
|
25092
|
+
return !isNaN(parseInt(YYYY)) && !isNaN(parseInt(MM)) && !isNaN(parseInt(DD));
|
|
25093
|
+
}
|
|
25094
|
+
return false;
|
|
25095
|
+
};
|
|
25096
|
+
|
|
25097
|
+
// example:
|
|
25098
|
+
// unicodeDomain[contains]=a&unicodeDomain[contains]=dsa&logicOperator=and&tab=ignored
|
|
25099
|
+
const getFilterModelFromString = (searchString, columns) => {
|
|
25100
|
+
if (!searchString) {
|
|
25101
|
+
return {
|
|
25102
|
+
items: [],
|
|
25103
|
+
logicOperator: GridLogicOperator.And
|
|
25104
|
+
};
|
|
25105
|
+
}
|
|
25106
|
+
let logicOperator = GridLogicOperator.And;
|
|
25107
|
+
const searchParams = new URLSearchParams();
|
|
25108
|
+
for (const [key, value] of new URLSearchParams(searchString)) {
|
|
25109
|
+
if (key.startsWith('_') && !['_logicOperator', '_sortColumn', '_pinnedColumnsLeft', '_pinnedColumnsRight', '_columnVisibility'].includes(key)) {
|
|
25110
|
+
searchParams.set(key, value);
|
|
25111
|
+
}
|
|
25112
|
+
if (key === '_logicOperator') {
|
|
25113
|
+
logicOperator = value;
|
|
25114
|
+
}
|
|
25115
|
+
}
|
|
25116
|
+
let id = 5000;
|
|
25117
|
+
const fields = columns.map(column => column.field);
|
|
25118
|
+
let isInvalid = false;
|
|
25119
|
+
const items = [];
|
|
25120
|
+
searchParams.forEach((value, key) => {
|
|
25121
|
+
if (isInvalid) {
|
|
25122
|
+
return;
|
|
25123
|
+
}
|
|
25124
|
+
const field = key.split('[')[0].slice(1); // Slice to remove the _ at the beginning
|
|
25125
|
+
if (!fields.includes(field)) {
|
|
25126
|
+
return;
|
|
25127
|
+
}
|
|
25128
|
+
const left = key.split(']')[0];
|
|
25129
|
+
if (left.split('[').length < 2) {
|
|
25130
|
+
isInvalid = true;
|
|
25131
|
+
return;
|
|
25132
|
+
}
|
|
25133
|
+
const operator = decodeValue(key.split('[')[1].split(']')[0]);
|
|
25134
|
+
// if the operator is not part of the valid operators invalidate the URL
|
|
25135
|
+
if (!isOperatorValueValid(field, operator, columns) || Array.isArray(operator)) {
|
|
25136
|
+
isInvalid = true;
|
|
25137
|
+
return;
|
|
25138
|
+
}
|
|
25139
|
+
id += 1;
|
|
25140
|
+
const decodedValue = decodeValue(value);
|
|
25141
|
+
if (!isValueValid(decodedValue, field, columns, operator)) {
|
|
25142
|
+
isInvalid = true;
|
|
25143
|
+
return;
|
|
25144
|
+
}
|
|
25145
|
+
items.push({
|
|
25146
|
+
field,
|
|
25147
|
+
operator,
|
|
25148
|
+
id,
|
|
25149
|
+
value: decodedValue
|
|
25150
|
+
});
|
|
25151
|
+
});
|
|
25152
|
+
|
|
25153
|
+
// If we found some condition that results in an invalid URL,
|
|
25154
|
+
// return the empty filterModel (this will trigger the localStorage)
|
|
25155
|
+
// and will pick up the last valid search
|
|
25156
|
+
if (isInvalid) {
|
|
25157
|
+
return {
|
|
25158
|
+
items: [],
|
|
25159
|
+
logicOperator: GridLogicOperator.And
|
|
25160
|
+
};
|
|
25161
|
+
}
|
|
25162
|
+
return {
|
|
25163
|
+
items,
|
|
25164
|
+
logicOperator
|
|
25165
|
+
};
|
|
25166
|
+
};
|
|
25167
|
+
const getSearchParamsFromFilterModel = filterModel => {
|
|
25168
|
+
const searchParams = new URLSearchParams();
|
|
25169
|
+
searchParams.set('_logicOperator', filterModel['logicOperator'] || '');
|
|
25170
|
+
filterModel['items'].forEach(item => {
|
|
25171
|
+
const {
|
|
25172
|
+
field,
|
|
25173
|
+
operator,
|
|
25174
|
+
value
|
|
25175
|
+
} = item;
|
|
25176
|
+
searchParams.set(`_${field}[${encodeValue(operator)}]`, encodeValue(value));
|
|
25177
|
+
});
|
|
25178
|
+
return searchParams;
|
|
25179
|
+
};
|
|
25180
|
+
|
|
25181
|
+
// Rules:
|
|
25182
|
+
// - if we have something in the URL, use that info
|
|
25183
|
+
// - if we don't have that, use the localStorage and update the URL
|
|
25184
|
+
// - if we don't have that, return an empty FilterModel
|
|
25185
|
+
const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFilters) => {
|
|
25186
|
+
const filterModelFromSearch = getFilterModelFromString(search, columns);
|
|
25187
|
+
if (filterModelFromSearch.items.length > 0) {
|
|
25188
|
+
const searchFromFilterModel = getSearchParamsFromFilterModel(filterModelFromSearch);
|
|
25189
|
+
if (urlSearchParamsToString(searchFromFilterModel) !== localStorageFilters) {
|
|
25190
|
+
setLocalStorageFilters(urlSearchParamsToString(searchFromFilterModel));
|
|
25191
|
+
}
|
|
25192
|
+
return filterModelFromSearch;
|
|
25193
|
+
}
|
|
25194
|
+
const filterModelFromLocalStorage = getFilterModelFromString(localStorageFilters, columns);
|
|
25195
|
+
if (filterModelFromLocalStorage) {
|
|
25196
|
+
return filterModelFromLocalStorage;
|
|
25197
|
+
}
|
|
25198
|
+
return {
|
|
25199
|
+
items: [],
|
|
25200
|
+
logicOperator: GridLogicOperator.And
|
|
25201
|
+
};
|
|
25202
|
+
};
|
|
25203
|
+
const getSortingFromString = (notParsed, columns) => {
|
|
25204
|
+
// If the string is empty return the default model
|
|
25205
|
+
if (!notParsed) {
|
|
25206
|
+
return null;
|
|
25207
|
+
}
|
|
25208
|
+
// remove the initial ? if present
|
|
25209
|
+
const parsed = notParsed[0] === '?' ? notParsed.slice(1) : notParsed;
|
|
25210
|
+
for (const item of parsed.split('&')) {
|
|
25211
|
+
const fieldURL = item.split('=')[0];
|
|
25212
|
+
if (fieldURL !== '_sortColumn') {
|
|
25213
|
+
continue;
|
|
25214
|
+
}
|
|
25215
|
+
const left = item.split(']')[0];
|
|
25216
|
+
if (left.split('[').length < 2) {
|
|
25217
|
+
continue;
|
|
25218
|
+
}
|
|
25219
|
+
const value = item.split('[')[1].split(']')[0];
|
|
25220
|
+
if (value === '') {
|
|
25221
|
+
return [];
|
|
25222
|
+
}
|
|
25223
|
+
const fields = columns.map(column => column.field);
|
|
25224
|
+
const [column, order] = value.split(',');
|
|
25225
|
+
if (fields.includes(column) && (order === 'asc' || order === 'desc')) {
|
|
25226
|
+
return [{
|
|
25227
|
+
field: column,
|
|
25228
|
+
sort: order
|
|
25229
|
+
}];
|
|
25230
|
+
}
|
|
25231
|
+
continue;
|
|
25232
|
+
}
|
|
25233
|
+
|
|
25234
|
+
// No information was found about the sorting model in the URL
|
|
25235
|
+
return null;
|
|
25236
|
+
};
|
|
25237
|
+
const getSearchParamsFromSorting = sorting => {
|
|
25238
|
+
const searchParams = new URLSearchParams();
|
|
25239
|
+
searchParams.set('_sortColumn', sorting.length > 0 && sorting[0].sort ? `[${encodeValue(sorting[0].field)},${encodeValue(sorting[0].sort)}]` : '[]');
|
|
25240
|
+
return searchParams;
|
|
25241
|
+
};
|
|
25242
|
+
|
|
25243
|
+
// Rules:
|
|
25244
|
+
// - if we have something in the URL, use that info
|
|
25245
|
+
// - if we don't have that, use the localStorage and update the URL
|
|
25246
|
+
// - if we don't have that, return an empty SortModel
|
|
25247
|
+
const getSortModel = (search, columns, localStorageSorting, setLocalStorageSorting) => {
|
|
25248
|
+
const sorting = getSortingFromString(search, columns);
|
|
25249
|
+
if (sorting) {
|
|
25250
|
+
const searchFromSortModel = getSearchParamsFromSorting(sorting);
|
|
25251
|
+
if (searchFromSortModel.toString() !== localStorageSorting) {
|
|
25252
|
+
setLocalStorageSorting(searchFromSortModel.toString());
|
|
25253
|
+
}
|
|
25254
|
+
return sorting;
|
|
25255
|
+
}
|
|
25256
|
+
const sortModelFromLocalStorage = getSortingFromString(localStorageSorting, columns);
|
|
25257
|
+
if (sortModelFromLocalStorage) {
|
|
25258
|
+
return sortModelFromLocalStorage;
|
|
25259
|
+
}
|
|
25260
|
+
return [];
|
|
25261
|
+
};
|
|
25262
|
+
const getSearchParamsFromColumnVisibility = (columnVisibility, columns) => {
|
|
25263
|
+
const searchParams = new URLSearchParams();
|
|
25264
|
+
const fields = columns.map(column => column.field);
|
|
25265
|
+
|
|
25266
|
+
// if column visibility model is empty, show all columns
|
|
25267
|
+
if (Object.keys(columnVisibility).length == 0) {
|
|
25268
|
+
searchParams.set('_columnVisibility', `[${fields.join(',')}]`);
|
|
25269
|
+
return searchParams;
|
|
25270
|
+
}
|
|
25271
|
+
const finalColumnVisibility = columns.filter(c => {
|
|
25272
|
+
var _c$hideable;
|
|
25273
|
+
return !((_c$hideable = c === null || c === void 0 ? void 0 : c.hideable) !== null && _c$hideable !== void 0 ? _c$hideable : true);
|
|
25274
|
+
}).map(c => c.field).reduce((acc, colName) => {
|
|
25275
|
+
return _objectSpread2(_objectSpread2({}, acc), {}, {
|
|
25276
|
+
[colName]: true
|
|
25277
|
+
});
|
|
25278
|
+
}, columnVisibility);
|
|
25279
|
+
const visibleColumns = Object.entries(finalColumnVisibility)
|
|
25280
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
25281
|
+
.filter(_ref => {
|
|
25282
|
+
let [_, visible] = _ref;
|
|
25283
|
+
return visible;
|
|
25284
|
+
})
|
|
25285
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
25286
|
+
.map(_ref2 => {
|
|
25287
|
+
let [column, _] = _ref2;
|
|
25288
|
+
return encodeValue(column);
|
|
25289
|
+
});
|
|
25290
|
+
searchParams.set('_columnVisibility', `[${visibleColumns.join(',')}]`);
|
|
25291
|
+
return searchParams;
|
|
25292
|
+
};
|
|
25293
|
+
const getColumnVisibilityFromString = (notParsed, tableColumns) => {
|
|
25294
|
+
if (!notParsed || notParsed.length === 1 && notParsed[0] === '?') {
|
|
25295
|
+
return null;
|
|
25296
|
+
}
|
|
25297
|
+
// remove the initial ? if present
|
|
25298
|
+
const parsed = notParsed[0] === '?' ? notParsed.slice(1) : notParsed;
|
|
25299
|
+
const visibility = {};
|
|
25300
|
+
let exist = false;
|
|
25301
|
+
let visibleColumnsCount = 0;
|
|
25302
|
+
for (const item of parsed.split('&')) {
|
|
25303
|
+
// if it's not column visibility field, skip
|
|
25304
|
+
const fieldURL = item.split('=')[0];
|
|
25305
|
+
if (fieldURL !== '_columnVisibility') {
|
|
25306
|
+
continue;
|
|
25307
|
+
}
|
|
25308
|
+
// e.g. item = _columnVisibility[abc,def]
|
|
25309
|
+
const left = item.split(']')[0];
|
|
25310
|
+
if (left.split('[').length < 2) {
|
|
25311
|
+
continue;
|
|
25312
|
+
}
|
|
25313
|
+
const encodedValues = item.split('[')[1].split(']')[0];
|
|
25314
|
+
if (typeof encodedValues !== 'string') {
|
|
25315
|
+
continue;
|
|
25316
|
+
}
|
|
25317
|
+
exist = true;
|
|
25318
|
+
const fields = tableColumns.map(column => column.field);
|
|
25319
|
+
// TODO: Add validation that , is present
|
|
25320
|
+
const columns = encodedValues.split(',').map(value => decodeValue(value));
|
|
25321
|
+
|
|
25322
|
+
// for each column, check if it's visible and add it to visibility model
|
|
25323
|
+
for (const column of fields) {
|
|
25324
|
+
const isColumnVisible = columns.includes(column);
|
|
25325
|
+
visibility[column] = isColumnVisible;
|
|
25326
|
+
if (isColumnVisible) {
|
|
25327
|
+
visibleColumnsCount += 1;
|
|
25328
|
+
}
|
|
25329
|
+
}
|
|
25330
|
+
}
|
|
25331
|
+
if (visibleColumnsCount === 0 && !exist) {
|
|
25332
|
+
return null;
|
|
25333
|
+
}
|
|
25334
|
+
return visibility;
|
|
25335
|
+
};
|
|
25336
|
+
|
|
25337
|
+
// Rules:
|
|
25338
|
+
// - if we have something in the URL, use that info
|
|
25339
|
+
// - if we don't have that, use the localStorage and update the URL
|
|
25340
|
+
// - if we don't have that, return an empty ColumnVisibilityModel (which is all columns)
|
|
25341
|
+
// NOTE: the `defaultHidden` is a custom field and not standard DataGrid
|
|
25342
|
+
// The reason is the following bug: https://github.com/mui/mui-x/issues/8407
|
|
25343
|
+
const getColumnsVisibility = (search, columns, localStorageColumnsVisibility, setLocalStorageColumnsVisibility) => {
|
|
25344
|
+
const columnVisibility = getColumnVisibilityFromString(search, columns);
|
|
25345
|
+
if (columnVisibility) {
|
|
25346
|
+
const searchColumnVisibility = getSearchParamsFromColumnVisibility(columnVisibility, columns);
|
|
25347
|
+
if (searchColumnVisibility.toString() !== localStorageColumnsVisibility) {
|
|
25348
|
+
setLocalStorageColumnsVisibility(searchColumnVisibility.toString());
|
|
25349
|
+
}
|
|
25350
|
+
return columnVisibility;
|
|
25351
|
+
}
|
|
25352
|
+
const columnVisibilityFromLocalStorage = getColumnVisibilityFromString(localStorageColumnsVisibility, columns);
|
|
25353
|
+
if (columnVisibilityFromLocalStorage) {
|
|
25354
|
+
return columnVisibilityFromLocalStorage;
|
|
25355
|
+
}
|
|
25356
|
+
|
|
25357
|
+
// No columns in URL or localStorage, just show them all expect the hidden ones
|
|
25358
|
+
const res = {};
|
|
25359
|
+
for (const column of columns) {
|
|
25360
|
+
const field = column.field;
|
|
25361
|
+
res[field] = column.defaultHidden !== true; // undefined will be true
|
|
25362
|
+
}
|
|
25363
|
+
|
|
25364
|
+
return res;
|
|
25365
|
+
};
|
|
25366
|
+
const getPinnedColumnsFromString = (notParsed, tableColumns) => {
|
|
25367
|
+
if (!notParsed || notParsed.length === 1 && notParsed[0] === '?') {
|
|
25368
|
+
return null;
|
|
25369
|
+
}
|
|
25370
|
+
// remove the initial ? if present
|
|
25371
|
+
const parsed = notParsed[0] === '?' ? notParsed.slice(1) : notParsed;
|
|
25372
|
+
const pinnedColumns = {};
|
|
25373
|
+
for (const item of parsed.split('&')) {
|
|
25374
|
+
const fieldURL = item.split('=')[0];
|
|
25375
|
+
if (fieldURL !== '_pinnedColumnsLeft' && fieldURL !== '_pinnedColumnsRight') {
|
|
25376
|
+
continue;
|
|
25377
|
+
}
|
|
25378
|
+
const left = item.split(']')[0];
|
|
25379
|
+
if (left.split('[').length < 2) {
|
|
25380
|
+
continue;
|
|
25381
|
+
}
|
|
25382
|
+
const encodedValues = item.split('[')[1].split(']')[0];
|
|
25383
|
+
if (typeof encodedValues !== 'string') {
|
|
25384
|
+
continue;
|
|
25385
|
+
}
|
|
25386
|
+
const fields = [...tableColumns.map(column => column.field), '__check__'];
|
|
25387
|
+
const columns = encodedValues.split(',').map(value => decodeValue(value)).filter(val => typeof val === 'string' && fields.includes(val));
|
|
25388
|
+
if (fieldURL === '_pinnedColumnsLeft') {
|
|
25389
|
+
pinnedColumns['left'] = columns;
|
|
25390
|
+
}
|
|
25391
|
+
if (fieldURL === '_pinnedColumnsRight') {
|
|
25392
|
+
pinnedColumns['right'] = columns;
|
|
25393
|
+
}
|
|
25394
|
+
}
|
|
25395
|
+
if (pinnedColumns.left || pinnedColumns.right) {
|
|
25396
|
+
return {
|
|
25397
|
+
left: pinnedColumns['left'] || [],
|
|
25398
|
+
right: pinnedColumns['right'] || []
|
|
25399
|
+
};
|
|
25400
|
+
}
|
|
25401
|
+
return null;
|
|
25402
|
+
};
|
|
25403
|
+
const getSearchParamsFromPinnedColumns = pinnedColumns => {
|
|
25404
|
+
var _pinnedColumns$left, _pinnedColumns$right;
|
|
25405
|
+
const searchParams = new URLSearchParams();
|
|
25406
|
+
const pinnedColumnLeft = ((_pinnedColumns$left = pinnedColumns.left) === null || _pinnedColumns$left === void 0 ? void 0 : _pinnedColumns$left.map(val => encodeValue(val))) || [];
|
|
25407
|
+
const pinnedColumnRight = ((_pinnedColumns$right = pinnedColumns.right) === null || _pinnedColumns$right === void 0 ? void 0 : _pinnedColumns$right.map(val => encodeValue(val))) || [];
|
|
25408
|
+
searchParams.set('_pinnedColumnsLeft', `[${pinnedColumnLeft.join(',')}]`);
|
|
25409
|
+
searchParams.set('_pinnedColumnsRight', `[${pinnedColumnRight.join(',')}]`);
|
|
25410
|
+
return searchParams;
|
|
25411
|
+
};
|
|
25412
|
+
|
|
25413
|
+
// Rules:
|
|
25414
|
+
// - if we have something in the URL, use that info
|
|
25415
|
+
// - if we don't have that, use the localStorage and update the URL
|
|
25416
|
+
// - if we don't have that, return an empty ColumnVisibilityModel (which is all columns)
|
|
25417
|
+
const getPinnedColumns = (search, columns, localStoragePinnedColumns, setLocalStoragePinnedColumns) => {
|
|
25418
|
+
const pinnedColumns = getPinnedColumnsFromString(search, columns);
|
|
25419
|
+
if (pinnedColumns) {
|
|
25420
|
+
const searchPinnedColumns = getSearchParamsFromPinnedColumns(pinnedColumns);
|
|
25421
|
+
if (searchPinnedColumns.toString() !== localStoragePinnedColumns) {
|
|
25422
|
+
setLocalStoragePinnedColumns(searchPinnedColumns.toString());
|
|
25423
|
+
}
|
|
25424
|
+
return pinnedColumns;
|
|
25425
|
+
}
|
|
25426
|
+
const pinnedColumnsFromLocalStorage = getPinnedColumnsFromString(localStoragePinnedColumns, columns);
|
|
25427
|
+
if (pinnedColumnsFromLocalStorage) {
|
|
25428
|
+
return pinnedColumnsFromLocalStorage;
|
|
25429
|
+
}
|
|
25430
|
+
|
|
25431
|
+
// No pinnedColumn in URL or localStorage, TODO: decide what is the default state
|
|
25432
|
+
const res = {
|
|
25433
|
+
left: [],
|
|
25434
|
+
right: []
|
|
25435
|
+
};
|
|
25436
|
+
return res;
|
|
25437
|
+
};
|
|
25438
|
+
const getSearchParamsFromTab = search => {
|
|
25439
|
+
const searchParams = new URLSearchParams();
|
|
25440
|
+
const openTab = new URLSearchParams(search).get('tab');
|
|
25441
|
+
if (openTab) {
|
|
25442
|
+
searchParams.set('tab', openTab);
|
|
25443
|
+
}
|
|
25444
|
+
return searchParams;
|
|
25445
|
+
};
|
|
25446
|
+
const getFinalSearch = _ref3 => {
|
|
25447
|
+
let {
|
|
25448
|
+
search,
|
|
25449
|
+
filterModel,
|
|
25450
|
+
sortModel,
|
|
25451
|
+
columnsVisibilityModel,
|
|
25452
|
+
pinnedColumnsModel,
|
|
25453
|
+
columns
|
|
25454
|
+
} = _ref3;
|
|
25455
|
+
const filterModelSearch = getSearchParamsFromFilterModel(filterModel);
|
|
25456
|
+
const sortModelSearch = getSearchParamsFromSorting(sortModel);
|
|
25457
|
+
const columnVisibilityModelSearch = getSearchParamsFromColumnVisibility(columnsVisibilityModel, columns);
|
|
25458
|
+
const pinnedColumnsModelSearch = getSearchParamsFromPinnedColumns(pinnedColumnsModel);
|
|
25459
|
+
const tabSearch = getSearchParamsFromTab(search);
|
|
25460
|
+
const searchParams = new URLSearchParams();
|
|
25461
|
+
for (const [key, value] of new URLSearchParams(search)) {
|
|
25462
|
+
if (!key.startsWith('_')) {
|
|
25463
|
+
searchParams.set(key, value);
|
|
25464
|
+
}
|
|
25465
|
+
}
|
|
25466
|
+
return new URLSearchParams([...searchParams, ...filterModelSearch, ...sortModelSearch, ...tabSearch, ...pinnedColumnsModelSearch, ...columnVisibilityModelSearch]);
|
|
25467
|
+
};
|
|
25468
|
+
/** Return the state of the table given the URL and the local storage state */
|
|
25469
|
+
const getModelsParsedOrUpdateLocalStorage = (search, columns, historyReplace, localStorage) => {
|
|
25470
|
+
const {
|
|
25471
|
+
localStorageFilters,
|
|
25472
|
+
setLocalStorageFilters,
|
|
25473
|
+
localStorageSorting,
|
|
25474
|
+
setLocalStorageSorting,
|
|
25475
|
+
localStorageColumnsVisibility,
|
|
25476
|
+
setLocalStorageColumnsVisibility,
|
|
25477
|
+
localStoragePinnedColumns,
|
|
25478
|
+
setLocalStoragePinnedColumns
|
|
25479
|
+
} = localStorage;
|
|
25480
|
+
const filterModel = getFilterModel(search, columns, localStorageFilters, setLocalStorageFilters);
|
|
25481
|
+
const sortModel = getSortModel(search, columns, localStorageSorting, setLocalStorageSorting);
|
|
25482
|
+
const columnVisibilityModel = getColumnsVisibility(search, columns, localStorageColumnsVisibility, setLocalStorageColumnsVisibility);
|
|
25483
|
+
const pinnedColumnsModel = getPinnedColumns(search, columns, localStoragePinnedColumns, setLocalStoragePinnedColumns);
|
|
25484
|
+
const finalSearch = getFinalSearch({
|
|
25485
|
+
search,
|
|
25486
|
+
filterModel,
|
|
25487
|
+
sortModel,
|
|
25488
|
+
columnsVisibilityModel: columnVisibilityModel,
|
|
25489
|
+
pinnedColumnsModel,
|
|
25490
|
+
columns
|
|
25491
|
+
});
|
|
25492
|
+
if (urlSearchParamsToString(finalSearch) !== search) {
|
|
25493
|
+
historyReplace(urlSearchParamsToString(finalSearch));
|
|
25494
|
+
}
|
|
25495
|
+
return {
|
|
25496
|
+
filterModel,
|
|
25497
|
+
sortModel,
|
|
25498
|
+
columnVisibilityModel,
|
|
25499
|
+
pinnedColumnsModel
|
|
25500
|
+
};
|
|
25501
|
+
};
|
|
25502
|
+
const updateUrl = (_ref4, search, historyReplace, columns) => {
|
|
25503
|
+
let {
|
|
25504
|
+
filterModel,
|
|
25505
|
+
sortModel,
|
|
25506
|
+
columnsModel: columnsVisibilityModel,
|
|
25507
|
+
pinnedColumnsModel
|
|
25508
|
+
} = _ref4;
|
|
25509
|
+
const newSearch = getFinalSearch({
|
|
25510
|
+
search,
|
|
25511
|
+
filterModel,
|
|
25512
|
+
sortModel,
|
|
25513
|
+
columnsVisibilityModel,
|
|
25514
|
+
pinnedColumnsModel,
|
|
25515
|
+
columns
|
|
25516
|
+
});
|
|
25517
|
+
if (urlSearchParamsToString(newSearch) !== search) {
|
|
25518
|
+
historyReplace(urlSearchParamsToString(newSearch));
|
|
25519
|
+
}
|
|
25520
|
+
};
|
|
25521
|
+
|
|
25522
|
+
const DATAGRID_VERSION = 1;
|
|
25523
|
+
const useStatefulTable = props => {
|
|
25524
|
+
const {
|
|
25525
|
+
// density = 'standard',
|
|
25526
|
+
apiRef,
|
|
25527
|
+
columns: propsColumns,
|
|
25528
|
+
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
25529
|
+
onColumnWidthChange: propsOnColumnWidthChange,
|
|
25530
|
+
onFilterModelChange: propsOnFilterModelChange,
|
|
25531
|
+
onPaginationModelChange: propsOnPaginationModelChange,
|
|
25532
|
+
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
25533
|
+
onSortModelChange: propsOnSortModelChange,
|
|
25534
|
+
pinnedCustomColumns = {
|
|
25535
|
+
left: [],
|
|
25536
|
+
right: []
|
|
25537
|
+
},
|
|
25538
|
+
useRouter,
|
|
25539
|
+
version = DATAGRID_VERSION
|
|
25540
|
+
} = props;
|
|
25541
|
+
const {
|
|
25542
|
+
search,
|
|
25543
|
+
pathname,
|
|
25544
|
+
historyReplace
|
|
25545
|
+
} = useRouter();
|
|
25546
|
+
const id = pathname;
|
|
25547
|
+
const customDefaults = useMemo(() => {
|
|
25548
|
+
return {
|
|
25549
|
+
pinnedColumns: `_pinnedColumnsLeft=[${[GRID_CHECKBOX_SELECTION_COL_DEF.field, ...pinnedCustomColumns.left].join(',')}]&_pinnedColumnsRight=[${pinnedCustomColumns.right.join(',')}]`
|
|
25550
|
+
};
|
|
25551
|
+
}, [pinnedCustomColumns]);
|
|
25552
|
+
|
|
25553
|
+
// States and setters persisted in the local storage for this table
|
|
25554
|
+
const {
|
|
25555
|
+
paginationModel,
|
|
25556
|
+
setPaginationModel,
|
|
25557
|
+
sortModel,
|
|
25558
|
+
setSortModel,
|
|
25559
|
+
localStorageFilters,
|
|
25560
|
+
setLocalStorageFilters,
|
|
25561
|
+
visibilityModelLocalStorage,
|
|
25562
|
+
setVisibilityModelLocalStorage,
|
|
25563
|
+
pinnedColumns,
|
|
25564
|
+
setPinnedColumns,
|
|
25565
|
+
dimensionModel,
|
|
25566
|
+
setDimensionModel
|
|
25567
|
+
} = useTableStates(id, version, customDefaults);
|
|
25568
|
+
|
|
25569
|
+
// clearing up old version keys, triggering only on first render
|
|
25570
|
+
useEffect(() => clearPreviousVersionStorage(id, version), [id, version]);
|
|
25571
|
+
const onColumnDimensionChange = useCallback(_ref => {
|
|
25572
|
+
let {
|
|
25573
|
+
newWidth,
|
|
25574
|
+
field
|
|
25575
|
+
} = _ref;
|
|
25576
|
+
setDimensionModel(_objectSpread2(_objectSpread2({}, dimensionModel), {}, {
|
|
25577
|
+
[field]: newWidth
|
|
25578
|
+
}));
|
|
25579
|
+
}, [dimensionModel, setDimensionModel]);
|
|
25580
|
+
const {
|
|
25581
|
+
filterModel: filterParsed,
|
|
25582
|
+
sortModel: sortModelParsed,
|
|
25583
|
+
columnVisibilityModel: visibilityModel,
|
|
25584
|
+
pinnedColumnsModel
|
|
25585
|
+
} = getModelsParsedOrUpdateLocalStorage(search || '', propsColumns, historyReplace, {
|
|
25586
|
+
localStorageFilters,
|
|
25587
|
+
setLocalStorageFilters,
|
|
25588
|
+
localStorageSorting: sortModel,
|
|
25589
|
+
setLocalStorageSorting: setSortModel,
|
|
25590
|
+
localStorageColumnsVisibility: visibilityModelLocalStorage,
|
|
25591
|
+
setLocalStorageColumnsVisibility: setVisibilityModelLocalStorage,
|
|
25592
|
+
localStoragePinnedColumns: pinnedColumns,
|
|
25593
|
+
setLocalStoragePinnedColumns: setPinnedColumns
|
|
25594
|
+
});
|
|
25595
|
+
const columns = useMemo(() => propsColumns.map(column => {
|
|
25596
|
+
column.width = dimensionModel[column.field] || column.width || 100;
|
|
25597
|
+
return column;
|
|
25598
|
+
}), [propsColumns, dimensionModel]);
|
|
25599
|
+
return {
|
|
25600
|
+
apiRef,
|
|
25601
|
+
columns,
|
|
25602
|
+
onFilterModelChange: (model, details) => {
|
|
25603
|
+
propsOnFilterModelChange === null || propsOnFilterModelChange === void 0 ? void 0 : propsOnFilterModelChange(model, details);
|
|
25604
|
+
updateUrl({
|
|
25605
|
+
filterModel: model,
|
|
25606
|
+
sortModel: sortModelParsed,
|
|
25607
|
+
columnsModel: apiRef.current.state.columns.columnVisibilityModel,
|
|
25608
|
+
pinnedColumnsModel: pinnedColumnsModel
|
|
25609
|
+
}, search, historyReplace, columns);
|
|
25610
|
+
},
|
|
25611
|
+
filterModel: filterParsed,
|
|
25612
|
+
onSortModelChange: (model, details) => {
|
|
25613
|
+
propsOnSortModelChange === null || propsOnSortModelChange === void 0 ? void 0 : propsOnSortModelChange(model, details);
|
|
25614
|
+
updateUrl({
|
|
25615
|
+
filterModel: filterParsed,
|
|
25616
|
+
sortModel: model,
|
|
25617
|
+
columnsModel: apiRef.current.state.columns.columnVisibilityModel,
|
|
25618
|
+
pinnedColumnsModel: pinnedColumnsModel
|
|
25619
|
+
}, search, historyReplace, columns);
|
|
25620
|
+
},
|
|
25621
|
+
sortModel: sortModelParsed,
|
|
25622
|
+
onPinnedColumnsChange: (pinnedColumns, details) => {
|
|
25623
|
+
propsOnPinnedColumnsChange === null || propsOnPinnedColumnsChange === void 0 ? void 0 : propsOnPinnedColumnsChange(pinnedColumns, details);
|
|
25624
|
+
updateUrl({
|
|
25625
|
+
filterModel: filterParsed,
|
|
25626
|
+
sortModel: sortModelParsed,
|
|
25627
|
+
columnsModel: apiRef.current.state.columns.columnVisibilityModel,
|
|
25628
|
+
pinnedColumnsModel: pinnedColumns
|
|
25629
|
+
}, search, historyReplace, columns);
|
|
25630
|
+
},
|
|
25631
|
+
pinnedColumns: pinnedColumnsModel,
|
|
25632
|
+
paginationModel,
|
|
25633
|
+
onPaginationModelChange: (model, details) => {
|
|
25634
|
+
propsOnPaginationModelChange === null || propsOnPaginationModelChange === void 0 ? void 0 : propsOnPaginationModelChange(model, details);
|
|
25635
|
+
setPaginationModel(model);
|
|
25636
|
+
},
|
|
25637
|
+
columnVisibilityModel: visibilityModel,
|
|
25638
|
+
onColumnVisibilityModelChange: (columnsVisibilityModel, details) => {
|
|
25639
|
+
propsOnColumnVisibilityModelChange === null || propsOnColumnVisibilityModelChange === void 0 ? void 0 : propsOnColumnVisibilityModelChange(columnsVisibilityModel, details);
|
|
25640
|
+
updateUrl({
|
|
25641
|
+
filterModel: filterParsed,
|
|
25642
|
+
sortModel: sortModelParsed,
|
|
25643
|
+
columnsModel: columnsVisibilityModel,
|
|
25644
|
+
pinnedColumnsModel: pinnedColumnsModel
|
|
25645
|
+
}, search, historyReplace, columns);
|
|
25646
|
+
},
|
|
25647
|
+
onColumnWidthChange: (params, event, details) => {
|
|
25648
|
+
propsOnColumnWidthChange === null || propsOnColumnWidthChange === void 0 ? void 0 : propsOnColumnWidthChange(params, event, details);
|
|
25649
|
+
onColumnDimensionChange({
|
|
25650
|
+
newWidth: params.width,
|
|
25651
|
+
field: params.colDef.field
|
|
25652
|
+
});
|
|
25653
|
+
}
|
|
25654
|
+
};
|
|
25655
|
+
};
|
|
25656
|
+
|
|
25657
|
+
const _excluded$1 = ["apiRef", "columns", "onColumnVisibilityModelChange", "onColumnWidthChange", "onFilterModelChange", "onPaginationModelChange", "onPinnedColumnsChange", "onSortModelChange", "pinnedCustomColumns", "rows", "useRouter"],
|
|
25658
|
+
_excluded2 = ["apiRef", "autoHeight", "className", "slots", "slotProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "height", "hideToolbar", "initialState", "isRowSelectable", "isStateful", "license", "onFilterModelChange", "rowSelectionModel", "paginationModel", "onPaginationModelChange", "onRowSelectionModelChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "pagination", "paginationPlacement", "paginationProps", "pinnedCustomColumns", "rows", "pageSizeOptions", "sx", "theme", "useRouter", "paginationMode", "rowCount"];
|
|
25659
|
+
const COMPONENT_NAME$1 = 'DataGrid';
|
|
25660
|
+
const CLASSNAME$1 = 'redsift-datagrid';
|
|
24752
25661
|
const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionStatus, isRowSelectable, page, pageSize) => {
|
|
24753
|
-
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(
|
|
25662
|
+
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref => {
|
|
24754
25663
|
let {
|
|
24755
25664
|
model
|
|
24756
|
-
} =
|
|
25665
|
+
} = _ref;
|
|
24757
25666
|
return isRowSelectable({
|
|
24758
25667
|
row: model
|
|
24759
25668
|
});
|
|
24760
|
-
}).map(
|
|
25669
|
+
}).map(_ref2 => {
|
|
24761
25670
|
let {
|
|
24762
25671
|
id
|
|
24763
|
-
} =
|
|
25672
|
+
} = _ref2;
|
|
24764
25673
|
return id;
|
|
24765
25674
|
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
24766
25675
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
@@ -24804,8 +25713,41 @@ const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionS
|
|
|
24804
25713
|
};
|
|
24805
25714
|
}
|
|
24806
25715
|
};
|
|
25716
|
+
const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
25717
|
+
const {
|
|
25718
|
+
// density = 'standard',
|
|
25719
|
+
apiRef,
|
|
25720
|
+
columns,
|
|
25721
|
+
onColumnVisibilityModelChange,
|
|
25722
|
+
onColumnWidthChange,
|
|
25723
|
+
onFilterModelChange,
|
|
25724
|
+
onPaginationModelChange,
|
|
25725
|
+
onPinnedColumnsChange,
|
|
25726
|
+
onSortModelChange,
|
|
25727
|
+
pinnedCustomColumns,
|
|
25728
|
+
rows,
|
|
25729
|
+
useRouter
|
|
25730
|
+
} = props,
|
|
25731
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1);
|
|
25732
|
+
const statefulTableProps = useStatefulTable({
|
|
25733
|
+
apiRef: apiRef,
|
|
25734
|
+
columns,
|
|
25735
|
+
onFilterModelChange,
|
|
25736
|
+
onPinnedColumnsChange,
|
|
25737
|
+
onSortModelChange,
|
|
25738
|
+
onPaginationModelChange,
|
|
25739
|
+
onColumnVisibilityModelChange,
|
|
25740
|
+
onColumnWidthChange,
|
|
25741
|
+
pinnedCustomColumns,
|
|
25742
|
+
useRouter: useRouter
|
|
25743
|
+
});
|
|
25744
|
+
return /*#__PURE__*/React__default.createElement(DataGridPro, _extends$2({
|
|
25745
|
+
ref: ref,
|
|
25746
|
+
rows: rows
|
|
25747
|
+
}, forwardedProps, statefulTableProps));
|
|
25748
|
+
});
|
|
24807
25749
|
const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
24808
|
-
var
|
|
25750
|
+
var _ref3, _ref4, _initialState$paginat, _initialState$paginat2, _initialState$paginat3, _pageSizeOptions$, _ref5, _initialState$paginat4, _initialState$paginat5, _initialState$paginat6;
|
|
24809
25751
|
const datagridRef = ref || useRef();
|
|
24810
25752
|
const {
|
|
24811
25753
|
apiRef: propsApiRef,
|
|
@@ -24814,23 +25756,32 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24814
25756
|
slots,
|
|
24815
25757
|
slotProps,
|
|
24816
25758
|
filterModel: propsFilterModel,
|
|
25759
|
+
columnVisibilityModel: propsColumnVisibilityModel,
|
|
25760
|
+
pinnedColumns: propsPinnedColumns,
|
|
25761
|
+
sortModel: propsSortModel,
|
|
24817
25762
|
height: propsHeight,
|
|
24818
25763
|
hideToolbar,
|
|
24819
25764
|
initialState,
|
|
24820
25765
|
isRowSelectable,
|
|
25766
|
+
isStateful: propsIsStateful,
|
|
24821
25767
|
license = process.env.MUI_LICENSE_KEY,
|
|
24822
25768
|
onFilterModelChange: propsOnFilterModelChange,
|
|
24823
25769
|
rowSelectionModel: propsSelectionModel,
|
|
24824
25770
|
paginationModel: propsPaginationModel,
|
|
24825
25771
|
onPaginationModelChange: propsOnPaginationModelChange,
|
|
24826
25772
|
onRowSelectionModelChange,
|
|
25773
|
+
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
25774
|
+
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
25775
|
+
onSortModelChange: propsOnSortModelChange,
|
|
24827
25776
|
pagination,
|
|
24828
25777
|
paginationPlacement = 'both',
|
|
24829
25778
|
paginationProps,
|
|
25779
|
+
pinnedCustomColumns,
|
|
24830
25780
|
rows,
|
|
24831
25781
|
pageSizeOptions,
|
|
24832
25782
|
sx,
|
|
24833
25783
|
theme: propsTheme,
|
|
25784
|
+
useRouter,
|
|
24834
25785
|
paginationMode = 'client',
|
|
24835
25786
|
rowCount
|
|
24836
25787
|
} = props,
|
|
@@ -24838,7 +25789,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24838
25789
|
const theme = useTheme$4(propsTheme);
|
|
24839
25790
|
const _apiRef = useGridApiRef();
|
|
24840
25791
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
24841
|
-
const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$
|
|
25792
|
+
const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$2;
|
|
24842
25793
|
LicenseInfo.setLicenseKey(license);
|
|
24843
25794
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
24844
25795
|
const [filterModel, setFilterModel] = useState(propsFilterModel);
|
|
@@ -24852,13 +25803,46 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24852
25803
|
setFilterModel(model);
|
|
24853
25804
|
}
|
|
24854
25805
|
};
|
|
25806
|
+
const [columnVisibilityModel, setColumnVisibilityModel] = useState(propsColumnVisibilityModel);
|
|
25807
|
+
useEffect(() => {
|
|
25808
|
+
setColumnVisibilityModel(propsColumnVisibilityModel);
|
|
25809
|
+
}, [propsColumnVisibilityModel]);
|
|
25810
|
+
const onColumnVisibilityModelChange = (model, details) => {
|
|
25811
|
+
if (propsOnColumnVisibilityModelChange) {
|
|
25812
|
+
propsOnColumnVisibilityModelChange(model, details);
|
|
25813
|
+
} else {
|
|
25814
|
+
setColumnVisibilityModel(model);
|
|
25815
|
+
}
|
|
25816
|
+
};
|
|
25817
|
+
const [pinnedColumns, setPinnedColumns] = useState(propsPinnedColumns);
|
|
25818
|
+
useEffect(() => {
|
|
25819
|
+
setPinnedColumns(propsPinnedColumns);
|
|
25820
|
+
}, [propsPinnedColumns]);
|
|
25821
|
+
const onPinnedColumnsChange = (model, details) => {
|
|
25822
|
+
if (propsOnPinnedColumnsChange) {
|
|
25823
|
+
propsOnPinnedColumnsChange(model, details);
|
|
25824
|
+
} else {
|
|
25825
|
+
setPinnedColumns(model);
|
|
25826
|
+
}
|
|
25827
|
+
};
|
|
25828
|
+
const [sortModel, setSortModel] = useState(propsSortModel);
|
|
25829
|
+
useEffect(() => {
|
|
25830
|
+
setSortModel(propsSortModel);
|
|
25831
|
+
}, [propsSortModel]);
|
|
25832
|
+
const onSortModelChange = (model, details) => {
|
|
25833
|
+
if (propsOnSortModelChange) {
|
|
25834
|
+
propsOnSortModelChange(model, details);
|
|
25835
|
+
} else {
|
|
25836
|
+
setSortModel(model);
|
|
25837
|
+
}
|
|
25838
|
+
};
|
|
24855
25839
|
const [rowSelectionModel, setRowSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
24856
25840
|
useEffect(() => {
|
|
24857
25841
|
setRowSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
24858
25842
|
}, [propsSelectionModel]);
|
|
24859
25843
|
const [paginationModel, setPaginationModel] = useState({
|
|
24860
|
-
pageSize: (
|
|
24861
|
-
page: (
|
|
25844
|
+
pageSize: (_ref3 = (_ref4 = (_initialState$paginat = initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat2 = initialState.pagination) === null || _initialState$paginat2 === void 0 ? void 0 : (_initialState$paginat3 = _initialState$paginat2.paginationModel) === null || _initialState$paginat3 === void 0 ? void 0 : _initialState$paginat3.pageSize) !== null && _initialState$paginat !== void 0 ? _initialState$paginat : propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.pageSize) !== null && _ref4 !== void 0 ? _ref4 : typeof (pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0]) === 'number' ? pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0] : pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : (_pageSizeOptions$ = pageSizeOptions[0]) === null || _pageSizeOptions$ === void 0 ? void 0 : _pageSizeOptions$.value) !== null && _ref3 !== void 0 ? _ref3 : 100,
|
|
25845
|
+
page: (_ref5 = (_initialState$paginat4 = initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat5 = initialState.pagination) === null || _initialState$paginat5 === void 0 ? void 0 : (_initialState$paginat6 = _initialState$paginat5.paginationModel) === null || _initialState$paginat6 === void 0 ? void 0 : _initialState$paginat6.page) !== null && _initialState$paginat4 !== void 0 ? _initialState$paginat4 : propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.page) !== null && _ref5 !== void 0 ? _ref5 : 0
|
|
24862
25846
|
});
|
|
24863
25847
|
const onPaginationModelChange = model => {
|
|
24864
25848
|
if (propsOnPaginationModelChange) {
|
|
@@ -24902,6 +25886,8 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24902
25886
|
}
|
|
24903
25887
|
}
|
|
24904
25888
|
}), [theme]);
|
|
25889
|
+
const isStateful = propsIsStateful && useRouter;
|
|
25890
|
+
const RenderedDataGrid = isStateful ? StatefulDataGrid : DataGridPro;
|
|
24905
25891
|
return /*#__PURE__*/React__default.createElement(ThemeProvider$4, {
|
|
24906
25892
|
value: {
|
|
24907
25893
|
theme
|
|
@@ -24912,7 +25898,10 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24912
25898
|
ref: datagridRef,
|
|
24913
25899
|
className: classNames(DataGrid.className, className),
|
|
24914
25900
|
$height: height
|
|
24915
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
25901
|
+
}, /*#__PURE__*/React__default.createElement(RenderedDataGrid, _extends$2({}, isStateful ? {
|
|
25902
|
+
pinnedCustomColumns,
|
|
25903
|
+
useRouter
|
|
25904
|
+
} : {}, forwardedProps, {
|
|
24916
25905
|
rowCount: rowCount,
|
|
24917
25906
|
apiRef: apiRef,
|
|
24918
25907
|
autoHeight: autoHeight,
|
|
@@ -24956,7 +25945,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24956
25945
|
displayName: "OpenFilterButtonIcon"
|
|
24957
25946
|
}, props))
|
|
24958
25947
|
}, slots), {}, {
|
|
24959
|
-
toolbar:
|
|
25948
|
+
toolbar: ToolbarWrapper,
|
|
24960
25949
|
pagination: props => pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$2({}, props, {
|
|
24961
25950
|
displaySelection: false,
|
|
24962
25951
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
@@ -24989,7 +25978,6 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24989
25978
|
filterModel,
|
|
24990
25979
|
onFilterModelChange,
|
|
24991
25980
|
pagination,
|
|
24992
|
-
ControlledPagination: paginationMode == 'server' ? ServerSideControlledPagination : ControlledPagination,
|
|
24993
25981
|
paginationPlacement,
|
|
24994
25982
|
selectionStatus,
|
|
24995
25983
|
apiRef,
|
|
@@ -25003,9 +25991,17 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25003
25991
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar)
|
|
25004
25992
|
}),
|
|
25005
25993
|
filterModel: filterModel,
|
|
25994
|
+
columnVisibilityModel: columnVisibilityModel,
|
|
25995
|
+
pinnedColumns: pinnedColumns,
|
|
25996
|
+
sortModel: sortModel,
|
|
25006
25997
|
initialState: initialState,
|
|
25007
25998
|
isRowSelectable: isRowSelectable,
|
|
25008
25999
|
onFilterModelChange: onFilterModelChange,
|
|
26000
|
+
onColumnVisibilityModelChange: onColumnVisibilityModelChange
|
|
26001
|
+
// onColumnWidthChange={onColumnWidthChange}
|
|
26002
|
+
,
|
|
26003
|
+
onPinnedColumnsChange: onPinnedColumnsChange,
|
|
26004
|
+
onSortModelChange: onSortModelChange,
|
|
25009
26005
|
pagination: pagination,
|
|
25010
26006
|
paginationMode: paginationMode,
|
|
25011
26007
|
keepNonExistentRowsSelected: paginationMode == 'server',
|
|
@@ -25016,31 +26012,31 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25016
26012
|
rowSelectionModel: rowSelectionModel,
|
|
25017
26013
|
onRowSelectionModelChange: (newSelectionModel, details) => {
|
|
25018
26014
|
if (pagination && paginationMode != 'server') {
|
|
25019
|
-
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(
|
|
26015
|
+
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref6 => {
|
|
25020
26016
|
let {
|
|
25021
26017
|
model
|
|
25022
|
-
} =
|
|
26018
|
+
} = _ref6;
|
|
25023
26019
|
return isRowSelectable({
|
|
25024
26020
|
row: model
|
|
25025
26021
|
});
|
|
25026
|
-
}).map(
|
|
26022
|
+
}).map(_ref7 => {
|
|
25027
26023
|
let {
|
|
25028
26024
|
id
|
|
25029
|
-
} =
|
|
26025
|
+
} = _ref7;
|
|
25030
26026
|
return id;
|
|
25031
26027
|
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
25032
26028
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
25033
|
-
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(
|
|
26029
|
+
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref8 => {
|
|
25034
26030
|
let {
|
|
25035
26031
|
model
|
|
25036
|
-
} =
|
|
26032
|
+
} = _ref8;
|
|
25037
26033
|
return isRowSelectable({
|
|
25038
26034
|
row: model
|
|
25039
26035
|
});
|
|
25040
|
-
}).map(
|
|
26036
|
+
}).map(_ref9 => {
|
|
25041
26037
|
let {
|
|
25042
26038
|
id
|
|
25043
|
-
} =
|
|
26039
|
+
} = _ref9;
|
|
25044
26040
|
return id;
|
|
25045
26041
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
25046
26042
|
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
@@ -25146,5 +26142,5 @@ const TextCell = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25146
26142
|
TextCell.className = CLASSNAME;
|
|
25147
26143
|
TextCell.displayName = COMPONENT_NAME;
|
|
25148
26144
|
|
|
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$
|
|
26145
|
+
export { CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DataGrid, ENDS_WITH_ANY_OF, GridToolbarFilterSemanticField, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, STARTS_WITH_ANY_OF, TextCell, Toolbar$2 as Toolbar, getCompletion, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, operatorList };
|
|
25150
26146
|
//# sourceMappingURL=index.js.map
|