@rjsf/mui 6.6.1 → 6.6.2
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/dist/index.cjs +90 -71
- package/dist/index.cjs.map +3 -3
- package/dist/mui.esm.js +103 -145
- package/dist/mui.esm.js.map +3 -3
- package/dist/mui.umd.js +85 -67
- package/lib/AddButton/AddButton.d.ts +1 -1
- package/lib/AddButton/AddButton.js +1 -1
- package/lib/AddButton/AddButton.js.map +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +4 -4
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +4 -4
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +3 -3
- package/lib/BaseInputTemplate/BaseInputTemplate.js +7 -7
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.d.ts +3 -3
- package/lib/CheckboxWidget/CheckboxWidget.js +5 -5
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +4 -4
- package/lib/CheckboxesWidget/CheckboxesWidget.js +6 -6
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.d.ts +2 -2
- package/lib/DescriptionField/DescriptionField.js +1 -1
- package/lib/DescriptionField/DescriptionField.js.map +1 -1
- package/lib/ErrorList/ErrorList.d.ts +8 -8
- package/lib/ErrorList/ErrorList.js +2 -4
- package/lib/ErrorList/ErrorList.js.map +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +4 -4
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +2 -4
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +2 -2
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.d.ts +3 -3
- package/lib/FieldTemplate/FieldTemplate.js +2 -2
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/GridTemplate/GridTemplate.d.ts +1 -1
- package/lib/IconButton/IconButton.d.ts +14 -7
- package/lib/IconButton/IconButton.js +15 -7
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/MuiForm/MuiForm.d.ts +3 -3
- package/lib/MuiForm/MuiForm.js.map +1 -1
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +3 -3
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js +1 -1
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js.map +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +3 -3
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.d.ts +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -1
- package/lib/RadioWidget/RadioWidget.d.ts +4 -4
- package/lib/RadioWidget/RadioWidget.js +6 -6
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/RangeWidget/RangeWidget.d.ts +2 -2
- package/lib/RangeWidget/RangeWidget.js +6 -6
- package/lib/RangeWidget/RangeWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.d.ts +3 -3
- package/lib/SelectWidget/SelectWidget.js +7 -7
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.d.ts +3 -3
- package/lib/SubmitButton/SubmitButton.js +1 -1
- package/lib/SubmitButton/SubmitButton.js.map +1 -1
- package/lib/Templates/Templates.d.ts +1 -1
- package/lib/TextareaWidget/TextareaWidget.d.ts +1 -1
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/Theme/Theme.d.ts +2 -2
- package/lib/TitleField/TitleField.d.ts +5 -5
- package/lib/TitleField/TitleField.js +1 -1
- package/lib/TitleField/TitleField.js.map +1 -1
- package/lib/Widgets/Widgets.d.ts +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +2 -2
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/util.d.ts +2 -2
- package/lib/util.js +3 -3
- package/package.json +6 -6
- package/src/AddButton/AddButton.tsx +4 -9
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +9 -7
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +8 -7
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +17 -18
- package/src/CheckboxWidget/CheckboxWidget.tsx +12 -20
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +16 -17
- package/src/DescriptionField/DescriptionField.tsx +4 -3
- package/src/ErrorList/ErrorList.tsx +26 -27
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +17 -22
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +4 -10
- package/src/FieldTemplate/FieldTemplate.tsx +8 -13
- package/src/GridTemplate/GridTemplate.tsx +1 -1
- package/src/IconButton/IconButton.tsx +20 -19
- package/src/MuiForm/MuiForm.tsx +4 -3
- package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +6 -4
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +6 -10
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +3 -2
- package/src/RadioWidget/RadioWidget.tsx +17 -18
- package/src/RangeWidget/RangeWidget.tsx +12 -19
- package/src/SelectWidget/SelectWidget.tsx +21 -20
- package/src/SubmitButton/SubmitButton.tsx +6 -11
- package/src/Templates/Templates.ts +1 -1
- package/src/TextareaWidget/TextareaWidget.tsx +2 -1
- package/src/Theme/Theme.tsx +2 -2
- package/src/TitleField/TitleField.tsx +11 -13
- package/src/Widgets/Widgets.ts +1 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +6 -8
- package/src/util.ts +5 -5
|
@@ -16,7 +16,7 @@ export default function CheckboxesWidget(props) {
|
|
|
16
16
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
17
17
|
const optionValueFormat = getOptionValueFormat(options);
|
|
18
18
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
19
|
-
const
|
|
19
|
+
const handleChange = (index) => ({ target: { checked } }) => {
|
|
20
20
|
if (checked) {
|
|
21
21
|
onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
|
|
22
22
|
}
|
|
@@ -24,15 +24,15 @@ export default function CheckboxesWidget(props) {
|
|
|
24
24
|
onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
const
|
|
28
|
-
const
|
|
27
|
+
const handleBlur = ({ target }) => onBlur(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, emptyValue));
|
|
28
|
+
const handleFocus = ({ target }) => onFocus(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, emptyValue));
|
|
29
29
|
const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(options);
|
|
30
30
|
return (_jsxs(_Fragment, { children: [labelValue(_jsx(FormLabel, { required: required, htmlFor: id, children: label || undefined }), hideLabel), _jsx(FormGroup, { ...otherMuiProps, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.formGroup, id: id, row: !!inline, children: Array.isArray(enumOptions) &&
|
|
31
31
|
enumOptions.map((option, index) => {
|
|
32
32
|
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
33
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.
|
|
34
|
-
const checkbox = (_jsx(Checkbox, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.checkbox, id: optionId(id, index), name: htmlName || id, checked: checked, disabled: disabled || itemDisabled || readonly, autoFocus: autofocus && index === 0, onChange:
|
|
35
|
-
return (_createElement(FormControlLabel, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.formControlLabel, control: checkbox, key:
|
|
33
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
|
|
34
|
+
const checkbox = (_jsx(Checkbox, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.checkbox, id: optionId(id, index), name: htmlName || id, checked: checked, disabled: disabled || itemDisabled || readonly, autoFocus: autofocus && index === 0, onChange: handleChange(index), onBlur: handleBlur, onFocus: handleFocus, "aria-describedby": ariaDescribedByIds(id) }));
|
|
35
|
+
return (_createElement(FormControlLabel, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.formControlLabel, control: checkbox, key: String(option.value), label: option.label }));
|
|
36
36
|
}) })] }));
|
|
37
37
|
}
|
|
38
38
|
//# sourceMappingURL=CheckboxesWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxesWidget.js","sourceRoot":"","sources":["../../src/CheckboxesWidget/CheckboxesWidget.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"CheckboxesWidget.js","sourceRoot":"","sources":["../../src/CheckboxesWidget/CheckboxesWidget.tsx"],"names":[],"mappings":";;AAEA,OAAO,QAAQ,MA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vB,IAAI,EAAE,QAAQ,IAAI,EAAE,EACpB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,IAAI,YAAY,IAAI,QAAQ,EAC9C,SAAS,EAAE,SAAS,IAAI,KAAK,KAAK,CAAC,EACnC,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,EAC7B,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,WAAW,sBACF,kBAAkB,CAAC,EAAE,CAAC,GACxC,CACH,CAAC;wBACF,OAAO,CACL,eAAC,gBAAgB,OACX,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,gBAAgB,EAClC,OAAO,EAAE,QAAQ,EACjB,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EACzB,KAAK,EAAE,MAAM,CAAC,KAAK,GACnB,CACH,CAAC;oBACJ,CAAC,CAAC,GACM,IACX,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TypographyProps } from '@mui/material/Typography';
|
|
2
|
-
import { DescriptionFieldProps, FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { TypographyProps } from '@mui/material/Typography';
|
|
2
|
+
import type { DescriptionFieldProps, FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
3
|
/** Properties available for the `rjsfSlotProps` target of the DescriptionField. */
|
|
4
4
|
export interface DescriptionFieldMuiProps extends GenericObjectType {
|
|
5
5
|
/** RJSF-specific slot props for targeting child elements of the DescriptionField. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Typography from '@mui/material/Typography';
|
|
3
3
|
import { RichDescription } from '@rjsf/core';
|
|
4
|
-
import { getUiOptions
|
|
4
|
+
import { getUiOptions } from '@rjsf/utils';
|
|
5
5
|
import { computeSxProps, getMuiProps } from '../util.js';
|
|
6
6
|
/** The `DescriptionField` is the template to use to render the description of a field
|
|
7
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptionField.js","sourceRoot":"","sources":["../../src/DescriptionField/DescriptionField.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DescriptionField.js","sourceRoot":"","sources":["../../src/DescriptionField/DescriptionField.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAQ7C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAItC,KAAqC;IACrC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEtD,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,EAAE,aAAa,EAAE,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,GAAG,WAAW,CAAoC,SAAS,CAAC,CAAC;IAE7G,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CACL,KAAC,UAAU,IACT,EAAE,EAAE,EAAE,EACN,OAAO,EAAC,WAAW,KACf,cAAc,EAClB,EAAE,EAAE,cAAc,CAAkB,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,cAAc,CAAC,YAElE,KAAC,eAAe,IAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,GAC1E,CACd,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BoxProps } from '@mui/material/Box';
|
|
2
|
-
import { ListProps } from '@mui/material/List';
|
|
3
|
-
import { ListItemProps } from '@mui/material/ListItem';
|
|
4
|
-
import { ListItemIconProps } from '@mui/material/ListItemIcon';
|
|
5
|
-
import { ListItemTextProps } from '@mui/material/ListItemText';
|
|
6
|
-
import { PaperProps } from '@mui/material/Paper';
|
|
7
|
-
import { TypographyProps } from '@mui/material/Typography';
|
|
8
|
-
import { ErrorListProps, FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { BoxProps } from '@mui/material/Box';
|
|
2
|
+
import type { ListProps } from '@mui/material/List';
|
|
3
|
+
import type { ListItemProps } from '@mui/material/ListItem';
|
|
4
|
+
import type { ListItemIconProps } from '@mui/material/ListItemIcon';
|
|
5
|
+
import type { ListItemTextProps } from '@mui/material/ListItemText';
|
|
6
|
+
import type { PaperProps } from '@mui/material/Paper';
|
|
7
|
+
import type { TypographyProps } from '@mui/material/Typography';
|
|
8
|
+
import type { ErrorListProps, FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
9
9
|
/** Properties available for the `rjsfSlotProps` target of the ErrorList. */
|
|
10
10
|
export interface ErrorListMuiProps extends GenericObjectType {
|
|
11
11
|
/** RJSF-specific slot props for targeting child elements of the ErrorList. */
|
|
@@ -7,7 +7,7 @@ import ListItemIcon from '@mui/material/ListItemIcon';
|
|
|
7
7
|
import ListItemText from '@mui/material/ListItemText';
|
|
8
8
|
import Paper from '@mui/material/Paper';
|
|
9
9
|
import Typography from '@mui/material/Typography';
|
|
10
|
-
import { TranslatableString, getUiOptions
|
|
10
|
+
import { TranslatableString, getUiOptions } from '@rjsf/utils';
|
|
11
11
|
import { computeSxProps, getMuiProps } from '../util.js';
|
|
12
12
|
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
13
13
|
*
|
|
@@ -17,8 +17,6 @@ export default function ErrorList({ errors, registry, uiSchema, }) {
|
|
|
17
17
|
const { translateString } = registry;
|
|
18
18
|
const uiOptions = getUiOptions(uiSchema);
|
|
19
19
|
const { rjsfSlotProps: { errorPaper, errorBox, errorTypography, errorList, errorListItem, errorListItemIcon, errorListItemText, } = {}, } = getMuiProps(uiOptions);
|
|
20
|
-
return (_jsx(Paper, { elevation: 2, ...errorPaper, children: _jsxs(Box, { ...errorBox, sx: computeSxProps({ mb: 2, p: 2 }, errorBox), children: [_jsx(Typography, { variant: 'h6', ...errorTypography, children: translateString(TranslatableString.ErrorsLabel) }), _jsx(List, { dense: true, ...errorList, children: errors.map((error, i) => {
|
|
21
|
-
return (_jsxs(ListItem, { ...errorListItem, children: [_jsx(ListItemIcon, { ...errorListItemIcon, children: _jsx(ErrorIcon, { color: 'error' }) }), _jsx(ListItemText, { primary: error.stack, ...errorListItemText })] }, i));
|
|
22
|
-
}) })] }) }));
|
|
20
|
+
return (_jsx(Paper, { elevation: 2, ...errorPaper, children: _jsxs(Box, { ...errorBox, sx: computeSxProps({ mb: 2, p: 2 }, errorBox), children: [_jsx(Typography, { variant: 'h6', ...errorTypography, children: translateString(TranslatableString.ErrorsLabel) }), _jsx(List, { dense: true, ...errorList, children: errors.map((error, i) => (_jsxs(ListItem, { ...errorListItem, children: [_jsx(ListItemIcon, { ...errorListItemIcon, children: _jsx(ErrorIcon, { color: 'error' }) }), _jsx(ListItemText, { primary: error.stack, ...errorListItemText })] }, i))) })] }) }));
|
|
23
21
|
}
|
|
24
22
|
//# sourceMappingURL=ErrorList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorList.js","sourceRoot":"","sources":["../../src/ErrorList/ErrorList.tsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorList.js","sourceRoot":"","sources":["../../src/ErrorList/ErrorList.tsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AAEpC,OAAO,IAAI,MAAM,oBAAoB,CAAC;A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GACd,EACf,KAAC,YAAY,IAAC,OAAO,EAAE,KAAK,CAAC,KAAK,KAAM,iBAAiB,GAAI,KAJhD,CAAC,CAKL,CACZ,CAAC,GACG,IACH,GACA,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FormHelperTextProps } from '@mui/material/FormHelperText';
|
|
2
|
-
import { ListProps } from '@mui/material/List';
|
|
3
|
-
import { ListItemProps } from '@mui/material/ListItem';
|
|
4
|
-
import { FieldErrorProps, FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { FormHelperTextProps } from '@mui/material/FormHelperText';
|
|
2
|
+
import type { ListProps } from '@mui/material/List';
|
|
3
|
+
import type { ListItemProps } from '@mui/material/ListItem';
|
|
4
|
+
import type { FieldErrorProps, FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
5
5
|
/** Properties available for the `rjsfSlotProps` target of the FieldErrorTemplate. */
|
|
6
6
|
export interface FieldErrorTemplateMuiProps extends GenericObjectType {
|
|
7
7
|
/** RJSF-specific slot props for targeting child elements of the FieldErrorTemplate. */
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import FormHelperText from '@mui/material/FormHelperText';
|
|
3
3
|
import List from '@mui/material/List';
|
|
4
4
|
import ListItem from '@mui/material/ListItem';
|
|
5
|
-
import { errorId, getUiOptions
|
|
5
|
+
import { errorId, getUiOptions } from '@rjsf/utils';
|
|
6
6
|
import { getMuiProps } from '../util.js';
|
|
7
7
|
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
8
8
|
*
|
|
@@ -17,8 +17,6 @@ export default function FieldErrorTemplate(props) {
|
|
|
17
17
|
const uiOptions = getUiOptions(uiSchema);
|
|
18
18
|
const muiProps = getMuiProps(uiOptions);
|
|
19
19
|
const { rjsfSlotProps: muiSlotProps } = muiProps;
|
|
20
|
-
return (_jsx(List, { id: id, dense: true, disablePadding: true, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.fieldErrorList, children: errors.map((error, i) => {
|
|
21
|
-
return (_jsx(ListItem, { disableGutters: true, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.fieldErrorListItem, children: _jsx(FormHelperText, { component: 'div', id: `${id}-${i}`, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.fieldErrorFormHelperText, children: error }) }, i));
|
|
22
|
-
}) }));
|
|
20
|
+
return (_jsx(List, { id: id, dense: true, disablePadding: true, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.fieldErrorList, children: errors.map((error, i) => (_jsx(ListItem, { disableGutters: true, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.fieldErrorListItem, children: _jsx(FormHelperText, { component: 'div', id: `${id}-${i}`, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.fieldErrorFormHelperText, children: error }) }, i))) }));
|
|
23
21
|
}
|
|
24
22
|
//# sourceMappingURL=FieldErrorTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldErrorTemplate.js","sourceRoot":"","sources":["../../src/FieldErrorTemplate/FieldErrorTemplate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FieldErrorTemplate.js","sourceRoot":"","sources":["../../src/FieldErrorTemplate/FieldErrorTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAetC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,KAA+B;IAC/B,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACrD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEhC,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,WAAW,CAAsC,SAAS,CAAC,CAAC;IAC7E,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;IAEjD,OAAO,CACL,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,EAAE,KAAK,QAAC,cAAc,WAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,cAAc,YAChE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAS,EAAE,EAAE,CAAC,CAEhC,KAAC,QAAQ,IAAS,cAAc,WAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,kBAAkB,YACnE,KAAC,cAAc,IAAC,SAAS,EAAC,KAAK,EAAC,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,KAAM,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,wBAAwB,YACzF,KAAK,GACS,IAHJ,CAAC,CAIL,CACZ,CAAC,GACG,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormHelperTextProps } from '@mui/material/FormHelperText';
|
|
2
|
-
import { FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema, GenericObjectType } from '@rjsf/utils';
|
|
1
|
+
import type { FormHelperTextProps } from '@mui/material/FormHelperText';
|
|
2
|
+
import type { FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema, GenericObjectType } from '@rjsf/utils';
|
|
3
3
|
/** Properties available for the `rjsfSlotProps` target of the FieldHelpTemplate. */
|
|
4
4
|
export interface FieldHelpTemplateMuiProps extends GenericObjectType {
|
|
5
5
|
/** RJSF-specific slot props for targeting child elements of the FieldHelpTemplate. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import FormHelperText from '@mui/material/FormHelperText';
|
|
3
3
|
import { RichHelp } from '@rjsf/core';
|
|
4
|
-
import { helpId, getUiOptions
|
|
4
|
+
import { helpId, getUiOptions } from '@rjsf/utils';
|
|
5
5
|
import { computeSxProps, getMuiProps } from '../util.js';
|
|
6
6
|
/** The `FieldHelpTemplate` component renders any help desired for a field
|
|
7
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldHelpTemplate.js","sourceRoot":"","sources":["../../src/FieldHelpTemplate/FieldHelpTemplate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FieldHelpTemplate.js","sourceRoot":"","sources":["../../src/FieldHelpTemplate/FieldHelpTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAIvC,KAA8B;IAC9B,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACxD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,EAAE,aAAa,EAAE,EAAE,kBAAkB,EAAE,GAAG,EAAE,EAAE,GAAG,WAAW,CAAqC,SAAS,CAAC,CAAC;IAElH,OAAO,CACL,KAAC,cAAc,IACb,SAAS,EAAC,KAAK,EACf,EAAE,EAAE,MAAM,CAAC,WAAW,CAAC,KACnB,kBAAkB,EACtB,EAAE,EAAE,cAAc,CAAsB,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,kBAAkB,CAAC,YAE1E,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,GACjD,CAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FormControlProps } from '@mui/material/FormControl';
|
|
2
|
-
import { TypographyProps } from '@mui/material/Typography';
|
|
3
|
-
import { FieldTemplateProps, FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { FormControlProps } from '@mui/material/FormControl';
|
|
2
|
+
import type { TypographyProps } from '@mui/material/Typography';
|
|
3
|
+
import type { FieldTemplateProps, FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
4
4
|
/** Properties available for the `rjsfSlotProps` target of the FieldTemplate. */
|
|
5
5
|
export interface FieldTemplateMuiProps extends GenericObjectType {
|
|
6
6
|
/** RJSF-specific slot props for targeting child elements of the FieldTemplate. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import FormControl from '@mui/material/FormControl';
|
|
3
3
|
import Typography from '@mui/material/Typography';
|
|
4
|
-
import { getTemplate, getUiOptions
|
|
4
|
+
import { getTemplate, getUiOptions } from '@rjsf/utils';
|
|
5
5
|
import { getMuiProps } from '../util.js';
|
|
6
6
|
/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
|
|
7
7
|
* content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
|
|
@@ -17,6 +17,6 @@ export default function FieldTemplate(props) {
|
|
|
17
17
|
}
|
|
18
18
|
const isCheckbox = uiOptions.widget === 'checkbox';
|
|
19
19
|
const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(uiOptions);
|
|
20
|
-
return (_jsx(WrapIfAdditionalTemplate, { classNames: classNames, style: style, disabled: disabled, id: id, label: label, displayLabel: displayLabel, rawDescription: rawDescription, onKeyRename: onKeyRename, onKeyRenameBlur: onKeyRenameBlur, onRemoveProperty: onRemoveProperty, readonly: readonly, required: required, schema: schema, uiSchema: uiSchema, registry: registry, children: _jsxs(FormControl, { fullWidth: true, error: rawErrors.length
|
|
20
|
+
return (_jsx(WrapIfAdditionalTemplate, { classNames: classNames, style: style, disabled: disabled, id: id, label: label, displayLabel: displayLabel, rawDescription: rawDescription, onKeyRename: onKeyRename, onKeyRenameBlur: onKeyRenameBlur, onRemoveProperty: onRemoveProperty, readonly: readonly, required: required, schema: schema, uiSchema: uiSchema, registry: registry, children: _jsxs(FormControl, { fullWidth: true, error: !!rawErrors.length, required: required, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.fieldFormControl, sx: otherMuiProps.sx, className: otherMuiProps.className, children: [children, displayLabel && !isCheckbox && rawDescription ? (_jsx(Typography, { variant: 'caption', color: 'textSecondary', ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.fieldTypography, children: description })) : null, errors, help] }) }));
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=FieldTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldTemplate.js","sourceRoot":"","sources":["../../src/FieldTemplate/FieldTemplate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FieldTemplate.js","sourceRoot":"","sources":["../../src/FieldTemplate/FieldTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAEpD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAA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,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,YAElB,MAAC,WAAW,IACV,SAAS,QACT,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EACzB,QAAQ,EAAE,QAAQ,KACd,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,gBAAgB,EAClC,EAAE,EAAE,aAAa,CAAC,EAAE,EACpB,SAAS,EAAE,aAAa,CAAC,SAAS,aAEjC,QAAQ,EACR,YAAY,IAAI,CAAC,UAAU,IAAI,cAAc,CAAC,CAAC,CAAC,CAC/C,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,eAAe,KAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,eAAe,YAClF,WAAW,GACD,CACd,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,EACN,IAAI,IACO,GACW,CAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridTemplateProps } from '@rjsf/utils';
|
|
1
|
+
import type { GridTemplateProps } from '@rjsf/utils';
|
|
2
2
|
/** Renders a `GridTemplate` for mui, which is expecting the column sizing information coming in via the
|
|
3
3
|
* extra props provided by the caller, which are spread directly on the `Grid`.
|
|
4
4
|
*
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
export declare
|
|
7
|
-
|
|
1
|
+
import type { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
declare function MuiIconButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const MuiIconButton: typeof MuiIconButtonFn;
|
|
4
|
+
export default MuiIconButton;
|
|
5
|
+
declare function CopyButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const CopyButton: typeof CopyButtonFn;
|
|
7
|
+
declare function MoveDownButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const MoveDownButton: typeof MoveDownButtonFn;
|
|
9
|
+
declare function MoveUpButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const MoveUpButton: typeof MoveUpButtonFn;
|
|
11
|
+
declare function RemoveButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const RemoveButton: typeof RemoveButtonFn;
|
|
13
|
+
declare function ClearButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const ClearButton: typeof ClearButtonFn;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
2
3
|
import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward';
|
|
3
4
|
import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward';
|
|
4
5
|
import ClearIcon from '@mui/icons-material/Clear';
|
|
5
6
|
import CopyIcon from '@mui/icons-material/ContentCopy';
|
|
6
7
|
import RemoveIcon from '@mui/icons-material/Remove';
|
|
7
8
|
import IconButton from '@mui/material/IconButton';
|
|
8
|
-
import { TranslatableString, getUiOptions
|
|
9
|
+
import { TranslatableString, getUiOptions } from '@rjsf/utils';
|
|
9
10
|
import { getMuiProps } from '../util.js';
|
|
10
|
-
|
|
11
|
+
function MuiIconButtonFn(props) {
|
|
11
12
|
const { icon, color, uiSchema, registry, ...otherProps } = props;
|
|
12
13
|
const uiOptions = getUiOptions(uiSchema);
|
|
13
14
|
const muiProps = getMuiProps(uiOptions, [
|
|
@@ -20,26 +21,33 @@ export default function MuiIconButton(props) {
|
|
|
20
21
|
]);
|
|
21
22
|
return (_jsx(IconButton, { ...muiProps, ...otherProps, size: 'small', color: color, children: icon }));
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
+
const MuiIconButton = memo(MuiIconButtonFn);
|
|
25
|
+
export default MuiIconButton;
|
|
26
|
+
function CopyButtonFn(props) {
|
|
24
27
|
const { registry: { translateString }, } = props;
|
|
25
28
|
return (_jsx(MuiIconButton, { title: translateString(TranslatableString.CopyButton), ...props, icon: _jsx(CopyIcon, { fontSize: 'small' }) }));
|
|
26
29
|
}
|
|
27
|
-
export
|
|
30
|
+
export const CopyButton = memo(CopyButtonFn);
|
|
31
|
+
function MoveDownButtonFn(props) {
|
|
28
32
|
const { registry: { translateString }, } = props;
|
|
29
33
|
return (_jsx(MuiIconButton, { title: translateString(TranslatableString.MoveDownButton), ...props, icon: _jsx(ArrowDownwardIcon, { fontSize: 'small' }) }));
|
|
30
34
|
}
|
|
31
|
-
export
|
|
35
|
+
export const MoveDownButton = memo(MoveDownButtonFn);
|
|
36
|
+
function MoveUpButtonFn(props) {
|
|
32
37
|
const { registry: { translateString }, } = props;
|
|
33
38
|
return (_jsx(MuiIconButton, { title: translateString(TranslatableString.MoveUpButton), ...props, icon: _jsx(ArrowUpwardIcon, { fontSize: 'small' }) }));
|
|
34
39
|
}
|
|
35
|
-
export
|
|
40
|
+
export const MoveUpButton = memo(MoveUpButtonFn);
|
|
41
|
+
function RemoveButtonFn(props) {
|
|
36
42
|
const { iconType, ...otherProps } = props;
|
|
37
43
|
const { registry: { translateString }, } = otherProps;
|
|
38
44
|
return (_jsx(MuiIconButton, { title: translateString(TranslatableString.RemoveButton), ...otherProps, color: 'error', icon: _jsx(RemoveIcon, { fontSize: iconType === 'default' ? undefined : 'small' }) }));
|
|
39
45
|
}
|
|
40
|
-
export
|
|
46
|
+
export const RemoveButton = memo(RemoveButtonFn);
|
|
47
|
+
function ClearButtonFn(props) {
|
|
41
48
|
const { iconType, ...otherProps } = props;
|
|
42
49
|
const { registry: { translateString }, } = otherProps;
|
|
43
50
|
return (_jsx(MuiIconButton, { title: translateString(TranslatableString.ClearButton), ...otherProps, icon: _jsx(ClearIcon, { fontSize: iconType === 'default' ? undefined : 'small' }) }));
|
|
44
51
|
}
|
|
52
|
+
export const ClearButton = memo(ClearButtonFn);
|
|
45
53
|
//# sourceMappingURL=IconButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../src/IconButton/IconButton.tsx"],"names":[],"mappings":";AAAA,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAClE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,UAAU,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../src/IconButton/IconButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAClE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,UAAU,MAAM,4BAA4B,CAAC;AAEpD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MA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KAAC,SAAS,IAAC,QAAQ,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,GAAI,GAC3E,CACH,CAAC;AACJ,CAAC;AACD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAyB,CAAC"}
|
package/lib/MuiForm/MuiForm.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { FormProps } from '@rjsf/core';
|
|
3
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { FormProps } from '@rjsf/core';
|
|
3
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
4
4
|
export declare function generateForm<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): ComponentType<FormProps<T, S, F>>;
|
|
5
5
|
declare const _default: ComponentType<FormProps<any, RJSFSchema, any>>;
|
|
6
6
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MuiForm.js","sourceRoot":"","sources":["../../src/MuiForm/MuiForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MuiForm.js","sourceRoot":"","sources":["../../src/MuiForm/MuiForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,YAAY;IAK1B,OAAO,SAAS,CAAU,aAAa,EAAW,CAAC,CAAC;AACtD,CAAC;AAED,eAAe,YAAY,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BoxProps } from '@mui/material/Box';
|
|
2
|
-
import { FormControlProps } from '@mui/material/FormControl';
|
|
3
|
-
import { FormContextType, GenericObjectType, MultiSchemaFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { BoxProps } from '@mui/material/Box';
|
|
2
|
+
import type { FormControlProps } from '@mui/material/FormControl';
|
|
3
|
+
import type { FormContextType, GenericObjectType, MultiSchemaFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
4
4
|
/** Properties available for the `rjsfSlotProps` target of the MultiSchemaFieldTemplate. */
|
|
5
5
|
export interface MultiSchemaFieldTemplateMuiProps extends GenericObjectType {
|
|
6
6
|
/** RJSF-specific slot props for targeting child elements of the MultiSchemaFieldTemplate. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Box from '@mui/material/Box';
|
|
3
3
|
import FormControl from '@mui/material/FormControl';
|
|
4
|
-
import { getUiOptions
|
|
4
|
+
import { getUiOptions } from '@rjsf/utils';
|
|
5
5
|
import { getMuiProps } from '../util.js';
|
|
6
6
|
export default function MultiSchemaFieldTemplate(props) {
|
|
7
7
|
const { optionSchemaField, selector, uiSchema } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSchemaFieldTemplate.js","sourceRoot":"","sources":["../../src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"MultiSchemaFieldTemplate.js","sourceRoot":"","sources":["../../src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,GAAG,MAAM,mBAAmB,CAAC;AAEpC,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAQpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAatC,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAI9C,KAA6C;IAC7C,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAExD,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,WAAW,CAA4C,SAAS,CAAC,CAAC;IAE1G,OAAO,CACL,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAM,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,aAC5C,KAAC,WAAW,IAAC,SAAS,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAM,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,gBAAgB,YACrE,QAAQ,GACG,EACb,iBAAiB,IACd,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GridProps } from '@mui/material/Grid';
|
|
2
|
-
import { FormContextType, GenericObjectType, ObjectFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { GridProps } from '@mui/material/Grid';
|
|
2
|
+
import type { FormContextType, GenericObjectType, ObjectFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
3
|
/** Properties available for the `rjsfSlotProps` target of the ObjectFieldTemplate. */
|
|
4
4
|
export interface ObjectFieldTemplateMuiProps extends GenericObjectType {
|
|
5
5
|
/** RJSF-specific slot props for targeting child elements of the ObjectFieldTemplate. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import Grid from '@mui/material/Grid';
|
|
3
|
-
import { canExpand, descriptionId, getTemplate, getUiOptions, titleId, buttonId
|
|
3
|
+
import { canExpand, descriptionId, getTemplate, getUiOptions, titleId, buttonId } from '@rjsf/utils';
|
|
4
4
|
import { computeSxProps, getMuiProps } from '../util.js';
|
|
5
5
|
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
|
|
6
6
|
* title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
|
|
@@ -17,9 +17,9 @@ export default function ObjectFieldTemplate(props) {
|
|
|
17
17
|
// Button templates are not overridden in the uiSchema
|
|
18
18
|
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
19
19
|
const { rjsfSlotProps: { objectGridContainer, objectGridItem, objectAddButtonGridContainer, objectAddButtonGridItem } = {}, } = getMuiProps(uiOptions);
|
|
20
|
-
return (_jsxs(_Fragment, { children: [title && (_jsx(TitleFieldTemplate, { id: titleId(fieldPathId), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined })), description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(fieldPathId), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsxs(Grid, { container: true, spacing: 2, ...objectGridContainer, sx: computeSxProps({ mt: 1.25 }, objectGridContainer), children: [!showOptionalDataControlInTitle ? optionalDataControl : undefined, properties.map((element
|
|
20
|
+
return (_jsxs(_Fragment, { children: [title && (_jsx(TitleFieldTemplate, { id: titleId(fieldPathId), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined })), description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(fieldPathId), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsxs(Grid, { container: true, spacing: 2, ...objectGridContainer, sx: computeSxProps({ mt: 1.25 }, objectGridContainer), children: [!showOptionalDataControlInTitle ? optionalDataControl : undefined, properties.map((element) =>
|
|
21
21
|
// Remove the <Grid> if the inner element is hidden as the <Grid>
|
|
22
22
|
// itself would otherwise still take up space.
|
|
23
|
-
element.hidden ? (element.content) : (_jsx(Grid, { size: { xs: 12 }, ...objectGridItem, sx: computeSxProps({ mb: 1.25 }, objectGridItem), children: element.content },
|
|
23
|
+
element.hidden ? (element.content) : (_jsx(Grid, { size: { xs: 12 }, ...objectGridItem, sx: computeSxProps({ mb: 1.25 }, objectGridItem), children: element.content }, element.name)))] }), canExpand(schema, uiSchema, formData) && (_jsx(Grid, { container: true, ...objectAddButtonGridContainer, sx: computeSxProps({ justifyContent: 'flex-end' }, objectAddButtonGridContainer), children: _jsx(Grid, { ...objectAddButtonGridItem, children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), className: 'rjsf-object-property-expand', onClick: onAddProperty, disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }) }) }))] }));
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=ObjectFieldTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectFieldTemplate.js","sourceRoot":"","sources":["../../src/ObjectFieldTemplate/ObjectFieldTemplate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ObjectFieldTemplate.js","sourceRoot":"","sources":["../../src/ObjectFieldTemplate/ObjectFieldTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAQtC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAErG,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiBtD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAIzC,KAAwC;IACxC,MAAM,EACJ,WAAW,EACX,KAAK,EACL,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,MAAM,EACN,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,kBAAkB,GAAG,WAAW,CAAgC,oBAAoB,EAAE,QAAQ,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AC9C,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CACf,OAAO,CAAC,OAAO,CAChB,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IACH,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAEZ,cAAc,EAClB,EAAE,EAAE,cAAc,CAAY,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,cAAc,CAAC,YAE1D,OAAO,CAAC,OAAO,IAJX,OAAO,CAAC,IAAI,CAKZ,CACR,CACF,IACI,EACN,SAAS,CAAU,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CACjD,KAAC,IAAI,IACH,SAAS,WACL,4BAA4B,EAChC,EAAE,EAAE,cAAc,CAAY,EAAE,cAAc,EAAE,UAAU,EAAE,EAAE,4BAA4B,CAAC,YAE3F,KAAC,IAAI,OAAK,uBAAuB,YAC/B,KAAC,SAAS,IACR,EAAE,EAAE,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,EAChC,SAAS,EAAC,6BAA6B,EACvC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACG,GACF,CACR,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, OptionalDataControlsTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, OptionalDataControlsTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
/** The OptionalDataControlsTemplate renders one of three different states. If
|
|
3
3
|
* there is an `onAddClick()` function, it renders the "Add" button. If there is
|
|
4
4
|
* an `onRemoveClick()` function, it renders the "Remove" button. Otherwise it
|
|
@@ -14,7 +14,7 @@ export default function OptionalDataControlsTemplate(props) {
|
|
|
14
14
|
if (onAddClick) {
|
|
15
15
|
return (_jsx(IconButton, { id: id, registry: registry, uiSchema: uiSchema, className: 'rjsf-add-optional-data', onClick: onAddClick, title: label, icon: _jsx(AddIcon, { fontSize: 'small' }) }));
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
if (onRemoveClick) {
|
|
18
18
|
return (_jsx(RemoveButton, { id: id, registry: registry, uiSchema: uiSchema, className: 'rjsf-remove-optional-data', onClick: onRemoveClick, title: label }));
|
|
19
19
|
}
|
|
20
20
|
return _jsx("em", { id: id, children: label });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionalDataControlsTemplate.js","sourceRoot":"","sources":["../../src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAG9C,OAAO,UAAU,EAAE,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAIlD,KAAiD;IACjD,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3E,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CACL,KAAC,UAAU,IACT,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAC,wBAAwB,EAClC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,KAAC,OAAO,IAAC,QAAQ,EAAC,OAAO,GAAG,GAClC,CACH,CAAC;IACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"OptionalDataControlsTemplate.js","sourceRoot":"","sources":["../../src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAG9C,OAAO,UAAU,EAAE,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAIlD,KAAiD;IACjD,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3E,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CACL,KAAC,UAAU,IACT,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAC,wBAAwB,EAClC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,KAAC,OAAO,IAAC,QAAQ,EAAC,OAAO,GAAG,GAClC,CACH,CAAC;IACJ,CAAC;IACD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CACL,KAAC,YAAY,IACX,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAC,2BAA2B,EACrC,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;IACJ,CAAC;IACD,OAAO,aAAI,EAAE,EAAE,EAAE,YAAG,KAAK,GAAM,CAAC;AAClC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FormControlLabelProps } from '@mui/material/FormControlLabel';
|
|
2
|
-
import { RadioProps } from '@mui/material/Radio';
|
|
3
|
-
import { RadioGroupProps } from '@mui/material/RadioGroup';
|
|
4
|
-
import { FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { FormControlLabelProps } from '@mui/material/FormControlLabel';
|
|
2
|
+
import type { RadioProps } from '@mui/material/Radio';
|
|
3
|
+
import type { RadioGroupProps } from '@mui/material/RadioGroup';
|
|
4
|
+
import type { FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
5
5
|
/** Properties available for the `rjsfSlotProps` target of the RadioWidget. */
|
|
6
6
|
export interface RadioWidgetMuiProps extends GenericObjectType {
|
|
7
7
|
/** RJSF-specific slot props for targeting child elements of the RadioWidget. */
|
|
@@ -15,16 +15,16 @@ export default function RadioWidget(props) {
|
|
|
15
15
|
const { id, htmlName, options, value, required, disabled, readonly, label, hideLabel, onChange, onBlur, onFocus } = props;
|
|
16
16
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
17
17
|
const optionValueFormat = getOptionValueFormat(options);
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
18
|
+
const handleChange = (_, enumValue) => onChange(enumOptionValueDecoder(enumValue, enumOptions, optionValueFormat, emptyValue));
|
|
19
|
+
const handleBlur = ({ target }) => onBlur(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, emptyValue));
|
|
20
|
+
const handleFocus = ({ target }) => onFocus(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, emptyValue));
|
|
21
21
|
const row = options ? options.inline : false;
|
|
22
22
|
const selectValue = enumOptionSelectedValue(value, enumOptions, false, optionValueFormat, '');
|
|
23
23
|
const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(options);
|
|
24
|
-
return (_jsxs(_Fragment, { children: [labelValue(_jsx(FormLabel, { required: required, htmlFor: id, children: label || undefined }), hideLabel), _jsx(RadioGroup, { ...otherMuiProps, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.radioGroup, id: id, name: htmlName || id, value: selectValue, row: row, onChange:
|
|
24
|
+
return (_jsxs(_Fragment, { children: [labelValue(_jsx(FormLabel, { required: required, htmlFor: id, children: label || undefined }), hideLabel), _jsx(RadioGroup, { ...otherMuiProps, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.radioGroup, id: id, name: htmlName || id, value: selectValue, row: row, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, "aria-describedby": ariaDescribedByIds(id), children: Array.isArray(enumOptions) &&
|
|
25
25
|
enumOptions.map((option, index) => {
|
|
26
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.
|
|
27
|
-
const radio = (_createElement(FormControlLabel, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.formControlLabel, control: _jsx(Radio, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.radio, name: htmlName || id, id: optionId(id, index), color: 'primary' }), label: option.label, value: enumOptionValueEncoder(option.value, index, optionValueFormat), key:
|
|
26
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
|
|
27
|
+
const radio = (_createElement(FormControlLabel, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.formControlLabel, control: _jsx(Radio, { ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.radio, name: htmlName || id, id: optionId(id, index), color: 'primary' }), label: option.label, value: enumOptionValueEncoder(option.value, index, optionValueFormat), key: String(option.value), disabled: disabled || itemDisabled || readonly }));
|
|
28
28
|
return radio;
|
|
29
29
|
}) })] }));
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioWidget.js","sourceRoot":"","sources":["../../src/RadioWidget/RadioWidget.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"RadioWidget.js","sourceRoot":"","sources":["../../src/RadioWidget/RadioWidget.tsx"],"names":[],"mappings":";;AAEA,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAEhD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAExC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,UAAU,EACV,QAAQ,GACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAA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,GAC9C,CACH,CAAC;wBAEF,OAAO,KAAK,CAAC;oBACf,CAAC,CAAC,GACO,IACZ,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SliderProps } from '@mui/material/Slider';
|
|
2
|
-
import { FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { SliderProps } from '@mui/material/Slider';
|
|
2
|
+
import type { FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
3
3
|
/** Properties available for the `rjsfSlotProps` target of the RangeWidget. */
|
|
4
4
|
export interface RangeWidgetMuiProps extends GenericObjectType {
|
|
5
5
|
/** RJSF-specific slot props for targeting child elements of the RangeWidget. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import FormLabel from '@mui/material/FormLabel';
|
|
3
3
|
import Slider from '@mui/material/Slider';
|
|
4
|
-
import { ariaDescribedByIds, labelValue, rangeSpec
|
|
4
|
+
import { ariaDescribedByIds, labelValue, rangeSpec } from '@rjsf/utils';
|
|
5
5
|
import { getMuiProps } from '../util.js';
|
|
6
6
|
/** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
|
|
7
7
|
* in a div, with the value along side it.
|
|
@@ -11,12 +11,12 @@ import { getMuiProps } from '../util.js';
|
|
|
11
11
|
export default function RangeWidget(props) {
|
|
12
12
|
const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, required, label, hideLabel, id } = props;
|
|
13
13
|
const sliderProps = { value, label, id, name: id, ...rangeSpec(schema) };
|
|
14
|
-
const
|
|
15
|
-
onChange(
|
|
14
|
+
const handleChange = (_, newValue) => {
|
|
15
|
+
onChange(newValue !== null && newValue !== void 0 ? newValue : options.emptyValue);
|
|
16
16
|
};
|
|
17
|
-
const
|
|
18
|
-
const
|
|
17
|
+
const handleBlur = ({ target }) => onBlur(id, target && target.value);
|
|
18
|
+
const handleFocus = ({ target }) => onFocus(id, target && target.value);
|
|
19
19
|
const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(options);
|
|
20
|
-
return (_jsxs(_Fragment, { children: [labelValue(_jsx(FormLabel, { required: required, htmlFor: id, children: label || undefined }), hideLabel), _jsx(Slider, { disabled: disabled || readonly, onChange:
|
|
20
|
+
return (_jsxs(_Fragment, { children: [labelValue(_jsx(FormLabel, { required: required, htmlFor: id, children: label || undefined }), hideLabel), _jsx(Slider, { disabled: disabled || readonly, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, valueLabelDisplay: 'auto', ...otherMuiProps, ...muiSlotProps === null || muiSlotProps === void 0 ? void 0 : muiSlotProps.slider, ...sliderProps, "aria-describedby": ariaDescribedByIds(id) })] }));
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=RangeWidget.js.map
|