@redsift/table 11.10.0-muiv7 → 11.11.0-muiv6-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/_internal/BasePopper.js +186 -190
- package/_internal/BasePopper.js.map +1 -1
- package/_internal/ControlledPagination.js +5576 -6996
- package/_internal/ControlledPagination.js.map +1 -1
- package/_internal/DataGrid2.js +39 -39
- package/_internal/DataGrid2.js.map +1 -1
- package/_internal/GridToolbarFilterSemanticField2.js +1 -1
- package/_internal/GridToolbarFilterSemanticField2.js.map +1 -1
- package/_internal/Portal.js +1686 -3886
- package/_internal/Portal.js.map +1 -1
- package/_internal/StatefulDataGrid.js +1 -1
- package/_internal/StatefulDataGrid2.js +774 -683
- package/_internal/StatefulDataGrid2.js.map +1 -1
- package/_internal/Toolbar2.js +5 -22
- package/_internal/Toolbar2.js.map +1 -1
- package/_internal/useControlledDatagridState.js +38 -947
- package/_internal/useControlledDatagridState.js.map +1 -1
- package/index.d.ts +291 -172
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
import { _ as _objectSpread2, a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
|
|
1
|
+
import { _ as _objectSpread2, a as _objectWithoutProperties, b as _extends$1 } from './_rollupPluginBabelHelpers.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { useCallback, useEffect, useMemo, forwardRef, useRef, useState } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import { Icon, useTheme as useTheme$1, RedsiftColorBlueN, RedsiftColorNeutralXDarkGrey, RedsiftColorNeutralWhite
|
|
5
|
+
import { Icon, useTheme as useTheme$1, ThemeProvider, RedsiftColorBlueN, RedsiftColorNeutralXDarkGrey, RedsiftColorNeutralWhite } from '@redsift/design-system';
|
|
6
6
|
import { getGridNumericOperators as getGridNumericOperators$1, GridFilterInputValue, GridFilterInputSingleSelect, GridFilterInputMultipleValue, GridFilterInputMultipleSingleSelect, getGridStringOperators as getGridStringOperators$1, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators, GridLogicOperator, useGridApiRef, DataGridPro, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector } from '@mui/x-data-grid-pro';
|
|
7
7
|
import { L as LicenseInfo, u as useControlledDatagridState, T as ThemeProvider$1, S as StyledDataGrid } from './useControlledDatagridState.js';
|
|
8
8
|
import { mdiSync } from '@redsift/icons';
|
|
9
|
-
import { d as defaultSxConfig, i as isPlainObject, s as styled,
|
|
9
|
+
import { _ as _objectWithoutPropertiesLoose, a as _extends, d as defaultSxConfig, i as isPlainObject, s as styled, b as styleFunctionSx, u as useTheme, c as clsx, e as createTheme, T as THEME_ID, C as ClassNameGenerator, P as PropTypes, g as generateUtilityClasses, f as generateUtilityClass, h as styled$1, j as useThemeProps, k as capitalize, l as composeClasses, r as rootShouldForwardProp, m as refType } from './Portal.js';
|
|
10
10
|
import { j as jsxRuntimeExports } from './jsx-runtime.js';
|
|
11
|
-
import { u as
|
|
11
|
+
import { u as useFormControl, f as formControlState, i as isAdornedStart, a as isFilled, F as FormControlContext, b as useId, c as Select, I as Input, d as FilledInput, O as OutlinedInput, o as onServerSideSelectionStatusChange, S as ServerSideControlledPagination, C as ControlledPagination } from './ControlledPagination.js';
|
|
12
12
|
import { T as Toolbar } from './Toolbar2.js';
|
|
13
13
|
import { B as BaseButton, a as BaseCheckbox, c as BasePopper, b as BaseIcon } from './BasePopper.js';
|
|
14
14
|
import { T as ToolbarWrapper } from './ToolbarWrapper2.js';
|
|
15
15
|
|
|
16
|
+
function isMuiElement(element, muiNames) {
|
|
17
|
+
return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const _excluded$7 = ["sx"];
|
|
16
21
|
const splitProps = props => {
|
|
22
|
+
var _props$theme$unstable, _props$theme;
|
|
17
23
|
const result = {
|
|
18
24
|
systemProps: {},
|
|
19
25
|
otherProps: {}
|
|
20
26
|
};
|
|
21
|
-
const config = props
|
|
27
|
+
const config = (_props$theme$unstable = props == null ? void 0 : (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig;
|
|
22
28
|
Object.keys(props).forEach(prop => {
|
|
23
29
|
if (config[prop]) {
|
|
24
30
|
result.systemProps[prop] = props[prop];
|
|
@@ -30,9 +36,9 @@ const splitProps = props => {
|
|
|
30
36
|
};
|
|
31
37
|
function extendSxProp(props) {
|
|
32
38
|
const {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
sx: inSx
|
|
40
|
+
} = props,
|
|
41
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$7);
|
|
36
42
|
const {
|
|
37
43
|
systemProps,
|
|
38
44
|
otherProps
|
|
@@ -46,23 +52,17 @@ function extendSxProp(props) {
|
|
|
46
52
|
if (!isPlainObject(result)) {
|
|
47
53
|
return systemProps;
|
|
48
54
|
}
|
|
49
|
-
return {
|
|
50
|
-
...systemProps,
|
|
51
|
-
...result
|
|
52
|
-
};
|
|
55
|
+
return _extends({}, systemProps, result);
|
|
53
56
|
};
|
|
54
57
|
} else {
|
|
55
|
-
finalSx = {
|
|
56
|
-
...systemProps,
|
|
57
|
-
...inSx
|
|
58
|
-
};
|
|
58
|
+
finalSx = _extends({}, systemProps, inSx);
|
|
59
59
|
}
|
|
60
|
-
return {
|
|
61
|
-
...otherProps,
|
|
60
|
+
return _extends({}, otherProps, {
|
|
62
61
|
sx: finalSx
|
|
63
|
-
};
|
|
62
|
+
});
|
|
64
63
|
}
|
|
65
64
|
|
|
65
|
+
const _excluded$6 = ["className", "component"];
|
|
66
66
|
function createBox(options = {}) {
|
|
67
67
|
const {
|
|
68
68
|
themeId,
|
|
@@ -75,45 +75,34 @@ function createBox(options = {}) {
|
|
|
75
75
|
})(styleFunctionSx);
|
|
76
76
|
const Box = /*#__PURE__*/React.forwardRef(function Box(inProps, ref) {
|
|
77
77
|
const theme = useTheme(defaultTheme);
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
const _extendSxProp = extendSxProp(inProps),
|
|
79
|
+
{
|
|
80
|
+
className,
|
|
81
|
+
component = 'div'
|
|
82
|
+
} = _extendSxProp,
|
|
83
|
+
other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$6);
|
|
84
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(BoxRoot, _extends({
|
|
84
85
|
as: component,
|
|
85
86
|
ref: ref,
|
|
86
87
|
className: clsx(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),
|
|
87
|
-
theme: themeId ? theme[themeId] || theme : theme
|
|
88
|
-
|
|
89
|
-
});
|
|
88
|
+
theme: themeId ? theme[themeId] || theme : theme
|
|
89
|
+
}, other));
|
|
90
90
|
});
|
|
91
91
|
return Box;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
function isMuiElement(element, muiNames) {
|
|
95
|
-
return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(
|
|
96
|
-
// For server components `muiName` is avaialble in element.type._payload.value.muiName
|
|
97
|
-
// relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45
|
|
98
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
99
|
-
element.type.muiName ?? element.type?._payload?.value?.muiName) !== -1;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const boxClasses = generateUtilityClasses('MuiBox', ['root']);
|
|
103
|
-
var boxClasses$1 = boxClasses;
|
|
104
|
-
|
|
105
94
|
const defaultTheme = createTheme();
|
|
106
95
|
const Box = createBox({
|
|
107
96
|
themeId: THEME_ID,
|
|
108
97
|
defaultTheme,
|
|
109
|
-
defaultClassName:
|
|
98
|
+
defaultClassName: 'MuiBox-root',
|
|
110
99
|
generateClassName: ClassNameGenerator.generate
|
|
111
100
|
});
|
|
112
101
|
process.env.NODE_ENV !== "production" ? Box.propTypes /* remove-proptypes */ = {
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
//
|
|
102
|
+
// ----------------------------- Warning --------------------------------
|
|
103
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
104
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
105
|
+
// ----------------------------------------------------------------------
|
|
117
106
|
/**
|
|
118
107
|
* @ignore
|
|
119
108
|
*/
|
|
@@ -136,6 +125,7 @@ function getFormLabelUtilityClasses(slot) {
|
|
|
136
125
|
const formLabelClasses = generateUtilityClasses('MuiFormLabel', ['root', 'colorSecondary', 'focused', 'disabled', 'error', 'filled', 'required', 'asterisk']);
|
|
137
126
|
var formLabelClasses$1 = formLabelClasses;
|
|
138
127
|
|
|
128
|
+
const _excluded$5 = ["children", "className", "color", "component", "disabled", "error", "filled", "focused", "required"];
|
|
139
129
|
const useUtilityClasses$4 = ownerState => {
|
|
140
130
|
const {
|
|
141
131
|
classes,
|
|
@@ -155,77 +145,59 @@ const useUtilityClasses$4 = ownerState => {
|
|
|
155
145
|
const FormLabelRoot = styled$1('label', {
|
|
156
146
|
name: 'MuiFormLabel',
|
|
157
147
|
slot: 'Root',
|
|
158
|
-
overridesResolver: (
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}) => ({
|
|
167
|
-
color: (theme.vars || theme).palette.text.secondary
|
|
168
|
-
|
|
148
|
+
overridesResolver: ({
|
|
149
|
+
ownerState
|
|
150
|
+
}, styles) => {
|
|
151
|
+
return _extends({}, styles.root, ownerState.color === 'secondary' && styles.colorSecondary, ownerState.filled && styles.filled);
|
|
152
|
+
}
|
|
153
|
+
})(({
|
|
154
|
+
theme,
|
|
155
|
+
ownerState
|
|
156
|
+
}) => _extends({
|
|
157
|
+
color: (theme.vars || theme).palette.text.secondary
|
|
158
|
+
}, theme.typography.body1, {
|
|
169
159
|
lineHeight: '1.4375em',
|
|
170
160
|
padding: 0,
|
|
171
161
|
position: 'relative',
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
props: {},
|
|
183
|
-
style: {
|
|
184
|
-
[`&.${formLabelClasses$1.disabled}`]: {
|
|
185
|
-
color: (theme.vars || theme).palette.text.disabled
|
|
186
|
-
},
|
|
187
|
-
[`&.${formLabelClasses$1.error}`]: {
|
|
188
|
-
color: (theme.vars || theme).palette.error.main
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}]
|
|
192
|
-
})));
|
|
162
|
+
[`&.${formLabelClasses$1.focused}`]: {
|
|
163
|
+
color: (theme.vars || theme).palette[ownerState.color].main
|
|
164
|
+
},
|
|
165
|
+
[`&.${formLabelClasses$1.disabled}`]: {
|
|
166
|
+
color: (theme.vars || theme).palette.text.disabled
|
|
167
|
+
},
|
|
168
|
+
[`&.${formLabelClasses$1.error}`]: {
|
|
169
|
+
color: (theme.vars || theme).palette.error.main
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
193
172
|
const AsteriskComponent = styled$1('span', {
|
|
194
173
|
name: 'MuiFormLabel',
|
|
195
174
|
slot: 'Asterisk',
|
|
196
175
|
overridesResolver: (props, styles) => styles.asterisk
|
|
197
|
-
})(
|
|
176
|
+
})(({
|
|
198
177
|
theme
|
|
199
178
|
}) => ({
|
|
200
179
|
[`&.${formLabelClasses$1.error}`]: {
|
|
201
180
|
color: (theme.vars || theme).palette.error.main
|
|
202
181
|
}
|
|
203
|
-
}))
|
|
182
|
+
}));
|
|
204
183
|
const FormLabel = /*#__PURE__*/React.forwardRef(function FormLabel(inProps, ref) {
|
|
205
|
-
const props =
|
|
184
|
+
const props = useThemeProps({
|
|
206
185
|
props: inProps,
|
|
207
186
|
name: 'MuiFormLabel'
|
|
208
187
|
});
|
|
209
188
|
const {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
error,
|
|
216
|
-
filled,
|
|
217
|
-
focused,
|
|
218
|
-
required,
|
|
219
|
-
...other
|
|
220
|
-
} = props;
|
|
189
|
+
children,
|
|
190
|
+
className,
|
|
191
|
+
component = 'label'
|
|
192
|
+
} = props,
|
|
193
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$5);
|
|
221
194
|
const muiFormControl = useFormControl();
|
|
222
195
|
const fcs = formControlState({
|
|
223
196
|
props,
|
|
224
197
|
muiFormControl,
|
|
225
198
|
states: ['color', 'required', 'focused', 'disabled', 'error', 'filled']
|
|
226
199
|
});
|
|
227
|
-
const ownerState = {
|
|
228
|
-
...props,
|
|
200
|
+
const ownerState = _extends({}, props, {
|
|
229
201
|
color: fcs.color || 'primary',
|
|
230
202
|
component,
|
|
231
203
|
disabled: fcs.disabled,
|
|
@@ -233,27 +205,27 @@ const FormLabel = /*#__PURE__*/React.forwardRef(function FormLabel(inProps, ref)
|
|
|
233
205
|
filled: fcs.filled,
|
|
234
206
|
focused: fcs.focused,
|
|
235
207
|
required: fcs.required
|
|
236
|
-
};
|
|
208
|
+
});
|
|
237
209
|
const classes = useUtilityClasses$4(ownerState);
|
|
238
|
-
return /*#__PURE__*/jsxRuntimeExports.jsxs(FormLabelRoot, {
|
|
210
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs(FormLabelRoot, _extends({
|
|
239
211
|
as: component,
|
|
240
212
|
ownerState: ownerState,
|
|
241
213
|
className: clsx(classes.root, className),
|
|
242
|
-
ref: ref
|
|
243
|
-
|
|
214
|
+
ref: ref
|
|
215
|
+
}, other, {
|
|
244
216
|
children: [children, fcs.required && /*#__PURE__*/jsxRuntimeExports.jsxs(AsteriskComponent, {
|
|
245
217
|
ownerState: ownerState,
|
|
246
218
|
"aria-hidden": true,
|
|
247
219
|
className: classes.asterisk,
|
|
248
220
|
children: ["\u2009", '*']
|
|
249
221
|
})]
|
|
250
|
-
});
|
|
222
|
+
}));
|
|
251
223
|
});
|
|
252
224
|
process.env.NODE_ENV !== "production" ? FormLabel.propTypes /* remove-proptypes */ = {
|
|
253
|
-
//
|
|
254
|
-
//
|
|
255
|
-
//
|
|
256
|
-
//
|
|
225
|
+
// ----------------------------- Warning --------------------------------
|
|
226
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
227
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
228
|
+
// ----------------------------------------------------------------------
|
|
257
229
|
/**
|
|
258
230
|
* The content of the component.
|
|
259
231
|
*/
|
|
@@ -269,7 +241,7 @@ process.env.NODE_ENV !== "production" ? FormLabel.propTypes /* remove-proptypes
|
|
|
269
241
|
/**
|
|
270
242
|
* The color of the component.
|
|
271
243
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
272
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
244
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
273
245
|
*/
|
|
274
246
|
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']), PropTypes.string]),
|
|
275
247
|
/**
|
|
@@ -309,6 +281,7 @@ function getInputLabelUtilityClasses(slot) {
|
|
|
309
281
|
}
|
|
310
282
|
generateUtilityClasses('MuiInputLabel', ['root', 'focused', 'disabled', 'error', 'required', 'asterisk', 'formControl', 'sizeSmall', 'shrink', 'animated', 'standard', 'filled', 'outlined']);
|
|
311
283
|
|
|
284
|
+
const _excluded$4 = ["disableAnimation", "margin", "shrink", "variant", "className"];
|
|
312
285
|
const useUtilityClasses$3 = ownerState => {
|
|
313
286
|
const {
|
|
314
287
|
classes,
|
|
@@ -320,15 +293,11 @@ const useUtilityClasses$3 = ownerState => {
|
|
|
320
293
|
required
|
|
321
294
|
} = ownerState;
|
|
322
295
|
const slots = {
|
|
323
|
-
root: ['root', formControl && 'formControl', !disableAnimation && 'animated', shrink && 'shrink', size
|
|
296
|
+
root: ['root', formControl && 'formControl', !disableAnimation && 'animated', shrink && 'shrink', size === 'small' && 'sizeSmall', variant],
|
|
324
297
|
asterisk: [required && 'asterisk']
|
|
325
298
|
};
|
|
326
299
|
const composedClasses = composeClasses(slots, getInputLabelUtilityClasses, classes);
|
|
327
|
-
return {
|
|
328
|
-
...classes,
|
|
329
|
-
// forward the focused, disabled, etc. classes to the FormLabel
|
|
330
|
-
...composedClasses
|
|
331
|
-
};
|
|
300
|
+
return _extends({}, classes, composedClasses);
|
|
332
301
|
};
|
|
333
302
|
const InputLabelRoot = styled$1(FormLabel$1, {
|
|
334
303
|
shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',
|
|
@@ -340,144 +309,81 @@ const InputLabelRoot = styled$1(FormLabel$1, {
|
|
|
340
309
|
} = props;
|
|
341
310
|
return [{
|
|
342
311
|
[`& .${formLabelClasses$1.asterisk}`]: styles.asterisk
|
|
343
|
-
}, styles.root, ownerState.formControl && styles.formControl, ownerState.size === 'small' && styles.sizeSmall, ownerState.shrink && styles.shrink, !ownerState.disableAnimation && styles.animated,
|
|
312
|
+
}, styles.root, ownerState.formControl && styles.formControl, ownerState.size === 'small' && styles.sizeSmall, ownerState.shrink && styles.shrink, !ownerState.disableAnimation && styles.animated, styles[ownerState.variant]];
|
|
344
313
|
}
|
|
345
|
-
})(
|
|
346
|
-
theme
|
|
347
|
-
|
|
314
|
+
})(({
|
|
315
|
+
theme,
|
|
316
|
+
ownerState
|
|
317
|
+
}) => _extends({
|
|
348
318
|
display: 'block',
|
|
349
319
|
transformOrigin: 'top left',
|
|
350
320
|
whiteSpace: 'nowrap',
|
|
351
321
|
overflow: 'hidden',
|
|
352
322
|
textOverflow: 'ellipsis',
|
|
353
|
-
maxWidth: '100%'
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
406
|
-
}, {
|
|
407
|
-
props: {
|
|
408
|
-
variant: 'filled',
|
|
409
|
-
size: 'small'
|
|
410
|
-
},
|
|
411
|
-
style: {
|
|
412
|
-
transform: 'translate(12px, 13px) scale(1)'
|
|
413
|
-
}
|
|
414
|
-
}, {
|
|
415
|
-
props: ({
|
|
416
|
-
variant,
|
|
417
|
-
ownerState
|
|
418
|
-
}) => variant === 'filled' && ownerState.shrink,
|
|
419
|
-
style: {
|
|
420
|
-
userSelect: 'none',
|
|
421
|
-
pointerEvents: 'auto',
|
|
422
|
-
transform: 'translate(12px, 7px) scale(0.75)',
|
|
423
|
-
maxWidth: 'calc(133% - 24px)'
|
|
424
|
-
}
|
|
425
|
-
}, {
|
|
426
|
-
props: ({
|
|
427
|
-
variant,
|
|
428
|
-
ownerState,
|
|
429
|
-
size
|
|
430
|
-
}) => variant === 'filled' && ownerState.shrink && size === 'small',
|
|
431
|
-
style: {
|
|
432
|
-
transform: 'translate(12px, 4px) scale(0.75)'
|
|
433
|
-
}
|
|
434
|
-
}, {
|
|
435
|
-
props: {
|
|
436
|
-
variant: 'outlined'
|
|
437
|
-
},
|
|
438
|
-
style: {
|
|
439
|
-
// see comment above on filled.zIndex
|
|
440
|
-
zIndex: 1,
|
|
441
|
-
pointerEvents: 'none',
|
|
442
|
-
transform: 'translate(14px, 16px) scale(1)',
|
|
443
|
-
maxWidth: 'calc(100% - 24px)'
|
|
444
|
-
}
|
|
445
|
-
}, {
|
|
446
|
-
props: {
|
|
447
|
-
variant: 'outlined',
|
|
448
|
-
size: 'small'
|
|
449
|
-
},
|
|
450
|
-
style: {
|
|
451
|
-
transform: 'translate(14px, 9px) scale(1)'
|
|
452
|
-
}
|
|
453
|
-
}, {
|
|
454
|
-
props: ({
|
|
455
|
-
variant,
|
|
456
|
-
ownerState
|
|
457
|
-
}) => variant === 'outlined' && ownerState.shrink,
|
|
458
|
-
style: {
|
|
459
|
-
userSelect: 'none',
|
|
460
|
-
pointerEvents: 'auto',
|
|
461
|
-
// Theoretically, we should have (8+5)*2/0.75 = 34px
|
|
462
|
-
// but it feels a better when it bleeds a bit on the left, so 32px.
|
|
463
|
-
maxWidth: 'calc(133% - 32px)',
|
|
464
|
-
transform: 'translate(14px, -9px) scale(0.75)'
|
|
465
|
-
}
|
|
466
|
-
}]
|
|
323
|
+
maxWidth: '100%'
|
|
324
|
+
}, ownerState.formControl && {
|
|
325
|
+
position: 'absolute',
|
|
326
|
+
left: 0,
|
|
327
|
+
top: 0,
|
|
328
|
+
// slight alteration to spec spacing to match visual spec result
|
|
329
|
+
transform: 'translate(0, 20px) scale(1)'
|
|
330
|
+
}, ownerState.size === 'small' && {
|
|
331
|
+
// Compensation for the `Input.inputSizeSmall` style.
|
|
332
|
+
transform: 'translate(0, 17px) scale(1)'
|
|
333
|
+
}, ownerState.shrink && {
|
|
334
|
+
transform: 'translate(0, -1.5px) scale(0.75)',
|
|
335
|
+
transformOrigin: 'top left',
|
|
336
|
+
maxWidth: '133%'
|
|
337
|
+
}, !ownerState.disableAnimation && {
|
|
338
|
+
transition: theme.transitions.create(['color', 'transform', 'max-width'], {
|
|
339
|
+
duration: theme.transitions.duration.shorter,
|
|
340
|
+
easing: theme.transitions.easing.easeOut
|
|
341
|
+
})
|
|
342
|
+
}, ownerState.variant === 'filled' && _extends({
|
|
343
|
+
// Chrome's autofill feature gives the input field a yellow background.
|
|
344
|
+
// Since the input field is behind the label in the HTML tree,
|
|
345
|
+
// the input field is drawn last and hides the label with an opaque background color.
|
|
346
|
+
// zIndex: 1 will raise the label above opaque background-colors of input.
|
|
347
|
+
zIndex: 1,
|
|
348
|
+
pointerEvents: 'none',
|
|
349
|
+
transform: 'translate(12px, 16px) scale(1)',
|
|
350
|
+
maxWidth: 'calc(100% - 24px)'
|
|
351
|
+
}, ownerState.size === 'small' && {
|
|
352
|
+
transform: 'translate(12px, 13px) scale(1)'
|
|
353
|
+
}, ownerState.shrink && _extends({
|
|
354
|
+
userSelect: 'none',
|
|
355
|
+
pointerEvents: 'auto',
|
|
356
|
+
transform: 'translate(12px, 7px) scale(0.75)',
|
|
357
|
+
maxWidth: 'calc(133% - 24px)'
|
|
358
|
+
}, ownerState.size === 'small' && {
|
|
359
|
+
transform: 'translate(12px, 4px) scale(0.75)'
|
|
360
|
+
})), ownerState.variant === 'outlined' && _extends({
|
|
361
|
+
// see comment above on filled.zIndex
|
|
362
|
+
zIndex: 1,
|
|
363
|
+
pointerEvents: 'none',
|
|
364
|
+
transform: 'translate(14px, 16px) scale(1)',
|
|
365
|
+
maxWidth: 'calc(100% - 24px)'
|
|
366
|
+
}, ownerState.size === 'small' && {
|
|
367
|
+
transform: 'translate(14px, 9px) scale(1)'
|
|
368
|
+
}, ownerState.shrink && {
|
|
369
|
+
userSelect: 'none',
|
|
370
|
+
pointerEvents: 'auto',
|
|
371
|
+
// Theoretically, we should have (8+5)*2/0.75 = 34px
|
|
372
|
+
// but it feels a better when it bleeds a bit on the left, so 32px.
|
|
373
|
+
maxWidth: 'calc(133% - 32px)',
|
|
374
|
+
transform: 'translate(14px, -9px) scale(0.75)'
|
|
467
375
|
})));
|
|
468
376
|
const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, ref) {
|
|
469
|
-
const props =
|
|
377
|
+
const props = useThemeProps({
|
|
470
378
|
name: 'MuiInputLabel',
|
|
471
379
|
props: inProps
|
|
472
380
|
});
|
|
473
381
|
const {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
...other
|
|
480
|
-
} = props;
|
|
382
|
+
disableAnimation = false,
|
|
383
|
+
shrink: shrinkProp,
|
|
384
|
+
className
|
|
385
|
+
} = props,
|
|
386
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$4);
|
|
481
387
|
const muiFormControl = useFormControl();
|
|
482
388
|
let shrink = shrinkProp;
|
|
483
389
|
if (typeof shrink === 'undefined' && muiFormControl) {
|
|
@@ -486,33 +392,31 @@ const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, re
|
|
|
486
392
|
const fcs = formControlState({
|
|
487
393
|
props,
|
|
488
394
|
muiFormControl,
|
|
489
|
-
states: ['size', 'variant', 'required'
|
|
395
|
+
states: ['size', 'variant', 'required']
|
|
490
396
|
});
|
|
491
|
-
const ownerState = {
|
|
492
|
-
...props,
|
|
397
|
+
const ownerState = _extends({}, props, {
|
|
493
398
|
disableAnimation,
|
|
494
399
|
formControl: muiFormControl,
|
|
495
400
|
shrink,
|
|
496
401
|
size: fcs.size,
|
|
497
402
|
variant: fcs.variant,
|
|
498
|
-
required: fcs.required
|
|
499
|
-
|
|
500
|
-
};
|
|
403
|
+
required: fcs.required
|
|
404
|
+
});
|
|
501
405
|
const classes = useUtilityClasses$3(ownerState);
|
|
502
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(InputLabelRoot, {
|
|
406
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(InputLabelRoot, _extends({
|
|
503
407
|
"data-shrink": shrink,
|
|
504
|
-
ref: ref,
|
|
505
|
-
className: clsx(classes.root, className),
|
|
506
|
-
...other,
|
|
507
408
|
ownerState: ownerState,
|
|
409
|
+
ref: ref,
|
|
410
|
+
className: clsx(classes.root, className)
|
|
411
|
+
}, other, {
|
|
508
412
|
classes: classes
|
|
509
|
-
});
|
|
413
|
+
}));
|
|
510
414
|
});
|
|
511
415
|
process.env.NODE_ENV !== "production" ? InputLabel.propTypes /* remove-proptypes */ = {
|
|
512
|
-
//
|
|
513
|
-
//
|
|
514
|
-
//
|
|
515
|
-
//
|
|
416
|
+
// ----------------------------- Warning --------------------------------
|
|
417
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
418
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
419
|
+
// ----------------------------------------------------------------------
|
|
516
420
|
/**
|
|
517
421
|
* The content of the component.
|
|
518
422
|
*/
|
|
@@ -528,7 +432,7 @@ process.env.NODE_ENV !== "production" ? InputLabel.propTypes /* remove-proptypes
|
|
|
528
432
|
/**
|
|
529
433
|
* The color of the component.
|
|
530
434
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
531
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
435
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
532
436
|
*/
|
|
533
437
|
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']), PropTypes.string]),
|
|
534
438
|
/**
|
|
@@ -582,6 +486,7 @@ function getFormControlUtilityClasses(slot) {
|
|
|
582
486
|
}
|
|
583
487
|
generateUtilityClasses('MuiFormControl', ['root', 'marginNone', 'marginNormal', 'marginDense', 'fullWidth', 'disabled']);
|
|
584
488
|
|
|
489
|
+
const _excluded$3 = ["children", "className", "color", "component", "disabled", "error", "focused", "fullWidth", "hiddenLabel", "margin", "required", "size", "variant"];
|
|
585
490
|
const useUtilityClasses$2 = ownerState => {
|
|
586
491
|
const {
|
|
587
492
|
classes,
|
|
@@ -596,13 +501,14 @@ const useUtilityClasses$2 = ownerState => {
|
|
|
596
501
|
const FormControlRoot = styled$1('div', {
|
|
597
502
|
name: 'MuiFormControl',
|
|
598
503
|
slot: 'Root',
|
|
599
|
-
overridesResolver: (
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
}
|
|
603
|
-
return [styles.root, styles[`margin${capitalize(ownerState.margin)}`], ownerState.fullWidth && styles.fullWidth];
|
|
504
|
+
overridesResolver: ({
|
|
505
|
+
ownerState
|
|
506
|
+
}, styles) => {
|
|
507
|
+
return _extends({}, styles.root, styles[`margin${capitalize(ownerState.margin)}`], ownerState.fullWidth && styles.fullWidth);
|
|
604
508
|
}
|
|
605
|
-
})({
|
|
509
|
+
})(({
|
|
510
|
+
ownerState
|
|
511
|
+
}) => _extends({
|
|
606
512
|
display: 'inline-flex',
|
|
607
513
|
flexDirection: 'column',
|
|
608
514
|
position: 'relative',
|
|
@@ -611,33 +517,16 @@ const FormControlRoot = styled$1('div', {
|
|
|
611
517
|
padding: 0,
|
|
612
518
|
margin: 0,
|
|
613
519
|
border: 0,
|
|
614
|
-
verticalAlign: 'top'
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
}, {
|
|
625
|
-
props: {
|
|
626
|
-
margin: 'dense'
|
|
627
|
-
},
|
|
628
|
-
style: {
|
|
629
|
-
marginTop: 8,
|
|
630
|
-
marginBottom: 4
|
|
631
|
-
}
|
|
632
|
-
}, {
|
|
633
|
-
props: {
|
|
634
|
-
fullWidth: true
|
|
635
|
-
},
|
|
636
|
-
style: {
|
|
637
|
-
width: '100%'
|
|
638
|
-
}
|
|
639
|
-
}]
|
|
640
|
-
});
|
|
520
|
+
verticalAlign: 'top'
|
|
521
|
+
}, ownerState.margin === 'normal' && {
|
|
522
|
+
marginTop: 16,
|
|
523
|
+
marginBottom: 8
|
|
524
|
+
}, ownerState.margin === 'dense' && {
|
|
525
|
+
marginTop: 8,
|
|
526
|
+
marginBottom: 4
|
|
527
|
+
}, ownerState.fullWidth && {
|
|
528
|
+
width: '100%'
|
|
529
|
+
}));
|
|
641
530
|
|
|
642
531
|
/**
|
|
643
532
|
* Provides context such as filled/focused/error/required for form inputs.
|
|
@@ -664,28 +553,27 @@ const FormControlRoot = styled$1('div', {
|
|
|
664
553
|
* For instance, only one input can be focused at the same time, the state shouldn't be shared.
|
|
665
554
|
*/
|
|
666
555
|
const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps, ref) {
|
|
667
|
-
const props =
|
|
556
|
+
const props = useThemeProps({
|
|
668
557
|
props: inProps,
|
|
669
558
|
name: 'MuiFormControl'
|
|
670
559
|
});
|
|
671
560
|
const {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
const ownerState = {
|
|
688
|
-
...props,
|
|
561
|
+
children,
|
|
562
|
+
className,
|
|
563
|
+
color = 'primary',
|
|
564
|
+
component = 'div',
|
|
565
|
+
disabled = false,
|
|
566
|
+
error = false,
|
|
567
|
+
focused: visuallyFocused,
|
|
568
|
+
fullWidth = false,
|
|
569
|
+
hiddenLabel = false,
|
|
570
|
+
margin = 'none',
|
|
571
|
+
required = false,
|
|
572
|
+
size = 'medium',
|
|
573
|
+
variant = 'outlined'
|
|
574
|
+
} = props,
|
|
575
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$3);
|
|
576
|
+
const ownerState = _extends({}, props, {
|
|
689
577
|
color,
|
|
690
578
|
component,
|
|
691
579
|
disabled,
|
|
@@ -696,7 +584,7 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
696
584
|
required,
|
|
697
585
|
size,
|
|
698
586
|
variant
|
|
699
|
-
};
|
|
587
|
+
});
|
|
700
588
|
const classes = useUtilityClasses$2(ownerState);
|
|
701
589
|
const [adornedStart, setAdornedStart] = React.useState(() => {
|
|
702
590
|
// We need to iterate through the children and find the Input in order
|
|
@@ -737,8 +625,9 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
737
625
|
}
|
|
738
626
|
const focused = visuallyFocused !== undefined && !disabled ? visuallyFocused : focusedState;
|
|
739
627
|
let registerEffect;
|
|
740
|
-
const registeredInput = React.useRef(false);
|
|
741
628
|
if (process.env.NODE_ENV !== 'production') {
|
|
629
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
630
|
+
const registeredInput = React.useRef(false);
|
|
742
631
|
registerEffect = () => {
|
|
743
632
|
if (registeredInput.current) {
|
|
744
633
|
console.error(['MUI: There are multiple `InputBase` components inside a FormControl.', 'This creates visual inconsistencies, only use one `InputBase`.'].join('\n'));
|
|
@@ -749,12 +638,6 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
749
638
|
};
|
|
750
639
|
};
|
|
751
640
|
}
|
|
752
|
-
const onFilled = React.useCallback(() => {
|
|
753
|
-
setFilled(true);
|
|
754
|
-
}, []);
|
|
755
|
-
const onEmpty = React.useCallback(() => {
|
|
756
|
-
setFilled(false);
|
|
757
|
-
}, []);
|
|
758
641
|
const childContext = React.useMemo(() => {
|
|
759
642
|
return {
|
|
760
643
|
adornedStart,
|
|
@@ -770,33 +653,37 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
770
653
|
onBlur: () => {
|
|
771
654
|
setFocused(false);
|
|
772
655
|
},
|
|
656
|
+
onEmpty: () => {
|
|
657
|
+
setFilled(false);
|
|
658
|
+
},
|
|
659
|
+
onFilled: () => {
|
|
660
|
+
setFilled(true);
|
|
661
|
+
},
|
|
773
662
|
onFocus: () => {
|
|
774
663
|
setFocused(true);
|
|
775
664
|
},
|
|
776
|
-
onEmpty,
|
|
777
|
-
onFilled,
|
|
778
665
|
registerEffect,
|
|
779
666
|
required,
|
|
780
667
|
variant
|
|
781
668
|
};
|
|
782
|
-
}, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect,
|
|
669
|
+
}, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect, required, size, variant]);
|
|
783
670
|
return /*#__PURE__*/jsxRuntimeExports.jsx(FormControlContext.Provider, {
|
|
784
671
|
value: childContext,
|
|
785
|
-
children: /*#__PURE__*/jsxRuntimeExports.jsx(FormControlRoot, {
|
|
672
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(FormControlRoot, _extends({
|
|
786
673
|
as: component,
|
|
787
674
|
ownerState: ownerState,
|
|
788
675
|
className: clsx(classes.root, className),
|
|
789
|
-
ref: ref
|
|
790
|
-
|
|
676
|
+
ref: ref
|
|
677
|
+
}, other, {
|
|
791
678
|
children: children
|
|
792
|
-
})
|
|
679
|
+
}))
|
|
793
680
|
});
|
|
794
681
|
});
|
|
795
682
|
process.env.NODE_ENV !== "production" ? FormControl.propTypes /* remove-proptypes */ = {
|
|
796
|
-
//
|
|
797
|
-
//
|
|
798
|
-
//
|
|
799
|
-
//
|
|
683
|
+
// ----------------------------- Warning --------------------------------
|
|
684
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
685
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
686
|
+
// ----------------------------------------------------------------------
|
|
800
687
|
/**
|
|
801
688
|
* The content of the component.
|
|
802
689
|
*/
|
|
@@ -812,7 +699,7 @@ process.env.NODE_ENV !== "production" ? FormControl.propTypes /* remove-proptype
|
|
|
812
699
|
/**
|
|
813
700
|
* The color of the component.
|
|
814
701
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
815
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
702
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
816
703
|
* @default 'primary'
|
|
817
704
|
*/
|
|
818
705
|
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
|
|
@@ -881,6 +768,7 @@ const formHelperTextClasses = generateUtilityClasses('MuiFormHelperText', ['root
|
|
|
881
768
|
var formHelperTextClasses$1 = formHelperTextClasses;
|
|
882
769
|
|
|
883
770
|
var _span;
|
|
771
|
+
const _excluded$2 = ["children", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"];
|
|
884
772
|
const useUtilityClasses$1 = ownerState => {
|
|
885
773
|
const {
|
|
886
774
|
classes,
|
|
@@ -906,11 +794,12 @@ const FormHelperTextRoot = styled$1('p', {
|
|
|
906
794
|
} = props;
|
|
907
795
|
return [styles.root, ownerState.size && styles[`size${capitalize(ownerState.size)}`], ownerState.contained && styles.contained, ownerState.filled && styles.filled];
|
|
908
796
|
}
|
|
909
|
-
})(
|
|
910
|
-
theme
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
797
|
+
})(({
|
|
798
|
+
theme,
|
|
799
|
+
ownerState
|
|
800
|
+
}) => _extends({
|
|
801
|
+
color: (theme.vars || theme).palette.text.secondary
|
|
802
|
+
}, theme.typography.caption, {
|
|
914
803
|
textAlign: 'left',
|
|
915
804
|
marginTop: 3,
|
|
916
805
|
marginRight: 0,
|
|
@@ -921,50 +810,31 @@ const FormHelperTextRoot = styled$1('p', {
|
|
|
921
810
|
},
|
|
922
811
|
[`&.${formHelperTextClasses$1.error}`]: {
|
|
923
812
|
color: (theme.vars || theme).palette.error.main
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
}
|
|
932
|
-
}, {
|
|
933
|
-
props: ({
|
|
934
|
-
ownerState
|
|
935
|
-
}) => ownerState.contained,
|
|
936
|
-
style: {
|
|
937
|
-
marginLeft: 14,
|
|
938
|
-
marginRight: 14
|
|
939
|
-
}
|
|
940
|
-
}]
|
|
941
|
-
})));
|
|
813
|
+
}
|
|
814
|
+
}, ownerState.size === 'small' && {
|
|
815
|
+
marginTop: 4
|
|
816
|
+
}, ownerState.contained && {
|
|
817
|
+
marginLeft: 14,
|
|
818
|
+
marginRight: 14
|
|
819
|
+
}));
|
|
942
820
|
const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inProps, ref) {
|
|
943
|
-
const props =
|
|
821
|
+
const props = useThemeProps({
|
|
944
822
|
props: inProps,
|
|
945
823
|
name: 'MuiFormHelperText'
|
|
946
824
|
});
|
|
947
825
|
const {
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
filled,
|
|
954
|
-
focused,
|
|
955
|
-
margin,
|
|
956
|
-
required,
|
|
957
|
-
variant,
|
|
958
|
-
...other
|
|
959
|
-
} = props;
|
|
826
|
+
children,
|
|
827
|
+
className,
|
|
828
|
+
component = 'p'
|
|
829
|
+
} = props,
|
|
830
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$2);
|
|
960
831
|
const muiFormControl = useFormControl();
|
|
961
832
|
const fcs = formControlState({
|
|
962
833
|
props,
|
|
963
834
|
muiFormControl,
|
|
964
835
|
states: ['variant', 'size', 'disabled', 'error', 'filled', 'focused', 'required']
|
|
965
836
|
});
|
|
966
|
-
const ownerState = {
|
|
967
|
-
...props,
|
|
837
|
+
const ownerState = _extends({}, props, {
|
|
968
838
|
component,
|
|
969
839
|
contained: fcs.variant === 'filled' || fcs.variant === 'outlined',
|
|
970
840
|
variant: fcs.variant,
|
|
@@ -974,30 +844,26 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
|
|
|
974
844
|
filled: fcs.filled,
|
|
975
845
|
focused: fcs.focused,
|
|
976
846
|
required: fcs.required
|
|
977
|
-
};
|
|
978
|
-
|
|
979
|
-
// This issue explains why this is required: https://github.com/mui/material-ui/issues/42184
|
|
980
|
-
delete ownerState.ownerState;
|
|
847
|
+
});
|
|
981
848
|
const classes = useUtilityClasses$1(ownerState);
|
|
982
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(FormHelperTextRoot, {
|
|
849
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(FormHelperTextRoot, _extends({
|
|
983
850
|
as: component,
|
|
984
|
-
className: clsx(classes.root, className),
|
|
985
|
-
ref: ref,
|
|
986
|
-
...other,
|
|
987
851
|
ownerState: ownerState,
|
|
852
|
+
className: clsx(classes.root, className),
|
|
853
|
+
ref: ref
|
|
854
|
+
}, other, {
|
|
988
855
|
children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
989
856
|
_span || (_span = /*#__PURE__*/jsxRuntimeExports.jsx("span", {
|
|
990
857
|
className: "notranslate",
|
|
991
|
-
"aria-hidden": true,
|
|
992
858
|
children: "\u200B"
|
|
993
859
|
})) : children
|
|
994
|
-
});
|
|
860
|
+
}));
|
|
995
861
|
});
|
|
996
862
|
process.env.NODE_ENV !== "production" ? FormHelperText.propTypes /* remove-proptypes */ = {
|
|
997
|
-
//
|
|
998
|
-
//
|
|
999
|
-
//
|
|
1000
|
-
//
|
|
863
|
+
// ----------------------------- Warning --------------------------------
|
|
864
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
865
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
866
|
+
// ----------------------------------------------------------------------
|
|
1001
867
|
/**
|
|
1002
868
|
* The content of the component.
|
|
1003
869
|
*
|
|
@@ -1058,6 +924,7 @@ function getTextFieldUtilityClass(slot) {
|
|
|
1058
924
|
}
|
|
1059
925
|
generateUtilityClasses('MuiTextField', ['root']);
|
|
1060
926
|
|
|
927
|
+
const _excluded$1 = ["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"];
|
|
1061
928
|
const variantComponent = {
|
|
1062
929
|
standard: Input,
|
|
1063
930
|
filled: FilledInput,
|
|
@@ -1111,49 +978,47 @@ const TextFieldRoot = styled$1(FormControl$1, {
|
|
|
1111
978
|
* - using the underlying components directly as shown in the demos
|
|
1112
979
|
*/
|
|
1113
980
|
const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
|
|
1114
|
-
const props =
|
|
981
|
+
const props = useThemeProps({
|
|
1115
982
|
props: inProps,
|
|
1116
983
|
name: 'MuiTextField'
|
|
1117
984
|
});
|
|
1118
985
|
const {
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
const ownerState = {
|
|
1156
|
-
...props,
|
|
986
|
+
autoComplete,
|
|
987
|
+
autoFocus = false,
|
|
988
|
+
children,
|
|
989
|
+
className,
|
|
990
|
+
color = 'primary',
|
|
991
|
+
defaultValue,
|
|
992
|
+
disabled = false,
|
|
993
|
+
error = false,
|
|
994
|
+
FormHelperTextProps,
|
|
995
|
+
fullWidth = false,
|
|
996
|
+
helperText,
|
|
997
|
+
id: idOverride,
|
|
998
|
+
InputLabelProps,
|
|
999
|
+
inputProps,
|
|
1000
|
+
InputProps,
|
|
1001
|
+
inputRef,
|
|
1002
|
+
label,
|
|
1003
|
+
maxRows,
|
|
1004
|
+
minRows,
|
|
1005
|
+
multiline = false,
|
|
1006
|
+
name,
|
|
1007
|
+
onBlur,
|
|
1008
|
+
onChange,
|
|
1009
|
+
onClick,
|
|
1010
|
+
onFocus,
|
|
1011
|
+
placeholder,
|
|
1012
|
+
required = false,
|
|
1013
|
+
rows,
|
|
1014
|
+
select = false,
|
|
1015
|
+
SelectProps,
|
|
1016
|
+
type,
|
|
1017
|
+
value,
|
|
1018
|
+
variant = 'outlined'
|
|
1019
|
+
} = props,
|
|
1020
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$1);
|
|
1021
|
+
const ownerState = _extends({}, props, {
|
|
1157
1022
|
autoFocus,
|
|
1158
1023
|
color,
|
|
1159
1024
|
disabled,
|
|
@@ -1163,89 +1028,32 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
1163
1028
|
required,
|
|
1164
1029
|
select,
|
|
1165
1030
|
variant
|
|
1166
|
-
};
|
|
1031
|
+
});
|
|
1167
1032
|
const classes = useUtilityClasses(ownerState);
|
|
1168
1033
|
if (process.env.NODE_ENV !== 'production') {
|
|
1169
1034
|
if (select && !children) {
|
|
1170
1035
|
console.error('MUI: `children` must be passed when using the `TextField` component with `select`.');
|
|
1171
1036
|
}
|
|
1172
1037
|
}
|
|
1173
|
-
const
|
|
1174
|
-
const helperTextId = helperText && id ? `${id}-helper-text` : undefined;
|
|
1175
|
-
const inputLabelId = label && id ? `${id}-label` : undefined;
|
|
1176
|
-
const InputComponent = variantComponent[variant];
|
|
1177
|
-
const externalForwardedProps = {
|
|
1178
|
-
slots,
|
|
1179
|
-
slotProps: {
|
|
1180
|
-
input: InputPropsProp,
|
|
1181
|
-
inputLabel: InputLabelPropsProp,
|
|
1182
|
-
htmlInput: inputPropsProp,
|
|
1183
|
-
formHelperText: FormHelperTextPropsProp,
|
|
1184
|
-
select: SelectPropsProp,
|
|
1185
|
-
...slotProps
|
|
1186
|
-
}
|
|
1187
|
-
};
|
|
1188
|
-
const inputAdditionalProps = {};
|
|
1189
|
-
const inputLabelSlotProps = externalForwardedProps.slotProps.inputLabel;
|
|
1038
|
+
const InputMore = {};
|
|
1190
1039
|
if (variant === 'outlined') {
|
|
1191
|
-
if (
|
|
1192
|
-
|
|
1040
|
+
if (InputLabelProps && typeof InputLabelProps.shrink !== 'undefined') {
|
|
1041
|
+
InputMore.notched = InputLabelProps.shrink;
|
|
1193
1042
|
}
|
|
1194
|
-
|
|
1043
|
+
InputMore.label = label;
|
|
1195
1044
|
}
|
|
1196
1045
|
if (select) {
|
|
1197
1046
|
// unset defaults from textbox inputs
|
|
1198
|
-
if (!
|
|
1199
|
-
|
|
1047
|
+
if (!SelectProps || !SelectProps.native) {
|
|
1048
|
+
InputMore.id = undefined;
|
|
1200
1049
|
}
|
|
1201
|
-
|
|
1050
|
+
InputMore['aria-describedby'] = undefined;
|
|
1202
1051
|
}
|
|
1203
|
-
const
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
...other
|
|
1209
|
-
},
|
|
1210
|
-
ownerState,
|
|
1211
|
-
className: clsx(classes.root, className),
|
|
1212
|
-
ref,
|
|
1213
|
-
additionalProps: {
|
|
1214
|
-
disabled,
|
|
1215
|
-
error,
|
|
1216
|
-
fullWidth,
|
|
1217
|
-
required,
|
|
1218
|
-
color,
|
|
1219
|
-
variant
|
|
1220
|
-
}
|
|
1221
|
-
});
|
|
1222
|
-
const [InputSlot, inputProps] = useSlot('input', {
|
|
1223
|
-
elementType: InputComponent,
|
|
1224
|
-
externalForwardedProps,
|
|
1225
|
-
additionalProps: inputAdditionalProps,
|
|
1226
|
-
ownerState
|
|
1227
|
-
});
|
|
1228
|
-
const [InputLabelSlot, inputLabelProps] = useSlot('inputLabel', {
|
|
1229
|
-
elementType: InputLabel$1,
|
|
1230
|
-
externalForwardedProps,
|
|
1231
|
-
ownerState
|
|
1232
|
-
});
|
|
1233
|
-
const [HtmlInputSlot, htmlInputProps] = useSlot('htmlInput', {
|
|
1234
|
-
elementType: 'input',
|
|
1235
|
-
externalForwardedProps,
|
|
1236
|
-
ownerState
|
|
1237
|
-
});
|
|
1238
|
-
const [FormHelperTextSlot, formHelperTextProps] = useSlot('formHelperText', {
|
|
1239
|
-
elementType: FormHelperText$1,
|
|
1240
|
-
externalForwardedProps,
|
|
1241
|
-
ownerState
|
|
1242
|
-
});
|
|
1243
|
-
const [SelectSlot, selectProps] = useSlot('select', {
|
|
1244
|
-
elementType: Select,
|
|
1245
|
-
externalForwardedProps,
|
|
1246
|
-
ownerState
|
|
1247
|
-
});
|
|
1248
|
-
const InputElement = /*#__PURE__*/jsxRuntimeExports.jsx(InputSlot, {
|
|
1052
|
+
const id = useId(idOverride);
|
|
1053
|
+
const helperTextId = helperText && id ? `${id}-helper-text` : undefined;
|
|
1054
|
+
const inputLabelId = label && id ? `${id}-label` : undefined;
|
|
1055
|
+
const InputComponent = variantComponent[variant];
|
|
1056
|
+
const InputElement = /*#__PURE__*/jsxRuntimeExports.jsx(InputComponent, _extends({
|
|
1249
1057
|
"aria-describedby": helperTextId,
|
|
1250
1058
|
autoComplete: autoComplete,
|
|
1251
1059
|
autoFocus: autoFocus,
|
|
@@ -1263,40 +1071,46 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
1263
1071
|
onBlur: onBlur,
|
|
1264
1072
|
onChange: onChange,
|
|
1265
1073
|
onFocus: onFocus,
|
|
1074
|
+
onClick: onClick,
|
|
1266
1075
|
placeholder: placeholder,
|
|
1267
|
-
inputProps:
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1076
|
+
inputProps: inputProps
|
|
1077
|
+
}, InputMore, InputProps));
|
|
1078
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs(TextFieldRoot, _extends({
|
|
1079
|
+
className: clsx(classes.root, className),
|
|
1080
|
+
disabled: disabled,
|
|
1081
|
+
error: error,
|
|
1082
|
+
fullWidth: fullWidth,
|
|
1083
|
+
ref: ref,
|
|
1084
|
+
required: required,
|
|
1085
|
+
color: color,
|
|
1086
|
+
variant: variant,
|
|
1087
|
+
ownerState: ownerState
|
|
1088
|
+
}, other, {
|
|
1089
|
+
children: [label != null && label !== '' && /*#__PURE__*/jsxRuntimeExports.jsx(InputLabel$1, _extends({
|
|
1276
1090
|
htmlFor: id,
|
|
1277
|
-
id: inputLabelId
|
|
1278
|
-
|
|
1091
|
+
id: inputLabelId
|
|
1092
|
+
}, InputLabelProps, {
|
|
1279
1093
|
children: label
|
|
1280
|
-
}), select ? /*#__PURE__*/jsxRuntimeExports.jsx(
|
|
1094
|
+
})), select ? /*#__PURE__*/jsxRuntimeExports.jsx(Select, _extends({
|
|
1281
1095
|
"aria-describedby": helperTextId,
|
|
1282
1096
|
id: id,
|
|
1283
1097
|
labelId: inputLabelId,
|
|
1284
1098
|
value: value,
|
|
1285
|
-
input: InputElement
|
|
1286
|
-
|
|
1099
|
+
input: InputElement
|
|
1100
|
+
}, SelectProps, {
|
|
1287
1101
|
children: children
|
|
1288
|
-
}) : InputElement, helperText && /*#__PURE__*/jsxRuntimeExports.jsx(
|
|
1289
|
-
id: helperTextId
|
|
1290
|
-
|
|
1102
|
+
})) : InputElement, helperText && /*#__PURE__*/jsxRuntimeExports.jsx(FormHelperText$1, _extends({
|
|
1103
|
+
id: helperTextId
|
|
1104
|
+
}, FormHelperTextProps, {
|
|
1291
1105
|
children: helperText
|
|
1292
|
-
})]
|
|
1293
|
-
});
|
|
1106
|
+
}))]
|
|
1107
|
+
}));
|
|
1294
1108
|
});
|
|
1295
1109
|
process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes */ = {
|
|
1296
|
-
//
|
|
1297
|
-
//
|
|
1298
|
-
//
|
|
1299
|
-
//
|
|
1110
|
+
// ----------------------------- Warning --------------------------------
|
|
1111
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1112
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
1113
|
+
// ----------------------------------------------------------------------
|
|
1300
1114
|
/**
|
|
1301
1115
|
* This prop helps users to fill forms faster, especially on mobile devices.
|
|
1302
1116
|
* The name can be confusing, as it's more like an autofill.
|
|
@@ -1323,7 +1137,7 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
1323
1137
|
/**
|
|
1324
1138
|
* The color of the component.
|
|
1325
1139
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
1326
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#
|
|
1140
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
1327
1141
|
* @default 'primary'
|
|
1328
1142
|
*/
|
|
1329
1143
|
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
|
|
@@ -1342,8 +1156,7 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
1342
1156
|
*/
|
|
1343
1157
|
error: PropTypes.bool,
|
|
1344
1158
|
/**
|
|
1345
|
-
* Props applied to the [`FormHelperText`](
|
|
1346
|
-
* @deprecated Use `slotProps.formHelperText` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
1159
|
+
* Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.
|
|
1347
1160
|
*/
|
|
1348
1161
|
FormHelperTextProps: PropTypes.object,
|
|
1349
1162
|
/**
|
|
@@ -1361,22 +1174,19 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
1361
1174
|
*/
|
|
1362
1175
|
id: PropTypes.string,
|
|
1363
1176
|
/**
|
|
1364
|
-
* Props applied to the [`InputLabel`](
|
|
1177
|
+
* Props applied to the [`InputLabel`](/material-ui/api/input-label/) element.
|
|
1365
1178
|
* Pointer events like `onClick` are enabled if and only if `shrink` is `true`.
|
|
1366
|
-
* @deprecated Use `slotProps.inputLabel` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
1367
1179
|
*/
|
|
1368
1180
|
InputLabelProps: PropTypes.object,
|
|
1369
1181
|
/**
|
|
1370
1182
|
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
|
|
1371
|
-
* @deprecated Use `slotProps.htmlInput` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
1372
1183
|
*/
|
|
1373
1184
|
inputProps: PropTypes.object,
|
|
1374
1185
|
/**
|
|
1375
1186
|
* Props applied to the Input element.
|
|
1376
|
-
* It will be a [`FilledInput`](
|
|
1377
|
-
* [`OutlinedInput`](
|
|
1187
|
+
* It will be a [`FilledInput`](/material-ui/api/filled-input/),
|
|
1188
|
+
* [`OutlinedInput`](/material-ui/api/outlined-input/) or [`Input`](/material-ui/api/input/)
|
|
1378
1189
|
* component depending on the `variant` prop value.
|
|
1379
|
-
* @deprecated Use `slotProps.input` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
1380
1190
|
*/
|
|
1381
1191
|
InputProps: PropTypes.object,
|
|
1382
1192
|
/**
|
|
@@ -1420,6 +1230,10 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
1420
1230
|
* You can pull out the new value by accessing `event.target.value` (string).
|
|
1421
1231
|
*/
|
|
1422
1232
|
onChange: PropTypes.func,
|
|
1233
|
+
/**
|
|
1234
|
+
* @ignore
|
|
1235
|
+
*/
|
|
1236
|
+
onClick: PropTypes.func,
|
|
1423
1237
|
/**
|
|
1424
1238
|
* @ignore
|
|
1425
1239
|
*/
|
|
@@ -1438,44 +1252,19 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
1438
1252
|
*/
|
|
1439
1253
|
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
1440
1254
|
/**
|
|
1441
|
-
* Render a [`Select`](
|
|
1255
|
+
* Render a [`Select`](/material-ui/api/select/) element while passing the Input element to `Select` as `input` parameter.
|
|
1442
1256
|
* If this option is set you must pass the options of the select as children.
|
|
1443
1257
|
* @default false
|
|
1444
1258
|
*/
|
|
1445
1259
|
select: PropTypes.bool,
|
|
1446
1260
|
/**
|
|
1447
|
-
* Props applied to the [`Select`](
|
|
1448
|
-
* @deprecated Use `slotProps.select` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
1261
|
+
* Props applied to the [`Select`](/material-ui/api/select/) element.
|
|
1449
1262
|
*/
|
|
1450
1263
|
SelectProps: PropTypes.object,
|
|
1451
1264
|
/**
|
|
1452
1265
|
* The size of the component.
|
|
1453
|
-
* @default 'medium'
|
|
1454
1266
|
*/
|
|
1455
1267
|
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
|
|
1456
|
-
/**
|
|
1457
|
-
* The props used for each slot inside.
|
|
1458
|
-
* @default {}
|
|
1459
|
-
*/
|
|
1460
|
-
slotProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({
|
|
1461
|
-
formHelperText: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
1462
|
-
htmlInput: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
1463
|
-
input: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
1464
|
-
inputLabel: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
1465
|
-
select: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
1466
|
-
}),
|
|
1467
|
-
/**
|
|
1468
|
-
* The components used for each slot inside.
|
|
1469
|
-
* @default {}
|
|
1470
|
-
*/
|
|
1471
|
-
slots: PropTypes.shape({
|
|
1472
|
-
formHelperText: PropTypes.elementType,
|
|
1473
|
-
htmlInput: PropTypes.elementType,
|
|
1474
|
-
input: PropTypes.elementType,
|
|
1475
|
-
inputLabel: PropTypes.elementType,
|
|
1476
|
-
root: PropTypes.elementType,
|
|
1477
|
-
select: PropTypes.elementType
|
|
1478
|
-
}),
|
|
1479
1268
|
/**
|
|
1480
1269
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1481
1270
|
*/
|
|
@@ -1588,8 +1377,8 @@ const isBetweenOperator = {
|
|
|
1588
1377
|
if (typeof filterItem.value[0] !== 'number' || typeof filterItem.value[1] !== 'number') {
|
|
1589
1378
|
return null;
|
|
1590
1379
|
}
|
|
1591
|
-
return
|
|
1592
|
-
return value !== null && value !== undefined && filterItem.value[0] <= value && value <= filterItem.value[1];
|
|
1380
|
+
return params => {
|
|
1381
|
+
return params.value !== null && params.value !== undefined && filterItem.value[0] <= params.value && params.value <= filterItem.value[1];
|
|
1593
1382
|
};
|
|
1594
1383
|
},
|
|
1595
1384
|
InputComponent: InputNumberInterval
|
|
@@ -1605,11 +1394,11 @@ const doesNotContain = {
|
|
|
1605
1394
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1606
1395
|
return null;
|
|
1607
1396
|
}
|
|
1608
|
-
return
|
|
1397
|
+
return params => {
|
|
1609
1398
|
if (filterItem.value.length === 0) {
|
|
1610
1399
|
return true;
|
|
1611
1400
|
}
|
|
1612
|
-
if (String(value).indexOf(filterItem.value) !== -1) {
|
|
1401
|
+
if (String(params.value).indexOf(filterItem.value) !== -1) {
|
|
1613
1402
|
return false;
|
|
1614
1403
|
}
|
|
1615
1404
|
return true;
|
|
@@ -1626,11 +1415,11 @@ const doesNotEqual = {
|
|
|
1626
1415
|
if (!filterItem.field || !filterItem.value || !filterItem.value) {
|
|
1627
1416
|
return null;
|
|
1628
1417
|
}
|
|
1629
|
-
return
|
|
1418
|
+
return params => {
|
|
1630
1419
|
if (filterItem.value.length === 0) {
|
|
1631
1420
|
return true;
|
|
1632
1421
|
}
|
|
1633
|
-
if (String(value) === filterItem.value) {
|
|
1422
|
+
if (String(params.value) === filterItem.value) {
|
|
1634
1423
|
return false;
|
|
1635
1424
|
}
|
|
1636
1425
|
return true;
|
|
@@ -1647,9 +1436,9 @@ const doesNotHaveOperator = {
|
|
|
1647
1436
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1648
1437
|
return null;
|
|
1649
1438
|
}
|
|
1650
|
-
return
|
|
1651
|
-
const cellValues = Array.isArray(value) ? value : [value];
|
|
1652
|
-
return !cellValues.map(
|
|
1439
|
+
return params => {
|
|
1440
|
+
const cellValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1441
|
+
return !cellValues.map(value => String(value)).includes(filterItem.value);
|
|
1653
1442
|
};
|
|
1654
1443
|
},
|
|
1655
1444
|
InputComponent: GridFilterInputValue
|
|
@@ -1666,9 +1455,9 @@ const hasOperator = {
|
|
|
1666
1455
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1667
1456
|
return null;
|
|
1668
1457
|
}
|
|
1669
|
-
return
|
|
1670
|
-
const cellValues = Array.isArray(value) ? value : [value];
|
|
1671
|
-
return cellValues.map(
|
|
1458
|
+
return params => {
|
|
1459
|
+
const cellValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1460
|
+
return cellValues.map(value => String(value)).includes(filterItem.value);
|
|
1672
1461
|
};
|
|
1673
1462
|
},
|
|
1674
1463
|
InputComponent: GridFilterInputValue
|
|
@@ -1685,8 +1474,8 @@ const hasOnlyOperator = {
|
|
|
1685
1474
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1686
1475
|
return null;
|
|
1687
1476
|
}
|
|
1688
|
-
return
|
|
1689
|
-
const cellValues = Array.isArray(value) ? value : [value];
|
|
1477
|
+
return params => {
|
|
1478
|
+
const cellValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1690
1479
|
return cellValues.length === 1 && String(cellValues[0]) === filterItem.value;
|
|
1691
1480
|
};
|
|
1692
1481
|
},
|
|
@@ -1704,11 +1493,11 @@ const isOperator = {
|
|
|
1704
1493
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1705
1494
|
return null;
|
|
1706
1495
|
}
|
|
1707
|
-
return
|
|
1708
|
-
if (Array.isArray(value)) {
|
|
1496
|
+
return params => {
|
|
1497
|
+
if (Array.isArray(params.value)) {
|
|
1709
1498
|
return false;
|
|
1710
1499
|
}
|
|
1711
|
-
return String(value) === filterItem.value;
|
|
1500
|
+
return String(params.value) === filterItem.value;
|
|
1712
1501
|
};
|
|
1713
1502
|
},
|
|
1714
1503
|
InputComponent: GridFilterInputValue
|
|
@@ -1725,11 +1514,11 @@ const isNotOperator = {
|
|
|
1725
1514
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1726
1515
|
return null;
|
|
1727
1516
|
}
|
|
1728
|
-
return
|
|
1729
|
-
if (Array.isArray(value)) {
|
|
1517
|
+
return params => {
|
|
1518
|
+
if (Array.isArray(params.value)) {
|
|
1730
1519
|
return true;
|
|
1731
1520
|
}
|
|
1732
|
-
return String(value) !== filterItem.value;
|
|
1521
|
+
return String(params.value) !== filterItem.value;
|
|
1733
1522
|
};
|
|
1734
1523
|
},
|
|
1735
1524
|
InputComponent: GridFilterInputValue
|
|
@@ -1746,11 +1535,11 @@ const containsAnyOfOperator = {
|
|
|
1746
1535
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1747
1536
|
return null;
|
|
1748
1537
|
}
|
|
1749
|
-
return
|
|
1538
|
+
return params => {
|
|
1750
1539
|
if (filterItem.value.length === 0) {
|
|
1751
1540
|
return true;
|
|
1752
1541
|
}
|
|
1753
|
-
const paramValues = Array.isArray(value) ? value : [value];
|
|
1542
|
+
const paramValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1754
1543
|
let match = false;
|
|
1755
1544
|
filterItem.value.forEach(filteredValue => {
|
|
1756
1545
|
paramValues.forEach(paramValue => {
|
|
@@ -1771,11 +1560,11 @@ const containsAnyOfCIOperator = {
|
|
|
1771
1560
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1772
1561
|
return null;
|
|
1773
1562
|
}
|
|
1774
|
-
return
|
|
1563
|
+
return params => {
|
|
1775
1564
|
if (filterItem.value.length === 0) {
|
|
1776
1565
|
return true;
|
|
1777
1566
|
}
|
|
1778
|
-
const paramValues = Array.isArray(value) ? value : [value];
|
|
1567
|
+
const paramValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1779
1568
|
const paramValuesLower = paramValues.map(item => String(item).toLowerCase());
|
|
1780
1569
|
let match = false;
|
|
1781
1570
|
filterItem.value.forEach(filteredValue => {
|
|
@@ -1798,11 +1587,11 @@ const doesNotHaveAnyOf = {
|
|
|
1798
1587
|
if (!filterItem.field || !filterItem.value || !Array.isArray(filterItem.value) || filterItem.value.length === 0) {
|
|
1799
1588
|
return null;
|
|
1800
1589
|
}
|
|
1801
|
-
return
|
|
1802
|
-
const cellValues = Array.isArray(value) ? value : [value];
|
|
1590
|
+
return params => {
|
|
1591
|
+
const cellValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1803
1592
|
|
|
1804
1593
|
// Return true only if none of the filter values are in the cell values
|
|
1805
|
-
return filterItem.value.every(filterVal => !cellValues.map(
|
|
1594
|
+
return filterItem.value.every(filterVal => !cellValues.map(value => String(value)).includes(filterVal));
|
|
1806
1595
|
};
|
|
1807
1596
|
},
|
|
1808
1597
|
InputComponent: GridFilterInputMultipleValue
|
|
@@ -1819,11 +1608,11 @@ const endsWithAnyOfOperator = {
|
|
|
1819
1608
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1820
1609
|
return null;
|
|
1821
1610
|
}
|
|
1822
|
-
return
|
|
1611
|
+
return params => {
|
|
1823
1612
|
if (filterItem.value.length === 0) {
|
|
1824
1613
|
return true;
|
|
1825
1614
|
}
|
|
1826
|
-
const paramValues = Array.isArray(value) ? value : [value];
|
|
1615
|
+
const paramValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1827
1616
|
let match = false;
|
|
1828
1617
|
filterItem.value.forEach(filteredValue => {
|
|
1829
1618
|
paramValues.forEach(paramValue => {
|
|
@@ -1846,11 +1635,11 @@ const isAnyOfOperator = {
|
|
|
1846
1635
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1847
1636
|
return null;
|
|
1848
1637
|
}
|
|
1849
|
-
return
|
|
1638
|
+
return params => {
|
|
1850
1639
|
if (filterItem.value.length === 0) {
|
|
1851
1640
|
return true;
|
|
1852
1641
|
}
|
|
1853
|
-
const paramValues = Array.isArray(value) ? value : [value];
|
|
1642
|
+
const paramValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1854
1643
|
for (const paramValue of paramValues) {
|
|
1855
1644
|
if (filterItem.value.includes(String(paramValue))) {
|
|
1856
1645
|
return true;
|
|
@@ -1874,11 +1663,11 @@ const isAnyOfIOperator = {
|
|
|
1874
1663
|
return null;
|
|
1875
1664
|
}
|
|
1876
1665
|
const lowerCaseFilterValues = filterItem.value.map(v => String(v).toLowerCase());
|
|
1877
|
-
return
|
|
1666
|
+
return params => {
|
|
1878
1667
|
if (filterItem.value.length === 0) {
|
|
1879
1668
|
return true;
|
|
1880
1669
|
}
|
|
1881
|
-
const paramValues = Array.isArray(value) ? value : [value];
|
|
1670
|
+
const paramValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1882
1671
|
for (const paramValue of paramValues) {
|
|
1883
1672
|
if (lowerCaseFilterValues.includes(String(paramValue).toLowerCase())) {
|
|
1884
1673
|
return true;
|
|
@@ -1901,13 +1690,13 @@ const hasAnyOfOperator = {
|
|
|
1901
1690
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1902
1691
|
return null;
|
|
1903
1692
|
}
|
|
1904
|
-
return
|
|
1693
|
+
return params => {
|
|
1905
1694
|
if (filterItem.value.length === 0) {
|
|
1906
1695
|
return true;
|
|
1907
1696
|
}
|
|
1908
|
-
const cellValues = Array.isArray(value) ? value : [value];
|
|
1697
|
+
const cellValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1909
1698
|
const filterItemValues = Array.isArray(filterItem.value) ? filterItem.value : [filterItem.value];
|
|
1910
|
-
return filterItemValues.some(v => cellValues.map(
|
|
1699
|
+
return filterItemValues.some(v => cellValues.map(value => String(value)).includes(v));
|
|
1911
1700
|
};
|
|
1912
1701
|
},
|
|
1913
1702
|
InputComponent: GridFilterInputMultipleValue
|
|
@@ -1924,11 +1713,11 @@ const isNotAnyOfOperator = {
|
|
|
1924
1713
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1925
1714
|
return null;
|
|
1926
1715
|
}
|
|
1927
|
-
return
|
|
1716
|
+
return params => {
|
|
1928
1717
|
if (filterItem.value.length === 0) {
|
|
1929
1718
|
return true;
|
|
1930
1719
|
}
|
|
1931
|
-
const paramValues = Array.isArray(value) ? value : [value];
|
|
1720
|
+
const paramValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1932
1721
|
for (const paramValue of paramValues) {
|
|
1933
1722
|
if (filterItem.value.includes(String(paramValue))) {
|
|
1934
1723
|
return false;
|
|
@@ -1951,11 +1740,11 @@ const startsWithAnyOfOperator = {
|
|
|
1951
1740
|
if (!filterItem.field || !filterItem.value || !filterItem.operator) {
|
|
1952
1741
|
return null;
|
|
1953
1742
|
}
|
|
1954
|
-
return
|
|
1743
|
+
return params => {
|
|
1955
1744
|
if (filterItem.value.length === 0) {
|
|
1956
1745
|
return true;
|
|
1957
1746
|
}
|
|
1958
|
-
const paramValues = Array.isArray(value) ? value : [value];
|
|
1747
|
+
const paramValues = Array.isArray(params.value) ? params.value : [params.value];
|
|
1959
1748
|
let match = false;
|
|
1960
1749
|
filterItem.value.forEach(filteredValue => {
|
|
1961
1750
|
paramValues.forEach(paramValue => {
|
|
@@ -2054,63 +1843,348 @@ const clearPreviousVersionStorage = (id, previousLocalStorageVersions) => {
|
|
|
2054
1843
|
}
|
|
2055
1844
|
};
|
|
2056
1845
|
|
|
2057
|
-
//
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
'
|
|
2061
|
-
|
|
2062
|
-
'
|
|
2063
|
-
|
|
2064
|
-
'
|
|
2065
|
-
|
|
2066
|
-
'
|
|
2067
|
-
|
|
2068
|
-
'%21': '!',
|
|
2069
|
-
'%22': '"'
|
|
2070
|
-
};
|
|
2071
|
-
const ENCODER = {
|
|
2072
|
-
' ': '%20',
|
|
2073
|
-
'&': '%26',
|
|
2074
|
-
'=': '%3D',
|
|
2075
|
-
'?': '%3F',
|
|
1846
|
+
// Characters that need URL encoding in display format values
|
|
1847
|
+
// These characters could cause CloudFront issues or parsing ambiguity
|
|
1848
|
+
const CHARS_TO_ENCODE_IN_VALUES = {
|
|
1849
|
+
':': '%3A',
|
|
1850
|
+
// Colon - reserved
|
|
1851
|
+
',': '%2C',
|
|
1852
|
+
// Comma - used as list separator (only in list values)
|
|
1853
|
+
'~': '%7E',
|
|
1854
|
+
// Tilde - reserved
|
|
1855
|
+
';': '%3B',
|
|
1856
|
+
// Semicolon - reserved
|
|
2076
1857
|
'[': '%5B',
|
|
1858
|
+
// Square bracket - used in internal format
|
|
2077
1859
|
']': '%5D',
|
|
2078
|
-
|
|
2079
|
-
'
|
|
2080
|
-
|
|
2081
|
-
'
|
|
2082
|
-
|
|
1860
|
+
// Square bracket - used in internal format
|
|
1861
|
+
'(': '%28',
|
|
1862
|
+
// Parenthesis - reserved
|
|
1863
|
+
')': '%29' // Parenthesis - reserved
|
|
1864
|
+
};
|
|
1865
|
+
|
|
1866
|
+
/**
|
|
1867
|
+
* Encodes special characters in a value for display format URLs.
|
|
1868
|
+
* This ensures values containing colons, commas, etc. don't break parsing.
|
|
1869
|
+
*/
|
|
1870
|
+
const encodeDisplayValue = value => {
|
|
1871
|
+
let encoded = value;
|
|
1872
|
+
for (const [char, replacement] of Object.entries(CHARS_TO_ENCODE_IN_VALUES)) {
|
|
1873
|
+
encoded = encoded.split(char).join(replacement);
|
|
1874
|
+
}
|
|
1875
|
+
return encoded;
|
|
1876
|
+
};
|
|
1877
|
+
|
|
1878
|
+
/**
|
|
1879
|
+
* Decodes URL-encoded characters in display format values back to their original form.
|
|
1880
|
+
* Uses decodeURIComponent to handle all standard URL encoding.
|
|
1881
|
+
*/
|
|
1882
|
+
const decodeDisplayValue = value => {
|
|
1883
|
+
try {
|
|
1884
|
+
return decodeURIComponent(value);
|
|
1885
|
+
} catch {
|
|
1886
|
+
// If decoding fails, return the original value
|
|
1887
|
+
return value;
|
|
1888
|
+
}
|
|
1889
|
+
};
|
|
1890
|
+
|
|
1891
|
+
/**
|
|
1892
|
+
* Encodes array values for display format URLs.
|
|
1893
|
+
* Each value is URL-encoded and joined with commas.
|
|
1894
|
+
*/
|
|
1895
|
+
const encodeDisplayArrayValue = values => {
|
|
1896
|
+
return values.map(v => encodeDisplayValue(v)).join(',');
|
|
1897
|
+
};
|
|
1898
|
+
|
|
1899
|
+
/**
|
|
1900
|
+
* Decodes comma-separated display format array values.
|
|
1901
|
+
* Handles URL-encoded commas within individual values.
|
|
1902
|
+
*/
|
|
1903
|
+
const decodeDisplayArrayValue = value => {
|
|
1904
|
+
if (value === '') {
|
|
1905
|
+
return [];
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
// Split by unencoded commas only (not %2C)
|
|
1909
|
+
// First, temporarily replace encoded commas, then split, then restore
|
|
1910
|
+
const TEMP_COMMA_PLACEHOLDER = '\x00COMMA\x00';
|
|
1911
|
+
const withPlaceholder = value.split('%2C').join(TEMP_COMMA_PLACEHOLDER);
|
|
1912
|
+
const parts = withPlaceholder.split(',');
|
|
1913
|
+
return parts.map(part => {
|
|
1914
|
+
const withCommasRestored = part.split(TEMP_COMMA_PLACEHOLDER).join('%2C');
|
|
1915
|
+
return decodeDisplayValue(withCommasRestored);
|
|
1916
|
+
});
|
|
1917
|
+
};
|
|
1918
|
+
|
|
1919
|
+
/**
|
|
1920
|
+
* Converts internal bracket notation to display-friendly dot notation.
|
|
1921
|
+
*
|
|
1922
|
+
* Display format (CloudFront-safe, no brackets):
|
|
1923
|
+
* - `field[operator]=value` → `field.operator=value` (value URL-encoded if needed)
|
|
1924
|
+
* - `field[isAnyOf]=list[a,b,c]` → `field.isAnyOf=a,b,c` (comma-separated, values URL-encoded)
|
|
1925
|
+
* - `_sortColumn=[field,desc]` → `_sortColumn=field.desc`
|
|
1926
|
+
* - `_pagination=[0,25,next]` → `_pagination=0.25.next`
|
|
1927
|
+
* - `_pinnedColumnsLeft=[a,b,c]` → `_pinnedColumnsLeft=a,b,c` (comma-separated)
|
|
1928
|
+
* - `_columnVisibility=[a,b,c]` → `_columnVisibility=a,b,c` (comma-separated)
|
|
1929
|
+
*/
|
|
1930
|
+
const convertToDisplayFormat = search => {
|
|
1931
|
+
if (!search) return search;
|
|
1932
|
+
const cleanSearch = search.startsWith('?') ? search.slice(1) : search;
|
|
1933
|
+
const params = cleanSearch.split('&');
|
|
1934
|
+
const converted = params.map(param => {
|
|
1935
|
+
// Handle _sortColumn=[field,direction]
|
|
1936
|
+
if (param.startsWith('_sortColumn=')) {
|
|
1937
|
+
const value = param.slice('_sortColumn='.length);
|
|
1938
|
+
if (value.startsWith('[') && value.endsWith(']')) {
|
|
1939
|
+
const inner = value.slice(1, -1);
|
|
1940
|
+
if (inner === '') {
|
|
1941
|
+
return '_sortColumn=';
|
|
1942
|
+
}
|
|
1943
|
+
const [field, direction] = inner.split(',');
|
|
1944
|
+
return `_sortColumn=${field}.${direction}`;
|
|
1945
|
+
}
|
|
1946
|
+
return param;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
// Handle _pagination=[page,pageSize,direction]
|
|
1950
|
+
if (param.startsWith('_pagination=')) {
|
|
1951
|
+
const value = param.slice('_pagination='.length);
|
|
1952
|
+
if (value.startsWith('[') && value.endsWith(']')) {
|
|
1953
|
+
const inner = value.slice(1, -1);
|
|
1954
|
+
if (inner === '') {
|
|
1955
|
+
return '_pagination=';
|
|
1956
|
+
}
|
|
1957
|
+
const [page, pageSize, direction] = inner.split(',');
|
|
1958
|
+
return `_pagination=${page}.${pageSize}.${direction}`;
|
|
1959
|
+
}
|
|
1960
|
+
return param;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
// Handle _pinnedColumnsLeft=[a,b,c] and _pinnedColumnsRight=[a,b,c]
|
|
1964
|
+
if (param.startsWith('_pinnedColumnsLeft=') || param.startsWith('_pinnedColumnsRight=')) {
|
|
1965
|
+
const eqIndex = param.indexOf('=');
|
|
1966
|
+
const key = param.slice(0, eqIndex);
|
|
1967
|
+
const value = param.slice(eqIndex + 1);
|
|
1968
|
+
if (value.startsWith('[') && value.endsWith(']')) {
|
|
1969
|
+
const inner = value.slice(1, -1);
|
|
1970
|
+
return `${key}=${inner}`;
|
|
1971
|
+
}
|
|
1972
|
+
return param;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
// Handle _columnVisibility=[a,b,c]
|
|
1976
|
+
if (param.startsWith('_columnVisibility=')) {
|
|
1977
|
+
const value = param.slice('_columnVisibility='.length);
|
|
1978
|
+
if (value.startsWith('[') && value.endsWith(']')) {
|
|
1979
|
+
const inner = value.slice(1, -1);
|
|
1980
|
+
return `_columnVisibility=${inner}`;
|
|
1981
|
+
}
|
|
1982
|
+
return param;
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
// Handle _field[operator,type]=value or _field[operator,type]=list[a,b,c]
|
|
1986
|
+
const bracketMatch = param.match(/^_([^[]+)\[([^\]]+)\]=(.*)$/);
|
|
1987
|
+
if (bracketMatch) {
|
|
1988
|
+
const [, field, operatorAndType, value] = bracketMatch;
|
|
1989
|
+
const [operator] = operatorAndType.split(',');
|
|
1990
|
+
|
|
1991
|
+
// Convert list[a,b,c] to comma-separated with URL-encoded values
|
|
1992
|
+
if (value.startsWith('list[') && value.endsWith(']')) {
|
|
1993
|
+
const listContent = value.slice(5, -1);
|
|
1994
|
+
if (listContent === '') {
|
|
1995
|
+
return `${field}.${operator}=`;
|
|
1996
|
+
}
|
|
1997
|
+
const items = listContent.split(',');
|
|
1998
|
+
return `${field}.${operator}=${encodeDisplayArrayValue(items)}`;
|
|
1999
|
+
}
|
|
2000
|
+
// URL-encode special characters in the value
|
|
2001
|
+
return `${field}.${operator}=${encodeDisplayValue(value)}`;
|
|
2002
|
+
}
|
|
2003
|
+
return param;
|
|
2004
|
+
});
|
|
2005
|
+
return converted.join('&');
|
|
2006
|
+
};
|
|
2007
|
+
|
|
2008
|
+
/**
|
|
2009
|
+
* Converts display-friendly dot notation back to internal bracket notation.
|
|
2010
|
+
*
|
|
2011
|
+
* Internal format (server-side compatible):
|
|
2012
|
+
* - `field.operator=value` → `_field[operator,type]=value`
|
|
2013
|
+
* - `field.isAnyOf=a,b,c` → `_field[isAnyOf,type]=list[a,b,c]`
|
|
2014
|
+
* - `_sortColumn=field.desc` → `_sortColumn=[field,desc]`
|
|
2015
|
+
* - `_pagination=0.25.next` → `_pagination=[0,25,next]`
|
|
2016
|
+
* - `_pinnedColumnsLeft=a,b,c` → `_pinnedColumnsLeft=[a,b,c]`
|
|
2017
|
+
* - `_columnVisibility=a,b,c` → `_columnVisibility=[a,b,c]`
|
|
2018
|
+
*/
|
|
2019
|
+
const convertFromDisplayFormat = (search, columns) => {
|
|
2020
|
+
if (!search) return search;
|
|
2021
|
+
const cleanSearch = search.startsWith('?') ? search.slice(1) : search;
|
|
2022
|
+
const params = cleanSearch.split('&');
|
|
2023
|
+
const converted = params.map(param => {
|
|
2024
|
+
// Handle _sortColumn=field.direction or _sortColumn=
|
|
2025
|
+
if (param.startsWith('_sortColumn=')) {
|
|
2026
|
+
const value = param.slice('_sortColumn='.length);
|
|
2027
|
+
if (value === '') {
|
|
2028
|
+
return '_sortColumn=[]';
|
|
2029
|
+
}
|
|
2030
|
+
// If it already has brackets, leave it alone
|
|
2031
|
+
if (value.startsWith('[')) {
|
|
2032
|
+
return param;
|
|
2033
|
+
}
|
|
2034
|
+
const dotIndex = value.indexOf('.');
|
|
2035
|
+
if (dotIndex !== -1) {
|
|
2036
|
+
const field = value.slice(0, dotIndex);
|
|
2037
|
+
const direction = value.slice(dotIndex + 1);
|
|
2038
|
+
return `_sortColumn=[${field},${direction}]`;
|
|
2039
|
+
}
|
|
2040
|
+
return param;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
// Handle _pagination=page.pageSize.direction or _pagination=
|
|
2044
|
+
if (param.startsWith('_pagination=')) {
|
|
2045
|
+
const value = param.slice('_pagination='.length);
|
|
2046
|
+
if (value === '') {
|
|
2047
|
+
return '_pagination=[]';
|
|
2048
|
+
}
|
|
2049
|
+
// If it already has brackets, leave it alone
|
|
2050
|
+
if (value.startsWith('[')) {
|
|
2051
|
+
return param;
|
|
2052
|
+
}
|
|
2053
|
+
const parts = value.split('.');
|
|
2054
|
+
if (parts.length === 3) {
|
|
2055
|
+
return `_pagination=[${parts.join(',')}]`;
|
|
2056
|
+
}
|
|
2057
|
+
return param;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
// Handle _pinnedColumnsLeft=a,b,c and _pinnedColumnsRight=a,b,c
|
|
2061
|
+
if (param.startsWith('_pinnedColumnsLeft=') || param.startsWith('_pinnedColumnsRight=')) {
|
|
2062
|
+
const eqIndex = param.indexOf('=');
|
|
2063
|
+
const key = param.slice(0, eqIndex);
|
|
2064
|
+
const value = param.slice(eqIndex + 1);
|
|
2065
|
+
// If it already has brackets, leave it alone
|
|
2066
|
+
if (value.startsWith('[')) {
|
|
2067
|
+
return param;
|
|
2068
|
+
}
|
|
2069
|
+
return `${key}=[${value}]`;
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
// Handle _columnVisibility=a,b,c
|
|
2073
|
+
if (param.startsWith('_columnVisibility=')) {
|
|
2074
|
+
const value = param.slice('_columnVisibility='.length);
|
|
2075
|
+
// If it already has brackets, leave it alone
|
|
2076
|
+
if (value.startsWith('[')) {
|
|
2077
|
+
return param;
|
|
2078
|
+
}
|
|
2079
|
+
return `_columnVisibility=[${value}]`;
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
// Handle field.operator=value (dot notation for filters)
|
|
2083
|
+
const dotMatch = param.match(/^([^.]+)\.([a-zA-Z_]+)=(.*)$/);
|
|
2084
|
+
if (dotMatch) {
|
|
2085
|
+
const [, field, operator, rawValue] = dotMatch;
|
|
2086
|
+
|
|
2087
|
+
// Get column type for this field
|
|
2088
|
+
const column = columns.find(c => c.field === field);
|
|
2089
|
+
const columnType = (column === null || column === void 0 ? void 0 : column.type) || 'string';
|
|
2090
|
+
|
|
2091
|
+
// Check if this is a list operator
|
|
2092
|
+
const listOps = ['containsAnyOf', 'doesNotContainAnyOf', 'endsWithAnyOf', 'doesNotEndWithAnyOf', 'hasAnyOf', 'doesNotHaveAnyOf', 'isAnyOf', 'isNotAnyOf', 'startsWithAnyOf', 'doesNotStartWithAnyOf'];
|
|
2093
|
+
if (listOps.includes(operator)) {
|
|
2094
|
+
const items = decodeDisplayArrayValue(rawValue);
|
|
2095
|
+
return `_${field}[${operator},${columnType}]=list[${items.join(',')}]`;
|
|
2096
|
+
}
|
|
2097
|
+
// Decode URL-encoded special characters in the value
|
|
2098
|
+
const decodedValue = decodeDisplayValue(rawValue);
|
|
2099
|
+
return `_${field}[${operator},${columnType}]=${decodedValue}`;
|
|
2100
|
+
}
|
|
2101
|
+
return param;
|
|
2102
|
+
});
|
|
2103
|
+
return converted.join('&');
|
|
2104
|
+
};
|
|
2105
|
+
|
|
2106
|
+
/**
|
|
2107
|
+
* Detects if search string is in display format and converts it to internal format.
|
|
2108
|
+
*/
|
|
2109
|
+
const getDecodedSearchFromUrl = (search, columns) => {
|
|
2110
|
+
const searchWithoutLeadingQuestion = search.startsWith('?') ? search.slice(1) : search;
|
|
2111
|
+
|
|
2112
|
+
// Check if it's using display format:
|
|
2113
|
+
// 1. Contains dot notation for filters like 'field.operator='
|
|
2114
|
+
// 2. Has empty _sortColumn= (display format) instead of _sortColumn=[] (internal format)
|
|
2115
|
+
// 3. Has _pinnedColumnsLeft=a,b without brackets
|
|
2116
|
+
// 4. Has _sortColumn=field.desc format
|
|
2117
|
+
// 5. Has _pagination=0.25.next format
|
|
2118
|
+
const hasDotNotationFilter = /[a-zA-Z_]+\.[a-zA-Z_]+=/.test(searchWithoutLeadingQuestion);
|
|
2119
|
+
const hasEmptySortColumn = /(_sortColumn)=(&|$)/.test(searchWithoutLeadingQuestion);
|
|
2120
|
+
const hasSortDotNotation = /_sortColumn=[^&[]+\.[^&]+/.test(searchWithoutLeadingQuestion);
|
|
2121
|
+
const hasPaginationDotNotation = /_pagination=[^&[]+\.[^&]+/.test(searchWithoutLeadingQuestion);
|
|
2122
|
+
const hasPinnedWithoutBrackets = /(_pinnedColumnsLeft|_pinnedColumnsRight)=[^&[]*(&|$)/.test(searchWithoutLeadingQuestion);
|
|
2123
|
+
const hasVisibilityWithoutBrackets = /_columnVisibility=[^&[]*(&|$)/.test(searchWithoutLeadingQuestion);
|
|
2124
|
+
const hasBracketNotation = /\[.*\]=/.test(searchWithoutLeadingQuestion);
|
|
2125
|
+
const isDisplayFormat = (hasDotNotationFilter || hasEmptySortColumn || hasSortDotNotation || hasPaginationDotNotation || hasPinnedWithoutBrackets || hasVisibilityWithoutBrackets) && !hasBracketNotation;
|
|
2126
|
+
if (isDisplayFormat) {
|
|
2127
|
+
return '?' + convertFromDisplayFormat(searchWithoutLeadingQuestion, columns);
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
// Already in internal bracket format or empty
|
|
2131
|
+
return search;
|
|
2132
|
+
};
|
|
2133
|
+
|
|
2134
|
+
/**
|
|
2135
|
+
* Builds a display-format query string from internal format.
|
|
2136
|
+
*/
|
|
2137
|
+
const buildQueryParamsString = search => {
|
|
2138
|
+
const displaySearch = convertToDisplayFormat(search);
|
|
2139
|
+
return displaySearch.startsWith('?') ? displaySearch : `?${displaySearch}`;
|
|
2140
|
+
};
|
|
2141
|
+
|
|
2142
|
+
/**
|
|
2143
|
+
* Compares two search strings for equality, ignoring parameter order.
|
|
2144
|
+
* This prevents infinite update loops when the same parameters appear in different order.
|
|
2145
|
+
*/
|
|
2146
|
+
const areSearchStringsEqual = (search1, search2) => {
|
|
2147
|
+
const strippedSearch1 = search1.startsWith('?') ? search1.slice(1) : search1;
|
|
2148
|
+
const strippedSearch2 = search2.startsWith('?') ? search2.slice(1) : search2;
|
|
2149
|
+
|
|
2150
|
+
// Quick check: if strings are identical, no need to parse
|
|
2151
|
+
if (strippedSearch1 === strippedSearch2) {
|
|
2152
|
+
return true;
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
// Parse and sort parameters for order-independent comparison
|
|
2156
|
+
const params1 = strippedSearch1.split('&').filter(Boolean).sort();
|
|
2157
|
+
const params2 = strippedSearch2.split('&').filter(Boolean).sort();
|
|
2158
|
+
if (params1.length !== params2.length) {
|
|
2159
|
+
return false;
|
|
2160
|
+
}
|
|
2161
|
+
return params1.every((param, index) => param === params2[index]);
|
|
2083
2162
|
};
|
|
2084
2163
|
const decodeValue = value => {
|
|
2085
2164
|
if (value === '') {
|
|
2086
|
-
return
|
|
2165
|
+
return undefined;
|
|
2087
2166
|
}
|
|
2088
|
-
|
|
2089
|
-
//
|
|
2167
|
+
|
|
2168
|
+
// Handle array values encoded as list[item1,item2,...]
|
|
2090
2169
|
if (value.startsWith('list[')) {
|
|
2091
|
-
const
|
|
2092
|
-
|
|
2093
|
-
|
|
2170
|
+
const arrayContent = value.slice(5, -1); // Remove 'list[' and ']'
|
|
2171
|
+
if (arrayContent === '') {
|
|
2172
|
+
return [];
|
|
2173
|
+
}
|
|
2174
|
+
return arrayContent.split(',').filter(item => item);
|
|
2094
2175
|
}
|
|
2095
|
-
return value
|
|
2176
|
+
return value;
|
|
2096
2177
|
};
|
|
2097
2178
|
const encodeValue = value => {
|
|
2098
|
-
if (
|
|
2179
|
+
if (value === undefined || value === null) {
|
|
2099
2180
|
return '';
|
|
2100
2181
|
}
|
|
2101
2182
|
|
|
2102
|
-
//
|
|
2103
|
-
// we are representing it as list[encoded], where encoded is the list comma separated
|
|
2183
|
+
// Handle array values - encode as list[item1,item2,...]
|
|
2104
2184
|
if (Array.isArray(value)) {
|
|
2105
|
-
|
|
2106
|
-
return String(entry).replace(/\s|&|=|\?|\[|\]/g, encoded => ENCODER[encoded]);
|
|
2107
|
-
}).join(',');
|
|
2108
|
-
return `list[${encodedArray}]`;
|
|
2185
|
+
return `list[${value.map(String).join(',')}]`;
|
|
2109
2186
|
}
|
|
2110
|
-
|
|
2111
|
-
// we might also pass integers
|
|
2112
|
-
const castedValue = String(value);
|
|
2113
|
-
return castedValue.replace(/\s|&|=|\?|\[|\]/g, encoded => ENCODER[encoded]);
|
|
2187
|
+
return String(value);
|
|
2114
2188
|
};
|
|
2115
2189
|
const urlSearchParamsToString = searchParams => {
|
|
2116
2190
|
let searchString = '';
|
|
@@ -2173,11 +2247,16 @@ const isValueValid = (value, field, columns, operator) => {
|
|
|
2173
2247
|
}
|
|
2174
2248
|
const type = (_column$type = column['type']) !== null && _column$type !== void 0 ? _column$type : 'string';
|
|
2175
2249
|
|
|
2176
|
-
// Only date fail with 500s, other set themselves as undefined
|
|
2177
|
-
if (type !== 'date') {
|
|
2250
|
+
// Only date and rating fail with 500s, other set themselves as undefined
|
|
2251
|
+
if (type !== 'date' && type !== 'rating') {
|
|
2178
2252
|
return true;
|
|
2179
2253
|
}
|
|
2180
2254
|
|
|
2255
|
+
// just checking that rating is a number.
|
|
2256
|
+
if (type === 'rating') {
|
|
2257
|
+
return !isNaN(Number(value));
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2181
2260
|
// format: YYYY-MM-DD
|
|
2182
2261
|
// just verifying that the 3 values are numbers to avoid 500s,
|
|
2183
2262
|
// If the value is invalid the form will appear as undefined
|
|
@@ -2641,7 +2720,9 @@ const getFinalSearch = _ref => {
|
|
|
2641
2720
|
};
|
|
2642
2721
|
/** Return the state of the table given the URL and the local storage state */
|
|
2643
2722
|
const getModelsParsedOrUpdateLocalStorage = (search, localStorageVersion, columns, historyReplace, initialState, localStorage) => {
|
|
2644
|
-
|
|
2723
|
+
// Convert from display format (dot notation) to internal format (bracket notation) if needed
|
|
2724
|
+
const decodedSearch = getDecodedSearchFromUrl(search, columns);
|
|
2725
|
+
const currentVersion = new URLSearchParams(decodedSearch).get('v');
|
|
2645
2726
|
const isNewVersion = !currentVersion || Number(currentVersion) !== localStorageVersion;
|
|
2646
2727
|
const {
|
|
2647
2728
|
localStorageFilters,
|
|
@@ -2655,14 +2736,14 @@ const getModelsParsedOrUpdateLocalStorage = (search, localStorageVersion, column
|
|
|
2655
2736
|
localStoragePinnedColumns,
|
|
2656
2737
|
setLocalStoragePinnedColumns
|
|
2657
2738
|
} = localStorage;
|
|
2658
|
-
const filterModel = getFilterModel(
|
|
2659
|
-
const sortModel = getSortModel(
|
|
2660
|
-
const paginationModel = getPaginationModel(
|
|
2661
|
-
const columnVisibilityModel = getColumnsVisibility(
|
|
2662
|
-
const pinnedColumnsModel = getPinnedColumns(
|
|
2739
|
+
const filterModel = getFilterModel(decodedSearch, columns, localStorageFilters, setLocalStorageFilters, initialState, isNewVersion);
|
|
2740
|
+
const sortModel = getSortModel(decodedSearch, columns, localStorageSorting, setLocalStorageSorting, initialState, isNewVersion);
|
|
2741
|
+
const paginationModel = getPaginationModel(decodedSearch, localStoragePagination, setLocalStoragePagination, initialState, isNewVersion);
|
|
2742
|
+
const columnVisibilityModel = getColumnsVisibility(decodedSearch, columns, localStorageColumnsVisibility, setLocalStorageColumnsVisibility, initialState, isNewVersion);
|
|
2743
|
+
const pinnedColumnsModel = getPinnedColumns(decodedSearch, columns, localStoragePinnedColumns, setLocalStoragePinnedColumns, initialState, isNewVersion);
|
|
2663
2744
|
const finalSearch = getFinalSearch({
|
|
2664
2745
|
localStorageVersion,
|
|
2665
|
-
search,
|
|
2746
|
+
search: decodedSearch,
|
|
2666
2747
|
filterModel,
|
|
2667
2748
|
sortModel,
|
|
2668
2749
|
paginationModel,
|
|
@@ -2670,9 +2751,15 @@ const getModelsParsedOrUpdateLocalStorage = (search, localStorageVersion, column
|
|
|
2670
2751
|
pinnedColumnsModel,
|
|
2671
2752
|
columns
|
|
2672
2753
|
});
|
|
2673
|
-
const
|
|
2674
|
-
|
|
2675
|
-
|
|
2754
|
+
const internalSearchString = urlSearchParamsToString(finalSearch);
|
|
2755
|
+
// Convert to display format for the URL
|
|
2756
|
+
const displaySearchString = buildQueryParamsString(internalSearchString);
|
|
2757
|
+
const displaySearchWithoutQuestion = displaySearchString.startsWith('?') ? displaySearchString.slice(1) : displaySearchString;
|
|
2758
|
+
|
|
2759
|
+
// Compare with original search (without leading ?)
|
|
2760
|
+
const originalSearchWithoutQuestion = search.startsWith('?') ? search.slice(1) : search;
|
|
2761
|
+
if (!areSearchStringsEqual(displaySearchWithoutQuestion, originalSearchWithoutQuestion)) {
|
|
2762
|
+
historyReplace(displaySearchWithoutQuestion);
|
|
2676
2763
|
}
|
|
2677
2764
|
return {
|
|
2678
2765
|
filterModel,
|
|
@@ -2690,8 +2777,10 @@ const updateUrl = (_ref2, search, localStorageVersion, historyReplace, columns)
|
|
|
2690
2777
|
columnsModel: columnsVisibilityModel,
|
|
2691
2778
|
pinnedColumnsModel
|
|
2692
2779
|
} = _ref2;
|
|
2780
|
+
// Convert from display format to internal format if needed
|
|
2781
|
+
const decodedSearch = getDecodedSearchFromUrl(search, columns);
|
|
2693
2782
|
const newSearch = getFinalSearch({
|
|
2694
|
-
search,
|
|
2783
|
+
search: decodedSearch,
|
|
2695
2784
|
localStorageVersion,
|
|
2696
2785
|
filterModel,
|
|
2697
2786
|
sortModel,
|
|
@@ -2700,9 +2789,15 @@ const updateUrl = (_ref2, search, localStorageVersion, historyReplace, columns)
|
|
|
2700
2789
|
pinnedColumnsModel,
|
|
2701
2790
|
columns
|
|
2702
2791
|
});
|
|
2703
|
-
const
|
|
2704
|
-
|
|
2705
|
-
|
|
2792
|
+
const internalSearchString = urlSearchParamsToString(newSearch);
|
|
2793
|
+
// Convert to display format for the URL
|
|
2794
|
+
const displaySearchString = buildQueryParamsString(internalSearchString);
|
|
2795
|
+
const displaySearchWithoutQuestion = displaySearchString.startsWith('?') ? displaySearchString.slice(1) : displaySearchString;
|
|
2796
|
+
|
|
2797
|
+
// Compare with original search (without leading ?)
|
|
2798
|
+
const originalSearchWithoutQuestion = search.startsWith('?') ? search.slice(1) : search;
|
|
2799
|
+
if (!areSearchStringsEqual(displaySearchWithoutQuestion, originalSearchWithoutQuestion)) {
|
|
2800
|
+
historyReplace(displaySearchWithoutQuestion);
|
|
2706
2801
|
}
|
|
2707
2802
|
};
|
|
2708
2803
|
|
|
@@ -3103,18 +3198,11 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3103
3198
|
pageSize: paginationModel.pageSize
|
|
3104
3199
|
});
|
|
3105
3200
|
|
|
3106
|
-
// Version counter to force re-renders when selectionStatus ref changes
|
|
3107
|
-
const [, forceSelectionUpdate] = useState(0);
|
|
3108
|
-
|
|
3109
|
-
// The checkboxSelectionVisibleOnly should only be applied to client-side pagination,
|
|
3110
|
-
// for server-side pagination it produces inconsistent behavior when selecting all rows in pages 2 and beyond
|
|
3111
|
-
const checkboxSelectionVisibleOnly = Boolean(pagination) && Boolean(paginationMode != 'server');
|
|
3112
|
-
|
|
3113
3201
|
// in server-side pagination we want to update the selection status
|
|
3114
3202
|
// every time we navigate between pages, resize our page or select something
|
|
3115
3203
|
useEffect(() => {
|
|
3116
3204
|
if (paginationMode == 'server') {
|
|
3117
|
-
onServerSideSelectionStatusChange(Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel], apiRef, selectionStatus,
|
|
3205
|
+
onServerSideSelectionStatusChange(Array.isArray(rowSelectionModel) ? rowSelectionModel : [rowSelectionModel], apiRef, selectionStatus, isRowSelectable, paginationModel.page, paginationModel.pageSize);
|
|
3118
3206
|
}
|
|
3119
3207
|
}, [rowSelectionModel, paginationModel.page, paginationModel.pageSize]);
|
|
3120
3208
|
if (!Array.isArray(rows)) {
|
|
@@ -3142,7 +3230,7 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3142
3230
|
ref: datagridRef,
|
|
3143
3231
|
className: classNames(StatefulDataGrid.className, className),
|
|
3144
3232
|
$height: height
|
|
3145
|
-
}, /*#__PURE__*/React__default.createElement(DataGridPro, _extends({}, forwardedProps, {
|
|
3233
|
+
}, /*#__PURE__*/React__default.createElement(DataGridPro, _extends$1({}, forwardedProps, {
|
|
3146
3234
|
apiRef: apiRef,
|
|
3147
3235
|
columns: columns,
|
|
3148
3236
|
columnVisibilityModel: columnVisibilityModel,
|
|
@@ -3165,65 +3253,49 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3165
3253
|
rows: rows,
|
|
3166
3254
|
rowCount: rowCount,
|
|
3167
3255
|
autoHeight: autoHeight,
|
|
3168
|
-
checkboxSelectionVisibleOnly:
|
|
3256
|
+
checkboxSelectionVisibleOnly: Boolean(pagination),
|
|
3169
3257
|
slots: _objectSpread2(_objectSpread2({
|
|
3170
3258
|
baseButton: BaseButton,
|
|
3171
3259
|
baseCheckbox: BaseCheckbox,
|
|
3172
3260
|
// baseTextField,
|
|
3173
3261
|
basePopper: BasePopper,
|
|
3174
|
-
columnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({}, props, {
|
|
3262
|
+
columnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
3175
3263
|
displayName: "ColumnFilteredIcon"
|
|
3176
3264
|
})),
|
|
3177
|
-
columnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({}, props, {
|
|
3265
|
+
columnSelectorIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
3178
3266
|
displayName: "ColumnSelectorIcon"
|
|
3179
3267
|
})),
|
|
3180
|
-
columnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({}, props, {
|
|
3268
|
+
columnSortedAscendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
3181
3269
|
displayName: "ColumnSortedAscendingIcon"
|
|
3182
3270
|
})),
|
|
3183
|
-
columnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({}, props, {
|
|
3271
|
+
columnSortedDescendingIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
3184
3272
|
displayName: "ColumnSortedDescendingIcon"
|
|
3185
3273
|
})),
|
|
3186
|
-
densityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({}, props, {
|
|
3274
|
+
densityCompactIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
3187
3275
|
displayName: "DensityCompactIcon"
|
|
3188
3276
|
})),
|
|
3189
|
-
densityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({}, props, {
|
|
3277
|
+
densityStandardIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
3190
3278
|
displayName: "DensityStandardIcon"
|
|
3191
3279
|
})),
|
|
3192
|
-
densityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({}, props, {
|
|
3280
|
+
densityComfortableIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
3193
3281
|
displayName: "DensityComfortableIcon"
|
|
3194
3282
|
})),
|
|
3195
|
-
detailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({}, props, {
|
|
3283
|
+
detailPanelCollapseIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
3196
3284
|
displayName: "DetailPanelCollapseIcon"
|
|
3197
3285
|
})),
|
|
3198
|
-
detailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({}, props, {
|
|
3286
|
+
detailPanelExpandIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
3199
3287
|
displayName: "DetailPanelExpandIcon"
|
|
3200
3288
|
})),
|
|
3201
|
-
exportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({}, props, {
|
|
3289
|
+
exportIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
3202
3290
|
displayName: "ExportIcon"
|
|
3203
3291
|
})),
|
|
3204
|
-
openFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({
|
|
3292
|
+
openFilterButtonIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({
|
|
3205
3293
|
displayName: "OpenFilterButtonIcon"
|
|
3206
3294
|
}, props))
|
|
3207
3295
|
}, slots), {}, {
|
|
3208
|
-
toolbar:
|
|
3209
|
-
hideToolbar: hideToolbar,
|
|
3210
|
-
RenderedToolbar: RenderedToolbar,
|
|
3211
|
-
filterModel: filterModel,
|
|
3212
|
-
onFilterModelChange: onFilterModelChange,
|
|
3213
|
-
pagination: pagination,
|
|
3214
|
-
paginationPlacement: paginationPlacement,
|
|
3215
|
-
selectionStatus: selectionStatus,
|
|
3216
|
-
apiRef: apiRef,
|
|
3217
|
-
isRowSelectable: isRowSelectable,
|
|
3218
|
-
paginationModel: paginationModel,
|
|
3219
|
-
onPaginationModelChange: onPaginationModelChange,
|
|
3220
|
-
pageSizeOptions: pageSizeOptions,
|
|
3221
|
-
paginationProps: paginationProps,
|
|
3222
|
-
paginationMode: paginationMode,
|
|
3223
|
-
rowCount: rowCount
|
|
3224
|
-
})),
|
|
3296
|
+
toolbar: ToolbarWrapper,
|
|
3225
3297
|
pagination: props => {
|
|
3226
|
-
return pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends({}, props, {
|
|
3298
|
+
return pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, _extends$1({}, props, {
|
|
3227
3299
|
displaySelection: false,
|
|
3228
3300
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
3229
3301
|
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
@@ -3232,8 +3304,9 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3232
3304
|
onPaginationModelChange: onPaginationModelChange,
|
|
3233
3305
|
pageSizeOptions: pageSizeOptions,
|
|
3234
3306
|
paginationProps: paginationProps,
|
|
3307
|
+
paginationMode: paginationMode,
|
|
3235
3308
|
rowCount: rowCount
|
|
3236
|
-
})) : /*#__PURE__*/React__default.createElement(ControlledPagination, _extends({}, props, {
|
|
3309
|
+
})) : /*#__PURE__*/React__default.createElement(ControlledPagination, _extends$1({}, props, {
|
|
3237
3310
|
displaySelection: false,
|
|
3238
3311
|
displayRowsPerPage: ['bottom', 'both'].includes(paginationPlacement),
|
|
3239
3312
|
displayPagination: ['bottom', 'both'].includes(paginationPlacement),
|
|
@@ -3243,11 +3316,30 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3243
3316
|
paginationModel: paginationModel,
|
|
3244
3317
|
onPaginationModelChange: onPaginationModelChange,
|
|
3245
3318
|
pageSizeOptions: pageSizeOptions,
|
|
3246
|
-
paginationProps: paginationProps
|
|
3319
|
+
paginationProps: paginationProps,
|
|
3320
|
+
paginationMode: paginationMode
|
|
3247
3321
|
})) : null;
|
|
3248
3322
|
}
|
|
3249
3323
|
}),
|
|
3250
|
-
slotProps: _objectSpread2({}, slotProps),
|
|
3324
|
+
slotProps: _objectSpread2(_objectSpread2({}, slotProps), {}, {
|
|
3325
|
+
toolbar: _objectSpread2({
|
|
3326
|
+
hideToolbar,
|
|
3327
|
+
RenderedToolbar,
|
|
3328
|
+
filterModel,
|
|
3329
|
+
onFilterModelChange,
|
|
3330
|
+
pagination,
|
|
3331
|
+
paginationPlacement,
|
|
3332
|
+
selectionStatus,
|
|
3333
|
+
apiRef,
|
|
3334
|
+
isRowSelectable,
|
|
3335
|
+
paginationModel,
|
|
3336
|
+
onPaginationModelChange,
|
|
3337
|
+
pageSizeOptions,
|
|
3338
|
+
paginationProps,
|
|
3339
|
+
paginationMode,
|
|
3340
|
+
rowCount
|
|
3341
|
+
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.toolbar)
|
|
3342
|
+
}),
|
|
3251
3343
|
rowSelectionModel: rowSelectionModel,
|
|
3252
3344
|
onRowSelectionModelChange: (newSelectionModel, details) => {
|
|
3253
3345
|
if (pagination && paginationMode != 'server') {
|
|
@@ -3306,7 +3398,6 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3306
3398
|
numberOfSelectedRows
|
|
3307
3399
|
};
|
|
3308
3400
|
}
|
|
3309
|
-
forceSelectionUpdate(v => v + 1);
|
|
3310
3401
|
}
|
|
3311
3402
|
onRowSelectionModelChange === null || onRowSelectionModelChange === void 0 ? void 0 : onRowSelectionModelChange(newSelectionModel, details);
|
|
3312
3403
|
},
|
|
@@ -3324,5 +3415,5 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3324
3415
|
StatefulDataGrid.className = CLASSNAME;
|
|
3325
3416
|
StatefulDataGrid.displayName = COMPONENT_NAME;
|
|
3326
3417
|
|
|
3327
|
-
export {
|
|
3418
|
+
export { isOperatorValueValid as $, getGridStringArrayOperatorsWithSelectOnStringArrayColumns as A, SORT_MODEL_KEY as B, CONTAINS_ANY_OF as C, DOES_NOT_CONTAIN as D, ENDS_WITH_ANY_OF as E, FILTER_MODEL_KEY as F, PINNED_COLUMNS as G, HAS as H, IS_BETWEEN as I, DIMENSION_MODEL_KEY as J, FILTER_SEARCH_KEY as K, CATEGORIES as L, buildStorageKey as M, clearPreviousVersionStorage as N, convertToDisplayFormat as O, PAGINATION_MODEL_KEY as P, convertFromDisplayFormat as Q, getDecodedSearchFromUrl as R, STARTS_WITH_ANY_OF as S, buildQueryParamsString as T, areSearchStringsEqual as U, VISIBILITY_MODEL_KEY as V, decodeValue as W, encodeValue as X, urlSearchParamsToString as Y, numberOperatorEncoder as Z, numberOperatorDecoder as _, DOES_NOT_EQUAL as a, isValueValid as a0, getFilterModelFromString as a1, getSearchParamsFromFilterModel as a2, getSortingFromString as a3, getSearchParamsFromSorting as a4, getPaginationFromString as a5, getSearchParamsFromPagination as a6, getColumnVisibilityFromString as a7, getSearchParamsFromColumnVisibility as a8, getPinnedColumnsFromString as a9, getSearchParamsFromPinnedColumns as aa, getSearchParamsFromTab as ab, getFinalSearch as ac, getModelsParsedOrUpdateLocalStorage as ad, updateUrl as ae, areFilterModelsEquivalent as af, StatefulDataGrid as ag, DOES_NOT_HAVE as b, DOES_NOT_HAVE_WITH_SELECT as c, HAS_WITH_SELECT as d, HAS_ONLY as e, HAS_ONLY_WITH_SELECT as f, getGridNumericOperators as g, IS as h, IS_WITH_SELECT as i, IS_NOT as j, IS_NOT_WITH_SELECT as k, getGridStringOperators as l, CONTAINS_ANY_OF_I as m, DOES_NOT_HAVE_ANY_OF as n, operatorList as o, DOES_NOT_HAVE_ANY_OF_WITH_SELECT as p, IS_ANY_OF as q, IS_ANY_OF_WITH_SELECT as r, IS_ANY_OF_I as s, IS_ANY_OF_I_WITH_SELECT as t, HAS_ANY_OF as u, HAS_ANY_OF_WITH_SELECT as v, IS_NOT_ANY_OF as w, IS_NOT_ANY_OF_WITH_SELECT as x, getGridStringArrayOperators as y, getGridStringArrayOperatorsWithSelect as z };
|
|
3328
3419
|
//# sourceMappingURL=StatefulDataGrid2.js.map
|