@rjsf/mui 6.0.0-beta.8 → 6.0.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/README.md +14 -14
- package/dist/{index.js → index.cjs} +176 -103
- package/dist/index.cjs.map +7 -0
- package/dist/mui.esm.js +175 -102
- package/dist/mui.esm.js.map +4 -4
- package/dist/mui.umd.js +125 -62
- package/lib/AddButton/AddButton.js +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +3 -3
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +5 -5
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +7 -8
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +3 -3
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js +6 -6
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +6 -6
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.js +1 -1
- package/lib/ErrorList/ErrorList.js +7 -7
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +5 -5
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +3 -3
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.js +4 -4
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/GridTemplate/GridTemplate.d.ts +1 -1
- package/lib/GridTemplate/GridTemplate.js +3 -3
- package/lib/GridTemplate/GridTemplate.js.map +1 -1
- package/lib/IconButton/IconButton.js +1 -1
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +2 -0
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js +8 -0
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js.map +1 -0
- package/lib/MultiSchemaFieldTemplate/index.d.ts +2 -0
- package/lib/MultiSchemaFieldTemplate/index.js +3 -0
- package/lib/MultiSchemaFieldTemplate/index.js.map +1 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +6 -5
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.d.ts +10 -0
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +22 -0
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -0
- package/lib/OptionalDataControlsTemplate/index.d.ts +2 -0
- package/lib/OptionalDataControlsTemplate/index.js +3 -0
- package/lib/OptionalDataControlsTemplate/index.js.map +1 -0
- package/lib/RadioWidget/RadioWidget.d.ts +1 -1
- package/lib/RadioWidget/RadioWidget.js +7 -7
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/RangeWidget/RangeWidget.js +2 -2
- package/lib/RangeWidget/RangeWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.d.ts +1 -1
- package/lib/SelectWidget/SelectWidget.js +4 -4
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.js +2 -2
- package/lib/Templates/Templates.js +4 -0
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/TitleField/TitleField.d.ts +1 -1
- package/lib/TitleField/TitleField.js +10 -5
- package/lib/TitleField/TitleField.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +4 -5
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -26
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +10 -10
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +27 -21
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +6 -7
- package/src/CheckboxWidget/CheckboxWidget.tsx +6 -6
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +3 -2
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +2 -2
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -2
- package/src/FieldTemplate/FieldTemplate.tsx +6 -4
- package/src/GridTemplate/GridTemplate.tsx +4 -4
- package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +20 -0
- package/src/MultiSchemaFieldTemplate/index.ts +2 -0
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +20 -16
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +43 -0
- package/src/OptionalDataControlsTemplate/index.ts +2 -0
- package/src/RadioWidget/RadioWidget.tsx +4 -3
- package/src/RangeWidget/RangeWidget.tsx +1 -1
- package/src/SelectWidget/SelectWidget.tsx +3 -3
- package/src/Templates/Templates.ts +4 -0
- package/src/TitleField/TitleField.tsx +12 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +14 -16
- package/dist/index.js.map +0 -7
|
@@ -61,7 +61,7 @@ function AddButton({
|
|
|
61
61
|
|
|
62
62
|
// src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
|
|
63
63
|
var import_Box = __toESM(require("@mui/material/Box"), 1);
|
|
64
|
-
var
|
|
64
|
+
var import_Grid = __toESM(require("@mui/material/Grid"), 1);
|
|
65
65
|
var import_Paper = __toESM(require("@mui/material/Paper"), 1);
|
|
66
66
|
var import_utils2 = require("@rjsf/utils");
|
|
67
67
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
@@ -80,36 +80,45 @@ function ArrayFieldItemTemplate(props) {
|
|
|
80
80
|
fontWeight: "bold",
|
|
81
81
|
minWidth: 0
|
|
82
82
|
};
|
|
83
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
84
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
85
|
-
hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_Grid.default, { container: true, alignItems: "center", children: [
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Grid.default, { size: "auto", 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 }) }) }) }),
|
|
85
|
+
hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Grid.default, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ArrayFieldItemButtonsTemplate, { ...buttonsProps, style: btnStyle }) })
|
|
86
86
|
] });
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// src/ArrayFieldTemplate/ArrayFieldTemplate.tsx
|
|
90
90
|
var import_Box2 = __toESM(require("@mui/material/Box"), 1);
|
|
91
|
-
var
|
|
91
|
+
var import_Grid2 = __toESM(require("@mui/material/Grid"), 1);
|
|
92
92
|
var import_Paper2 = __toESM(require("@mui/material/Paper"), 1);
|
|
93
93
|
var import_utils3 = require("@rjsf/utils");
|
|
94
94
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
95
95
|
function ArrayFieldTemplate(props) {
|
|
96
|
-
const {
|
|
96
|
+
const {
|
|
97
|
+
canAdd,
|
|
98
|
+
disabled,
|
|
99
|
+
fieldPathId,
|
|
100
|
+
uiSchema,
|
|
101
|
+
items,
|
|
102
|
+
optionalDataControl,
|
|
103
|
+
onAddClick,
|
|
104
|
+
readonly,
|
|
105
|
+
registry,
|
|
106
|
+
required,
|
|
107
|
+
schema,
|
|
108
|
+
title
|
|
109
|
+
} = props;
|
|
97
110
|
const uiOptions = (0, import_utils3.getUiOptions)(uiSchema);
|
|
98
111
|
const ArrayFieldDescriptionTemplate = (0, import_utils3.getTemplate)(
|
|
99
112
|
"ArrayFieldDescriptionTemplate",
|
|
100
113
|
registry,
|
|
101
114
|
uiOptions
|
|
102
115
|
);
|
|
103
|
-
const ArrayFieldItemTemplate2 = (0, import_utils3.getTemplate)(
|
|
104
|
-
"ArrayFieldItemTemplate",
|
|
105
|
-
registry,
|
|
106
|
-
uiOptions
|
|
107
|
-
);
|
|
108
116
|
const ArrayFieldTitleTemplate = (0, import_utils3.getTemplate)(
|
|
109
117
|
"ArrayFieldTitleTemplate",
|
|
110
118
|
registry,
|
|
111
119
|
uiOptions
|
|
112
120
|
);
|
|
121
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
113
122
|
const {
|
|
114
123
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
115
124
|
} = registry.templates;
|
|
@@ -117,29 +126,31 @@ function ArrayFieldTemplate(props) {
|
|
|
117
126
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
118
127
|
ArrayFieldTitleTemplate,
|
|
119
128
|
{
|
|
120
|
-
|
|
129
|
+
fieldPathId,
|
|
121
130
|
title: uiOptions.title || title,
|
|
122
131
|
schema,
|
|
123
132
|
uiSchema,
|
|
124
133
|
required,
|
|
125
|
-
registry
|
|
134
|
+
registry,
|
|
135
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
126
136
|
}
|
|
127
137
|
),
|
|
128
138
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
129
139
|
ArrayFieldDescriptionTemplate,
|
|
130
140
|
{
|
|
131
|
-
|
|
141
|
+
fieldPathId,
|
|
132
142
|
description: uiOptions.description || schema.description,
|
|
133
143
|
schema,
|
|
134
144
|
uiSchema,
|
|
135
145
|
registry
|
|
136
146
|
}
|
|
137
147
|
),
|
|
138
|
-
|
|
139
|
-
|
|
148
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
149
|
+
items,
|
|
150
|
+
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, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Box2.default, { mt: 2, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
140
151
|
AddButton2,
|
|
141
152
|
{
|
|
142
|
-
id: (0, import_utils3.buttonId)(
|
|
153
|
+
id: (0, import_utils3.buttonId)(fieldPathId, "add"),
|
|
143
154
|
className: "rjsf-array-item-add",
|
|
144
155
|
onClick: onAddClick,
|
|
145
156
|
disabled: disabled || readonly,
|
|
@@ -160,6 +171,7 @@ function BaseInputTemplate(props) {
|
|
|
160
171
|
id,
|
|
161
172
|
name,
|
|
162
173
|
// remove this from textFieldProps
|
|
174
|
+
htmlName,
|
|
163
175
|
placeholder,
|
|
164
176
|
required,
|
|
165
177
|
readonly,
|
|
@@ -179,7 +191,6 @@ function BaseInputTemplate(props) {
|
|
|
179
191
|
uiSchema,
|
|
180
192
|
rawErrors = [],
|
|
181
193
|
errorSchema,
|
|
182
|
-
formContext,
|
|
183
194
|
registry,
|
|
184
195
|
InputLabelProps,
|
|
185
196
|
...textFieldProps
|
|
@@ -199,20 +210,19 @@ function BaseInputTemplate(props) {
|
|
|
199
210
|
import_TextField.default,
|
|
200
211
|
{
|
|
201
212
|
id,
|
|
202
|
-
name: id,
|
|
213
|
+
name: htmlName || id,
|
|
203
214
|
placeholder,
|
|
204
215
|
label: (0, import_utils4.labelValue)(label || void 0, hideLabel, void 0),
|
|
205
216
|
autoFocus: autofocus,
|
|
206
217
|
required,
|
|
207
218
|
disabled: disabled || readonly,
|
|
208
|
-
|
|
219
|
+
slotProps: { htmlInput: htmlInputProps, inputLabel: DisplayInputLabelProps },
|
|
209
220
|
...rest,
|
|
210
221
|
value: value || value === 0 ? value : "",
|
|
211
222
|
error: rawErrors.length > 0,
|
|
212
223
|
onChange: onChangeOverride || _onChange,
|
|
213
224
|
onBlur: _onBlur,
|
|
214
225
|
onFocus: _onFocus,
|
|
215
|
-
InputLabelProps: DisplayInputLabelProps,
|
|
216
226
|
...textFieldProps,
|
|
217
227
|
"aria-describedby": (0, import_utils4.ariaDescribedByIds)(id, !!schema.examples)
|
|
218
228
|
}
|
|
@@ -336,11 +346,11 @@ var import_List2 = __toESM(require("@mui/material/List"), 1);
|
|
|
336
346
|
var import_utils7 = require("@rjsf/utils");
|
|
337
347
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
338
348
|
function FieldErrorTemplate(props) {
|
|
339
|
-
const { errors = [],
|
|
349
|
+
const { errors = [], fieldPathId } = props;
|
|
340
350
|
if (errors.length === 0) {
|
|
341
351
|
return null;
|
|
342
352
|
}
|
|
343
|
-
const id = (0, import_utils7.errorId)(
|
|
353
|
+
const id = (0, import_utils7.errorId)(fieldPathId);
|
|
344
354
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_List2.default, { id, dense: true, disablePadding: true, children: errors.map((error, i) => {
|
|
345
355
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ListItem2.default, { disableGutters: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_FormHelperText.default, { component: "div", id: `${id}-${i}`, children: error }) }, i);
|
|
346
356
|
}) });
|
|
@@ -351,11 +361,11 @@ var import_FormHelperText2 = __toESM(require("@mui/material/FormHelperText"), 1)
|
|
|
351
361
|
var import_utils8 = require("@rjsf/utils");
|
|
352
362
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
353
363
|
function FieldHelpTemplate(props) {
|
|
354
|
-
const {
|
|
364
|
+
const { fieldPathId, help } = props;
|
|
355
365
|
if (!help) {
|
|
356
366
|
return null;
|
|
357
367
|
}
|
|
358
|
-
const id = (0, import_utils8.helpId)(
|
|
368
|
+
const id = (0, import_utils8.helpId)(fieldPathId);
|
|
359
369
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_FormHelperText2.default, { component: "div", id, children: help });
|
|
360
370
|
}
|
|
361
371
|
|
|
@@ -374,8 +384,9 @@ function FieldTemplate(props) {
|
|
|
374
384
|
displayLabel,
|
|
375
385
|
hidden,
|
|
376
386
|
label,
|
|
377
|
-
|
|
378
|
-
|
|
387
|
+
onKeyRename,
|
|
388
|
+
onKeyRenameBlur,
|
|
389
|
+
onRemoveProperty,
|
|
379
390
|
readonly,
|
|
380
391
|
required,
|
|
381
392
|
rawErrors = [],
|
|
@@ -404,8 +415,9 @@ function FieldTemplate(props) {
|
|
|
404
415
|
disabled,
|
|
405
416
|
id,
|
|
406
417
|
label,
|
|
407
|
-
|
|
408
|
-
|
|
418
|
+
onKeyRename,
|
|
419
|
+
onKeyRenameBlur,
|
|
420
|
+
onRemoveProperty,
|
|
409
421
|
readonly,
|
|
410
422
|
required,
|
|
411
423
|
schema,
|
|
@@ -422,17 +434,29 @@ function FieldTemplate(props) {
|
|
|
422
434
|
}
|
|
423
435
|
|
|
424
436
|
// src/GridTemplate/GridTemplate.tsx
|
|
425
|
-
var
|
|
437
|
+
var import_Grid3 = __toESM(require("@mui/material/Grid"), 1);
|
|
426
438
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
427
439
|
function GridTemplate(props) {
|
|
428
440
|
const { children, column, ...rest } = props;
|
|
429
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Grid3.default, { container: !column, ...rest, children });
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
|
|
445
|
+
var import_Box4 = __toESM(require("@mui/material/Box"), 1);
|
|
446
|
+
var import_FormControl2 = __toESM(require("@mui/material/FormControl"), 1);
|
|
447
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
448
|
+
function MultiSchemaFieldTemplate(props) {
|
|
449
|
+
const { optionSchemaField, selector } = props;
|
|
450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_Box4.default, { sx: { mb: 2 }, children: [
|
|
451
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_FormControl2.default, { fullWidth: true, sx: { mb: 2 }, children: selector }),
|
|
452
|
+
optionSchemaField
|
|
453
|
+
] });
|
|
430
454
|
}
|
|
431
455
|
|
|
432
456
|
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
433
|
-
var
|
|
457
|
+
var import_Grid4 = __toESM(require("@mui/material/Grid"), 1);
|
|
434
458
|
var import_utils10 = require("@rjsf/utils");
|
|
435
|
-
var
|
|
459
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
436
460
|
function ObjectFieldTemplate(props) {
|
|
437
461
|
const {
|
|
438
462
|
description,
|
|
@@ -442,10 +466,11 @@ function ObjectFieldTemplate(props) {
|
|
|
442
466
|
disabled,
|
|
443
467
|
readonly,
|
|
444
468
|
uiSchema,
|
|
445
|
-
|
|
469
|
+
fieldPathId,
|
|
446
470
|
schema,
|
|
447
471
|
formData,
|
|
448
|
-
|
|
472
|
+
optionalDataControl,
|
|
473
|
+
onAddProperty,
|
|
449
474
|
registry
|
|
450
475
|
} = props;
|
|
451
476
|
const uiOptions = (0, import_utils10.getUiOptions)(uiSchema);
|
|
@@ -455,45 +480,48 @@ function ObjectFieldTemplate(props) {
|
|
|
455
480
|
registry,
|
|
456
481
|
uiOptions
|
|
457
482
|
);
|
|
483
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
458
484
|
const {
|
|
459
485
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
460
486
|
} = registry.templates;
|
|
461
|
-
return /* @__PURE__ */ (0,
|
|
462
|
-
title && /* @__PURE__ */ (0,
|
|
487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
488
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
463
489
|
TitleFieldTemplate,
|
|
464
490
|
{
|
|
465
|
-
id: (0, import_utils10.titleId)(
|
|
491
|
+
id: (0, import_utils10.titleId)(fieldPathId),
|
|
466
492
|
title,
|
|
467
493
|
required,
|
|
468
494
|
schema,
|
|
469
495
|
uiSchema,
|
|
470
|
-
registry
|
|
496
|
+
registry,
|
|
497
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
471
498
|
}
|
|
472
499
|
),
|
|
473
|
-
description && /* @__PURE__ */ (0,
|
|
500
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
474
501
|
DescriptionFieldTemplate,
|
|
475
502
|
{
|
|
476
|
-
id: (0, import_utils10.descriptionId)(
|
|
503
|
+
id: (0, import_utils10.descriptionId)(fieldPathId),
|
|
477
504
|
description,
|
|
478
505
|
schema,
|
|
479
506
|
uiSchema,
|
|
480
507
|
registry
|
|
481
508
|
}
|
|
482
509
|
),
|
|
483
|
-
/* @__PURE__ */ (0,
|
|
510
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_Grid4.default, { container: true, spacing: 2, style: { marginTop: "10px" }, children: [
|
|
511
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
484
512
|
properties.map(
|
|
485
513
|
(element, index) => (
|
|
486
|
-
// Remove the <
|
|
514
|
+
// Remove the <Grid> if the inner element is hidden as the <Grid>
|
|
487
515
|
// itself would otherwise still take up space.
|
|
488
|
-
element.hidden ? element.content : /* @__PURE__ */ (0,
|
|
516
|
+
element.hidden ? element.content : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_Grid4.default, { size: { xs: 12 }, style: { marginBottom: "10px" }, children: element.content }, index)
|
|
489
517
|
)
|
|
490
518
|
),
|
|
491
|
-
(0, import_utils10.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0,
|
|
519
|
+
(0, import_utils10.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_Grid4.default, { container: true, justifyContent: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_Grid4.default, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
492
520
|
AddButton2,
|
|
493
521
|
{
|
|
494
|
-
id: (0, import_utils10.buttonId)(
|
|
522
|
+
id: (0, import_utils10.buttonId)(fieldPathId, "add"),
|
|
495
523
|
className: "rjsf-object-property-expand",
|
|
496
|
-
onClick:
|
|
524
|
+
onClick: onAddProperty,
|
|
497
525
|
disabled: disabled || readonly,
|
|
498
526
|
uiSchema,
|
|
499
527
|
registry
|
|
@@ -503,39 +531,80 @@ function ObjectFieldTemplate(props) {
|
|
|
503
531
|
] });
|
|
504
532
|
}
|
|
505
533
|
|
|
534
|
+
// src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
|
|
535
|
+
var import_Add2 = __toESM(require("@mui/icons-material/Add"), 1);
|
|
536
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
537
|
+
function OptionalDataControlsTemplate(props) {
|
|
538
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
539
|
+
if (onAddClick) {
|
|
540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
541
|
+
MuiIconButton,
|
|
542
|
+
{
|
|
543
|
+
id,
|
|
544
|
+
registry,
|
|
545
|
+
className: "rjsf-add-optional-data",
|
|
546
|
+
onClick: onAddClick,
|
|
547
|
+
title: label,
|
|
548
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_Add2.default, { fontSize: "small" })
|
|
549
|
+
}
|
|
550
|
+
);
|
|
551
|
+
} else if (onRemoveClick) {
|
|
552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
553
|
+
RemoveButton,
|
|
554
|
+
{
|
|
555
|
+
id,
|
|
556
|
+
registry,
|
|
557
|
+
className: "rjsf-remove-optional-data",
|
|
558
|
+
onClick: onRemoveClick,
|
|
559
|
+
title: label
|
|
560
|
+
}
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("em", { id, children: label });
|
|
564
|
+
}
|
|
565
|
+
|
|
506
566
|
// src/SubmitButton/SubmitButton.tsx
|
|
507
|
-
var
|
|
567
|
+
var import_Box5 = __toESM(require("@mui/material/Box"), 1);
|
|
508
568
|
var import_Button = __toESM(require("@mui/material/Button"), 1);
|
|
509
569
|
var import_utils11 = require("@rjsf/utils");
|
|
510
|
-
var
|
|
570
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
511
571
|
function SubmitButton({ uiSchema }) {
|
|
512
572
|
const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils11.getSubmitButtonOptions)(uiSchema);
|
|
513
573
|
if (norender) {
|
|
514
574
|
return null;
|
|
515
575
|
}
|
|
516
|
-
return /* @__PURE__ */ (0,
|
|
576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Box5.default, { marginTop: 3, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Button.default, { type: "submit", variant: "contained", color: "primary", ...submitButtonProps, children: submitText }) });
|
|
517
577
|
}
|
|
518
578
|
|
|
519
579
|
// src/TitleField/TitleField.tsx
|
|
520
|
-
var
|
|
580
|
+
var import_Box6 = __toESM(require("@mui/material/Box"), 1);
|
|
521
581
|
var import_Divider = __toESM(require("@mui/material/Divider"), 1);
|
|
582
|
+
var import_Grid5 = __toESM(require("@mui/material/Grid"), 1);
|
|
522
583
|
var import_Typography4 = __toESM(require("@mui/material/Typography"), 1);
|
|
523
|
-
var
|
|
584
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
524
585
|
function TitleField({
|
|
525
586
|
id,
|
|
526
|
-
title
|
|
587
|
+
title,
|
|
588
|
+
optionalDataControl
|
|
527
589
|
}) {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
/* @__PURE__ */ (0,
|
|
590
|
+
let heading = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_Typography4.default, { variant: "h5", children: title });
|
|
591
|
+
if (optionalDataControl) {
|
|
592
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_Grid5.default, { container: true, spacing: 0, children: [
|
|
593
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_Grid5.default, { size: "grow", children: heading }),
|
|
594
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_Grid5.default, { justifyContent: "flex-end", children: optionalDataControl })
|
|
595
|
+
] });
|
|
596
|
+
}
|
|
597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_Box6.default, { id, mb: 1, mt: 1, children: [
|
|
598
|
+
heading,
|
|
599
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_Divider.default, {})
|
|
531
600
|
] });
|
|
532
601
|
}
|
|
533
602
|
|
|
534
603
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
535
|
-
var
|
|
604
|
+
var import_Grid6 = __toESM(require("@mui/material/Grid"), 1);
|
|
536
605
|
var import_TextField2 = __toESM(require("@mui/material/TextField"), 1);
|
|
537
606
|
var import_utils12 = require("@rjsf/utils");
|
|
538
|
-
var
|
|
607
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
539
608
|
function WrapIfAdditionalTemplate(props) {
|
|
540
609
|
const {
|
|
541
610
|
children,
|
|
@@ -544,8 +613,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
544
613
|
disabled,
|
|
545
614
|
id,
|
|
546
615
|
label,
|
|
547
|
-
|
|
548
|
-
|
|
616
|
+
onKeyRenameBlur,
|
|
617
|
+
onRemoveProperty,
|
|
549
618
|
readonly,
|
|
550
619
|
required,
|
|
551
620
|
schema,
|
|
@@ -563,11 +632,10 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
563
632
|
fontWeight: "bold"
|
|
564
633
|
};
|
|
565
634
|
if (!additional) {
|
|
566
|
-
return /* @__PURE__ */ (0,
|
|
635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: classNames, style, children });
|
|
567
636
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Grid25.default, { size: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_Grid6.default, { container: true, alignItems: "center", spacing: 2, className: classNames, style, children: [
|
|
638
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Grid6.default, { size: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
571
639
|
import_TextField2.default,
|
|
572
640
|
{
|
|
573
641
|
fullWidth: true,
|
|
@@ -577,12 +645,12 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
577
645
|
disabled: disabled || readonly,
|
|
578
646
|
id: `${id}-key`,
|
|
579
647
|
name: `${id}-key`,
|
|
580
|
-
onBlur: !readonly ?
|
|
648
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
581
649
|
type: "text"
|
|
582
650
|
}
|
|
583
651
|
) }),
|
|
584
|
-
/* @__PURE__ */ (0,
|
|
585
|
-
/* @__PURE__ */ (0,
|
|
652
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Grid6.default, { size: "auto", children }),
|
|
653
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Grid6.default, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
586
654
|
RemoveButton2,
|
|
587
655
|
{
|
|
588
656
|
id: (0, import_utils12.buttonId)(id, "remove"),
|
|
@@ -590,7 +658,7 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
590
658
|
iconType: "default",
|
|
591
659
|
style: btnStyle,
|
|
592
660
|
disabled: disabled || readonly,
|
|
593
|
-
onClick:
|
|
661
|
+
onClick: onRemoveProperty,
|
|
594
662
|
uiSchema,
|
|
595
663
|
registry
|
|
596
664
|
}
|
|
@@ -618,7 +686,9 @@ function generateTemplates() {
|
|
|
618
686
|
FieldHelpTemplate,
|
|
619
687
|
FieldTemplate,
|
|
620
688
|
GridTemplate,
|
|
689
|
+
MultiSchemaFieldTemplate,
|
|
621
690
|
ObjectFieldTemplate,
|
|
691
|
+
OptionalDataControlsTemplate,
|
|
622
692
|
TitleFieldTemplate: TitleField,
|
|
623
693
|
WrapIfAdditionalTemplate
|
|
624
694
|
};
|
|
@@ -629,11 +699,12 @@ var Templates_default = generateTemplates();
|
|
|
629
699
|
var import_Checkbox = __toESM(require("@mui/material/Checkbox"), 1);
|
|
630
700
|
var import_FormControlLabel = __toESM(require("@mui/material/FormControlLabel"), 1);
|
|
631
701
|
var import_utils13 = require("@rjsf/utils");
|
|
632
|
-
var
|
|
702
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
633
703
|
function CheckboxWidget(props) {
|
|
634
704
|
const {
|
|
635
705
|
schema,
|
|
636
706
|
id,
|
|
707
|
+
htmlName,
|
|
637
708
|
value,
|
|
638
709
|
disabled,
|
|
639
710
|
readonly,
|
|
@@ -654,11 +725,11 @@ function CheckboxWidget(props) {
|
|
|
654
725
|
);
|
|
655
726
|
const required = (0, import_utils13.schemaRequiresTrueValue)(schema);
|
|
656
727
|
const _onChange = (_, checked) => onChange(checked);
|
|
657
|
-
const _onBlur = (
|
|
658
|
-
const _onFocus = (
|
|
728
|
+
const _onBlur = () => onBlur(id, value);
|
|
729
|
+
const _onFocus = () => onFocus(id, value);
|
|
659
730
|
const description = options.description ?? schema.description;
|
|
660
|
-
return /* @__PURE__ */ (0,
|
|
661
|
-
!hideLabel && description && /* @__PURE__ */ (0,
|
|
731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
732
|
+
!hideLabel && description && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
662
733
|
DescriptionFieldTemplate,
|
|
663
734
|
{
|
|
664
735
|
id: (0, import_utils13.descriptionId)(id),
|
|
@@ -668,14 +739,14 @@ function CheckboxWidget(props) {
|
|
|
668
739
|
registry
|
|
669
740
|
}
|
|
670
741
|
),
|
|
671
|
-
/* @__PURE__ */ (0,
|
|
742
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
672
743
|
import_FormControlLabel.default,
|
|
673
744
|
{
|
|
674
|
-
control: /* @__PURE__ */ (0,
|
|
745
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
675
746
|
import_Checkbox.default,
|
|
676
747
|
{
|
|
677
748
|
id,
|
|
678
|
-
name: id,
|
|
749
|
+
name: htmlName || id,
|
|
679
750
|
checked: typeof value === "undefined" ? false : Boolean(value),
|
|
680
751
|
required,
|
|
681
752
|
disabled: disabled || readonly,
|
|
@@ -698,11 +769,12 @@ var import_FormControlLabel2 = __toESM(require("@mui/material/FormControlLabel")
|
|
|
698
769
|
var import_FormGroup = __toESM(require("@mui/material/FormGroup"), 1);
|
|
699
770
|
var import_FormLabel = __toESM(require("@mui/material/FormLabel"), 1);
|
|
700
771
|
var import_utils14 = require("@rjsf/utils");
|
|
701
|
-
var
|
|
772
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
702
773
|
function CheckboxesWidget({
|
|
703
774
|
label,
|
|
704
775
|
hideLabel,
|
|
705
776
|
id,
|
|
777
|
+
htmlName,
|
|
706
778
|
disabled,
|
|
707
779
|
options,
|
|
708
780
|
value,
|
|
@@ -724,19 +796,19 @@ function CheckboxesWidget({
|
|
|
724
796
|
};
|
|
725
797
|
const _onBlur = ({ target }) => onBlur(id, (0, import_utils14.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
726
798
|
const _onFocus = ({ target }) => onFocus(id, (0, import_utils14.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
727
|
-
return /* @__PURE__ */ (0,
|
|
799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
728
800
|
(0, import_utils14.labelValue)(
|
|
729
|
-
/* @__PURE__ */ (0,
|
|
801
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_FormLabel.default, { required, htmlFor: id, children: label || void 0 }),
|
|
730
802
|
hideLabel
|
|
731
803
|
),
|
|
732
|
-
/* @__PURE__ */ (0,
|
|
804
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_FormGroup.default, { id, row: !!inline, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
733
805
|
const checked = (0, import_utils14.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
734
806
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
735
|
-
const checkbox = /* @__PURE__ */ (0,
|
|
807
|
+
const checkbox = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
736
808
|
import_Checkbox2.default,
|
|
737
809
|
{
|
|
738
810
|
id: (0, import_utils14.optionId)(id, index),
|
|
739
|
-
name: id,
|
|
811
|
+
name: htmlName || id,
|
|
740
812
|
checked,
|
|
741
813
|
disabled: disabled || itemDisabled || readonly,
|
|
742
814
|
autoFocus: autofocus && index === 0,
|
|
@@ -746,7 +818,7 @@ function CheckboxesWidget({
|
|
|
746
818
|
"aria-describedby": (0, import_utils14.ariaDescribedByIds)(id)
|
|
747
819
|
}
|
|
748
820
|
);
|
|
749
|
-
return /* @__PURE__ */ (0,
|
|
821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_FormControlLabel2.default, { control: checkbox, label: option.label }, index);
|
|
750
822
|
}) })
|
|
751
823
|
] });
|
|
752
824
|
}
|
|
@@ -757,9 +829,10 @@ var import_FormLabel2 = __toESM(require("@mui/material/FormLabel"), 1);
|
|
|
757
829
|
var import_Radio = __toESM(require("@mui/material/Radio"), 1);
|
|
758
830
|
var import_RadioGroup = __toESM(require("@mui/material/RadioGroup"), 1);
|
|
759
831
|
var import_utils15 = require("@rjsf/utils");
|
|
760
|
-
var
|
|
832
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
761
833
|
function RadioWidget({
|
|
762
834
|
id,
|
|
835
|
+
htmlName,
|
|
763
836
|
options,
|
|
764
837
|
value,
|
|
765
838
|
required,
|
|
@@ -777,16 +850,16 @@ function RadioWidget({
|
|
|
777
850
|
const _onFocus = ({ target }) => onFocus(id, (0, import_utils15.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
778
851
|
const row = options ? options.inline : false;
|
|
779
852
|
const selectedIndex = (0, import_utils15.enumOptionsIndexForValue)(value, enumOptions) ?? null;
|
|
780
|
-
return /* @__PURE__ */ (0,
|
|
853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
781
854
|
(0, import_utils15.labelValue)(
|
|
782
|
-
/* @__PURE__ */ (0,
|
|
855
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_FormLabel2.default, { required, htmlFor: id, children: label || void 0 }),
|
|
783
856
|
hideLabel
|
|
784
857
|
),
|
|
785
|
-
/* @__PURE__ */ (0,
|
|
858
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
786
859
|
import_RadioGroup.default,
|
|
787
860
|
{
|
|
788
861
|
id,
|
|
789
|
-
name: id,
|
|
862
|
+
name: htmlName || id,
|
|
790
863
|
value: selectedIndex,
|
|
791
864
|
row,
|
|
792
865
|
onChange: _onChange,
|
|
@@ -795,10 +868,10 @@ function RadioWidget({
|
|
|
795
868
|
"aria-describedby": (0, import_utils15.ariaDescribedByIds)(id),
|
|
796
869
|
children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
797
870
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
798
|
-
const radio = /* @__PURE__ */ (0,
|
|
871
|
+
const radio = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
799
872
|
import_FormControlLabel3.default,
|
|
800
873
|
{
|
|
801
|
-
control: /* @__PURE__ */ (0,
|
|
874
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_Radio.default, { name: htmlName || id, id: (0, import_utils15.optionId)(id, index), color: "primary" }),
|
|
802
875
|
label: option.label,
|
|
803
876
|
value: String(index),
|
|
804
877
|
disabled: disabled || itemDisabled || readonly
|
|
@@ -816,7 +889,7 @@ function RadioWidget({
|
|
|
816
889
|
var import_FormLabel3 = __toESM(require("@mui/material/FormLabel"), 1);
|
|
817
890
|
var import_Slider = __toESM(require("@mui/material/Slider"), 1);
|
|
818
891
|
var import_utils16 = require("@rjsf/utils");
|
|
819
|
-
var
|
|
892
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
820
893
|
function RangeWidget(props) {
|
|
821
894
|
const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, required, label, hideLabel, id } = props;
|
|
822
895
|
const sliderProps = { value, label, id, name: id, ...(0, import_utils16.rangeSpec)(schema) };
|
|
@@ -825,12 +898,12 @@ function RangeWidget(props) {
|
|
|
825
898
|
};
|
|
826
899
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
827
900
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
828
|
-
return /* @__PURE__ */ (0,
|
|
901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
829
902
|
(0, import_utils16.labelValue)(
|
|
830
|
-
/* @__PURE__ */ (0,
|
|
903
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_FormLabel3.default, { required, htmlFor: id, children: label || void 0 }),
|
|
831
904
|
hideLabel
|
|
832
905
|
),
|
|
833
|
-
/* @__PURE__ */ (0,
|
|
906
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
834
907
|
import_Slider.default,
|
|
835
908
|
{
|
|
836
909
|
disabled: disabled || readonly,
|
|
@@ -849,12 +922,13 @@ function RangeWidget(props) {
|
|
|
849
922
|
var import_MenuItem = __toESM(require("@mui/material/MenuItem"), 1);
|
|
850
923
|
var import_TextField3 = __toESM(require("@mui/material/TextField"), 1);
|
|
851
924
|
var import_utils17 = require("@rjsf/utils");
|
|
852
|
-
var
|
|
925
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
853
926
|
function SelectWidget({
|
|
854
927
|
schema,
|
|
855
928
|
id,
|
|
856
929
|
name,
|
|
857
930
|
// remove this from textFieldProps
|
|
931
|
+
htmlName,
|
|
858
932
|
options,
|
|
859
933
|
label,
|
|
860
934
|
hideLabel,
|
|
@@ -873,7 +947,6 @@ function SelectWidget({
|
|
|
873
947
|
registry,
|
|
874
948
|
uiSchema,
|
|
875
949
|
hideError,
|
|
876
|
-
formContext,
|
|
877
950
|
...textFieldProps
|
|
878
951
|
}) {
|
|
879
952
|
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
@@ -886,11 +959,11 @@ function SelectWidget({
|
|
|
886
959
|
const selectedIndexes = (0, import_utils17.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
887
960
|
const { InputLabelProps, SelectProps, autocomplete, ...textFieldRemainingProps } = textFieldProps;
|
|
888
961
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
889
|
-
return /* @__PURE__ */ (0,
|
|
962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
890
963
|
import_TextField3.default,
|
|
891
964
|
{
|
|
892
965
|
id,
|
|
893
|
-
name: id,
|
|
966
|
+
name: htmlName || id,
|
|
894
967
|
label: (0, import_utils17.labelValue)(label || void 0, hideLabel, void 0),
|
|
895
968
|
value: !isEmpty && typeof selectedIndexes !== "undefined" ? selectedIndexes : emptyValue,
|
|
896
969
|
required,
|
|
@@ -914,10 +987,10 @@ function SelectWidget({
|
|
|
914
987
|
},
|
|
915
988
|
"aria-describedby": (0, import_utils17.ariaDescribedByIds)(id),
|
|
916
989
|
children: [
|
|
917
|
-
showPlaceholderOption && /* @__PURE__ */ (0,
|
|
990
|
+
showPlaceholderOption && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_MenuItem.default, { value: "", children: placeholder }),
|
|
918
991
|
Array.isArray(enumOptions) && enumOptions.map(({ value: value2, label: label2 }, i) => {
|
|
919
992
|
const disabled2 = Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1;
|
|
920
|
-
return /* @__PURE__ */ (0,
|
|
993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_MenuItem.default, { value: String(i), disabled: disabled2, children: label2 }, i);
|
|
921
994
|
})
|
|
922
995
|
]
|
|
923
996
|
}
|
|
@@ -926,7 +999,7 @@ function SelectWidget({
|
|
|
926
999
|
|
|
927
1000
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
928
1001
|
var import_utils18 = require("@rjsf/utils");
|
|
929
|
-
var
|
|
1002
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
930
1003
|
function TextareaWidget(props) {
|
|
931
1004
|
const { options, registry } = props;
|
|
932
1005
|
const BaseInputTemplate2 = (0, import_utils18.getTemplate)("BaseInputTemplate", registry, options);
|
|
@@ -934,7 +1007,7 @@ function TextareaWidget(props) {
|
|
|
934
1007
|
if (typeof options.rows === "string" || typeof options.rows === "number") {
|
|
935
1008
|
rows = options.rows;
|
|
936
1009
|
}
|
|
937
|
-
return /* @__PURE__ */ (0,
|
|
1010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(BaseInputTemplate2, { ...props, multiline: true, rows });
|
|
938
1011
|
}
|
|
939
1012
|
|
|
940
1013
|
// src/Widgets/Widgets.ts
|
|
@@ -967,4 +1040,4 @@ var MuiForm_default = generateForm();
|
|
|
967
1040
|
|
|
968
1041
|
// src/index.ts
|
|
969
1042
|
var index_default = MuiForm_default;
|
|
970
|
-
//# sourceMappingURL=index.
|
|
1043
|
+
//# sourceMappingURL=index.cjs.map
|