@rjsf/mui 5.11.2 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/index.js
CHANGED
|
@@ -1,8 +1,1006 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
29
|
|
|
2
|
-
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
Form: () => MuiForm_default,
|
|
34
|
+
Templates: () => Templates_default,
|
|
35
|
+
Theme: () => Theme_default,
|
|
36
|
+
Widgets: () => Widgets_default,
|
|
37
|
+
default: () => src_default,
|
|
38
|
+
generateForm: () => generateForm,
|
|
39
|
+
generateTemplates: () => generateTemplates,
|
|
40
|
+
generateTheme: () => generateTheme,
|
|
41
|
+
generateWidgets: () => generateWidgets
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(src_exports);
|
|
3
44
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
45
|
+
// src/MuiForm/MuiForm.tsx
|
|
46
|
+
var import_core = require("@rjsf/core");
|
|
47
|
+
|
|
48
|
+
// src/AddButton/AddButton.tsx
|
|
49
|
+
var import_Add = __toESM(require("@mui/icons-material/Add"));
|
|
50
|
+
var import_IconButton = __toESM(require("@mui/material/IconButton"));
|
|
51
|
+
var import_utils = require("@rjsf/utils");
|
|
52
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
|
+
function AddButton({
|
|
54
|
+
uiSchema,
|
|
55
|
+
registry,
|
|
56
|
+
...props
|
|
57
|
+
}) {
|
|
58
|
+
const { translateString } = registry;
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_IconButton.default, { title: translateString(import_utils.TranslatableString.AddItemButton), ...props, color: "primary", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Add.default, {}) });
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
|
|
63
|
+
var import_Box = __toESM(require("@mui/material/Box"));
|
|
64
|
+
var import_Grid = __toESM(require("@mui/material/Grid"));
|
|
65
|
+
var import_Paper = __toESM(require("@mui/material/Paper"));
|
|
66
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
67
|
+
function ArrayFieldItemTemplate(props) {
|
|
68
|
+
const {
|
|
69
|
+
children,
|
|
70
|
+
disabled,
|
|
71
|
+
hasToolbar,
|
|
72
|
+
hasCopy,
|
|
73
|
+
hasMoveDown,
|
|
74
|
+
hasMoveUp,
|
|
75
|
+
hasRemove,
|
|
76
|
+
index,
|
|
77
|
+
onCopyIndexClick,
|
|
78
|
+
onDropIndexClick,
|
|
79
|
+
onReorderClick,
|
|
80
|
+
readonly,
|
|
81
|
+
uiSchema,
|
|
82
|
+
registry
|
|
83
|
+
} = props;
|
|
84
|
+
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
85
|
+
const btnStyle = {
|
|
86
|
+
flex: 1,
|
|
87
|
+
paddingLeft: 6,
|
|
88
|
+
paddingRight: 6,
|
|
89
|
+
fontWeight: "bold",
|
|
90
|
+
minWidth: 0
|
|
91
|
+
};
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_Grid.default, { container: true, alignItems: "center", children: [
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Grid.default, { item: true, xs: true, style: { overflow: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Box.default, { mb: 2, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Paper.default, { elevation: 2, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Box.default, { p: 2, children }) }) }) }),
|
|
94
|
+
hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_Grid.default, { item: true, children: [
|
|
95
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
96
|
+
MoveUpButton2,
|
|
97
|
+
{
|
|
98
|
+
style: btnStyle,
|
|
99
|
+
disabled: disabled || readonly || !hasMoveUp,
|
|
100
|
+
onClick: onReorderClick(index, index - 1),
|
|
101
|
+
uiSchema,
|
|
102
|
+
registry
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
106
|
+
MoveDownButton2,
|
|
107
|
+
{
|
|
108
|
+
style: btnStyle,
|
|
109
|
+
disabled: disabled || readonly || !hasMoveDown,
|
|
110
|
+
onClick: onReorderClick(index, index + 1),
|
|
111
|
+
uiSchema,
|
|
112
|
+
registry
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
hasCopy && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
116
|
+
CopyButton2,
|
|
117
|
+
{
|
|
118
|
+
style: btnStyle,
|
|
119
|
+
disabled: disabled || readonly,
|
|
120
|
+
onClick: onCopyIndexClick(index),
|
|
121
|
+
uiSchema,
|
|
122
|
+
registry
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
hasRemove && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
126
|
+
RemoveButton2,
|
|
127
|
+
{
|
|
128
|
+
style: btnStyle,
|
|
129
|
+
disabled: disabled || readonly,
|
|
130
|
+
onClick: onDropIndexClick(index),
|
|
131
|
+
uiSchema,
|
|
132
|
+
registry
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] })
|
|
136
|
+
] });
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// src/ArrayFieldTemplate/ArrayFieldTemplate.tsx
|
|
140
|
+
var import_Box2 = __toESM(require("@mui/material/Box"));
|
|
141
|
+
var import_Grid2 = __toESM(require("@mui/material/Grid"));
|
|
142
|
+
var import_Paper2 = __toESM(require("@mui/material/Paper"));
|
|
143
|
+
var import_utils2 = require("@rjsf/utils");
|
|
144
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
145
|
+
function ArrayFieldTemplate(props) {
|
|
146
|
+
const { canAdd, disabled, idSchema, uiSchema, items, onAddClick, readonly, registry, required, schema, title } = props;
|
|
147
|
+
const uiOptions = (0, import_utils2.getUiOptions)(uiSchema);
|
|
148
|
+
const ArrayFieldDescriptionTemplate = (0, import_utils2.getTemplate)(
|
|
149
|
+
"ArrayFieldDescriptionTemplate",
|
|
150
|
+
registry,
|
|
151
|
+
uiOptions
|
|
152
|
+
);
|
|
153
|
+
const ArrayFieldItemTemplate2 = (0, import_utils2.getTemplate)(
|
|
154
|
+
"ArrayFieldItemTemplate",
|
|
155
|
+
registry,
|
|
156
|
+
uiOptions
|
|
157
|
+
);
|
|
158
|
+
const ArrayFieldTitleTemplate = (0, import_utils2.getTemplate)(
|
|
159
|
+
"ArrayFieldTitleTemplate",
|
|
160
|
+
registry,
|
|
161
|
+
uiOptions
|
|
162
|
+
);
|
|
163
|
+
const {
|
|
164
|
+
ButtonTemplates: { AddButton: AddButton2 }
|
|
165
|
+
} = registry.templates;
|
|
166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Paper2.default, { elevation: 2, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_Box2.default, { p: 2, children: [
|
|
167
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
168
|
+
ArrayFieldTitleTemplate,
|
|
169
|
+
{
|
|
170
|
+
idSchema,
|
|
171
|
+
title: uiOptions.title || title,
|
|
172
|
+
schema,
|
|
173
|
+
uiSchema,
|
|
174
|
+
required,
|
|
175
|
+
registry
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
179
|
+
ArrayFieldDescriptionTemplate,
|
|
180
|
+
{
|
|
181
|
+
idSchema,
|
|
182
|
+
description: uiOptions.description || schema.description,
|
|
183
|
+
schema,
|
|
184
|
+
uiSchema,
|
|
185
|
+
registry
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_Grid2.default, { container: true, children: [
|
|
189
|
+
items && items.map(({ key, ...itemProps }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrayFieldItemTemplate2, { ...itemProps }, key)),
|
|
190
|
+
canAdd && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Grid2.default, { container: true, justifyContent: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Grid2.default, { item: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Box2.default, { mt: 2, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
191
|
+
AddButton2,
|
|
192
|
+
{
|
|
193
|
+
className: "array-item-add",
|
|
194
|
+
onClick: onAddClick,
|
|
195
|
+
disabled: disabled || readonly,
|
|
196
|
+
uiSchema,
|
|
197
|
+
registry
|
|
198
|
+
}
|
|
199
|
+
) }) }) })
|
|
200
|
+
] }, `array-item-list-${idSchema.$id}`)
|
|
201
|
+
] }) });
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
205
|
+
var import_TextField = __toESM(require("@mui/material/TextField"));
|
|
206
|
+
var import_utils3 = require("@rjsf/utils");
|
|
207
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
208
|
+
var TYPES_THAT_SHRINK_LABEL = ["date", "datetime-local", "file", "time"];
|
|
209
|
+
function BaseInputTemplate(props) {
|
|
210
|
+
const {
|
|
211
|
+
id,
|
|
212
|
+
name,
|
|
213
|
+
// remove this from textFieldProps
|
|
214
|
+
placeholder,
|
|
215
|
+
required,
|
|
216
|
+
readonly,
|
|
217
|
+
disabled,
|
|
218
|
+
type,
|
|
219
|
+
label,
|
|
220
|
+
hideLabel,
|
|
221
|
+
value,
|
|
222
|
+
onChange,
|
|
223
|
+
onChangeOverride,
|
|
224
|
+
onBlur,
|
|
225
|
+
onFocus,
|
|
226
|
+
autofocus,
|
|
227
|
+
options,
|
|
228
|
+
schema,
|
|
229
|
+
uiSchema,
|
|
230
|
+
rawErrors = [],
|
|
231
|
+
formContext,
|
|
232
|
+
registry,
|
|
233
|
+
InputLabelProps,
|
|
234
|
+
...textFieldProps
|
|
235
|
+
} = props;
|
|
236
|
+
const inputProps = (0, import_utils3.getInputProps)(schema, type, options);
|
|
237
|
+
const { step, min, max, ...rest } = inputProps;
|
|
238
|
+
const otherProps = {
|
|
239
|
+
inputProps: {
|
|
240
|
+
step,
|
|
241
|
+
min,
|
|
242
|
+
max,
|
|
243
|
+
...schema.examples ? { list: (0, import_utils3.examplesId)(id) } : void 0
|
|
244
|
+
},
|
|
245
|
+
...rest
|
|
246
|
+
};
|
|
247
|
+
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
248
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
|
|
249
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
|
|
250
|
+
const DisplayInputLabelProps = TYPES_THAT_SHRINK_LABEL.includes(type) ? {
|
|
251
|
+
...InputLabelProps,
|
|
252
|
+
shrink: true
|
|
253
|
+
} : InputLabelProps;
|
|
254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
256
|
+
import_TextField.default,
|
|
257
|
+
{
|
|
258
|
+
id,
|
|
259
|
+
name: id,
|
|
260
|
+
placeholder,
|
|
261
|
+
label: (0, import_utils3.labelValue)(label || void 0, hideLabel, false),
|
|
262
|
+
autoFocus: autofocus,
|
|
263
|
+
required,
|
|
264
|
+
disabled: disabled || readonly,
|
|
265
|
+
...otherProps,
|
|
266
|
+
value: value || value === 0 ? value : "",
|
|
267
|
+
error: rawErrors.length > 0,
|
|
268
|
+
onChange: onChangeOverride || _onChange,
|
|
269
|
+
onBlur: _onBlur,
|
|
270
|
+
onFocus: _onFocus,
|
|
271
|
+
InputLabelProps: DisplayInputLabelProps,
|
|
272
|
+
...textFieldProps,
|
|
273
|
+
"aria-describedby": (0, import_utils3.ariaDescribedByIds)(id, !!schema.examples)
|
|
274
|
+
}
|
|
275
|
+
),
|
|
276
|
+
Array.isArray(schema.examples) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("datalist", { id: (0, import_utils3.examplesId)(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
|
|
277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: example }, example);
|
|
278
|
+
}) })
|
|
279
|
+
] });
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// src/DescriptionField/DescriptionField.tsx
|
|
283
|
+
var import_Typography = __toESM(require("@mui/material/Typography"));
|
|
284
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
285
|
+
function DescriptionField(props) {
|
|
286
|
+
const { id, description } = props;
|
|
287
|
+
if (description) {
|
|
288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Typography.default, { id, variant: "subtitle2", style: { marginTop: "5px" }, children: description });
|
|
289
|
+
}
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// src/ErrorList/ErrorList.tsx
|
|
294
|
+
var import_Error = __toESM(require("@mui/icons-material/Error"));
|
|
295
|
+
var import_Box3 = __toESM(require("@mui/material/Box"));
|
|
296
|
+
var import_List = __toESM(require("@mui/material/List"));
|
|
297
|
+
var import_ListItem = __toESM(require("@mui/material/ListItem"));
|
|
298
|
+
var import_ListItemIcon = __toESM(require("@mui/material/ListItemIcon"));
|
|
299
|
+
var import_ListItemText = __toESM(require("@mui/material/ListItemText"));
|
|
300
|
+
var import_Paper3 = __toESM(require("@mui/material/Paper"));
|
|
301
|
+
var import_Typography2 = __toESM(require("@mui/material/Typography"));
|
|
302
|
+
var import_utils4 = require("@rjsf/utils");
|
|
303
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
304
|
+
function ErrorList({
|
|
305
|
+
errors,
|
|
306
|
+
registry
|
|
307
|
+
}) {
|
|
308
|
+
const { translateString } = registry;
|
|
309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Paper3.default, { elevation: 2, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box3.default, { mb: 2, p: 2, children: [
|
|
310
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Typography2.default, { variant: "h6", children: translateString(import_utils4.TranslatableString.ErrorsLabel) }),
|
|
311
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_List.default, { dense: true, children: errors.map((error, i) => {
|
|
312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_ListItem.default, { children: [
|
|
313
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ListItemIcon.default, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Error.default, { color: "error" }) }),
|
|
314
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ListItemText.default, { primary: error.stack })
|
|
315
|
+
] }, i);
|
|
316
|
+
}) })
|
|
317
|
+
] }) });
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// src/IconButton/IconButton.tsx
|
|
321
|
+
var import_IconButton2 = __toESM(require("@mui/material/IconButton"));
|
|
322
|
+
var import_ArrowDownward = __toESM(require("@mui/icons-material/ArrowDownward"));
|
|
323
|
+
var import_ArrowUpward = __toESM(require("@mui/icons-material/ArrowUpward"));
|
|
324
|
+
var import_ContentCopy = __toESM(require("@mui/icons-material/ContentCopy"));
|
|
325
|
+
var import_Remove = __toESM(require("@mui/icons-material/Remove"));
|
|
326
|
+
var import_utils5 = require("@rjsf/utils");
|
|
327
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
328
|
+
function MuiIconButton(props) {
|
|
329
|
+
const { icon, color, uiSchema, registry, ...otherProps } = props;
|
|
330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_IconButton2.default, { ...otherProps, size: "small", color, children: icon });
|
|
331
|
+
}
|
|
332
|
+
function CopyButton(props) {
|
|
333
|
+
const {
|
|
334
|
+
registry: { translateString }
|
|
335
|
+
} = props;
|
|
336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
337
|
+
MuiIconButton,
|
|
338
|
+
{
|
|
339
|
+
title: translateString(import_utils5.TranslatableString.CopyButton),
|
|
340
|
+
...props,
|
|
341
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ContentCopy.default, { fontSize: "small" })
|
|
342
|
+
}
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
function MoveDownButton(props) {
|
|
346
|
+
const {
|
|
347
|
+
registry: { translateString }
|
|
348
|
+
} = props;
|
|
349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
350
|
+
MuiIconButton,
|
|
351
|
+
{
|
|
352
|
+
title: translateString(import_utils5.TranslatableString.MoveDownButton),
|
|
353
|
+
...props,
|
|
354
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ArrowDownward.default, { fontSize: "small" })
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
function MoveUpButton(props) {
|
|
359
|
+
const {
|
|
360
|
+
registry: { translateString }
|
|
361
|
+
} = props;
|
|
362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
363
|
+
MuiIconButton,
|
|
364
|
+
{
|
|
365
|
+
title: translateString(import_utils5.TranslatableString.MoveUpButton),
|
|
366
|
+
...props,
|
|
367
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ArrowUpward.default, { fontSize: "small" })
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
function RemoveButton(props) {
|
|
372
|
+
const { iconType, ...otherProps } = props;
|
|
373
|
+
const {
|
|
374
|
+
registry: { translateString }
|
|
375
|
+
} = otherProps;
|
|
376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
377
|
+
MuiIconButton,
|
|
378
|
+
{
|
|
379
|
+
title: translateString(import_utils5.TranslatableString.RemoveButton),
|
|
380
|
+
...otherProps,
|
|
381
|
+
color: "error",
|
|
382
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Remove.default, { fontSize: iconType === "default" ? void 0 : "small" })
|
|
383
|
+
}
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
388
|
+
var import_ListItem2 = __toESM(require("@mui/material/ListItem"));
|
|
389
|
+
var import_FormHelperText = __toESM(require("@mui/material/FormHelperText"));
|
|
390
|
+
var import_List2 = __toESM(require("@mui/material/List"));
|
|
391
|
+
var import_utils6 = require("@rjsf/utils");
|
|
392
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
393
|
+
function FieldErrorTemplate(props) {
|
|
394
|
+
const { errors = [], idSchema } = props;
|
|
395
|
+
if (errors.length === 0) {
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
const id = (0, import_utils6.errorId)(idSchema);
|
|
399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_List2.default, { dense: true, disablePadding: true, children: errors.map((error, i) => {
|
|
400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ListItem2.default, { disableGutters: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_FormHelperText.default, { id, children: error }) }, i);
|
|
401
|
+
}) });
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
405
|
+
var import_FormHelperText2 = __toESM(require("@mui/material/FormHelperText"));
|
|
406
|
+
var import_utils7 = require("@rjsf/utils");
|
|
407
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
408
|
+
function FieldHelpTemplate(props) {
|
|
409
|
+
const { idSchema, help } = props;
|
|
410
|
+
if (!help) {
|
|
411
|
+
return null;
|
|
412
|
+
}
|
|
413
|
+
const id = (0, import_utils7.helpId)(idSchema);
|
|
414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_FormHelperText2.default, { id, children: help });
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// src/FieldTemplate/FieldTemplate.tsx
|
|
418
|
+
var import_FormControl = __toESM(require("@mui/material/FormControl"));
|
|
419
|
+
var import_Typography3 = __toESM(require("@mui/material/Typography"));
|
|
420
|
+
var import_utils8 = require("@rjsf/utils");
|
|
421
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
422
|
+
function FieldTemplate(props) {
|
|
423
|
+
const {
|
|
424
|
+
id,
|
|
425
|
+
children,
|
|
426
|
+
classNames,
|
|
427
|
+
style,
|
|
428
|
+
disabled,
|
|
429
|
+
displayLabel,
|
|
430
|
+
hidden,
|
|
431
|
+
label,
|
|
432
|
+
onDropPropertyClick,
|
|
433
|
+
onKeyChange,
|
|
434
|
+
readonly,
|
|
435
|
+
required,
|
|
436
|
+
rawErrors = [],
|
|
437
|
+
errors,
|
|
438
|
+
help,
|
|
439
|
+
description,
|
|
440
|
+
rawDescription,
|
|
441
|
+
schema,
|
|
442
|
+
uiSchema,
|
|
443
|
+
registry
|
|
444
|
+
} = props;
|
|
445
|
+
const uiOptions = (0, import_utils8.getUiOptions)(uiSchema);
|
|
446
|
+
const WrapIfAdditionalTemplate2 = (0, import_utils8.getTemplate)(
|
|
447
|
+
"WrapIfAdditionalTemplate",
|
|
448
|
+
registry,
|
|
449
|
+
uiOptions
|
|
450
|
+
);
|
|
451
|
+
if (hidden) {
|
|
452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { display: "none" }, children });
|
|
453
|
+
}
|
|
454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
455
|
+
WrapIfAdditionalTemplate2,
|
|
456
|
+
{
|
|
457
|
+
classNames,
|
|
458
|
+
style,
|
|
459
|
+
disabled,
|
|
460
|
+
id,
|
|
461
|
+
label,
|
|
462
|
+
onDropPropertyClick,
|
|
463
|
+
onKeyChange,
|
|
464
|
+
readonly,
|
|
465
|
+
required,
|
|
466
|
+
schema,
|
|
467
|
+
uiSchema,
|
|
468
|
+
registry,
|
|
469
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_FormControl.default, { fullWidth: true, error: rawErrors.length ? true : false, required, children: [
|
|
470
|
+
children,
|
|
471
|
+
displayLabel && rawDescription ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_Typography3.default, { variant: "caption", color: "textSecondary", children: description }) : null,
|
|
472
|
+
errors,
|
|
473
|
+
help
|
|
474
|
+
] })
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
480
|
+
var import_Grid3 = __toESM(require("@mui/material/Grid"));
|
|
481
|
+
var import_utils9 = require("@rjsf/utils");
|
|
482
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
483
|
+
function ObjectFieldTemplate(props) {
|
|
484
|
+
const {
|
|
485
|
+
description,
|
|
486
|
+
title,
|
|
487
|
+
properties,
|
|
488
|
+
required,
|
|
489
|
+
disabled,
|
|
490
|
+
readonly,
|
|
491
|
+
uiSchema,
|
|
492
|
+
idSchema,
|
|
493
|
+
schema,
|
|
494
|
+
formData,
|
|
495
|
+
onAddClick,
|
|
496
|
+
registry
|
|
497
|
+
} = props;
|
|
498
|
+
const uiOptions = (0, import_utils9.getUiOptions)(uiSchema);
|
|
499
|
+
const TitleFieldTemplate = (0, import_utils9.getTemplate)("TitleFieldTemplate", registry, uiOptions);
|
|
500
|
+
const DescriptionFieldTemplate = (0, import_utils9.getTemplate)(
|
|
501
|
+
"DescriptionFieldTemplate",
|
|
502
|
+
registry,
|
|
503
|
+
uiOptions
|
|
504
|
+
);
|
|
505
|
+
const {
|
|
506
|
+
ButtonTemplates: { AddButton: AddButton2 }
|
|
507
|
+
} = registry.templates;
|
|
508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
509
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
510
|
+
TitleFieldTemplate,
|
|
511
|
+
{
|
|
512
|
+
id: (0, import_utils9.titleId)(idSchema),
|
|
513
|
+
title,
|
|
514
|
+
required,
|
|
515
|
+
schema,
|
|
516
|
+
uiSchema,
|
|
517
|
+
registry
|
|
518
|
+
}
|
|
519
|
+
),
|
|
520
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
521
|
+
DescriptionFieldTemplate,
|
|
522
|
+
{
|
|
523
|
+
id: (0, import_utils9.descriptionId)(idSchema),
|
|
524
|
+
description,
|
|
525
|
+
schema,
|
|
526
|
+
uiSchema,
|
|
527
|
+
registry
|
|
528
|
+
}
|
|
529
|
+
),
|
|
530
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_Grid3.default, { container: true, spacing: 2, style: { marginTop: "10px" }, children: [
|
|
531
|
+
properties.map(
|
|
532
|
+
(element, index) => (
|
|
533
|
+
// Remove the <Grid> if the inner element is hidden as the <Grid>
|
|
534
|
+
// itself would otherwise still take up space.
|
|
535
|
+
element.hidden ? element.content : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Grid3.default, { item: true, xs: 12, style: { marginBottom: "10px" }, children: element.content }, index)
|
|
536
|
+
)
|
|
537
|
+
),
|
|
538
|
+
(0, import_utils9.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Grid3.default, { container: true, justifyContent: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Grid3.default, { item: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
539
|
+
AddButton2,
|
|
540
|
+
{
|
|
541
|
+
className: "object-property-expand",
|
|
542
|
+
onClick: onAddClick(schema),
|
|
543
|
+
disabled: disabled || readonly,
|
|
544
|
+
uiSchema,
|
|
545
|
+
registry
|
|
546
|
+
}
|
|
547
|
+
) }) })
|
|
548
|
+
] })
|
|
549
|
+
] });
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// src/SubmitButton/SubmitButton.tsx
|
|
553
|
+
var import_Box4 = __toESM(require("@mui/material/Box"));
|
|
554
|
+
var import_Button = __toESM(require("@mui/material/Button"));
|
|
555
|
+
var import_utils10 = require("@rjsf/utils");
|
|
556
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
557
|
+
function SubmitButton({ uiSchema }) {
|
|
558
|
+
const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils10.getSubmitButtonOptions)(uiSchema);
|
|
559
|
+
if (norender) {
|
|
560
|
+
return null;
|
|
561
|
+
}
|
|
562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_Box4.default, { marginTop: 3, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_Button.default, { type: "submit", variant: "contained", color: "primary", ...submitButtonProps, children: submitText }) });
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
// src/TitleField/TitleField.tsx
|
|
566
|
+
var import_Box5 = __toESM(require("@mui/material/Box"));
|
|
567
|
+
var import_Divider = __toESM(require("@mui/material/Divider"));
|
|
568
|
+
var import_Typography4 = __toESM(require("@mui/material/Typography"));
|
|
569
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
570
|
+
function TitleField({
|
|
571
|
+
id,
|
|
572
|
+
title
|
|
573
|
+
}) {
|
|
574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_Box5.default, { id, mb: 1, mt: 1, children: [
|
|
575
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_Typography4.default, { variant: "h5", children: title }),
|
|
576
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_Divider.default, {})
|
|
577
|
+
] });
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
581
|
+
var import_Grid4 = __toESM(require("@mui/material/Grid"));
|
|
582
|
+
var import_TextField2 = __toESM(require("@mui/material/TextField"));
|
|
583
|
+
var import_utils11 = require("@rjsf/utils");
|
|
584
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
585
|
+
function WrapIfAdditionalTemplate(props) {
|
|
586
|
+
const {
|
|
587
|
+
children,
|
|
588
|
+
classNames,
|
|
589
|
+
style,
|
|
590
|
+
disabled,
|
|
591
|
+
id,
|
|
592
|
+
label,
|
|
593
|
+
onDropPropertyClick,
|
|
594
|
+
onKeyChange,
|
|
595
|
+
readonly,
|
|
596
|
+
required,
|
|
597
|
+
schema,
|
|
598
|
+
uiSchema,
|
|
599
|
+
registry
|
|
600
|
+
} = props;
|
|
601
|
+
const { templates, translateString } = registry;
|
|
602
|
+
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
603
|
+
const keyLabel = translateString(import_utils11.TranslatableString.KeyLabel, [label]);
|
|
604
|
+
const additional = import_utils11.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
605
|
+
const btnStyle = {
|
|
606
|
+
flex: 1,
|
|
607
|
+
paddingLeft: 6,
|
|
608
|
+
paddingRight: 6,
|
|
609
|
+
fontWeight: "bold"
|
|
610
|
+
};
|
|
611
|
+
if (!additional) {
|
|
612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: classNames, style, children });
|
|
613
|
+
}
|
|
614
|
+
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_Grid4.default, { container: true, alignItems: "center", spacing: 2, className: classNames, style, children: [
|
|
616
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_Grid4.default, { item: true, xs: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
617
|
+
import_TextField2.default,
|
|
618
|
+
{
|
|
619
|
+
fullWidth: true,
|
|
620
|
+
required,
|
|
621
|
+
label: keyLabel,
|
|
622
|
+
defaultValue: label,
|
|
623
|
+
disabled: disabled || readonly,
|
|
624
|
+
id: `${id}-key`,
|
|
625
|
+
name: `${id}-key`,
|
|
626
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
627
|
+
type: "text"
|
|
628
|
+
}
|
|
629
|
+
) }),
|
|
630
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_Grid4.default, { item: true, xs: true, children }),
|
|
631
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_Grid4.default, { item: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
632
|
+
RemoveButton2,
|
|
633
|
+
{
|
|
634
|
+
iconType: "default",
|
|
635
|
+
style: btnStyle,
|
|
636
|
+
disabled: disabled || readonly,
|
|
637
|
+
onClick: onDropPropertyClick(label),
|
|
638
|
+
uiSchema,
|
|
639
|
+
registry
|
|
640
|
+
}
|
|
641
|
+
) })
|
|
642
|
+
] }, `${id}-key`);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
// src/Templates/Templates.ts
|
|
646
|
+
function generateTemplates() {
|
|
647
|
+
return {
|
|
648
|
+
ArrayFieldItemTemplate,
|
|
649
|
+
ArrayFieldTemplate,
|
|
650
|
+
BaseInputTemplate,
|
|
651
|
+
ButtonTemplates: {
|
|
652
|
+
AddButton,
|
|
653
|
+
CopyButton,
|
|
654
|
+
MoveDownButton,
|
|
655
|
+
MoveUpButton,
|
|
656
|
+
RemoveButton,
|
|
657
|
+
SubmitButton
|
|
658
|
+
},
|
|
659
|
+
DescriptionFieldTemplate: DescriptionField,
|
|
660
|
+
ErrorListTemplate: ErrorList,
|
|
661
|
+
FieldErrorTemplate,
|
|
662
|
+
FieldHelpTemplate,
|
|
663
|
+
FieldTemplate,
|
|
664
|
+
ObjectFieldTemplate,
|
|
665
|
+
TitleFieldTemplate: TitleField,
|
|
666
|
+
WrapIfAdditionalTemplate
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
var Templates_default = generateTemplates();
|
|
670
|
+
|
|
671
|
+
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
672
|
+
var import_Checkbox = __toESM(require("@mui/material/Checkbox"));
|
|
673
|
+
var import_FormControlLabel = __toESM(require("@mui/material/FormControlLabel"));
|
|
674
|
+
var import_utils12 = require("@rjsf/utils");
|
|
675
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
676
|
+
function CheckboxWidget(props) {
|
|
677
|
+
const {
|
|
678
|
+
schema,
|
|
679
|
+
id,
|
|
680
|
+
value,
|
|
681
|
+
disabled,
|
|
682
|
+
readonly,
|
|
683
|
+
label = "",
|
|
684
|
+
hideLabel,
|
|
685
|
+
autofocus,
|
|
686
|
+
onChange,
|
|
687
|
+
onBlur,
|
|
688
|
+
onFocus,
|
|
689
|
+
registry,
|
|
690
|
+
options,
|
|
691
|
+
uiSchema
|
|
692
|
+
} = props;
|
|
693
|
+
const DescriptionFieldTemplate = (0, import_utils12.getTemplate)(
|
|
694
|
+
"DescriptionFieldTemplate",
|
|
695
|
+
registry,
|
|
696
|
+
options
|
|
697
|
+
);
|
|
698
|
+
const required = (0, import_utils12.schemaRequiresTrueValue)(schema);
|
|
699
|
+
const _onChange = (_, checked) => onChange(checked);
|
|
700
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
|
|
701
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
|
|
702
|
+
const description = options.description ?? schema.description;
|
|
703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
704
|
+
!hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
705
|
+
DescriptionFieldTemplate,
|
|
706
|
+
{
|
|
707
|
+
id: (0, import_utils12.descriptionId)(id),
|
|
708
|
+
description,
|
|
709
|
+
schema,
|
|
710
|
+
uiSchema,
|
|
711
|
+
registry
|
|
712
|
+
}
|
|
713
|
+
),
|
|
714
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
715
|
+
import_FormControlLabel.default,
|
|
716
|
+
{
|
|
717
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
718
|
+
import_Checkbox.default,
|
|
719
|
+
{
|
|
720
|
+
id,
|
|
721
|
+
name: id,
|
|
722
|
+
checked: typeof value === "undefined" ? false : Boolean(value),
|
|
723
|
+
required,
|
|
724
|
+
disabled: disabled || readonly,
|
|
725
|
+
autoFocus: autofocus,
|
|
726
|
+
onChange: _onChange,
|
|
727
|
+
onBlur: _onBlur,
|
|
728
|
+
onFocus: _onFocus,
|
|
729
|
+
"aria-describedby": (0, import_utils12.ariaDescribedByIds)(id)
|
|
730
|
+
}
|
|
731
|
+
),
|
|
732
|
+
label: (0, import_utils12.labelValue)(label, hideLabel, false)
|
|
733
|
+
}
|
|
734
|
+
)
|
|
735
|
+
] });
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
739
|
+
var import_Checkbox2 = __toESM(require("@mui/material/Checkbox"));
|
|
740
|
+
var import_FormControlLabel2 = __toESM(require("@mui/material/FormControlLabel"));
|
|
741
|
+
var import_FormGroup = __toESM(require("@mui/material/FormGroup"));
|
|
742
|
+
var import_FormLabel = __toESM(require("@mui/material/FormLabel"));
|
|
743
|
+
var import_utils13 = require("@rjsf/utils");
|
|
744
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
745
|
+
function CheckboxesWidget({
|
|
746
|
+
label,
|
|
747
|
+
hideLabel,
|
|
748
|
+
id,
|
|
749
|
+
disabled,
|
|
750
|
+
options,
|
|
751
|
+
value,
|
|
752
|
+
autofocus,
|
|
753
|
+
readonly,
|
|
754
|
+
required,
|
|
755
|
+
onChange,
|
|
756
|
+
onBlur,
|
|
757
|
+
onFocus
|
|
758
|
+
}) {
|
|
759
|
+
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
760
|
+
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
761
|
+
const _onChange = (index) => ({ target: { checked } }) => {
|
|
762
|
+
if (checked) {
|
|
763
|
+
onChange((0, import_utils13.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
|
|
764
|
+
} else {
|
|
765
|
+
onChange((0, import_utils13.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, (0, import_utils13.enumOptionsValueForIndex)(value2, enumOptions, emptyValue));
|
|
769
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, (0, import_utils13.enumOptionsValueForIndex)(value2, enumOptions, emptyValue));
|
|
770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
771
|
+
(0, import_utils13.labelValue)(
|
|
772
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_FormLabel.default, { required, htmlFor: id, children: label || void 0 }),
|
|
773
|
+
hideLabel
|
|
774
|
+
),
|
|
775
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_FormGroup.default, { id, row: !!inline, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
776
|
+
const checked = (0, import_utils13.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
777
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
778
|
+
const checkbox = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
779
|
+
import_Checkbox2.default,
|
|
780
|
+
{
|
|
781
|
+
id: (0, import_utils13.optionId)(id, index),
|
|
782
|
+
name: id,
|
|
783
|
+
checked,
|
|
784
|
+
disabled: disabled || itemDisabled || readonly,
|
|
785
|
+
autoFocus: autofocus && index === 0,
|
|
786
|
+
onChange: _onChange(index),
|
|
787
|
+
onBlur: _onBlur,
|
|
788
|
+
onFocus: _onFocus,
|
|
789
|
+
"aria-describedby": (0, import_utils13.ariaDescribedByIds)(id)
|
|
790
|
+
}
|
|
791
|
+
);
|
|
792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_FormControlLabel2.default, { control: checkbox, label: option.label }, index);
|
|
793
|
+
}) })
|
|
794
|
+
] });
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
// src/RadioWidget/RadioWidget.tsx
|
|
798
|
+
var import_FormControlLabel3 = __toESM(require("@mui/material/FormControlLabel"));
|
|
799
|
+
var import_FormLabel2 = __toESM(require("@mui/material/FormLabel"));
|
|
800
|
+
var import_Radio = __toESM(require("@mui/material/Radio"));
|
|
801
|
+
var import_RadioGroup = __toESM(require("@mui/material/RadioGroup"));
|
|
802
|
+
var import_utils14 = require("@rjsf/utils");
|
|
803
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
804
|
+
function RadioWidget({
|
|
805
|
+
id,
|
|
806
|
+
options,
|
|
807
|
+
value,
|
|
808
|
+
required,
|
|
809
|
+
disabled,
|
|
810
|
+
readonly,
|
|
811
|
+
label,
|
|
812
|
+
hideLabel,
|
|
813
|
+
onChange,
|
|
814
|
+
onBlur,
|
|
815
|
+
onFocus
|
|
816
|
+
}) {
|
|
817
|
+
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
818
|
+
const _onChange = (_, value2) => onChange((0, import_utils14.enumOptionsValueForIndex)(value2, enumOptions, emptyValue));
|
|
819
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, (0, import_utils14.enumOptionsValueForIndex)(value2, enumOptions, emptyValue));
|
|
820
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, (0, import_utils14.enumOptionsValueForIndex)(value2, enumOptions, emptyValue));
|
|
821
|
+
const row = options ? options.inline : false;
|
|
822
|
+
const selectedIndex = (0, import_utils14.enumOptionsIndexForValue)(value, enumOptions) ?? null;
|
|
823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
824
|
+
(0, import_utils14.labelValue)(
|
|
825
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_FormLabel2.default, { required, htmlFor: id, children: label || void 0 }),
|
|
826
|
+
hideLabel
|
|
827
|
+
),
|
|
828
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
829
|
+
import_RadioGroup.default,
|
|
830
|
+
{
|
|
831
|
+
id,
|
|
832
|
+
name: id,
|
|
833
|
+
value: selectedIndex,
|
|
834
|
+
row,
|
|
835
|
+
onChange: _onChange,
|
|
836
|
+
onBlur: _onBlur,
|
|
837
|
+
onFocus: _onFocus,
|
|
838
|
+
"aria-describedby": (0, import_utils14.ariaDescribedByIds)(id),
|
|
839
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
840
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
841
|
+
const radio = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
842
|
+
import_FormControlLabel3.default,
|
|
843
|
+
{
|
|
844
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Radio.default, { name: id, id: (0, import_utils14.optionId)(id, index), color: "primary" }),
|
|
845
|
+
label: option.label,
|
|
846
|
+
value: String(index),
|
|
847
|
+
disabled: disabled || itemDisabled || readonly
|
|
848
|
+
},
|
|
849
|
+
index
|
|
850
|
+
);
|
|
851
|
+
return radio;
|
|
852
|
+
})
|
|
853
|
+
}
|
|
854
|
+
)
|
|
855
|
+
] });
|
|
8
856
|
}
|
|
857
|
+
|
|
858
|
+
// src/RangeWidget/RangeWidget.tsx
|
|
859
|
+
var import_FormLabel3 = __toESM(require("@mui/material/FormLabel"));
|
|
860
|
+
var import_Slider = __toESM(require("@mui/material/Slider"));
|
|
861
|
+
var import_utils15 = require("@rjsf/utils");
|
|
862
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
863
|
+
function RangeWidget(props) {
|
|
864
|
+
const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, required, label, hideLabel, id } = props;
|
|
865
|
+
const sliderProps = { value, label, id, name: id, ...(0, import_utils15.rangeSpec)(schema) };
|
|
866
|
+
const _onChange = (_, value2) => {
|
|
867
|
+
onChange(value2 ?? options.emptyValue);
|
|
868
|
+
};
|
|
869
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
|
|
870
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
|
|
871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
872
|
+
(0, import_utils15.labelValue)(
|
|
873
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_FormLabel3.default, { required, htmlFor: id, children: label || void 0 }),
|
|
874
|
+
hideLabel
|
|
875
|
+
),
|
|
876
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
877
|
+
import_Slider.default,
|
|
878
|
+
{
|
|
879
|
+
disabled: disabled || readonly,
|
|
880
|
+
onChange: _onChange,
|
|
881
|
+
onBlur: _onBlur,
|
|
882
|
+
onFocus: _onFocus,
|
|
883
|
+
valueLabelDisplay: "auto",
|
|
884
|
+
...sliderProps,
|
|
885
|
+
"aria-describedby": (0, import_utils15.ariaDescribedByIds)(id)
|
|
886
|
+
}
|
|
887
|
+
)
|
|
888
|
+
] });
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
// src/SelectWidget/SelectWidget.tsx
|
|
892
|
+
var import_MenuItem = __toESM(require("@mui/material/MenuItem"));
|
|
893
|
+
var import_TextField3 = __toESM(require("@mui/material/TextField"));
|
|
894
|
+
var import_utils16 = require("@rjsf/utils");
|
|
895
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
896
|
+
function SelectWidget({
|
|
897
|
+
schema,
|
|
898
|
+
id,
|
|
899
|
+
name,
|
|
900
|
+
// remove this from textFieldProps
|
|
901
|
+
options,
|
|
902
|
+
label,
|
|
903
|
+
hideLabel,
|
|
904
|
+
required,
|
|
905
|
+
disabled,
|
|
906
|
+
placeholder,
|
|
907
|
+
readonly,
|
|
908
|
+
value,
|
|
909
|
+
multiple,
|
|
910
|
+
autofocus,
|
|
911
|
+
onChange,
|
|
912
|
+
onBlur,
|
|
913
|
+
onFocus,
|
|
914
|
+
rawErrors = [],
|
|
915
|
+
registry,
|
|
916
|
+
uiSchema,
|
|
917
|
+
hideError,
|
|
918
|
+
formContext,
|
|
919
|
+
...textFieldProps
|
|
920
|
+
}) {
|
|
921
|
+
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
922
|
+
multiple = typeof multiple === "undefined" ? false : !!multiple;
|
|
923
|
+
const emptyValue = multiple ? [] : "";
|
|
924
|
+
const isEmpty = typeof value === "undefined" || multiple && value.length < 1 || !multiple && value === emptyValue;
|
|
925
|
+
const _onChange = ({ target: { value: value2 } }) => onChange((0, import_utils16.enumOptionsValueForIndex)(value2, enumOptions, optEmptyVal));
|
|
926
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, (0, import_utils16.enumOptionsValueForIndex)(value2, enumOptions, optEmptyVal));
|
|
927
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, (0, import_utils16.enumOptionsValueForIndex)(value2, enumOptions, optEmptyVal));
|
|
928
|
+
const selectedIndexes = (0, import_utils16.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
930
|
+
import_TextField3.default,
|
|
931
|
+
{
|
|
932
|
+
id,
|
|
933
|
+
name: id,
|
|
934
|
+
label: (0, import_utils16.labelValue)(label || void 0, hideLabel, false),
|
|
935
|
+
value: isEmpty ? emptyValue : selectedIndexes,
|
|
936
|
+
required,
|
|
937
|
+
disabled: disabled || readonly,
|
|
938
|
+
autoFocus: autofocus,
|
|
939
|
+
placeholder,
|
|
940
|
+
error: rawErrors.length > 0,
|
|
941
|
+
onChange: _onChange,
|
|
942
|
+
onBlur: _onBlur,
|
|
943
|
+
onFocus: _onFocus,
|
|
944
|
+
...textFieldProps,
|
|
945
|
+
select: true,
|
|
946
|
+
InputLabelProps: {
|
|
947
|
+
...textFieldProps.InputLabelProps,
|
|
948
|
+
shrink: !isEmpty
|
|
949
|
+
},
|
|
950
|
+
SelectProps: {
|
|
951
|
+
...textFieldProps.SelectProps,
|
|
952
|
+
multiple
|
|
953
|
+
},
|
|
954
|
+
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id),
|
|
955
|
+
children: Array.isArray(enumOptions) && enumOptions.map(({ value: value2, label: label2 }, i) => {
|
|
956
|
+
const disabled2 = Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1;
|
|
957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_MenuItem.default, { value: String(i), disabled: disabled2, children: label2 }, i);
|
|
958
|
+
})
|
|
959
|
+
}
|
|
960
|
+
);
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
// src/TextareaWidget/TextareaWidget.tsx
|
|
964
|
+
var import_utils17 = require("@rjsf/utils");
|
|
965
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
966
|
+
function TextareaWidget(props) {
|
|
967
|
+
const { options, registry } = props;
|
|
968
|
+
const BaseInputTemplate2 = (0, import_utils17.getTemplate)("BaseInputTemplate", registry, options);
|
|
969
|
+
let rows = 5;
|
|
970
|
+
if (typeof options.rows === "string" || typeof options.rows === "number") {
|
|
971
|
+
rows = options.rows;
|
|
972
|
+
}
|
|
973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(BaseInputTemplate2, { ...props, multiline: true, rows });
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
// src/Widgets/Widgets.ts
|
|
977
|
+
function generateWidgets() {
|
|
978
|
+
return {
|
|
979
|
+
CheckboxWidget,
|
|
980
|
+
CheckboxesWidget,
|
|
981
|
+
RadioWidget,
|
|
982
|
+
RangeWidget,
|
|
983
|
+
SelectWidget,
|
|
984
|
+
TextareaWidget
|
|
985
|
+
};
|
|
986
|
+
}
|
|
987
|
+
var Widgets_default = generateWidgets();
|
|
988
|
+
|
|
989
|
+
// src/Theme/Theme.tsx
|
|
990
|
+
function generateTheme() {
|
|
991
|
+
return {
|
|
992
|
+
templates: generateTemplates(),
|
|
993
|
+
widgets: generateWidgets()
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
var Theme_default = generateTheme();
|
|
997
|
+
|
|
998
|
+
// src/MuiForm/MuiForm.tsx
|
|
999
|
+
function generateForm() {
|
|
1000
|
+
return (0, import_core.withTheme)(generateTheme());
|
|
1001
|
+
}
|
|
1002
|
+
var MuiForm_default = generateForm();
|
|
1003
|
+
|
|
1004
|
+
// src/index.ts
|
|
1005
|
+
var src_default = MuiForm_default;
|
|
1006
|
+
//# sourceMappingURL=index.js.map
|