@redsift/table 10.8.2-muiv5 → 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 +44 -7
- package/index.js +1277 -303
- package/index.js.map +1 -1
- package/package.json +6 -6
package/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport,
|
|
1
|
+
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputValue, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, GridLogicOperator, GRID_CHECKBOX_SELECTION_COL_DEF, useGridApiRef, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, DataGridPro } from '@mui/x-data-grid-pro';
|
|
2
|
+
export * from '@mui/x-data-grid-pro';
|
|
2
3
|
export { getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import React__default, { Children, isValidElement, cloneElement, useLayoutEffect, useEffect, useRef, forwardRef, useContext, useState, useCallback, createElement, useMemo } from 'react';
|
|
5
|
-
import { Icon, baseContainer, Theme, AppContainerContext, useTheme as useTheme$4, useId as useId$2, partitionComponents, isComponent, Flexbox, TextField as TextField$2, Button, Switch, Text, ButtonsColorPalette, IconButton as IconButton$2, Checkbox, 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';
|
|
6
7
|
import { mdiSync, mdiFilterVariant, mdiViewColumn, mdiChevronUp, mdiChevronDown, mdiViewHeadline, mdiViewSequential, mdiViewStream, mdiChevronRight, mdiTrayArrowDown } from '@redsift/icons';
|
|
7
8
|
import emStyled from '@emotion/styled';
|
|
8
9
|
import { Global, ThemeContext as ThemeContext$3, keyframes } from '@emotion/react';
|
|
@@ -3624,7 +3625,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
3624
3625
|
return target;
|
|
3625
3626
|
}
|
|
3626
3627
|
|
|
3627
|
-
const _excluded$
|
|
3628
|
+
const _excluded$R = ["values", "unit", "step"];
|
|
3628
3629
|
const sortBreakpointsValues = values => {
|
|
3629
3630
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
3630
3631
|
key,
|
|
@@ -3659,7 +3660,7 @@ function createBreakpoints(breakpoints) {
|
|
|
3659
3660
|
unit = 'px',
|
|
3660
3661
|
step = 5
|
|
3661
3662
|
} = breakpoints,
|
|
3662
|
-
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$
|
|
3663
|
+
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$R);
|
|
3663
3664
|
const sortedValues = sortBreakpointsValues(values);
|
|
3664
3665
|
const keys = Object.keys(sortedValues);
|
|
3665
3666
|
function up(key) {
|
|
@@ -4688,7 +4689,7 @@ const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
|
4688
4689
|
styleFunctionSx.filterProps = ['sx'];
|
|
4689
4690
|
var styleFunctionSx$1 = styleFunctionSx;
|
|
4690
4691
|
|
|
4691
|
-
const _excluded$
|
|
4692
|
+
const _excluded$Q = ["breakpoints", "palette", "spacing", "shape"];
|
|
4692
4693
|
function createTheme$1(options = {}, ...args) {
|
|
4693
4694
|
const {
|
|
4694
4695
|
breakpoints: breakpointsInput = {},
|
|
@@ -4696,7 +4697,7 @@ function createTheme$1(options = {}, ...args) {
|
|
|
4696
4697
|
spacing: spacingInput,
|
|
4697
4698
|
shape: shapeInput = {}
|
|
4698
4699
|
} = options,
|
|
4699
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
4700
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$Q);
|
|
4700
4701
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
4701
4702
|
const spacing = createSpacing(spacingInput);
|
|
4702
4703
|
let muiTheme = deepmerge({
|
|
@@ -4764,7 +4765,7 @@ process.env.NODE_ENV !== "production" ? GlobalStyles$1.propTypes /* remove-propt
|
|
|
4764
4765
|
themeId: PropTypes.string
|
|
4765
4766
|
} : void 0;
|
|
4766
4767
|
|
|
4767
|
-
const _excluded$
|
|
4768
|
+
const _excluded$P = ["sx"];
|
|
4768
4769
|
const splitProps = props => {
|
|
4769
4770
|
var _props$theme$unstable, _props$theme;
|
|
4770
4771
|
const result = {
|
|
@@ -4785,7 +4786,7 @@ function extendSxProp(props) {
|
|
|
4785
4786
|
const {
|
|
4786
4787
|
sx: inSx
|
|
4787
4788
|
} = props,
|
|
4788
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4789
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$P);
|
|
4789
4790
|
const {
|
|
4790
4791
|
systemProps,
|
|
4791
4792
|
otherProps
|
|
@@ -4811,7 +4812,7 @@ function extendSxProp(props) {
|
|
|
4811
4812
|
|
|
4812
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}
|
|
4813
4814
|
|
|
4814
|
-
const _excluded$
|
|
4815
|
+
const _excluded$O = ["className", "component"];
|
|
4815
4816
|
function createBox(options = {}) {
|
|
4816
4817
|
const {
|
|
4817
4818
|
themeId,
|
|
@@ -4829,7 +4830,7 @@ function createBox(options = {}) {
|
|
|
4829
4830
|
className,
|
|
4830
4831
|
component = 'div'
|
|
4831
4832
|
} = _extendSxProp,
|
|
4832
|
-
other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$
|
|
4833
|
+
other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$O);
|
|
4833
4834
|
return /*#__PURE__*/jsxRuntimeExports.jsx(BoxRoot, _extends$1({
|
|
4834
4835
|
as: component,
|
|
4835
4836
|
ref: ref,
|
|
@@ -4840,7 +4841,7 @@ function createBox(options = {}) {
|
|
|
4840
4841
|
return Box;
|
|
4841
4842
|
}
|
|
4842
4843
|
|
|
4843
|
-
const _excluded$
|
|
4844
|
+
const _excluded$N = ["variant"];
|
|
4844
4845
|
function isEmpty$3(string) {
|
|
4845
4846
|
return string.length === 0;
|
|
4846
4847
|
}
|
|
@@ -4854,7 +4855,7 @@ function propsToClassKey(props) {
|
|
|
4854
4855
|
const {
|
|
4855
4856
|
variant
|
|
4856
4857
|
} = props,
|
|
4857
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4858
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$N);
|
|
4858
4859
|
let classKey = variant || '';
|
|
4859
4860
|
Object.keys(other).sort().forEach(key => {
|
|
4860
4861
|
if (key === 'color') {
|
|
@@ -4866,7 +4867,7 @@ function propsToClassKey(props) {
|
|
|
4866
4867
|
return classKey;
|
|
4867
4868
|
}
|
|
4868
4869
|
|
|
4869
|
-
const _excluded$
|
|
4870
|
+
const _excluded$M = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
4870
4871
|
function isEmpty$2(obj) {
|
|
4871
4872
|
return Object.keys(obj).length === 0;
|
|
4872
4873
|
}
|
|
@@ -4961,7 +4962,7 @@ function createStyled(input = {}) {
|
|
|
4961
4962
|
skipSx: inputSkipSx,
|
|
4962
4963
|
overridesResolver
|
|
4963
4964
|
} = inputOptions,
|
|
4964
|
-
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$
|
|
4965
|
+
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$M);
|
|
4965
4966
|
|
|
4966
4967
|
// if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
4967
4968
|
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
|
|
@@ -5638,7 +5639,7 @@ const green = {
|
|
|
5638
5639
|
};
|
|
5639
5640
|
var green$1 = green;
|
|
5640
5641
|
|
|
5641
|
-
const _excluded$
|
|
5642
|
+
const _excluded$L = ["mode", "contrastThreshold", "tonalOffset"];
|
|
5642
5643
|
const light = {
|
|
5643
5644
|
// The colors used to style the text.
|
|
5644
5645
|
text: {
|
|
@@ -5807,7 +5808,7 @@ function createPalette(palette) {
|
|
|
5807
5808
|
contrastThreshold = 3,
|
|
5808
5809
|
tonalOffset = 0.2
|
|
5809
5810
|
} = palette,
|
|
5810
|
-
other = _objectWithoutPropertiesLoose(palette, _excluded$
|
|
5811
|
+
other = _objectWithoutPropertiesLoose(palette, _excluded$L);
|
|
5811
5812
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
5812
5813
|
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
5813
5814
|
const error = palette.error || getDefaultError(mode);
|
|
@@ -5931,7 +5932,7 @@ const theme2 = createTheme({ palette: {
|
|
|
5931
5932
|
return paletteOutput;
|
|
5932
5933
|
}
|
|
5933
5934
|
|
|
5934
|
-
const _excluded$
|
|
5935
|
+
const _excluded$K = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
5935
5936
|
function round$2(value) {
|
|
5936
5937
|
return Math.round(value * 1e5) / 1e5;
|
|
5937
5938
|
}
|
|
@@ -5962,7 +5963,7 @@ function createTypography(palette, typography) {
|
|
|
5962
5963
|
allVariants,
|
|
5963
5964
|
pxToRem: pxToRem2
|
|
5964
5965
|
} = _ref,
|
|
5965
|
-
other = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5966
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded$K);
|
|
5966
5967
|
if (process.env.NODE_ENV !== 'production') {
|
|
5967
5968
|
if (typeof fontSize !== 'number') {
|
|
5968
5969
|
console.error('MUI: `fontSize` is required to be a number.');
|
|
@@ -6029,7 +6030,7 @@ function createShadow(...px) {
|
|
|
6029
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)];
|
|
6030
6031
|
var shadows$1 = shadows;
|
|
6031
6032
|
|
|
6032
|
-
const _excluded$
|
|
6033
|
+
const _excluded$J = ["duration", "easing", "delay"];
|
|
6033
6034
|
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
6034
6035
|
// to learn the context in which each easing should be used.
|
|
6035
6036
|
const easing = {
|
|
@@ -6080,7 +6081,7 @@ function createTransitions(inputTransitions) {
|
|
|
6080
6081
|
easing: easingOption = mergedEasing.easeInOut,
|
|
6081
6082
|
delay = 0
|
|
6082
6083
|
} = options,
|
|
6083
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
6084
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$J);
|
|
6084
6085
|
if (process.env.NODE_ENV !== 'production') {
|
|
6085
6086
|
const isString = value => typeof value === 'string';
|
|
6086
6087
|
// IE11 support, replace with Number.isNaN
|
|
@@ -6127,7 +6128,7 @@ const zIndex = {
|
|
|
6127
6128
|
};
|
|
6128
6129
|
var zIndex$1 = zIndex;
|
|
6129
6130
|
|
|
6130
|
-
const _excluded$
|
|
6131
|
+
const _excluded$I = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
6131
6132
|
function createTheme(options = {}, ...args) {
|
|
6132
6133
|
const {
|
|
6133
6134
|
mixins: mixinsInput = {},
|
|
@@ -6135,7 +6136,7 @@ function createTheme(options = {}, ...args) {
|
|
|
6135
6136
|
transitions: transitionsInput = {},
|
|
6136
6137
|
typography: typographyInput = {}
|
|
6137
6138
|
} = options,
|
|
6138
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
6139
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$I);
|
|
6139
6140
|
if (options.vars) {
|
|
6140
6141
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`vars\` is a private field used for CSS variables support.
|
|
6141
6142
|
Please use another name.` : formatMuiErrorMessage(18));
|
|
@@ -6226,12 +6227,12 @@ const styled = createStyled({
|
|
|
6226
6227
|
});
|
|
6227
6228
|
var styled$1 = styled;
|
|
6228
6229
|
|
|
6229
|
-
const _excluded$
|
|
6230
|
+
const _excluded$H = ["theme"];
|
|
6230
6231
|
function ThemeProvider$1(_ref) {
|
|
6231
6232
|
let {
|
|
6232
6233
|
theme: themeInput
|
|
6233
6234
|
} = _ref,
|
|
6234
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
6235
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$H);
|
|
6235
6236
|
const scopedTheme = themeInput[THEME_ID];
|
|
6236
6237
|
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$2, _extends$1({}, props, {
|
|
6237
6238
|
themeId: scopedTheme ? THEME_ID : undefined,
|
|
@@ -6455,7 +6456,7 @@ function mergeSlotProps(parameters) {
|
|
|
6455
6456
|
};
|
|
6456
6457
|
}
|
|
6457
6458
|
|
|
6458
|
-
const _excluded$
|
|
6459
|
+
const _excluded$G = ["elementType", "externalSlotProps", "ownerState"];
|
|
6459
6460
|
/**
|
|
6460
6461
|
* @ignore - do not document.
|
|
6461
6462
|
* Builds the props to be passed into the slot of an unstyled component.
|
|
@@ -6471,7 +6472,7 @@ function useSlotProps(parameters) {
|
|
|
6471
6472
|
externalSlotProps,
|
|
6472
6473
|
ownerState
|
|
6473
6474
|
} = parameters,
|
|
6474
|
-
rest = _objectWithoutPropertiesLoose(parameters, _excluded$
|
|
6475
|
+
rest = _objectWithoutPropertiesLoose(parameters, _excluded$G);
|
|
6475
6476
|
const resolvedComponentsProps = resolveComponentProps(externalSlotProps, ownerState);
|
|
6476
6477
|
const {
|
|
6477
6478
|
props: mergedProps,
|
|
@@ -8687,7 +8688,7 @@ function getPopperUtilityClass(slot) {
|
|
|
8687
8688
|
}
|
|
8688
8689
|
generateUtilityClasses('MuiPopper', ['root']);
|
|
8689
8690
|
|
|
8690
|
-
const _excluded$
|
|
8691
|
+
const _excluded$F = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "placement", "popperOptions", "popperRef", "slotProps", "slots", "TransitionProps", "ownerState"],
|
|
8691
8692
|
_excluded2$3 = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition", "slotProps", "slots"];
|
|
8692
8693
|
function flipPlacement(placement, direction) {
|
|
8693
8694
|
if (direction === 'ltr') {
|
|
@@ -8740,7 +8741,7 @@ const PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props
|
|
|
8740
8741
|
// @ts-ignore internal logic
|
|
8741
8742
|
// prevent from spreading to DOM, it can come from the parent component e.g. Select.
|
|
8742
8743
|
} = props,
|
|
8743
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
8744
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$F);
|
|
8744
8745
|
const tooltipRef = React.useRef(null);
|
|
8745
8746
|
const ownRef = useForkRef(tooltipRef, forwardedRef);
|
|
8746
8747
|
const popperRef = React.useRef(null);
|
|
@@ -9267,7 +9268,7 @@ function getModalUtilityClass(slot) {
|
|
|
9267
9268
|
}
|
|
9268
9269
|
generateUtilityClasses('MuiModal', ['root', 'hidden', 'backdrop']);
|
|
9269
9270
|
|
|
9270
|
-
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"];
|
|
9271
9272
|
const useUtilityClasses$o = ownerState => {
|
|
9272
9273
|
const {
|
|
9273
9274
|
open,
|
|
@@ -9336,7 +9337,7 @@ const Modal$2 = /*#__PURE__*/React.forwardRef(function Modal(props, forwardedRef
|
|
|
9336
9337
|
slotProps = {},
|
|
9337
9338
|
slots = {}
|
|
9338
9339
|
} = props,
|
|
9339
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
9340
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$E);
|
|
9340
9341
|
// TODO: `modal`` must change its type in this file to match the type of methods
|
|
9341
9342
|
// provided by `ModalManager`
|
|
9342
9343
|
const manager = managerProp;
|
|
@@ -9626,7 +9627,7 @@ process.env.NODE_ENV !== "production" ? Modal$2.propTypes /* remove-proptypes */
|
|
|
9626
9627
|
} : void 0;
|
|
9627
9628
|
var ModalUnstyled = Modal$2;
|
|
9628
9629
|
|
|
9629
|
-
const _excluded$
|
|
9630
|
+
const _excluded$D = ["onChange", "maxRows", "minRows", "style", "value"];
|
|
9630
9631
|
function getStyleValue(value) {
|
|
9631
9632
|
return parseInt(value, 10) || 0;
|
|
9632
9633
|
}
|
|
@@ -9668,7 +9669,7 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
|
|
|
9668
9669
|
style,
|
|
9669
9670
|
value
|
|
9670
9671
|
} = props,
|
|
9671
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
9672
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$D);
|
|
9672
9673
|
const {
|
|
9673
9674
|
current: isControlled
|
|
9674
9675
|
} = React.useRef(value != null);
|
|
@@ -9962,7 +9963,7 @@ function getInputBaseUtilityClass(slot) {
|
|
|
9962
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']);
|
|
9963
9964
|
var inputBaseClasses$1 = inputBaseClasses;
|
|
9964
9965
|
|
|
9965
|
-
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"];
|
|
9966
9967
|
const rootOverridesResolver = (props, styles) => {
|
|
9967
9968
|
const {
|
|
9968
9969
|
ownerState
|
|
@@ -10193,7 +10194,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
10193
10194
|
type = 'text',
|
|
10194
10195
|
value: valueProp
|
|
10195
10196
|
} = props,
|
|
10196
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
10197
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$C);
|
|
10197
10198
|
const value = inputPropsProp.value != null ? inputPropsProp.value : valueProp;
|
|
10198
10199
|
const {
|
|
10199
10200
|
current: isControlled
|
|
@@ -10655,7 +10656,7 @@ function getInputUtilityClass(slot) {
|
|
|
10655
10656
|
const inputClasses = _extends$1({}, inputBaseClasses$1, generateUtilityClasses('MuiInput', ['root', 'underline', 'input']));
|
|
10656
10657
|
var inputClasses$1 = inputClasses;
|
|
10657
10658
|
|
|
10658
|
-
const _excluded$
|
|
10659
|
+
const _excluded$B = ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "slotProps", "slots", "type"];
|
|
10659
10660
|
const useUtilityClasses$m = ownerState => {
|
|
10660
10661
|
const {
|
|
10661
10662
|
classes,
|
|
@@ -10768,7 +10769,7 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
|
|
|
10768
10769
|
slots = {},
|
|
10769
10770
|
type = 'text'
|
|
10770
10771
|
} = props,
|
|
10771
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
10772
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$B);
|
|
10772
10773
|
const classes = useUtilityClasses$m(props);
|
|
10773
10774
|
const ownerState = {
|
|
10774
10775
|
disableUnderline
|
|
@@ -10991,7 +10992,7 @@ function getFilledInputUtilityClass(slot) {
|
|
|
10991
10992
|
const filledInputClasses = _extends$1({}, inputBaseClasses$1, generateUtilityClasses('MuiFilledInput', ['root', 'underline', 'input']));
|
|
10992
10993
|
var filledInputClasses$1 = filledInputClasses;
|
|
10993
10994
|
|
|
10994
|
-
const _excluded$
|
|
10995
|
+
const _excluded$A = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "slotProps", "slots", "type"];
|
|
10995
10996
|
const useUtilityClasses$l = ownerState => {
|
|
10996
10997
|
const {
|
|
10997
10998
|
classes,
|
|
@@ -11175,7 +11176,7 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
|
|
|
11175
11176
|
slots = {},
|
|
11176
11177
|
type = 'text'
|
|
11177
11178
|
} = props,
|
|
11178
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
11179
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$A);
|
|
11179
11180
|
const ownerState = _extends$1({}, props, {
|
|
11180
11181
|
fullWidth,
|
|
11181
11182
|
inputComponent,
|
|
@@ -11406,7 +11407,7 @@ FilledInput.muiName = 'Input';
|
|
|
11406
11407
|
var FilledInput$1 = FilledInput;
|
|
11407
11408
|
|
|
11408
11409
|
var _span$2;
|
|
11409
|
-
const _excluded$
|
|
11410
|
+
const _excluded$z = ["children", "classes", "className", "label", "notched"];
|
|
11410
11411
|
const NotchedOutlineRoot$1 = styled$1('fieldset')({
|
|
11411
11412
|
textAlign: 'left',
|
|
11412
11413
|
position: 'absolute',
|
|
@@ -11479,7 +11480,7 @@ function NotchedOutline(props) {
|
|
|
11479
11480
|
label,
|
|
11480
11481
|
notched
|
|
11481
11482
|
} = props,
|
|
11482
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
11483
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$z);
|
|
11483
11484
|
const withLabel = label != null && label !== '';
|
|
11484
11485
|
const ownerState = _extends$1({}, props, {
|
|
11485
11486
|
notched,
|
|
@@ -11536,7 +11537,7 @@ function getOutlinedInputUtilityClass(slot) {
|
|
|
11536
11537
|
const outlinedInputClasses = _extends$1({}, inputBaseClasses$1, generateUtilityClasses('MuiOutlinedInput', ['root', 'notchedOutline', 'input']));
|
|
11537
11538
|
var outlinedInputClasses$1 = outlinedInputClasses;
|
|
11538
11539
|
|
|
11539
|
-
const _excluded$
|
|
11540
|
+
const _excluded$y = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"];
|
|
11540
11541
|
const useUtilityClasses$k = ownerState => {
|
|
11541
11542
|
const {
|
|
11542
11543
|
classes
|
|
@@ -11655,7 +11656,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
11655
11656
|
slots = {},
|
|
11656
11657
|
type = 'text'
|
|
11657
11658
|
} = props,
|
|
11658
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
11659
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$y);
|
|
11659
11660
|
const classes = useUtilityClasses$k(props);
|
|
11660
11661
|
const muiFormControl = useFormControl();
|
|
11661
11662
|
const fcs = formControlState({
|
|
@@ -11876,7 +11877,7 @@ function getFormLabelUtilityClasses(slot) {
|
|
|
11876
11877
|
const formLabelClasses = generateUtilityClasses('MuiFormLabel', ['root', 'colorSecondary', 'focused', 'disabled', 'error', 'filled', 'required', 'asterisk']);
|
|
11877
11878
|
var formLabelClasses$1 = formLabelClasses;
|
|
11878
11879
|
|
|
11879
|
-
const _excluded$
|
|
11880
|
+
const _excluded$x = ["children", "className", "color", "component", "disabled", "error", "filled", "focused", "required"];
|
|
11880
11881
|
const useUtilityClasses$j = ownerState => {
|
|
11881
11882
|
const {
|
|
11882
11883
|
classes,
|
|
@@ -11941,7 +11942,7 @@ const FormLabel = /*#__PURE__*/React.forwardRef(function FormLabel(inProps, ref)
|
|
|
11941
11942
|
className,
|
|
11942
11943
|
component = 'label'
|
|
11943
11944
|
} = props,
|
|
11944
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
11945
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$x);
|
|
11945
11946
|
const muiFormControl = useFormControl();
|
|
11946
11947
|
const fcs = formControlState({
|
|
11947
11948
|
props,
|
|
@@ -12032,7 +12033,7 @@ function getInputLabelUtilityClasses(slot) {
|
|
|
12032
12033
|
}
|
|
12033
12034
|
generateUtilityClasses('MuiInputLabel', ['root', 'focused', 'disabled', 'error', 'required', 'asterisk', 'formControl', 'sizeSmall', 'shrink', 'animated', 'standard', 'filled', 'outlined']);
|
|
12034
12035
|
|
|
12035
|
-
const _excluded$
|
|
12036
|
+
const _excluded$w = ["disableAnimation", "margin", "shrink", "variant", "className"];
|
|
12036
12037
|
const useUtilityClasses$i = ownerState => {
|
|
12037
12038
|
const {
|
|
12038
12039
|
classes,
|
|
@@ -12134,7 +12135,7 @@ const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, re
|
|
|
12134
12135
|
shrink: shrinkProp,
|
|
12135
12136
|
className
|
|
12136
12137
|
} = props,
|
|
12137
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
12138
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$w);
|
|
12138
12139
|
const muiFormControl = useFormControl();
|
|
12139
12140
|
let shrink = shrinkProp;
|
|
12140
12141
|
if (typeof shrink === 'undefined' && muiFormControl) {
|
|
@@ -12237,7 +12238,7 @@ function getFormControlUtilityClasses(slot) {
|
|
|
12237
12238
|
}
|
|
12238
12239
|
generateUtilityClasses('MuiFormControl', ['root', 'marginNone', 'marginNormal', 'marginDense', 'fullWidth', 'disabled']);
|
|
12239
12240
|
|
|
12240
|
-
const _excluded$
|
|
12241
|
+
const _excluded$v = ["children", "className", "color", "component", "disabled", "error", "focused", "fullWidth", "hiddenLabel", "margin", "required", "size", "variant"];
|
|
12241
12242
|
const useUtilityClasses$h = ownerState => {
|
|
12242
12243
|
const {
|
|
12243
12244
|
classes,
|
|
@@ -12323,7 +12324,7 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
12323
12324
|
size = 'medium',
|
|
12324
12325
|
variant = 'outlined'
|
|
12325
12326
|
} = props,
|
|
12326
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
12327
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$v);
|
|
12327
12328
|
const ownerState = _extends$1({}, props, {
|
|
12328
12329
|
color,
|
|
12329
12330
|
component,
|
|
@@ -12519,7 +12520,7 @@ const formHelperTextClasses = generateUtilityClasses('MuiFormHelperText', ['root
|
|
|
12519
12520
|
var formHelperTextClasses$1 = formHelperTextClasses;
|
|
12520
12521
|
|
|
12521
12522
|
var _span$1;
|
|
12522
|
-
const _excluded$
|
|
12523
|
+
const _excluded$u = ["children", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"];
|
|
12523
12524
|
const useUtilityClasses$g = ownerState => {
|
|
12524
12525
|
const {
|
|
12525
12526
|
classes,
|
|
@@ -12578,7 +12579,7 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
|
|
|
12578
12579
|
className,
|
|
12579
12580
|
component = 'p'
|
|
12580
12581
|
} = props,
|
|
12581
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
12582
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$u);
|
|
12582
12583
|
const muiFormControl = useFormControl();
|
|
12583
12584
|
const fcs = formControlState({
|
|
12584
12585
|
props,
|
|
@@ -12684,7 +12685,7 @@ function getListUtilityClass(slot) {
|
|
|
12684
12685
|
}
|
|
12685
12686
|
generateUtilityClasses('MuiList', ['root', 'padding', 'dense', 'subheader']);
|
|
12686
12687
|
|
|
12687
|
-
const _excluded$
|
|
12688
|
+
const _excluded$t = ["children", "className", "component", "dense", "disablePadding", "subheader"];
|
|
12688
12689
|
const useUtilityClasses$f = ownerState => {
|
|
12689
12690
|
const {
|
|
12690
12691
|
classes,
|
|
@@ -12732,7 +12733,7 @@ const List = /*#__PURE__*/React.forwardRef(function List(inProps, ref) {
|
|
|
12732
12733
|
disablePadding = false,
|
|
12733
12734
|
subheader
|
|
12734
12735
|
} = props,
|
|
12735
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
12736
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$t);
|
|
12736
12737
|
const context = React.useMemo(() => ({
|
|
12737
12738
|
dense
|
|
12738
12739
|
}), [dense]);
|
|
@@ -12799,7 +12800,7 @@ process.env.NODE_ENV !== "production" ? List.propTypes /* remove-proptypes */ =
|
|
|
12799
12800
|
} : void 0;
|
|
12800
12801
|
var List$1 = List;
|
|
12801
12802
|
|
|
12802
|
-
const _excluded$
|
|
12803
|
+
const _excluded$s = ["actions", "autoFocus", "autoFocusItem", "children", "className", "disabledItemsFocusable", "disableListWrap", "onKeyDown", "variant"];
|
|
12803
12804
|
function nextItem(list, item, disableListWrap) {
|
|
12804
12805
|
if (list === item) {
|
|
12805
12806
|
return list.firstChild;
|
|
@@ -12881,7 +12882,7 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
|
|
|
12881
12882
|
onKeyDown,
|
|
12882
12883
|
variant = 'selectedMenu'
|
|
12883
12884
|
} = props,
|
|
12884
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
12885
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$s);
|
|
12885
12886
|
const listRef = React.useRef(null);
|
|
12886
12887
|
const textCriteriaRef = React.useRef({
|
|
12887
12888
|
keys: [],
|
|
@@ -14071,7 +14072,7 @@ function getTransitionProps(props, options) {
|
|
|
14071
14072
|
};
|
|
14072
14073
|
}
|
|
14073
14074
|
|
|
14074
|
-
const _excluded$
|
|
14075
|
+
const _excluded$r = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
|
|
14075
14076
|
function getScale$1(value) {
|
|
14076
14077
|
return `scale(${value}, ${value ** 2})`;
|
|
14077
14078
|
}
|
|
@@ -14115,7 +14116,7 @@ const Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {
|
|
|
14115
14116
|
// eslint-disable-next-line react/prop-types
|
|
14116
14117
|
TransitionComponent = Transition$1
|
|
14117
14118
|
} = props,
|
|
14118
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14119
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$r);
|
|
14119
14120
|
const timer = React.useRef();
|
|
14120
14121
|
const autoTimeout = React.useRef();
|
|
14121
14122
|
const theme = useTheme();
|
|
@@ -14319,7 +14320,7 @@ process.env.NODE_ENV !== "production" ? Grow.propTypes /* remove-proptypes */ =
|
|
|
14319
14320
|
Grow.muiSupportAuto = true;
|
|
14320
14321
|
var Grow$1 = Grow;
|
|
14321
14322
|
|
|
14322
|
-
const _excluded$
|
|
14323
|
+
const _excluded$q = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
|
|
14323
14324
|
const styles = {
|
|
14324
14325
|
entering: {
|
|
14325
14326
|
opacity: 1
|
|
@@ -14356,7 +14357,7 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
|
|
|
14356
14357
|
// eslint-disable-next-line react/prop-types
|
|
14357
14358
|
TransitionComponent = Transition$1
|
|
14358
14359
|
} = props,
|
|
14359
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14360
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$q);
|
|
14360
14361
|
const nodeRef = React.useRef(null);
|
|
14361
14362
|
const handleRef = useForkRef(nodeRef, children.ref, ref);
|
|
14362
14363
|
const normalizedTransitionCallback = callback => maybeIsAppearing => {
|
|
@@ -14517,7 +14518,7 @@ function getBackdropUtilityClass(slot) {
|
|
|
14517
14518
|
}
|
|
14518
14519
|
generateUtilityClasses('MuiBackdrop', ['root', 'invisible']);
|
|
14519
14520
|
|
|
14520
|
-
const _excluded$
|
|
14521
|
+
const _excluded$p = ["children", "className", "component", "components", "componentsProps", "invisible", "open", "slotProps", "slots", "TransitionComponent", "transitionDuration"];
|
|
14521
14522
|
const useUtilityClasses$e = ownerState => {
|
|
14522
14523
|
const {
|
|
14523
14524
|
classes,
|
|
@@ -14572,7 +14573,7 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
|
|
|
14572
14573
|
TransitionComponent = Fade$1,
|
|
14573
14574
|
transitionDuration
|
|
14574
14575
|
} = props,
|
|
14575
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14576
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$p);
|
|
14576
14577
|
const ownerState = _extends$1({}, props, {
|
|
14577
14578
|
component,
|
|
14578
14579
|
invisible
|
|
@@ -14693,7 +14694,7 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes /* remove-proptypes *
|
|
|
14693
14694
|
} : void 0;
|
|
14694
14695
|
var Backdrop$1 = Backdrop;
|
|
14695
14696
|
|
|
14696
|
-
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"];
|
|
14697
14698
|
const ModalRoot = styled$1('div', {
|
|
14698
14699
|
name: 'MuiModal',
|
|
14699
14700
|
slot: 'Root',
|
|
@@ -14772,7 +14773,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
14772
14773
|
// eslint-disable-next-line react/prop-types
|
|
14773
14774
|
theme
|
|
14774
14775
|
} = props,
|
|
14775
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14776
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$o);
|
|
14776
14777
|
const [exited, setExited] = React.useState(true);
|
|
14777
14778
|
const commonProps = {
|
|
14778
14779
|
container,
|
|
@@ -14996,7 +14997,7 @@ function getPaperUtilityClass(slot) {
|
|
|
14996
14997
|
}
|
|
14997
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']);
|
|
14998
14999
|
|
|
14999
|
-
const _excluded$
|
|
15000
|
+
const _excluded$n = ["className", "component", "elevation", "square", "variant"];
|
|
15000
15001
|
const useUtilityClasses$d = ownerState => {
|
|
15001
15002
|
const {
|
|
15002
15003
|
square,
|
|
@@ -15051,7 +15052,7 @@ const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
|
|
|
15051
15052
|
square = false,
|
|
15052
15053
|
variant = 'elevation'
|
|
15053
15054
|
} = props,
|
|
15054
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
15055
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$n);
|
|
15055
15056
|
const ownerState = _extends$1({}, props, {
|
|
15056
15057
|
component,
|
|
15057
15058
|
elevation,
|
|
@@ -15132,7 +15133,7 @@ function getPopoverUtilityClass(slot) {
|
|
|
15132
15133
|
}
|
|
15133
15134
|
generateUtilityClasses('MuiPopover', ['root', 'paper']);
|
|
15134
15135
|
|
|
15135
|
-
const _excluded$
|
|
15136
|
+
const _excluded$m = ["onEntering"],
|
|
15136
15137
|
_excluded2$2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
|
|
15137
15138
|
_excluded3 = ["slotProps"];
|
|
15138
15139
|
function getOffsetTop(rect, vertical) {
|
|
@@ -15229,7 +15230,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
15229
15230
|
onEntering
|
|
15230
15231
|
} = {}
|
|
15231
15232
|
} = props,
|
|
15232
|
-
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$
|
|
15233
|
+
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$m),
|
|
15233
15234
|
other = _objectWithoutPropertiesLoose(props, _excluded2$2);
|
|
15234
15235
|
const externalPaperSlotProps = (_slotProps$paper = slotProps == null ? void 0 : slotProps.paper) != null ? _slotProps$paper : PaperPropsProp;
|
|
15235
15236
|
const paperRef = React.useRef();
|
|
@@ -15635,7 +15636,7 @@ function getMenuUtilityClass(slot) {
|
|
|
15635
15636
|
}
|
|
15636
15637
|
generateUtilityClasses('MuiMenu', ['root', 'paper', 'list']);
|
|
15637
15638
|
|
|
15638
|
-
const _excluded$
|
|
15639
|
+
const _excluded$l = ["onEntering"],
|
|
15639
15640
|
_excluded2$1 = ["autoFocus", "children", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant"];
|
|
15640
15641
|
const RTL_ORIGIN = {
|
|
15641
15642
|
vertical: 'top',
|
|
@@ -15702,7 +15703,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
15702
15703
|
} = {},
|
|
15703
15704
|
variant = 'selectedMenu'
|
|
15704
15705
|
} = props,
|
|
15705
|
-
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$
|
|
15706
|
+
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$l),
|
|
15706
15707
|
other = _objectWithoutPropertiesLoose(props, _excluded2$1);
|
|
15707
15708
|
const theme = useTheme();
|
|
15708
15709
|
const isRtl = theme.direction === 'rtl';
|
|
@@ -15892,7 +15893,7 @@ function getNativeSelectUtilityClasses(slot) {
|
|
|
15892
15893
|
const nativeSelectClasses = generateUtilityClasses('MuiNativeSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
|
|
15893
15894
|
var nativeSelectClasses$1 = nativeSelectClasses;
|
|
15894
15895
|
|
|
15895
|
-
const _excluded$
|
|
15896
|
+
const _excluded$k = ["className", "disabled", "error", "IconComponent", "inputRef", "variant"];
|
|
15896
15897
|
const useUtilityClasses$a = ownerState => {
|
|
15897
15898
|
const {
|
|
15898
15899
|
classes,
|
|
@@ -16021,7 +16022,7 @@ const NativeSelectInput = /*#__PURE__*/React.forwardRef(function NativeSelectInp
|
|
|
16021
16022
|
inputRef,
|
|
16022
16023
|
variant = 'standard'
|
|
16023
16024
|
} = props,
|
|
16024
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
16025
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$k);
|
|
16025
16026
|
const ownerState = _extends$1({}, props, {
|
|
16026
16027
|
disabled,
|
|
16027
16028
|
variant,
|
|
@@ -16106,7 +16107,7 @@ const selectClasses = generateUtilityClasses('MuiSelect', ['select', 'multiple',
|
|
|
16106
16107
|
var selectClasses$1 = selectClasses;
|
|
16107
16108
|
|
|
16108
16109
|
var _span;
|
|
16109
|
-
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"];
|
|
16110
16111
|
const SelectSelect = styled$1('div', {
|
|
16111
16112
|
name: 'MuiSelect',
|
|
16112
16113
|
slot: 'Select',
|
|
@@ -16228,7 +16229,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
16228
16229
|
value: valueProp,
|
|
16229
16230
|
variant = 'standard'
|
|
16230
16231
|
} = props,
|
|
16231
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
16232
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$j);
|
|
16232
16233
|
const [value, setValueState] = useControlled({
|
|
16233
16234
|
controlled: valueProp,
|
|
16234
16235
|
default: defaultValue,
|
|
@@ -16739,7 +16740,7 @@ function getSvgIconUtilityClass(slot) {
|
|
|
16739
16740
|
}
|
|
16740
16741
|
generateUtilityClasses('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);
|
|
16741
16742
|
|
|
16742
|
-
const _excluded$
|
|
16743
|
+
const _excluded$i = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
|
|
16743
16744
|
const useUtilityClasses$8 = ownerState => {
|
|
16744
16745
|
const {
|
|
16745
16746
|
color,
|
|
@@ -16805,7 +16806,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
16805
16806
|
titleAccess,
|
|
16806
16807
|
viewBox = '0 0 24 24'
|
|
16807
16808
|
} = props,
|
|
16808
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
16809
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$i);
|
|
16809
16810
|
const ownerState = _extends$1({}, props, {
|
|
16810
16811
|
color,
|
|
16811
16812
|
component,
|
|
@@ -16931,7 +16932,7 @@ var ArrowDropDownIcon = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path"
|
|
|
16931
16932
|
d: "M7 10l5 5 5-5z"
|
|
16932
16933
|
}), 'ArrowDropDown');
|
|
16933
16934
|
|
|
16934
|
-
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"];
|
|
16935
16936
|
const useUtilityClasses$7 = ownerState => {
|
|
16936
16937
|
const {
|
|
16937
16938
|
classes
|
|
@@ -16975,7 +16976,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
16975
16976
|
SelectDisplayProps,
|
|
16976
16977
|
variant: variantProp = 'outlined'
|
|
16977
16978
|
} = props,
|
|
16978
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
16979
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$h);
|
|
16979
16980
|
const inputComponent = native ? NativeSelectInput$1 : SelectInput$1;
|
|
16980
16981
|
const muiFormControl = useFormControl();
|
|
16981
16982
|
const fcs = formControlState({
|
|
@@ -17198,7 +17199,7 @@ function getTextFieldUtilityClass(slot) {
|
|
|
17198
17199
|
}
|
|
17199
17200
|
generateUtilityClasses('MuiTextField', ['root']);
|
|
17200
17201
|
|
|
17201
|
-
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"];
|
|
17202
17203
|
const variantComponent = {
|
|
17203
17204
|
standard: Input$1,
|
|
17204
17205
|
filled: FilledInput$1,
|
|
@@ -17291,7 +17292,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
17291
17292
|
value,
|
|
17292
17293
|
variant = 'outlined'
|
|
17293
17294
|
} = props,
|
|
17294
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
17295
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$g);
|
|
17295
17296
|
const ownerState = _extends$1({}, props, {
|
|
17296
17297
|
autoFocus,
|
|
17297
17298
|
color,
|
|
@@ -17639,7 +17640,7 @@ const isBetweenOperator = {
|
|
|
17639
17640
|
label: 'is between',
|
|
17640
17641
|
value: 'isBetween',
|
|
17641
17642
|
getApplyFilterFn: filterItem => {
|
|
17642
|
-
if (!filterItem.
|
|
17643
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17643
17644
|
return null;
|
|
17644
17645
|
}
|
|
17645
17646
|
if (!Array.isArray(filterItem.value) || filterItem.value.length !== 2) {
|
|
@@ -17652,7 +17653,7 @@ const isBetweenOperator = {
|
|
|
17652
17653
|
return null;
|
|
17653
17654
|
}
|
|
17654
17655
|
return params => {
|
|
17655
|
-
return params.value !== null && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
|
|
17656
|
+
return params.value !== null && params.value !== undefined && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
|
|
17656
17657
|
};
|
|
17657
17658
|
},
|
|
17658
17659
|
InputComponent: InputNumberInterval
|
|
@@ -17661,11 +17662,53 @@ const IS_BETWEEN = isBetweenOperator;
|
|
|
17661
17662
|
|
|
17662
17663
|
const getGridNumericOperators = () => [...getGridNumericOperators$1(), IS_BETWEEN];
|
|
17663
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
|
+
|
|
17664
17707
|
const containsAnyOfOperator = {
|
|
17665
17708
|
label: 'contains any of',
|
|
17666
17709
|
value: 'containsAnyOf',
|
|
17667
17710
|
getApplyFilterFn: filterItem => {
|
|
17668
|
-
if (!filterItem.
|
|
17711
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17669
17712
|
return null;
|
|
17670
17713
|
}
|
|
17671
17714
|
return params => {
|
|
@@ -17688,7 +17731,7 @@ const containsAnyOfCIOperator = {
|
|
|
17688
17731
|
label: 'contains any of (case insensitive)',
|
|
17689
17732
|
value: 'containsAnyOf',
|
|
17690
17733
|
getApplyFilterFn: filterItem => {
|
|
17691
|
-
if (!filterItem.
|
|
17734
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17692
17735
|
return null;
|
|
17693
17736
|
}
|
|
17694
17737
|
return params => {
|
|
@@ -17715,7 +17758,7 @@ const endsWithAnyOfOperator = {
|
|
|
17715
17758
|
label: 'ends with any of',
|
|
17716
17759
|
value: 'endsWithAnyOf',
|
|
17717
17760
|
getApplyFilterFn: filterItem => {
|
|
17718
|
-
if (!filterItem.
|
|
17761
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17719
17762
|
return null;
|
|
17720
17763
|
}
|
|
17721
17764
|
return params => {
|
|
@@ -17742,7 +17785,7 @@ const isAnyOfOperator = {
|
|
|
17742
17785
|
label: 'is any of',
|
|
17743
17786
|
value: 'isAnyOf',
|
|
17744
17787
|
getApplyFilterFn: filterItem => {
|
|
17745
|
-
if (!filterItem.
|
|
17788
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17746
17789
|
return null;
|
|
17747
17790
|
}
|
|
17748
17791
|
return params => {
|
|
@@ -17766,7 +17809,7 @@ const isNotAnyOfOperator = {
|
|
|
17766
17809
|
label: 'is not any of',
|
|
17767
17810
|
value: 'isNotAnyOf',
|
|
17768
17811
|
getApplyFilterFn: filterItem => {
|
|
17769
|
-
if (!filterItem.
|
|
17812
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17770
17813
|
return null;
|
|
17771
17814
|
}
|
|
17772
17815
|
return params => {
|
|
@@ -17790,7 +17833,7 @@ const startsWithAnyOfOperator = {
|
|
|
17790
17833
|
label: 'starts with any of',
|
|
17791
17834
|
value: 'startsWithAnyOf',
|
|
17792
17835
|
getApplyFilterFn: filterItem => {
|
|
17793
|
-
if (!filterItem.
|
|
17836
|
+
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
17794
17837
|
return null;
|
|
17795
17838
|
}
|
|
17796
17839
|
return params => {
|
|
@@ -17815,11 +17858,27 @@ const STARTS_WITH_ANY_OF = startsWithAnyOfOperator;
|
|
|
17815
17858
|
|
|
17816
17859
|
const getGridStringArrayOperators = () => [CONTAINS_ANY_OF, ENDS_WITH_ANY_OF, IS_ANY_OF, IS_NOT_ANY_OF, STARTS_WITH_ANY_OF];
|
|
17817
17860
|
|
|
17818
|
-
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
|
+
};
|
|
17819
17878
|
|
|
17820
17879
|
const API_URL = 'https://api.openai.com/v1/chat/completions';
|
|
17821
17880
|
async function getCompletion(text, role, openai_api_key) {
|
|
17822
|
-
let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-
|
|
17881
|
+
let model = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'gpt-3.5-turbo-1106';
|
|
17823
17882
|
try {
|
|
17824
17883
|
const messages = [{
|
|
17825
17884
|
role: 'system',
|
|
@@ -21920,7 +21979,7 @@ const StyledGridToolbarFilterSemanticField = styled$3.form`
|
|
|
21920
21979
|
}
|
|
21921
21980
|
`;
|
|
21922
21981
|
|
|
21923
|
-
const _excluded$
|
|
21982
|
+
const _excluded$f = ["className", "nlpFilterConfig", "onFilterModelChange", "dateFormat", "defaultModel", "defaultFilter", "disablePower", "localeText"];
|
|
21924
21983
|
const COMPONENT_NAME$2 = 'GridToolbarFilterSemanticField';
|
|
21925
21984
|
const CLASSNAME$2 = 'redsift-datagrid-toolbar-nlp-filter-field';
|
|
21926
21985
|
const DEFAULT_OPERATORS = {
|
|
@@ -21951,16 +22010,16 @@ const getRole = (config, dateFormat) => {
|
|
|
21951
22010
|
}).join('\n');
|
|
21952
22011
|
return `The AI assistant parses user input to generate a JSON object that will be used as a row filter for a data table MUI Data Grid.
|
|
21953
22012
|
The filter supports mulitple conditions using only two logical operator "and", "or". It only allows "and" between all conditions or "or" between all conditions. It can't mix the two types.
|
|
21954
|
-
The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "
|
|
21955
|
-
- "
|
|
21956
|
-
- "items": a list of conditions, each is an object with exactly the three keys "
|
|
21957
|
-
- "
|
|
22013
|
+
The AI assistant extracts information from the user input and generates a JSON object with exactly the two keys "logicOperator" and "items":
|
|
22014
|
+
- "logicOperator": the logical operator, only "and" or "or" are allowed. If there is only one condition in the "items", use "and".
|
|
22015
|
+
- "items": a list of conditions, each is an object with exactly the three keys "field", "operator" and "value":
|
|
22016
|
+
- "field": the column name, must be one of ${columns}
|
|
21958
22017
|
- "value":
|
|
21959
|
-
- this can be skipped if the "
|
|
21960
|
-
- a list of multiple values if the "
|
|
22018
|
+
- this can be skipped if the "operator" is either "isEmpty" or "isNotEmpty"
|
|
22019
|
+
- a list of multiple values if the "operator" ends with "AnyOf"
|
|
21961
22020
|
- otherwise, it's a single value represented as a string: "true" instead of true, "false" instead of false, "0.6" instead of 0.6.
|
|
21962
22021
|
For "date" data type, use ${dateFormat}. If relative date is input, convert to the actual date given today is ${today}.
|
|
21963
|
-
- "
|
|
22022
|
+
- "operator": the comparison operator, accepted values depend on the data type of the column
|
|
21964
22023
|
${operators}
|
|
21965
22024
|
|
|
21966
22025
|
Below is the datatype in square bracket, constraints on the data range if any, followed by the description of each column used in the data table:
|
|
@@ -21997,15 +22056,15 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
21997
22056
|
nlpFilterConfig,
|
|
21998
22057
|
onFilterModelChange,
|
|
21999
22058
|
dateFormat = 'yyyy-mm-dd',
|
|
22000
|
-
defaultModel = 'gpt-4-
|
|
22059
|
+
defaultModel = 'gpt-4-1106-preview',
|
|
22001
22060
|
defaultFilter = {
|
|
22002
22061
|
items: [],
|
|
22003
|
-
|
|
22062
|
+
logicOperator: 'and'
|
|
22004
22063
|
},
|
|
22005
22064
|
disablePower = false,
|
|
22006
22065
|
localeText
|
|
22007
22066
|
} = props,
|
|
22008
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22067
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$f);
|
|
22009
22068
|
const {
|
|
22010
22069
|
textLabel,
|
|
22011
22070
|
textPlaceholder,
|
|
@@ -22078,7 +22137,7 @@ const GridToolbarFilterSemanticField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22078
22137
|
value: prompt
|
|
22079
22138
|
}), /*#__PURE__*/React__default.createElement(Button, {
|
|
22080
22139
|
variant: "primary",
|
|
22081
|
-
"
|
|
22140
|
+
"aria-label": buttonAriaLabel,
|
|
22082
22141
|
type: "submit",
|
|
22083
22142
|
isLoading: isLoading
|
|
22084
22143
|
}, buttonText)), !disablePower && /*#__PURE__*/React__default.createElement(Tooltip, null, /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, /*#__PURE__*/React__default.createElement(Switch, {
|
|
@@ -22100,7 +22159,7 @@ GridToolbarFilterSemanticField.displayName = COMPONENT_NAME$2;
|
|
|
22100
22159
|
|
|
22101
22160
|
/** ------ */
|
|
22102
22161
|
|
|
22103
|
-
const Toolbar$
|
|
22162
|
+
const Toolbar$2 = props => {
|
|
22104
22163
|
const {
|
|
22105
22164
|
hasExportButton = true,
|
|
22106
22165
|
exportButtonProps,
|
|
@@ -22139,7 +22198,7 @@ const Toolbar$3 = props => {
|
|
|
22139
22198
|
let {
|
|
22140
22199
|
apiRef
|
|
22141
22200
|
} = _ref;
|
|
22142
|
-
return
|
|
22201
|
+
return gridExpandedSortedRowIdsSelector(apiRef);
|
|
22143
22202
|
}
|
|
22144
22203
|
},
|
|
22145
22204
|
printOptions: {
|
|
@@ -22153,7 +22212,7 @@ const Toolbar$3 = props => {
|
|
|
22153
22212
|
}, semanticFilterProps ? /*#__PURE__*/React__default.createElement(GridToolbarFilterSemanticField, semanticFilterProps) : null)));
|
|
22154
22213
|
};
|
|
22155
22214
|
|
|
22156
|
-
const _excluded$
|
|
22215
|
+
const _excluded$e = ["displayName"];
|
|
22157
22216
|
const muiIconToDSIcon = {
|
|
22158
22217
|
ColumnFilteredIcon: mdiFilterVariant,
|
|
22159
22218
|
ColumnSelectorIcon: mdiViewColumn,
|
|
@@ -22171,7 +22230,7 @@ const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22171
22230
|
const {
|
|
22172
22231
|
displayName
|
|
22173
22232
|
} = props,
|
|
22174
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22233
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$e);
|
|
22175
22234
|
return /*#__PURE__*/React__default.createElement(Icon, _extends$2({}, forwardedProps, forwardedProps.inputProps, {
|
|
22176
22235
|
ref: ref,
|
|
22177
22236
|
size: forwardedProps.fontSize,
|
|
@@ -22179,7 +22238,7 @@ const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22179
22238
|
}));
|
|
22180
22239
|
});
|
|
22181
22240
|
|
|
22182
|
-
const _excluded$
|
|
22241
|
+
const _excluded$d = ["children", "color", "onClick", "startIcon"];
|
|
22183
22242
|
const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
22184
22243
|
var _props$className;
|
|
22185
22244
|
const {
|
|
@@ -22188,7 +22247,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22188
22247
|
onClick,
|
|
22189
22248
|
startIcon
|
|
22190
22249
|
} = props,
|
|
22191
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22250
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$d);
|
|
22192
22251
|
const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
|
|
22193
22252
|
if ((_props$className = props.className) !== null && _props$className !== void 0 && _props$className.includes('redsift-condensed')) {
|
|
22194
22253
|
return /*#__PURE__*/React__default.createElement(IconButton$2, _extends$2({}, forwardedProps, {
|
|
@@ -22214,7 +22273,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22214
22273
|
}), children);
|
|
22215
22274
|
});
|
|
22216
22275
|
|
|
22217
|
-
const _excluded$
|
|
22276
|
+
const _excluded$c = ["checked", "indeterminate", "disabled", "onChange"];
|
|
22218
22277
|
const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
22219
22278
|
const {
|
|
22220
22279
|
checked,
|
|
@@ -22222,7 +22281,7 @@ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22222
22281
|
disabled,
|
|
22223
22282
|
onChange
|
|
22224
22283
|
} = props,
|
|
22225
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
22284
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$c);
|
|
22226
22285
|
return /*#__PURE__*/React__default.createElement(Checkbox, _extends$2({}, forwardedProps, forwardedProps.inputProps, {
|
|
22227
22286
|
isSelected: checked && !indeterminate,
|
|
22228
22287
|
isDisabled: disabled,
|
|
@@ -22232,7 +22291,7 @@ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22232
22291
|
}));
|
|
22233
22292
|
});
|
|
22234
22293
|
|
|
22235
|
-
const _excluded$
|
|
22294
|
+
const _excluded$b = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
|
|
22236
22295
|
const PopperRoot = styled$1(BasePopper$1, {
|
|
22237
22296
|
name: 'MuiPopper',
|
|
22238
22297
|
slot: 'Root',
|
|
@@ -22275,7 +22334,7 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
|
22275
22334
|
slots,
|
|
22276
22335
|
slotProps
|
|
22277
22336
|
} = props,
|
|
22278
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
22337
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$b);
|
|
22279
22338
|
const RootComponent = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components == null ? void 0 : components.Root;
|
|
22280
22339
|
const otherProps = _extends$1({
|
|
22281
22340
|
anchorEl,
|
|
@@ -22515,7 +22574,7 @@ process.env.NODE_ENV !== "production" ? Ripple.propTypes = {
|
|
|
22515
22574
|
const touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);
|
|
22516
22575
|
var touchRippleClasses$1 = touchRippleClasses;
|
|
22517
22576
|
|
|
22518
|
-
const _excluded$
|
|
22577
|
+
const _excluded$a = ["center", "classes", "className"];
|
|
22519
22578
|
let _ = t => t,
|
|
22520
22579
|
_t,
|
|
22521
22580
|
_t2,
|
|
@@ -22644,7 +22703,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
|
|
|
22644
22703
|
classes = {},
|
|
22645
22704
|
className
|
|
22646
22705
|
} = props,
|
|
22647
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
22706
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$a);
|
|
22648
22707
|
const [ripples, setRipples] = React.useState([]);
|
|
22649
22708
|
const nextKey = React.useRef(0);
|
|
22650
22709
|
const rippleCallback = React.useRef(null);
|
|
@@ -22845,7 +22904,7 @@ function getButtonBaseUtilityClass(slot) {
|
|
|
22845
22904
|
const buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);
|
|
22846
22905
|
var buttonBaseClasses$1 = buttonBaseClasses;
|
|
22847
22906
|
|
|
22848
|
-
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"];
|
|
22849
22908
|
const useUtilityClasses$5 = ownerState => {
|
|
22850
22909
|
const {
|
|
22851
22910
|
disabled,
|
|
@@ -22947,7 +23006,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
22947
23006
|
touchRippleRef,
|
|
22948
23007
|
type
|
|
22949
23008
|
} = props,
|
|
22950
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
23009
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$9);
|
|
22951
23010
|
const buttonRef = React.useRef(null);
|
|
22952
23011
|
const rippleRef = React.useRef(null);
|
|
22953
23012
|
const handleRippleRef = useForkRef(rippleRef, touchRippleRef);
|
|
@@ -23320,7 +23379,7 @@ function getMenuItemUtilityClass(slot) {
|
|
|
23320
23379
|
const menuItemClasses = generateUtilityClasses('MuiMenuItem', ['root', 'focusVisible', 'dense', 'disabled', 'divider', 'gutters', 'selected']);
|
|
23321
23380
|
var menuItemClasses$1 = menuItemClasses;
|
|
23322
23381
|
|
|
23323
|
-
const _excluded$
|
|
23382
|
+
const _excluded$8 = ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex", "className"];
|
|
23324
23383
|
const overridesResolver = (props, styles) => {
|
|
23325
23384
|
const {
|
|
23326
23385
|
ownerState
|
|
@@ -23442,7 +23501,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
|
|
|
23442
23501
|
tabIndex: tabIndexProp,
|
|
23443
23502
|
className
|
|
23444
23503
|
} = props,
|
|
23445
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
23504
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$8);
|
|
23446
23505
|
const context = React.useContext(ListContext$1);
|
|
23447
23506
|
const childContext = React.useMemo(() => ({
|
|
23448
23507
|
dense: dense || context.dense || false,
|
|
@@ -23585,7 +23644,7 @@ function getTableCellUtilityClass(slot) {
|
|
|
23585
23644
|
const tableCellClasses = generateUtilityClasses('MuiTableCell', ['root', 'head', 'body', 'footer', 'sizeSmall', 'sizeMedium', 'paddingCheckbox', 'paddingNone', 'alignLeft', 'alignCenter', 'alignRight', 'alignJustify', 'stickyHeader']);
|
|
23586
23645
|
var tableCellClasses$1 = tableCellClasses;
|
|
23587
23646
|
|
|
23588
|
-
const _excluded$
|
|
23647
|
+
const _excluded$7 = ["align", "className", "component", "padding", "scope", "size", "sortDirection", "variant"];
|
|
23589
23648
|
const useUtilityClasses$3 = ownerState => {
|
|
23590
23649
|
const {
|
|
23591
23650
|
classes,
|
|
@@ -23682,7 +23741,7 @@ const TableCell = /*#__PURE__*/React.forwardRef(function TableCell(inProps, ref)
|
|
|
23682
23741
|
sortDirection,
|
|
23683
23742
|
variant: variantProp
|
|
23684
23743
|
} = props,
|
|
23685
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
23744
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$7);
|
|
23686
23745
|
const table = React.useContext(TableContext$1);
|
|
23687
23746
|
const tablelvl2 = React.useContext(Tablelvl2Context$1);
|
|
23688
23747
|
const isHeadCell = tablelvl2 && tablelvl2.variant === 'head';
|
|
@@ -23789,7 +23848,7 @@ function getToolbarUtilityClass(slot) {
|
|
|
23789
23848
|
}
|
|
23790
23849
|
generateUtilityClasses('MuiToolbar', ['root', 'gutters', 'regular', 'dense']);
|
|
23791
23850
|
|
|
23792
|
-
const _excluded$
|
|
23851
|
+
const _excluded$6 = ["className", "component", "disableGutters", "variant"];
|
|
23793
23852
|
const useUtilityClasses$2 = ownerState => {
|
|
23794
23853
|
const {
|
|
23795
23854
|
classes,
|
|
@@ -23830,7 +23889,7 @@ const ToolbarRoot = styled$1('div', {
|
|
|
23830
23889
|
theme,
|
|
23831
23890
|
ownerState
|
|
23832
23891
|
}) => ownerState.variant === 'regular' && theme.mixins.toolbar);
|
|
23833
|
-
const Toolbar
|
|
23892
|
+
const Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
|
|
23834
23893
|
const props = useThemeProps({
|
|
23835
23894
|
props: inProps,
|
|
23836
23895
|
name: 'MuiToolbar'
|
|
@@ -23841,7 +23900,7 @@ const Toolbar$1 = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
|
|
|
23841
23900
|
disableGutters = false,
|
|
23842
23901
|
variant = 'regular'
|
|
23843
23902
|
} = props,
|
|
23844
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
23903
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$6);
|
|
23845
23904
|
const ownerState = _extends$1({}, props, {
|
|
23846
23905
|
component,
|
|
23847
23906
|
disableGutters,
|
|
@@ -23855,7 +23914,7 @@ const Toolbar$1 = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
|
|
|
23855
23914
|
ownerState: ownerState
|
|
23856
23915
|
}, other));
|
|
23857
23916
|
});
|
|
23858
|
-
process.env.NODE_ENV !== "production" ? Toolbar
|
|
23917
|
+
process.env.NODE_ENV !== "production" ? Toolbar.propTypes /* remove-proptypes */ = {
|
|
23859
23918
|
// ----------------------------- Warning --------------------------------
|
|
23860
23919
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
23861
23920
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -23893,7 +23952,7 @@ process.env.NODE_ENV !== "production" ? Toolbar$1.propTypes /* remove-proptypes
|
|
|
23893
23952
|
*/
|
|
23894
23953
|
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['dense', 'regular']), PropTypes.string])
|
|
23895
23954
|
} : void 0;
|
|
23896
|
-
var Toolbar$
|
|
23955
|
+
var Toolbar$1 = Toolbar;
|
|
23897
23956
|
|
|
23898
23957
|
var KeyboardArrowLeft = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
23899
23958
|
d: "M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"
|
|
@@ -23909,7 +23968,7 @@ function getIconButtonUtilityClass(slot) {
|
|
|
23909
23968
|
const iconButtonClasses = generateUtilityClasses('MuiIconButton', ['root', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning', 'edgeStart', 'edgeEnd', 'sizeSmall', 'sizeMedium', 'sizeLarge']);
|
|
23910
23969
|
var iconButtonClasses$1 = iconButtonClasses;
|
|
23911
23970
|
|
|
23912
|
-
const _excluded$
|
|
23971
|
+
const _excluded$5 = ["edge", "children", "className", "color", "disabled", "disableFocusRipple", "size"];
|
|
23913
23972
|
const useUtilityClasses$1 = ownerState => {
|
|
23914
23973
|
const {
|
|
23915
23974
|
classes,
|
|
@@ -24010,7 +24069,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
24010
24069
|
disableFocusRipple = false,
|
|
24011
24070
|
size = 'medium'
|
|
24012
24071
|
} = props,
|
|
24013
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
24072
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$5);
|
|
24014
24073
|
const ownerState = _extends$1({}, props, {
|
|
24015
24074
|
edge,
|
|
24016
24075
|
color,
|
|
@@ -24108,7 +24167,7 @@ var FirstPageIcon = createSvgIcon( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
|
|
|
24108
24167
|
}), 'FirstPage');
|
|
24109
24168
|
|
|
24110
24169
|
var _LastPageIcon, _FirstPageIcon, _KeyboardArrowRight, _KeyboardArrowLeft, _KeyboardArrowLeft2, _KeyboardArrowRight2, _FirstPageIcon2, _LastPageIcon2;
|
|
24111
|
-
const _excluded$
|
|
24170
|
+
const _excluded$4 = ["backIconButtonProps", "count", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton"];
|
|
24112
24171
|
const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginationActions(props, ref) {
|
|
24113
24172
|
const {
|
|
24114
24173
|
backIconButtonProps,
|
|
@@ -24121,7 +24180,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
24121
24180
|
showFirstButton,
|
|
24122
24181
|
showLastButton
|
|
24123
24182
|
} = props,
|
|
24124
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
24183
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$4);
|
|
24125
24184
|
const theme = useTheme();
|
|
24126
24185
|
const handleFirstPageButtonClick = event => {
|
|
24127
24186
|
onPageChange(event, 0);
|
|
@@ -24225,7 +24284,7 @@ const tablePaginationClasses = generateUtilityClasses('MuiTablePagination', ['ro
|
|
|
24225
24284
|
var tablePaginationClasses$1 = tablePaginationClasses;
|
|
24226
24285
|
|
|
24227
24286
|
var _InputBase;
|
|
24228
|
-
const _excluded$
|
|
24287
|
+
const _excluded$3 = ["ActionsComponent", "backIconButtonProps", "className", "colSpan", "component", "count", "getItemAriaLabel", "labelDisplayedRows", "labelRowsPerPage", "nextIconButtonProps", "onPageChange", "onRowsPerPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "SelectProps", "showFirstButton", "showLastButton"];
|
|
24229
24288
|
const TablePaginationRoot = styled$1(TableCell$1, {
|
|
24230
24289
|
name: 'MuiTablePagination',
|
|
24231
24290
|
slot: 'Root',
|
|
@@ -24241,7 +24300,7 @@ const TablePaginationRoot = styled$1(TableCell$1, {
|
|
|
24241
24300
|
padding: 0
|
|
24242
24301
|
}
|
|
24243
24302
|
}));
|
|
24244
|
-
const TablePaginationToolbar = styled$1(Toolbar$
|
|
24303
|
+
const TablePaginationToolbar = styled$1(Toolbar$1, {
|
|
24245
24304
|
name: 'MuiTablePagination',
|
|
24246
24305
|
slot: 'Toolbar',
|
|
24247
24306
|
overridesResolver: (props, styles) => _extends$1({
|
|
@@ -24372,7 +24431,7 @@ const TablePagination = /*#__PURE__*/React.forwardRef(function TablePagination(i
|
|
|
24372
24431
|
showFirstButton = false,
|
|
24373
24432
|
showLastButton = false
|
|
24374
24433
|
} = props,
|
|
24375
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
24434
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$3);
|
|
24376
24435
|
const ownerState = props;
|
|
24377
24436
|
const classes = useUtilityClasses(ownerState);
|
|
24378
24437
|
const MenuItemComponent = SelectProps.native ? 'option' : TablePaginationMenuItem;
|
|
@@ -24591,10 +24650,47 @@ process.env.NODE_ENV !== "production" ? TablePagination.propTypes /* remove-prop
|
|
|
24591
24650
|
} : void 0;
|
|
24592
24651
|
var TablePagination$1 = TablePagination;
|
|
24593
24652
|
|
|
24594
|
-
const
|
|
24595
|
-
|
|
24596
|
-
|
|
24597
|
-
|
|
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
|
+
|
|
24598
24694
|
const getSelectableRowsInTable = (apiRef, isRowSelectable) => {
|
|
24599
24695
|
return isRowSelectable && typeof isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref => {
|
|
24600
24696
|
let {
|
|
@@ -24617,11 +24713,9 @@ const ControlledPagination = _ref3 => {
|
|
|
24617
24713
|
displayPagination = false,
|
|
24618
24714
|
selectionStatus,
|
|
24619
24715
|
apiRef,
|
|
24620
|
-
|
|
24621
|
-
|
|
24622
|
-
|
|
24623
|
-
onPageSizeChange,
|
|
24624
|
-
rowsPerPageOptions,
|
|
24716
|
+
paginationModel,
|
|
24717
|
+
onPaginationModelChange,
|
|
24718
|
+
pageSizeOptions,
|
|
24625
24719
|
isRowSelectable,
|
|
24626
24720
|
paginationProps
|
|
24627
24721
|
} = _ref3;
|
|
@@ -24651,75 +24745,40 @@ const ControlledPagination = _ref3 => {
|
|
|
24651
24745
|
}, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
|
|
24652
24746
|
component: "div",
|
|
24653
24747
|
count: numberOfFilteredRowsInTable,
|
|
24654
|
-
page: page,
|
|
24655
|
-
onPageChange: (event,
|
|
24656
|
-
|
|
24657
|
-
|
|
24658
|
-
|
|
24659
|
-
|
|
24660
|
-
|
|
24661
|
-
|
|
24662
|
-
|
|
24663
|
-
|
|
24664
|
-
|
|
24665
|
-
selectionStatus,
|
|
24666
|
-
displaySelection,
|
|
24667
|
-
displayPagination,
|
|
24668
|
-
page,
|
|
24669
|
-
onPageChange,
|
|
24670
|
-
pageSize,
|
|
24671
|
-
onPageSizeChange,
|
|
24672
|
-
displayRowsPerPage,
|
|
24673
|
-
rowsPerPageOptions,
|
|
24674
|
-
paginationProps,
|
|
24675
|
-
rowCount
|
|
24676
|
-
} = _ref4;
|
|
24677
|
-
const totalNumberOfRowsInTable = rowCount;
|
|
24678
|
-
const totalRowsLabel = `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`;
|
|
24679
|
-
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)` : ''}.`;
|
|
24680
|
-
return /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
24681
|
-
flexDirection: "row",
|
|
24682
|
-
alignItems: "center",
|
|
24683
|
-
justifyContent: "space-between",
|
|
24684
|
-
marginBottom: "7px"
|
|
24685
|
-
}, displaySelection ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, selectionStatus.type === 'page' && selectionStatus.numberOfSelectedRowsInPage != 0 ? /*#__PURE__*/React__default.createElement(Text, {
|
|
24686
|
-
fontSize: "14px"
|
|
24687
|
-
}, pageRowsLabel) : selectionStatus.type === 'other' ? /*#__PURE__*/React__default.createElement(Text, {
|
|
24688
|
-
fontSize: "14px"
|
|
24689
|
-
}, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination$1, _extends$2({
|
|
24690
|
-
component: "div",
|
|
24691
|
-
count: totalNumberOfRowsInTable,
|
|
24692
|
-
page: page,
|
|
24693
|
-
onPageChange: (event, newPage) => onPageChange(newPage),
|
|
24694
|
-
rowsPerPage: pageSize,
|
|
24695
|
-
onRowsPerPageChange: event => {
|
|
24696
|
-
onPageSizeChange(parseInt(event.target.value, 10));
|
|
24697
|
-
},
|
|
24698
|
-
rowsPerPageOptions: displayRowsPerPage ? rowsPerPageOptions : []
|
|
24748
|
+
page: paginationModel.page,
|
|
24749
|
+
onPageChange: (event, page) => onPaginationModelChange({
|
|
24750
|
+
page,
|
|
24751
|
+
pageSize: paginationModel.pageSize
|
|
24752
|
+
}),
|
|
24753
|
+
rowsPerPage: paginationModel.pageSize,
|
|
24754
|
+
onRowsPerPageChange: event => onPaginationModelChange({
|
|
24755
|
+
page: paginationModel.page,
|
|
24756
|
+
pageSize: parseInt(event.target.value, 10)
|
|
24757
|
+
}),
|
|
24758
|
+
rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
|
|
24699
24759
|
}, paginationProps)) : null);
|
|
24700
24760
|
};
|
|
24701
|
-
|
|
24761
|
+
|
|
24762
|
+
const _excluded$2 = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "paginationModel", "onPaginationModelChange", "pageSizeOptions", "paginationProps", "paginationMode", "rowCount"];
|
|
24763
|
+
const ToolbarWrapper = _ref => {
|
|
24702
24764
|
let {
|
|
24703
24765
|
hideToolbar,
|
|
24704
24766
|
RenderedToolbar,
|
|
24705
24767
|
filterModel,
|
|
24706
24768
|
onFilterModelChange,
|
|
24707
24769
|
pagination,
|
|
24708
|
-
ControlledPagination,
|
|
24709
24770
|
paginationPlacement,
|
|
24710
24771
|
selectionStatus,
|
|
24711
24772
|
apiRef,
|
|
24712
24773
|
isRowSelectable,
|
|
24713
|
-
|
|
24714
|
-
|
|
24715
|
-
|
|
24716
|
-
onPageSizeChange,
|
|
24717
|
-
rowsPerPageOptions,
|
|
24774
|
+
paginationModel,
|
|
24775
|
+
onPaginationModelChange,
|
|
24776
|
+
pageSizeOptions,
|
|
24718
24777
|
paginationProps,
|
|
24719
24778
|
paginationMode = 'client',
|
|
24720
24779
|
rowCount
|
|
24721
|
-
} =
|
|
24722
|
-
forwardedProps = _objectWithoutProperties(
|
|
24780
|
+
} = _ref,
|
|
24781
|
+
forwardedProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
24723
24782
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !hideToolbar ? /*#__PURE__*/React__default.createElement(RenderedToolbar, _extends$2({}, forwardedProps, {
|
|
24724
24783
|
filterModel: filterModel,
|
|
24725
24784
|
onFilterModelChange: onFilterModelChange
|
|
@@ -24728,11 +24787,9 @@ const Toolbar = _ref5 => {
|
|
|
24728
24787
|
displayRowsPerPage: false,
|
|
24729
24788
|
displayPagination: ['top', 'both'].includes(paginationPlacement),
|
|
24730
24789
|
selectionStatus: selectionStatus.current,
|
|
24731
|
-
|
|
24732
|
-
|
|
24733
|
-
|
|
24734
|
-
onPageSizeChange: onPageSizeChange,
|
|
24735
|
-
rowsPerPageOptions: rowsPerPageOptions,
|
|
24790
|
+
paginationModel: paginationModel,
|
|
24791
|
+
onPaginationModelChange: onPaginationModelChange,
|
|
24792
|
+
pageSizeOptions: pageSizeOptions,
|
|
24736
24793
|
paginationProps: paginationProps,
|
|
24737
24794
|
rowCount: rowCount
|
|
24738
24795
|
}) : /*#__PURE__*/React__default.createElement(ControlledPagination, {
|
|
@@ -24742,26 +24799,877 @@ const Toolbar = _ref5 => {
|
|
|
24742
24799
|
selectionStatus: selectionStatus.current,
|
|
24743
24800
|
apiRef: apiRef,
|
|
24744
24801
|
isRowSelectable: isRowSelectable,
|
|
24745
|
-
|
|
24746
|
-
|
|
24747
|
-
|
|
24748
|
-
onPageSizeChange: onPageSizeChange,
|
|
24749
|
-
rowsPerPageOptions: rowsPerPageOptions,
|
|
24802
|
+
paginationModel: paginationModel,
|
|
24803
|
+
onPaginationModelChange: onPaginationModelChange,
|
|
24804
|
+
pageSizeOptions: pageSizeOptions,
|
|
24750
24805
|
paginationProps: paginationProps
|
|
24751
24806
|
}) : null);
|
|
24752
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';
|
|
24753
25661
|
const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionStatus, isRowSelectable, page, pageSize) => {
|
|
24754
|
-
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(
|
|
25662
|
+
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref => {
|
|
24755
25663
|
let {
|
|
24756
25664
|
model
|
|
24757
|
-
} =
|
|
25665
|
+
} = _ref;
|
|
24758
25666
|
return isRowSelectable({
|
|
24759
25667
|
row: model
|
|
24760
25668
|
});
|
|
24761
|
-
}).map(
|
|
25669
|
+
}).map(_ref2 => {
|
|
24762
25670
|
let {
|
|
24763
25671
|
id
|
|
24764
|
-
} =
|
|
25672
|
+
} = _ref2;
|
|
24765
25673
|
return id;
|
|
24766
25674
|
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
24767
25675
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
@@ -24805,35 +25713,75 @@ const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionS
|
|
|
24805
25713
|
};
|
|
24806
25714
|
}
|
|
24807
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
|
+
});
|
|
24808
25749
|
const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
24809
|
-
var _initialState$paginat, _initialState$paginat2;
|
|
25750
|
+
var _ref3, _ref4, _initialState$paginat, _initialState$paginat2, _initialState$paginat3, _pageSizeOptions$, _ref5, _initialState$paginat4, _initialState$paginat5, _initialState$paginat6;
|
|
24810
25751
|
const datagridRef = ref || useRef();
|
|
24811
25752
|
const {
|
|
24812
25753
|
apiRef: propsApiRef,
|
|
24813
25754
|
autoHeight,
|
|
24814
25755
|
className,
|
|
24815
|
-
|
|
24816
|
-
|
|
25756
|
+
slots,
|
|
25757
|
+
slotProps,
|
|
24817
25758
|
filterModel: propsFilterModel,
|
|
25759
|
+
columnVisibilityModel: propsColumnVisibilityModel,
|
|
25760
|
+
pinnedColumns: propsPinnedColumns,
|
|
25761
|
+
sortModel: propsSortModel,
|
|
24818
25762
|
height: propsHeight,
|
|
24819
25763
|
hideToolbar,
|
|
24820
25764
|
initialState,
|
|
24821
25765
|
isRowSelectable,
|
|
25766
|
+
isStateful: propsIsStateful,
|
|
24822
25767
|
license = process.env.MUI_LICENSE_KEY,
|
|
24823
25768
|
onFilterModelChange: propsOnFilterModelChange,
|
|
24824
|
-
|
|
24825
|
-
|
|
24826
|
-
|
|
24827
|
-
|
|
24828
|
-
|
|
24829
|
-
|
|
25769
|
+
rowSelectionModel: propsSelectionModel,
|
|
25770
|
+
paginationModel: propsPaginationModel,
|
|
25771
|
+
onPaginationModelChange: propsOnPaginationModelChange,
|
|
25772
|
+
onRowSelectionModelChange,
|
|
25773
|
+
onColumnVisibilityModelChange: propsOnColumnVisibilityModelChange,
|
|
25774
|
+
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
25775
|
+
onSortModelChange: propsOnSortModelChange,
|
|
24830
25776
|
pagination,
|
|
24831
25777
|
paginationPlacement = 'both',
|
|
24832
25778
|
paginationProps,
|
|
25779
|
+
pinnedCustomColumns,
|
|
24833
25780
|
rows,
|
|
24834
|
-
|
|
25781
|
+
pageSizeOptions,
|
|
24835
25782
|
sx,
|
|
24836
25783
|
theme: propsTheme,
|
|
25784
|
+
useRouter,
|
|
24837
25785
|
paginationMode = 'client',
|
|
24838
25786
|
rowCount
|
|
24839
25787
|
} = props,
|
|
@@ -24841,7 +25789,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24841
25789
|
const theme = useTheme$4(propsTheme);
|
|
24842
25790
|
const _apiRef = useGridApiRef();
|
|
24843
25791
|
const apiRef = propsApiRef !== null && propsApiRef !== void 0 ? propsApiRef : _apiRef;
|
|
24844
|
-
const RenderedToolbar =
|
|
25792
|
+
const RenderedToolbar = slots !== null && slots !== void 0 && slots.toolbar ? slots.toolbar : Toolbar$2;
|
|
24845
25793
|
LicenseInfo.setLicenseKey(license);
|
|
24846
25794
|
const height = propsHeight !== null && propsHeight !== void 0 ? propsHeight : autoHeight ? undefined : '500px';
|
|
24847
25795
|
const [filterModel, setFilterModel] = useState(propsFilterModel);
|
|
@@ -24855,52 +25803,74 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24855
25803
|
setFilterModel(model);
|
|
24856
25804
|
}
|
|
24857
25805
|
};
|
|
24858
|
-
const [
|
|
25806
|
+
const [columnVisibilityModel, setColumnVisibilityModel] = useState(propsColumnVisibilityModel);
|
|
24859
25807
|
useEffect(() => {
|
|
24860
|
-
|
|
24861
|
-
}, [
|
|
24862
|
-
const
|
|
24863
|
-
|
|
24864
|
-
|
|
24865
|
-
type: 'none',
|
|
24866
|
-
numberOfSelectedRows: 0,
|
|
24867
|
-
numberOfSelectedRowsInPage: 0,
|
|
24868
|
-
page,
|
|
24869
|
-
pageSize
|
|
24870
|
-
});
|
|
24871
|
-
const onPageChange = page => {
|
|
24872
|
-
if (propsOnPageChange) {
|
|
24873
|
-
propsOnPageChange(page, undefined);
|
|
25808
|
+
setColumnVisibilityModel(propsColumnVisibilityModel);
|
|
25809
|
+
}, [propsColumnVisibilityModel]);
|
|
25810
|
+
const onColumnVisibilityModelChange = (model, details) => {
|
|
25811
|
+
if (propsOnColumnVisibilityModelChange) {
|
|
25812
|
+
propsOnColumnVisibilityModelChange(model, details);
|
|
24874
25813
|
} else {
|
|
24875
|
-
|
|
25814
|
+
setColumnVisibilityModel(model);
|
|
24876
25815
|
}
|
|
24877
25816
|
};
|
|
25817
|
+
const [pinnedColumns, setPinnedColumns] = useState(propsPinnedColumns);
|
|
24878
25818
|
useEffect(() => {
|
|
24879
|
-
|
|
24880
|
-
|
|
24881
|
-
|
|
24882
|
-
|
|
24883
|
-
|
|
24884
|
-
onPageChange(0);
|
|
24885
|
-
if (propsOnPageSizeChange) {
|
|
24886
|
-
propsOnPageSizeChange(pageSize, undefined);
|
|
25819
|
+
setPinnedColumns(propsPinnedColumns);
|
|
25820
|
+
}, [propsPinnedColumns]);
|
|
25821
|
+
const onPinnedColumnsChange = (model, details) => {
|
|
25822
|
+
if (propsOnPinnedColumnsChange) {
|
|
25823
|
+
propsOnPinnedColumnsChange(model, details);
|
|
24887
25824
|
} else {
|
|
24888
|
-
|
|
25825
|
+
setPinnedColumns(model);
|
|
24889
25826
|
}
|
|
24890
25827
|
};
|
|
25828
|
+
const [sortModel, setSortModel] = useState(propsSortModel);
|
|
24891
25829
|
useEffect(() => {
|
|
24892
|
-
|
|
24893
|
-
|
|
25830
|
+
setSortModel(propsSortModel);
|
|
25831
|
+
}, [propsSortModel]);
|
|
25832
|
+
const onSortModelChange = (model, details) => {
|
|
25833
|
+
if (propsOnSortModelChange) {
|
|
25834
|
+
propsOnSortModelChange(model, details);
|
|
25835
|
+
} else {
|
|
25836
|
+
setSortModel(model);
|
|
24894
25837
|
}
|
|
24895
|
-
}
|
|
25838
|
+
};
|
|
25839
|
+
const [rowSelectionModel, setRowSelectionModel] = useState(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
25840
|
+
useEffect(() => {
|
|
25841
|
+
setRowSelectionModel(propsSelectionModel !== null && propsSelectionModel !== void 0 ? propsSelectionModel : []);
|
|
25842
|
+
}, [propsSelectionModel]);
|
|
25843
|
+
const [paginationModel, setPaginationModel] = useState({
|
|
25844
|
+
pageSize: (_ref3 = (_ref4 = (_initialState$paginat = initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat2 = initialState.pagination) === null || _initialState$paginat2 === void 0 ? void 0 : (_initialState$paginat3 = _initialState$paginat2.paginationModel) === null || _initialState$paginat3 === void 0 ? void 0 : _initialState$paginat3.pageSize) !== null && _initialState$paginat !== void 0 ? _initialState$paginat : propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.pageSize) !== null && _ref4 !== void 0 ? _ref4 : typeof (pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0]) === 'number' ? pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0] : pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : (_pageSizeOptions$ = pageSizeOptions[0]) === null || _pageSizeOptions$ === void 0 ? void 0 : _pageSizeOptions$.value) !== null && _ref3 !== void 0 ? _ref3 : 100,
|
|
25845
|
+
page: (_ref5 = (_initialState$paginat4 = initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat5 = initialState.pagination) === null || _initialState$paginat5 === void 0 ? void 0 : (_initialState$paginat6 = _initialState$paginat5.paginationModel) === null || _initialState$paginat6 === void 0 ? void 0 : _initialState$paginat6.page) !== null && _initialState$paginat4 !== void 0 ? _initialState$paginat4 : propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.page) !== null && _ref5 !== void 0 ? _ref5 : 0
|
|
25846
|
+
});
|
|
25847
|
+
const onPaginationModelChange = model => {
|
|
25848
|
+
if (propsOnPaginationModelChange) {
|
|
25849
|
+
propsOnPaginationModelChange(model, undefined);
|
|
25850
|
+
} else {
|
|
25851
|
+
setPaginationModel(model);
|
|
25852
|
+
}
|
|
25853
|
+
};
|
|
25854
|
+
useEffect(() => {
|
|
25855
|
+
if (propsPaginationModel) {
|
|
25856
|
+
setPaginationModel(propsPaginationModel);
|
|
25857
|
+
}
|
|
25858
|
+
}, [propsPaginationModel]);
|
|
25859
|
+
const selectionStatus = useRef({
|
|
25860
|
+
type: 'none',
|
|
25861
|
+
numberOfSelectedRows: 0,
|
|
25862
|
+
numberOfSelectedRowsInPage: 0,
|
|
25863
|
+
page: paginationModel.page,
|
|
25864
|
+
pageSize: paginationModel.pageSize
|
|
25865
|
+
});
|
|
24896
25866
|
|
|
24897
25867
|
// in server-side pagination we want to update the selection status
|
|
24898
25868
|
// every time we navigate between pages, resize our page or select something
|
|
24899
25869
|
useEffect(() => {
|
|
24900
25870
|
if (paginationMode == 'server') {
|
|
24901
|
-
onServerSideSelectionStatusChange(Array.isArray(
|
|
25871
|
+
onServerSideSelectionStatusChange(Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel], apiRef, selectionStatus, isRowSelectable, paginationModel.page, paginationModel.pageSize);
|
|
24902
25872
|
}
|
|
24903
|
-
}, [
|
|
25873
|
+
}, [rowSelectionModel, paginationModel.page, paginationModel.pageSize]);
|
|
24904
25874
|
if (!Array.isArray(rows)) {
|
|
24905
25875
|
return null;
|
|
24906
25876
|
}
|
|
@@ -24916,6 +25886,8 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24916
25886
|
}
|
|
24917
25887
|
}
|
|
24918
25888
|
}), [theme]);
|
|
25889
|
+
const isStateful = propsIsStateful && useRouter;
|
|
25890
|
+
const RenderedDataGrid = isStateful ? StatefulDataGrid : DataGridPro;
|
|
24919
25891
|
return /*#__PURE__*/React__default.createElement(ThemeProvider$4, {
|
|
24920
25892
|
value: {
|
|
24921
25893
|
theme
|
|
@@ -24926,61 +25898,62 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24926
25898
|
ref: datagridRef,
|
|
24927
25899
|
className: classNames(DataGrid.className, className),
|
|
24928
25900
|
$height: height
|
|
24929
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
25901
|
+
}, /*#__PURE__*/React__default.createElement(RenderedDataGrid, _extends$2({}, isStateful ? {
|
|
25902
|
+
pinnedCustomColumns,
|
|
25903
|
+
useRouter
|
|
25904
|
+
} : {}, forwardedProps, {
|
|
24930
25905
|
rowCount: rowCount,
|
|
24931
25906
|
apiRef: apiRef,
|
|
24932
25907
|
autoHeight: autoHeight,
|
|
24933
25908
|
checkboxSelectionVisibleOnly: Boolean(pagination),
|
|
24934
|
-
|
|
24935
|
-
BaseButton,
|
|
24936
|
-
BaseCheckbox,
|
|
24937
|
-
//
|
|
24938
|
-
BasePopper,
|
|
24939
|
-
|
|
25909
|
+
slots: _objectSpread2(_objectSpread2({
|
|
25910
|
+
baseButton: BaseButton,
|
|
25911
|
+
baseCheckbox: BaseCheckbox,
|
|
25912
|
+
// baseTextField,
|
|
25913
|
+
basePopper: BasePopper,
|
|
25914
|
+
columnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24940
25915
|
displayName: "ColumnFilteredIcon"
|
|
24941
25916
|
})),
|
|
24942
|
-
|
|
25917
|
+
columnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24943
25918
|
displayName: "ColumnSelectorIcon"
|
|
24944
25919
|
})),
|
|
24945
|
-
|
|
25920
|
+
columnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24946
25921
|
displayName: "ColumnSortedAscendingIcon"
|
|
24947
25922
|
})),
|
|
24948
|
-
|
|
25923
|
+
columnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24949
25924
|
displayName: "ColumnSortedDescendingIcon"
|
|
24950
25925
|
})),
|
|
24951
|
-
|
|
25926
|
+
densityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24952
25927
|
displayName: "DensityCompactIcon"
|
|
24953
25928
|
})),
|
|
24954
|
-
|
|
25929
|
+
densityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24955
25930
|
displayName: "DensityStandardIcon"
|
|
24956
25931
|
})),
|
|
24957
|
-
|
|
25932
|
+
densityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24958
25933
|
displayName: "DensityComfortableIcon"
|
|
24959
25934
|
})),
|
|
24960
|
-
|
|
25935
|
+
detailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24961
25936
|
displayName: "DetailPanelCollapseIcon"
|
|
24962
25937
|
})),
|
|
24963
|
-
|
|
25938
|
+
detailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24964
25939
|
displayName: "DetailPanelExpandIcon"
|
|
24965
25940
|
})),
|
|
24966
|
-
|
|
25941
|
+
exportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({}, props, {
|
|
24967
25942
|
displayName: "ExportIcon"
|
|
24968
25943
|
})),
|
|
24969
|
-
|
|
25944
|
+
openFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$2({
|
|
24970
25945
|
displayName: "OpenFilterButtonIcon"
|
|
24971
25946
|
}, props))
|
|
24972
|
-
},
|
|
24973
|
-
|
|
24974
|
-
|
|
25947
|
+
}, slots), {}, {
|
|
25948
|
+
toolbar: ToolbarWrapper,
|
|
25949
|
+
pagination: props => pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$2({}, props, {
|
|
24975
25950
|
displaySelection: false,
|
|
24976
25951
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
24977
25952
|
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
24978
25953
|
selectionStatus: selectionStatus.current,
|
|
24979
|
-
|
|
24980
|
-
|
|
24981
|
-
|
|
24982
|
-
onPageSizeChange: onPageSizeChange,
|
|
24983
|
-
rowsPerPageOptions: rowsPerPageOptions,
|
|
25954
|
+
paginationModel: paginationModel,
|
|
25955
|
+
onPaginationModelChange: onPaginationModelChange,
|
|
25956
|
+
pageSizeOptions: pageSizeOptions,
|
|
24984
25957
|
paginationProps: paginationProps,
|
|
24985
25958
|
paginationMode: paginationMode,
|
|
24986
25959
|
rowCount: rowCount
|
|
@@ -24991,78 +25964,79 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24991
25964
|
selectionStatus: selectionStatus.current,
|
|
24992
25965
|
apiRef: apiRef,
|
|
24993
25966
|
isRowSelectable: isRowSelectable,
|
|
24994
|
-
|
|
24995
|
-
|
|
24996
|
-
|
|
24997
|
-
onPageSizeChange: onPageSizeChange,
|
|
24998
|
-
rowsPerPageOptions: rowsPerPageOptions,
|
|
25967
|
+
paginationModel: paginationModel,
|
|
25968
|
+
onPaginationModelChange: onPaginationModelChange,
|
|
25969
|
+
pageSizeOptions: pageSizeOptions,
|
|
24999
25970
|
paginationProps: paginationProps,
|
|
25000
25971
|
paginationMode: paginationMode
|
|
25001
25972
|
})) : null
|
|
25002
25973
|
}),
|
|
25003
|
-
|
|
25974
|
+
slotProps: _objectSpread2(_objectSpread2({}, slotProps), {}, {
|
|
25004
25975
|
toolbar: _objectSpread2({
|
|
25005
25976
|
hideToolbar,
|
|
25006
25977
|
RenderedToolbar,
|
|
25007
25978
|
filterModel,
|
|
25008
25979
|
onFilterModelChange,
|
|
25009
25980
|
pagination,
|
|
25010
|
-
ControlledPagination: paginationMode == 'server' ? ServerSideControlledPagination : ControlledPagination,
|
|
25011
25981
|
paginationPlacement,
|
|
25012
25982
|
selectionStatus,
|
|
25013
25983
|
apiRef,
|
|
25014
25984
|
isRowSelectable,
|
|
25015
|
-
|
|
25016
|
-
|
|
25017
|
-
|
|
25018
|
-
onPageSizeChange,
|
|
25019
|
-
rowsPerPageOptions,
|
|
25985
|
+
paginationModel,
|
|
25986
|
+
onPaginationModelChange,
|
|
25987
|
+
pageSizeOptions,
|
|
25020
25988
|
paginationProps,
|
|
25021
25989
|
paginationMode,
|
|
25022
25990
|
rowCount
|
|
25023
|
-
},
|
|
25991
|
+
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar)
|
|
25024
25992
|
}),
|
|
25025
25993
|
filterModel: filterModel,
|
|
25994
|
+
columnVisibilityModel: columnVisibilityModel,
|
|
25995
|
+
pinnedColumns: pinnedColumns,
|
|
25996
|
+
sortModel: sortModel,
|
|
25026
25997
|
initialState: initialState,
|
|
25027
25998
|
isRowSelectable: isRowSelectable,
|
|
25028
25999
|
onFilterModelChange: onFilterModelChange,
|
|
26000
|
+
onColumnVisibilityModelChange: onColumnVisibilityModelChange
|
|
26001
|
+
// onColumnWidthChange={onColumnWidthChange}
|
|
26002
|
+
,
|
|
26003
|
+
onPinnedColumnsChange: onPinnedColumnsChange,
|
|
26004
|
+
onSortModelChange: onSortModelChange,
|
|
25029
26005
|
pagination: pagination,
|
|
25030
26006
|
paginationMode: paginationMode,
|
|
25031
26007
|
keepNonExistentRowsSelected: paginationMode == 'server',
|
|
25032
26008
|
rows: rows,
|
|
25033
|
-
|
|
25034
|
-
|
|
25035
|
-
|
|
25036
|
-
|
|
25037
|
-
|
|
25038
|
-
selectionModel: selectionModel,
|
|
25039
|
-
onSelectionModelChange: (newSelectionModel, details) => {
|
|
26009
|
+
pageSizeOptions: pageSizeOptions,
|
|
26010
|
+
paginationModel: paginationModel,
|
|
26011
|
+
onPaginationModelChange: onPaginationModelChange,
|
|
26012
|
+
rowSelectionModel: rowSelectionModel,
|
|
26013
|
+
onRowSelectionModelChange: (newSelectionModel, details) => {
|
|
25040
26014
|
if (pagination && paginationMode != 'server') {
|
|
25041
|
-
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(
|
|
26015
|
+
const selectableRowsInPage = isRowSelectable ? gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef).filter(_ref6 => {
|
|
25042
26016
|
let {
|
|
25043
26017
|
model
|
|
25044
|
-
} =
|
|
26018
|
+
} = _ref6;
|
|
25045
26019
|
return isRowSelectable({
|
|
25046
26020
|
row: model
|
|
25047
26021
|
});
|
|
25048
|
-
}).map(
|
|
26022
|
+
}).map(_ref7 => {
|
|
25049
26023
|
let {
|
|
25050
26024
|
id
|
|
25051
|
-
} =
|
|
26025
|
+
} = _ref7;
|
|
25052
26026
|
return id;
|
|
25053
26027
|
}) : gridPaginatedVisibleSortedGridRowIdsSelector(apiRef);
|
|
25054
26028
|
const numberOfSelectableRowsInPage = selectableRowsInPage.length;
|
|
25055
|
-
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(
|
|
26029
|
+
const selectableRowsInTable = isRowSelectable ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref8 => {
|
|
25056
26030
|
let {
|
|
25057
26031
|
model
|
|
25058
|
-
} =
|
|
26032
|
+
} = _ref8;
|
|
25059
26033
|
return isRowSelectable({
|
|
25060
26034
|
row: model
|
|
25061
26035
|
});
|
|
25062
|
-
}).map(
|
|
26036
|
+
}).map(_ref9 => {
|
|
25063
26037
|
let {
|
|
25064
26038
|
id
|
|
25065
|
-
} =
|
|
26039
|
+
} = _ref9;
|
|
25066
26040
|
return id;
|
|
25067
26041
|
}) : gridFilteredSortedRowIdsSelector(apiRef);
|
|
25068
26042
|
const numberOfSelectableRowsInTable = selectableRowsInTable.length;
|
|
@@ -25094,7 +26068,7 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25094
26068
|
};
|
|
25095
26069
|
}
|
|
25096
26070
|
}
|
|
25097
|
-
|
|
26071
|
+
onRowSelectionModelChange === null || onRowSelectionModelChange === void 0 ? void 0 : onRowSelectionModelChange(newSelectionModel, details);
|
|
25098
26072
|
},
|
|
25099
26073
|
sx: _objectSpread2(_objectSpread2({}, sx), {}, {
|
|
25100
26074
|
'.MuiDataGrid-columnHeaders': {
|
|
@@ -25168,5 +26142,5 @@ const TextCell = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25168
26142
|
TextCell.className = CLASSNAME;
|
|
25169
26143
|
TextCell.displayName = COMPONENT_NAME;
|
|
25170
26144
|
|
|
25171
|
-
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 };
|
|
25172
26146
|
//# sourceMappingURL=index.js.map
|