@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.
Files changed (211) hide show
  1. package/dist/index.js +1003 -5
  2. package/dist/index.js.map +7 -0
  3. package/dist/mui.esm.js +650 -824
  4. package/dist/mui.esm.js.map +7 -1
  5. package/dist/mui.umd.js +852 -0
  6. package/lib/AddButton/AddButton.d.ts +5 -0
  7. package/lib/AddButton/AddButton.js +13 -0
  8. package/lib/AddButton/AddButton.js.map +1 -0
  9. package/lib/AddButton/index.d.ts +2 -0
  10. package/lib/AddButton/index.js +3 -0
  11. package/lib/AddButton/index.js.map +1 -0
  12. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +7 -0
  13. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +21 -0
  14. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -0
  15. package/lib/ArrayFieldItemTemplate/index.d.ts +2 -0
  16. package/lib/ArrayFieldItemTemplate/index.js +3 -0
  17. package/lib/ArrayFieldItemTemplate/index.js.map +1 -0
  18. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +7 -0
  19. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +25 -0
  20. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -0
  21. package/lib/ArrayFieldTemplate/index.d.ts +2 -0
  22. package/lib/ArrayFieldTemplate/index.js +3 -0
  23. package/lib/ArrayFieldTemplate/index.js.map +1 -0
  24. package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +9 -0
  25. package/lib/BaseInputTemplate/BaseInputTemplate.js +32 -0
  26. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -0
  27. package/lib/BaseInputTemplate/index.d.ts +2 -0
  28. package/lib/BaseInputTemplate/index.js +3 -0
  29. package/lib/BaseInputTemplate/index.js.map +1 -0
  30. package/lib/CheckboxWidget/CheckboxWidget.d.ts +8 -0
  31. package/lib/CheckboxWidget/CheckboxWidget.js +24 -0
  32. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -0
  33. package/lib/CheckboxWidget/index.d.ts +2 -0
  34. package/lib/CheckboxWidget/index.js +3 -0
  35. package/lib/CheckboxWidget/index.js.map +1 -0
  36. package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +8 -0
  37. package/lib/CheckboxesWidget/CheckboxesWidget.js +33 -0
  38. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -0
  39. package/lib/CheckboxesWidget/index.d.ts +2 -0
  40. package/lib/CheckboxesWidget/index.js +3 -0
  41. package/lib/CheckboxesWidget/index.js.map +1 -0
  42. package/lib/DescriptionField/DescriptionField.d.ts +7 -0
  43. package/lib/DescriptionField/DescriptionField.js +14 -0
  44. package/lib/DescriptionField/DescriptionField.js.map +1 -0
  45. package/lib/DescriptionField/index.d.ts +2 -0
  46. package/lib/DescriptionField/index.js +3 -0
  47. package/lib/DescriptionField/index.js.map +1 -0
  48. package/lib/ErrorList/ErrorList.d.ts +7 -0
  49. package/lib/ErrorList/ErrorList.js +21 -0
  50. package/lib/ErrorList/ErrorList.js.map +1 -0
  51. package/lib/ErrorList/index.d.ts +2 -0
  52. package/lib/ErrorList/index.js +3 -0
  53. package/lib/ErrorList/index.js.map +1 -0
  54. package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +7 -0
  55. package/lib/FieldErrorTemplate/FieldErrorTemplate.js +20 -0
  56. package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -0
  57. package/lib/FieldErrorTemplate/index.d.ts +2 -0
  58. package/lib/FieldErrorTemplate/index.js +3 -0
  59. package/lib/FieldErrorTemplate/index.js.map +1 -0
  60. package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +7 -0
  61. package/lib/FieldHelpTemplate/FieldHelpTemplate.js +16 -0
  62. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -0
  63. package/lib/FieldHelpTemplate/index.d.ts +2 -0
  64. package/lib/FieldHelpTemplate/index.js +3 -0
  65. package/lib/FieldHelpTemplate/index.js.map +1 -0
  66. package/lib/FieldTemplate/FieldTemplate.d.ts +8 -0
  67. package/lib/FieldTemplate/FieldTemplate.js +19 -0
  68. package/lib/FieldTemplate/FieldTemplate.js.map +1 -0
  69. package/lib/FieldTemplate/index.d.ts +2 -0
  70. package/lib/FieldTemplate/index.js +3 -0
  71. package/lib/FieldTemplate/index.js.map +1 -0
  72. package/lib/IconButton/IconButton.d.ts +7 -0
  73. package/lib/IconButton/IconButton.js +30 -0
  74. package/lib/IconButton/IconButton.js.map +1 -0
  75. package/lib/IconButton/index.d.ts +2 -0
  76. package/lib/IconButton/index.js +3 -0
  77. package/lib/IconButton/index.js.map +1 -0
  78. package/lib/MuiForm/MuiForm.d.ts +6 -0
  79. package/lib/MuiForm/MuiForm.js +7 -0
  80. package/lib/MuiForm/MuiForm.js.map +1 -0
  81. package/lib/MuiForm/index.d.ts +2 -0
  82. package/lib/MuiForm/index.js +3 -0
  83. package/lib/MuiForm/index.js.map +1 -0
  84. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +9 -0
  85. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +22 -0
  86. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -0
  87. package/lib/ObjectFieldTemplate/index.d.ts +2 -0
  88. package/lib/ObjectFieldTemplate/index.js +3 -0
  89. package/lib/ObjectFieldTemplate/index.js.map +1 -0
  90. package/lib/RadioWidget/RadioWidget.d.ts +8 -0
  91. package/lib/RadioWidget/RadioWidget.js +27 -0
  92. package/lib/RadioWidget/RadioWidget.js.map +1 -0
  93. package/lib/RadioWidget/index.d.ts +2 -0
  94. package/lib/RadioWidget/index.js +3 -0
  95. package/lib/RadioWidget/index.js.map +1 -0
  96. package/lib/RangeWidget/RangeWidget.d.ts +8 -0
  97. package/lib/RangeWidget/RangeWidget.js +20 -0
  98. package/lib/RangeWidget/RangeWidget.js.map +1 -0
  99. package/lib/RangeWidget/index.d.ts +2 -0
  100. package/lib/RangeWidget/index.js +3 -0
  101. package/lib/RangeWidget/index.js.map +1 -0
  102. package/lib/SelectWidget/SelectWidget.d.ts +9 -0
  103. package/lib/SelectWidget/SelectWidget.js +29 -0
  104. package/lib/SelectWidget/SelectWidget.js.map +1 -0
  105. package/lib/SelectWidget/index.d.ts +2 -0
  106. package/lib/SelectWidget/index.js +3 -0
  107. package/lib/SelectWidget/index.js.map +1 -0
  108. package/lib/SubmitButton/SubmitButton.d.ts +5 -0
  109. package/lib/SubmitButton/SubmitButton.js +14 -0
  110. package/lib/SubmitButton/SubmitButton.js.map +1 -0
  111. package/lib/SubmitButton/index.d.ts +2 -0
  112. package/lib/SubmitButton/index.js +3 -0
  113. package/lib/SubmitButton/index.js.map +1 -0
  114. package/lib/Templates/Templates.d.ts +4 -0
  115. package/lib/Templates/Templates.js +39 -0
  116. package/lib/Templates/Templates.js.map +1 -0
  117. package/lib/Templates/index.d.ts +2 -0
  118. package/lib/Templates/index.js +3 -0
  119. package/lib/Templates/index.js.map +1 -0
  120. package/lib/TextareaWidget/TextareaWidget.d.ts +7 -0
  121. package/lib/TextareaWidget/TextareaWidget.js +16 -0
  122. package/lib/TextareaWidget/TextareaWidget.js.map +1 -0
  123. package/lib/TextareaWidget/index.d.ts +2 -0
  124. package/lib/TextareaWidget/index.js +3 -0
  125. package/lib/TextareaWidget/index.js.map +1 -0
  126. package/lib/Theme/Theme.d.ts +5 -0
  127. package/lib/Theme/Theme.js +10 -0
  128. package/lib/Theme/Theme.js.map +1 -0
  129. package/lib/Theme/index.d.ts +2 -0
  130. package/lib/Theme/index.js +3 -0
  131. package/lib/Theme/index.js.map +1 -0
  132. package/lib/TitleField/TitleField.d.ts +7 -0
  133. package/lib/TitleField/TitleField.js +12 -0
  134. package/lib/TitleField/TitleField.js.map +1 -0
  135. package/lib/TitleField/index.d.ts +2 -0
  136. package/lib/TitleField/index.js +3 -0
  137. package/lib/TitleField/index.js.map +1 -0
  138. package/lib/Widgets/Widgets.d.ts +4 -0
  139. package/lib/Widgets/Widgets.js +18 -0
  140. package/lib/Widgets/Widgets.js.map +1 -0
  141. package/lib/Widgets/index.d.ts +2 -0
  142. package/lib/Widgets/index.js +3 -0
  143. package/lib/Widgets/index.js.map +1 -0
  144. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +8 -0
  145. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +29 -0
  146. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -0
  147. package/lib/WrapIfAdditionalTemplate/index.d.ts +2 -0
  148. package/lib/WrapIfAdditionalTemplate/index.js +3 -0
  149. package/lib/WrapIfAdditionalTemplate/index.js.map +1 -0
  150. package/lib/index.d.ts +6 -0
  151. package/lib/index.js +7 -0
  152. package/lib/index.js.map +1 -0
  153. package/package.json +24 -16
  154. package/src/AddButton/AddButton.tsx +18 -0
  155. package/src/AddButton/index.ts +2 -0
  156. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +91 -0
  157. package/src/ArrayFieldItemTemplate/index.ts +2 -0
  158. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +87 -0
  159. package/src/ArrayFieldTemplate/index.ts +2 -0
  160. package/src/BaseInputTemplate/BaseInputTemplate.tsx +106 -0
  161. package/src/BaseInputTemplate/index.ts +2 -0
  162. package/src/CheckboxWidget/CheckboxWidget.tsx +87 -0
  163. package/src/CheckboxWidget/index.ts +2 -0
  164. package/src/CheckboxesWidget/CheckboxesWidget.tsx +92 -0
  165. package/src/CheckboxesWidget/index.ts +2 -0
  166. package/src/DescriptionField/DescriptionField.tsx +23 -0
  167. package/src/DescriptionField/index.ts +2 -0
  168. package/src/ErrorList/ErrorList.tsx +39 -0
  169. package/src/ErrorList/index.ts +2 -0
  170. package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +32 -0
  171. package/src/FieldErrorTemplate/index.ts +2 -0
  172. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +19 -0
  173. package/src/FieldHelpTemplate/index.ts +2 -0
  174. package/src/FieldTemplate/FieldTemplate.tsx +81 -0
  175. package/src/FieldTemplate/index.ts +2 -0
  176. package/src/IconButton/IconButton.tsx +81 -0
  177. package/src/IconButton/index.ts +2 -0
  178. package/src/MuiForm/MuiForm.tsx +15 -0
  179. package/src/MuiForm/index.ts +2 -0
  180. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +99 -0
  181. package/src/ObjectFieldTemplate/index.ts +2 -0
  182. package/src/RadioWidget/RadioWidget.tsx +83 -0
  183. package/src/RadioWidget/index.ts +2 -0
  184. package/src/RangeWidget/RangeWidget.tsx +51 -0
  185. package/src/RangeWidget/index.ts +2 -0
  186. package/src/SelectWidget/SelectWidget.tsx +100 -0
  187. package/src/SelectWidget/index.ts +2 -0
  188. package/src/SubmitButton/SubmitButton.tsx +23 -0
  189. package/src/SubmitButton/index.ts +2 -0
  190. package/src/Templates/Templates.ts +46 -0
  191. package/src/Templates/index.ts +2 -0
  192. package/src/TextareaWidget/TextareaWidget.tsx +21 -0
  193. package/src/TextareaWidget/index.ts +2 -0
  194. package/src/Theme/Theme.tsx +18 -0
  195. package/src/Theme/index.ts +2 -0
  196. package/src/TitleField/TitleField.tsx +20 -0
  197. package/src/TitleField/index.ts +2 -0
  198. package/src/Widgets/Widgets.ts +25 -0
  199. package/src/Widgets/index.ts +2 -0
  200. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +90 -0
  201. package/src/WrapIfAdditionalTemplate/index.ts +2 -0
  202. package/src/index.ts +8 -0
  203. package/dist/index.d.ts +0 -17
  204. package/dist/mui.cjs.development.js +0 -1239
  205. package/dist/mui.cjs.development.js.map +0 -1
  206. package/dist/mui.cjs.production.min.js +0 -2
  207. package/dist/mui.cjs.production.min.js.map +0 -1
  208. package/dist/mui.umd.development.js +0 -1213
  209. package/dist/mui.umd.development.js.map +0 -1
  210. package/dist/mui.umd.production.min.js +0 -2
  211. package/dist/mui.umd.production.min.js.map +0 -1
