@rjsf/mui 6.5.3 → 6.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +203 -203
- package/dist/index.cjs.map +4 -4
- package/dist/mui.esm.js +207 -207
- package/dist/mui.esm.js.map +4 -4
- package/dist/mui.umd.js +149 -149
- package/lib/AddButton/AddButton.js.map +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.js +1 -1
- package/lib/DescriptionField/DescriptionField.js.map +1 -1
- package/lib/ErrorList/ErrorList.js.map +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/IconButton/IconButton.js +2 -2
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js.map +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -1
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/RangeWidget/RangeWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.js.map +1 -1
- package/lib/Templates/Templates.js +1 -1
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/Theme/Theme.d.ts +1 -1
- package/lib/TitleField/TitleField.js.map +1 -1
- package/lib/Widgets/Widgets.js +1 -1
- package/lib/Widgets/Widgets.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/util.d.ts +1 -1
- package/lib/util.js.map +1 -1
- package/package.json +17 -17
- package/src/AddButton/AddButton.tsx +1 -0
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +1 -0
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +1 -0
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +4 -3
- package/src/CheckboxWidget/CheckboxWidget.tsx +1 -0
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +1 -0
- package/src/DescriptionField/DescriptionField.tsx +2 -1
- package/src/ErrorList/ErrorList.tsx +1 -0
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +2 -1
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -1
- package/src/FieldTemplate/FieldTemplate.tsx +1 -0
- package/src/IconButton/IconButton.tsx +3 -2
- package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +1 -0
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +1 -0
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +1 -1
- package/src/RadioWidget/RadioWidget.tsx +1 -0
- package/src/RangeWidget/RangeWidget.tsx +1 -0
- package/src/SelectWidget/SelectWidget.tsx +3 -2
- package/src/SubmitButton/SubmitButton.tsx +1 -0
- package/src/Templates/Templates.ts +1 -1
- package/src/Theme/Theme.tsx +1 -1
- package/src/TitleField/TitleField.tsx +1 -0
- package/src/Widgets/Widgets.ts +1 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +1 -0
- package/src/tsconfig.json +0 -1
- package/src/util.ts +1 -2
package/dist/index.cjs
CHANGED
|
@@ -249,10 +249,10 @@ function ArrayFieldTemplate(props) {
|
|
|
249
249
|
|
|
250
250
|
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
251
251
|
var import_react = require("react");
|
|
252
|
-
var import_TextField = __toESM(require("@mui/material/TextField"), 1);
|
|
253
252
|
var import_InputAdornment = __toESM(require("@mui/material/InputAdornment"), 1);
|
|
254
|
-
var
|
|
253
|
+
var import_TextField = __toESM(require("@mui/material/TextField"), 1);
|
|
255
254
|
var import_core = require("@rjsf/core");
|
|
255
|
+
var import_utils4 = require("@rjsf/utils");
|
|
256
256
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
257
257
|
var TYPES_THAT_SHRINK_LABEL = ["date", "datetime-local", "file", "time"];
|
|
258
258
|
function BaseInputTemplate(props) {
|
|
@@ -353,8 +353,8 @@ function BaseInputTemplate(props) {
|
|
|
353
353
|
|
|
354
354
|
// src/DescriptionField/DescriptionField.tsx
|
|
355
355
|
var import_Typography = __toESM(require("@mui/material/Typography"), 1);
|
|
356
|
-
var import_utils5 = require("@rjsf/utils");
|
|
357
356
|
var import_core2 = require("@rjsf/core");
|
|
357
|
+
var import_utils5 = require("@rjsf/utils");
|
|
358
358
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
359
359
|
function DescriptionField(props) {
|
|
360
360
|
const { id, description, registry, uiSchema } = props;
|
|
@@ -415,137 +415,46 @@ function ErrorList({
|
|
|
415
415
|
] }) });
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
-
// src/IconButton/IconButton.tsx
|
|
419
|
-
var import_IconButton2 = __toESM(require("@mui/material/IconButton"), 1);
|
|
420
|
-
var import_ArrowDownward = __toESM(require("@mui/icons-material/ArrowDownward"), 1);
|
|
421
|
-
var import_ArrowUpward = __toESM(require("@mui/icons-material/ArrowUpward"), 1);
|
|
422
|
-
var import_ContentCopy = __toESM(require("@mui/icons-material/ContentCopy"), 1);
|
|
423
|
-
var import_Remove = __toESM(require("@mui/icons-material/Remove"), 1);
|
|
424
|
-
var import_Clear = __toESM(require("@mui/icons-material/Clear"), 1);
|
|
425
|
-
var import_utils7 = require("@rjsf/utils");
|
|
426
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
427
|
-
function MuiIconButton(props) {
|
|
428
|
-
const { icon, color, uiSchema, registry, ...otherProps } = props;
|
|
429
|
-
const uiOptions = (0, import_utils7.getUiOptions)(uiSchema);
|
|
430
|
-
const muiProps = getMuiProps(uiOptions, [
|
|
431
|
-
"color",
|
|
432
|
-
"disableFocusRipple",
|
|
433
|
-
"disableRipple",
|
|
434
|
-
"edge",
|
|
435
|
-
"size",
|
|
436
|
-
"sx"
|
|
437
|
-
]);
|
|
438
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_IconButton2.default, { ...muiProps, ...otherProps, size: "small", color, children: icon });
|
|
439
|
-
}
|
|
440
|
-
function CopyButton(props) {
|
|
441
|
-
const {
|
|
442
|
-
registry: { translateString }
|
|
443
|
-
} = props;
|
|
444
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
445
|
-
MuiIconButton,
|
|
446
|
-
{
|
|
447
|
-
title: translateString(import_utils7.TranslatableString.CopyButton),
|
|
448
|
-
...props,
|
|
449
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ContentCopy.default, { fontSize: "small" })
|
|
450
|
-
}
|
|
451
|
-
);
|
|
452
|
-
}
|
|
453
|
-
function MoveDownButton(props) {
|
|
454
|
-
const {
|
|
455
|
-
registry: { translateString }
|
|
456
|
-
} = props;
|
|
457
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
458
|
-
MuiIconButton,
|
|
459
|
-
{
|
|
460
|
-
title: translateString(import_utils7.TranslatableString.MoveDownButton),
|
|
461
|
-
...props,
|
|
462
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ArrowDownward.default, { fontSize: "small" })
|
|
463
|
-
}
|
|
464
|
-
);
|
|
465
|
-
}
|
|
466
|
-
function MoveUpButton(props) {
|
|
467
|
-
const {
|
|
468
|
-
registry: { translateString }
|
|
469
|
-
} = props;
|
|
470
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
471
|
-
MuiIconButton,
|
|
472
|
-
{
|
|
473
|
-
title: translateString(import_utils7.TranslatableString.MoveUpButton),
|
|
474
|
-
...props,
|
|
475
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ArrowUpward.default, { fontSize: "small" })
|
|
476
|
-
}
|
|
477
|
-
);
|
|
478
|
-
}
|
|
479
|
-
function RemoveButton(props) {
|
|
480
|
-
const { iconType, ...otherProps } = props;
|
|
481
|
-
const {
|
|
482
|
-
registry: { translateString }
|
|
483
|
-
} = otherProps;
|
|
484
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
485
|
-
MuiIconButton,
|
|
486
|
-
{
|
|
487
|
-
title: translateString(import_utils7.TranslatableString.RemoveButton),
|
|
488
|
-
...otherProps,
|
|
489
|
-
color: "error",
|
|
490
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Remove.default, { fontSize: iconType === "default" ? void 0 : "small" })
|
|
491
|
-
}
|
|
492
|
-
);
|
|
493
|
-
}
|
|
494
|
-
function ClearButton(props) {
|
|
495
|
-
const { iconType, ...otherProps } = props;
|
|
496
|
-
const {
|
|
497
|
-
registry: { translateString }
|
|
498
|
-
} = otherProps;
|
|
499
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
500
|
-
MuiIconButton,
|
|
501
|
-
{
|
|
502
|
-
title: translateString(import_utils7.TranslatableString.ClearButton),
|
|
503
|
-
...otherProps,
|
|
504
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Clear.default, { fontSize: iconType === "default" ? void 0 : "small" })
|
|
505
|
-
}
|
|
506
|
-
);
|
|
507
|
-
}
|
|
508
|
-
|
|
509
418
|
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
510
|
-
var import_ListItem2 = __toESM(require("@mui/material/ListItem"), 1);
|
|
511
419
|
var import_FormHelperText = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
512
420
|
var import_List2 = __toESM(require("@mui/material/List"), 1);
|
|
513
|
-
var
|
|
514
|
-
var
|
|
421
|
+
var import_ListItem2 = __toESM(require("@mui/material/ListItem"), 1);
|
|
422
|
+
var import_utils7 = require("@rjsf/utils");
|
|
423
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
515
424
|
function FieldErrorTemplate(props) {
|
|
516
425
|
const { errors = [], fieldPathId, uiSchema } = props;
|
|
517
426
|
if (errors.length === 0) {
|
|
518
427
|
return null;
|
|
519
428
|
}
|
|
520
|
-
const id = (0,
|
|
521
|
-
const uiOptions = (0,
|
|
429
|
+
const id = (0, import_utils7.errorId)(fieldPathId);
|
|
430
|
+
const uiOptions = (0, import_utils7.getUiOptions)(uiSchema);
|
|
522
431
|
const muiProps = getMuiProps(uiOptions);
|
|
523
432
|
const { rjsfSlotProps: muiSlotProps } = muiProps;
|
|
524
|
-
return /* @__PURE__ */ (0,
|
|
525
|
-
return /* @__PURE__ */ (0,
|
|
433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_List2.default, { id, dense: true, disablePadding: true, ...muiSlotProps?.fieldErrorList, children: errors.map((error, i) => {
|
|
434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ListItem2.default, { disableGutters: true, ...muiSlotProps?.fieldErrorListItem, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_FormHelperText.default, { component: "div", id: `${id}-${i}`, ...muiSlotProps?.fieldErrorFormHelperText, children: error }) }, i);
|
|
526
435
|
}) });
|
|
527
436
|
}
|
|
528
437
|
|
|
529
438
|
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
530
|
-
var import_core3 = require("@rjsf/core");
|
|
531
|
-
var import_utils9 = require("@rjsf/utils");
|
|
532
439
|
var import_FormHelperText2 = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
533
|
-
var
|
|
440
|
+
var import_core3 = require("@rjsf/core");
|
|
441
|
+
var import_utils8 = require("@rjsf/utils");
|
|
442
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
534
443
|
function FieldHelpTemplate(props) {
|
|
535
444
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
536
445
|
if (!help) {
|
|
537
446
|
return null;
|
|
538
447
|
}
|
|
539
|
-
const uiOptions = (0,
|
|
448
|
+
const uiOptions = (0, import_utils8.getUiOptions)(uiSchema);
|
|
540
449
|
const { rjsfSlotProps: { helpFormHelperText } = {} } = getMuiProps(uiOptions);
|
|
541
|
-
return /* @__PURE__ */ (0,
|
|
450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
542
451
|
import_FormHelperText2.default,
|
|
543
452
|
{
|
|
544
453
|
component: "div",
|
|
545
|
-
id: (0,
|
|
454
|
+
id: (0, import_utils8.helpId)(fieldPathId),
|
|
546
455
|
...helpFormHelperText,
|
|
547
456
|
sx: computeSxProps({ mt: 0.625 }, helpFormHelperText),
|
|
548
|
-
children: /* @__PURE__ */ (0,
|
|
457
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core3.RichHelp, { help, registry, uiSchema })
|
|
549
458
|
}
|
|
550
459
|
);
|
|
551
460
|
}
|
|
@@ -553,8 +462,8 @@ function FieldHelpTemplate(props) {
|
|
|
553
462
|
// src/FieldTemplate/FieldTemplate.tsx
|
|
554
463
|
var import_FormControl = __toESM(require("@mui/material/FormControl"), 1);
|
|
555
464
|
var import_Typography3 = __toESM(require("@mui/material/Typography"), 1);
|
|
556
|
-
var
|
|
557
|
-
var
|
|
465
|
+
var import_utils9 = require("@rjsf/utils");
|
|
466
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
558
467
|
function FieldTemplate(props) {
|
|
559
468
|
const {
|
|
560
469
|
id,
|
|
@@ -579,18 +488,18 @@ function FieldTemplate(props) {
|
|
|
579
488
|
uiSchema,
|
|
580
489
|
registry
|
|
581
490
|
} = props;
|
|
582
|
-
const uiOptions = (0,
|
|
583
|
-
const WrapIfAdditionalTemplate2 = (0,
|
|
491
|
+
const uiOptions = (0, import_utils9.getUiOptions)(uiSchema);
|
|
492
|
+
const WrapIfAdditionalTemplate2 = (0, import_utils9.getTemplate)(
|
|
584
493
|
"WrapIfAdditionalTemplate",
|
|
585
494
|
registry,
|
|
586
495
|
uiOptions
|
|
587
496
|
);
|
|
588
497
|
if (hidden) {
|
|
589
|
-
return /* @__PURE__ */ (0,
|
|
498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { display: "none" }, children });
|
|
590
499
|
}
|
|
591
500
|
const isCheckbox = uiOptions.widget === "checkbox";
|
|
592
501
|
const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(uiOptions);
|
|
593
|
-
return /* @__PURE__ */ (0,
|
|
502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
594
503
|
WrapIfAdditionalTemplate2,
|
|
595
504
|
{
|
|
596
505
|
classNames,
|
|
@@ -608,7 +517,7 @@ function FieldTemplate(props) {
|
|
|
608
517
|
schema,
|
|
609
518
|
uiSchema,
|
|
610
519
|
registry,
|
|
611
|
-
children: /* @__PURE__ */ (0,
|
|
520
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
612
521
|
import_FormControl.default,
|
|
613
522
|
{
|
|
614
523
|
fullWidth: true,
|
|
@@ -619,7 +528,7 @@ function FieldTemplate(props) {
|
|
|
619
528
|
className: otherMuiProps.className,
|
|
620
529
|
children: [
|
|
621
530
|
children,
|
|
622
|
-
displayLabel && !isCheckbox && rawDescription ? /* @__PURE__ */ (0,
|
|
531
|
+
displayLabel && !isCheckbox && rawDescription ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_Typography3.default, { variant: "caption", color: "textSecondary", ...muiSlotProps?.fieldTypography, children: description }) : null,
|
|
623
532
|
errors,
|
|
624
533
|
help
|
|
625
534
|
]
|
|
@@ -631,10 +540,101 @@ function FieldTemplate(props) {
|
|
|
631
540
|
|
|
632
541
|
// src/GridTemplate/GridTemplate.tsx
|
|
633
542
|
var import_Grid3 = __toESM(require("@mui/material/Grid"), 1);
|
|
634
|
-
var
|
|
543
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
635
544
|
function GridTemplate(props) {
|
|
636
545
|
const { children, column, ...rest } = props;
|
|
637
|
-
return /* @__PURE__ */ (0,
|
|
546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_Grid3.default, { container: !column, ...rest, children });
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// src/IconButton/IconButton.tsx
|
|
550
|
+
var import_ArrowDownward = __toESM(require("@mui/icons-material/ArrowDownward"), 1);
|
|
551
|
+
var import_ArrowUpward = __toESM(require("@mui/icons-material/ArrowUpward"), 1);
|
|
552
|
+
var import_Clear = __toESM(require("@mui/icons-material/Clear"), 1);
|
|
553
|
+
var import_ContentCopy = __toESM(require("@mui/icons-material/ContentCopy"), 1);
|
|
554
|
+
var import_Remove = __toESM(require("@mui/icons-material/Remove"), 1);
|
|
555
|
+
var import_IconButton2 = __toESM(require("@mui/material/IconButton"), 1);
|
|
556
|
+
var import_utils10 = require("@rjsf/utils");
|
|
557
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
558
|
+
function MuiIconButton(props) {
|
|
559
|
+
const { icon, color, uiSchema, registry, ...otherProps } = props;
|
|
560
|
+
const uiOptions = (0, import_utils10.getUiOptions)(uiSchema);
|
|
561
|
+
const muiProps = getMuiProps(uiOptions, [
|
|
562
|
+
"color",
|
|
563
|
+
"disableFocusRipple",
|
|
564
|
+
"disableRipple",
|
|
565
|
+
"edge",
|
|
566
|
+
"size",
|
|
567
|
+
"sx"
|
|
568
|
+
]);
|
|
569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_IconButton2.default, { ...muiProps, ...otherProps, size: "small", color, children: icon });
|
|
570
|
+
}
|
|
571
|
+
function CopyButton(props) {
|
|
572
|
+
const {
|
|
573
|
+
registry: { translateString }
|
|
574
|
+
} = props;
|
|
575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
576
|
+
MuiIconButton,
|
|
577
|
+
{
|
|
578
|
+
title: translateString(import_utils10.TranslatableString.CopyButton),
|
|
579
|
+
...props,
|
|
580
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ContentCopy.default, { fontSize: "small" })
|
|
581
|
+
}
|
|
582
|
+
);
|
|
583
|
+
}
|
|
584
|
+
function MoveDownButton(props) {
|
|
585
|
+
const {
|
|
586
|
+
registry: { translateString }
|
|
587
|
+
} = props;
|
|
588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
589
|
+
MuiIconButton,
|
|
590
|
+
{
|
|
591
|
+
title: translateString(import_utils10.TranslatableString.MoveDownButton),
|
|
592
|
+
...props,
|
|
593
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ArrowDownward.default, { fontSize: "small" })
|
|
594
|
+
}
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
function MoveUpButton(props) {
|
|
598
|
+
const {
|
|
599
|
+
registry: { translateString }
|
|
600
|
+
} = props;
|
|
601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
602
|
+
MuiIconButton,
|
|
603
|
+
{
|
|
604
|
+
title: translateString(import_utils10.TranslatableString.MoveUpButton),
|
|
605
|
+
...props,
|
|
606
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ArrowUpward.default, { fontSize: "small" })
|
|
607
|
+
}
|
|
608
|
+
);
|
|
609
|
+
}
|
|
610
|
+
function RemoveButton(props) {
|
|
611
|
+
const { iconType, ...otherProps } = props;
|
|
612
|
+
const {
|
|
613
|
+
registry: { translateString }
|
|
614
|
+
} = otherProps;
|
|
615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
616
|
+
MuiIconButton,
|
|
617
|
+
{
|
|
618
|
+
title: translateString(import_utils10.TranslatableString.RemoveButton),
|
|
619
|
+
...otherProps,
|
|
620
|
+
color: "error",
|
|
621
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Remove.default, { fontSize: iconType === "default" ? void 0 : "small" })
|
|
622
|
+
}
|
|
623
|
+
);
|
|
624
|
+
}
|
|
625
|
+
function ClearButton(props) {
|
|
626
|
+
const { iconType, ...otherProps } = props;
|
|
627
|
+
const {
|
|
628
|
+
registry: { translateString }
|
|
629
|
+
} = otherProps;
|
|
630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
631
|
+
MuiIconButton,
|
|
632
|
+
{
|
|
633
|
+
title: translateString(import_utils10.TranslatableString.ClearButton),
|
|
634
|
+
...otherProps,
|
|
635
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Clear.default, { fontSize: iconType === "default" ? void 0 : "small" })
|
|
636
|
+
}
|
|
637
|
+
);
|
|
638
638
|
}
|
|
639
639
|
|
|
640
640
|
// src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
|
|
@@ -971,11 +971,84 @@ function generateTemplates() {
|
|
|
971
971
|
}
|
|
972
972
|
var Templates_default = generateTemplates();
|
|
973
973
|
|
|
974
|
-
// src/
|
|
974
|
+
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
975
975
|
var import_Checkbox = __toESM(require("@mui/material/Checkbox"), 1);
|
|
976
976
|
var import_FormControlLabel = __toESM(require("@mui/material/FormControlLabel"), 1);
|
|
977
|
+
var import_FormGroup = __toESM(require("@mui/material/FormGroup"), 1);
|
|
978
|
+
var import_FormLabel = __toESM(require("@mui/material/FormLabel"), 1);
|
|
977
979
|
var import_utils16 = require("@rjsf/utils");
|
|
978
980
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
981
|
+
var import_react2 = require("react");
|
|
982
|
+
function CheckboxesWidget(props) {
|
|
983
|
+
const {
|
|
984
|
+
label,
|
|
985
|
+
hideLabel,
|
|
986
|
+
id,
|
|
987
|
+
htmlName,
|
|
988
|
+
disabled,
|
|
989
|
+
options,
|
|
990
|
+
value,
|
|
991
|
+
autofocus,
|
|
992
|
+
readonly,
|
|
993
|
+
required,
|
|
994
|
+
onChange,
|
|
995
|
+
onBlur,
|
|
996
|
+
onFocus
|
|
997
|
+
} = props;
|
|
998
|
+
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
999
|
+
const optionValueFormat = (0, import_utils16.getOptionValueFormat)(options);
|
|
1000
|
+
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
1001
|
+
const _onChange = (index) => ({ target: { checked } }) => {
|
|
1002
|
+
if (checked) {
|
|
1003
|
+
onChange((0, import_utils16.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
|
|
1004
|
+
} else {
|
|
1005
|
+
onChange((0, import_utils16.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
const _onBlur = ({ target }) => onBlur(id, (0, import_utils16.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
|
|
1009
|
+
const _onFocus = ({ target }) => onFocus(id, (0, import_utils16.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
|
|
1010
|
+
const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(options);
|
|
1011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
1012
|
+
(0, import_utils16.labelValue)(
|
|
1013
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_FormLabel.default, { required, htmlFor: id, children: label || void 0 }),
|
|
1014
|
+
hideLabel
|
|
1015
|
+
),
|
|
1016
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_FormGroup.default, { ...otherMuiProps, ...muiSlotProps?.formGroup, id, row: !!inline, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
1017
|
+
const checked = (0, import_utils16.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
1018
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
1019
|
+
const checkbox = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1020
|
+
import_Checkbox.default,
|
|
1021
|
+
{
|
|
1022
|
+
...muiSlotProps?.checkbox,
|
|
1023
|
+
id: (0, import_utils16.optionId)(id, index),
|
|
1024
|
+
name: htmlName || id,
|
|
1025
|
+
checked,
|
|
1026
|
+
disabled: disabled || itemDisabled || readonly,
|
|
1027
|
+
autoFocus: autofocus && index === 0,
|
|
1028
|
+
onChange: _onChange(index),
|
|
1029
|
+
onBlur: _onBlur,
|
|
1030
|
+
onFocus: _onFocus,
|
|
1031
|
+
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id)
|
|
1032
|
+
}
|
|
1033
|
+
);
|
|
1034
|
+
return /* @__PURE__ */ (0, import_react2.createElement)(
|
|
1035
|
+
import_FormControlLabel.default,
|
|
1036
|
+
{
|
|
1037
|
+
...muiSlotProps?.formControlLabel,
|
|
1038
|
+
control: checkbox,
|
|
1039
|
+
key: index,
|
|
1040
|
+
label: option.label
|
|
1041
|
+
}
|
|
1042
|
+
);
|
|
1043
|
+
}) })
|
|
1044
|
+
] });
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
1048
|
+
var import_Checkbox2 = __toESM(require("@mui/material/Checkbox"), 1);
|
|
1049
|
+
var import_FormControlLabel2 = __toESM(require("@mui/material/FormControlLabel"), 1);
|
|
1050
|
+
var import_utils17 = require("@rjsf/utils");
|
|
1051
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
979
1052
|
function CheckboxWidget(props) {
|
|
980
1053
|
const {
|
|
981
1054
|
schema,
|
|
@@ -994,35 +1067,35 @@ function CheckboxWidget(props) {
|
|
|
994
1067
|
options,
|
|
995
1068
|
uiSchema
|
|
996
1069
|
} = props;
|
|
997
|
-
const DescriptionFieldTemplate = (0,
|
|
1070
|
+
const DescriptionFieldTemplate = (0, import_utils17.getTemplate)(
|
|
998
1071
|
"DescriptionFieldTemplate",
|
|
999
1072
|
registry,
|
|
1000
1073
|
options
|
|
1001
1074
|
);
|
|
1002
|
-
const required = (0,
|
|
1075
|
+
const required = (0, import_utils17.schemaRequiresTrueValue)(schema);
|
|
1003
1076
|
const _onChange = (_, checked) => onChange(checked);
|
|
1004
1077
|
const _onBlur = () => onBlur(id, value);
|
|
1005
1078
|
const _onFocus = () => onFocus(id, value);
|
|
1006
1079
|
const description = options.description ?? schema.description;
|
|
1007
1080
|
const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(options);
|
|
1008
|
-
return /* @__PURE__ */ (0,
|
|
1009
|
-
!hideLabel && description && /* @__PURE__ */ (0,
|
|
1081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1082
|
+
!hideLabel && description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1010
1083
|
DescriptionFieldTemplate,
|
|
1011
1084
|
{
|
|
1012
|
-
id: (0,
|
|
1085
|
+
id: (0, import_utils17.descriptionId)(id),
|
|
1013
1086
|
description,
|
|
1014
1087
|
schema,
|
|
1015
1088
|
uiSchema,
|
|
1016
1089
|
registry
|
|
1017
1090
|
}
|
|
1018
1091
|
),
|
|
1019
|
-
/* @__PURE__ */ (0,
|
|
1020
|
-
|
|
1092
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1093
|
+
import_FormControlLabel2.default,
|
|
1021
1094
|
{
|
|
1022
1095
|
...otherMuiProps,
|
|
1023
1096
|
...muiSlotProps?.formControlLabel,
|
|
1024
|
-
control: /* @__PURE__ */ (0,
|
|
1025
|
-
|
|
1097
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1098
|
+
import_Checkbox2.default,
|
|
1026
1099
|
{
|
|
1027
1100
|
id,
|
|
1028
1101
|
name: htmlName || id,
|
|
@@ -1033,89 +1106,16 @@ function CheckboxWidget(props) {
|
|
|
1033
1106
|
onChange: _onChange,
|
|
1034
1107
|
onBlur: _onBlur,
|
|
1035
1108
|
onFocus: _onFocus,
|
|
1036
|
-
"aria-describedby": (0,
|
|
1109
|
+
"aria-describedby": (0, import_utils17.ariaDescribedByIds)(id),
|
|
1037
1110
|
...muiSlotProps?.checkbox
|
|
1038
1111
|
}
|
|
1039
1112
|
),
|
|
1040
|
-
label: (0,
|
|
1113
|
+
label: (0, import_utils17.labelValue)(label, hideLabel, false)
|
|
1041
1114
|
}
|
|
1042
1115
|
)
|
|
1043
1116
|
] });
|
|
1044
1117
|
}
|
|
1045
1118
|
|
|
1046
|
-
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
1047
|
-
var import_Checkbox2 = __toESM(require("@mui/material/Checkbox"), 1);
|
|
1048
|
-
var import_FormControlLabel2 = __toESM(require("@mui/material/FormControlLabel"), 1);
|
|
1049
|
-
var import_FormGroup = __toESM(require("@mui/material/FormGroup"), 1);
|
|
1050
|
-
var import_FormLabel = __toESM(require("@mui/material/FormLabel"), 1);
|
|
1051
|
-
var import_utils17 = require("@rjsf/utils");
|
|
1052
|
-
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1053
|
-
var import_react2 = require("react");
|
|
1054
|
-
function CheckboxesWidget(props) {
|
|
1055
|
-
const {
|
|
1056
|
-
label,
|
|
1057
|
-
hideLabel,
|
|
1058
|
-
id,
|
|
1059
|
-
htmlName,
|
|
1060
|
-
disabled,
|
|
1061
|
-
options,
|
|
1062
|
-
value,
|
|
1063
|
-
autofocus,
|
|
1064
|
-
readonly,
|
|
1065
|
-
required,
|
|
1066
|
-
onChange,
|
|
1067
|
-
onBlur,
|
|
1068
|
-
onFocus
|
|
1069
|
-
} = props;
|
|
1070
|
-
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
1071
|
-
const optionValueFormat = (0, import_utils17.getOptionValueFormat)(options);
|
|
1072
|
-
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
1073
|
-
const _onChange = (index) => ({ target: { checked } }) => {
|
|
1074
|
-
if (checked) {
|
|
1075
|
-
onChange((0, import_utils17.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
|
|
1076
|
-
} else {
|
|
1077
|
-
onChange((0, import_utils17.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
|
|
1078
|
-
}
|
|
1079
|
-
};
|
|
1080
|
-
const _onBlur = ({ target }) => onBlur(id, (0, import_utils17.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
|
|
1081
|
-
const _onFocus = ({ target }) => onFocus(id, (0, import_utils17.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
|
|
1082
|
-
const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(options);
|
|
1083
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1084
|
-
(0, import_utils17.labelValue)(
|
|
1085
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_FormLabel.default, { required, htmlFor: id, children: label || void 0 }),
|
|
1086
|
-
hideLabel
|
|
1087
|
-
),
|
|
1088
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_FormGroup.default, { ...otherMuiProps, ...muiSlotProps?.formGroup, id, row: !!inline, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
1089
|
-
const checked = (0, import_utils17.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
1090
|
-
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
1091
|
-
const checkbox = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1092
|
-
import_Checkbox2.default,
|
|
1093
|
-
{
|
|
1094
|
-
...muiSlotProps?.checkbox,
|
|
1095
|
-
id: (0, import_utils17.optionId)(id, index),
|
|
1096
|
-
name: htmlName || id,
|
|
1097
|
-
checked,
|
|
1098
|
-
disabled: disabled || itemDisabled || readonly,
|
|
1099
|
-
autoFocus: autofocus && index === 0,
|
|
1100
|
-
onChange: _onChange(index),
|
|
1101
|
-
onBlur: _onBlur,
|
|
1102
|
-
onFocus: _onFocus,
|
|
1103
|
-
"aria-describedby": (0, import_utils17.ariaDescribedByIds)(id)
|
|
1104
|
-
}
|
|
1105
|
-
);
|
|
1106
|
-
return /* @__PURE__ */ (0, import_react2.createElement)(
|
|
1107
|
-
import_FormControlLabel2.default,
|
|
1108
|
-
{
|
|
1109
|
-
...muiSlotProps?.formControlLabel,
|
|
1110
|
-
control: checkbox,
|
|
1111
|
-
key: index,
|
|
1112
|
-
label: option.label
|
|
1113
|
-
}
|
|
1114
|
-
);
|
|
1115
|
-
}) })
|
|
1116
|
-
] });
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
1119
|
// src/RadioWidget/RadioWidget.tsx
|
|
1120
1120
|
var import_FormControlLabel3 = __toESM(require("@mui/material/FormControlLabel"), 1);
|
|
1121
1121
|
var import_FormLabel2 = __toESM(require("@mui/material/FormLabel"), 1);
|