@rjsf/mantine 6.0.0-beta.20 → 6.0.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +187 -139
- package/dist/index.cjs.map +4 -4
- package/dist/mantine.esm.js +186 -138
- package/dist/mantine.esm.js.map +4 -4
- package/dist/mantine.umd.js +75 -29
- package/lib/templates/ArrayFieldItemTemplate.d.ts +3 -3
- package/lib/templates/ArrayFieldItemTemplate.js +1 -1
- package/lib/templates/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/templates/ArrayFieldTemplate.d.ts +1 -1
- package/lib/templates/ArrayFieldTemplate.js +5 -6
- package/lib/templates/ArrayFieldTemplate.js.map +1 -1
- package/lib/templates/BaseInputTemplate.js +2 -2
- package/lib/templates/BaseInputTemplate.js.map +1 -1
- package/lib/templates/ObjectFieldTemplate.js +5 -4
- package/lib/templates/ObjectFieldTemplate.js.map +1 -1
- package/lib/templates/OptionalDataControlsTemplate.d.ts +10 -0
- package/lib/templates/OptionalDataControlsTemplate.js +22 -0
- package/lib/templates/OptionalDataControlsTemplate.js.map +1 -0
- package/lib/templates/TitleField.js +8 -4
- package/lib/templates/TitleField.js.map +1 -1
- package/lib/templates/WrapIfAdditionalTemplate.js +2 -4
- package/lib/templates/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/templates/index.js +2 -0
- package/lib/templates/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/widgets/CheckboxWidget.js +2 -2
- package/lib/widgets/CheckboxWidget.js.map +1 -1
- package/lib/widgets/CheckboxesWidget.js +2 -2
- package/lib/widgets/CheckboxesWidget.js.map +1 -1
- package/lib/widgets/RadioWidget.js +2 -2
- package/lib/widgets/RadioWidget.js.map +1 -1
- package/lib/widgets/SelectWidget.js +2 -2
- 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 +7 -7
- package/src/templates/ArrayFieldItemTemplate.tsx +3 -3
- package/src/templates/ArrayFieldTemplate.tsx +6 -13
- package/src/templates/BaseInputTemplate.tsx +3 -2
- package/src/templates/ObjectFieldTemplate.tsx +6 -3
- package/src/templates/OptionalDataControlsTemplate.tsx +44 -0
- package/src/templates/TitleField.tsx +12 -3
- package/src/templates/WrapIfAdditionalTemplate.tsx +4 -10
- package/src/templates/index.ts +2 -0
- package/src/widgets/CheckboxWidget.tsx +2 -1
- package/src/widgets/CheckboxesWidget.tsx +2 -1
- package/src/widgets/RadioWidget.tsx +2 -1
- package/src/widgets/SelectWidget.tsx +2 -1
- package/src/widgets/TextareaWidget.tsx +2 -1
package/dist/mantine.esm.js
CHANGED
|
@@ -37,6 +37,7 @@ function ArrayFieldTemplate(props) {
|
|
|
37
37
|
disabled,
|
|
38
38
|
fieldPathId,
|
|
39
39
|
items,
|
|
40
|
+
optionalDataControl,
|
|
40
41
|
onAddClick,
|
|
41
42
|
readonly,
|
|
42
43
|
required,
|
|
@@ -51,16 +52,12 @@ function ArrayFieldTemplate(props) {
|
|
|
51
52
|
registry,
|
|
52
53
|
uiOptions
|
|
53
54
|
);
|
|
54
|
-
const ArrayFieldItemTemplate2 = getTemplate2(
|
|
55
|
-
"ArrayFieldItemTemplate",
|
|
56
|
-
registry,
|
|
57
|
-
uiOptions
|
|
58
|
-
);
|
|
59
55
|
const ArrayFieldTitleTemplate2 = getTemplate2(
|
|
60
56
|
"ArrayFieldTitleTemplate",
|
|
61
57
|
registry,
|
|
62
58
|
uiOptions
|
|
63
59
|
);
|
|
60
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
64
61
|
const {
|
|
65
62
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
66
63
|
} = registry.templates;
|
|
@@ -72,7 +69,8 @@ function ArrayFieldTemplate(props) {
|
|
|
72
69
|
title: uiOptions.title || title,
|
|
73
70
|
schema,
|
|
74
71
|
uiSchema,
|
|
75
|
-
registry
|
|
72
|
+
registry,
|
|
73
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
76
74
|
}
|
|
77
75
|
);
|
|
78
76
|
return /* @__PURE__ */ jsxs2(Fieldset, { legend, className, id: fieldPathId.$id, children: [
|
|
@@ -86,7 +84,10 @@ function ArrayFieldTemplate(props) {
|
|
|
86
84
|
registry
|
|
87
85
|
}
|
|
88
86
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ jsxs2(Box2, { className: "row rjsf-array-item-list", children: [
|
|
88
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
89
|
+
items
|
|
90
|
+
] }),
|
|
90
91
|
canAdd && /* @__PURE__ */ jsx2(Group2, { justify: "flex-end", children: /* @__PURE__ */ jsx2(
|
|
91
92
|
AddButton2,
|
|
92
93
|
{
|
|
@@ -170,6 +171,7 @@ import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
|
170
171
|
function BaseInputTemplate(props) {
|
|
171
172
|
const {
|
|
172
173
|
id,
|
|
174
|
+
htmlName,
|
|
173
175
|
type,
|
|
174
176
|
schema,
|
|
175
177
|
value,
|
|
@@ -215,7 +217,7 @@ function BaseInputTemplate(props) {
|
|
|
215
217
|
NumberInput,
|
|
216
218
|
{
|
|
217
219
|
id,
|
|
218
|
-
name: id,
|
|
220
|
+
name: htmlName || id,
|
|
219
221
|
label: labelValue(label || void 0, hideLabel, false),
|
|
220
222
|
required,
|
|
221
223
|
autoFocus: autofocus,
|
|
@@ -237,7 +239,7 @@ function BaseInputTemplate(props) {
|
|
|
237
239
|
TextInput,
|
|
238
240
|
{
|
|
239
241
|
id,
|
|
240
|
-
name: id,
|
|
242
|
+
name: htmlName || id,
|
|
241
243
|
label: labelValue(label || void 0, hideLabel, false),
|
|
242
244
|
required,
|
|
243
245
|
autoFocus: autofocus,
|
|
@@ -654,7 +656,8 @@ function ObjectFieldTemplate(props) {
|
|
|
654
656
|
description,
|
|
655
657
|
disabled,
|
|
656
658
|
properties,
|
|
657
|
-
|
|
659
|
+
optionalDataControl,
|
|
660
|
+
onAddProperty,
|
|
658
661
|
readonly,
|
|
659
662
|
required,
|
|
660
663
|
schema,
|
|
@@ -670,6 +673,7 @@ function ObjectFieldTemplate(props) {
|
|
|
670
673
|
registry,
|
|
671
674
|
uiOptions
|
|
672
675
|
);
|
|
676
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
673
677
|
const {
|
|
674
678
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
675
679
|
} = registry.templates;
|
|
@@ -685,7 +689,8 @@ function ObjectFieldTemplate(props) {
|
|
|
685
689
|
required,
|
|
686
690
|
schema,
|
|
687
691
|
uiSchema,
|
|
688
|
-
registry
|
|
692
|
+
registry,
|
|
693
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
689
694
|
}
|
|
690
695
|
),
|
|
691
696
|
description && /* @__PURE__ */ jsx15(
|
|
@@ -698,14 +703,17 @@ function ObjectFieldTemplate(props) {
|
|
|
698
703
|
registry
|
|
699
704
|
}
|
|
700
705
|
),
|
|
701
|
-
/* @__PURE__ */
|
|
706
|
+
/* @__PURE__ */ jsxs6(
|
|
702
707
|
SimpleGrid,
|
|
703
708
|
{
|
|
704
709
|
cols: gridCols,
|
|
705
710
|
spacing: gridSpacing,
|
|
706
711
|
verticalSpacing: gridVerticalSpacing,
|
|
707
712
|
mb: "sm",
|
|
708
|
-
children:
|
|
713
|
+
children: [
|
|
714
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
715
|
+
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ jsx15(Box5, { children: element.content }, element.name))
|
|
716
|
+
]
|
|
709
717
|
}
|
|
710
718
|
),
|
|
711
719
|
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx15(Group3, { mt: "xs", justify: "flex-end", children: /* @__PURE__ */ jsx15(
|
|
@@ -713,7 +721,7 @@ function ObjectFieldTemplate(props) {
|
|
|
713
721
|
{
|
|
714
722
|
id: buttonId2(fieldPathId, "add"),
|
|
715
723
|
disabled: disabled || readonly,
|
|
716
|
-
onClick:
|
|
724
|
+
onClick: onAddProperty,
|
|
717
725
|
className: "rjsf-object-property-expand",
|
|
718
726
|
uiSchema,
|
|
719
727
|
registry
|
|
@@ -722,24 +730,62 @@ function ObjectFieldTemplate(props) {
|
|
|
722
730
|
] });
|
|
723
731
|
}
|
|
724
732
|
|
|
725
|
-
// src/templates/
|
|
726
|
-
import { Title as Title3 } from "@mantine/core";
|
|
733
|
+
// src/templates/OptionalDataControlsTemplate.tsx
|
|
727
734
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
735
|
+
function OptionalDataControlsTemplate(props) {
|
|
736
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
737
|
+
if (onAddClick) {
|
|
738
|
+
return /* @__PURE__ */ jsx16(
|
|
739
|
+
AddButton,
|
|
740
|
+
{
|
|
741
|
+
id,
|
|
742
|
+
registry,
|
|
743
|
+
icon: "plus",
|
|
744
|
+
className: "rjsf-add-optional-data",
|
|
745
|
+
onClick: onAddClick,
|
|
746
|
+
title: label
|
|
747
|
+
}
|
|
748
|
+
);
|
|
749
|
+
} else if (onRemoveClick) {
|
|
750
|
+
return /* @__PURE__ */ jsx16(
|
|
751
|
+
RemoveButton,
|
|
752
|
+
{
|
|
753
|
+
id,
|
|
754
|
+
registry,
|
|
755
|
+
icon: "remove",
|
|
756
|
+
className: "rjsf-remove-optional-data",
|
|
757
|
+
onClick: onRemoveClick,
|
|
758
|
+
title: label
|
|
759
|
+
}
|
|
760
|
+
);
|
|
761
|
+
}
|
|
762
|
+
return /* @__PURE__ */ jsx16("em", { id, children: label });
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
// src/templates/TitleField.tsx
|
|
766
|
+
import { Grid as Grid2, Title as Title3 } from "@mantine/core";
|
|
767
|
+
import { jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
728
768
|
function TitleField(props) {
|
|
729
|
-
const { id, title } = props;
|
|
730
|
-
|
|
769
|
+
const { id, title, optionalDataControl } = props;
|
|
770
|
+
let heading = title ? /* @__PURE__ */ jsx17(Title3, { id, order: 3, fw: "normal", children: title }) : null;
|
|
771
|
+
if (optionalDataControl) {
|
|
772
|
+
heading = /* @__PURE__ */ jsxs7(Grid2, { children: [
|
|
773
|
+
/* @__PURE__ */ jsx17(Grid2.Col, { span: "auto", children: heading }),
|
|
774
|
+
/* @__PURE__ */ jsx17(Grid2.Col, { span: "content", children: optionalDataControl })
|
|
775
|
+
] });
|
|
776
|
+
}
|
|
777
|
+
return heading;
|
|
731
778
|
}
|
|
732
779
|
|
|
733
780
|
// src/templates/WrapIfAdditionalTemplate.tsx
|
|
734
|
-
import { useCallback as useCallback2 } from "react";
|
|
735
781
|
import {
|
|
736
782
|
ADDITIONAL_PROPERTY_FLAG,
|
|
737
783
|
UI_OPTIONS_KEY,
|
|
738
784
|
buttonId as buttonId3,
|
|
739
785
|
TranslatableString as TranslatableString4
|
|
740
786
|
} from "@rjsf/utils";
|
|
741
|
-
import { Flex as Flex2, Grid as
|
|
742
|
-
import { jsx as
|
|
787
|
+
import { Flex as Flex2, Grid as Grid3, TextInput as TextInput2 } from "@mantine/core";
|
|
788
|
+
import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
743
789
|
function WrapIfAdditionalTemplate(props) {
|
|
744
790
|
const {
|
|
745
791
|
id,
|
|
@@ -751,8 +797,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
751
797
|
disabled,
|
|
752
798
|
schema,
|
|
753
799
|
uiSchema,
|
|
754
|
-
|
|
755
|
-
|
|
800
|
+
onKeyRenameBlur,
|
|
801
|
+
onRemoveProperty,
|
|
756
802
|
registry,
|
|
757
803
|
children
|
|
758
804
|
} = props;
|
|
@@ -760,21 +806,17 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
760
806
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
761
807
|
const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
|
|
762
808
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
763
|
-
const handleBlur = useCallback2(
|
|
764
|
-
({ target }) => onKeyChange(target && target.value),
|
|
765
|
-
[onKeyChange]
|
|
766
|
-
);
|
|
767
809
|
if (!additional) {
|
|
768
|
-
return /* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ jsx18("div", { className: classNames, style, children });
|
|
769
811
|
}
|
|
770
812
|
const uiOptions = uiSchema ? uiSchema[UI_OPTIONS_KEY] : {};
|
|
771
813
|
const buttonUiOptions = {
|
|
772
814
|
...uiSchema,
|
|
773
815
|
[UI_OPTIONS_KEY]: { ...uiOptions, block: true }
|
|
774
816
|
};
|
|
775
|
-
return /* @__PURE__ */
|
|
776
|
-
/* @__PURE__ */
|
|
777
|
-
/* @__PURE__ */
|
|
817
|
+
return /* @__PURE__ */ jsx18("div", { className: classNames, style, children: /* @__PURE__ */ jsxs8(Flex2, { gap: "xs", align: "end", justify: "center", children: [
|
|
818
|
+
/* @__PURE__ */ jsxs8(Grid3, { w: "100%", align: "center", children: [
|
|
819
|
+
/* @__PURE__ */ jsx18(Grid3.Col, { span: 6, className: "form-additional", children: /* @__PURE__ */ jsx18("div", { className: "form-group", children: /* @__PURE__ */ jsx18(
|
|
778
820
|
TextInput2,
|
|
779
821
|
{
|
|
780
822
|
className: "form-group",
|
|
@@ -784,19 +826,19 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
784
826
|
disabled: disabled || readonly,
|
|
785
827
|
id: `${id}-key`,
|
|
786
828
|
name: `${id}-key`,
|
|
787
|
-
onBlur: !readonly ?
|
|
829
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0
|
|
788
830
|
}
|
|
789
831
|
) }) }),
|
|
790
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ jsx18(Grid3.Col, { span: 6, className: "form-additional", children })
|
|
791
833
|
] }),
|
|
792
|
-
/* @__PURE__ */
|
|
834
|
+
/* @__PURE__ */ jsx18(
|
|
793
835
|
RemoveButton2,
|
|
794
836
|
{
|
|
795
837
|
id: buttonId3(id, "remove"),
|
|
796
838
|
iconType: "sm",
|
|
797
839
|
className: "rjsf-array-item-remove",
|
|
798
840
|
disabled: disabled || readonly,
|
|
799
|
-
onClick:
|
|
841
|
+
onClick: onRemoveProperty,
|
|
800
842
|
uiSchema: buttonUiOptions,
|
|
801
843
|
registry
|
|
802
844
|
}
|
|
@@ -806,9 +848,9 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
806
848
|
|
|
807
849
|
// src/templates/MultiSchemaFieldTemplate.tsx
|
|
808
850
|
import { Stack } from "@mantine/core";
|
|
809
|
-
import { jsxs as
|
|
851
|
+
import { jsxs as jsxs9 } from "react/jsx-runtime";
|
|
810
852
|
function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
|
|
811
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ jsxs9(Stack, { style: { marginBottom: "1rem" }, children: [
|
|
812
854
|
selector,
|
|
813
855
|
optionSchemaField
|
|
814
856
|
] });
|
|
@@ -829,6 +871,7 @@ function generateTemplates() {
|
|
|
829
871
|
FieldHelpTemplate,
|
|
830
872
|
GridTemplate,
|
|
831
873
|
ObjectFieldTemplate,
|
|
874
|
+
OptionalDataControlsTemplate,
|
|
832
875
|
TitleFieldTemplate: TitleField,
|
|
833
876
|
WrapIfAdditionalTemplate,
|
|
834
877
|
MultiSchemaFieldTemplate
|
|
@@ -841,7 +884,7 @@ import dayjs2 from "dayjs";
|
|
|
841
884
|
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
842
885
|
|
|
843
886
|
// src/widgets/DateTime/AltDateWidget.tsx
|
|
844
|
-
import { useCallback as
|
|
887
|
+
import { useCallback as useCallback2, useEffect, useState } from "react";
|
|
845
888
|
import {
|
|
846
889
|
ariaDescribedByIds as ariaDescribedByIds2,
|
|
847
890
|
dateRangeOptions,
|
|
@@ -852,7 +895,7 @@ import {
|
|
|
852
895
|
TranslatableString as TranslatableString5
|
|
853
896
|
} from "@rjsf/utils";
|
|
854
897
|
import { Flex as Flex3, Box as Box6, Group as Group4, Button as Button2, Select, Input } from "@mantine/core";
|
|
855
|
-
import { Fragment as Fragment2, jsx as
|
|
898
|
+
import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
856
899
|
function readyForChange(state) {
|
|
857
900
|
return Object.values(state).every((value) => value !== -1);
|
|
858
901
|
}
|
|
@@ -876,7 +919,7 @@ function AltDateWidget(props) {
|
|
|
876
919
|
useEffect(() => {
|
|
877
920
|
setState(parseDateString(value, showTime));
|
|
878
921
|
}, [showTime, value]);
|
|
879
|
-
const handleChange =
|
|
922
|
+
const handleChange = useCallback2(
|
|
880
923
|
(property, nextValue) => {
|
|
881
924
|
const nextState = {
|
|
882
925
|
...state,
|
|
@@ -890,20 +933,20 @@ function AltDateWidget(props) {
|
|
|
890
933
|
},
|
|
891
934
|
[state, onChange, showTime]
|
|
892
935
|
);
|
|
893
|
-
const handleSetNow =
|
|
936
|
+
const handleSetNow = useCallback2(() => {
|
|
894
937
|
if (!disabled && !readonly) {
|
|
895
938
|
const nextState = parseDateString((/* @__PURE__ */ new Date()).toJSON(), showTime);
|
|
896
939
|
onChange(toDateString(nextState, showTime));
|
|
897
940
|
}
|
|
898
941
|
}, [disabled, readonly, showTime, onChange]);
|
|
899
|
-
const handleClear =
|
|
942
|
+
const handleClear = useCallback2(() => {
|
|
900
943
|
if (!disabled && !readonly) {
|
|
901
944
|
onChange("");
|
|
902
945
|
}
|
|
903
946
|
}, [disabled, readonly, onChange]);
|
|
904
|
-
return /* @__PURE__ */
|
|
905
|
-
!hideLabel && !!label && /* @__PURE__ */
|
|
906
|
-
/* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
948
|
+
!hideLabel && !!label && /* @__PURE__ */ jsx19(Input.Label, { id: titleId3(id), required, children: label }),
|
|
949
|
+
/* @__PURE__ */ jsxs10(Flex3, { gap: "xs", align: "center", wrap: "nowrap", children: [
|
|
907
950
|
getDateElementProps(
|
|
908
951
|
state,
|
|
909
952
|
showTime,
|
|
@@ -911,7 +954,7 @@ function AltDateWidget(props) {
|
|
|
911
954
|
options.format
|
|
912
955
|
).map((elemProps, i) => {
|
|
913
956
|
const elemId = id + "_" + elemProps.type;
|
|
914
|
-
return /* @__PURE__ */
|
|
957
|
+
return /* @__PURE__ */ jsx19(Box6, { children: /* @__PURE__ */ jsx19(
|
|
915
958
|
Select,
|
|
916
959
|
{
|
|
917
960
|
id: elemId,
|
|
@@ -928,12 +971,12 @@ function AltDateWidget(props) {
|
|
|
928
971
|
}
|
|
929
972
|
) }, i);
|
|
930
973
|
}),
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */
|
|
933
|
-
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ jsxs10(Group4, { wrap: "nowrap", gap: 3, children: [
|
|
975
|
+
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ jsx19(Button2, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(TranslatableString5.NowLabel) }),
|
|
976
|
+
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ jsx19(Button2, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(TranslatableString5.ClearLabel) })
|
|
934
977
|
] })
|
|
935
978
|
] }),
|
|
936
|
-
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */
|
|
979
|
+
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ jsx19(Input.Error, { children: error }, `alt-date-widget-input-errors-${index}`))
|
|
937
980
|
] });
|
|
938
981
|
}
|
|
939
982
|
AltDateWidget.defaultProps = {
|
|
@@ -941,10 +984,10 @@ AltDateWidget.defaultProps = {
|
|
|
941
984
|
};
|
|
942
985
|
|
|
943
986
|
// src/widgets/DateTime/AltDateTimeWidget.tsx
|
|
944
|
-
import { jsx as
|
|
987
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
945
988
|
function AltDateTimeWidget(props) {
|
|
946
989
|
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
947
|
-
return /* @__PURE__ */
|
|
990
|
+
return /* @__PURE__ */ jsx20(AltDateWidget2, { showTime: true, ...props });
|
|
948
991
|
}
|
|
949
992
|
AltDateTimeWidget.defaultProps = {
|
|
950
993
|
...AltDateWidget?.defaultProps,
|
|
@@ -952,14 +995,14 @@ AltDateTimeWidget.defaultProps = {
|
|
|
952
995
|
};
|
|
953
996
|
|
|
954
997
|
// src/widgets/DateTime/DateTimeInput.tsx
|
|
955
|
-
import { useCallback as
|
|
998
|
+
import { useCallback as useCallback3 } from "react";
|
|
956
999
|
import {
|
|
957
1000
|
ariaDescribedByIds as ariaDescribedByIds3,
|
|
958
1001
|
labelValue as labelValue2
|
|
959
1002
|
} from "@rjsf/utils";
|
|
960
1003
|
import dayjs from "dayjs";
|
|
961
1004
|
import { DateInput } from "@mantine/dates";
|
|
962
|
-
import { jsx as
|
|
1005
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
963
1006
|
var dateParser = (input, format) => {
|
|
964
1007
|
if (!input) {
|
|
965
1008
|
return null;
|
|
@@ -993,23 +1036,23 @@ function DateTimeInput(props) {
|
|
|
993
1036
|
valueFormat,
|
|
994
1037
|
displayFormat
|
|
995
1038
|
} = props;
|
|
996
|
-
const handleChange =
|
|
1039
|
+
const handleChange = useCallback3(
|
|
997
1040
|
(nextValue) => {
|
|
998
1041
|
onChange(dateFormat(nextValue, valueFormat));
|
|
999
1042
|
},
|
|
1000
1043
|
[onChange, valueFormat]
|
|
1001
1044
|
);
|
|
1002
|
-
const handleBlur =
|
|
1045
|
+
const handleBlur = useCallback3(() => {
|
|
1003
1046
|
if (onBlur) {
|
|
1004
1047
|
onBlur(id, value);
|
|
1005
1048
|
}
|
|
1006
1049
|
}, [onBlur, id, value]);
|
|
1007
|
-
const handleFocus =
|
|
1050
|
+
const handleFocus = useCallback3(() => {
|
|
1008
1051
|
if (onFocus) {
|
|
1009
1052
|
onFocus(id, value);
|
|
1010
1053
|
}
|
|
1011
1054
|
}, [onFocus, id, value]);
|
|
1012
|
-
return /* @__PURE__ */
|
|
1055
|
+
return /* @__PURE__ */ jsx21(
|
|
1013
1056
|
DateInput,
|
|
1014
1057
|
{
|
|
1015
1058
|
id,
|
|
@@ -1035,10 +1078,10 @@ function DateTimeInput(props) {
|
|
|
1035
1078
|
}
|
|
1036
1079
|
|
|
1037
1080
|
// src/widgets/DateTime/DateWidget.tsx
|
|
1038
|
-
import { jsx as
|
|
1081
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1039
1082
|
function DateWidget(props) {
|
|
1040
1083
|
const { valueFormat = "YYYY-MM-DD", displayFormat, ...otherOptions } = props.options;
|
|
1041
|
-
return /* @__PURE__ */
|
|
1084
|
+
return /* @__PURE__ */ jsx22(
|
|
1042
1085
|
DateTimeInput,
|
|
1043
1086
|
{
|
|
1044
1087
|
...props,
|
|
@@ -1050,10 +1093,10 @@ function DateWidget(props) {
|
|
|
1050
1093
|
}
|
|
1051
1094
|
|
|
1052
1095
|
// src/widgets/DateTime/DateTimeWidget.tsx
|
|
1053
|
-
import { jsx as
|
|
1096
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1054
1097
|
function DateTimeWidget(props) {
|
|
1055
1098
|
const { valueFormat = "YYYY-MM-DD HH:mm:ss", displayFormat, ...otherOptions } = props.options;
|
|
1056
|
-
return /* @__PURE__ */
|
|
1099
|
+
return /* @__PURE__ */ jsx23(
|
|
1057
1100
|
DateTimeInput,
|
|
1058
1101
|
{
|
|
1059
1102
|
...props,
|
|
@@ -1065,13 +1108,13 @@ function DateTimeWidget(props) {
|
|
|
1065
1108
|
}
|
|
1066
1109
|
|
|
1067
1110
|
// src/widgets/DateTime/TimeWidget.tsx
|
|
1068
|
-
import { useCallback as
|
|
1111
|
+
import { useCallback as useCallback4 } from "react";
|
|
1069
1112
|
import {
|
|
1070
1113
|
labelValue as labelValue3,
|
|
1071
1114
|
ariaDescribedByIds as ariaDescribedByIds4
|
|
1072
1115
|
} from "@rjsf/utils";
|
|
1073
1116
|
import { TimeInput } from "@mantine/dates";
|
|
1074
|
-
import { jsx as
|
|
1117
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1075
1118
|
function TimeWidget(props) {
|
|
1076
1119
|
const {
|
|
1077
1120
|
id,
|
|
@@ -1091,13 +1134,13 @@ function TimeWidget(props) {
|
|
|
1091
1134
|
onFocus
|
|
1092
1135
|
} = props;
|
|
1093
1136
|
const emptyValue = options.emptyValue || "";
|
|
1094
|
-
const handleChange =
|
|
1137
|
+
const handleChange = useCallback4(
|
|
1095
1138
|
(e) => {
|
|
1096
1139
|
onChange(e.target.value === "" ? emptyValue : e.target.value);
|
|
1097
1140
|
},
|
|
1098
1141
|
[onChange, emptyValue]
|
|
1099
1142
|
);
|
|
1100
|
-
const handleBlur =
|
|
1143
|
+
const handleBlur = useCallback4(
|
|
1101
1144
|
({ target }) => {
|
|
1102
1145
|
if (onBlur) {
|
|
1103
1146
|
onBlur(id, target && target.value);
|
|
@@ -1105,7 +1148,7 @@ function TimeWidget(props) {
|
|
|
1105
1148
|
},
|
|
1106
1149
|
[onBlur, id]
|
|
1107
1150
|
);
|
|
1108
|
-
const handleFocus =
|
|
1151
|
+
const handleFocus = useCallback4(
|
|
1109
1152
|
({ target }) => {
|
|
1110
1153
|
if (onFocus) {
|
|
1111
1154
|
onFocus(id, target && target.value);
|
|
@@ -1113,7 +1156,7 @@ function TimeWidget(props) {
|
|
|
1113
1156
|
},
|
|
1114
1157
|
[onFocus, id]
|
|
1115
1158
|
);
|
|
1116
|
-
return /* @__PURE__ */
|
|
1159
|
+
return /* @__PURE__ */ jsx24(
|
|
1117
1160
|
TimeInput,
|
|
1118
1161
|
{
|
|
1119
1162
|
id,
|
|
@@ -1136,7 +1179,7 @@ function TimeWidget(props) {
|
|
|
1136
1179
|
}
|
|
1137
1180
|
|
|
1138
1181
|
// src/widgets/CheckboxesWidget.tsx
|
|
1139
|
-
import { useCallback as
|
|
1182
|
+
import { useCallback as useCallback5 } from "react";
|
|
1140
1183
|
import {
|
|
1141
1184
|
ariaDescribedByIds as ariaDescribedByIds5,
|
|
1142
1185
|
enumOptionsValueForIndex,
|
|
@@ -1145,10 +1188,11 @@ import {
|
|
|
1145
1188
|
titleId as titleId4
|
|
1146
1189
|
} from "@rjsf/utils";
|
|
1147
1190
|
import { Checkbox, Flex as Flex4, Input as Input2 } from "@mantine/core";
|
|
1148
|
-
import { Fragment as Fragment3, jsx as
|
|
1191
|
+
import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1149
1192
|
function CheckboxesWidget(props) {
|
|
1150
1193
|
const {
|
|
1151
1194
|
id,
|
|
1195
|
+
htmlName,
|
|
1152
1196
|
value,
|
|
1153
1197
|
required,
|
|
1154
1198
|
disabled,
|
|
@@ -1164,7 +1208,7 @@ function CheckboxesWidget(props) {
|
|
|
1164
1208
|
} = props;
|
|
1165
1209
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
1166
1210
|
const themeProps = cleanupOptions(options);
|
|
1167
|
-
const handleChange =
|
|
1211
|
+
const handleChange = useCallback5(
|
|
1168
1212
|
(nextValue) => {
|
|
1169
1213
|
if (!disabled && !readonly && onChange) {
|
|
1170
1214
|
onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
|
|
@@ -1172,7 +1216,7 @@ function CheckboxesWidget(props) {
|
|
|
1172
1216
|
},
|
|
1173
1217
|
[onChange, disabled, readonly, enumOptions, emptyValue]
|
|
1174
1218
|
);
|
|
1175
|
-
const handleBlur =
|
|
1219
|
+
const handleBlur = useCallback5(
|
|
1176
1220
|
({ target }) => {
|
|
1177
1221
|
if (onBlur) {
|
|
1178
1222
|
onBlur(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
|
|
@@ -1180,7 +1224,7 @@ function CheckboxesWidget(props) {
|
|
|
1180
1224
|
},
|
|
1181
1225
|
[onBlur, id, enumOptions, emptyValue]
|
|
1182
1226
|
);
|
|
1183
|
-
const handleFocus =
|
|
1227
|
+
const handleFocus = useCallback5(
|
|
1184
1228
|
({ target }) => {
|
|
1185
1229
|
if (onFocus) {
|
|
1186
1230
|
onFocus(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
|
|
@@ -1189,9 +1233,9 @@ function CheckboxesWidget(props) {
|
|
|
1189
1233
|
[onFocus, id, enumOptions, emptyValue]
|
|
1190
1234
|
);
|
|
1191
1235
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
|
|
1192
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */
|
|
1193
|
-
!hideLabel && !!label && /* @__PURE__ */
|
|
1194
|
-
/* @__PURE__ */
|
|
1236
|
+
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
1237
|
+
!hideLabel && !!label && /* @__PURE__ */ jsx25(Input2.Label, { id: titleId4(id), required, children: label }),
|
|
1238
|
+
/* @__PURE__ */ jsx25(
|
|
1195
1239
|
Checkbox.Group,
|
|
1196
1240
|
{
|
|
1197
1241
|
id,
|
|
@@ -1202,11 +1246,11 @@ function CheckboxesWidget(props) {
|
|
|
1202
1246
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1203
1247
|
"aria-describedby": ariaDescribedByIds5(id),
|
|
1204
1248
|
...themeProps,
|
|
1205
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */
|
|
1249
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ jsx25(Flex4, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ jsx25(
|
|
1206
1250
|
Checkbox,
|
|
1207
1251
|
{
|
|
1208
1252
|
id: optionId(id, i),
|
|
1209
|
-
name: id,
|
|
1253
|
+
name: htmlName || id,
|
|
1210
1254
|
value: String(i),
|
|
1211
1255
|
label: option.label,
|
|
1212
1256
|
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1,
|
|
@@ -1222,7 +1266,7 @@ function CheckboxesWidget(props) {
|
|
|
1222
1266
|
}
|
|
1223
1267
|
|
|
1224
1268
|
// src/widgets/CheckboxWidget.tsx
|
|
1225
|
-
import { useCallback as
|
|
1269
|
+
import { useCallback as useCallback6 } from "react";
|
|
1226
1270
|
import {
|
|
1227
1271
|
descriptionId as descriptionId2,
|
|
1228
1272
|
getTemplate as getTemplate5,
|
|
@@ -1230,11 +1274,12 @@ import {
|
|
|
1230
1274
|
ariaDescribedByIds as ariaDescribedByIds6
|
|
1231
1275
|
} from "@rjsf/utils";
|
|
1232
1276
|
import { Checkbox as Checkbox2 } from "@mantine/core";
|
|
1233
|
-
import { Fragment as Fragment4, jsx as
|
|
1277
|
+
import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1234
1278
|
function CheckboxWidget(props) {
|
|
1235
1279
|
const {
|
|
1236
1280
|
id,
|
|
1237
1281
|
name,
|
|
1282
|
+
htmlName,
|
|
1238
1283
|
value = false,
|
|
1239
1284
|
required,
|
|
1240
1285
|
disabled,
|
|
@@ -1257,7 +1302,7 @@ function CheckboxWidget(props) {
|
|
|
1257
1302
|
registry,
|
|
1258
1303
|
options
|
|
1259
1304
|
);
|
|
1260
|
-
const handleCheckboxChange =
|
|
1305
|
+
const handleCheckboxChange = useCallback6(
|
|
1261
1306
|
(e) => {
|
|
1262
1307
|
if (!disabled && !readonly && onChange) {
|
|
1263
1308
|
onChange(e.currentTarget.checked);
|
|
@@ -1265,7 +1310,7 @@ function CheckboxWidget(props) {
|
|
|
1265
1310
|
},
|
|
1266
1311
|
[onChange, disabled, readonly]
|
|
1267
1312
|
);
|
|
1268
|
-
const handleBlur =
|
|
1313
|
+
const handleBlur = useCallback6(
|
|
1269
1314
|
({ target }) => {
|
|
1270
1315
|
if (onBlur) {
|
|
1271
1316
|
onBlur(id, target.checked);
|
|
@@ -1273,7 +1318,7 @@ function CheckboxWidget(props) {
|
|
|
1273
1318
|
},
|
|
1274
1319
|
[onBlur, id]
|
|
1275
1320
|
);
|
|
1276
|
-
const handleFocus =
|
|
1321
|
+
const handleFocus = useCallback6(
|
|
1277
1322
|
({ target }) => {
|
|
1278
1323
|
if (onFocus) {
|
|
1279
1324
|
onFocus(id, target.checked);
|
|
@@ -1282,8 +1327,8 @@ function CheckboxWidget(props) {
|
|
|
1282
1327
|
[onFocus, id]
|
|
1283
1328
|
);
|
|
1284
1329
|
const description = options.description || schema.description;
|
|
1285
|
-
return /* @__PURE__ */
|
|
1286
|
-
!hideLabel && !!description && /* @__PURE__ */
|
|
1330
|
+
return /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
1331
|
+
!hideLabel && !!description && /* @__PURE__ */ jsx26(
|
|
1287
1332
|
DescriptionFieldTemplate,
|
|
1288
1333
|
{
|
|
1289
1334
|
id: descriptionId2(id),
|
|
@@ -1293,11 +1338,11 @@ function CheckboxWidget(props) {
|
|
|
1293
1338
|
registry
|
|
1294
1339
|
}
|
|
1295
1340
|
),
|
|
1296
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ jsx26(
|
|
1297
1342
|
Checkbox2,
|
|
1298
1343
|
{
|
|
1299
1344
|
id,
|
|
1300
|
-
name,
|
|
1345
|
+
name: htmlName || name,
|
|
1301
1346
|
label: labelValue4(label || void 0, hideLabel, false),
|
|
1302
1347
|
disabled: disabled || readonly,
|
|
1303
1348
|
required,
|
|
@@ -1315,13 +1360,13 @@ function CheckboxWidget(props) {
|
|
|
1315
1360
|
}
|
|
1316
1361
|
|
|
1317
1362
|
// src/widgets/ColorWidget.tsx
|
|
1318
|
-
import { useCallback as
|
|
1363
|
+
import { useCallback as useCallback7 } from "react";
|
|
1319
1364
|
import {
|
|
1320
1365
|
labelValue as labelValue5,
|
|
1321
1366
|
ariaDescribedByIds as ariaDescribedByIds7
|
|
1322
1367
|
} from "@rjsf/utils";
|
|
1323
1368
|
import { ColorInput } from "@mantine/core";
|
|
1324
|
-
import { jsx as
|
|
1369
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1325
1370
|
function ColorWidget(props) {
|
|
1326
1371
|
const {
|
|
1327
1372
|
id,
|
|
@@ -1341,13 +1386,13 @@ function ColorWidget(props) {
|
|
|
1341
1386
|
onFocus
|
|
1342
1387
|
} = props;
|
|
1343
1388
|
const themeProps = cleanupOptions(options);
|
|
1344
|
-
const handleChange =
|
|
1389
|
+
const handleChange = useCallback7(
|
|
1345
1390
|
(nextValue) => {
|
|
1346
1391
|
onChange(nextValue);
|
|
1347
1392
|
},
|
|
1348
1393
|
[onChange]
|
|
1349
1394
|
);
|
|
1350
|
-
const handleBlur =
|
|
1395
|
+
const handleBlur = useCallback7(
|
|
1351
1396
|
({ target }) => {
|
|
1352
1397
|
if (onBlur) {
|
|
1353
1398
|
onBlur(id, target && target.value);
|
|
@@ -1355,7 +1400,7 @@ function ColorWidget(props) {
|
|
|
1355
1400
|
},
|
|
1356
1401
|
[onBlur, id]
|
|
1357
1402
|
);
|
|
1358
|
-
const handleFocus =
|
|
1403
|
+
const handleFocus = useCallback7(
|
|
1359
1404
|
({ target }) => {
|
|
1360
1405
|
if (onFocus) {
|
|
1361
1406
|
onFocus(id, target && target.value);
|
|
@@ -1363,7 +1408,7 @@ function ColorWidget(props) {
|
|
|
1363
1408
|
},
|
|
1364
1409
|
[onFocus, id]
|
|
1365
1410
|
);
|
|
1366
|
-
return /* @__PURE__ */
|
|
1411
|
+
return /* @__PURE__ */ jsx27(
|
|
1367
1412
|
ColorInput,
|
|
1368
1413
|
{
|
|
1369
1414
|
id,
|
|
@@ -1386,14 +1431,14 @@ function ColorWidget(props) {
|
|
|
1386
1431
|
}
|
|
1387
1432
|
|
|
1388
1433
|
// src/widgets/FileWidget.tsx
|
|
1389
|
-
import { useCallback as
|
|
1434
|
+
import { useCallback as useCallback8 } from "react";
|
|
1390
1435
|
import {
|
|
1391
1436
|
dataURItoBlob,
|
|
1392
1437
|
ariaDescribedByIds as ariaDescribedByIds8,
|
|
1393
1438
|
labelValue as labelValue6
|
|
1394
1439
|
} from "@rjsf/utils";
|
|
1395
1440
|
import { FileInput, Pill } from "@mantine/core";
|
|
1396
|
-
import { jsx as
|
|
1441
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1397
1442
|
function addNameToDataURL(dataURL, name) {
|
|
1398
1443
|
if (dataURL === null) {
|
|
1399
1444
|
return null;
|
|
@@ -1468,7 +1513,7 @@ function FileWidget(props) {
|
|
|
1468
1513
|
onChange
|
|
1469
1514
|
} = props;
|
|
1470
1515
|
const themeProps = cleanupOptions(options);
|
|
1471
|
-
const handleChange =
|
|
1516
|
+
const handleChange = useCallback8(
|
|
1472
1517
|
(files) => {
|
|
1473
1518
|
if (typeof files === "object") {
|
|
1474
1519
|
processFiles(multiple ? files : [files]).then((filesInfoEvent) => {
|
|
@@ -1484,7 +1529,7 @@ function FileWidget(props) {
|
|
|
1484
1529
|
},
|
|
1485
1530
|
[multiple, value, onChange]
|
|
1486
1531
|
);
|
|
1487
|
-
const handleRemoveFile =
|
|
1532
|
+
const handleRemoveFile = useCallback8(
|
|
1488
1533
|
(index) => {
|
|
1489
1534
|
if (multiple) {
|
|
1490
1535
|
const newValue = value.filter((_, i) => i !== index);
|
|
@@ -1495,17 +1540,17 @@ function FileWidget(props) {
|
|
|
1495
1540
|
},
|
|
1496
1541
|
[multiple, value, onChange]
|
|
1497
1542
|
);
|
|
1498
|
-
const ValueComponent =
|
|
1543
|
+
const ValueComponent = useCallback8(
|
|
1499
1544
|
(props2) => {
|
|
1500
1545
|
const filesInfo = props2.value ? extractFileInfo(Array.isArray(props2.value) ? props2.value : [props2.value]) : null;
|
|
1501
1546
|
if (Array.isArray(filesInfo) && filesInfo.length > 0) {
|
|
1502
|
-
return /* @__PURE__ */
|
|
1547
|
+
return /* @__PURE__ */ jsx28(Pill.Group, { children: filesInfo.map((file, index) => /* @__PURE__ */ jsx28(Pill, { withRemoveButton: true, onRemove: () => handleRemoveFile(index), children: file.name }, index)) });
|
|
1503
1548
|
}
|
|
1504
1549
|
return null;
|
|
1505
1550
|
},
|
|
1506
1551
|
[handleRemoveFile]
|
|
1507
1552
|
);
|
|
1508
|
-
return /* @__PURE__ */
|
|
1553
|
+
return /* @__PURE__ */ jsx28(
|
|
1509
1554
|
FileInput,
|
|
1510
1555
|
{
|
|
1511
1556
|
id,
|
|
@@ -1527,13 +1572,13 @@ function FileWidget(props) {
|
|
|
1527
1572
|
}
|
|
1528
1573
|
|
|
1529
1574
|
// src/widgets/PasswordWidget.tsx
|
|
1530
|
-
import { useCallback as
|
|
1575
|
+
import { useCallback as useCallback9 } from "react";
|
|
1531
1576
|
import {
|
|
1532
1577
|
ariaDescribedByIds as ariaDescribedByIds9,
|
|
1533
1578
|
labelValue as labelValue7
|
|
1534
1579
|
} from "@rjsf/utils";
|
|
1535
1580
|
import { PasswordInput } from "@mantine/core";
|
|
1536
|
-
import { jsx as
|
|
1581
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1537
1582
|
function PasswordWidget(props) {
|
|
1538
1583
|
const {
|
|
1539
1584
|
id,
|
|
@@ -1554,13 +1599,13 @@ function PasswordWidget(props) {
|
|
|
1554
1599
|
} = props;
|
|
1555
1600
|
const emptyValue = options.emptyValue || "";
|
|
1556
1601
|
const themeProps = cleanupOptions(options);
|
|
1557
|
-
const handleChange =
|
|
1602
|
+
const handleChange = useCallback9(
|
|
1558
1603
|
(e) => {
|
|
1559
1604
|
onChange(e.target.value === "" ? emptyValue : e.target.value);
|
|
1560
1605
|
},
|
|
1561
1606
|
[onChange, emptyValue]
|
|
1562
1607
|
);
|
|
1563
|
-
const handleBlur =
|
|
1608
|
+
const handleBlur = useCallback9(
|
|
1564
1609
|
({ target }) => {
|
|
1565
1610
|
if (onBlur) {
|
|
1566
1611
|
onBlur(id, target && target.value);
|
|
@@ -1568,7 +1613,7 @@ function PasswordWidget(props) {
|
|
|
1568
1613
|
},
|
|
1569
1614
|
[onBlur, id]
|
|
1570
1615
|
);
|
|
1571
|
-
const handleFocus =
|
|
1616
|
+
const handleFocus = useCallback9(
|
|
1572
1617
|
({ target }) => {
|
|
1573
1618
|
if (onFocus) {
|
|
1574
1619
|
onFocus(id, target && target.value);
|
|
@@ -1576,7 +1621,7 @@ function PasswordWidget(props) {
|
|
|
1576
1621
|
},
|
|
1577
1622
|
[onFocus, id]
|
|
1578
1623
|
);
|
|
1579
|
-
return /* @__PURE__ */
|
|
1624
|
+
return /* @__PURE__ */ jsx29(
|
|
1580
1625
|
PasswordInput,
|
|
1581
1626
|
{
|
|
1582
1627
|
id,
|
|
@@ -1598,7 +1643,7 @@ function PasswordWidget(props) {
|
|
|
1598
1643
|
}
|
|
1599
1644
|
|
|
1600
1645
|
// src/widgets/RadioWidget.tsx
|
|
1601
|
-
import { useCallback as
|
|
1646
|
+
import { useCallback as useCallback10 } from "react";
|
|
1602
1647
|
import {
|
|
1603
1648
|
ariaDescribedByIds as ariaDescribedByIds10,
|
|
1604
1649
|
enumOptionsIndexForValue as enumOptionsIndexForValue2,
|
|
@@ -1606,10 +1651,11 @@ import {
|
|
|
1606
1651
|
optionId as optionId2
|
|
1607
1652
|
} from "@rjsf/utils";
|
|
1608
1653
|
import { Radio, Flex as Flex5 } from "@mantine/core";
|
|
1609
|
-
import { jsx as
|
|
1654
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1610
1655
|
function RadioWidget(props) {
|
|
1611
1656
|
const {
|
|
1612
1657
|
id,
|
|
1658
|
+
htmlName,
|
|
1613
1659
|
value,
|
|
1614
1660
|
required,
|
|
1615
1661
|
disabled,
|
|
@@ -1625,7 +1671,7 @@ function RadioWidget(props) {
|
|
|
1625
1671
|
} = props;
|
|
1626
1672
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
1627
1673
|
const themeProps = cleanupOptions(options);
|
|
1628
|
-
const handleChange =
|
|
1674
|
+
const handleChange = useCallback10(
|
|
1629
1675
|
(nextValue) => {
|
|
1630
1676
|
if (!disabled && !readonly && onChange) {
|
|
1631
1677
|
onChange(enumOptionsValueForIndex2(nextValue, enumOptions, emptyValue));
|
|
@@ -1633,7 +1679,7 @@ function RadioWidget(props) {
|
|
|
1633
1679
|
},
|
|
1634
1680
|
[onChange, disabled, readonly, enumOptions, emptyValue]
|
|
1635
1681
|
);
|
|
1636
|
-
const handleBlur =
|
|
1682
|
+
const handleBlur = useCallback10(
|
|
1637
1683
|
({ target }) => {
|
|
1638
1684
|
if (onBlur) {
|
|
1639
1685
|
onBlur(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
|
|
@@ -1641,7 +1687,7 @@ function RadioWidget(props) {
|
|
|
1641
1687
|
},
|
|
1642
1688
|
[onBlur, id, enumOptions, emptyValue]
|
|
1643
1689
|
);
|
|
1644
|
-
const handleFocus =
|
|
1690
|
+
const handleFocus = useCallback10(
|
|
1645
1691
|
({ target }) => {
|
|
1646
1692
|
if (onFocus) {
|
|
1647
1693
|
onFocus(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
|
|
@@ -1650,11 +1696,11 @@ function RadioWidget(props) {
|
|
|
1650
1696
|
[onFocus, id, enumOptions, emptyValue]
|
|
1651
1697
|
);
|
|
1652
1698
|
const selected = enumOptionsIndexForValue2(value, enumOptions);
|
|
1653
|
-
return /* @__PURE__ */
|
|
1699
|
+
return /* @__PURE__ */ jsx30(
|
|
1654
1700
|
Radio.Group,
|
|
1655
1701
|
{
|
|
1656
1702
|
id,
|
|
1657
|
-
name: id,
|
|
1703
|
+
name: htmlName || id,
|
|
1658
1704
|
value: selected,
|
|
1659
1705
|
label: !hideLabel ? label : void 0,
|
|
1660
1706
|
onChange: handleChange,
|
|
@@ -1663,7 +1709,7 @@ function RadioWidget(props) {
|
|
|
1663
1709
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1664
1710
|
"aria-describedby": ariaDescribedByIds10(id),
|
|
1665
1711
|
...themeProps,
|
|
1666
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */
|
|
1712
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ jsx30(Flex5, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ jsx30(
|
|
1667
1713
|
Radio,
|
|
1668
1714
|
{
|
|
1669
1715
|
id: optionId2(id, i),
|
|
@@ -1681,14 +1727,14 @@ function RadioWidget(props) {
|
|
|
1681
1727
|
}
|
|
1682
1728
|
|
|
1683
1729
|
// src/widgets/RangeWidget.tsx
|
|
1684
|
-
import { useCallback as
|
|
1730
|
+
import { useCallback as useCallback11 } from "react";
|
|
1685
1731
|
import {
|
|
1686
1732
|
ariaDescribedByIds as ariaDescribedByIds11,
|
|
1687
1733
|
rangeSpec,
|
|
1688
1734
|
titleId as titleId5
|
|
1689
1735
|
} from "@rjsf/utils";
|
|
1690
1736
|
import { Slider, Input as Input3 } from "@mantine/core";
|
|
1691
|
-
import { Fragment as Fragment5, jsx as
|
|
1737
|
+
import { Fragment as Fragment5, jsx as jsx31, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1692
1738
|
function RangeWidget(props) {
|
|
1693
1739
|
const {
|
|
1694
1740
|
id,
|
|
@@ -1709,7 +1755,7 @@ function RangeWidget(props) {
|
|
|
1709
1755
|
} = props;
|
|
1710
1756
|
const themeProps = cleanupOptions(options);
|
|
1711
1757
|
const { min, max, step } = rangeSpec(schema);
|
|
1712
|
-
const handleChange =
|
|
1758
|
+
const handleChange = useCallback11(
|
|
1713
1759
|
(nextValue) => {
|
|
1714
1760
|
if (!disabled && !readonly && onChange) {
|
|
1715
1761
|
onChange(nextValue);
|
|
@@ -1717,20 +1763,20 @@ function RangeWidget(props) {
|
|
|
1717
1763
|
},
|
|
1718
1764
|
[onChange, disabled, readonly]
|
|
1719
1765
|
);
|
|
1720
|
-
const handleBlur =
|
|
1766
|
+
const handleBlur = useCallback11(() => {
|
|
1721
1767
|
if (onBlur) {
|
|
1722
1768
|
onBlur(id, value);
|
|
1723
1769
|
}
|
|
1724
1770
|
}, [onBlur, id, value]);
|
|
1725
|
-
const handleFocus =
|
|
1771
|
+
const handleFocus = useCallback11(() => {
|
|
1726
1772
|
if (onFocus) {
|
|
1727
1773
|
onFocus(id, value);
|
|
1728
1774
|
}
|
|
1729
1775
|
}, [onFocus, id, value]);
|
|
1730
|
-
return /* @__PURE__ */
|
|
1731
|
-
!hideLabel && !!label && /* @__PURE__ */
|
|
1732
|
-
options?.description && /* @__PURE__ */
|
|
1733
|
-
/* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
1777
|
+
!hideLabel && !!label && /* @__PURE__ */ jsx31(Input3.Label, { id: titleId5(id), required, children: label }),
|
|
1778
|
+
options?.description && /* @__PURE__ */ jsx31(Input3.Description, { children: options.description }),
|
|
1779
|
+
/* @__PURE__ */ jsx31(
|
|
1734
1780
|
Slider,
|
|
1735
1781
|
{
|
|
1736
1782
|
id,
|
|
@@ -1748,12 +1794,12 @@ function RangeWidget(props) {
|
|
|
1748
1794
|
"aria-describedby": ariaDescribedByIds11(id)
|
|
1749
1795
|
}
|
|
1750
1796
|
),
|
|
1751
|
-
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */
|
|
1797
|
+
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ jsx31(Input3.Error, { children: error }, `range-widget-input-errors-${index}`))
|
|
1752
1798
|
] });
|
|
1753
1799
|
}
|
|
1754
1800
|
|
|
1755
1801
|
// src/widgets/SelectWidget.tsx
|
|
1756
|
-
import { useCallback as
|
|
1802
|
+
import { useCallback as useCallback12, useMemo } from "react";
|
|
1757
1803
|
import {
|
|
1758
1804
|
ariaDescribedByIds as ariaDescribedByIds12,
|
|
1759
1805
|
enumOptionsIndexForValue as enumOptionsIndexForValue3,
|
|
@@ -1761,10 +1807,11 @@ import {
|
|
|
1761
1807
|
labelValue as labelValue8
|
|
1762
1808
|
} from "@rjsf/utils";
|
|
1763
1809
|
import { Select as Select2, MultiSelect } from "@mantine/core";
|
|
1764
|
-
import { jsx as
|
|
1810
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1765
1811
|
function SelectWidget(props) {
|
|
1766
1812
|
const {
|
|
1767
1813
|
id,
|
|
1814
|
+
htmlName,
|
|
1768
1815
|
value,
|
|
1769
1816
|
placeholder,
|
|
1770
1817
|
required,
|
|
@@ -1782,7 +1829,7 @@ function SelectWidget(props) {
|
|
|
1782
1829
|
} = props;
|
|
1783
1830
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
1784
1831
|
const themeProps = cleanupOptions(options);
|
|
1785
|
-
const handleChange =
|
|
1832
|
+
const handleChange = useCallback12(
|
|
1786
1833
|
(nextValue) => {
|
|
1787
1834
|
if (!disabled && !readonly && onChange) {
|
|
1788
1835
|
onChange(enumOptionsValueForIndex3(nextValue, enumOptions, emptyValue));
|
|
@@ -1790,7 +1837,7 @@ function SelectWidget(props) {
|
|
|
1790
1837
|
},
|
|
1791
1838
|
[onChange, disabled, readonly, enumOptions, emptyValue]
|
|
1792
1839
|
);
|
|
1793
|
-
const handleBlur =
|
|
1840
|
+
const handleBlur = useCallback12(
|
|
1794
1841
|
({ target }) => {
|
|
1795
1842
|
if (onBlur) {
|
|
1796
1843
|
onBlur(id, enumOptionsValueForIndex3(target && target.value, enumOptions, emptyValue));
|
|
@@ -1798,7 +1845,7 @@ function SelectWidget(props) {
|
|
|
1798
1845
|
},
|
|
1799
1846
|
[onBlur, id, enumOptions, emptyValue]
|
|
1800
1847
|
);
|
|
1801
|
-
const handleFocus =
|
|
1848
|
+
const handleFocus = useCallback12(
|
|
1802
1849
|
({ target }) => {
|
|
1803
1850
|
if (onFocus) {
|
|
1804
1851
|
onFocus(id, enumOptionsValueForIndex3(target && target.value, enumOptions, emptyValue));
|
|
@@ -1819,11 +1866,11 @@ function SelectWidget(props) {
|
|
|
1819
1866
|
return [];
|
|
1820
1867
|
}, [enumDisabled, enumOptions]);
|
|
1821
1868
|
const Component = multiple ? MultiSelect : Select2;
|
|
1822
|
-
return /* @__PURE__ */
|
|
1869
|
+
return /* @__PURE__ */ jsx32(
|
|
1823
1870
|
Component,
|
|
1824
1871
|
{
|
|
1825
1872
|
id,
|
|
1826
|
-
name: id,
|
|
1873
|
+
name: htmlName || id,
|
|
1827
1874
|
label: labelValue8(label || void 0, hideLabel, false),
|
|
1828
1875
|
data: selectOptions,
|
|
1829
1876
|
value: multiple ? selectedIndexes : selectedIndexes,
|
|
@@ -1844,17 +1891,18 @@ function SelectWidget(props) {
|
|
|
1844
1891
|
}
|
|
1845
1892
|
|
|
1846
1893
|
// src/widgets/TextareaWidget.tsx
|
|
1847
|
-
import { useCallback as
|
|
1894
|
+
import { useCallback as useCallback13 } from "react";
|
|
1848
1895
|
import {
|
|
1849
1896
|
labelValue as labelValue9,
|
|
1850
1897
|
ariaDescribedByIds as ariaDescribedByIds13
|
|
1851
1898
|
} from "@rjsf/utils";
|
|
1852
1899
|
import { Textarea } from "@mantine/core";
|
|
1853
|
-
import { jsx as
|
|
1900
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1854
1901
|
function TextareaWidget(props) {
|
|
1855
1902
|
const {
|
|
1856
1903
|
id,
|
|
1857
1904
|
name,
|
|
1905
|
+
htmlName,
|
|
1858
1906
|
value,
|
|
1859
1907
|
placeholder,
|
|
1860
1908
|
required,
|
|
@@ -1871,13 +1919,13 @@ function TextareaWidget(props) {
|
|
|
1871
1919
|
} = props;
|
|
1872
1920
|
const themeProps = cleanupOptions(options);
|
|
1873
1921
|
const emptyValue = options?.emptyValue ?? "";
|
|
1874
|
-
const handleChange =
|
|
1922
|
+
const handleChange = useCallback13(
|
|
1875
1923
|
(e) => {
|
|
1876
1924
|
onChange(e.target.value === "" ? emptyValue : e.target.value);
|
|
1877
1925
|
},
|
|
1878
1926
|
[onChange, emptyValue]
|
|
1879
1927
|
);
|
|
1880
|
-
const handleBlur =
|
|
1928
|
+
const handleBlur = useCallback13(
|
|
1881
1929
|
({ target }) => {
|
|
1882
1930
|
if (onBlur) {
|
|
1883
1931
|
onBlur(id, target && target.value);
|
|
@@ -1885,7 +1933,7 @@ function TextareaWidget(props) {
|
|
|
1885
1933
|
},
|
|
1886
1934
|
[onBlur, id]
|
|
1887
1935
|
);
|
|
1888
|
-
const handleFocus =
|
|
1936
|
+
const handleFocus = useCallback13(
|
|
1889
1937
|
({ target }) => {
|
|
1890
1938
|
if (onFocus) {
|
|
1891
1939
|
onFocus(id, target && target.value);
|
|
@@ -1893,11 +1941,11 @@ function TextareaWidget(props) {
|
|
|
1893
1941
|
},
|
|
1894
1942
|
[onFocus, id]
|
|
1895
1943
|
);
|
|
1896
|
-
return /* @__PURE__ */
|
|
1944
|
+
return /* @__PURE__ */ jsx33(
|
|
1897
1945
|
Textarea,
|
|
1898
1946
|
{
|
|
1899
1947
|
id,
|
|
1900
|
-
name,
|
|
1948
|
+
name: htmlName || name,
|
|
1901
1949
|
value: value || "",
|
|
1902
1950
|
placeholder: placeholder || void 0,
|
|
1903
1951
|
required,
|