package/dist/mui.esm.js CHANGED
@@ -1,57 +1,25 @@
1
- import { withTheme } from '@rjsf/core';
2
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
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
- /** The `AddButton` renders a button that represent the `Add` action on a form
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
- translateString
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
- /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
52
- *
53
- * @param props - The `ArrayFieldTemplateItemType` props for the component
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: 'bold',
45
+ fontWeight: "bold",
83
46
  minWidth: 0
84
47
  };
85
- return jsxs(Grid, {
86
- container: true,
87
- alignItems: 'center',
88
- children: [jsx(Grid, {
89
- item: true,
90
- xs: true,
91
- style: {
92
- overflow: 'auto'
93
- },
94
- children: jsx(Box, {
95
- mb: 2,
96
- children: jsx(Paper, {
97
- elevation: 2,
98
- children: jsx(Box, {
99
- p: 2,
100
- children: children
101
- })
102
- })
103
- })
104
- }), hasToolbar && jsxs(Grid, {
105
- item: true,
106
- children: [(hasMoveUp || hasMoveDown) && jsx(MoveUpButton, {
107
- style: btnStyle,
108
- disabled: disabled || readonly || !hasMoveUp,
109
- onClick: onReorderClick(index, index - 1),
110
- uiSchema: uiSchema,
111
- registry: registry
112
- }), (hasMoveUp || hasMoveDown) && jsx(MoveDownButton, {
113
- style: btnStyle,
114
- disabled: disabled || readonly || !hasMoveDown,
115
- onClick: onReorderClick(index, index + 1),
116
- uiSchema: uiSchema,
117
- registry: registry
118
- }), hasCopy && jsx(CopyButton, {
119
- style: btnStyle,
120
- disabled: disabled || readonly,
121
- onClick: onCopyIndexClick(index),
122
- uiSchema: uiSchema,
123
- registry: registry
124
- }), hasRemove && jsx(RemoveButton, {
125
- style: btnStyle,
126
- disabled: disabled || readonly,
127
- onClick: onDropIndexClick(index),
128
- uiSchema: uiSchema,
129
- registry: registry
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
- /** The `ArrayFieldTemplate` component is the template used to render all items in an array.
136
- *
137
- * @param props - The `ArrayFieldTemplateItemType` props for the component
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('ArrayFieldDescriptionTemplate', registry, uiOptions);
155
- const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
156
- const ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
157
- // Button templates are not overridden in the uiSchema
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 jsx(Paper, {
164
- elevation: 2,
165
- children: jsxs(Box, {
166
- p: 2,
167
- children: [jsx(ArrayFieldTitleTemplate, {
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: schema,
171
- uiSchema: uiSchema,
172
- required: required,
173
- registry: registry
174
- }), jsx(ArrayFieldDescriptionTemplate, {
175
- idSchema: idSchema,
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: schema,
178
- uiSchema: uiSchema,
179
- registry: registry
180
- }), jsxs(Grid, {
181
- container: true,
182
- children: [items && items.map(({
183
- key,
184
- ...itemProps
185
- }) => jsx(ArrayFieldItemTemplate, {
186
- ...itemProps
187
- }, key)), canAdd && jsx(Grid, {
188
- container: true,
189
- justifyContent: 'flex-end',
190
- children: jsx(Grid, {
191
- item: true,
192
- children: jsx(Box, {
193
- mt: 2,
194
- children: jsx(AddButton, {
195
- className: 'array-item-add',
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
- const TYPES_THAT_SHRINK_LABEL = ['date', 'datetime-local', 'file', 'time'];
210
- /** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
211
- * It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
212
- * It can be customized/overridden for other themes or individual implementations as needed.
213
- *
214
- * @param props - The `WidgetProps` for this template
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
- // Now we need to pull out the step, min, max into an inner `inputProps` for material-ui
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
- ...(schema.examples ? {
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
- target: {
264
- value
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 jsxs(Fragment, {
282
- children: [jsx(TextField, {
283
- id: id,
284
- name: id,
285
- placeholder: placeholder,
286
- label: labelValue(label || undefined, hideLabel, false),
287
- autoFocus: autofocus,
288
- required: required,
289
- disabled: disabled || readonly,
290
- ...otherProps,
291
- value: value || value === 0 ? value : '',
292
- error: rawErrors.length > 0,
293
- onChange: onChangeOverride || _onChange,
294
- onBlur: _onBlur,
295
- onFocus: _onFocus,
296
- InputLabelProps: DisplayInputLabelProps,
297
- ...textFieldProps,
298
- "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
299
- }), Array.isArray(schema.examples) && jsx("datalist", {
300
- id: examplesId(id),
301
- children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map(example => {
302
- return jsx("option", {
303
- value: example
304
- }, example);
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
- /** The `DescriptionField` is the template to use to render the description of a field
311
- *
312
- * @param props - The `DescriptionFieldProps` for this component
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 jsx(Typography, {
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
- /** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
333
- *
334
- * @param props - The `ErrorListProps` for this component
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
- translateString
342
- } = registry;
343
- return jsx(Paper, {
344
- elevation: 2,
345
- children: jsxs(Box, {
346
- mb: 2,
347
- p: 2,
348
- children: [jsx(Typography, {
349
- variant: 'h6',
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
- icon,
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 jsx(MuiIconButton, {
391
- title: translateString(TranslatableString.CopyButton),
392
- ...props,
393
- icon: jsx(CopyIcon, {
394
- fontSize: 'small'
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 jsx(MuiIconButton, {
405
- title: translateString(TranslatableString.MoveDownButton),
406
- ...props,
407
- icon: jsx(ArrowDownwardIcon, {
408
- fontSize: 'small'
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 jsx(MuiIconButton, {
419
- title: translateString(TranslatableString.MoveUpButton),
420
- ...props,
421
- icon: jsx(ArrowUpwardIcon, {
422
- fontSize: 'small'
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
- iconType,
429
- ...otherProps
430
- } = props;
431
- const {
432
- registry: {
433
- translateString
434
- }
338
+ registry: { translateString }
435
339
  } = otherProps;
436
- return jsx(MuiIconButton, {
437
- title: translateString(TranslatableString.RemoveButton),
438
- ...otherProps,
439
- color: 'error',
440
- icon: jsx(RemoveIcon, {
441
- fontSize: iconType === 'default' ? undefined : 'small'
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
- /** The `FieldErrorTemplate` component renders the errors local to the particular field
447
- *
448
- * @param props - The `FieldErrorProps` for the errors being rendered
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 jsx(List, {
460
- dense: true,
461
- disablePadding: true,
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
- /** The `FieldHelpTemplate` component renders any help desired for a field
475
- *
476
- * @param props - The `FieldHelpProps` to be rendered
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 jsx(FormHelperText, {
488
- id: id,
489
- children: help
490
- });
378
+ return /* @__PURE__ */ jsx9(FormHelperText2, { id, children: help });
491
379
  }
