@rjsf/mui 5.11.2 → 5.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1003 -5
- package/dist/index.js.map +7 -0
- package/dist/mui.esm.js +650 -824
- package/dist/mui.esm.js.map +7 -1
- package/dist/mui.umd.js +852 -0
- package/lib/AddButton/AddButton.d.ts +5 -0
- package/lib/AddButton/AddButton.js +13 -0
- package/lib/AddButton/AddButton.js.map +1 -0
- package/lib/AddButton/index.d.ts +2 -0
- package/lib/AddButton/index.js +3 -0
- package/lib/AddButton/index.js.map +1 -0
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +7 -0
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +21 -0
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -0
- package/lib/ArrayFieldItemTemplate/index.d.ts +2 -0
- package/lib/ArrayFieldItemTemplate/index.js +3 -0
- package/lib/ArrayFieldItemTemplate/index.js.map +1 -0
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +7 -0
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +25 -0
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -0
- package/lib/ArrayFieldTemplate/index.d.ts +2 -0
- package/lib/ArrayFieldTemplate/index.js +3 -0
- package/lib/ArrayFieldTemplate/index.js.map +1 -0
- package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +9 -0
- package/lib/BaseInputTemplate/BaseInputTemplate.js +32 -0
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -0
- package/lib/BaseInputTemplate/index.d.ts +2 -0
- package/lib/BaseInputTemplate/index.js +3 -0
- package/lib/BaseInputTemplate/index.js.map +1 -0
- package/lib/CheckboxWidget/CheckboxWidget.d.ts +8 -0
- package/lib/CheckboxWidget/CheckboxWidget.js +24 -0
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -0
- package/lib/CheckboxWidget/index.d.ts +2 -0
- package/lib/CheckboxWidget/index.js +3 -0
- package/lib/CheckboxWidget/index.js.map +1 -0
- package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +8 -0
- package/lib/CheckboxesWidget/CheckboxesWidget.js +33 -0
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -0
- package/lib/CheckboxesWidget/index.d.ts +2 -0
- package/lib/CheckboxesWidget/index.js +3 -0
- package/lib/CheckboxesWidget/index.js.map +1 -0
- package/lib/DescriptionField/DescriptionField.d.ts +7 -0
- package/lib/DescriptionField/DescriptionField.js +14 -0
- package/lib/DescriptionField/DescriptionField.js.map +1 -0
- package/lib/DescriptionField/index.d.ts +2 -0
- package/lib/DescriptionField/index.js +3 -0
- package/lib/DescriptionField/index.js.map +1 -0
- package/lib/ErrorList/ErrorList.d.ts +7 -0
- package/lib/ErrorList/ErrorList.js +21 -0
- package/lib/ErrorList/ErrorList.js.map +1 -0
- package/lib/ErrorList/index.d.ts +2 -0
- package/lib/ErrorList/index.js +3 -0
- package/lib/ErrorList/index.js.map +1 -0
- package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +7 -0
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +20 -0
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -0
- package/lib/FieldErrorTemplate/index.d.ts +2 -0
- package/lib/FieldErrorTemplate/index.js +3 -0
- package/lib/FieldErrorTemplate/index.js.map +1 -0
- package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +7 -0
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +16 -0
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -0
- package/lib/FieldHelpTemplate/index.d.ts +2 -0
- package/lib/FieldHelpTemplate/index.js +3 -0
- package/lib/FieldHelpTemplate/index.js.map +1 -0
- package/lib/FieldTemplate/FieldTemplate.d.ts +8 -0
- package/lib/FieldTemplate/FieldTemplate.js +19 -0
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -0
- package/lib/FieldTemplate/index.d.ts +2 -0
- package/lib/FieldTemplate/index.js +3 -0
- package/lib/FieldTemplate/index.js.map +1 -0
- package/lib/IconButton/IconButton.d.ts +7 -0
- package/lib/IconButton/IconButton.js +30 -0
- package/lib/IconButton/IconButton.js.map +1 -0
- package/lib/IconButton/index.d.ts +2 -0
- package/lib/IconButton/index.js +3 -0
- package/lib/IconButton/index.js.map +1 -0
- package/lib/MuiForm/MuiForm.d.ts +6 -0
- package/lib/MuiForm/MuiForm.js +7 -0
- package/lib/MuiForm/MuiForm.js.map +1 -0
- package/lib/MuiForm/index.d.ts +2 -0
- package/lib/MuiForm/index.js +3 -0
- package/lib/MuiForm/index.js.map +1 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +9 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +22 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -0
- package/lib/ObjectFieldTemplate/index.d.ts +2 -0
- package/lib/ObjectFieldTemplate/index.js +3 -0
- package/lib/ObjectFieldTemplate/index.js.map +1 -0
- package/lib/RadioWidget/RadioWidget.d.ts +8 -0
- package/lib/RadioWidget/RadioWidget.js +27 -0
- package/lib/RadioWidget/RadioWidget.js.map +1 -0
- package/lib/RadioWidget/index.d.ts +2 -0
- package/lib/RadioWidget/index.js +3 -0
- package/lib/RadioWidget/index.js.map +1 -0
- package/lib/RangeWidget/RangeWidget.d.ts +8 -0
- package/lib/RangeWidget/RangeWidget.js +20 -0
- package/lib/RangeWidget/RangeWidget.js.map +1 -0
- package/lib/RangeWidget/index.d.ts +2 -0
- package/lib/RangeWidget/index.js +3 -0
- package/lib/RangeWidget/index.js.map +1 -0
- package/lib/SelectWidget/SelectWidget.d.ts +9 -0
- package/lib/SelectWidget/SelectWidget.js +29 -0
- package/lib/SelectWidget/SelectWidget.js.map +1 -0
- package/lib/SelectWidget/index.d.ts +2 -0
- package/lib/SelectWidget/index.js +3 -0
- package/lib/SelectWidget/index.js.map +1 -0
- package/lib/SubmitButton/SubmitButton.d.ts +5 -0
- package/lib/SubmitButton/SubmitButton.js +14 -0
- package/lib/SubmitButton/SubmitButton.js.map +1 -0
- package/lib/SubmitButton/index.d.ts +2 -0
- package/lib/SubmitButton/index.js +3 -0
- package/lib/SubmitButton/index.js.map +1 -0
- package/lib/Templates/Templates.d.ts +4 -0
- package/lib/Templates/Templates.js +39 -0
- package/lib/Templates/Templates.js.map +1 -0
- package/lib/Templates/index.d.ts +2 -0
- package/lib/Templates/index.js +3 -0
- package/lib/Templates/index.js.map +1 -0
- package/lib/TextareaWidget/TextareaWidget.d.ts +7 -0
- package/lib/TextareaWidget/TextareaWidget.js +16 -0
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -0
- package/lib/TextareaWidget/index.d.ts +2 -0
- package/lib/TextareaWidget/index.js +3 -0
- package/lib/TextareaWidget/index.js.map +1 -0
- package/lib/Theme/Theme.d.ts +5 -0
- package/lib/Theme/Theme.js +10 -0
- package/lib/Theme/Theme.js.map +1 -0
- package/lib/Theme/index.d.ts +2 -0
- package/lib/Theme/index.js +3 -0
- package/lib/Theme/index.js.map +1 -0
- package/lib/TitleField/TitleField.d.ts +7 -0
- package/lib/TitleField/TitleField.js +12 -0
- package/lib/TitleField/TitleField.js.map +1 -0
- package/lib/TitleField/index.d.ts +2 -0
- package/lib/TitleField/index.js +3 -0
- package/lib/TitleField/index.js.map +1 -0
- package/lib/Widgets/Widgets.d.ts +4 -0
- package/lib/Widgets/Widgets.js +18 -0
- package/lib/Widgets/Widgets.js.map +1 -0
- package/lib/Widgets/index.d.ts +2 -0
- package/lib/Widgets/index.js +3 -0
- package/lib/Widgets/index.js.map +1 -0
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +8 -0
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +29 -0
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -0
- package/lib/WrapIfAdditionalTemplate/index.d.ts +2 -0
- package/lib/WrapIfAdditionalTemplate/index.js +3 -0
- package/lib/WrapIfAdditionalTemplate/index.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/package.json +24 -16
- package/src/AddButton/AddButton.tsx +18 -0
- package/src/AddButton/index.ts +2 -0
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +91 -0
- package/src/ArrayFieldItemTemplate/index.ts +2 -0
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +87 -0
- package/src/ArrayFieldTemplate/index.ts +2 -0
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +106 -0
- package/src/BaseInputTemplate/index.ts +2 -0
- package/src/CheckboxWidget/CheckboxWidget.tsx +87 -0
- package/src/CheckboxWidget/index.ts +2 -0
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +92 -0
- package/src/CheckboxesWidget/index.ts +2 -0
- package/src/DescriptionField/DescriptionField.tsx +23 -0
- package/src/DescriptionField/index.ts +2 -0
- package/src/ErrorList/ErrorList.tsx +39 -0
- package/src/ErrorList/index.ts +2 -0
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +32 -0
- package/src/FieldErrorTemplate/index.ts +2 -0
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +19 -0
- package/src/FieldHelpTemplate/index.ts +2 -0
- package/src/FieldTemplate/FieldTemplate.tsx +81 -0
- package/src/FieldTemplate/index.ts +2 -0
- package/src/IconButton/IconButton.tsx +81 -0
- package/src/IconButton/index.ts +2 -0
- package/src/MuiForm/MuiForm.tsx +15 -0
- package/src/MuiForm/index.ts +2 -0
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +99 -0
- package/src/ObjectFieldTemplate/index.ts +2 -0
- package/src/RadioWidget/RadioWidget.tsx +83 -0
- package/src/RadioWidget/index.ts +2 -0
- package/src/RangeWidget/RangeWidget.tsx +51 -0
- package/src/RangeWidget/index.ts +2 -0
- package/src/SelectWidget/SelectWidget.tsx +100 -0
- package/src/SelectWidget/index.ts +2 -0
- package/src/SubmitButton/SubmitButton.tsx +23 -0
- package/src/SubmitButton/index.ts +2 -0
- package/src/Templates/Templates.ts +46 -0
- package/src/Templates/index.ts +2 -0
- package/src/TextareaWidget/TextareaWidget.tsx +21 -0
- package/src/TextareaWidget/index.ts +2 -0
- package/src/Theme/Theme.tsx +18 -0
- package/src/Theme/index.ts +2 -0
- package/src/TitleField/TitleField.tsx +20 -0
- package/src/TitleField/index.ts +2 -0
- package/src/Widgets/Widgets.ts +25 -0
- package/src/Widgets/index.ts +2 -0
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +90 -0
- package/src/WrapIfAdditionalTemplate/index.ts +2 -0
- package/src/index.ts +8 -0
- package/dist/index.d.ts +0 -17
- package/dist/mui.cjs.development.js +0 -1239
- package/dist/mui.cjs.development.js.map +0 -1
- package/dist/mui.cjs.production.min.js +0 -2
- package/dist/mui.cjs.production.min.js.map +0 -1
- package/dist/mui.umd.development.js +0 -1213
- package/dist/mui.umd.development.js.map +0 -1
- package/dist/mui.umd.production.min.js +0 -2
- package/dist/mui.umd.production.min.js.map +0 -1
package/dist/mui.esm.js
CHANGED
|
@@ -1,57 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import AddIcon from '@mui/icons-material/Add';
|
|
4
|
-
import IconButton from '@mui/material/IconButton';
|
|
5
|
-
import { TranslatableString, getUiOptions, getTemplate, getInputProps, examplesId, labelValue, ariaDescribedByIds, errorId, helpId, titleId, descriptionId, canExpand, getSubmitButtonOptions, ADDITIONAL_PROPERTY_FLAG, schemaRequiresTrueValue, enumOptionsIsSelected, optionId, enumOptionsSelectValue, enumOptionsDeselectValue, enumOptionsValueForIndex, enumOptionsIndexForValue, rangeSpec } from '@rjsf/utils';
|
|
6
|
-
import Box from '@mui/material/Box';
|
|
7
|
-
import Grid from '@mui/material/Grid';
|
|
8
|
-
import Paper from '@mui/material/Paper';
|
|
9
|
-
import TextField from '@mui/material/TextField';
|
|
10
|
-
import Typography from '@mui/material/Typography';
|
|
11
|
-
import ErrorIcon from '@mui/icons-material/Error';
|
|
12
|
-
import List from '@mui/material/List';
|
|
13
|
-
import ListItem from '@mui/material/ListItem';
|
|
14
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
15
|
-
import ListItemText from '@mui/material/ListItemText';
|
|
16
|
-
import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward';
|
|
17
|
-
import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward';
|
|
18
|
-
import CopyIcon from '@mui/icons-material/ContentCopy';
|
|
19
|
-
import RemoveIcon from '@mui/icons-material/Remove';
|
|
20
|
-
import FormHelperText from '@mui/material/FormHelperText';
|
|
21
|
-
import FormControl from '@mui/material/FormControl';
|
|
22
|
-
import Button from '@mui/material/Button';
|
|
23
|
-
import Divider from '@mui/material/Divider';
|
|
24
|
-
import Checkbox from '@mui/material/Checkbox';
|
|
25
|
-
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
26
|
-
import FormGroup from '@mui/material/FormGroup';
|
|
27
|
-
import FormLabel from '@mui/material/FormLabel';
|
|
28
|
-
import Radio from '@mui/material/Radio';
|
|
29
|
-
import RadioGroup from '@mui/material/RadioGroup';
|
|
30
|
-
import Slider from '@mui/material/Slider';
|
|
31
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
1
|
+
// src/MuiForm/MuiForm.tsx
|
|
2
|
+
import { withTheme } from "@rjsf/core";
|
|
32
3
|
|
|
33
|
-
|
|
34
|
-
|
|
4
|
+
// src/AddButton/AddButton.tsx
|
|
5
|
+
import AddIcon from "@mui/icons-material/Add";
|
|
6
|
+
import IconButton from "@mui/material/IconButton";
|
|
7
|
+
import { TranslatableString } from "@rjsf/utils";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
35
9
|
function AddButton({
|
|
36
10
|
uiSchema,
|
|
37
11
|
registry,
|
|
38
12
|
...props
|
|
39
13
|
}) {
|
|
40
|
-
const {
|
|
41
|
-
|
|
42
|
-
} = registry;
|
|
43
|
-
return jsx(IconButton, {
|
|
44
|
-
title: translateString(TranslatableString.AddItemButton),
|
|
45
|
-
...props,
|
|
46
|
-
color: 'primary',
|
|
47
|
-
children: jsx(AddIcon, {})
|
|
48
|
-
});
|
|
14
|
+
const { translateString } = registry;
|
|
15
|
+
return /* @__PURE__ */ jsx(IconButton, { title: translateString(TranslatableString.AddItemButton), ...props, color: "primary", children: /* @__PURE__ */ jsx(AddIcon, {}) });
|
|
49
16
|
}
|
|
50
17
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
18
|
+
// src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
|
|
19
|
+
import Box from "@mui/material/Box";
|
|
20
|
+
import Grid from "@mui/material/Grid";
|
|
21
|
+
import Paper from "@mui/material/Paper";
|
|
22
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
55
23
|
function ArrayFieldItemTemplate(props) {
|
|
56
24
|
const {
|
|
57
25
|
children,
|
|
@@ -69,150 +37,139 @@ function ArrayFieldItemTemplate(props) {
|
|
|
69
37
|
uiSchema,
|
|
70
38
|
registry
|
|
71
39
|
} = props;
|
|
72
|
-
const {
|
|
73
|
-
CopyButton,
|
|
74
|
-
MoveDownButton,
|
|
75
|
-
MoveUpButton,
|
|
76
|
-
RemoveButton
|
|
77
|
-
} = registry.templates.ButtonTemplates;
|
|
40
|
+
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
78
41
|
const btnStyle = {
|
|
79
42
|
flex: 1,
|
|
80
43
|
paddingLeft: 6,
|
|
81
44
|
paddingRight: 6,
|
|
82
|
-
fontWeight:
|
|
45
|
+
fontWeight: "bold",
|
|
83
46
|
minWidth: 0
|
|
84
47
|
};
|
|
85
|
-
return jsxs(Grid, {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
})]
|
|
131
|
-
})]
|
|
132
|
-
});
|
|
48
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", children: [
|
|
49
|
+
/* @__PURE__ */ jsx2(Grid, { item: true, xs: true, style: { overflow: "auto" }, children: /* @__PURE__ */ jsx2(Box, { mb: 2, children: /* @__PURE__ */ jsx2(Paper, { elevation: 2, children: /* @__PURE__ */ jsx2(Box, { p: 2, children }) }) }) }),
|
|
50
|
+
hasToolbar && /* @__PURE__ */ jsxs(Grid, { item: true, children: [
|
|
51
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx2(
|
|
52
|
+
MoveUpButton2,
|
|
53
|
+
{
|
|
54
|
+
style: btnStyle,
|
|
55
|
+
disabled: disabled || readonly || !hasMoveUp,
|
|
56
|
+
onClick: onReorderClick(index, index - 1),
|
|
57
|
+
uiSchema,
|
|
58
|
+
registry
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx2(
|
|
62
|
+
MoveDownButton2,
|
|
63
|
+
{
|
|
64
|
+
style: btnStyle,
|
|
65
|
+
disabled: disabled || readonly || !hasMoveDown,
|
|
66
|
+
onClick: onReorderClick(index, index + 1),
|
|
67
|
+
uiSchema,
|
|
68
|
+
registry
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
hasCopy && /* @__PURE__ */ jsx2(
|
|
72
|
+
CopyButton2,
|
|
73
|
+
{
|
|
74
|
+
style: btnStyle,
|
|
75
|
+
disabled: disabled || readonly,
|
|
76
|
+
onClick: onCopyIndexClick(index),
|
|
77
|
+
uiSchema,
|
|
78
|
+
registry
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
hasRemove && /* @__PURE__ */ jsx2(
|
|
82
|
+
RemoveButton2,
|
|
83
|
+
{
|
|
84
|
+
style: btnStyle,
|
|
85
|
+
disabled: disabled || readonly,
|
|
86
|
+
onClick: onDropIndexClick(index),
|
|
87
|
+
uiSchema,
|
|
88
|
+
registry
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
] })
|
|
92
|
+
] });
|
|
133
93
|
}
|
|
134
94
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
95
|
+
// src/ArrayFieldTemplate/ArrayFieldTemplate.tsx
|
|
96
|
+
import Box2 from "@mui/material/Box";
|
|
97
|
+
import Grid2 from "@mui/material/Grid";
|
|
98
|
+
import Paper2 from "@mui/material/Paper";
|
|
99
|
+
import {
|
|
100
|
+
getTemplate,
|
|
101
|
+
getUiOptions
|
|
102
|
+
} from "@rjsf/utils";
|
|
103
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
139
104
|
function ArrayFieldTemplate(props) {
|
|
140
|
-
const {
|
|
141
|
-
canAdd,
|
|
142
|
-
disabled,
|
|
143
|
-
idSchema,
|
|
144
|
-
uiSchema,
|
|
145
|
-
items,
|
|
146
|
-
onAddClick,
|
|
147
|
-
readonly,
|
|
148
|
-
registry,
|
|
149
|
-
required,
|
|
150
|
-
schema,
|
|
151
|
-
title
|
|
152
|
-
} = props;
|
|
105
|
+
const { canAdd, disabled, idSchema, uiSchema, items, onAddClick, readonly, registry, required, schema, title } = props;
|
|
153
106
|
const uiOptions = getUiOptions(uiSchema);
|
|
154
|
-
const ArrayFieldDescriptionTemplate = getTemplate(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
107
|
+
const ArrayFieldDescriptionTemplate = getTemplate(
|
|
108
|
+
"ArrayFieldDescriptionTemplate",
|
|
109
|
+
registry,
|
|
110
|
+
uiOptions
|
|
111
|
+
);
|
|
112
|
+
const ArrayFieldItemTemplate2 = getTemplate(
|
|
113
|
+
"ArrayFieldItemTemplate",
|
|
114
|
+
registry,
|
|
115
|
+
uiOptions
|
|
116
|
+
);
|
|
117
|
+
const ArrayFieldTitleTemplate = getTemplate(
|
|
118
|
+
"ArrayFieldTitleTemplate",
|
|
119
|
+
registry,
|
|
120
|
+
uiOptions
|
|
121
|
+
);
|
|
158
122
|
const {
|
|
159
|
-
ButtonTemplates: {
|
|
160
|
-
AddButton
|
|
161
|
-
}
|
|
123
|
+
ButtonTemplates: { AddButton: AddButton2 }
|
|
162
124
|
} = registry.templates;
|
|
163
|
-
return
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
idSchema: idSchema,
|
|
125
|
+
return /* @__PURE__ */ jsx3(Paper2, { elevation: 2, children: /* @__PURE__ */ jsxs2(Box2, { p: 2, children: [
|
|
126
|
+
/* @__PURE__ */ jsx3(
|
|
127
|
+
ArrayFieldTitleTemplate,
|
|
128
|
+
{
|
|
129
|
+
idSchema,
|
|
169
130
|
title: uiOptions.title || title,
|
|
170
|
-
schema
|
|
171
|
-
uiSchema
|
|
172
|
-
required
|
|
173
|
-
registry
|
|
174
|
-
}
|
|
175
|
-
|
|
131
|
+
schema,
|
|
132
|
+
uiSchema,
|
|
133
|
+
required,
|
|
134
|
+
registry
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
/* @__PURE__ */ jsx3(
|
|
138
|
+
ArrayFieldDescriptionTemplate,
|
|
139
|
+
{
|
|
140
|
+
idSchema,
|
|
176
141
|
description: uiOptions.description || schema.description,
|
|
177
|
-
schema
|
|
178
|
-
uiSchema
|
|
179
|
-
registry
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
onClick: onAddClick,
|
|
197
|
-
disabled: disabled || readonly,
|
|
198
|
-
uiSchema: uiSchema,
|
|
199
|
-
registry: registry
|
|
200
|
-
})
|
|
201
|
-
})
|
|
202
|
-
})
|
|
203
|
-
})]
|
|
204
|
-
}, `array-item-list-${idSchema.$id}`)]
|
|
205
|
-
})
|
|
206
|
-
});
|
|
142
|
+
schema,
|
|
143
|
+
uiSchema,
|
|
144
|
+
registry
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
/* @__PURE__ */ jsxs2(Grid2, { container: true, children: [
|
|
148
|
+
items && items.map(({ key, ...itemProps }) => /* @__PURE__ */ jsx3(ArrayFieldItemTemplate2, { ...itemProps }, key)),
|
|
149
|
+
canAdd && /* @__PURE__ */ jsx3(Grid2, { container: true, justifyContent: "flex-end", children: /* @__PURE__ */ jsx3(Grid2, { item: true, children: /* @__PURE__ */ jsx3(Box2, { mt: 2, children: /* @__PURE__ */ jsx3(
|
|
150
|
+
AddButton2,
|
|
151
|
+
{
|
|
152
|
+
className: "array-item-add",
|
|
153
|
+
onClick: onAddClick,
|
|
154
|
+
disabled: disabled || readonly,
|
|
155
|
+
uiSchema,
|
|
156
|
+
registry
|
|
157
|
+
}
|
|
158
|
+
) }) }) })
|
|
159
|
+
] }, `array-item-list-${idSchema.$id}`)
|
|
160
|
+
] }) });
|
|
207
161
|
}
|
|
208
162
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
163
|
+
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
164
|
+
import TextField from "@mui/material/TextField";
|
|
165
|
+
import {
|
|
166
|
+
ariaDescribedByIds,
|
|
167
|
+
examplesId,
|
|
168
|
+
getInputProps,
|
|
169
|
+
labelValue
|
|
170
|
+
} from "@rjsf/utils";
|
|
171
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
172
|
+
var TYPES_THAT_SHRINK_LABEL = ["date", "datetime-local", "file", "time"];
|
|
216
173
|
function BaseInputTemplate(props) {
|
|
217
174
|
const {
|
|
218
175
|
id,
|
|
@@ -241,260 +198,194 @@ function BaseInputTemplate(props) {
|
|
|
241
198
|
...textFieldProps
|
|
242
199
|
} = props;
|
|
243
200
|
const inputProps = getInputProps(schema, type, options);
|
|
244
|
-
|
|
245
|
-
const {
|
|
246
|
-
step,
|
|
247
|
-
min,
|
|
248
|
-
max,
|
|
249
|
-
...rest
|
|
250
|
-
} = inputProps;
|
|
201
|
+
const { step, min, max, ...rest } = inputProps;
|
|
251
202
|
const otherProps = {
|
|
252
203
|
inputProps: {
|
|
253
204
|
step,
|
|
254
205
|
min,
|
|
255
206
|
max,
|
|
256
|
-
...
|
|
257
|
-
list: examplesId(id)
|
|
258
|
-
} : undefined)
|
|
207
|
+
...schema.examples ? { list: examplesId(id) } : void 0
|
|
259
208
|
},
|
|
260
209
|
...rest
|
|
261
210
|
};
|
|
262
|
-
const _onChange = ({
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
}) => onChange(value === '' ? options.emptyValue : value);
|
|
267
|
-
const _onBlur = ({
|
|
268
|
-
target: {
|
|
269
|
-
value
|
|
270
|
-
}
|
|
271
|
-
}) => onBlur(id, value);
|
|
272
|
-
const _onFocus = ({
|
|
273
|
-
target: {
|
|
274
|
-
value
|
|
275
|
-
}
|
|
276
|
-
}) => onFocus(id, value);
|
|
211
|
+
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
212
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
|
|
213
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
|
|
277
214
|
const DisplayInputLabelProps = TYPES_THAT_SHRINK_LABEL.includes(type) ? {
|
|
278
215
|
...InputLabelProps,
|
|
279
216
|
shrink: true
|
|
280
217
|
} : InputLabelProps;
|
|
281
|
-
return
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
});
|
|
218
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
219
|
+
/* @__PURE__ */ jsx4(
|
|
220
|
+
TextField,
|
|
221
|
+
{
|
|
222
|
+
id,
|
|
223
|
+
name: id,
|
|
224
|
+
placeholder,
|
|
225
|
+
label: labelValue(label || void 0, hideLabel, false),
|
|
226
|
+
autoFocus: autofocus,
|
|
227
|
+
required,
|
|
228
|
+
disabled: disabled || readonly,
|
|
229
|
+
...otherProps,
|
|
230
|
+
value: value || value === 0 ? value : "",
|
|
231
|
+
error: rawErrors.length > 0,
|
|
232
|
+
onChange: onChangeOverride || _onChange,
|
|
233
|
+
onBlur: _onBlur,
|
|
234
|
+
onFocus: _onFocus,
|
|
235
|
+
InputLabelProps: DisplayInputLabelProps,
|
|
236
|
+
...textFieldProps,
|
|
237
|
+
"aria-describedby": ariaDescribedByIds(id, !!schema.examples)
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
Array.isArray(schema.examples) && /* @__PURE__ */ jsx4("datalist", { id: examplesId(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
|
|
241
|
+
return /* @__PURE__ */ jsx4("option", { value: example }, example);
|
|
242
|
+
}) })
|
|
243
|
+
] });
|
|
308
244
|
}
|
|
309
245
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
*/
|
|
246
|
+
// src/DescriptionField/DescriptionField.tsx
|
|
247
|
+
import Typography from "@mui/material/Typography";
|
|
248
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
314
249
|
function DescriptionField(props) {
|
|
315
|
-
const {
|
|
316
|
-
id,
|
|
317
|
-
description
|
|
318
|
-
} = props;
|
|
250
|
+
const { id, description } = props;
|
|
319
251
|
if (description) {
|
|
320
|
-
return
|
|
321
|
-
id: id,
|
|
322
|
-
variant: 'subtitle2',
|
|
323
|
-
style: {
|
|
324
|
-
marginTop: '5px'
|
|
325
|
-
},
|
|
326
|
-
children: description
|
|
327
|
-
});
|
|
252
|
+
return /* @__PURE__ */ jsx5(Typography, { id, variant: "subtitle2", style: { marginTop: "5px" }, children: description });
|
|
328
253
|
}
|
|
329
254
|
return null;
|
|
330
255
|
}
|
|
331
256
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
257
|
+
// src/ErrorList/ErrorList.tsx
|
|
258
|
+
import ErrorIcon from "@mui/icons-material/Error";
|
|
259
|
+
import Box3 from "@mui/material/Box";
|
|
260
|
+
import List from "@mui/material/List";
|
|
261
|
+
import ListItem from "@mui/material/ListItem";
|
|
262
|
+
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
263
|
+
import ListItemText from "@mui/material/ListItemText";
|
|
264
|
+
import Paper3 from "@mui/material/Paper";
|
|
265
|
+
import Typography2 from "@mui/material/Typography";
|
|
266
|
+
import { TranslatableString as TranslatableString2 } from "@rjsf/utils";
|
|
267
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
336
268
|
function ErrorList({
|
|
337
269
|
errors,
|
|
338
270
|
registry
|
|
339
271
|
}) {
|
|
340
|
-
const {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
children: translateString(TranslatableString.ErrorsLabel)
|
|
351
|
-
}), jsx(List, {
|
|
352
|
-
dense: true,
|
|
353
|
-
children: errors.map((error, i) => {
|
|
354
|
-
return jsxs(ListItem, {
|
|
355
|
-
children: [jsx(ListItemIcon, {
|
|
356
|
-
children: jsx(ErrorIcon, {
|
|
357
|
-
color: 'error'
|
|
358
|
-
})
|
|
359
|
-
}), jsx(ListItemText, {
|
|
360
|
-
primary: error.stack
|
|
361
|
-
})]
|
|
362
|
-
}, i);
|
|
363
|
-
})
|
|
364
|
-
})]
|
|
365
|
-
})
|
|
366
|
-
});
|
|
272
|
+
const { translateString } = registry;
|
|
273
|
+
return /* @__PURE__ */ jsx6(Paper3, { elevation: 2, children: /* @__PURE__ */ jsxs4(Box3, { mb: 2, p: 2, children: [
|
|
274
|
+
/* @__PURE__ */ jsx6(Typography2, { variant: "h6", children: translateString(TranslatableString2.ErrorsLabel) }),
|
|
275
|
+
/* @__PURE__ */ jsx6(List, { dense: true, children: errors.map((error, i) => {
|
|
276
|
+
return /* @__PURE__ */ jsxs4(ListItem, { children: [
|
|
277
|
+
/* @__PURE__ */ jsx6(ListItemIcon, { children: /* @__PURE__ */ jsx6(ErrorIcon, { color: "error" }) }),
|
|
278
|
+
/* @__PURE__ */ jsx6(ListItemText, { primary: error.stack })
|
|
279
|
+
] }, i);
|
|
280
|
+
}) })
|
|
281
|
+
] }) });
|
|
367
282
|
}
|
|
368
283
|
|
|
284
|
+
// src/IconButton/IconButton.tsx
|
|
285
|
+
import IconButton2 from "@mui/material/IconButton";
|
|
286
|
+
import ArrowDownwardIcon from "@mui/icons-material/ArrowDownward";
|
|
287
|
+
import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
|
|
288
|
+
import CopyIcon from "@mui/icons-material/ContentCopy";
|
|
289
|
+
import RemoveIcon from "@mui/icons-material/Remove";
|
|
290
|
+
import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
|
|
291
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
369
292
|
function MuiIconButton(props) {
|
|
370
|
-
const {
|
|
371
|
-
|
|
372
|
-
color,
|
|
373
|
-
uiSchema,
|
|
374
|
-
registry,
|
|
375
|
-
...otherProps
|
|
376
|
-
} = props;
|
|
377
|
-
return jsx(IconButton, {
|
|
378
|
-
...otherProps,
|
|
379
|
-
size: 'small',
|
|
380
|
-
color: color,
|
|
381
|
-
children: icon
|
|
382
|
-
});
|
|
293
|
+
const { icon, color, uiSchema, registry, ...otherProps } = props;
|
|
294
|
+
return /* @__PURE__ */ jsx7(IconButton2, { ...otherProps, size: "small", color, children: icon });
|
|
383
295
|
}
|
|
384
296
|
function CopyButton(props) {
|
|
385
297
|
const {
|
|
386
|
-
registry: {
|
|
387
|
-
translateString
|
|
388
|
-
}
|
|
298
|
+
registry: { translateString }
|
|
389
299
|
} = props;
|
|
390
|
-
return
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
300
|
+
return /* @__PURE__ */ jsx7(
|
|
301
|
+
MuiIconButton,
|
|
302
|
+
{
|
|
303
|
+
title: translateString(TranslatableString3.CopyButton),
|
|
304
|
+
...props,
|
|
305
|
+
icon: /* @__PURE__ */ jsx7(CopyIcon, { fontSize: "small" })
|
|
306
|
+
}
|
|
307
|
+
);
|
|
397
308
|
}
|
|
398
309
|
function MoveDownButton(props) {
|
|
399
310
|
const {
|
|
400
|
-
registry: {
|
|
401
|
-
translateString
|
|
402
|
-
}
|
|
311
|
+
registry: { translateString }
|
|
403
312
|
} = props;
|
|
404
|
-
return
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
313
|
+
return /* @__PURE__ */ jsx7(
|
|
314
|
+
MuiIconButton,
|
|
315
|
+
{
|
|
316
|
+
title: translateString(TranslatableString3.MoveDownButton),
|
|
317
|
+
...props,
|
|
318
|
+
icon: /* @__PURE__ */ jsx7(ArrowDownwardIcon, { fontSize: "small" })
|
|
319
|
+
}
|
|
320
|
+
);
|
|
411
321
|
}
|
|
412
322
|
function MoveUpButton(props) {
|
|
413
323
|
const {
|
|
414
|
-
registry: {
|
|
415
|
-
translateString
|
|
416
|
-
}
|
|
324
|
+
registry: { translateString }
|
|
417
325
|
} = props;
|
|
418
|
-
return
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
326
|
+
return /* @__PURE__ */ jsx7(
|
|
327
|
+
MuiIconButton,
|
|
328
|
+
{
|
|
329
|
+
title: translateString(TranslatableString3.MoveUpButton),
|
|
330
|
+
...props,
|
|
331
|
+
icon: /* @__PURE__ */ jsx7(ArrowUpwardIcon, { fontSize: "small" })
|
|
332
|
+
}
|
|
333
|
+
);
|
|
425
334
|
}
|
|
426
335
|
function RemoveButton(props) {
|
|
336
|
+
const { iconType, ...otherProps } = props;
|
|
427
337
|
const {
|
|
428
|
-
|
|
429
|
-
...otherProps
|
|
430
|
-
} = props;
|
|
431
|
-
const {
|
|
432
|
-
registry: {
|
|
433
|
-
translateString
|
|
434
|
-
}
|
|
338
|
+
registry: { translateString }
|
|
435
339
|
} = otherProps;
|
|
436
|
-
return
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
340
|
+
return /* @__PURE__ */ jsx7(
|
|
341
|
+
MuiIconButton,
|
|
342
|
+
{
|
|
343
|
+
title: translateString(TranslatableString3.RemoveButton),
|
|
344
|
+
...otherProps,
|
|
345
|
+
color: "error",
|
|
346
|
+
icon: /* @__PURE__ */ jsx7(RemoveIcon, { fontSize: iconType === "default" ? void 0 : "small" })
|
|
347
|
+
}
|
|
348
|
+
);
|
|
444
349
|
}
|
|
445
350
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
351
|
+
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
352
|
+
import ListItem2 from "@mui/material/ListItem";
|
|
353
|
+
import FormHelperText from "@mui/material/FormHelperText";
|
|
354
|
+
import List2 from "@mui/material/List";
|
|
355
|
+
import { errorId } from "@rjsf/utils";
|
|
356
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
450
357
|
function FieldErrorTemplate(props) {
|
|
451
|
-
const {
|
|
452
|
-
errors = [],
|
|
453
|
-
idSchema
|
|
454
|
-
} = props;
|
|
358
|
+
const { errors = [], idSchema } = props;
|
|
455
359
|
if (errors.length === 0) {
|
|
456
360
|
return null;
|
|
457
361
|
}
|
|
458
362
|
const id = errorId(idSchema);
|
|
459
|
-
return
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
children: errors.map((error, i) => {
|
|
463
|
-
return jsx(ListItem, {
|
|
464
|
-
disableGutters: true,
|
|
465
|
-
children: jsx(FormHelperText, {
|
|
466
|
-
id: id,
|
|
467
|
-
children: error
|
|
468
|
-
})
|
|
469
|
-
}, i);
|
|
470
|
-
})
|
|
471
|
-
});
|
|
363
|
+
return /* @__PURE__ */ jsx8(List2, { dense: true, disablePadding: true, children: errors.map((error, i) => {
|
|
364
|
+
return /* @__PURE__ */ jsx8(ListItem2, { disableGutters: true, children: /* @__PURE__ */ jsx8(FormHelperText, { id, children: error }) }, i);
|
|
365
|
+
}) });
|
|
472
366
|
}
|
|
473
367
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
368
|
+
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
369
|
+
import FormHelperText2 from "@mui/material/FormHelperText";
|
|
370
|
+
import { helpId } from "@rjsf/utils";
|
|
371
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
478
372
|
function FieldHelpTemplate(props) {
|
|
479
|
-
const {
|
|
480
|
-
idSchema,
|
|
481
|
-
help
|
|
482
|
-
} = props;
|
|
373
|
+
const { idSchema, help } = props;
|
|
483
374
|
if (!help) {
|
|
484
375
|
return null;
|
|
485
376
|
}
|
|
486
377
|
const id = helpId(idSchema);
|
|
487
|
-
return
|
|
488
|
-
id: id,
|
|
489
|
-
children: help
|
|
490
|
-
});
|
|
378
|
+
return /* @__PURE__ */ jsx9(FormHelperText2, { id, children: help });
|
|
491
379
|
}
|
|
492
380
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
381
|
+
// src/FieldTemplate/FieldTemplate.tsx
|
|
382
|
+
import FormControl from "@mui/material/FormControl";
|
|
383
|
+
import Typography3 from "@mui/material/Typography";
|
|
384
|
+
import {
|
|
385
|
+
getTemplate as getTemplate2,
|
|
386
|
+
getUiOptions as getUiOptions2
|
|
387
|
+
} from "@rjsf/utils";
|
|
388
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
498
389
|
function FieldTemplate(props) {
|
|
499
390
|
const {
|
|
500
391
|
id,
|
|
@@ -518,48 +409,50 @@ function FieldTemplate(props) {
|
|
|
518
409
|
uiSchema,
|
|
519
410
|
registry
|
|
520
411
|
} = props;
|
|
521
|
-
const uiOptions =
|
|
522
|
-
const
|
|
412
|
+
const uiOptions = getUiOptions2(uiSchema);
|
|
413
|
+
const WrapIfAdditionalTemplate2 = getTemplate2(
|
|
414
|
+
"WrapIfAdditionalTemplate",
|
|
415
|
+
registry,
|
|
416
|
+
uiOptions
|
|
417
|
+
);
|
|
523
418
|
if (hidden) {
|
|
524
|
-
return
|
|
525
|
-
style: {
|
|
526
|
-
display: 'none'
|
|
527
|
-
},
|
|
528
|
-
children: children
|
|
529
|
-
});
|
|
419
|
+
return /* @__PURE__ */ jsx10("div", { style: { display: "none" }, children });
|
|
530
420
|
}
|
|
531
|
-
return
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
error: rawErrors.length ? true : false,
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
});
|
|
421
|
+
return /* @__PURE__ */ jsx10(
|
|
422
|
+
WrapIfAdditionalTemplate2,
|
|
423
|
+
{
|
|
424
|
+
classNames,
|
|
425
|
+
style,
|
|
426
|
+
disabled,
|
|
427
|
+
id,
|
|
428
|
+
label,
|
|
429
|
+
onDropPropertyClick,
|
|
430
|
+
onKeyChange,
|
|
431
|
+
readonly,
|
|
432
|
+
required,
|
|
433
|
+
schema,
|
|
434
|
+
uiSchema,
|
|
435
|
+
registry,
|
|
436
|
+
children: /* @__PURE__ */ jsxs5(FormControl, { fullWidth: true, error: rawErrors.length ? true : false, required, children: [
|
|
437
|
+
children,
|
|
438
|
+
displayLabel && rawDescription ? /* @__PURE__ */ jsx10(Typography3, { variant: "caption", color: "textSecondary", children: description }) : null,
|
|
439
|
+
errors,
|
|
440
|
+
help
|
|
441
|
+
] })
|
|
442
|
+
}
|
|
443
|
+
);
|
|
555
444
|
}
|
|
556
445
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
446
|
+
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
447
|
+
import Grid3 from "@mui/material/Grid";
|
|
448
|
+
import {
|
|
449
|
+
canExpand,
|
|
450
|
+
descriptionId,
|
|
451
|
+
getTemplate as getTemplate3,
|
|
452
|
+
getUiOptions as getUiOptions3,
|
|
453
|
+
titleId
|
|
454
|
+
} from "@rjsf/utils";
|
|
455
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
563
456
|
function ObjectFieldTemplate(props) {
|
|
564
457
|
const {
|
|
565
458
|
description,
|
|
@@ -575,112 +468,96 @@ function ObjectFieldTemplate(props) {
|
|
|
575
468
|
onAddClick,
|
|
576
469
|
registry
|
|
577
470
|
} = props;
|
|
578
|
-
const uiOptions =
|
|
579
|
-
const TitleFieldTemplate =
|
|
580
|
-
const DescriptionFieldTemplate =
|
|
581
|
-
|
|
471
|
+
const uiOptions = getUiOptions3(uiSchema);
|
|
472
|
+
const TitleFieldTemplate = getTemplate3("TitleFieldTemplate", registry, uiOptions);
|
|
473
|
+
const DescriptionFieldTemplate = getTemplate3(
|
|
474
|
+
"DescriptionFieldTemplate",
|
|
475
|
+
registry,
|
|
476
|
+
uiOptions
|
|
477
|
+
);
|
|
582
478
|
const {
|
|
583
|
-
ButtonTemplates: {
|
|
584
|
-
AddButton
|
|
585
|
-
}
|
|
479
|
+
ButtonTemplates: { AddButton: AddButton2 }
|
|
586
480
|
} = registry.templates;
|
|
587
|
-
return
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
marginBottom:
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
})
|
|
630
|
-
})]
|
|
631
|
-
})]
|
|
632
|
-
});
|
|
481
|
+
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
482
|
+
title && /* @__PURE__ */ jsx11(
|
|
483
|
+
TitleFieldTemplate,
|
|
484
|
+
{
|
|
485
|
+
id: titleId(idSchema),
|
|
486
|
+
title,
|
|
487
|
+
required,
|
|
488
|
+
schema,
|
|
489
|
+
uiSchema,
|
|
490
|
+
registry
|
|
491
|
+
}
|
|
492
|
+
),
|
|
493
|
+
description && /* @__PURE__ */ jsx11(
|
|
494
|
+
DescriptionFieldTemplate,
|
|
495
|
+
{
|
|
496
|
+
id: descriptionId(idSchema),
|
|
497
|
+
description,
|
|
498
|
+
schema,
|
|
499
|
+
uiSchema,
|
|
500
|
+
registry
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
/* @__PURE__ */ jsxs6(Grid3, { container: true, spacing: 2, style: { marginTop: "10px" }, children: [
|
|
504
|
+
properties.map(
|
|
505
|
+
(element, index) => (
|
|
506
|
+
// Remove the <Grid> if the inner element is hidden as the <Grid>
|
|
507
|
+
// itself would otherwise still take up space.
|
|
508
|
+
element.hidden ? element.content : /* @__PURE__ */ jsx11(Grid3, { item: true, xs: 12, style: { marginBottom: "10px" }, children: element.content }, index)
|
|
509
|
+
)
|
|
510
|
+
),
|
|
511
|
+
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx11(Grid3, { container: true, justifyContent: "flex-end", children: /* @__PURE__ */ jsx11(Grid3, { item: true, children: /* @__PURE__ */ jsx11(
|
|
512
|
+
AddButton2,
|
|
513
|
+
{
|
|
514
|
+
className: "object-property-expand",
|
|
515
|
+
onClick: onAddClick(schema),
|
|
516
|
+
disabled: disabled || readonly,
|
|
517
|
+
uiSchema,
|
|
518
|
+
registry
|
|
519
|
+
}
|
|
520
|
+
) }) })
|
|
521
|
+
] })
|
|
522
|
+
] });
|
|
633
523
|
}
|
|
634
524
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
norender,
|
|
643
|
-
props: submitButtonProps = {}
|
|
644
|
-
} = getSubmitButtonOptions(uiSchema);
|
|
525
|
+
// src/SubmitButton/SubmitButton.tsx
|
|
526
|
+
import Box4 from "@mui/material/Box";
|
|
527
|
+
import Button from "@mui/material/Button";
|
|
528
|
+
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
529
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
530
|
+
function SubmitButton({ uiSchema }) {
|
|
531
|
+
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
645
532
|
if (norender) {
|
|
646
533
|
return null;
|
|
647
534
|
}
|
|
648
|
-
return
|
|
649
|
-
marginTop: 3,
|
|
650
|
-
children: jsx(Button, {
|
|
651
|
-
type: 'submit',
|
|
652
|
-
variant: 'contained',
|
|
653
|
-
color: 'primary',
|
|
654
|
-
...submitButtonProps,
|
|
655
|
-
children: submitText
|
|
656
|
-
})
|
|
657
|
-
});
|
|
535
|
+
return /* @__PURE__ */ jsx12(Box4, { marginTop: 3, children: /* @__PURE__ */ jsx12(Button, { type: "submit", variant: "contained", color: "primary", ...submitButtonProps, children: submitText }) });
|
|
658
536
|
}
|
|
659
537
|
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
538
|
+
// src/TitleField/TitleField.tsx
|
|
539
|
+
import Box5 from "@mui/material/Box";
|
|
540
|
+
import Divider from "@mui/material/Divider";
|
|
541
|
+
import Typography4 from "@mui/material/Typography";
|
|
542
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
664
543
|
function TitleField({
|
|
665
544
|
id,
|
|
666
545
|
title
|
|
667
546
|
}) {
|
|
668
|
-
return
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
children: [jsx(Typography, {
|
|
673
|
-
variant: 'h5',
|
|
674
|
-
children: title
|
|
675
|
-
}), jsx(Divider, {})]
|
|
676
|
-
});
|
|
547
|
+
return /* @__PURE__ */ jsxs7(Box5, { id, mb: 1, mt: 1, children: [
|
|
548
|
+
/* @__PURE__ */ jsx13(Typography4, { variant: "h5", children: title }),
|
|
549
|
+
/* @__PURE__ */ jsx13(Divider, {})
|
|
550
|
+
] });
|
|
677
551
|
}
|
|
678
552
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
553
|
+
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
554
|
+
import Grid4 from "@mui/material/Grid";
|
|
555
|
+
import TextField2 from "@mui/material/TextField";
|
|
556
|
+
import {
|
|
557
|
+
ADDITIONAL_PROPERTY_FLAG,
|
|
558
|
+
TranslatableString as TranslatableString4
|
|
559
|
+
} from "@rjsf/utils";
|
|
560
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
684
561
|
function WrapIfAdditionalTemplate(props) {
|
|
685
562
|
const {
|
|
686
563
|
children,
|
|
@@ -697,70 +574,51 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
697
574
|
uiSchema,
|
|
698
575
|
registry
|
|
699
576
|
} = props;
|
|
700
|
-
const {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
// Button templates are not overridden in the uiSchema
|
|
705
|
-
const {
|
|
706
|
-
RemoveButton
|
|
707
|
-
} = templates.ButtonTemplates;
|
|
708
|
-
const keyLabel = translateString(TranslatableString.KeyLabel, [label]);
|
|
709
|
-
const additional = (ADDITIONAL_PROPERTY_FLAG in schema);
|
|
577
|
+
const { templates, translateString } = registry;
|
|
578
|
+
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
579
|
+
const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
|
|
580
|
+
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
710
581
|
const btnStyle = {
|
|
711
582
|
flex: 1,
|
|
712
583
|
paddingLeft: 6,
|
|
713
584
|
paddingRight: 6,
|
|
714
|
-
fontWeight:
|
|
585
|
+
fontWeight: "bold"
|
|
715
586
|
};
|
|
716
587
|
if (!additional) {
|
|
717
|
-
return
|
|
718
|
-
className: classNames,
|
|
719
|
-
style: style,
|
|
720
|
-
children: children
|
|
721
|
-
});
|
|
588
|
+
return /* @__PURE__ */ jsx14("div", { className: classNames, style, children });
|
|
722
589
|
}
|
|
723
|
-
const handleBlur = ({
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
alignItems: 'center',
|
|
729
|
-
spacing: 2,
|
|
730
|
-
className: classNames,
|
|
731
|
-
style: style,
|
|
732
|
-
children: [jsx(Grid, {
|
|
733
|
-
item: true,
|
|
734
|
-
xs: true,
|
|
735
|
-
children: jsx(TextField, {
|
|
590
|
+
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
591
|
+
return /* @__PURE__ */ jsxs8(Grid4, { container: true, alignItems: "center", spacing: 2, className: classNames, style, children: [
|
|
592
|
+
/* @__PURE__ */ jsx14(Grid4, { item: true, xs: true, children: /* @__PURE__ */ jsx14(
|
|
593
|
+
TextField2,
|
|
594
|
+
{
|
|
736
595
|
fullWidth: true,
|
|
737
|
-
required
|
|
596
|
+
required,
|
|
738
597
|
label: keyLabel,
|
|
739
598
|
defaultValue: label,
|
|
740
599
|
disabled: disabled || readonly,
|
|
741
600
|
id: `${id}-key`,
|
|
742
601
|
name: `${id}-key`,
|
|
743
|
-
onBlur: !readonly ? handleBlur :
|
|
744
|
-
type:
|
|
745
|
-
}
|
|
746
|
-
}),
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
children: jsx(RemoveButton, {
|
|
753
|
-
iconType: 'default',
|
|
602
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
603
|
+
type: "text"
|
|
604
|
+
}
|
|
605
|
+
) }),
|
|
606
|
+
/* @__PURE__ */ jsx14(Grid4, { item: true, xs: true, children }),
|
|
607
|
+
/* @__PURE__ */ jsx14(Grid4, { item: true, children: /* @__PURE__ */ jsx14(
|
|
608
|
+
RemoveButton2,
|
|
609
|
+
{
|
|
610
|
+
iconType: "default",
|
|
754
611
|
style: btnStyle,
|
|
755
612
|
disabled: disabled || readonly,
|
|
756
613
|
onClick: onDropPropertyClick(label),
|
|
757
|
-
uiSchema
|
|
758
|
-
registry
|
|
759
|
-
}
|
|
760
|
-
})
|
|
761
|
-
}, `${id}-key`);
|
|
614
|
+
uiSchema,
|
|
615
|
+
registry
|
|
616
|
+
}
|
|
617
|
+
) })
|
|
618
|
+
] }, `${id}-key`);
|
|
762
619
|
}
|
|
763
620
|
|
|
621
|
+
// src/Templates/Templates.ts
|
|
764
622
|
function generateTemplates() {
|
|
765
623
|
return {
|
|
766
624
|
ArrayFieldItemTemplate,
|
|
@@ -784,13 +642,19 @@ function generateTemplates() {
|
|
|
784
642
|
WrapIfAdditionalTemplate
|
|
785
643
|
};
|
|
786
644
|
}
|
|
787
|
-
var
|
|
645
|
+
var Templates_default = generateTemplates();
|
|
788
646
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
647
|
+
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
648
|
+
import Checkbox from "@mui/material/Checkbox";
|
|
649
|
+
import FormControlLabel from "@mui/material/FormControlLabel";
|
|
650
|
+
import {
|
|
651
|
+
ariaDescribedByIds as ariaDescribedByIds2,
|
|
652
|
+
descriptionId as descriptionId2,
|
|
653
|
+
getTemplate as getTemplate4,
|
|
654
|
+
labelValue as labelValue2,
|
|
655
|
+
schemaRequiresTrueValue
|
|
656
|
+
} from "@rjsf/utils";
|
|
657
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
794
658
|
function CheckboxWidget(props) {
|
|
795
659
|
const {
|
|
796
660
|
schema,
|
|
@@ -798,7 +662,7 @@ function CheckboxWidget(props) {
|
|
|
798
662
|
value,
|
|
799
663
|
disabled,
|
|
800
664
|
readonly,
|
|
801
|
-
label =
|
|
665
|
+
label = "",
|
|
802
666
|
hideLabel,
|
|
803
667
|
autofocus,
|
|
804
668
|
onChange,
|
|
@@ -808,53 +672,66 @@ function CheckboxWidget(props) {
|
|
|
808
672
|
options,
|
|
809
673
|
uiSchema
|
|
810
674
|
} = props;
|
|
811
|
-
const DescriptionFieldTemplate =
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
675
|
+
const DescriptionFieldTemplate = getTemplate4(
|
|
676
|
+
"DescriptionFieldTemplate",
|
|
677
|
+
registry,
|
|
678
|
+
options
|
|
679
|
+
);
|
|
815
680
|
const required = schemaRequiresTrueValue(schema);
|
|
816
681
|
const _onChange = (_, checked) => onChange(checked);
|
|
817
|
-
const _onBlur = ({
|
|
818
|
-
|
|
819
|
-
value
|
|
820
|
-
}
|
|
821
|
-
}) => onBlur(id, value);
|
|
822
|
-
const _onFocus = ({
|
|
823
|
-
target: {
|
|
824
|
-
value
|
|
825
|
-
}
|
|
826
|
-
}) => onFocus(id, value);
|
|
682
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
|
|
683
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
|
|
827
684
|
const description = options.description ?? schema.description;
|
|
828
|
-
return
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
685
|
+
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
686
|
+
!hideLabel && !!description && /* @__PURE__ */ jsx15(
|
|
687
|
+
DescriptionFieldTemplate,
|
|
688
|
+
{
|
|
689
|
+
id: descriptionId2(id),
|
|
690
|
+
description,
|
|
691
|
+
schema,
|
|
692
|
+
uiSchema,
|
|
693
|
+
registry
|
|
694
|
+
}
|
|
695
|
+
),
|
|
696
|
+
/* @__PURE__ */ jsx15(
|
|
697
|
+
FormControlLabel,
|
|
698
|
+
{
|
|
699
|
+
control: /* @__PURE__ */ jsx15(
|
|
700
|
+
Checkbox,
|
|
701
|
+
{
|
|
702
|
+
id,
|
|
703
|
+
name: id,
|
|
704
|
+
checked: typeof value === "undefined" ? false : Boolean(value),
|
|
705
|
+
required,
|
|
706
|
+
disabled: disabled || readonly,
|
|
707
|
+
autoFocus: autofocus,
|
|
708
|
+
onChange: _onChange,
|
|
709
|
+
onBlur: _onBlur,
|
|
710
|
+
onFocus: _onFocus,
|
|
711
|
+
"aria-describedby": ariaDescribedByIds2(id)
|
|
712
|
+
}
|
|
713
|
+
),
|
|
714
|
+
label: labelValue2(label, hideLabel, false)
|
|
715
|
+
}
|
|
716
|
+
)
|
|
717
|
+
] });
|
|
851
718
|
}
|
|
852
719
|
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
720
|
+
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
721
|
+
import Checkbox2 from "@mui/material/Checkbox";
|
|
722
|
+
import FormControlLabel2 from "@mui/material/FormControlLabel";
|
|
723
|
+
import FormGroup from "@mui/material/FormGroup";
|
|
724
|
+
import FormLabel from "@mui/material/FormLabel";
|
|
725
|
+
import {
|
|
726
|
+
ariaDescribedByIds as ariaDescribedByIds3,
|
|
727
|
+
enumOptionsDeselectValue,
|
|
728
|
+
enumOptionsIsSelected,
|
|
729
|
+
enumOptionsSelectValue,
|
|
730
|
+
enumOptionsValueForIndex,
|
|
731
|
+
labelValue as labelValue3,
|
|
732
|
+
optionId
|
|
733
|
+
} from "@rjsf/utils";
|
|
734
|
+
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
858
735
|
function CheckboxesWidget({
|
|
859
736
|
label,
|
|
860
737
|
hideLabel,
|
|
@@ -869,70 +746,57 @@ function CheckboxesWidget({
|
|
|
869
746
|
onBlur,
|
|
870
747
|
onFocus
|
|
871
748
|
}) {
|
|
872
|
-
const {
|
|
873
|
-
enumOptions,
|
|
874
|
-
enumDisabled,
|
|
875
|
-
inline,
|
|
876
|
-
emptyValue
|
|
877
|
-
} = options;
|
|
749
|
+
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
878
750
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
879
|
-
const _onChange = index => ({
|
|
880
|
-
target: {
|
|
881
|
-
checked
|
|
882
|
-
}
|
|
883
|
-
}) => {
|
|
751
|
+
const _onChange = (index) => ({ target: { checked } }) => {
|
|
884
752
|
if (checked) {
|
|
885
753
|
onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
|
|
886
754
|
} else {
|
|
887
755
|
onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
|
|
888
756
|
}
|
|
889
757
|
};
|
|
890
|
-
const _onBlur = ({
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
htmlFor: id,
|
|
904
|
-
children: label || undefined
|
|
905
|
-
}), hideLabel), jsx(FormGroup, {
|
|
906
|
-
id: id,
|
|
907
|
-
row: !!inline,
|
|
908
|
-
children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
909
|
-
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
910
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
911
|
-
const checkbox = jsx(Checkbox, {
|
|
758
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, enumOptionsValueForIndex(value2, enumOptions, emptyValue));
|
|
759
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, enumOptionsValueForIndex(value2, enumOptions, emptyValue));
|
|
760
|
+
return /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
761
|
+
labelValue3(
|
|
762
|
+
/* @__PURE__ */ jsx16(FormLabel, { required, htmlFor: id, children: label || void 0 }),
|
|
763
|
+
hideLabel
|
|
764
|
+
),
|
|
765
|
+
/* @__PURE__ */ jsx16(FormGroup, { id, row: !!inline, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
766
|
+
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
767
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
768
|
+
const checkbox = /* @__PURE__ */ jsx16(
|
|
769
|
+
Checkbox2,
|
|
770
|
+
{
|
|
912
771
|
id: optionId(id, index),
|
|
913
772
|
name: id,
|
|
914
|
-
checked
|
|
773
|
+
checked,
|
|
915
774
|
disabled: disabled || itemDisabled || readonly,
|
|
916
775
|
autoFocus: autofocus && index === 0,
|
|
917
776
|
onChange: _onChange(index),
|
|
918
777
|
onBlur: _onBlur,
|
|
919
778
|
onFocus: _onFocus,
|
|
920
|
-
"aria-describedby":
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
})
|
|
927
|
-
})]
|
|
928
|
-
});
|
|
779
|
+
"aria-describedby": ariaDescribedByIds3(id)
|
|
780
|
+
}
|
|
781
|
+
);
|
|
782
|
+
return /* @__PURE__ */ jsx16(FormControlLabel2, { control: checkbox, label: option.label }, index);
|
|
783
|
+
}) })
|
|
784
|
+
] });
|
|
929
785
|
}
|
|
930
786
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
787
|
+
// src/RadioWidget/RadioWidget.tsx
|
|
788
|
+
import FormControlLabel3 from "@mui/material/FormControlLabel";
|
|
789
|
+
import FormLabel2 from "@mui/material/FormLabel";
|
|
790
|
+
import Radio from "@mui/material/Radio";
|
|
791
|
+
import RadioGroup from "@mui/material/RadioGroup";
|
|
792
|
+
import {
|
|
793
|
+
ariaDescribedByIds as ariaDescribedByIds4,
|
|
794
|
+
enumOptionsIndexForValue,
|
|
795
|
+
enumOptionsValueForIndex as enumOptionsValueForIndex2,
|
|
796
|
+
labelValue as labelValue4,
|
|
797
|
+
optionId as optionId2
|
|
798
|
+
} from "@rjsf/utils";
|
|
799
|
+
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
936
800
|
function RadioWidget({
|
|
937
801
|
id,
|
|
938
802
|
options,
|
|
@@ -946,118 +810,94 @@ function RadioWidget({
|
|
|
946
810
|
onBlur,
|
|
947
811
|
onFocus
|
|
948
812
|
}) {
|
|
949
|
-
const {
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
} = options;
|
|
954
|
-
const _onChange = (_, value) => onChange(enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
955
|
-
const _onBlur = ({
|
|
956
|
-
target: {
|
|
957
|
-
value
|
|
958
|
-
}
|
|
959
|
-
}) => onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
960
|
-
const _onFocus = ({
|
|
961
|
-
target: {
|
|
962
|
-
value
|
|
963
|
-
}
|
|
964
|
-
}) => onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
813
|
+
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
814
|
+
const _onChange = (_, value2) => onChange(enumOptionsValueForIndex2(value2, enumOptions, emptyValue));
|
|
815
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, enumOptionsValueForIndex2(value2, enumOptions, emptyValue));
|
|
816
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, enumOptionsValueForIndex2(value2, enumOptions, emptyValue));
|
|
965
817
|
const row = options ? options.inline : false;
|
|
966
818
|
const selectedIndex = enumOptionsIndexForValue(value, enumOptions) ?? null;
|
|
967
|
-
return
|
|
968
|
-
|
|
969
|
-
required:
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
819
|
+
return /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
820
|
+
labelValue4(
|
|
821
|
+
/* @__PURE__ */ jsx17(FormLabel2, { required, htmlFor: id, children: label || void 0 }),
|
|
822
|
+
hideLabel
|
|
823
|
+
),
|
|
824
|
+
/* @__PURE__ */ jsx17(
|
|
825
|
+
RadioGroup,
|
|
826
|
+
{
|
|
827
|
+
id,
|
|
828
|
+
name: id,
|
|
829
|
+
value: selectedIndex,
|
|
830
|
+
row,
|
|
831
|
+
onChange: _onChange,
|
|
832
|
+
onBlur: _onBlur,
|
|
833
|
+
onFocus: _onFocus,
|
|
834
|
+
"aria-describedby": ariaDescribedByIds4(id),
|
|
835
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
836
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
837
|
+
const radio = /* @__PURE__ */ jsx17(
|
|
838
|
+
FormControlLabel3,
|
|
839
|
+
{
|
|
840
|
+
control: /* @__PURE__ */ jsx17(Radio, { name: id, id: optionId2(id, index), color: "primary" }),
|
|
841
|
+
label: option.label,
|
|
842
|
+
value: String(index),
|
|
843
|
+
disabled: disabled || itemDisabled || readonly
|
|
844
|
+
},
|
|
845
|
+
index
|
|
846
|
+
);
|
|
847
|
+
return radio;
|
|
848
|
+
})
|
|
849
|
+
}
|
|
850
|
+
)
|
|
851
|
+
] });
|
|
997
852
|
}
|
|
998
853
|
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
854
|
+
// src/RangeWidget/RangeWidget.tsx
|
|
855
|
+
import FormLabel3 from "@mui/material/FormLabel";
|
|
856
|
+
import Slider from "@mui/material/Slider";
|
|
857
|
+
import {
|
|
858
|
+
ariaDescribedByIds as ariaDescribedByIds5,
|
|
859
|
+
labelValue as labelValue5,
|
|
860
|
+
rangeSpec
|
|
861
|
+
} from "@rjsf/utils";
|
|
862
|
+
import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1004
863
|
function RangeWidget(props) {
|
|
1005
|
-
const {
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
onBlur,
|
|
1010
|
-
onFocus,
|
|
1011
|
-
options,
|
|
1012
|
-
schema,
|
|
1013
|
-
onChange,
|
|
1014
|
-
required,
|
|
1015
|
-
label,
|
|
1016
|
-
hideLabel,
|
|
1017
|
-
id
|
|
1018
|
-
} = props;
|
|
1019
|
-
const sliderProps = {
|
|
1020
|
-
value,
|
|
1021
|
-
label,
|
|
1022
|
-
id,
|
|
1023
|
-
name: id,
|
|
1024
|
-
...rangeSpec(schema)
|
|
1025
|
-
};
|
|
1026
|
-
const _onChange = (_, value) => {
|
|
1027
|
-
onChange(value ?? options.emptyValue);
|
|
864
|
+
const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, required, label, hideLabel, id } = props;
|
|
865
|
+
const sliderProps = { value, label, id, name: id, ...rangeSpec(schema) };
|
|
866
|
+
const _onChange = (_, value2) => {
|
|
867
|
+
onChange(value2 ?? options.emptyValue);
|
|
1028
868
|
};
|
|
1029
|
-
const _onBlur = ({
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
valueLabelDisplay: 'auto',
|
|
1050
|
-
...sliderProps,
|
|
1051
|
-
"aria-describedby": ariaDescribedByIds(id)
|
|
1052
|
-
})]
|
|
1053
|
-
});
|
|
869
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
|
|
870
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
|
|
871
|
+
return /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
872
|
+
labelValue5(
|
|
873
|
+
/* @__PURE__ */ jsx18(FormLabel3, { required, htmlFor: id, children: label || void 0 }),
|
|
874
|
+
hideLabel
|
|
875
|
+
),
|
|
876
|
+
/* @__PURE__ */ jsx18(
|
|
877
|
+
Slider,
|
|
878
|
+
{
|
|
879
|
+
disabled: disabled || readonly,
|
|
880
|
+
onChange: _onChange,
|
|
881
|
+
onBlur: _onBlur,
|
|
882
|
+
onFocus: _onFocus,
|
|
883
|
+
valueLabelDisplay: "auto",
|
|
884
|
+
...sliderProps,
|
|
885
|
+
"aria-describedby": ariaDescribedByIds5(id)
|
|
886
|
+
}
|
|
887
|
+
)
|
|
888
|
+
] });
|
|
1054
889
|
}
|
|
1055
890
|
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
891
|
+
// src/SelectWidget/SelectWidget.tsx
|
|
892
|
+
import MenuItem from "@mui/material/MenuItem";
|
|
893
|
+
import TextField3 from "@mui/material/TextField";
|
|
894
|
+
import {
|
|
895
|
+
ariaDescribedByIds as ariaDescribedByIds6,
|
|
896
|
+
enumOptionsIndexForValue as enumOptionsIndexForValue2,
|
|
897
|
+
enumOptionsValueForIndex as enumOptionsValueForIndex3,
|
|
898
|
+
labelValue as labelValue6
|
|
899
|
+
} from "@rjsf/utils";
|
|
900
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1061
901
|
function SelectWidget({
|
|
1062
902
|
schema,
|
|
1063
903
|
id,
|
|
@@ -1083,90 +923,62 @@ function SelectWidget({
|
|
|
1083
923
|
formContext,
|
|
1084
924
|
...textFieldProps
|
|
1085
925
|
}) {
|
|
1086
|
-
const {
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
const
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
926
|
+
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
927
|
+
multiple = typeof multiple === "undefined" ? false : !!multiple;
|
|
928
|
+
const emptyValue = multiple ? [] : "";
|
|
929
|
+
const isEmpty = typeof value === "undefined" || multiple && value.length < 1 || !multiple && value === emptyValue;
|
|
930
|
+
const _onChange = ({ target: { value: value2 } }) => onChange(enumOptionsValueForIndex3(value2, enumOptions, optEmptyVal));
|
|
931
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, enumOptionsValueForIndex3(value2, enumOptions, optEmptyVal));
|
|
932
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, enumOptionsValueForIndex3(value2, enumOptions, optEmptyVal));
|
|
933
|
+
const selectedIndexes = enumOptionsIndexForValue2(value, enumOptions, multiple);
|
|
934
|
+
return /* @__PURE__ */ jsx19(
|
|
935
|
+
TextField3,
|
|
936
|
+
{
|
|
937
|
+
id,
|
|
938
|
+
name: id,
|
|
939
|
+
label: labelValue6(label || void 0, hideLabel, false),
|
|
940
|
+
value: isEmpty ? emptyValue : selectedIndexes,
|
|
941
|
+
required,
|
|
942
|
+
disabled: disabled || readonly,
|
|
943
|
+
autoFocus: autofocus,
|
|
944
|
+
placeholder,
|
|
945
|
+
error: rawErrors.length > 0,
|
|
946
|
+
onChange: _onChange,
|
|
947
|
+
onBlur: _onBlur,
|
|
948
|
+
onFocus: _onFocus,
|
|
949
|
+
...textFieldProps,
|
|
950
|
+
select: true,
|
|
951
|
+
InputLabelProps: {
|
|
952
|
+
...textFieldProps.InputLabelProps,
|
|
953
|
+
shrink: !isEmpty
|
|
954
|
+
},
|
|
955
|
+
SelectProps: {
|
|
956
|
+
...textFieldProps.SelectProps,
|
|
957
|
+
multiple
|
|
958
|
+
},
|
|
959
|
+
"aria-describedby": ariaDescribedByIds6(id),
|
|
960
|
+
children: Array.isArray(enumOptions) && enumOptions.map(({ value: value2, label: label2 }, i) => {
|
|
961
|
+
const disabled2 = Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1;
|
|
962
|
+
return /* @__PURE__ */ jsx19(MenuItem, { value: String(i), disabled: disabled2, children: label2 }, i);
|
|
963
|
+
})
|
|
1107
964
|
}
|
|
1108
|
-
|
|
1109
|
-
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
1110
|
-
return jsx(TextField, {
|
|
1111
|
-
id: id,
|
|
1112
|
-
name: id,
|
|
1113
|
-
label: labelValue(label || undefined, hideLabel, false),
|
|
1114
|
-
value: isEmpty ? emptyValue : selectedIndexes,
|
|
1115
|
-
required: required,
|
|
1116
|
-
disabled: disabled || readonly,
|
|
1117
|
-
autoFocus: autofocus,
|
|
1118
|
-
placeholder: placeholder,
|
|
1119
|
-
error: rawErrors.length > 0,
|
|
1120
|
-
onChange: _onChange,
|
|
1121
|
-
onBlur: _onBlur,
|
|
1122
|
-
onFocus: _onFocus,
|
|
1123
|
-
...textFieldProps,
|
|
1124
|
-
select // Apply this and the following props after the potential overrides defined in textFieldProps
|
|
1125
|
-
: true,
|
|
1126
|
-
InputLabelProps: {
|
|
1127
|
-
...textFieldProps.InputLabelProps,
|
|
1128
|
-
shrink: !isEmpty
|
|
1129
|
-
},
|
|
1130
|
-
SelectProps: {
|
|
1131
|
-
...textFieldProps.SelectProps,
|
|
1132
|
-
multiple
|
|
1133
|
-
},
|
|
1134
|
-
"aria-describedby": ariaDescribedByIds(id),
|
|
1135
|
-
children: Array.isArray(enumOptions) && enumOptions.map(({
|
|
1136
|
-
value,
|
|
1137
|
-
label
|
|
1138
|
-
}, i) => {
|
|
1139
|
-
const disabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1;
|
|
1140
|
-
return jsx(MenuItem, {
|
|
1141
|
-
value: String(i),
|
|
1142
|
-
disabled: disabled,
|
|
1143
|
-
children: label
|
|
1144
|
-
}, i);
|
|
1145
|
-
})
|
|
1146
|
-
});
|
|
965
|
+
);
|
|
1147
966
|
}
|
|
1148
967
|
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
*/
|
|
968
|
+
// src/TextareaWidget/TextareaWidget.tsx
|
|
969
|
+
import { getTemplate as getTemplate5 } from "@rjsf/utils";
|
|
970
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1153
971
|
function TextareaWidget(props) {
|
|
1154
|
-
const {
|
|
1155
|
-
|
|
1156
|
-
registry
|
|
1157
|
-
} = props;
|
|
1158
|
-
const BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
|
|
972
|
+
const { options, registry } = props;
|
|
973
|
+
const BaseInputTemplate2 = getTemplate5("BaseInputTemplate", registry, options);
|
|
1159
974
|
let rows = 5;
|
|
1160
|
-
if (typeof options.rows ===
|
|
975
|
+
if (typeof options.rows === "string" || typeof options.rows === "number") {
|
|
1161
976
|
rows = options.rows;
|
|
1162
977
|
}
|
|
1163
|
-
return
|
|
1164
|
-
...props,
|
|
1165
|
-
multiline: true,
|
|
1166
|
-
rows: rows
|
|
1167
|
-
});
|
|
978
|
+
return /* @__PURE__ */ jsx20(BaseInputTemplate2, { ...props, multiline: true, rows });
|
|
1168
979
|
}
|
|
1169
980
|
|
|
981
|
+
// src/Widgets/Widgets.ts
|
|
1170
982
|
function generateWidgets() {
|
|
1171
983
|
return {
|
|
1172
984
|
CheckboxWidget,
|
|
@@ -1177,20 +989,34 @@ function generateWidgets() {
|
|
|
1177
989
|
TextareaWidget
|
|
1178
990
|
};
|
|
1179
991
|
}
|
|
1180
|
-
var
|
|
992
|
+
var Widgets_default = generateWidgets();
|
|
1181
993
|
|
|
994
|
+
// src/Theme/Theme.tsx
|
|
1182
995
|
function generateTheme() {
|
|
1183
996
|
return {
|
|
1184
997
|
templates: generateTemplates(),
|
|
1185
998
|
widgets: generateWidgets()
|
|
1186
999
|
};
|
|
1187
1000
|
}
|
|
1188
|
-
var
|
|
1001
|
+
var Theme_default = generateTheme();
|
|
1189
1002
|
|
|
1003
|
+
// src/MuiForm/MuiForm.tsx
|
|
1190
1004
|
function generateForm() {
|
|
1191
1005
|
return withTheme(generateTheme());
|
|
1192
1006
|
}
|
|
1193
|
-
var
|
|
1007
|
+
var MuiForm_default = generateForm();
|
|
1194
1008
|
|
|
1195
|
-
|
|
1009
|
+
// src/index.ts
|
|
1010
|
+
var src_default = MuiForm_default;
|
|
1011
|
+
export {
|
|
1012
|
+
MuiForm_default as Form,
|
|
1013
|
+
Templates_default as Templates,
|
|
1014
|
+
Theme_default as Theme,
|
|
1015
|
+
Widgets_default as Widgets,
|
|
1016
|
+
src_default as default,
|
|
1017
|
+
generateForm,
|
|
1018
|
+
generateTemplates,
|
|
1019
|
+
generateTheme,
|
|
1020
|
+
generateWidgets
|
|
1021
|
+
};
|
|
1196
1022
|
//# sourceMappingURL=mui.esm.js.map
|