@rjsf/mantine 6.6.2 → 6.7.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/LICENSE.md +201 -0
- package/dist/index.cjs +256 -229
- package/dist/index.cjs.map +4 -4
- package/dist/mantine.esm.js +147 -118
- package/dist/mantine.esm.js.map +4 -4
- package/dist/mantine.umd.js +50 -28
- package/lib/templates/ArrayFieldItemTemplate.d.ts +1 -1
- package/lib/templates/ArrayFieldTemplate.d.ts +1 -1
- package/lib/templates/ArrayFieldTitleTemplate.d.ts +1 -1
- package/lib/templates/BaseInputTemplate.d.ts +1 -1
- package/lib/templates/BaseInputTemplate.js +4 -2
- package/lib/templates/BaseInputTemplate.js.map +1 -1
- package/lib/templates/ButtonTemplates/AddButton.d.ts +1 -1
- package/lib/templates/ButtonTemplates/IconButton.d.ts +6 -6
- package/lib/templates/ButtonTemplates/SubmitButton.d.ts +1 -1
- package/lib/templates/CyclicSchemaExpandTemplate.d.ts +6 -0
- package/lib/templates/CyclicSchemaExpandTemplate.js +15 -0
- package/lib/templates/CyclicSchemaExpandTemplate.js.map +1 -0
- package/lib/templates/DescriptionField.d.ts +1 -1
- package/lib/templates/ErrorList.d.ts +1 -1
- package/lib/templates/FieldErrorTemplate.d.ts +1 -1
- package/lib/templates/FieldErrorTemplate.js +1 -1
- package/lib/templates/FieldErrorTemplate.js.map +1 -1
- package/lib/templates/FieldHelpTemplate.d.ts +1 -1
- package/lib/templates/FieldTemplate.d.ts +1 -1
- package/lib/templates/GridTemplate.d.ts +1 -1
- package/lib/templates/MultiSchemaFieldTemplate.d.ts +1 -1
- package/lib/templates/ObjectFieldTemplate.d.ts +1 -1
- package/lib/templates/OptionalDataControlsTemplate.d.ts +1 -1
- package/lib/templates/TitleField.d.ts +1 -1
- package/lib/templates/WrapIfAdditionalTemplate.d.ts +1 -1
- package/lib/templates/icons.d.ts +6 -6
- package/lib/templates/index.js +2 -0
- package/lib/templates/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/widgets/CheckboxesWidget.d.ts +1 -1
- package/lib/widgets/ColorWidget.d.ts +1 -1
- package/lib/widgets/ColorWidget.js +2 -2
- package/lib/widgets/ColorWidget.js.map +1 -1
- package/lib/widgets/DateTime/AltDateTimeWidget.d.ts +1 -1
- package/lib/widgets/DateTime/AltDateWidget.d.ts +1 -1
- package/lib/widgets/DateTime/DateTimeInput.d.ts +1 -1
- package/lib/widgets/DateTime/DateTimeWidget.d.ts +1 -1
- package/lib/widgets/DateTime/DateWidget.d.ts +1 -1
- package/lib/widgets/DateTime/TimeWidget.d.ts +1 -1
- package/lib/widgets/DateTime/TimeWidget.js +2 -2
- package/lib/widgets/DateTime/TimeWidget.js.map +1 -1
- package/lib/widgets/FileWidget.d.ts +1 -1
- package/lib/widgets/PasswordWidget.d.ts +1 -1
- package/lib/widgets/PasswordWidget.js +2 -2
- package/lib/widgets/PasswordWidget.js.map +1 -1
- package/lib/widgets/RadioWidget.d.ts +1 -1
- package/lib/widgets/RadioWidget.js +2 -2
- package/lib/widgets/RadioWidget.js.map +1 -1
- package/lib/widgets/RangeWidget.d.ts +1 -1
- package/lib/widgets/SelectWidget.d.ts +1 -1
- package/lib/widgets/SelectWidget.js +7 -6
- package/lib/widgets/SelectWidget.js.map +1 -1
- package/lib/widgets/TextareaWidget.js +2 -2
- package/lib/widgets/TextareaWidget.js.map +1 -1
- package/package.json +27 -24
- package/src/templates/BaseInputTemplate.tsx +2 -2
- package/src/templates/CyclicSchemaExpandTemplate.tsx +34 -0
- package/src/templates/FieldErrorTemplate.tsx +1 -1
- package/src/templates/index.ts +2 -0
- package/src/widgets/ColorWidget.tsx +2 -2
- package/src/widgets/DateTime/TimeWidget.tsx +2 -2
- package/src/widgets/PasswordWidget.tsx +2 -2
- package/src/widgets/RadioWidget.tsx +2 -2
- package/src/widgets/SelectWidget.tsx +21 -12
- package/src/widgets/TextareaWidget.tsx +2 -2
package/dist/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@ __export(index_exports, {
|
|
|
43
43
|
module.exports = __toCommonJS(index_exports);
|
|
44
44
|
|
|
45
45
|
// src/Form/index.ts
|
|
46
|
-
var
|
|
46
|
+
var import_core31 = require("@rjsf/core");
|
|
47
47
|
|
|
48
48
|
// src/templates/ArrayFieldItemTemplate.tsx
|
|
49
49
|
var import_core = require("@mantine/core");
|
|
@@ -246,13 +246,13 @@ function BaseInputTemplate(props) {
|
|
|
246
246
|
);
|
|
247
247
|
const handleBlur = (0, import_react.useCallback)(
|
|
248
248
|
(e) => {
|
|
249
|
-
onBlur(id, e.target
|
|
249
|
+
onBlur(id, e.target?.value);
|
|
250
250
|
},
|
|
251
251
|
[onBlur, id]
|
|
252
252
|
);
|
|
253
253
|
const handleFocus = (0, import_react.useCallback)(
|
|
254
254
|
(e) => {
|
|
255
|
-
onFocus(id, e.target
|
|
255
|
+
onFocus(id, e.target?.value);
|
|
256
256
|
},
|
|
257
257
|
[onFocus, id]
|
|
258
258
|
);
|
|
@@ -577,74 +577,95 @@ function buttonTemplates() {
|
|
|
577
577
|
}
|
|
578
578
|
var ButtonTemplates_default = buttonTemplates;
|
|
579
579
|
|
|
580
|
-
// src/templates/
|
|
580
|
+
// src/templates/CyclicSchemaExpandTemplate.tsx
|
|
581
581
|
var import_core8 = require("@mantine/core");
|
|
582
|
-
var
|
|
582
|
+
var import_utils9 = require("@rjsf/utils");
|
|
583
583
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
584
|
+
function CyclicSchemaExpandTemplate(props) {
|
|
585
|
+
const { name, fieldPathId, registry, onExpand } = props;
|
|
586
|
+
const { translateString } = registry;
|
|
587
|
+
const buttonId4 = `${fieldPathId[import_utils9.ID_KEY]}-button`;
|
|
588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
589
|
+
import_core8.Alert,
|
|
590
|
+
{
|
|
591
|
+
color: "yellow",
|
|
592
|
+
variant: "transparent",
|
|
593
|
+
title: translateString(import_utils9.TranslatableString.CycleDetected, [name]),
|
|
594
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ExclamationCircle, {}),
|
|
595
|
+
mt: "md",
|
|
596
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Button, { id: buttonId4, size: "xs", variant: "outline", color: "yellow", onClick: () => onExpand(fieldPathId[import_utils9.ID_KEY]), children: translateString(import_utils9.TranslatableString.ExpandButton) }) })
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// src/templates/DescriptionField.tsx
|
|
602
|
+
var import_core9 = require("@mantine/core");
|
|
603
|
+
var import_core10 = require("@rjsf/core");
|
|
604
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
584
605
|
function DescriptionField(props) {
|
|
585
606
|
const { id, description, registry, uiSchema } = props;
|
|
586
607
|
if (description) {
|
|
587
|
-
return /* @__PURE__ */ (0,
|
|
608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core9.Text, { id, mt: 3, mb: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core10.RichDescription, { description, registry, uiSchema }) });
|
|
588
609
|
}
|
|
589
610
|
return null;
|
|
590
611
|
}
|
|
591
612
|
|
|
592
613
|
// src/templates/ErrorList.tsx
|
|
593
|
-
var
|
|
594
|
-
var
|
|
595
|
-
var
|
|
614
|
+
var import_core11 = require("@mantine/core");
|
|
615
|
+
var import_utils10 = require("@rjsf/utils");
|
|
616
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
596
617
|
function ErrorList({
|
|
597
618
|
errors,
|
|
598
619
|
registry
|
|
599
620
|
}) {
|
|
600
621
|
const { translateString } = registry;
|
|
601
|
-
return /* @__PURE__ */ (0,
|
|
602
|
-
|
|
622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
623
|
+
import_core11.Alert,
|
|
603
624
|
{
|
|
604
625
|
color: "red",
|
|
605
626
|
variant: "transparent",
|
|
606
|
-
title: /* @__PURE__ */ (0,
|
|
607
|
-
icon: /* @__PURE__ */ (0,
|
|
608
|
-
children: /* @__PURE__ */ (0,
|
|
627
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.Title, { order: 5, fw: "normal", children: translateString(import_utils10.TranslatableString.ErrorsLabel) }),
|
|
628
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ExclamationCircle, {}),
|
|
629
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.List, { children: errors.map((error, index) => (
|
|
609
630
|
// oxlint-disable-next-line react/no-array-index-key
|
|
610
|
-
/* @__PURE__ */ (0,
|
|
631
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.List.Item, { c: "red", children: error.stack }, `error-${index}`)
|
|
611
632
|
)) })
|
|
612
633
|
}
|
|
613
634
|
);
|
|
614
635
|
}
|
|
615
636
|
|
|
616
637
|
// src/templates/FieldErrorTemplate.tsx
|
|
617
|
-
var
|
|
618
|
-
var
|
|
619
|
-
var
|
|
638
|
+
var import_core12 = require("@mantine/core");
|
|
639
|
+
var import_utils11 = require("@rjsf/utils");
|
|
640
|
+
var import_jsx_runtime12 = (
|
|
620
641
|
// oxlint-disable-next-line react/no-array-index-key
|
|
621
642
|
require("react/jsx-runtime")
|
|
622
643
|
);
|
|
623
644
|
function FieldErrorTemplate({ errors, fieldPathId }) {
|
|
624
|
-
if (!errors
|
|
645
|
+
if (!errors?.length) {
|
|
625
646
|
return null;
|
|
626
647
|
}
|
|
627
|
-
const id = (0,
|
|
628
|
-
return /* @__PURE__ */ (0,
|
|
648
|
+
const id = (0, import_utils11.errorId)(fieldPathId);
|
|
649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core12.Box, { id, c: "red", display: "none", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core12.List, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core12.List.Item, { children: error }, `field-error-${index}`)) }) });
|
|
629
650
|
}
|
|
630
651
|
|
|
631
652
|
// src/templates/FieldHelpTemplate.tsx
|
|
632
|
-
var
|
|
633
|
-
var
|
|
634
|
-
var
|
|
635
|
-
var
|
|
653
|
+
var import_core13 = require("@mantine/core");
|
|
654
|
+
var import_core14 = require("@rjsf/core");
|
|
655
|
+
var import_utils12 = require("@rjsf/utils");
|
|
656
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
636
657
|
function FieldHelpTemplate(props) {
|
|
637
658
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
638
659
|
if (!help) {
|
|
639
660
|
return null;
|
|
640
661
|
}
|
|
641
|
-
return /* @__PURE__ */ (0,
|
|
662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core13.Text, { id: (0, import_utils12.helpId)(fieldPathId), size: "sm", my: "xs", c: "dimmed", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core14.RichHelp, { help, registry, uiSchema }) });
|
|
642
663
|
}
|
|
643
664
|
|
|
644
665
|
// src/templates/FieldTemplate.tsx
|
|
645
|
-
var
|
|
646
|
-
var
|
|
647
|
-
var
|
|
666
|
+
var import_core15 = require("@mantine/core");
|
|
667
|
+
var import_utils13 = require("@rjsf/utils");
|
|
668
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
648
669
|
function FieldTemplate(props) {
|
|
649
670
|
const {
|
|
650
671
|
id,
|
|
@@ -663,16 +684,16 @@ function FieldTemplate(props) {
|
|
|
663
684
|
children,
|
|
664
685
|
...otherProps
|
|
665
686
|
} = props;
|
|
666
|
-
const uiOptions = (0,
|
|
667
|
-
const WrapIfAdditionalTemplate2 = (0,
|
|
687
|
+
const uiOptions = (0, import_utils13.getUiOptions)(uiSchema);
|
|
688
|
+
const WrapIfAdditionalTemplate2 = (0, import_utils13.getTemplate)(
|
|
668
689
|
"WrapIfAdditionalTemplate",
|
|
669
690
|
registry,
|
|
670
691
|
uiOptions
|
|
671
692
|
);
|
|
672
693
|
if (hidden) {
|
|
673
|
-
return /* @__PURE__ */ (0,
|
|
694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core15.Box, { display: "none", children });
|
|
674
695
|
}
|
|
675
|
-
return /* @__PURE__ */ (0,
|
|
696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
676
697
|
WrapIfAdditionalTemplate2,
|
|
677
698
|
{
|
|
678
699
|
id,
|
|
@@ -695,33 +716,33 @@ function FieldTemplate(props) {
|
|
|
695
716
|
}
|
|
696
717
|
|
|
697
718
|
// src/templates/GridTemplate.tsx
|
|
698
|
-
var
|
|
699
|
-
var
|
|
719
|
+
var import_core16 = require("@mantine/core");
|
|
720
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
700
721
|
function GridTemplate(props) {
|
|
701
722
|
const { children, column, fluid = true, ...rest } = props;
|
|
702
723
|
if (column) {
|
|
703
|
-
return /* @__PURE__ */ (0,
|
|
724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core16.Grid.Col, { ...rest, children });
|
|
704
725
|
}
|
|
705
726
|
if (fluid) {
|
|
706
|
-
return /* @__PURE__ */ (0,
|
|
727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core16.Container, { p: "4", mx: 0, w: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core16.Grid, { ...rest, children }) });
|
|
707
728
|
}
|
|
708
|
-
return /* @__PURE__ */ (0,
|
|
729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core16.Grid, { grow: true, ...rest, children });
|
|
709
730
|
}
|
|
710
731
|
|
|
711
732
|
// src/templates/MultiSchemaFieldTemplate.tsx
|
|
712
|
-
var
|
|
713
|
-
var
|
|
733
|
+
var import_core17 = require("@mantine/core");
|
|
734
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
714
735
|
function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
|
|
715
|
-
return /* @__PURE__ */ (0,
|
|
736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core17.Stack, { style: { marginBottom: "1rem" }, children: [
|
|
716
737
|
selector,
|
|
717
738
|
optionSchemaField
|
|
718
739
|
] });
|
|
719
740
|
}
|
|
720
741
|
|
|
721
742
|
// src/templates/ObjectFieldTemplate.tsx
|
|
722
|
-
var
|
|
723
|
-
var
|
|
724
|
-
var
|
|
743
|
+
var import_core18 = require("@mantine/core");
|
|
744
|
+
var import_utils14 = require("@rjsf/utils");
|
|
745
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
725
746
|
function ObjectFieldTemplate(props) {
|
|
726
747
|
const {
|
|
727
748
|
title,
|
|
@@ -738,9 +759,9 @@ function ObjectFieldTemplate(props) {
|
|
|
738
759
|
formData,
|
|
739
760
|
registry
|
|
740
761
|
} = props;
|
|
741
|
-
const uiOptions = (0,
|
|
742
|
-
const TitleFieldTemplate = (0,
|
|
743
|
-
const DescriptionFieldTemplate = (0,
|
|
762
|
+
const uiOptions = (0, import_utils14.getUiOptions)(uiSchema);
|
|
763
|
+
const TitleFieldTemplate = (0, import_utils14.getTemplate)("TitleFieldTemplate", registry, uiOptions);
|
|
764
|
+
const DescriptionFieldTemplate = (0, import_utils14.getTemplate)(
|
|
744
765
|
"DescriptionFieldTemplate",
|
|
745
766
|
registry,
|
|
746
767
|
uiOptions
|
|
@@ -752,11 +773,11 @@ function ObjectFieldTemplate(props) {
|
|
|
752
773
|
const gridCols = typeof uiOptions?.gridCols === "number" && uiOptions?.gridCols || void 0;
|
|
753
774
|
const gridSpacing = uiOptions?.gridSpacing;
|
|
754
775
|
const gridVerticalSpacing = uiOptions?.gridVerticalSpacing;
|
|
755
|
-
return /* @__PURE__ */ (0,
|
|
756
|
-
title && /* @__PURE__ */ (0,
|
|
776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core18.Container, { id: fieldPathId.$id, p: 0, children: [
|
|
777
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
757
778
|
TitleFieldTemplate,
|
|
758
779
|
{
|
|
759
|
-
id: (0,
|
|
780
|
+
id: (0, import_utils14.titleId)(fieldPathId),
|
|
760
781
|
title,
|
|
761
782
|
required,
|
|
762
783
|
schema,
|
|
@@ -765,18 +786,18 @@ function ObjectFieldTemplate(props) {
|
|
|
765
786
|
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
766
787
|
}
|
|
767
788
|
),
|
|
768
|
-
description && /* @__PURE__ */ (0,
|
|
789
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
769
790
|
DescriptionFieldTemplate,
|
|
770
791
|
{
|
|
771
|
-
id: (0,
|
|
792
|
+
id: (0, import_utils14.descriptionId)(fieldPathId),
|
|
772
793
|
description,
|
|
773
794
|
schema,
|
|
774
795
|
uiSchema,
|
|
775
796
|
registry
|
|
776
797
|
}
|
|
777
798
|
),
|
|
778
|
-
/* @__PURE__ */ (0,
|
|
779
|
-
|
|
799
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
800
|
+
import_core18.SimpleGrid,
|
|
780
801
|
{
|
|
781
802
|
cols: gridCols,
|
|
782
803
|
spacing: gridSpacing,
|
|
@@ -784,14 +805,14 @@ function ObjectFieldTemplate(props) {
|
|
|
784
805
|
mb: "sm",
|
|
785
806
|
children: [
|
|
786
807
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
787
|
-
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ (0,
|
|
808
|
+
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core18.Box, { children: element.content }, element.name))
|
|
788
809
|
]
|
|
789
810
|
}
|
|
790
811
|
),
|
|
791
|
-
(0,
|
|
812
|
+
(0, import_utils14.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core18.Group, { mt: "xs", justify: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
792
813
|
AddButton2,
|
|
793
814
|
{
|
|
794
|
-
id: (0,
|
|
815
|
+
id: (0, import_utils14.buttonId)(fieldPathId, "add"),
|
|
795
816
|
disabled: disabled || readonly,
|
|
796
817
|
onClick: onAddProperty,
|
|
797
818
|
className: "rjsf-object-property-expand",
|
|
@@ -803,11 +824,11 @@ function ObjectFieldTemplate(props) {
|
|
|
803
824
|
}
|
|
804
825
|
|
|
805
826
|
// src/templates/OptionalDataControlsTemplate.tsx
|
|
806
|
-
var
|
|
827
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
807
828
|
function OptionalDataControlsTemplate(props) {
|
|
808
829
|
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
809
830
|
if (onAddClick) {
|
|
810
|
-
return /* @__PURE__ */ (0,
|
|
831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
811
832
|
AddButton,
|
|
812
833
|
{
|
|
813
834
|
id,
|
|
@@ -820,7 +841,7 @@ function OptionalDataControlsTemplate(props) {
|
|
|
820
841
|
);
|
|
821
842
|
}
|
|
822
843
|
if (onRemoveClick) {
|
|
823
|
-
return /* @__PURE__ */ (0,
|
|
844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
824
845
|
RemoveButton,
|
|
825
846
|
{
|
|
826
847
|
id,
|
|
@@ -832,28 +853,28 @@ function OptionalDataControlsTemplate(props) {
|
|
|
832
853
|
}
|
|
833
854
|
);
|
|
834
855
|
}
|
|
835
|
-
return /* @__PURE__ */ (0,
|
|
856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("em", { id, children: label });
|
|
836
857
|
}
|
|
837
858
|
|
|
838
859
|
// src/templates/TitleField.tsx
|
|
839
|
-
var
|
|
840
|
-
var
|
|
860
|
+
var import_core19 = require("@mantine/core");
|
|
861
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
841
862
|
function TitleField(props) {
|
|
842
863
|
const { id, title, optionalDataControl } = props;
|
|
843
|
-
let heading = title ? /* @__PURE__ */ (0,
|
|
864
|
+
let heading = title ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core19.Title, { id, order: 3, fw: "normal", children: title }) : null;
|
|
844
865
|
if (optionalDataControl) {
|
|
845
|
-
heading = /* @__PURE__ */ (0,
|
|
846
|
-
/* @__PURE__ */ (0,
|
|
847
|
-
/* @__PURE__ */ (0,
|
|
866
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core19.Grid, { children: [
|
|
867
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core19.Grid.Col, { span: "auto", children: heading }),
|
|
868
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core19.Grid.Col, { span: "content", children: optionalDataControl })
|
|
848
869
|
] });
|
|
849
870
|
}
|
|
850
871
|
return heading;
|
|
851
872
|
}
|
|
852
873
|
|
|
853
874
|
// src/templates/WrapIfAdditionalTemplate.tsx
|
|
854
|
-
var
|
|
855
|
-
var
|
|
856
|
-
var
|
|
875
|
+
var import_core20 = require("@mantine/core");
|
|
876
|
+
var import_utils15 = require("@rjsf/utils");
|
|
877
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
857
878
|
function WrapIfAdditionalTemplate(props) {
|
|
858
879
|
const {
|
|
859
880
|
id,
|
|
@@ -874,20 +895,20 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
874
895
|
} = props;
|
|
875
896
|
const { templates, translateString } = registry;
|
|
876
897
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
877
|
-
const keyLabel = translateString(
|
|
878
|
-
const additional =
|
|
898
|
+
const keyLabel = translateString(import_utils15.TranslatableString.KeyLabel, [label]);
|
|
899
|
+
const additional = import_utils15.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
879
900
|
if (!additional) {
|
|
880
|
-
return /* @__PURE__ */ (0,
|
|
901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: classNames, style, children });
|
|
881
902
|
}
|
|
882
|
-
const uiOptions = uiSchema ? uiSchema[
|
|
903
|
+
const uiOptions = uiSchema ? uiSchema[import_utils15.UI_OPTIONS_KEY] : {};
|
|
883
904
|
const buttonUiOptions = {
|
|
884
905
|
...uiSchema,
|
|
885
|
-
[
|
|
906
|
+
[import_utils15.UI_OPTIONS_KEY]: { ...uiOptions, block: true }
|
|
886
907
|
};
|
|
887
|
-
return /* @__PURE__ */ (0,
|
|
888
|
-
/* @__PURE__ */ (0,
|
|
889
|
-
/* @__PURE__ */ (0,
|
|
890
|
-
|
|
908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: classNames, style, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core20.Flex, { gap: "xs", align: "end", justify: "center", children: [
|
|
909
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core20.Grid, { w: "100%", align: "center", children: [
|
|
910
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core20.Grid.Col, { span: 6, className: "form-additional", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
911
|
+
import_core20.TextInput,
|
|
891
912
|
{
|
|
892
913
|
className: "form-group",
|
|
893
914
|
label: displayLabel ? keyLabel : void 0,
|
|
@@ -901,12 +922,12 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
901
922
|
},
|
|
902
923
|
label
|
|
903
924
|
) }),
|
|
904
|
-
/* @__PURE__ */ (0,
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core20.Grid.Col, { span: 6, className: "form-additional", children })
|
|
905
926
|
] }),
|
|
906
|
-
/* @__PURE__ */ (0,
|
|
927
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
907
928
|
RemoveButton2,
|
|
908
929
|
{
|
|
909
|
-
id: (0,
|
|
930
|
+
id: (0, import_utils15.buttonId)(id, "remove"),
|
|
910
931
|
iconType: "sm",
|
|
911
932
|
className: "rjsf-array-item-remove",
|
|
912
933
|
disabled: disabled || readonly,
|
|
@@ -925,6 +946,7 @@ function generateTemplates() {
|
|
|
925
946
|
ArrayFieldTemplate,
|
|
926
947
|
ArrayFieldTitleTemplate,
|
|
927
948
|
BaseInputTemplate,
|
|
949
|
+
CyclicSchemaExpandTemplate,
|
|
928
950
|
ButtonTemplates: ButtonTemplates_default(),
|
|
929
951
|
DescriptionFieldTemplate: DescriptionField,
|
|
930
952
|
ErrorListTemplate: ErrorList,
|
|
@@ -947,9 +969,9 @@ var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat")
|
|
|
947
969
|
|
|
948
970
|
// src/widgets/CheckboxesWidget.tsx
|
|
949
971
|
var import_react3 = require("react");
|
|
950
|
-
var
|
|
951
|
-
var
|
|
952
|
-
var
|
|
972
|
+
var import_core21 = require("@mantine/core");
|
|
973
|
+
var import_utils16 = require("@rjsf/utils");
|
|
974
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
953
975
|
function CheckboxesWidget(props) {
|
|
954
976
|
const {
|
|
955
977
|
id,
|
|
@@ -968,12 +990,12 @@ function CheckboxesWidget(props) {
|
|
|
968
990
|
onFocus
|
|
969
991
|
} = props;
|
|
970
992
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
971
|
-
const optionValueFormat = (0,
|
|
993
|
+
const optionValueFormat = (0, import_utils16.getOptionValueFormat)(options);
|
|
972
994
|
const themeProps = cleanupOptions(options);
|
|
973
995
|
const handleChange = (0, import_react3.useCallback)(
|
|
974
996
|
(nextValue) => {
|
|
975
997
|
if (!disabled && !readonly && onChange) {
|
|
976
|
-
onChange((0,
|
|
998
|
+
onChange((0, import_utils16.enumOptionValueDecoder)(nextValue, enumOptions, optionValueFormat, emptyValue));
|
|
977
999
|
}
|
|
978
1000
|
},
|
|
979
1001
|
[onChange, disabled, readonly, enumOptions, emptyValue, optionValueFormat]
|
|
@@ -981,7 +1003,7 @@ function CheckboxesWidget(props) {
|
|
|
981
1003
|
const handleBlur = (0, import_react3.useCallback)(
|
|
982
1004
|
({ target }) => {
|
|
983
1005
|
if (onBlur) {
|
|
984
|
-
onBlur(id, (0,
|
|
1006
|
+
onBlur(id, (0, import_utils16.enumOptionValueDecoder)(target.value, enumOptions, optionValueFormat, emptyValue));
|
|
985
1007
|
}
|
|
986
1008
|
},
|
|
987
1009
|
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
@@ -989,16 +1011,16 @@ function CheckboxesWidget(props) {
|
|
|
989
1011
|
const handleFocus = (0, import_react3.useCallback)(
|
|
990
1012
|
({ target }) => {
|
|
991
1013
|
if (onFocus) {
|
|
992
|
-
onFocus(id, (0,
|
|
1014
|
+
onFocus(id, (0, import_utils16.enumOptionValueDecoder)(target.value, enumOptions, optionValueFormat, emptyValue));
|
|
993
1015
|
}
|
|
994
1016
|
},
|
|
995
1017
|
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
996
1018
|
);
|
|
997
|
-
const selectedIndexes = (0,
|
|
998
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0,
|
|
999
|
-
!hideLabel && !!label && /* @__PURE__ */ (0,
|
|
1000
|
-
/* @__PURE__ */ (0,
|
|
1001
|
-
|
|
1019
|
+
const selectedIndexes = (0, import_utils16.enumOptionsIndexForValue)(value, enumOptions, true);
|
|
1020
|
+
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1021
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core21.Input.Label, { id: (0, import_utils16.titleId)(id), required, children: label }),
|
|
1022
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1023
|
+
import_core21.Checkbox.Group,
|
|
1002
1024
|
{
|
|
1003
1025
|
id,
|
|
1004
1026
|
value: selectedIndexes,
|
|
@@ -1006,14 +1028,14 @@ function CheckboxesWidget(props) {
|
|
|
1006
1028
|
required,
|
|
1007
1029
|
readOnly: disabled || readonly,
|
|
1008
1030
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1009
|
-
"aria-describedby": (0,
|
|
1031
|
+
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id),
|
|
1010
1032
|
...themeProps,
|
|
1011
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0,
|
|
1012
|
-
|
|
1033
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core21.Flex, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1034
|
+
import_core21.Checkbox,
|
|
1013
1035
|
{
|
|
1014
|
-
id: (0,
|
|
1036
|
+
id: (0, import_utils16.optionId)(id, i),
|
|
1015
1037
|
name: htmlName || id,
|
|
1016
|
-
value: (0,
|
|
1038
|
+
value: (0, import_utils16.enumOptionValueEncoder)(option.value, i, optionValueFormat),
|
|
1017
1039
|
label: option.label,
|
|
1018
1040
|
disabled: Array.isArray(enumDisabled) && enumDisabled.includes(option.value),
|
|
1019
1041
|
autoFocus: i === 0 && autofocus,
|
|
@@ -1029,9 +1051,9 @@ function CheckboxesWidget(props) {
|
|
|
1029
1051
|
|
|
1030
1052
|
// src/widgets/CheckboxWidget.tsx
|
|
1031
1053
|
var import_react4 = require("react");
|
|
1032
|
-
var
|
|
1033
|
-
var
|
|
1034
|
-
var
|
|
1054
|
+
var import_core22 = require("@mantine/core");
|
|
1055
|
+
var import_utils18 = require("@rjsf/utils");
|
|
1056
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1035
1057
|
function CheckboxWidget(props) {
|
|
1036
1058
|
const {
|
|
1037
1059
|
id,
|
|
@@ -1053,7 +1075,7 @@ function CheckboxWidget(props) {
|
|
|
1053
1075
|
registry,
|
|
1054
1076
|
uiSchema
|
|
1055
1077
|
} = props;
|
|
1056
|
-
const DescriptionFieldTemplate = (0,
|
|
1078
|
+
const DescriptionFieldTemplate = (0, import_utils18.getTemplate)(
|
|
1057
1079
|
"DescriptionFieldTemplate",
|
|
1058
1080
|
registry,
|
|
1059
1081
|
options
|
|
@@ -1083,23 +1105,23 @@ function CheckboxWidget(props) {
|
|
|
1083
1105
|
[onFocus, id]
|
|
1084
1106
|
);
|
|
1085
1107
|
const description = options.description || schema.description;
|
|
1086
|
-
return /* @__PURE__ */ (0,
|
|
1087
|
-
!hideLabel && !!description && /* @__PURE__ */ (0,
|
|
1108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
1109
|
+
!hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1088
1110
|
DescriptionFieldTemplate,
|
|
1089
1111
|
{
|
|
1090
|
-
id: (0,
|
|
1112
|
+
id: (0, import_utils18.descriptionId)(id),
|
|
1091
1113
|
description,
|
|
1092
1114
|
schema,
|
|
1093
1115
|
uiSchema,
|
|
1094
1116
|
registry
|
|
1095
1117
|
}
|
|
1096
1118
|
),
|
|
1097
|
-
/* @__PURE__ */ (0,
|
|
1098
|
-
|
|
1119
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1120
|
+
import_core22.Checkbox,
|
|
1099
1121
|
{
|
|
1100
1122
|
id,
|
|
1101
1123
|
name: htmlName || name,
|
|
1102
|
-
label: (0,
|
|
1124
|
+
label: (0, import_utils18.labelValue)(label || void 0, hideLabel, false),
|
|
1103
1125
|
disabled: disabled || readonly,
|
|
1104
1126
|
required,
|
|
1105
1127
|
autoFocus: autofocus,
|
|
@@ -1108,7 +1130,7 @@ function CheckboxWidget(props) {
|
|
|
1108
1130
|
onBlur: handleBlur,
|
|
1109
1131
|
onFocus: handleFocus,
|
|
1110
1132
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1111
|
-
"aria-describedby": (0,
|
|
1133
|
+
"aria-describedby": (0, import_utils18.ariaDescribedByIds)(id)
|
|
1112
1134
|
}
|
|
1113
1135
|
)
|
|
1114
1136
|
] });
|
|
@@ -1116,9 +1138,9 @@ function CheckboxWidget(props) {
|
|
|
1116
1138
|
|
|
1117
1139
|
// src/widgets/ColorWidget.tsx
|
|
1118
1140
|
var import_react5 = require("react");
|
|
1119
|
-
var
|
|
1120
|
-
var
|
|
1121
|
-
var
|
|
1141
|
+
var import_core23 = require("@mantine/core");
|
|
1142
|
+
var import_utils19 = require("@rjsf/utils");
|
|
1143
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1122
1144
|
function ColorWidget(props) {
|
|
1123
1145
|
const {
|
|
1124
1146
|
id,
|
|
@@ -1147,7 +1169,7 @@ function ColorWidget(props) {
|
|
|
1147
1169
|
const handleBlur = (0, import_react5.useCallback)(
|
|
1148
1170
|
({ target }) => {
|
|
1149
1171
|
if (onBlur) {
|
|
1150
|
-
onBlur(id, target
|
|
1172
|
+
onBlur(id, target?.value);
|
|
1151
1173
|
}
|
|
1152
1174
|
},
|
|
1153
1175
|
[onBlur, id]
|
|
@@ -1155,13 +1177,13 @@ function ColorWidget(props) {
|
|
|
1155
1177
|
const handleFocus = (0, import_react5.useCallback)(
|
|
1156
1178
|
({ target }) => {
|
|
1157
1179
|
if (onFocus) {
|
|
1158
|
-
onFocus(id, target
|
|
1180
|
+
onFocus(id, target?.value);
|
|
1159
1181
|
}
|
|
1160
1182
|
},
|
|
1161
1183
|
[onFocus, id]
|
|
1162
1184
|
);
|
|
1163
|
-
return /* @__PURE__ */ (0,
|
|
1164
|
-
|
|
1185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1186
|
+
import_core23.ColorInput,
|
|
1165
1187
|
{
|
|
1166
1188
|
id,
|
|
1167
1189
|
name,
|
|
@@ -1170,66 +1192,66 @@ function ColorWidget(props) {
|
|
|
1170
1192
|
required,
|
|
1171
1193
|
disabled: disabled || readonly,
|
|
1172
1194
|
autoFocus: autofocus,
|
|
1173
|
-
label: (0,
|
|
1195
|
+
label: (0, import_utils19.labelValue)(label || void 0, hideLabel, false),
|
|
1174
1196
|
onChange: handleChange,
|
|
1175
1197
|
onBlur: handleBlur,
|
|
1176
1198
|
onFocus: handleFocus,
|
|
1177
1199
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1178
1200
|
...themeProps,
|
|
1179
|
-
"aria-describedby": (0,
|
|
1201
|
+
"aria-describedby": (0, import_utils19.ariaDescribedByIds)(id),
|
|
1180
1202
|
popoverProps: { withinPortal: false }
|
|
1181
1203
|
}
|
|
1182
1204
|
);
|
|
1183
1205
|
}
|
|
1184
1206
|
|
|
1185
1207
|
// src/widgets/DateTime/AltDateTimeWidget.tsx
|
|
1186
|
-
var
|
|
1208
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1187
1209
|
function AltDateTimeWidget(props) {
|
|
1188
1210
|
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
1189
|
-
return /* @__PURE__ */ (0,
|
|
1211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AltDateWidget2, { time: true, ...props });
|
|
1190
1212
|
}
|
|
1191
1213
|
|
|
1192
1214
|
// src/widgets/DateTime/AltDateWidget.tsx
|
|
1193
|
-
var
|
|
1194
|
-
var
|
|
1195
|
-
var
|
|
1215
|
+
var import_core24 = require("@mantine/core");
|
|
1216
|
+
var import_utils21 = require("@rjsf/utils");
|
|
1217
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1196
1218
|
function AltDateWidget(props) {
|
|
1197
1219
|
const { id, required, disabled, readonly, label, hideLabel, rawErrors, options, registry } = props;
|
|
1198
1220
|
const { translateString } = registry;
|
|
1199
|
-
const { elements, handleChange, handleClear, handleSetNow } = (0,
|
|
1200
|
-
return /* @__PURE__ */ (0,
|
|
1201
|
-
!hideLabel && !!label && /* @__PURE__ */ (0,
|
|
1202
|
-
/* @__PURE__ */ (0,
|
|
1221
|
+
const { elements, handleChange, handleClear, handleSetNow } = (0, import_utils21.useAltDateWidgetProps)(props);
|
|
1222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
1223
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core24.Input.Label, { id: (0, import_utils21.titleId)(id), required, children: label }),
|
|
1224
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core24.Flex, { gap: "xs", align: "center", wrap: "nowrap", children: [
|
|
1203
1225
|
elements.map((elemProps, i) => {
|
|
1204
1226
|
const elemId = `${id}_${elemProps.type}`;
|
|
1205
1227
|
return (
|
|
1206
1228
|
// oxlint-disable-next-line react/no-array-index-key
|
|
1207
|
-
/* @__PURE__ */ (0,
|
|
1208
|
-
|
|
1229
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core24.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1230
|
+
import_core24.Select,
|
|
1209
1231
|
{
|
|
1210
1232
|
id: elemId,
|
|
1211
1233
|
name: elemId,
|
|
1212
1234
|
placeholder: elemProps.type,
|
|
1213
1235
|
disabled: disabled || readonly,
|
|
1214
|
-
data: (0,
|
|
1236
|
+
data: (0, import_utils21.dateRangeOptions)(elemProps.range[0], elemProps.range[1]).map((item) => item.value.toString()),
|
|
1215
1237
|
value: !elemProps.value || elemProps.value < 0 ? null : elemProps.value.toString(),
|
|
1216
1238
|
onChange: (v) => handleChange(elemProps.type, v || void 0),
|
|
1217
1239
|
searchable: false,
|
|
1218
1240
|
allowDeselect: false,
|
|
1219
1241
|
comboboxProps: { withinPortal: false },
|
|
1220
|
-
"aria-describedby": (0,
|
|
1242
|
+
"aria-describedby": (0, import_utils21.ariaDescribedByIds)(elemId)
|
|
1221
1243
|
}
|
|
1222
1244
|
) }, i)
|
|
1223
1245
|
);
|
|
1224
1246
|
}),
|
|
1225
|
-
/* @__PURE__ */ (0,
|
|
1226
|
-
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0,
|
|
1227
|
-
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0,
|
|
1247
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core24.Group, { wrap: "nowrap", gap: 3, children: [
|
|
1248
|
+
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core24.Button, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(import_utils21.TranslatableString.NowLabel) }),
|
|
1249
|
+
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core24.Button, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(import_utils21.TranslatableString.ClearLabel) })
|
|
1228
1250
|
] })
|
|
1229
1251
|
] }),
|
|
1230
1252
|
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => (
|
|
1231
1253
|
// oxlint-disable-next-line react/no-array-index-key
|
|
1232
|
-
/* @__PURE__ */ (0,
|
|
1254
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core24.Input.Error, { children: error }, `alt-date-widget-input-errors-${index}`)
|
|
1233
1255
|
))
|
|
1234
1256
|
] });
|
|
1235
1257
|
}
|
|
@@ -1237,9 +1259,9 @@ function AltDateWidget(props) {
|
|
|
1237
1259
|
// src/widgets/DateTime/DateTimeInput.tsx
|
|
1238
1260
|
var import_react6 = require("react");
|
|
1239
1261
|
var import_dates = require("@mantine/dates");
|
|
1240
|
-
var
|
|
1262
|
+
var import_utils22 = require("@rjsf/utils");
|
|
1241
1263
|
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
1242
|
-
var
|
|
1264
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1243
1265
|
var dateParser = (input, format) => {
|
|
1244
1266
|
if (!input) {
|
|
1245
1267
|
return null;
|
|
@@ -1289,7 +1311,7 @@ function DateTimeInput(props) {
|
|
|
1289
1311
|
onFocus(id, value);
|
|
1290
1312
|
}
|
|
1291
1313
|
}, [onFocus, id, value]);
|
|
1292
|
-
return /* @__PURE__ */ (0,
|
|
1314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1293
1315
|
import_dates.DateInput,
|
|
1294
1316
|
{
|
|
1295
1317
|
id,
|
|
@@ -1300,13 +1322,13 @@ function DateTimeInput(props) {
|
|
|
1300
1322
|
required,
|
|
1301
1323
|
disabled: disabled || readonly,
|
|
1302
1324
|
autoFocus: autofocus,
|
|
1303
|
-
label: (0,
|
|
1325
|
+
label: (0, import_utils22.labelValue)(label || void 0, hideLabel, false),
|
|
1304
1326
|
onChange: handleChange,
|
|
1305
1327
|
onBlur: handleBlur,
|
|
1306
1328
|
onFocus: handleFocus,
|
|
1307
1329
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1308
1330
|
...options,
|
|
1309
|
-
"aria-describedby": (0,
|
|
1331
|
+
"aria-describedby": (0, import_utils22.ariaDescribedByIds)(id),
|
|
1310
1332
|
popoverProps: { withinPortal: false },
|
|
1311
1333
|
classNames: typeof options?.classNames === "object" ? options.classNames : void 0,
|
|
1312
1334
|
valueFormat: displayFormat
|
|
@@ -1315,10 +1337,10 @@ function DateTimeInput(props) {
|
|
|
1315
1337
|
}
|
|
1316
1338
|
|
|
1317
1339
|
// src/widgets/DateTime/DateWidget.tsx
|
|
1318
|
-
var
|
|
1340
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1319
1341
|
function DateWidget(props) {
|
|
1320
1342
|
const { valueFormat = "YYYY-MM-DD", displayFormat, ...otherOptions } = props.options;
|
|
1321
|
-
return /* @__PURE__ */ (0,
|
|
1343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1322
1344
|
DateTimeInput,
|
|
1323
1345
|
{
|
|
1324
1346
|
...props,
|
|
@@ -1330,10 +1352,10 @@ function DateWidget(props) {
|
|
|
1330
1352
|
}
|
|
1331
1353
|
|
|
1332
1354
|
// src/widgets/DateTime/DateTimeWidget.tsx
|
|
1333
|
-
var
|
|
1355
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1334
1356
|
function DateTimeWidget(props) {
|
|
1335
1357
|
const { valueFormat = "YYYY-MM-DD HH:mm:ss", displayFormat, ...otherOptions } = props.options;
|
|
1336
|
-
return /* @__PURE__ */ (0,
|
|
1358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1337
1359
|
DateTimeInput,
|
|
1338
1360
|
{
|
|
1339
1361
|
...props,
|
|
@@ -1347,8 +1369,8 @@ function DateTimeWidget(props) {
|
|
|
1347
1369
|
// src/widgets/DateTime/TimeWidget.tsx
|
|
1348
1370
|
var import_react7 = require("react");
|
|
1349
1371
|
var import_dates2 = require("@mantine/dates");
|
|
1350
|
-
var
|
|
1351
|
-
var
|
|
1372
|
+
var import_utils23 = require("@rjsf/utils");
|
|
1373
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1352
1374
|
function TimeWidget(props) {
|
|
1353
1375
|
const {
|
|
1354
1376
|
id,
|
|
@@ -1377,7 +1399,7 @@ function TimeWidget(props) {
|
|
|
1377
1399
|
const handleBlur = (0, import_react7.useCallback)(
|
|
1378
1400
|
({ target }) => {
|
|
1379
1401
|
if (onBlur) {
|
|
1380
|
-
onBlur(id, target
|
|
1402
|
+
onBlur(id, target?.value);
|
|
1381
1403
|
}
|
|
1382
1404
|
},
|
|
1383
1405
|
[onBlur, id]
|
|
@@ -1385,12 +1407,12 @@ function TimeWidget(props) {
|
|
|
1385
1407
|
const handleFocus = (0, import_react7.useCallback)(
|
|
1386
1408
|
({ target }) => {
|
|
1387
1409
|
if (onFocus) {
|
|
1388
|
-
onFocus(id, target
|
|
1410
|
+
onFocus(id, target?.value);
|
|
1389
1411
|
}
|
|
1390
1412
|
},
|
|
1391
1413
|
[onFocus, id]
|
|
1392
1414
|
);
|
|
1393
|
-
return /* @__PURE__ */ (0,
|
|
1415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1394
1416
|
import_dates2.TimeInput,
|
|
1395
1417
|
{
|
|
1396
1418
|
id,
|
|
@@ -1400,13 +1422,13 @@ function TimeWidget(props) {
|
|
|
1400
1422
|
required,
|
|
1401
1423
|
disabled: disabled || readonly,
|
|
1402
1424
|
autoFocus: autofocus,
|
|
1403
|
-
label: (0,
|
|
1425
|
+
label: (0, import_utils23.labelValue)(label || void 0, hideLabel, false),
|
|
1404
1426
|
onChange: handleChange,
|
|
1405
1427
|
onBlur: handleBlur,
|
|
1406
1428
|
onFocus: handleFocus,
|
|
1407
1429
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1408
1430
|
...options,
|
|
1409
|
-
"aria-describedby": (0,
|
|
1431
|
+
"aria-describedby": (0, import_utils23.ariaDescribedByIds)(id),
|
|
1410
1432
|
classNames: typeof options?.classNames === "object" ? options.classNames : void 0
|
|
1411
1433
|
}
|
|
1412
1434
|
);
|
|
@@ -1414,9 +1436,9 @@ function TimeWidget(props) {
|
|
|
1414
1436
|
|
|
1415
1437
|
// src/widgets/FileWidget.tsx
|
|
1416
1438
|
var import_react8 = require("react");
|
|
1417
|
-
var
|
|
1418
|
-
var
|
|
1419
|
-
var
|
|
1439
|
+
var import_core25 = require("@mantine/core");
|
|
1440
|
+
var import_utils24 = require("@rjsf/utils");
|
|
1441
|
+
var import_jsx_runtime30 = (
|
|
1420
1442
|
// oxlint-disable-next-line react/no-array-index-key
|
|
1421
1443
|
require("react/jsx-runtime")
|
|
1422
1444
|
);
|
|
@@ -1437,7 +1459,7 @@ function FileWidget(props) {
|
|
|
1437
1459
|
multiple,
|
|
1438
1460
|
onChange
|
|
1439
1461
|
} = props;
|
|
1440
|
-
const { filesInfo, handleChange, handleRemove } = (0,
|
|
1462
|
+
const { filesInfo, handleChange, handleRemove } = (0, import_utils24.useFileWidgetProps)(value, onChange, multiple);
|
|
1441
1463
|
const themeProps = cleanupOptions(options);
|
|
1442
1464
|
const handleOnChange = (0, import_react8.useCallback)(
|
|
1443
1465
|
(files) => {
|
|
@@ -1449,12 +1471,12 @@ function FileWidget(props) {
|
|
|
1449
1471
|
);
|
|
1450
1472
|
const ValueComponent = (0, import_react8.useCallback)(() => {
|
|
1451
1473
|
if (Array.isArray(filesInfo) && filesInfo.length > 0) {
|
|
1452
|
-
return /* @__PURE__ */ (0,
|
|
1474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core25.Pill.Group, { children: filesInfo.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core25.Pill, { withRemoveButton: true, onRemove: () => handleRemove(index), children: file.name }, index)) });
|
|
1453
1475
|
}
|
|
1454
1476
|
return null;
|
|
1455
1477
|
}, [handleRemove, filesInfo]);
|
|
1456
|
-
return /* @__PURE__ */ (0,
|
|
1457
|
-
|
|
1478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1479
|
+
import_core25.FileInput,
|
|
1458
1480
|
{
|
|
1459
1481
|
id,
|
|
1460
1482
|
name,
|
|
@@ -1463,22 +1485,22 @@ function FileWidget(props) {
|
|
|
1463
1485
|
required,
|
|
1464
1486
|
disabled: disabled || readonly,
|
|
1465
1487
|
autoFocus: autofocus,
|
|
1466
|
-
label: (0,
|
|
1488
|
+
label: (0, import_utils24.labelValue)(label || void 0, hideLabel, false),
|
|
1467
1489
|
multiple: !!multiple,
|
|
1468
1490
|
valueComponent: ValueComponent,
|
|
1469
1491
|
onChange: handleOnChange,
|
|
1470
1492
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1471
1493
|
...themeProps,
|
|
1472
|
-
"aria-describedby": (0,
|
|
1494
|
+
"aria-describedby": (0, import_utils24.ariaDescribedByIds)(id)
|
|
1473
1495
|
}
|
|
1474
1496
|
);
|
|
1475
1497
|
}
|
|
1476
1498
|
|
|
1477
1499
|
// src/widgets/PasswordWidget.tsx
|
|
1478
1500
|
var import_react9 = require("react");
|
|
1479
|
-
var
|
|
1480
|
-
var
|
|
1481
|
-
var
|
|
1501
|
+
var import_core26 = require("@mantine/core");
|
|
1502
|
+
var import_utils26 = require("@rjsf/utils");
|
|
1503
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1482
1504
|
function PasswordWidget(props) {
|
|
1483
1505
|
const {
|
|
1484
1506
|
id,
|
|
@@ -1508,7 +1530,7 @@ function PasswordWidget(props) {
|
|
|
1508
1530
|
const handleBlur = (0, import_react9.useCallback)(
|
|
1509
1531
|
({ target }) => {
|
|
1510
1532
|
if (onBlur) {
|
|
1511
|
-
onBlur(id, target
|
|
1533
|
+
onBlur(id, target?.value);
|
|
1512
1534
|
}
|
|
1513
1535
|
},
|
|
1514
1536
|
[onBlur, id]
|
|
@@ -1516,13 +1538,13 @@ function PasswordWidget(props) {
|
|
|
1516
1538
|
const handleFocus = (0, import_react9.useCallback)(
|
|
1517
1539
|
({ target }) => {
|
|
1518
1540
|
if (onFocus) {
|
|
1519
|
-
onFocus(id, target
|
|
1541
|
+
onFocus(id, target?.value);
|
|
1520
1542
|
}
|
|
1521
1543
|
},
|
|
1522
1544
|
[onFocus, id]
|
|
1523
1545
|
);
|
|
1524
|
-
return /* @__PURE__ */ (0,
|
|
1525
|
-
|
|
1546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1547
|
+
import_core26.PasswordInput,
|
|
1526
1548
|
{
|
|
1527
1549
|
id,
|
|
1528
1550
|
name,
|
|
@@ -1531,22 +1553,22 @@ function PasswordWidget(props) {
|
|
|
1531
1553
|
required,
|
|
1532
1554
|
disabled: disabled || readonly,
|
|
1533
1555
|
autoFocus: autofocus,
|
|
1534
|
-
label: (0,
|
|
1556
|
+
label: (0, import_utils26.labelValue)(label || void 0, hideLabel, false),
|
|
1535
1557
|
onChange: handleChange,
|
|
1536
1558
|
onBlur: handleBlur,
|
|
1537
1559
|
onFocus: handleFocus,
|
|
1538
1560
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1539
1561
|
...themeProps,
|
|
1540
|
-
"aria-describedby": (0,
|
|
1562
|
+
"aria-describedby": (0, import_utils26.ariaDescribedByIds)(id)
|
|
1541
1563
|
}
|
|
1542
1564
|
);
|
|
1543
1565
|
}
|
|
1544
1566
|
|
|
1545
1567
|
// src/widgets/RadioWidget.tsx
|
|
1546
1568
|
var import_react10 = require("react");
|
|
1547
|
-
var
|
|
1548
|
-
var
|
|
1549
|
-
var
|
|
1569
|
+
var import_core27 = require("@mantine/core");
|
|
1570
|
+
var import_utils28 = require("@rjsf/utils");
|
|
1571
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1550
1572
|
function RadioWidget(props) {
|
|
1551
1573
|
const {
|
|
1552
1574
|
id,
|
|
@@ -1565,12 +1587,12 @@ function RadioWidget(props) {
|
|
|
1565
1587
|
onFocus
|
|
1566
1588
|
} = props;
|
|
1567
1589
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
1568
|
-
const optionValueFormat = (0,
|
|
1590
|
+
const optionValueFormat = (0, import_utils28.getOptionValueFormat)(options);
|
|
1569
1591
|
const themeProps = cleanupOptions(options);
|
|
1570
1592
|
const handleChange = (0, import_react10.useCallback)(
|
|
1571
1593
|
(nextValue) => {
|
|
1572
1594
|
if (!disabled && !readonly && onChange) {
|
|
1573
|
-
onChange((0,
|
|
1595
|
+
onChange((0, import_utils28.enumOptionValueDecoder)(nextValue, enumOptions, optionValueFormat, emptyValue));
|
|
1574
1596
|
}
|
|
1575
1597
|
},
|
|
1576
1598
|
[onChange, disabled, readonly, enumOptions, emptyValue, optionValueFormat]
|
|
@@ -1578,7 +1600,7 @@ function RadioWidget(props) {
|
|
|
1578
1600
|
const handleBlur = (0, import_react10.useCallback)(
|
|
1579
1601
|
({ target }) => {
|
|
1580
1602
|
if (onBlur) {
|
|
1581
|
-
onBlur(id, (0,
|
|
1603
|
+
onBlur(id, (0, import_utils28.enumOptionValueDecoder)(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1582
1604
|
}
|
|
1583
1605
|
},
|
|
1584
1606
|
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
@@ -1586,14 +1608,14 @@ function RadioWidget(props) {
|
|
|
1586
1608
|
const handleFocus = (0, import_react10.useCallback)(
|
|
1587
1609
|
({ target }) => {
|
|
1588
1610
|
if (onFocus) {
|
|
1589
|
-
onFocus(id, (0,
|
|
1611
|
+
onFocus(id, (0, import_utils28.enumOptionValueDecoder)(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1590
1612
|
}
|
|
1591
1613
|
},
|
|
1592
1614
|
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
1593
1615
|
);
|
|
1594
|
-
const selected = (0,
|
|
1595
|
-
return /* @__PURE__ */ (0,
|
|
1596
|
-
|
|
1616
|
+
const selected = (0, import_utils28.enumOptionsIndexForValue)(value, enumOptions);
|
|
1617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1618
|
+
import_core27.Radio.Group,
|
|
1597
1619
|
{
|
|
1598
1620
|
id,
|
|
1599
1621
|
name: htmlName || id,
|
|
@@ -1603,13 +1625,13 @@ function RadioWidget(props) {
|
|
|
1603
1625
|
required,
|
|
1604
1626
|
readOnly: disabled || readonly,
|
|
1605
1627
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1606
|
-
"aria-describedby": (0,
|
|
1628
|
+
"aria-describedby": (0, import_utils28.ariaDescribedByIds)(id),
|
|
1607
1629
|
...themeProps,
|
|
1608
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0,
|
|
1609
|
-
|
|
1630
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core27.Flex, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1631
|
+
import_core27.Radio,
|
|
1610
1632
|
{
|
|
1611
|
-
id: (0,
|
|
1612
|
-
value: (0,
|
|
1633
|
+
id: (0, import_utils28.optionId)(id, i),
|
|
1634
|
+
value: (0, import_utils28.enumOptionValueEncoder)(option.value, i, optionValueFormat),
|
|
1613
1635
|
label: option.label,
|
|
1614
1636
|
disabled: Array.isArray(enumDisabled) && enumDisabled.includes(option.value),
|
|
1615
1637
|
autoFocus: i === 0 && autofocus,
|
|
@@ -1624,9 +1646,9 @@ function RadioWidget(props) {
|
|
|
1624
1646
|
|
|
1625
1647
|
// src/widgets/RangeWidget.tsx
|
|
1626
1648
|
var import_react11 = require("react");
|
|
1627
|
-
var
|
|
1628
|
-
var
|
|
1629
|
-
var
|
|
1649
|
+
var import_core28 = require("@mantine/core");
|
|
1650
|
+
var import_utils30 = require("@rjsf/utils");
|
|
1651
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1630
1652
|
function RangeWidget(props) {
|
|
1631
1653
|
const {
|
|
1632
1654
|
id,
|
|
@@ -1646,7 +1668,7 @@ function RangeWidget(props) {
|
|
|
1646
1668
|
schema
|
|
1647
1669
|
} = props;
|
|
1648
1670
|
const themeProps = cleanupOptions(options);
|
|
1649
|
-
const { min, max, step } = (0,
|
|
1671
|
+
const { min, max, step } = (0, import_utils30.rangeSpec)(schema);
|
|
1650
1672
|
const handleChange = (0, import_react11.useCallback)(
|
|
1651
1673
|
(nextValue) => {
|
|
1652
1674
|
if (!disabled && !readonly && onChange) {
|
|
@@ -1665,11 +1687,11 @@ function RangeWidget(props) {
|
|
|
1665
1687
|
onFocus(id, value);
|
|
1666
1688
|
}
|
|
1667
1689
|
}, [onFocus, id, value]);
|
|
1668
|
-
return /* @__PURE__ */ (0,
|
|
1669
|
-
!hideLabel && !!label && /* @__PURE__ */ (0,
|
|
1670
|
-
options?.description && /* @__PURE__ */ (0,
|
|
1671
|
-
/* @__PURE__ */ (0,
|
|
1672
|
-
|
|
1690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
1691
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core28.Input.Label, { id: (0, import_utils30.titleId)(id), required, children: label }),
|
|
1692
|
+
options?.description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core28.Input.Description, { children: options.description }),
|
|
1693
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1694
|
+
import_core28.Slider,
|
|
1673
1695
|
{
|
|
1674
1696
|
id,
|
|
1675
1697
|
name,
|
|
@@ -1683,21 +1705,21 @@ function RangeWidget(props) {
|
|
|
1683
1705
|
onBlur: handleBlur,
|
|
1684
1706
|
onFocus: handleFocus,
|
|
1685
1707
|
...themeProps,
|
|
1686
|
-
"aria-describedby": (0,
|
|
1708
|
+
"aria-describedby": (0, import_utils30.ariaDescribedByIds)(id)
|
|
1687
1709
|
}
|
|
1688
1710
|
),
|
|
1689
1711
|
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => (
|
|
1690
1712
|
// oxlint-disable-next-line react/no-array-index-key
|
|
1691
|
-
/* @__PURE__ */ (0,
|
|
1713
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core28.Input.Error, { children: error }, `range-widget-input-errors-${index}`)
|
|
1692
1714
|
))
|
|
1693
1715
|
] });
|
|
1694
1716
|
}
|
|
1695
1717
|
|
|
1696
1718
|
// src/widgets/SelectWidget.tsx
|
|
1697
1719
|
var import_react12 = require("react");
|
|
1698
|
-
var
|
|
1699
|
-
var
|
|
1700
|
-
var
|
|
1720
|
+
var import_core29 = require("@mantine/core");
|
|
1721
|
+
var import_utils32 = require("@rjsf/utils");
|
|
1722
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1701
1723
|
function SelectWidget(props) {
|
|
1702
1724
|
const {
|
|
1703
1725
|
id,
|
|
@@ -1712,18 +1734,20 @@ function SelectWidget(props) {
|
|
|
1712
1734
|
hideLabel,
|
|
1713
1735
|
multiple,
|
|
1714
1736
|
rawErrors,
|
|
1737
|
+
schema,
|
|
1715
1738
|
options,
|
|
1716
1739
|
onChange,
|
|
1717
1740
|
onBlur,
|
|
1718
1741
|
onFocus
|
|
1719
1742
|
} = props;
|
|
1720
1743
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
1721
|
-
const optionValueFormat = (0,
|
|
1744
|
+
const optionValueFormat = (0, import_utils32.getOptionValueFormat)(options);
|
|
1722
1745
|
const themeProps = cleanupOptions(options);
|
|
1746
|
+
(0, import_utils32.logUnsupportedDefaultForEnum)(id, schema, enumOptions, multiple);
|
|
1723
1747
|
const handleChange = (0, import_react12.useCallback)(
|
|
1724
1748
|
(nextValue) => {
|
|
1725
1749
|
if (!disabled && !readonly && onChange) {
|
|
1726
|
-
onChange((0,
|
|
1750
|
+
onChange((0, import_utils32.enumOptionValueDecoder)(nextValue, enumOptions, optionValueFormat, emptyValue));
|
|
1727
1751
|
}
|
|
1728
1752
|
},
|
|
1729
1753
|
[onChange, disabled, readonly, enumOptions, emptyValue, optionValueFormat]
|
|
@@ -1731,7 +1755,7 @@ function SelectWidget(props) {
|
|
|
1731
1755
|
const handleBlur = (0, import_react12.useCallback)(
|
|
1732
1756
|
({ target }) => {
|
|
1733
1757
|
if (onBlur) {
|
|
1734
|
-
onBlur(id, (0,
|
|
1758
|
+
onBlur(id, (0, import_utils32.enumOptionValueDecoder)(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1735
1759
|
}
|
|
1736
1760
|
},
|
|
1737
1761
|
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
@@ -1739,7 +1763,7 @@ function SelectWidget(props) {
|
|
|
1739
1763
|
const handleFocus = (0, import_react12.useCallback)(
|
|
1740
1764
|
({ target }) => {
|
|
1741
1765
|
if (onFocus) {
|
|
1742
|
-
onFocus(id, (0,
|
|
1766
|
+
onFocus(id, (0, import_utils32.enumOptionValueDecoder)(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1743
1767
|
}
|
|
1744
1768
|
},
|
|
1745
1769
|
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
@@ -1748,7 +1772,7 @@ function SelectWidget(props) {
|
|
|
1748
1772
|
if (Array.isArray(enumOptions)) {
|
|
1749
1773
|
return enumOptions.map((option, index) => ({
|
|
1750
1774
|
key: String(index),
|
|
1751
|
-
value: (0,
|
|
1775
|
+
value: (0, import_utils32.enumOptionValueEncoder)(option.value, index, optionValueFormat),
|
|
1752
1776
|
label: option.label,
|
|
1753
1777
|
disabled: Array.isArray(enumDisabled) && enumDisabled.includes(option.value)
|
|
1754
1778
|
}));
|
|
@@ -1758,7 +1782,7 @@ function SelectWidget(props) {
|
|
|
1758
1782
|
const sharedProps = {
|
|
1759
1783
|
id,
|
|
1760
1784
|
name: htmlName || id,
|
|
1761
|
-
label: (0,
|
|
1785
|
+
label: (0, import_utils32.labelValue)(label || void 0, hideLabel, false),
|
|
1762
1786
|
data: selectOptions,
|
|
1763
1787
|
onChange: !readonly ? handleChange : void 0,
|
|
1764
1788
|
onBlur: !readonly ? handleBlur : void 0,
|
|
@@ -1769,30 +1793,33 @@ function SelectWidget(props) {
|
|
|
1769
1793
|
required,
|
|
1770
1794
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1771
1795
|
searchable: true,
|
|
1772
|
-
"aria-describedby": (0,
|
|
1796
|
+
"aria-describedby": (0, import_utils32.ariaDescribedByIds)(id),
|
|
1773
1797
|
comboboxProps: { withinPortal: false },
|
|
1774
1798
|
...themeProps
|
|
1775
1799
|
};
|
|
1776
|
-
return
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
1801
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_utils32.SelectedOptionDescription, { ...props }),
|
|
1802
|
+
multiple ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1803
|
+
import_core29.MultiSelect,
|
|
1804
|
+
{
|
|
1805
|
+
...sharedProps,
|
|
1806
|
+
value: (0, import_utils32.enumOptionSelectedValue)(value, enumOptions, true, optionValueFormat, [])
|
|
1807
|
+
}
|
|
1808
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1809
|
+
import_core29.Select,
|
|
1810
|
+
{
|
|
1811
|
+
...sharedProps,
|
|
1812
|
+
value: (0, import_utils32.enumOptionSelectedValue)(value, enumOptions, false, optionValueFormat, null)
|
|
1813
|
+
}
|
|
1814
|
+
)
|
|
1815
|
+
] });
|
|
1789
1816
|
}
|
|
1790
1817
|
|
|
1791
1818
|
// src/widgets/TextareaWidget.tsx
|
|
1792
1819
|
var import_react13 = require("react");
|
|
1793
|
-
var
|
|
1794
|
-
var
|
|
1795
|
-
var
|
|
1820
|
+
var import_core30 = require("@mantine/core");
|
|
1821
|
+
var import_utils34 = require("@rjsf/utils");
|
|
1822
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1796
1823
|
function TextareaWidget(props) {
|
|
1797
1824
|
const {
|
|
1798
1825
|
id,
|
|
@@ -1823,7 +1850,7 @@ function TextareaWidget(props) {
|
|
|
1823
1850
|
const handleBlur = (0, import_react13.useCallback)(
|
|
1824
1851
|
({ target }) => {
|
|
1825
1852
|
if (onBlur) {
|
|
1826
|
-
onBlur(id, target
|
|
1853
|
+
onBlur(id, target?.value);
|
|
1827
1854
|
}
|
|
1828
1855
|
},
|
|
1829
1856
|
[onBlur, id]
|
|
@@ -1831,13 +1858,13 @@ function TextareaWidget(props) {
|
|
|
1831
1858
|
const handleFocus = (0, import_react13.useCallback)(
|
|
1832
1859
|
({ target }) => {
|
|
1833
1860
|
if (onFocus) {
|
|
1834
|
-
onFocus(id, target
|
|
1861
|
+
onFocus(id, target?.value);
|
|
1835
1862
|
}
|
|
1836
1863
|
},
|
|
1837
1864
|
[onFocus, id]
|
|
1838
1865
|
);
|
|
1839
|
-
return /* @__PURE__ */ (0,
|
|
1840
|
-
|
|
1866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1867
|
+
import_core30.Textarea,
|
|
1841
1868
|
{
|
|
1842
1869
|
id,
|
|
1843
1870
|
name: htmlName || name,
|
|
@@ -1846,12 +1873,12 @@ function TextareaWidget(props) {
|
|
|
1846
1873
|
required,
|
|
1847
1874
|
disabled: disabled || readonly,
|
|
1848
1875
|
autoFocus: autofocus,
|
|
1849
|
-
label: (0,
|
|
1876
|
+
label: (0, import_utils34.labelValue)(label || void 0, hideLabel, false),
|
|
1850
1877
|
onChange: handleChange,
|
|
1851
1878
|
onBlur: handleBlur,
|
|
1852
1879
|
onFocus: handleFocus,
|
|
1853
1880
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1854
|
-
"aria-describedby": (0,
|
|
1881
|
+
"aria-describedby": (0, import_utils34.ariaDescribedByIds)(id),
|
|
1855
1882
|
...themeProps
|
|
1856
1883
|
}
|
|
1857
1884
|
);
|
|
@@ -1890,7 +1917,7 @@ var Theme_default = generateTheme();
|
|
|
1890
1917
|
|
|
1891
1918
|
// src/Form/index.ts
|
|
1892
1919
|
function generateForm() {
|
|
1893
|
-
return (0,
|
|
1920
|
+
return (0, import_core31.withTheme)(generateTheme());
|
|
1894
1921
|
}
|
|
1895
1922
|
var Form_default = generateForm();
|
|
1896
1923
|
|