492
380
 
493
- /** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
494
- * content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
495
- *
496
- * @param props - The `FieldTemplateProps` for this component
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 = getUiOptions(uiSchema);
522
- const WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
412
+ const uiOptions = getUiOptions2(uiSchema);
413
+ const WrapIfAdditionalTemplate2 = getTemplate2(
414
+ "WrapIfAdditionalTemplate",
415
+ registry,
416
+ uiOptions
417
+ );
523
418
  if (hidden) {
524
- return jsx("div", {
525
- style: {
526
- display: 'none'
527
- },
528
- children: children
529
- });
419
+ return /* @__PURE__ */ jsx10("div", { style: { display: "none" }, children });
530
420
  }
531
- return jsx(WrapIfAdditionalTemplate, {
532
- classNames: classNames,
533
- style: style,
534
- disabled: disabled,
535
- id: id,
536
- label: label,
537
- onDropPropertyClick: onDropPropertyClick,
538
- onKeyChange: onKeyChange,
539
- readonly: readonly,
540
- required: required,
541
- schema: schema,
542
- uiSchema: uiSchema,
543
- registry: registry,
544
- children: jsxs(FormControl, {
545
- fullWidth: true,
546
- error: rawErrors.length ? true : false,
547
- required: required,
548
- children: [children, displayLabel && rawDescription ? jsx(Typography, {
549
- variant: 'caption',
550
- color: 'textSecondary',
551
- children: description
552
- }) : null, errors, help]
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
- /** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
558
- * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
559
- * the properties.
560
- *
561
- * @param props - The `ObjectFieldTemplateProps` for this component
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 = getUiOptions(uiSchema);
579
- const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
580
- const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
581
- // Button templates are not overridden in the uiSchema
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 jsxs(Fragment, {
588
- children: [title && jsx(TitleFieldTemplate, {
589
- id: titleId(idSchema),
590
- title: title,
591
- required: required,
592
- schema: schema,
593
- uiSchema: uiSchema,
594
- registry: registry
595
- }), description && jsx(DescriptionFieldTemplate, {
596
- id: descriptionId(idSchema),
597
- description: description,
598
- schema: schema,
599
- uiSchema: uiSchema,
600
- registry: registry
601
- }), jsxs(Grid, {
602
- container: true,
603
- spacing: 2,
604
- style: {
605
- marginTop: '10px'
606
- },
607
- children: [properties.map((element, index) =>
608
- // Remove the <Grid> if the inner element is hidden as the <Grid>
609
- // itself would otherwise still take up space.
610
- element.hidden ? element.content : jsx(Grid, {
611
- item: true,
612
- xs: 12,
613
- style: {
614
- marginBottom: '10px'
615
- },
616
- children: element.content
617
- }, index)), canExpand(schema, uiSchema, formData) && jsx(Grid, {
618
- container: true,
619
- justifyContent: 'flex-end',
620
- children: jsx(Grid, {
621
- item: true,
622
- children: jsx(AddButton, {
623
- className: 'object-property-expand',
624
- onClick: onAddClick(schema),
625
- disabled: disabled || readonly,
626
- uiSchema: uiSchema,
627
- registry: registry
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
- /** The `SubmitButton` renders a button that represent the `Submit` action on a form
636
- */
637
- function SubmitButton({
638
- uiSchema
639
- }) {
640
- const {
641
- submitText,
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 jsx(Box, {
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
- /** The `TitleField` is the template to use to render the title of a field
661
- *
662
- * @param props - The `TitleFieldProps` for this component
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 jsxs(Box, {
669
- id: id,
670
- mb: 1,
671
- mt: 1,
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
- /** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
680
- * part of an `additionalProperties` part of a schema.
681
- *
682
- * @param props - The `WrapIfAdditionalProps` for this component
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
- templates,
702
- translateString
703
- } = registry;
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: 'bold'
585
+ fontWeight: "bold"
715
586
  };
716
587
  if (!additional) {
717
- return jsx("div", {
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
- target
725
- }) => onKeyChange(target.value);
726
- return jsxs(Grid, {
727
- container: true,
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: 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 : undefined,
744
- type: 'text'
745
- })
746
- }), jsx(Grid, {
747
- item: true,
748
- xs: true,
749
- children: children
750
- }), jsx(Grid, {
751
- item: true,
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: uiSchema,
758
- registry: 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 Templates = /*#__PURE__*/generateTemplates();
645
+ var Templates_default = generateTemplates();
788
646
 
789
- /** The `CheckBoxWidget` is a widget for rendering boolean properties.
790
- * It is typically used to represent a boolean.
791
- *
792
- * @param props - The `WidgetProps` for this component
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 = getTemplate('DescriptionFieldTemplate', registry, options);
812
- // Because an unchecked checkbox will cause html5 validation to fail, only add
813
- // the "required" attribute if the field value must be "true", due to the
814
- // "const" or "enum" keywords
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
- target: {
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 jsxs(Fragment, {
829
- children: [!hideLabel && !!description && jsx(DescriptionFieldTemplate, {
830
- id: descriptionId(id),
831
- description: description,
832
- schema: schema,
833
- uiSchema: uiSchema,
834
- registry: registry
835
- }), jsx(FormControlLabel, {
836
- control: jsx(Checkbox, {
837
- id: id,
838
- name: id,
839
- checked: typeof value === 'undefined' ? false : Boolean(value),
840
- required: required,
841
- disabled: disabled || readonly,
842
- autoFocus: autofocus,
843
- onChange: _onChange,
844
- onBlur: _onBlur,
845
- onFocus: _onFocus,
846
- "aria-describedby": ariaDescribedByIds(id)
847
- }),
848
- label: labelValue(label, hideLabel, false)
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
- /** The `CheckboxesWidget` is a widget for rendering checkbox groups.
854
- * It is typically used to represent an array of enums.
855
- *
856
- * @param props - The `WidgetProps` for this component
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
- target: {
892
- value
893
- }
894
- }) => onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
895
- const _onFocus = ({
896
- target: {
897
- value
898
- }
899
- }) => onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
900
- return jsxs(Fragment, {
901
- children: [labelValue(jsx(FormLabel, {
902
- required: required,
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: 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": ariaDescribedByIds(id)
921
- });
922
- return jsx(FormControlLabel, {
923
- control: checkbox,
924
- label: option.label
925
- }, index);
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
- /** The `RadioWidget` is a widget for rendering a radio group.
932
- * It is typically used with a string property constrained with enum options.
933
- *
934
- * @param props - The `WidgetProps` for this component
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
- enumOptions,
951
- enumDisabled,
952
- emptyValue
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 jsxs(Fragment, {
968
- children: [labelValue(jsx(FormLabel, {
969
- required: required,
970
- htmlFor: id,
971
- children: label || undefined
972
- }), hideLabel), jsx(RadioGroup, {
973
- id: id,
974
- name: id,
975
- value: selectedIndex,
976
- row: row,
977
- onChange: _onChange,
978
- onBlur: _onBlur,
979
- onFocus: _onFocus,
980
- "aria-describedby": ariaDescribedByIds(id),
981
- children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
982
- const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
983
- const radio = jsx(FormControlLabel, {
984
- control: jsx(Radio, {
985
- name: id,
986
- id: optionId(id, index),
987
- color: 'primary'
988
- }),
989
- label: option.label,
990
- value: String(index),
991
- disabled: disabled || itemDisabled || readonly
992
- }, index);
993
- return radio;
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
- /** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
1000
- * in a div, with the value along side it.
1001
- *
1002
- * @param props - The `WidgetProps` for this component
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
- value,
1007
- readonly,
1008
- disabled,
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
- target: {
1031
- value
1032
- }
1033
- }) => onBlur(id, value);
1034
- const _onFocus = ({
1035
- target: {
1036
- value
1037
- }
1038
- }) => onFocus(id, value);
1039
- return jsxs(Fragment, {
1040
- children: [labelValue(jsx(FormLabel, {
1041
- required: required,
1042
- htmlFor: id,
1043
- children: label || undefined
1044
- }), hideLabel), jsx(Slider, {
1045
- disabled: disabled || readonly,
1046
- onChange: _onChange,
1047
- onBlur: _onBlur,
1048
- onFocus: _onFocus,
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
- /** The `SelectWidget` is a widget for rendering dropdowns.
1057
- * It is typically used with string properties constrained with enum options.
1058
- *
1059
- * @param props - The `WidgetProps` for this component
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
- enumOptions,
1088
- enumDisabled,
1089
- emptyValue: optEmptyVal
1090
- } = options;
1091
- multiple = typeof multiple === 'undefined' ? false : !!multiple;
1092
- const emptyValue = multiple ? [] : '';
1093
- const isEmpty = typeof value === 'undefined' || multiple && value.length < 1 || !multiple && value === emptyValue;
1094
- const _onChange = ({
1095
- target: {
1096
- value
1097
- }
1098
- }) => onChange(enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
1099
- const _onBlur = ({
1100
- target: {
1101
- value
1102
- }
1103
- }) => onBlur(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
1104
- const _onFocus = ({
1105
- target: {
1106
- value
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
- }) => onFocus(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
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
- /** The `TextareaWidget` is a widget for rendering input fields as textarea.
1150
- *
1151
- * @param props - The `WidgetProps` for this component
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
- options,
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 === 'string' || typeof options.rows === 'number') {
975
+ if (typeof options.rows === "string" || typeof options.rows === "number") {
1161
976
  rows = options.rows;
1162
977
  }
1163
- return jsx(BaseInputTemplate, {
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 Widgets = /*#__PURE__*/generateWidgets();
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 Theme = /*#__PURE__*/generateTheme();
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 MuiForm = /*#__PURE__*/generateForm();
1007
+ var MuiForm_default = generateForm();
1194
1008
 
1195
- export { MuiForm as Form, Templates, Theme, Widgets, MuiForm as default, generateForm, generateTemplates, generateTheme, generateWidgets };
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