@rjsf/mantine 6.6.2 → 6.7.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/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/mantine.esm.js
CHANGED
|
@@ -202,13 +202,13 @@ function BaseInputTemplate(props) {
|
|
|
202
202
|
);
|
|
203
203
|
const handleBlur = useCallback(
|
|
204
204
|
(e) => {
|
|
205
|
-
onBlur(id, e.target
|
|
205
|
+
onBlur(id, e.target?.value);
|
|
206
206
|
},
|
|
207
207
|
[onBlur, id]
|
|
208
208
|
);
|
|
209
209
|
const handleFocus = useCallback(
|
|
210
210
|
(e) => {
|
|
211
|
-
onFocus(id, e.target
|
|
211
|
+
onFocus(id, e.target?.value);
|
|
212
212
|
},
|
|
213
213
|
[onFocus, id]
|
|
214
214
|
);
|
|
@@ -533,37 +533,58 @@ function buttonTemplates() {
|
|
|
533
533
|
}
|
|
534
534
|
var ButtonTemplates_default = buttonTemplates;
|
|
535
535
|
|
|
536
|
+
// src/templates/CyclicSchemaExpandTemplate.tsx
|
|
537
|
+
import { Alert, Button as Button2, Group as Group3 } from "@mantine/core";
|
|
538
|
+
import { ID_KEY, TranslatableString as TranslatableString3 } from "@rjsf/utils";
|
|
539
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
540
|
+
function CyclicSchemaExpandTemplate(props) {
|
|
541
|
+
const { name, fieldPathId, registry, onExpand } = props;
|
|
542
|
+
const { translateString } = registry;
|
|
543
|
+
const buttonId4 = `${fieldPathId[ID_KEY]}-button`;
|
|
544
|
+
return /* @__PURE__ */ jsx9(
|
|
545
|
+
Alert,
|
|
546
|
+
{
|
|
547
|
+
color: "yellow",
|
|
548
|
+
variant: "transparent",
|
|
549
|
+
title: translateString(TranslatableString3.CycleDetected, [name]),
|
|
550
|
+
icon: /* @__PURE__ */ jsx9(ExclamationCircle, {}),
|
|
551
|
+
mt: "md",
|
|
552
|
+
children: /* @__PURE__ */ jsx9(Group3, { children: /* @__PURE__ */ jsx9(Button2, { id: buttonId4, size: "xs", variant: "outline", color: "yellow", onClick: () => onExpand(fieldPathId[ID_KEY]), children: translateString(TranslatableString3.ExpandButton) }) })
|
|
553
|
+
}
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
|
|
536
557
|
// src/templates/DescriptionField.tsx
|
|
537
558
|
import { Text } from "@mantine/core";
|
|
538
559
|
import { RichDescription } from "@rjsf/core";
|
|
539
|
-
import { jsx as
|
|
560
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
540
561
|
function DescriptionField(props) {
|
|
541
562
|
const { id, description, registry, uiSchema } = props;
|
|
542
563
|
if (description) {
|
|
543
|
-
return /* @__PURE__ */
|
|
564
|
+
return /* @__PURE__ */ jsx10(Text, { id, mt: 3, mb: "sm", children: /* @__PURE__ */ jsx10(RichDescription, { description, registry, uiSchema }) });
|
|
544
565
|
}
|
|
545
566
|
return null;
|
|
546
567
|
}
|
|
547
568
|
|
|
548
569
|
// src/templates/ErrorList.tsx
|
|
549
|
-
import { Alert, Title as Title2, List } from "@mantine/core";
|
|
550
|
-
import { TranslatableString as
|
|
551
|
-
import { jsx as
|
|
570
|
+
import { Alert as Alert2, Title as Title2, List } from "@mantine/core";
|
|
571
|
+
import { TranslatableString as TranslatableString4 } from "@rjsf/utils";
|
|
572
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
552
573
|
function ErrorList({
|
|
553
574
|
errors,
|
|
554
575
|
registry
|
|
555
576
|
}) {
|
|
556
577
|
const { translateString } = registry;
|
|
557
|
-
return /* @__PURE__ */
|
|
558
|
-
|
|
578
|
+
return /* @__PURE__ */ jsx11(
|
|
579
|
+
Alert2,
|
|
559
580
|
{
|
|
560
581
|
color: "red",
|
|
561
582
|
variant: "transparent",
|
|
562
|
-
title: /* @__PURE__ */
|
|
563
|
-
icon: /* @__PURE__ */
|
|
564
|
-
children: /* @__PURE__ */
|
|
583
|
+
title: /* @__PURE__ */ jsx11(Title2, { order: 5, fw: "normal", children: translateString(TranslatableString4.ErrorsLabel) }),
|
|
584
|
+
icon: /* @__PURE__ */ jsx11(ExclamationCircle, {}),
|
|
585
|
+
children: /* @__PURE__ */ jsx11(List, { children: errors.map((error, index) => (
|
|
565
586
|
// oxlint-disable-next-line react/no-array-index-key
|
|
566
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ jsx11(List.Item, { c: "red", children: error.stack }, `error-${index}`)
|
|
567
588
|
)) })
|
|
568
589
|
}
|
|
569
590
|
);
|
|
@@ -572,15 +593,15 @@ function ErrorList({
|
|
|
572
593
|
// src/templates/FieldErrorTemplate.tsx
|
|
573
594
|
import { Box as Box3, List as List2 } from "@mantine/core";
|
|
574
595
|
import { errorId } from "@rjsf/utils";
|
|
575
|
-
import { jsx as
|
|
596
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
576
597
|
function FieldErrorTemplate({ errors, fieldPathId }) {
|
|
577
|
-
if (!errors
|
|
598
|
+
if (!errors?.length) {
|
|
578
599
|
return null;
|
|
579
600
|
}
|
|
580
601
|
const id = errorId(fieldPathId);
|
|
581
|
-
return /* @__PURE__ */
|
|
602
|
+
return /* @__PURE__ */ jsx12(Box3, { id, c: "red", display: "none", children: /* @__PURE__ */ jsx12(List2, { children: errors.map((error, index) => (
|
|
582
603
|
// oxlint-disable-next-line react/no-array-index-key
|
|
583
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ jsx12(List2.Item, { children: error }, `field-error-${index}`)
|
|
584
605
|
)) }) });
|
|
585
606
|
}
|
|
586
607
|
|
|
@@ -588,19 +609,19 @@ function FieldErrorTemplate({ errors, fieldPathId }) {
|
|
|
588
609
|
import { Text as Text2 } from "@mantine/core";
|
|
589
610
|
import { RichHelp } from "@rjsf/core";
|
|
590
611
|
import { helpId } from "@rjsf/utils";
|
|
591
|
-
import { jsx as
|
|
612
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
592
613
|
function FieldHelpTemplate(props) {
|
|
593
614
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
594
615
|
if (!help) {
|
|
595
616
|
return null;
|
|
596
617
|
}
|
|
597
|
-
return /* @__PURE__ */
|
|
618
|
+
return /* @__PURE__ */ jsx13(Text2, { id: helpId(fieldPathId), size: "sm", my: "xs", c: "dimmed", children: /* @__PURE__ */ jsx13(RichHelp, { help, registry, uiSchema }) });
|
|
598
619
|
}
|
|
599
620
|
|
|
600
621
|
// src/templates/FieldTemplate.tsx
|
|
601
622
|
import { Box as Box4 } from "@mantine/core";
|
|
602
623
|
import { getTemplate as getTemplate3, getUiOptions as getUiOptions4 } from "@rjsf/utils";
|
|
603
|
-
import { jsx as
|
|
624
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
604
625
|
function FieldTemplate(props) {
|
|
605
626
|
const {
|
|
606
627
|
id,
|
|
@@ -626,7 +647,7 @@ function FieldTemplate(props) {
|
|
|
626
647
|
uiOptions
|
|
627
648
|
);
|
|
628
649
|
if (hidden) {
|
|
629
|
-
return /* @__PURE__ */
|
|
650
|
+
return /* @__PURE__ */ jsx14(Box4, { display: "none", children });
|
|
630
651
|
}
|
|
631
652
|
return /* @__PURE__ */ jsxs6(
|
|
632
653
|
WrapIfAdditionalTemplate2,
|
|
@@ -652,16 +673,16 @@ function FieldTemplate(props) {
|
|
|
652
673
|
|
|
653
674
|
// src/templates/GridTemplate.tsx
|
|
654
675
|
import { Container, Grid as Grid2 } from "@mantine/core";
|
|
655
|
-
import { jsx as
|
|
676
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
656
677
|
function GridTemplate(props) {
|
|
657
678
|
const { children, column, fluid = true, ...rest } = props;
|
|
658
679
|
if (column) {
|
|
659
|
-
return /* @__PURE__ */
|
|
680
|
+
return /* @__PURE__ */ jsx15(Grid2.Col, { ...rest, children });
|
|
660
681
|
}
|
|
661
682
|
if (fluid) {
|
|
662
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ jsx15(Container, { p: "4", mx: 0, w: "100%", children: /* @__PURE__ */ jsx15(Grid2, { ...rest, children }) });
|
|
663
684
|
}
|
|
664
|
-
return /* @__PURE__ */
|
|
685
|
+
return /* @__PURE__ */ jsx15(Grid2, { grow: true, ...rest, children });
|
|
665
686
|
}
|
|
666
687
|
|
|
667
688
|
// src/templates/MultiSchemaFieldTemplate.tsx
|
|
@@ -675,9 +696,9 @@ function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
|
|
|
675
696
|
}
|
|
676
697
|
|
|
677
698
|
// src/templates/ObjectFieldTemplate.tsx
|
|
678
|
-
import { Box as Box5, Container as Container2, Group as
|
|
699
|
+
import { Box as Box5, Container as Container2, Group as Group4, SimpleGrid } from "@mantine/core";
|
|
679
700
|
import { buttonId as buttonId2, canExpand, descriptionId, getTemplate as getTemplate4, getUiOptions as getUiOptions5, titleId as titleId2 } from "@rjsf/utils";
|
|
680
|
-
import { jsx as
|
|
701
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
681
702
|
function ObjectFieldTemplate(props) {
|
|
682
703
|
const {
|
|
683
704
|
title,
|
|
@@ -709,7 +730,7 @@ function ObjectFieldTemplate(props) {
|
|
|
709
730
|
const gridSpacing = uiOptions?.gridSpacing;
|
|
710
731
|
const gridVerticalSpacing = uiOptions?.gridVerticalSpacing;
|
|
711
732
|
return /* @__PURE__ */ jsxs8(Container2, { id: fieldPathId.$id, p: 0, children: [
|
|
712
|
-
title && /* @__PURE__ */
|
|
733
|
+
title && /* @__PURE__ */ jsx16(
|
|
713
734
|
TitleFieldTemplate,
|
|
714
735
|
{
|
|
715
736
|
id: titleId2(fieldPathId),
|
|
@@ -721,7 +742,7 @@ function ObjectFieldTemplate(props) {
|
|
|
721
742
|
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
722
743
|
}
|
|
723
744
|
),
|
|
724
|
-
description && /* @__PURE__ */
|
|
745
|
+
description && /* @__PURE__ */ jsx16(
|
|
725
746
|
DescriptionFieldTemplate,
|
|
726
747
|
{
|
|
727
748
|
id: descriptionId(fieldPathId),
|
|
@@ -740,11 +761,11 @@ function ObjectFieldTemplate(props) {
|
|
|
740
761
|
mb: "sm",
|
|
741
762
|
children: [
|
|
742
763
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
743
|
-
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */
|
|
764
|
+
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ jsx16(Box5, { children: element.content }, element.name))
|
|
744
765
|
]
|
|
745
766
|
}
|
|
746
767
|
),
|
|
747
|
-
canExpand(schema, uiSchema, formData) && /* @__PURE__ */
|
|
768
|
+
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx16(Group4, { mt: "xs", justify: "flex-end", children: /* @__PURE__ */ jsx16(
|
|
748
769
|
AddButton2,
|
|
749
770
|
{
|
|
750
771
|
id: buttonId2(fieldPathId, "add"),
|
|
@@ -759,11 +780,11 @@ function ObjectFieldTemplate(props) {
|
|
|
759
780
|
}
|
|
760
781
|
|
|
761
782
|
// src/templates/OptionalDataControlsTemplate.tsx
|
|
762
|
-
import { jsx as
|
|
783
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
763
784
|
function OptionalDataControlsTemplate(props) {
|
|
764
785
|
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
765
786
|
if (onAddClick) {
|
|
766
|
-
return /* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ jsx17(
|
|
767
788
|
AddButton,
|
|
768
789
|
{
|
|
769
790
|
id,
|
|
@@ -776,7 +797,7 @@ function OptionalDataControlsTemplate(props) {
|
|
|
776
797
|
);
|
|
777
798
|
}
|
|
778
799
|
if (onRemoveClick) {
|
|
779
|
-
return /* @__PURE__ */
|
|
800
|
+
return /* @__PURE__ */ jsx17(
|
|
780
801
|
RemoveButton,
|
|
781
802
|
{
|
|
782
803
|
id,
|
|
@@ -788,19 +809,19 @@ function OptionalDataControlsTemplate(props) {
|
|
|
788
809
|
}
|
|
789
810
|
);
|
|
790
811
|
}
|
|
791
|
-
return /* @__PURE__ */
|
|
812
|
+
return /* @__PURE__ */ jsx17("em", { id, children: label });
|
|
792
813
|
}
|
|
793
814
|
|
|
794
815
|
// src/templates/TitleField.tsx
|
|
795
816
|
import { Grid as Grid3, Title as Title3 } from "@mantine/core";
|
|
796
|
-
import { jsx as
|
|
817
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
797
818
|
function TitleField(props) {
|
|
798
819
|
const { id, title, optionalDataControl } = props;
|
|
799
|
-
let heading = title ? /* @__PURE__ */
|
|
820
|
+
let heading = title ? /* @__PURE__ */ jsx18(Title3, { id, order: 3, fw: "normal", children: title }) : null;
|
|
800
821
|
if (optionalDataControl) {
|
|
801
822
|
heading = /* @__PURE__ */ jsxs9(Grid3, { children: [
|
|
802
|
-
/* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ jsx18(Grid3.Col, { span: "auto", children: heading }),
|
|
824
|
+
/* @__PURE__ */ jsx18(Grid3.Col, { span: "content", children: optionalDataControl })
|
|
804
825
|
] });
|
|
805
826
|
}
|
|
806
827
|
return heading;
|
|
@@ -808,8 +829,8 @@ function TitleField(props) {
|
|
|
808
829
|
|
|
809
830
|
// src/templates/WrapIfAdditionalTemplate.tsx
|
|
810
831
|
import { Flex as Flex2, Grid as Grid4, TextInput as TextInput2 } from "@mantine/core";
|
|
811
|
-
import { ADDITIONAL_PROPERTY_FLAG, UI_OPTIONS_KEY, buttonId as buttonId3, TranslatableString as
|
|
812
|
-
import { jsx as
|
|
832
|
+
import { ADDITIONAL_PROPERTY_FLAG, UI_OPTIONS_KEY, buttonId as buttonId3, TranslatableString as TranslatableString5 } from "@rjsf/utils";
|
|
833
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
813
834
|
function WrapIfAdditionalTemplate(props) {
|
|
814
835
|
const {
|
|
815
836
|
id,
|
|
@@ -830,19 +851,19 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
830
851
|
} = props;
|
|
831
852
|
const { templates, translateString } = registry;
|
|
832
853
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
833
|
-
const keyLabel = translateString(
|
|
854
|
+
const keyLabel = translateString(TranslatableString5.KeyLabel, [label]);
|
|
834
855
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
835
856
|
if (!additional) {
|
|
836
|
-
return /* @__PURE__ */
|
|
857
|
+
return /* @__PURE__ */ jsx19("div", { className: classNames, style, children });
|
|
837
858
|
}
|
|
838
859
|
const uiOptions = uiSchema ? uiSchema[UI_OPTIONS_KEY] : {};
|
|
839
860
|
const buttonUiOptions = {
|
|
840
861
|
...uiSchema,
|
|
841
862
|
[UI_OPTIONS_KEY]: { ...uiOptions, block: true }
|
|
842
863
|
};
|
|
843
|
-
return /* @__PURE__ */
|
|
864
|
+
return /* @__PURE__ */ jsx19("div", { className: classNames, style, children: /* @__PURE__ */ jsxs10(Flex2, { gap: "xs", align: "end", justify: "center", children: [
|
|
844
865
|
/* @__PURE__ */ jsxs10(Grid4, { w: "100%", align: "center", children: [
|
|
845
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ jsx19(Grid4.Col, { span: 6, className: "form-additional", children: /* @__PURE__ */ jsx19(
|
|
846
867
|
TextInput2,
|
|
847
868
|
{
|
|
848
869
|
className: "form-group",
|
|
@@ -857,9 +878,9 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
857
878
|
},
|
|
858
879
|
label
|
|
859
880
|
) }),
|
|
860
|
-
/* @__PURE__ */
|
|
881
|
+
/* @__PURE__ */ jsx19(Grid4.Col, { span: 6, className: "form-additional", children })
|
|
861
882
|
] }),
|
|
862
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ jsx19("div", { children: /* @__PURE__ */ jsx19(
|
|
863
884
|
RemoveButton2,
|
|
864
885
|
{
|
|
865
886
|
id: buttonId3(id, "remove"),
|
|
@@ -881,6 +902,7 @@ function generateTemplates() {
|
|
|
881
902
|
ArrayFieldTemplate,
|
|
882
903
|
ArrayFieldTitleTemplate,
|
|
883
904
|
BaseInputTemplate,
|
|
905
|
+
CyclicSchemaExpandTemplate,
|
|
884
906
|
ButtonTemplates: ButtonTemplates_default(),
|
|
885
907
|
DescriptionFieldTemplate: DescriptionField,
|
|
886
908
|
ErrorListTemplate: ErrorList,
|
|
@@ -913,7 +935,7 @@ import {
|
|
|
913
935
|
optionId,
|
|
914
936
|
titleId as titleId3
|
|
915
937
|
} from "@rjsf/utils";
|
|
916
|
-
import { Fragment as Fragment2, jsx as
|
|
938
|
+
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
917
939
|
function CheckboxesWidget(props) {
|
|
918
940
|
const {
|
|
919
941
|
id,
|
|
@@ -960,8 +982,8 @@ function CheckboxesWidget(props) {
|
|
|
960
982
|
);
|
|
961
983
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
|
|
962
984
|
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
963
|
-
!hideLabel && !!label && /* @__PURE__ */
|
|
964
|
-
/* @__PURE__ */
|
|
985
|
+
!hideLabel && !!label && /* @__PURE__ */ jsx20(Input.Label, { id: titleId3(id), required, children: label }),
|
|
986
|
+
/* @__PURE__ */ jsx20(
|
|
965
987
|
Checkbox.Group,
|
|
966
988
|
{
|
|
967
989
|
id,
|
|
@@ -972,7 +994,7 @@ function CheckboxesWidget(props) {
|
|
|
972
994
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
973
995
|
"aria-describedby": ariaDescribedByIds2(id),
|
|
974
996
|
...themeProps,
|
|
975
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */
|
|
997
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ jsx20(Flex3, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ jsx20(
|
|
976
998
|
Checkbox,
|
|
977
999
|
{
|
|
978
1000
|
id: optionId(id, i),
|
|
@@ -995,7 +1017,7 @@ function CheckboxesWidget(props) {
|
|
|
995
1017
|
import { useCallback as useCallback3 } from "react";
|
|
996
1018
|
import { Checkbox as Checkbox2 } from "@mantine/core";
|
|
997
1019
|
import { descriptionId as descriptionId2, getTemplate as getTemplate5, labelValue as labelValue2, ariaDescribedByIds as ariaDescribedByIds3 } from "@rjsf/utils";
|
|
998
|
-
import { Fragment as Fragment3, jsx as
|
|
1020
|
+
import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
999
1021
|
function CheckboxWidget(props) {
|
|
1000
1022
|
const {
|
|
1001
1023
|
id,
|
|
@@ -1048,7 +1070,7 @@ function CheckboxWidget(props) {
|
|
|
1048
1070
|
);
|
|
1049
1071
|
const description = options.description || schema.description;
|
|
1050
1072
|
return /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1051
|
-
!hideLabel && !!description && /* @__PURE__ */
|
|
1073
|
+
!hideLabel && !!description && /* @__PURE__ */ jsx21(
|
|
1052
1074
|
DescriptionFieldTemplate,
|
|
1053
1075
|
{
|
|
1054
1076
|
id: descriptionId2(id),
|
|
@@ -1058,7 +1080,7 @@ function CheckboxWidget(props) {
|
|
|
1058
1080
|
registry
|
|
1059
1081
|
}
|
|
1060
1082
|
),
|
|
1061
|
-
/* @__PURE__ */
|
|
1083
|
+
/* @__PURE__ */ jsx21(
|
|
1062
1084
|
Checkbox2,
|
|
1063
1085
|
{
|
|
1064
1086
|
id,
|
|
@@ -1082,7 +1104,7 @@ function CheckboxWidget(props) {
|
|
|
1082
1104
|
import { useCallback as useCallback4 } from "react";
|
|
1083
1105
|
import { ColorInput } from "@mantine/core";
|
|
1084
1106
|
import { labelValue as labelValue3, ariaDescribedByIds as ariaDescribedByIds4 } from "@rjsf/utils";
|
|
1085
|
-
import { jsx as
|
|
1107
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1086
1108
|
function ColorWidget(props) {
|
|
1087
1109
|
const {
|
|
1088
1110
|
id,
|
|
@@ -1111,7 +1133,7 @@ function ColorWidget(props) {
|
|
|
1111
1133
|
const handleBlur = useCallback4(
|
|
1112
1134
|
({ target }) => {
|
|
1113
1135
|
if (onBlur) {
|
|
1114
|
-
onBlur(id, target
|
|
1136
|
+
onBlur(id, target?.value);
|
|
1115
1137
|
}
|
|
1116
1138
|
},
|
|
1117
1139
|
[onBlur, id]
|
|
@@ -1119,12 +1141,12 @@ function ColorWidget(props) {
|
|
|
1119
1141
|
const handleFocus = useCallback4(
|
|
1120
1142
|
({ target }) => {
|
|
1121
1143
|
if (onFocus) {
|
|
1122
|
-
onFocus(id, target
|
|
1144
|
+
onFocus(id, target?.value);
|
|
1123
1145
|
}
|
|
1124
1146
|
},
|
|
1125
1147
|
[onFocus, id]
|
|
1126
1148
|
);
|
|
1127
|
-
return /* @__PURE__ */
|
|
1149
|
+
return /* @__PURE__ */ jsx22(
|
|
1128
1150
|
ColorInput,
|
|
1129
1151
|
{
|
|
1130
1152
|
id,
|
|
@@ -1147,28 +1169,28 @@ function ColorWidget(props) {
|
|
|
1147
1169
|
}
|
|
1148
1170
|
|
|
1149
1171
|
// src/widgets/DateTime/AltDateTimeWidget.tsx
|
|
1150
|
-
import { jsx as
|
|
1172
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1151
1173
|
function AltDateTimeWidget(props) {
|
|
1152
1174
|
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
1153
|
-
return /* @__PURE__ */
|
|
1175
|
+
return /* @__PURE__ */ jsx23(AltDateWidget2, { time: true, ...props });
|
|
1154
1176
|
}
|
|
1155
1177
|
|
|
1156
1178
|
// src/widgets/DateTime/AltDateWidget.tsx
|
|
1157
|
-
import { Flex as Flex4, Box as Box6, Group as
|
|
1158
|
-
import { ariaDescribedByIds as ariaDescribedByIds5, dateRangeOptions, titleId as titleId4, TranslatableString as
|
|
1159
|
-
import { Fragment as Fragment4, jsx as
|
|
1179
|
+
import { Flex as Flex4, Box as Box6, Group as Group5, Button as Button3, Select, Input as Input2 } from "@mantine/core";
|
|
1180
|
+
import { ariaDescribedByIds as ariaDescribedByIds5, dateRangeOptions, titleId as titleId4, TranslatableString as TranslatableString6, useAltDateWidgetProps } from "@rjsf/utils";
|
|
1181
|
+
import { Fragment as Fragment4, jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1160
1182
|
function AltDateWidget(props) {
|
|
1161
1183
|
const { id, required, disabled, readonly, label, hideLabel, rawErrors, options, registry } = props;
|
|
1162
1184
|
const { translateString } = registry;
|
|
1163
1185
|
const { elements, handleChange, handleClear, handleSetNow } = useAltDateWidgetProps(props);
|
|
1164
1186
|
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
1165
|
-
!hideLabel && !!label && /* @__PURE__ */
|
|
1187
|
+
!hideLabel && !!label && /* @__PURE__ */ jsx24(Input2.Label, { id: titleId4(id), required, children: label }),
|
|
1166
1188
|
/* @__PURE__ */ jsxs13(Flex4, { gap: "xs", align: "center", wrap: "nowrap", children: [
|
|
1167
1189
|
elements.map((elemProps, i) => {
|
|
1168
1190
|
const elemId = `${id}_${elemProps.type}`;
|
|
1169
1191
|
return (
|
|
1170
1192
|
// oxlint-disable-next-line react/no-array-index-key
|
|
1171
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ jsx24(Box6, { children: /* @__PURE__ */ jsx24(
|
|
1172
1194
|
Select,
|
|
1173
1195
|
{
|
|
1174
1196
|
id: elemId,
|
|
@@ -1186,14 +1208,14 @@ function AltDateWidget(props) {
|
|
|
1186
1208
|
) }, i)
|
|
1187
1209
|
);
|
|
1188
1210
|
}),
|
|
1189
|
-
/* @__PURE__ */ jsxs13(
|
|
1190
|
-
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */
|
|
1191
|
-
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */
|
|
1211
|
+
/* @__PURE__ */ jsxs13(Group5, { wrap: "nowrap", gap: 3, children: [
|
|
1212
|
+
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ jsx24(Button3, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(TranslatableString6.NowLabel) }),
|
|
1213
|
+
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ jsx24(Button3, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(TranslatableString6.ClearLabel) })
|
|
1192
1214
|
] })
|
|
1193
1215
|
] }),
|
|
1194
1216
|
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => (
|
|
1195
1217
|
// oxlint-disable-next-line react/no-array-index-key
|
|
1196
|
-
/* @__PURE__ */
|
|
1218
|
+
/* @__PURE__ */ jsx24(Input2.Error, { children: error }, `alt-date-widget-input-errors-${index}`)
|
|
1197
1219
|
))
|
|
1198
1220
|
] });
|
|
1199
1221
|
}
|
|
@@ -1203,7 +1225,7 @@ import { useCallback as useCallback5 } from "react";
|
|
|
1203
1225
|
import { DateInput } from "@mantine/dates";
|
|
1204
1226
|
import { ariaDescribedByIds as ariaDescribedByIds6, labelValue as labelValue4 } from "@rjsf/utils";
|
|
1205
1227
|
import dayjs from "dayjs";
|
|
1206
|
-
import { jsx as
|
|
1228
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1207
1229
|
var dateParser = (input, format) => {
|
|
1208
1230
|
if (!input) {
|
|
1209
1231
|
return null;
|
|
@@ -1253,7 +1275,7 @@ function DateTimeInput(props) {
|
|
|
1253
1275
|
onFocus(id, value);
|
|
1254
1276
|
}
|
|
1255
1277
|
}, [onFocus, id, value]);
|
|
1256
|
-
return /* @__PURE__ */
|
|
1278
|
+
return /* @__PURE__ */ jsx25(
|
|
1257
1279
|
DateInput,
|
|
1258
1280
|
{
|
|
1259
1281
|
id,
|
|
@@ -1279,10 +1301,10 @@ function DateTimeInput(props) {
|
|
|
1279
1301
|
}
|
|
1280
1302
|
|
|
1281
1303
|
// src/widgets/DateTime/DateWidget.tsx
|
|
1282
|
-
import { jsx as
|
|
1304
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1283
1305
|
function DateWidget(props) {
|
|
1284
1306
|
const { valueFormat = "YYYY-MM-DD", displayFormat, ...otherOptions } = props.options;
|
|
1285
|
-
return /* @__PURE__ */
|
|
1307
|
+
return /* @__PURE__ */ jsx26(
|
|
1286
1308
|
DateTimeInput,
|
|
1287
1309
|
{
|
|
1288
1310
|
...props,
|
|
@@ -1294,10 +1316,10 @@ function DateWidget(props) {
|
|
|
1294
1316
|
}
|
|
1295
1317
|
|
|
1296
1318
|
// src/widgets/DateTime/DateTimeWidget.tsx
|
|
1297
|
-
import { jsx as
|
|
1319
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1298
1320
|
function DateTimeWidget(props) {
|
|
1299
1321
|
const { valueFormat = "YYYY-MM-DD HH:mm:ss", displayFormat, ...otherOptions } = props.options;
|
|
1300
|
-
return /* @__PURE__ */
|
|
1322
|
+
return /* @__PURE__ */ jsx27(
|
|
1301
1323
|
DateTimeInput,
|
|
1302
1324
|
{
|
|
1303
1325
|
...props,
|
|
@@ -1312,7 +1334,7 @@ function DateTimeWidget(props) {
|
|
|
1312
1334
|
import { useCallback as useCallback6 } from "react";
|
|
1313
1335
|
import { TimeInput } from "@mantine/dates";
|
|
1314
1336
|
import { labelValue as labelValue5, ariaDescribedByIds as ariaDescribedByIds7 } from "@rjsf/utils";
|
|
1315
|
-
import { jsx as
|
|
1337
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1316
1338
|
function TimeWidget(props) {
|
|
1317
1339
|
const {
|
|
1318
1340
|
id,
|
|
@@ -1341,7 +1363,7 @@ function TimeWidget(props) {
|
|
|
1341
1363
|
const handleBlur = useCallback6(
|
|
1342
1364
|
({ target }) => {
|
|
1343
1365
|
if (onBlur) {
|
|
1344
|
-
onBlur(id, target
|
|
1366
|
+
onBlur(id, target?.value);
|
|
1345
1367
|
}
|
|
1346
1368
|
},
|
|
1347
1369
|
[onBlur, id]
|
|
@@ -1349,12 +1371,12 @@ function TimeWidget(props) {
|
|
|
1349
1371
|
const handleFocus = useCallback6(
|
|
1350
1372
|
({ target }) => {
|
|
1351
1373
|
if (onFocus) {
|
|
1352
|
-
onFocus(id, target
|
|
1374
|
+
onFocus(id, target?.value);
|
|
1353
1375
|
}
|
|
1354
1376
|
},
|
|
1355
1377
|
[onFocus, id]
|
|
1356
1378
|
);
|
|
1357
|
-
return /* @__PURE__ */
|
|
1379
|
+
return /* @__PURE__ */ jsx28(
|
|
1358
1380
|
TimeInput,
|
|
1359
1381
|
{
|
|
1360
1382
|
id,
|
|
@@ -1380,7 +1402,7 @@ function TimeWidget(props) {
|
|
|
1380
1402
|
import { useCallback as useCallback7 } from "react";
|
|
1381
1403
|
import { FileInput, Pill } from "@mantine/core";
|
|
1382
1404
|
import { ariaDescribedByIds as ariaDescribedByIds8, labelValue as labelValue6, useFileWidgetProps } from "@rjsf/utils";
|
|
1383
|
-
import { jsx as
|
|
1405
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1384
1406
|
function FileWidget(props) {
|
|
1385
1407
|
const {
|
|
1386
1408
|
id,
|
|
@@ -1410,14 +1432,14 @@ function FileWidget(props) {
|
|
|
1410
1432
|
);
|
|
1411
1433
|
const ValueComponent = useCallback7(() => {
|
|
1412
1434
|
if (Array.isArray(filesInfo) && filesInfo.length > 0) {
|
|
1413
|
-
return /* @__PURE__ */
|
|
1435
|
+
return /* @__PURE__ */ jsx29(Pill.Group, { children: filesInfo.map((file, index) => (
|
|
1414
1436
|
// oxlint-disable-next-line react/no-array-index-key
|
|
1415
|
-
/* @__PURE__ */
|
|
1437
|
+
/* @__PURE__ */ jsx29(Pill, { withRemoveButton: true, onRemove: () => handleRemove(index), children: file.name }, index)
|
|
1416
1438
|
)) });
|
|
1417
1439
|
}
|
|
1418
1440
|
return null;
|
|
1419
1441
|
}, [handleRemove, filesInfo]);
|
|
1420
|
-
return /* @__PURE__ */
|
|
1442
|
+
return /* @__PURE__ */ jsx29(
|
|
1421
1443
|
FileInput,
|
|
1422
1444
|
{
|
|
1423
1445
|
id,
|
|
@@ -1442,7 +1464,7 @@ function FileWidget(props) {
|
|
|
1442
1464
|
import { useCallback as useCallback8 } from "react";
|
|
1443
1465
|
import { PasswordInput } from "@mantine/core";
|
|
1444
1466
|
import { ariaDescribedByIds as ariaDescribedByIds9, labelValue as labelValue7 } from "@rjsf/utils";
|
|
1445
|
-
import { jsx as
|
|
1467
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1446
1468
|
function PasswordWidget(props) {
|
|
1447
1469
|
const {
|
|
1448
1470
|
id,
|
|
@@ -1472,7 +1494,7 @@ function PasswordWidget(props) {
|
|
|
1472
1494
|
const handleBlur = useCallback8(
|
|
1473
1495
|
({ target }) => {
|
|
1474
1496
|
if (onBlur) {
|
|
1475
|
-
onBlur(id, target
|
|
1497
|
+
onBlur(id, target?.value);
|
|
1476
1498
|
}
|
|
1477
1499
|
},
|
|
1478
1500
|
[onBlur, id]
|
|
@@ -1480,12 +1502,12 @@ function PasswordWidget(props) {
|
|
|
1480
1502
|
const handleFocus = useCallback8(
|
|
1481
1503
|
({ target }) => {
|
|
1482
1504
|
if (onFocus) {
|
|
1483
|
-
onFocus(id, target
|
|
1505
|
+
onFocus(id, target?.value);
|
|
1484
1506
|
}
|
|
1485
1507
|
},
|
|
1486
1508
|
[onFocus, id]
|
|
1487
1509
|
);
|
|
1488
|
-
return /* @__PURE__ */
|
|
1510
|
+
return /* @__PURE__ */ jsx30(
|
|
1489
1511
|
PasswordInput,
|
|
1490
1512
|
{
|
|
1491
1513
|
id,
|
|
@@ -1517,7 +1539,7 @@ import {
|
|
|
1517
1539
|
getOptionValueFormat as getOptionValueFormat2,
|
|
1518
1540
|
optionId as optionId2
|
|
1519
1541
|
} from "@rjsf/utils";
|
|
1520
|
-
import { jsx as
|
|
1542
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1521
1543
|
function RadioWidget(props) {
|
|
1522
1544
|
const {
|
|
1523
1545
|
id,
|
|
@@ -1549,7 +1571,7 @@ function RadioWidget(props) {
|
|
|
1549
1571
|
const handleBlur = useCallback9(
|
|
1550
1572
|
({ target }) => {
|
|
1551
1573
|
if (onBlur) {
|
|
1552
|
-
onBlur(id, enumOptionValueDecoder2(target
|
|
1574
|
+
onBlur(id, enumOptionValueDecoder2(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1553
1575
|
}
|
|
1554
1576
|
},
|
|
1555
1577
|
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
@@ -1557,13 +1579,13 @@ function RadioWidget(props) {
|
|
|
1557
1579
|
const handleFocus = useCallback9(
|
|
1558
1580
|
({ target }) => {
|
|
1559
1581
|
if (onFocus) {
|
|
1560
|
-
onFocus(id, enumOptionValueDecoder2(target
|
|
1582
|
+
onFocus(id, enumOptionValueDecoder2(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1561
1583
|
}
|
|
1562
1584
|
},
|
|
1563
1585
|
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
1564
1586
|
);
|
|
1565
1587
|
const selected = enumOptionsIndexForValue2(value, enumOptions);
|
|
1566
|
-
return /* @__PURE__ */
|
|
1588
|
+
return /* @__PURE__ */ jsx31(
|
|
1567
1589
|
Radio.Group,
|
|
1568
1590
|
{
|
|
1569
1591
|
id,
|
|
@@ -1576,7 +1598,7 @@ function RadioWidget(props) {
|
|
|
1576
1598
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1577
1599
|
"aria-describedby": ariaDescribedByIds10(id),
|
|
1578
1600
|
...themeProps,
|
|
1579
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */
|
|
1601
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ jsx31(Flex5, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ jsx31(
|
|
1580
1602
|
Radio,
|
|
1581
1603
|
{
|
|
1582
1604
|
id: optionId2(id, i),
|
|
@@ -1597,7 +1619,7 @@ function RadioWidget(props) {
|
|
|
1597
1619
|
import { useCallback as useCallback10 } from "react";
|
|
1598
1620
|
import { Slider, Input as Input3 } from "@mantine/core";
|
|
1599
1621
|
import { ariaDescribedByIds as ariaDescribedByIds11, rangeSpec, titleId as titleId5 } from "@rjsf/utils";
|
|
1600
|
-
import { Fragment as Fragment5, jsx as
|
|
1622
|
+
import { Fragment as Fragment5, jsx as jsx32, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1601
1623
|
function RangeWidget(props) {
|
|
1602
1624
|
const {
|
|
1603
1625
|
id,
|
|
@@ -1637,9 +1659,9 @@ function RangeWidget(props) {
|
|
|
1637
1659
|
}
|
|
1638
1660
|
}, [onFocus, id, value]);
|
|
1639
1661
|
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
1640
|
-
!hideLabel && !!label && /* @__PURE__ */
|
|
1641
|
-
options?.description && /* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1662
|
+
!hideLabel && !!label && /* @__PURE__ */ jsx32(Input3.Label, { id: titleId5(id), required, children: label }),
|
|
1663
|
+
options?.description && /* @__PURE__ */ jsx32(Input3.Description, { children: options.description }),
|
|
1664
|
+
/* @__PURE__ */ jsx32(
|
|
1643
1665
|
Slider,
|
|
1644
1666
|
{
|
|
1645
1667
|
id,
|
|
@@ -1659,7 +1681,7 @@ function RangeWidget(props) {
|
|
|
1659
1681
|
),
|
|
1660
1682
|
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => (
|
|
1661
1683
|
// oxlint-disable-next-line react/no-array-index-key
|
|
1662
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ jsx32(Input3.Error, { children: error }, `range-widget-input-errors-${index}`)
|
|
1663
1685
|
))
|
|
1664
1686
|
] });
|
|
1665
1687
|
}
|
|
@@ -1673,9 +1695,11 @@ import {
|
|
|
1673
1695
|
enumOptionValueDecoder as enumOptionValueDecoder3,
|
|
1674
1696
|
enumOptionValueEncoder as enumOptionValueEncoder3,
|
|
1675
1697
|
getOptionValueFormat as getOptionValueFormat3,
|
|
1676
|
-
labelValue as labelValue8
|
|
1698
|
+
labelValue as labelValue8,
|
|
1699
|
+
logUnsupportedDefaultForEnum,
|
|
1700
|
+
SelectedOptionDescription
|
|
1677
1701
|
} from "@rjsf/utils";
|
|
1678
|
-
import { jsx as
|
|
1702
|
+
import { Fragment as Fragment6, jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1679
1703
|
function SelectWidget(props) {
|
|
1680
1704
|
const {
|
|
1681
1705
|
id,
|
|
@@ -1690,6 +1714,7 @@ function SelectWidget(props) {
|
|
|
1690
1714
|
hideLabel,
|
|
1691
1715
|
multiple,
|
|
1692
1716
|
rawErrors,
|
|
1717
|
+
schema,
|
|
1693
1718
|
options,
|
|
1694
1719
|
onChange,
|
|
1695
1720
|
onBlur,
|
|
@@ -1698,6 +1723,7 @@ function SelectWidget(props) {
|
|
|
1698
1723
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
1699
1724
|
const optionValueFormat = getOptionValueFormat3(options);
|
|
1700
1725
|
const themeProps = cleanupOptions(options);
|
|
1726
|
+
logUnsupportedDefaultForEnum(id, schema, enumOptions, multiple);
|
|
1701
1727
|
const handleChange = useCallback11(
|
|
1702
1728
|
(nextValue) => {
|
|
1703
1729
|
if (!disabled && !readonly && onChange) {
|
|
@@ -1709,7 +1735,7 @@ function SelectWidget(props) {
|
|
|
1709
1735
|
const handleBlur = useCallback11(
|
|
1710
1736
|
({ target }) => {
|
|
1711
1737
|
if (onBlur) {
|
|
1712
|
-
onBlur(id, enumOptionValueDecoder3(target
|
|
1738
|
+
onBlur(id, enumOptionValueDecoder3(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1713
1739
|
}
|
|
1714
1740
|
},
|
|
1715
1741
|
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
@@ -1717,7 +1743,7 @@ function SelectWidget(props) {
|
|
|
1717
1743
|
const handleFocus = useCallback11(
|
|
1718
1744
|
({ target }) => {
|
|
1719
1745
|
if (onFocus) {
|
|
1720
|
-
onFocus(id, enumOptionValueDecoder3(target
|
|
1746
|
+
onFocus(id, enumOptionValueDecoder3(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1721
1747
|
}
|
|
1722
1748
|
},
|
|
1723
1749
|
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
@@ -1751,26 +1777,29 @@ function SelectWidget(props) {
|
|
|
1751
1777
|
comboboxProps: { withinPortal: false },
|
|
1752
1778
|
...themeProps
|
|
1753
1779
|
};
|
|
1754
|
-
return
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1780
|
+
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
1781
|
+
/* @__PURE__ */ jsx33(SelectedOptionDescription, { ...props }),
|
|
1782
|
+
multiple ? /* @__PURE__ */ jsx33(
|
|
1783
|
+
MultiSelect,
|
|
1784
|
+
{
|
|
1785
|
+
...sharedProps,
|
|
1786
|
+
value: enumOptionSelectedValue(value, enumOptions, true, optionValueFormat, [])
|
|
1787
|
+
}
|
|
1788
|
+
) : /* @__PURE__ */ jsx33(
|
|
1789
|
+
Select2,
|
|
1790
|
+
{
|
|
1791
|
+
...sharedProps,
|
|
1792
|
+
value: enumOptionSelectedValue(value, enumOptions, false, optionValueFormat, null)
|
|
1793
|
+
}
|
|
1794
|
+
)
|
|
1795
|
+
] });
|
|
1767
1796
|
}
|
|
1768
1797
|
|
|
1769
1798
|
// src/widgets/TextareaWidget.tsx
|
|
1770
1799
|
import { useCallback as useCallback12 } from "react";
|
|
1771
1800
|
import { Textarea } from "@mantine/core";
|
|
1772
1801
|
import { labelValue as labelValue9, ariaDescribedByIds as ariaDescribedByIds13 } from "@rjsf/utils";
|
|
1773
|
-
import { jsx as
|
|
1802
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1774
1803
|
function TextareaWidget(props) {
|
|
1775
1804
|
const {
|
|
1776
1805
|
id,
|
|
@@ -1801,7 +1830,7 @@ function TextareaWidget(props) {
|
|
|
1801
1830
|
const handleBlur = useCallback12(
|
|
1802
1831
|
({ target }) => {
|
|
1803
1832
|
if (onBlur) {
|
|
1804
|
-
onBlur(id, target
|
|
1833
|
+
onBlur(id, target?.value);
|
|
1805
1834
|
}
|
|
1806
1835
|
},
|
|
1807
1836
|
[onBlur, id]
|
|
@@ -1809,12 +1838,12 @@ function TextareaWidget(props) {
|
|
|
1809
1838
|
const handleFocus = useCallback12(
|
|
1810
1839
|
({ target }) => {
|
|
1811
1840
|
if (onFocus) {
|
|
1812
|
-
onFocus(id, target
|
|
1841
|
+
onFocus(id, target?.value);
|
|
1813
1842
|
}
|
|
1814
1843
|
},
|
|
1815
1844
|
[onFocus, id]
|
|
1816
1845
|
);
|
|
1817
|
-
return /* @__PURE__ */
|
|
1846
|
+
return /* @__PURE__ */ jsx34(
|
|
1818
1847
|
Textarea,
|
|
1819
1848
|
{
|
|
1820
1849
|
id,
|