@rjsf/mui 6.0.0-beta.9 → 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 +2 -2
- package/dist/{index.js → index.cjs} +165 -91
- package/dist/index.cjs.map +7 -0
- package/dist/mui.esm.js +164 -90
- package/dist/mui.esm.js.map +4 -4
- package/dist/mui.umd.js +107 -43
- package/lib/AddButton/AddButton.js +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +3 -3
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +4 -4
- 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.js +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 +5 -4
- 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 +22 -23
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +3 -3
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +22 -16
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +5 -5
- 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/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +20 -0
- package/src/MultiSchemaFieldTemplate/index.ts +2 -0
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +10 -6
- 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 +6 -8
- package/dist/index.js.map +0 -7
package/dist/mui.esm.js
CHANGED
|
@@ -56,23 +56,32 @@ import {
|
|
|
56
56
|
} from "@rjsf/utils";
|
|
57
57
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
58
58
|
function ArrayFieldTemplate(props) {
|
|
59
|
-
const {
|
|
59
|
+
const {
|
|
60
|
+
canAdd,
|
|
61
|
+
disabled,
|
|
62
|
+
fieldPathId,
|
|
63
|
+
uiSchema,
|
|
64
|
+
items,
|
|
65
|
+
optionalDataControl,
|
|
66
|
+
onAddClick,
|
|
67
|
+
readonly,
|
|
68
|
+
registry,
|
|
69
|
+
required,
|
|
70
|
+
schema,
|
|
71
|
+
title
|
|
72
|
+
} = props;
|
|
60
73
|
const uiOptions = getUiOptions2(uiSchema);
|
|
61
74
|
const ArrayFieldDescriptionTemplate = getTemplate2(
|
|
62
75
|
"ArrayFieldDescriptionTemplate",
|
|
63
76
|
registry,
|
|
64
77
|
uiOptions
|
|
65
78
|
);
|
|
66
|
-
const ArrayFieldItemTemplate2 = getTemplate2(
|
|
67
|
-
"ArrayFieldItemTemplate",
|
|
68
|
-
registry,
|
|
69
|
-
uiOptions
|
|
70
|
-
);
|
|
71
79
|
const ArrayFieldTitleTemplate = getTemplate2(
|
|
72
80
|
"ArrayFieldTitleTemplate",
|
|
73
81
|
registry,
|
|
74
82
|
uiOptions
|
|
75
83
|
);
|
|
84
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
76
85
|
const {
|
|
77
86
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
78
87
|
} = registry.templates;
|
|
@@ -80,29 +89,31 @@ function ArrayFieldTemplate(props) {
|
|
|
80
89
|
/* @__PURE__ */ jsx3(
|
|
81
90
|
ArrayFieldTitleTemplate,
|
|
82
91
|
{
|
|
83
|
-
|
|
92
|
+
fieldPathId,
|
|
84
93
|
title: uiOptions.title || title,
|
|
85
94
|
schema,
|
|
86
95
|
uiSchema,
|
|
87
96
|
required,
|
|
88
|
-
registry
|
|
97
|
+
registry,
|
|
98
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
89
99
|
}
|
|
90
100
|
),
|
|
91
101
|
/* @__PURE__ */ jsx3(
|
|
92
102
|
ArrayFieldDescriptionTemplate,
|
|
93
103
|
{
|
|
94
|
-
|
|
104
|
+
fieldPathId,
|
|
95
105
|
description: uiOptions.description || schema.description,
|
|
96
106
|
schema,
|
|
97
107
|
uiSchema,
|
|
98
108
|
registry
|
|
99
109
|
}
|
|
100
110
|
),
|
|
101
|
-
|
|
111
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
112
|
+
items,
|
|
102
113
|
canAdd && /* @__PURE__ */ jsx3(Grid2, { container: true, justifyContent: "flex-end", children: /* @__PURE__ */ jsx3(Grid2, { children: /* @__PURE__ */ jsx3(Box2, { mt: 2, children: /* @__PURE__ */ jsx3(
|
|
103
114
|
AddButton2,
|
|
104
115
|
{
|
|
105
|
-
id: buttonId(
|
|
116
|
+
id: buttonId(fieldPathId, "add"),
|
|
106
117
|
className: "rjsf-array-item-add",
|
|
107
118
|
onClick: onAddClick,
|
|
108
119
|
disabled: disabled || readonly,
|
|
@@ -128,6 +139,7 @@ function BaseInputTemplate(props) {
|
|
|
128
139
|
id,
|
|
129
140
|
name,
|
|
130
141
|
// remove this from textFieldProps
|
|
142
|
+
htmlName,
|
|
131
143
|
placeholder,
|
|
132
144
|
required,
|
|
133
145
|
readonly,
|
|
@@ -147,7 +159,6 @@ function BaseInputTemplate(props) {
|
|
|
147
159
|
uiSchema,
|
|
148
160
|
rawErrors = [],
|
|
149
161
|
errorSchema,
|
|
150
|
-
formContext,
|
|
151
162
|
registry,
|
|
152
163
|
InputLabelProps,
|
|
153
164
|
...textFieldProps
|
|
@@ -167,7 +178,7 @@ function BaseInputTemplate(props) {
|
|
|
167
178
|
TextField,
|
|
168
179
|
{
|
|
169
180
|
id,
|
|
170
|
-
name: id,
|
|
181
|
+
name: htmlName || id,
|
|
171
182
|
placeholder,
|
|
172
183
|
label: labelValue(label || void 0, hideLabel, void 0),
|
|
173
184
|
autoFocus: autofocus,
|
|
@@ -303,11 +314,11 @@ import List2 from "@mui/material/List";
|
|
|
303
314
|
import { errorId } from "@rjsf/utils";
|
|
304
315
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
305
316
|
function FieldErrorTemplate(props) {
|
|
306
|
-
const { errors = [],
|
|
317
|
+
const { errors = [], fieldPathId } = props;
|
|
307
318
|
if (errors.length === 0) {
|
|
308
319
|
return null;
|
|
309
320
|
}
|
|
310
|
-
const id = errorId(
|
|
321
|
+
const id = errorId(fieldPathId);
|
|
311
322
|
return /* @__PURE__ */ jsx8(List2, { id, dense: true, disablePadding: true, children: errors.map((error, i) => {
|
|
312
323
|
return /* @__PURE__ */ jsx8(ListItem2, { disableGutters: true, children: /* @__PURE__ */ jsx8(FormHelperText, { component: "div", id: `${id}-${i}`, children: error }) }, i);
|
|
313
324
|
}) });
|
|
@@ -318,11 +329,11 @@ import FormHelperText2 from "@mui/material/FormHelperText";
|
|
|
318
329
|
import { helpId } from "@rjsf/utils";
|
|
319
330
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
320
331
|
function FieldHelpTemplate(props) {
|
|
321
|
-
const {
|
|
332
|
+
const { fieldPathId, help } = props;
|
|
322
333
|
if (!help) {
|
|
323
334
|
return null;
|
|
324
335
|
}
|
|
325
|
-
const id = helpId(
|
|
336
|
+
const id = helpId(fieldPathId);
|
|
326
337
|
return /* @__PURE__ */ jsx9(FormHelperText2, { component: "div", id, children: help });
|
|
327
338
|
}
|
|
328
339
|
|
|
@@ -344,8 +355,9 @@ function FieldTemplate(props) {
|
|
|
344
355
|
displayLabel,
|
|
345
356
|
hidden,
|
|
346
357
|
label,
|
|
347
|
-
|
|
348
|
-
|
|
358
|
+
onKeyRename,
|
|
359
|
+
onKeyRenameBlur,
|
|
360
|
+
onRemoveProperty,
|
|
349
361
|
readonly,
|
|
350
362
|
required,
|
|
351
363
|
rawErrors = [],
|
|
@@ -374,8 +386,9 @@ function FieldTemplate(props) {
|
|
|
374
386
|
disabled,
|
|
375
387
|
id,
|
|
376
388
|
label,
|
|
377
|
-
|
|
378
|
-
|
|
389
|
+
onKeyRename,
|
|
390
|
+
onKeyRenameBlur,
|
|
391
|
+
onRemoveProperty,
|
|
379
392
|
readonly,
|
|
380
393
|
required,
|
|
381
394
|
schema,
|
|
@@ -399,6 +412,18 @@ function GridTemplate(props) {
|
|
|
399
412
|
return /* @__PURE__ */ jsx11(Grid3, { container: !column, ...rest, children });
|
|
400
413
|
}
|
|
401
414
|
|
|
415
|
+
// src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
|
|
416
|
+
import Box4 from "@mui/material/Box";
|
|
417
|
+
import FormControl2 from "@mui/material/FormControl";
|
|
418
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
419
|
+
function MultiSchemaFieldTemplate(props) {
|
|
420
|
+
const { optionSchemaField, selector } = props;
|
|
421
|
+
return /* @__PURE__ */ jsxs6(Box4, { sx: { mb: 2 }, children: [
|
|
422
|
+
/* @__PURE__ */ jsx12(FormControl2, { fullWidth: true, sx: { mb: 2 }, children: selector }),
|
|
423
|
+
optionSchemaField
|
|
424
|
+
] });
|
|
425
|
+
}
|
|
426
|
+
|
|
402
427
|
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
403
428
|
import Grid4 from "@mui/material/Grid";
|
|
404
429
|
import {
|
|
@@ -409,7 +434,7 @@ import {
|
|
|
409
434
|
titleId,
|
|
410
435
|
buttonId as buttonId2
|
|
411
436
|
} from "@rjsf/utils";
|
|
412
|
-
import { Fragment as Fragment2, jsx as
|
|
437
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
413
438
|
function ObjectFieldTemplate(props) {
|
|
414
439
|
const {
|
|
415
440
|
description,
|
|
@@ -419,10 +444,11 @@ function ObjectFieldTemplate(props) {
|
|
|
419
444
|
disabled,
|
|
420
445
|
readonly,
|
|
421
446
|
uiSchema,
|
|
422
|
-
|
|
447
|
+
fieldPathId,
|
|
423
448
|
schema,
|
|
424
449
|
formData,
|
|
425
|
-
|
|
450
|
+
optionalDataControl,
|
|
451
|
+
onAddProperty,
|
|
426
452
|
registry
|
|
427
453
|
} = props;
|
|
428
454
|
const uiOptions = getUiOptions4(uiSchema);
|
|
@@ -432,45 +458,48 @@ function ObjectFieldTemplate(props) {
|
|
|
432
458
|
registry,
|
|
433
459
|
uiOptions
|
|
434
460
|
);
|
|
461
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
435
462
|
const {
|
|
436
463
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
437
464
|
} = registry.templates;
|
|
438
|
-
return /* @__PURE__ */
|
|
439
|
-
title && /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
466
|
+
title && /* @__PURE__ */ jsx13(
|
|
440
467
|
TitleFieldTemplate,
|
|
441
468
|
{
|
|
442
|
-
id: titleId(
|
|
469
|
+
id: titleId(fieldPathId),
|
|
443
470
|
title,
|
|
444
471
|
required,
|
|
445
472
|
schema,
|
|
446
473
|
uiSchema,
|
|
447
|
-
registry
|
|
474
|
+
registry,
|
|
475
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
448
476
|
}
|
|
449
477
|
),
|
|
450
|
-
description && /* @__PURE__ */
|
|
478
|
+
description && /* @__PURE__ */ jsx13(
|
|
451
479
|
DescriptionFieldTemplate,
|
|
452
480
|
{
|
|
453
|
-
id: descriptionId(
|
|
481
|
+
id: descriptionId(fieldPathId),
|
|
454
482
|
description,
|
|
455
483
|
schema,
|
|
456
484
|
uiSchema,
|
|
457
485
|
registry
|
|
458
486
|
}
|
|
459
487
|
),
|
|
460
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ jsxs7(Grid4, { container: true, spacing: 2, style: { marginTop: "10px" }, children: [
|
|
489
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
461
490
|
properties.map(
|
|
462
491
|
(element, index) => (
|
|
463
492
|
// Remove the <Grid> if the inner element is hidden as the <Grid>
|
|
464
493
|
// itself would otherwise still take up space.
|
|
465
|
-
element.hidden ? element.content : /* @__PURE__ */
|
|
494
|
+
element.hidden ? element.content : /* @__PURE__ */ jsx13(Grid4, { size: { xs: 12 }, style: { marginBottom: "10px" }, children: element.content }, index)
|
|
466
495
|
)
|
|
467
496
|
),
|
|
468
|
-
canExpand(schema, uiSchema, formData) && /* @__PURE__ */
|
|
497
|
+
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx13(Grid4, { container: true, justifyContent: "flex-end", children: /* @__PURE__ */ jsx13(Grid4, { children: /* @__PURE__ */ jsx13(
|
|
469
498
|
AddButton2,
|
|
470
499
|
{
|
|
471
|
-
id: buttonId2(
|
|
500
|
+
id: buttonId2(fieldPathId, "add"),
|
|
472
501
|
className: "rjsf-object-property-expand",
|
|
473
|
-
onClick:
|
|
502
|
+
onClick: onAddProperty,
|
|
474
503
|
disabled: disabled || readonly,
|
|
475
504
|
uiSchema,
|
|
476
505
|
registry
|
|
@@ -480,43 +509,84 @@ function ObjectFieldTemplate(props) {
|
|
|
480
509
|
] });
|
|
481
510
|
}
|
|
482
511
|
|
|
512
|
+
// src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
|
|
513
|
+
import AddIcon2 from "@mui/icons-material/Add";
|
|
514
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
515
|
+
function OptionalDataControlsTemplate(props) {
|
|
516
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
517
|
+
if (onAddClick) {
|
|
518
|
+
return /* @__PURE__ */ jsx14(
|
|
519
|
+
MuiIconButton,
|
|
520
|
+
{
|
|
521
|
+
id,
|
|
522
|
+
registry,
|
|
523
|
+
className: "rjsf-add-optional-data",
|
|
524
|
+
onClick: onAddClick,
|
|
525
|
+
title: label,
|
|
526
|
+
icon: /* @__PURE__ */ jsx14(AddIcon2, { fontSize: "small" })
|
|
527
|
+
}
|
|
528
|
+
);
|
|
529
|
+
} else if (onRemoveClick) {
|
|
530
|
+
return /* @__PURE__ */ jsx14(
|
|
531
|
+
RemoveButton,
|
|
532
|
+
{
|
|
533
|
+
id,
|
|
534
|
+
registry,
|
|
535
|
+
className: "rjsf-remove-optional-data",
|
|
536
|
+
onClick: onRemoveClick,
|
|
537
|
+
title: label
|
|
538
|
+
}
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
return /* @__PURE__ */ jsx14("em", { id, children: label });
|
|
542
|
+
}
|
|
543
|
+
|
|
483
544
|
// src/SubmitButton/SubmitButton.tsx
|
|
484
|
-
import
|
|
545
|
+
import Box5 from "@mui/material/Box";
|
|
485
546
|
import Button from "@mui/material/Button";
|
|
486
547
|
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
487
|
-
import { jsx as
|
|
548
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
488
549
|
function SubmitButton({ uiSchema }) {
|
|
489
550
|
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
490
551
|
if (norender) {
|
|
491
552
|
return null;
|
|
492
553
|
}
|
|
493
|
-
return /* @__PURE__ */
|
|
554
|
+
return /* @__PURE__ */ jsx15(Box5, { marginTop: 3, children: /* @__PURE__ */ jsx15(Button, { type: "submit", variant: "contained", color: "primary", ...submitButtonProps, children: submitText }) });
|
|
494
555
|
}
|
|
495
556
|
|
|
496
557
|
// src/TitleField/TitleField.tsx
|
|
497
|
-
import
|
|
558
|
+
import Box6 from "@mui/material/Box";
|
|
498
559
|
import Divider from "@mui/material/Divider";
|
|
560
|
+
import Grid5 from "@mui/material/Grid";
|
|
499
561
|
import Typography4 from "@mui/material/Typography";
|
|
500
|
-
import { jsx as
|
|
562
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
501
563
|
function TitleField({
|
|
502
564
|
id,
|
|
503
|
-
title
|
|
565
|
+
title,
|
|
566
|
+
optionalDataControl
|
|
504
567
|
}) {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
/* @__PURE__ */
|
|
568
|
+
let heading = /* @__PURE__ */ jsx16(Typography4, { variant: "h5", children: title });
|
|
569
|
+
if (optionalDataControl) {
|
|
570
|
+
heading = /* @__PURE__ */ jsxs8(Grid5, { container: true, spacing: 0, children: [
|
|
571
|
+
/* @__PURE__ */ jsx16(Grid5, { size: "grow", children: heading }),
|
|
572
|
+
/* @__PURE__ */ jsx16(Grid5, { justifyContent: "flex-end", children: optionalDataControl })
|
|
573
|
+
] });
|
|
574
|
+
}
|
|
575
|
+
return /* @__PURE__ */ jsxs8(Box6, { id, mb: 1, mt: 1, children: [
|
|
576
|
+
heading,
|
|
577
|
+
/* @__PURE__ */ jsx16(Divider, {})
|
|
508
578
|
] });
|
|
509
579
|
}
|
|
510
580
|
|
|
511
581
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
512
|
-
import
|
|
582
|
+
import Grid6 from "@mui/material/Grid";
|
|
513
583
|
import TextField2 from "@mui/material/TextField";
|
|
514
584
|
import {
|
|
515
585
|
ADDITIONAL_PROPERTY_FLAG,
|
|
516
586
|
buttonId as buttonId3,
|
|
517
587
|
TranslatableString as TranslatableString4
|
|
518
588
|
} from "@rjsf/utils";
|
|
519
|
-
import { jsx as
|
|
589
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
520
590
|
function WrapIfAdditionalTemplate(props) {
|
|
521
591
|
const {
|
|
522
592
|
children,
|
|
@@ -525,8 +595,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
525
595
|
disabled,
|
|
526
596
|
id,
|
|
527
597
|
label,
|
|
528
|
-
|
|
529
|
-
|
|
598
|
+
onKeyRenameBlur,
|
|
599
|
+
onRemoveProperty,
|
|
530
600
|
readonly,
|
|
531
601
|
required,
|
|
532
602
|
schema,
|
|
@@ -544,11 +614,10 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
544
614
|
fontWeight: "bold"
|
|
545
615
|
};
|
|
546
616
|
if (!additional) {
|
|
547
|
-
return /* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ jsx17("div", { className: classNames, style, children });
|
|
548
618
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
/* @__PURE__ */ jsx15(Grid5, { size: "auto", children: /* @__PURE__ */ jsx15(
|
|
619
|
+
return /* @__PURE__ */ jsxs9(Grid6, { container: true, alignItems: "center", spacing: 2, className: classNames, style, children: [
|
|
620
|
+
/* @__PURE__ */ jsx17(Grid6, { size: "auto", children: /* @__PURE__ */ jsx17(
|
|
552
621
|
TextField2,
|
|
553
622
|
{
|
|
554
623
|
fullWidth: true,
|
|
@@ -558,12 +627,12 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
558
627
|
disabled: disabled || readonly,
|
|
559
628
|
id: `${id}-key`,
|
|
560
629
|
name: `${id}-key`,
|
|
561
|
-
onBlur: !readonly ?
|
|
630
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
562
631
|
type: "text"
|
|
563
632
|
}
|
|
564
633
|
) }),
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ jsx17(Grid6, { size: "auto", children }),
|
|
635
|
+
/* @__PURE__ */ jsx17(Grid6, { children: /* @__PURE__ */ jsx17(
|
|
567
636
|
RemoveButton2,
|
|
568
637
|
{
|
|
569
638
|
id: buttonId3(id, "remove"),
|
|
@@ -571,7 +640,7 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
571
640
|
iconType: "default",
|
|
572
641
|
style: btnStyle,
|
|
573
642
|
disabled: disabled || readonly,
|
|
574
|
-
onClick:
|
|
643
|
+
onClick: onRemoveProperty,
|
|
575
644
|
uiSchema,
|
|
576
645
|
registry
|
|
577
646
|
}
|
|
@@ -599,7 +668,9 @@ function generateTemplates() {
|
|
|
599
668
|
FieldHelpTemplate,
|
|
600
669
|
FieldTemplate,
|
|
601
670
|
GridTemplate,
|
|
671
|
+
MultiSchemaFieldTemplate,
|
|
602
672
|
ObjectFieldTemplate,
|
|
673
|
+
OptionalDataControlsTemplate,
|
|
603
674
|
TitleFieldTemplate: TitleField,
|
|
604
675
|
WrapIfAdditionalTemplate
|
|
605
676
|
};
|
|
@@ -616,11 +687,12 @@ import {
|
|
|
616
687
|
labelValue as labelValue2,
|
|
617
688
|
schemaRequiresTrueValue
|
|
618
689
|
} from "@rjsf/utils";
|
|
619
|
-
import { Fragment as Fragment3, jsx as
|
|
690
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
620
691
|
function CheckboxWidget(props) {
|
|
621
692
|
const {
|
|
622
693
|
schema,
|
|
623
694
|
id,
|
|
695
|
+
htmlName,
|
|
624
696
|
value,
|
|
625
697
|
disabled,
|
|
626
698
|
readonly,
|
|
@@ -641,11 +713,11 @@ function CheckboxWidget(props) {
|
|
|
641
713
|
);
|
|
642
714
|
const required = schemaRequiresTrueValue(schema);
|
|
643
715
|
const _onChange = (_, checked) => onChange(checked);
|
|
644
|
-
const _onBlur = (
|
|
645
|
-
const _onFocus = (
|
|
716
|
+
const _onBlur = () => onBlur(id, value);
|
|
717
|
+
const _onFocus = () => onFocus(id, value);
|
|
646
718
|
const description = options.description ?? schema.description;
|
|
647
|
-
return /* @__PURE__ */
|
|
648
|
-
!hideLabel && description && /* @__PURE__ */
|
|
719
|
+
return /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
720
|
+
!hideLabel && description && /* @__PURE__ */ jsx18(
|
|
649
721
|
DescriptionFieldTemplate,
|
|
650
722
|
{
|
|
651
723
|
id: descriptionId2(id),
|
|
@@ -655,14 +727,14 @@ function CheckboxWidget(props) {
|
|
|
655
727
|
registry
|
|
656
728
|
}
|
|
657
729
|
),
|
|
658
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ jsx18(
|
|
659
731
|
FormControlLabel,
|
|
660
732
|
{
|
|
661
|
-
control: /* @__PURE__ */
|
|
733
|
+
control: /* @__PURE__ */ jsx18(
|
|
662
734
|
Checkbox,
|
|
663
735
|
{
|
|
664
736
|
id,
|
|
665
|
-
name: id,
|
|
737
|
+
name: htmlName || id,
|
|
666
738
|
checked: typeof value === "undefined" ? false : Boolean(value),
|
|
667
739
|
required,
|
|
668
740
|
disabled: disabled || readonly,
|
|
@@ -693,11 +765,12 @@ import {
|
|
|
693
765
|
labelValue as labelValue3,
|
|
694
766
|
optionId
|
|
695
767
|
} from "@rjsf/utils";
|
|
696
|
-
import { Fragment as Fragment4, jsx as
|
|
768
|
+
import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
697
769
|
function CheckboxesWidget({
|
|
698
770
|
label,
|
|
699
771
|
hideLabel,
|
|
700
772
|
id,
|
|
773
|
+
htmlName,
|
|
701
774
|
disabled,
|
|
702
775
|
options,
|
|
703
776
|
value,
|
|
@@ -719,19 +792,19 @@ function CheckboxesWidget({
|
|
|
719
792
|
};
|
|
720
793
|
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
|
|
721
794
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
|
|
722
|
-
return /* @__PURE__ */
|
|
795
|
+
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
723
796
|
labelValue3(
|
|
724
|
-
/* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ jsx19(FormLabel, { required, htmlFor: id, children: label || void 0 }),
|
|
725
798
|
hideLabel
|
|
726
799
|
),
|
|
727
|
-
/* @__PURE__ */
|
|
800
|
+
/* @__PURE__ */ jsx19(FormGroup, { id, row: !!inline, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
728
801
|
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
729
802
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
730
|
-
const checkbox = /* @__PURE__ */
|
|
803
|
+
const checkbox = /* @__PURE__ */ jsx19(
|
|
731
804
|
Checkbox2,
|
|
732
805
|
{
|
|
733
806
|
id: optionId(id, index),
|
|
734
|
-
name: id,
|
|
807
|
+
name: htmlName || id,
|
|
735
808
|
checked,
|
|
736
809
|
disabled: disabled || itemDisabled || readonly,
|
|
737
810
|
autoFocus: autofocus && index === 0,
|
|
@@ -741,7 +814,7 @@ function CheckboxesWidget({
|
|
|
741
814
|
"aria-describedby": ariaDescribedByIds3(id)
|
|
742
815
|
}
|
|
743
816
|
);
|
|
744
|
-
return /* @__PURE__ */
|
|
817
|
+
return /* @__PURE__ */ jsx19(FormControlLabel2, { control: checkbox, label: option.label }, index);
|
|
745
818
|
}) })
|
|
746
819
|
] });
|
|
747
820
|
}
|
|
@@ -758,9 +831,10 @@ import {
|
|
|
758
831
|
labelValue as labelValue4,
|
|
759
832
|
optionId as optionId2
|
|
760
833
|
} from "@rjsf/utils";
|
|
761
|
-
import { Fragment as Fragment5, jsx as
|
|
834
|
+
import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
762
835
|
function RadioWidget({
|
|
763
836
|
id,
|
|
837
|
+
htmlName,
|
|
764
838
|
options,
|
|
765
839
|
value,
|
|
766
840
|
required,
|
|
@@ -778,16 +852,16 @@ function RadioWidget({
|
|
|
778
852
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
|
|
779
853
|
const row = options ? options.inline : false;
|
|
780
854
|
const selectedIndex = enumOptionsIndexForValue(value, enumOptions) ?? null;
|
|
781
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
782
856
|
labelValue4(
|
|
783
|
-
/* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ jsx20(FormLabel2, { required, htmlFor: id, children: label || void 0 }),
|
|
784
858
|
hideLabel
|
|
785
859
|
),
|
|
786
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ jsx20(
|
|
787
861
|
RadioGroup,
|
|
788
862
|
{
|
|
789
863
|
id,
|
|
790
|
-
name: id,
|
|
864
|
+
name: htmlName || id,
|
|
791
865
|
value: selectedIndex,
|
|
792
866
|
row,
|
|
793
867
|
onChange: _onChange,
|
|
@@ -796,10 +870,10 @@ function RadioWidget({
|
|
|
796
870
|
"aria-describedby": ariaDescribedByIds4(id),
|
|
797
871
|
children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
798
872
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
799
|
-
const radio = /* @__PURE__ */
|
|
873
|
+
const radio = /* @__PURE__ */ jsx20(
|
|
800
874
|
FormControlLabel3,
|
|
801
875
|
{
|
|
802
|
-
control: /* @__PURE__ */
|
|
876
|
+
control: /* @__PURE__ */ jsx20(Radio, { name: htmlName || id, id: optionId2(id, index), color: "primary" }),
|
|
803
877
|
label: option.label,
|
|
804
878
|
value: String(index),
|
|
805
879
|
disabled: disabled || itemDisabled || readonly
|
|
@@ -821,7 +895,7 @@ import {
|
|
|
821
895
|
labelValue as labelValue5,
|
|
822
896
|
rangeSpec
|
|
823
897
|
} from "@rjsf/utils";
|
|
824
|
-
import { Fragment as Fragment6, jsx as
|
|
898
|
+
import { Fragment as Fragment6, jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
825
899
|
function RangeWidget(props) {
|
|
826
900
|
const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, required, label, hideLabel, id } = props;
|
|
827
901
|
const sliderProps = { value, label, id, name: id, ...rangeSpec(schema) };
|
|
@@ -830,12 +904,12 @@ function RangeWidget(props) {
|
|
|
830
904
|
};
|
|
831
905
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
832
906
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
833
|
-
return /* @__PURE__ */
|
|
907
|
+
return /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
834
908
|
labelValue5(
|
|
835
|
-
/* @__PURE__ */
|
|
909
|
+
/* @__PURE__ */ jsx21(FormLabel3, { required, htmlFor: id, children: label || void 0 }),
|
|
836
910
|
hideLabel
|
|
837
911
|
),
|
|
838
|
-
/* @__PURE__ */
|
|
912
|
+
/* @__PURE__ */ jsx21(
|
|
839
913
|
Slider,
|
|
840
914
|
{
|
|
841
915
|
disabled: disabled || readonly,
|
|
@@ -859,12 +933,13 @@ import {
|
|
|
859
933
|
enumOptionsValueForIndex as enumOptionsValueForIndex3,
|
|
860
934
|
labelValue as labelValue6
|
|
861
935
|
} from "@rjsf/utils";
|
|
862
|
-
import { jsx as
|
|
936
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
863
937
|
function SelectWidget({
|
|
864
938
|
schema,
|
|
865
939
|
id,
|
|
866
940
|
name,
|
|
867
941
|
// remove this from textFieldProps
|
|
942
|
+
htmlName,
|
|
868
943
|
options,
|
|
869
944
|
label,
|
|
870
945
|
hideLabel,
|
|
@@ -883,7 +958,6 @@ function SelectWidget({
|
|
|
883
958
|
registry,
|
|
884
959
|
uiSchema,
|
|
885
960
|
hideError,
|
|
886
|
-
formContext,
|
|
887
961
|
...textFieldProps
|
|
888
962
|
}) {
|
|
889
963
|
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
@@ -896,11 +970,11 @@ function SelectWidget({
|
|
|
896
970
|
const selectedIndexes = enumOptionsIndexForValue2(value, enumOptions, multiple);
|
|
897
971
|
const { InputLabelProps, SelectProps, autocomplete, ...textFieldRemainingProps } = textFieldProps;
|
|
898
972
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
899
|
-
return /* @__PURE__ */
|
|
973
|
+
return /* @__PURE__ */ jsxs14(
|
|
900
974
|
TextField3,
|
|
901
975
|
{
|
|
902
976
|
id,
|
|
903
|
-
name: id,
|
|
977
|
+
name: htmlName || id,
|
|
904
978
|
label: labelValue6(label || void 0, hideLabel, void 0),
|
|
905
979
|
value: !isEmpty && typeof selectedIndexes !== "undefined" ? selectedIndexes : emptyValue,
|
|
906
980
|
required,
|
|
@@ -924,10 +998,10 @@ function SelectWidget({
|
|
|
924
998
|
},
|
|
925
999
|
"aria-describedby": ariaDescribedByIds6(id),
|
|
926
1000
|
children: [
|
|
927
|
-
showPlaceholderOption && /* @__PURE__ */
|
|
1001
|
+
showPlaceholderOption && /* @__PURE__ */ jsx22(MenuItem, { value: "", children: placeholder }),
|
|
928
1002
|
Array.isArray(enumOptions) && enumOptions.map(({ value: value2, label: label2 }, i) => {
|
|
929
1003
|
const disabled2 = Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1;
|
|
930
|
-
return /* @__PURE__ */
|
|
1004
|
+
return /* @__PURE__ */ jsx22(MenuItem, { value: String(i), disabled: disabled2, children: label2 }, i);
|
|
931
1005
|
})
|
|
932
1006
|
]
|
|
933
1007
|
}
|
|
@@ -936,7 +1010,7 @@ function SelectWidget({
|
|
|
936
1010
|
|
|
937
1011
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
938
1012
|
import { getTemplate as getTemplate6 } from "@rjsf/utils";
|
|
939
|
-
import { jsx as
|
|
1013
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
940
1014
|
function TextareaWidget(props) {
|
|
941
1015
|
const { options, registry } = props;
|
|
942
1016
|
const BaseInputTemplate2 = getTemplate6("BaseInputTemplate", registry, options);
|
|
@@ -944,7 +1018,7 @@ function TextareaWidget(props) {
|
|
|
944
1018
|
if (typeof options.rows === "string" || typeof options.rows === "number") {
|
|
945
1019
|
rows = options.rows;
|
|
946
1020
|
}
|
|
947
|
-
return /* @__PURE__ */
|
|
1021
|
+
return /* @__PURE__ */ jsx23(BaseInputTemplate2, { ...props, multiline: true, rows });
|
|
948
1022
|
}
|
|
949
1023
|
|
|
950
1024
|
// src/Widgets/Widgets.ts
|