@rjsf/mantine 6.0.0-beta.20 → 6.0.0-beta.21
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 +117 -65
- package/dist/index.cjs.map +4 -4
- package/dist/mantine.esm.js +119 -67
- package/dist/mantine.esm.js.map +4 -4
- package/dist/mantine.umd.js +56 -7
- package/lib/templates/ArrayFieldTemplate.js +4 -4
- package/lib/templates/ArrayFieldTemplate.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/index.js +2 -0
- package/lib/templates/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/templates/ArrayFieldTemplate.tsx +7 -6
- package/src/templates/ObjectFieldTemplate.tsx +4 -1
- package/src/templates/OptionalDataControlsTemplate.tsx +44 -0
- package/src/templates/TitleField.tsx +12 -3
- package/src/templates/index.ts +2 -0
package/dist/index.cjs
CHANGED
|
@@ -74,6 +74,7 @@ function ArrayFieldTemplate(props) {
|
|
|
74
74
|
disabled,
|
|
75
75
|
fieldPathId,
|
|
76
76
|
items,
|
|
77
|
+
optionalDataControl,
|
|
77
78
|
onAddClick,
|
|
78
79
|
readonly,
|
|
79
80
|
required,
|
|
@@ -98,6 +99,7 @@ function ArrayFieldTemplate(props) {
|
|
|
98
99
|
registry,
|
|
99
100
|
uiOptions
|
|
100
101
|
);
|
|
102
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
101
103
|
const {
|
|
102
104
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
103
105
|
} = registry.templates;
|
|
@@ -109,7 +111,8 @@ function ArrayFieldTemplate(props) {
|
|
|
109
111
|
title: uiOptions.title || title,
|
|
110
112
|
schema,
|
|
111
113
|
uiSchema,
|
|
112
|
-
registry
|
|
114
|
+
registry,
|
|
115
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
113
116
|
}
|
|
114
117
|
);
|
|
115
118
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Fieldset, { legend, className, id: fieldPathId.$id, children: [
|
|
@@ -123,7 +126,10 @@ function ArrayFieldTemplate(props) {
|
|
|
123
126
|
registry
|
|
124
127
|
}
|
|
125
128
|
),
|
|
126
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Box, { className: "row rjsf-array-item-list", children: [
|
|
130
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
131
|
+
items.map(({ key, ...itemProps }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ArrayFieldItemTemplate2, { ...itemProps }, key))
|
|
132
|
+
] }),
|
|
127
133
|
canAdd && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Group, { justify: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
128
134
|
AddButton2,
|
|
129
135
|
{
|
|
@@ -673,6 +679,7 @@ function ObjectFieldTemplate(props) {
|
|
|
673
679
|
description,
|
|
674
680
|
disabled,
|
|
675
681
|
properties,
|
|
682
|
+
optionalDataControl,
|
|
676
683
|
onAddClick,
|
|
677
684
|
readonly,
|
|
678
685
|
required,
|
|
@@ -689,6 +696,7 @@ function ObjectFieldTemplate(props) {
|
|
|
689
696
|
registry,
|
|
690
697
|
uiOptions
|
|
691
698
|
);
|
|
699
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
692
700
|
const {
|
|
693
701
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
694
702
|
} = registry.templates;
|
|
@@ -704,7 +712,8 @@ function ObjectFieldTemplate(props) {
|
|
|
704
712
|
required,
|
|
705
713
|
schema,
|
|
706
714
|
uiSchema,
|
|
707
|
-
registry
|
|
715
|
+
registry,
|
|
716
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
708
717
|
}
|
|
709
718
|
),
|
|
710
719
|
description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
@@ -717,14 +726,17 @@ function ObjectFieldTemplate(props) {
|
|
|
717
726
|
registry
|
|
718
727
|
}
|
|
719
728
|
),
|
|
720
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.
|
|
729
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
721
730
|
import_core14.SimpleGrid,
|
|
722
731
|
{
|
|
723
732
|
cols: gridCols,
|
|
724
733
|
spacing: gridSpacing,
|
|
725
734
|
verticalSpacing: gridVerticalSpacing,
|
|
726
735
|
mb: "sm",
|
|
727
|
-
children:
|
|
736
|
+
children: [
|
|
737
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
738
|
+
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Box, { children: element.content }, element.name))
|
|
739
|
+
]
|
|
728
740
|
}
|
|
729
741
|
),
|
|
730
742
|
(0, import_utils13.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Group, { mt: "xs", justify: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
@@ -741,19 +753,58 @@ function ObjectFieldTemplate(props) {
|
|
|
741
753
|
] });
|
|
742
754
|
}
|
|
743
755
|
|
|
756
|
+
// src/templates/OptionalDataControlsTemplate.tsx
|
|
757
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
758
|
+
function OptionalDataControlsTemplate(props) {
|
|
759
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
760
|
+
if (onAddClick) {
|
|
761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
762
|
+
AddButton,
|
|
763
|
+
{
|
|
764
|
+
id,
|
|
765
|
+
registry,
|
|
766
|
+
icon: "plus",
|
|
767
|
+
className: "rjsf-add-optional-data",
|
|
768
|
+
onClick: onAddClick,
|
|
769
|
+
title: label
|
|
770
|
+
}
|
|
771
|
+
);
|
|
772
|
+
} else if (onRemoveClick) {
|
|
773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
774
|
+
RemoveButton,
|
|
775
|
+
{
|
|
776
|
+
id,
|
|
777
|
+
registry,
|
|
778
|
+
icon: "remove",
|
|
779
|
+
className: "rjsf-remove-optional-data",
|
|
780
|
+
onClick: onRemoveClick,
|
|
781
|
+
title: label
|
|
782
|
+
}
|
|
783
|
+
);
|
|
784
|
+
}
|
|
785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("em", { id, children: label });
|
|
786
|
+
}
|
|
787
|
+
|
|
744
788
|
// src/templates/TitleField.tsx
|
|
745
789
|
var import_core15 = require("@mantine/core");
|
|
746
|
-
var
|
|
790
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
747
791
|
function TitleField(props) {
|
|
748
|
-
const { id, title } = props;
|
|
749
|
-
|
|
792
|
+
const { id, title, optionalDataControl } = props;
|
|
793
|
+
let heading = title ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core15.Title, { id, order: 3, fw: "normal", children: title }) : null;
|
|
794
|
+
if (optionalDataControl) {
|
|
795
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core15.Grid, { children: [
|
|
796
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core15.Grid.Col, { span: "auto", children: heading }),
|
|
797
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core15.Grid.Col, { span: "content", children: optionalDataControl })
|
|
798
|
+
] });
|
|
799
|
+
}
|
|
800
|
+
return heading;
|
|
750
801
|
}
|
|
751
802
|
|
|
752
803
|
// src/templates/WrapIfAdditionalTemplate.tsx
|
|
753
804
|
var import_react2 = require("react");
|
|
754
805
|
var import_utils14 = require("@rjsf/utils");
|
|
755
806
|
var import_core16 = require("@mantine/core");
|
|
756
|
-
var
|
|
807
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
757
808
|
function WrapIfAdditionalTemplate(props) {
|
|
758
809
|
const {
|
|
759
810
|
id,
|
|
@@ -779,16 +830,16 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
779
830
|
[onKeyChange]
|
|
780
831
|
);
|
|
781
832
|
if (!additional) {
|
|
782
|
-
return /* @__PURE__ */ (0,
|
|
833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: classNames, style, children });
|
|
783
834
|
}
|
|
784
835
|
const uiOptions = uiSchema ? uiSchema[import_utils14.UI_OPTIONS_KEY] : {};
|
|
785
836
|
const buttonUiOptions = {
|
|
786
837
|
...uiSchema,
|
|
787
838
|
[import_utils14.UI_OPTIONS_KEY]: { ...uiOptions, block: true }
|
|
788
839
|
};
|
|
789
|
-
return /* @__PURE__ */ (0,
|
|
790
|
-
/* @__PURE__ */ (0,
|
|
791
|
-
/* @__PURE__ */ (0,
|
|
840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: classNames, style, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core16.Flex, { gap: "xs", align: "end", justify: "center", children: [
|
|
841
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core16.Grid, { w: "100%", align: "center", children: [
|
|
842
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core16.Grid.Col, { span: 6, className: "form-additional", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
792
843
|
import_core16.TextInput,
|
|
793
844
|
{
|
|
794
845
|
className: "form-group",
|
|
@@ -801,9 +852,9 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
801
852
|
onBlur: !readonly ? handleBlur : void 0
|
|
802
853
|
}
|
|
803
854
|
) }) }),
|
|
804
|
-
/* @__PURE__ */ (0,
|
|
855
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core16.Grid.Col, { span: 6, className: "form-additional", children })
|
|
805
856
|
] }),
|
|
806
|
-
/* @__PURE__ */ (0,
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
807
858
|
RemoveButton2,
|
|
808
859
|
{
|
|
809
860
|
id: (0, import_utils14.buttonId)(id, "remove"),
|
|
@@ -820,9 +871,9 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
820
871
|
|
|
821
872
|
// src/templates/MultiSchemaFieldTemplate.tsx
|
|
822
873
|
var import_core17 = require("@mantine/core");
|
|
823
|
-
var
|
|
874
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
824
875
|
function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
|
|
825
|
-
return /* @__PURE__ */ (0,
|
|
876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core17.Stack, { style: { marginBottom: "1rem" }, children: [
|
|
826
877
|
selector,
|
|
827
878
|
optionSchemaField
|
|
828
879
|
] });
|
|
@@ -843,6 +894,7 @@ function generateTemplates() {
|
|
|
843
894
|
FieldHelpTemplate,
|
|
844
895
|
GridTemplate,
|
|
845
896
|
ObjectFieldTemplate,
|
|
897
|
+
OptionalDataControlsTemplate,
|
|
846
898
|
TitleFieldTemplate: TitleField,
|
|
847
899
|
WrapIfAdditionalTemplate,
|
|
848
900
|
MultiSchemaFieldTemplate
|
|
@@ -858,7 +910,7 @@ var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat")
|
|
|
858
910
|
var import_react3 = require("react");
|
|
859
911
|
var import_utils15 = require("@rjsf/utils");
|
|
860
912
|
var import_core18 = require("@mantine/core");
|
|
861
|
-
var
|
|
913
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
862
914
|
function readyForChange(state) {
|
|
863
915
|
return Object.values(state).every((value) => value !== -1);
|
|
864
916
|
}
|
|
@@ -907,9 +959,9 @@ function AltDateWidget(props) {
|
|
|
907
959
|
onChange("");
|
|
908
960
|
}
|
|
909
961
|
}, [disabled, readonly, onChange]);
|
|
910
|
-
return /* @__PURE__ */ (0,
|
|
911
|
-
!hideLabel && !!label && /* @__PURE__ */ (0,
|
|
912
|
-
/* @__PURE__ */ (0,
|
|
962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
963
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Input.Label, { id: (0, import_utils15.titleId)(id), required, children: label }),
|
|
964
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core18.Flex, { gap: "xs", align: "center", wrap: "nowrap", children: [
|
|
913
965
|
(0, import_utils15.getDateElementProps)(
|
|
914
966
|
state,
|
|
915
967
|
showTime,
|
|
@@ -917,7 +969,7 @@ function AltDateWidget(props) {
|
|
|
917
969
|
options.format
|
|
918
970
|
).map((elemProps, i) => {
|
|
919
971
|
const elemId = id + "_" + elemProps.type;
|
|
920
|
-
return /* @__PURE__ */ (0,
|
|
972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
921
973
|
import_core18.Select,
|
|
922
974
|
{
|
|
923
975
|
id: elemId,
|
|
@@ -934,12 +986,12 @@ function AltDateWidget(props) {
|
|
|
934
986
|
}
|
|
935
987
|
) }, i);
|
|
936
988
|
}),
|
|
937
|
-
/* @__PURE__ */ (0,
|
|
938
|
-
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0,
|
|
939
|
-
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0,
|
|
989
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core18.Group, { wrap: "nowrap", gap: 3, children: [
|
|
990
|
+
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Button, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(import_utils15.TranslatableString.NowLabel) }),
|
|
991
|
+
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Button, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(import_utils15.TranslatableString.ClearLabel) })
|
|
940
992
|
] })
|
|
941
993
|
] }),
|
|
942
|
-
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ (0,
|
|
994
|
+
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core18.Input.Error, { children: error }, `alt-date-widget-input-errors-${index}`))
|
|
943
995
|
] });
|
|
944
996
|
}
|
|
945
997
|
AltDateWidget.defaultProps = {
|
|
@@ -947,10 +999,10 @@ AltDateWidget.defaultProps = {
|
|
|
947
999
|
};
|
|
948
1000
|
|
|
949
1001
|
// src/widgets/DateTime/AltDateTimeWidget.tsx
|
|
950
|
-
var
|
|
1002
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
951
1003
|
function AltDateTimeWidget(props) {
|
|
952
1004
|
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
953
|
-
return /* @__PURE__ */ (0,
|
|
1005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AltDateWidget2, { showTime: true, ...props });
|
|
954
1006
|
}
|
|
955
1007
|
AltDateTimeWidget.defaultProps = {
|
|
956
1008
|
...AltDateWidget?.defaultProps,
|
|
@@ -962,7 +1014,7 @@ var import_react4 = require("react");
|
|
|
962
1014
|
var import_utils16 = require("@rjsf/utils");
|
|
963
1015
|
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
964
1016
|
var import_dates = require("@mantine/dates");
|
|
965
|
-
var
|
|
1017
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
966
1018
|
var dateParser = (input, format) => {
|
|
967
1019
|
if (!input) {
|
|
968
1020
|
return null;
|
|
@@ -1012,7 +1064,7 @@ function DateTimeInput(props) {
|
|
|
1012
1064
|
onFocus(id, value);
|
|
1013
1065
|
}
|
|
1014
1066
|
}, [onFocus, id, value]);
|
|
1015
|
-
return /* @__PURE__ */ (0,
|
|
1067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1016
1068
|
import_dates.DateInput,
|
|
1017
1069
|
{
|
|
1018
1070
|
id,
|
|
@@ -1038,10 +1090,10 @@ function DateTimeInput(props) {
|
|
|
1038
1090
|
}
|
|
1039
1091
|
|
|
1040
1092
|
// src/widgets/DateTime/DateWidget.tsx
|
|
1041
|
-
var
|
|
1093
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1042
1094
|
function DateWidget(props) {
|
|
1043
1095
|
const { valueFormat = "YYYY-MM-DD", displayFormat, ...otherOptions } = props.options;
|
|
1044
|
-
return /* @__PURE__ */ (0,
|
|
1096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1045
1097
|
DateTimeInput,
|
|
1046
1098
|
{
|
|
1047
1099
|
...props,
|
|
@@ -1053,10 +1105,10 @@ function DateWidget(props) {
|
|
|
1053
1105
|
}
|
|
1054
1106
|
|
|
1055
1107
|
// src/widgets/DateTime/DateTimeWidget.tsx
|
|
1056
|
-
var
|
|
1108
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1057
1109
|
function DateTimeWidget(props) {
|
|
1058
1110
|
const { valueFormat = "YYYY-MM-DD HH:mm:ss", displayFormat, ...otherOptions } = props.options;
|
|
1059
|
-
return /* @__PURE__ */ (0,
|
|
1111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1060
1112
|
DateTimeInput,
|
|
1061
1113
|
{
|
|
1062
1114
|
...props,
|
|
@@ -1071,7 +1123,7 @@ function DateTimeWidget(props) {
|
|
|
1071
1123
|
var import_react5 = require("react");
|
|
1072
1124
|
var import_utils17 = require("@rjsf/utils");
|
|
1073
1125
|
var import_dates2 = require("@mantine/dates");
|
|
1074
|
-
var
|
|
1126
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1075
1127
|
function TimeWidget(props) {
|
|
1076
1128
|
const {
|
|
1077
1129
|
id,
|
|
@@ -1113,7 +1165,7 @@ function TimeWidget(props) {
|
|
|
1113
1165
|
},
|
|
1114
1166
|
[onFocus, id]
|
|
1115
1167
|
);
|
|
1116
|
-
return /* @__PURE__ */ (0,
|
|
1168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1117
1169
|
import_dates2.TimeInput,
|
|
1118
1170
|
{
|
|
1119
1171
|
id,
|
|
@@ -1139,7 +1191,7 @@ function TimeWidget(props) {
|
|
|
1139
1191
|
var import_react6 = require("react");
|
|
1140
1192
|
var import_utils18 = require("@rjsf/utils");
|
|
1141
1193
|
var import_core19 = require("@mantine/core");
|
|
1142
|
-
var
|
|
1194
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1143
1195
|
function CheckboxesWidget(props) {
|
|
1144
1196
|
const {
|
|
1145
1197
|
id,
|
|
@@ -1183,9 +1235,9 @@ function CheckboxesWidget(props) {
|
|
|
1183
1235
|
[onFocus, id, enumOptions, emptyValue]
|
|
1184
1236
|
);
|
|
1185
1237
|
const selectedIndexes = (0, import_utils18.enumOptionsIndexForValue)(value, enumOptions, true);
|
|
1186
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0,
|
|
1187
|
-
!hideLabel && !!label && /* @__PURE__ */ (0,
|
|
1188
|
-
/* @__PURE__ */ (0,
|
|
1238
|
+
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
1239
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core19.Input.Label, { id: (0, import_utils18.titleId)(id), required, children: label }),
|
|
1240
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1189
1241
|
import_core19.Checkbox.Group,
|
|
1190
1242
|
{
|
|
1191
1243
|
id,
|
|
@@ -1196,7 +1248,7 @@ function CheckboxesWidget(props) {
|
|
|
1196
1248
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1197
1249
|
"aria-describedby": (0, import_utils18.ariaDescribedByIds)(id),
|
|
1198
1250
|
...themeProps,
|
|
1199
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0,
|
|
1251
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core19.Flex, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1200
1252
|
import_core19.Checkbox,
|
|
1201
1253
|
{
|
|
1202
1254
|
id: (0, import_utils18.optionId)(id, i),
|
|
@@ -1219,7 +1271,7 @@ function CheckboxesWidget(props) {
|
|
|
1219
1271
|
var import_react7 = require("react");
|
|
1220
1272
|
var import_utils20 = require("@rjsf/utils");
|
|
1221
1273
|
var import_core20 = require("@mantine/core");
|
|
1222
|
-
var
|
|
1274
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1223
1275
|
function CheckboxWidget(props) {
|
|
1224
1276
|
const {
|
|
1225
1277
|
id,
|
|
@@ -1271,8 +1323,8 @@ function CheckboxWidget(props) {
|
|
|
1271
1323
|
[onFocus, id]
|
|
1272
1324
|
);
|
|
1273
1325
|
const description = options.description || schema.description;
|
|
1274
|
-
return /* @__PURE__ */ (0,
|
|
1275
|
-
!hideLabel && !!description && /* @__PURE__ */ (0,
|
|
1326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
1327
|
+
!hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1276
1328
|
DescriptionFieldTemplate,
|
|
1277
1329
|
{
|
|
1278
1330
|
id: (0, import_utils20.descriptionId)(id),
|
|
@@ -1282,7 +1334,7 @@ function CheckboxWidget(props) {
|
|
|
1282
1334
|
registry
|
|
1283
1335
|
}
|
|
1284
1336
|
),
|
|
1285
|
-
/* @__PURE__ */ (0,
|
|
1337
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1286
1338
|
import_core20.Checkbox,
|
|
1287
1339
|
{
|
|
1288
1340
|
id,
|
|
@@ -1307,7 +1359,7 @@ function CheckboxWidget(props) {
|
|
|
1307
1359
|
var import_react8 = require("react");
|
|
1308
1360
|
var import_utils22 = require("@rjsf/utils");
|
|
1309
1361
|
var import_core21 = require("@mantine/core");
|
|
1310
|
-
var
|
|
1362
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1311
1363
|
function ColorWidget(props) {
|
|
1312
1364
|
const {
|
|
1313
1365
|
id,
|
|
@@ -1349,7 +1401,7 @@ function ColorWidget(props) {
|
|
|
1349
1401
|
},
|
|
1350
1402
|
[onFocus, id]
|
|
1351
1403
|
);
|
|
1352
|
-
return /* @__PURE__ */ (0,
|
|
1404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1353
1405
|
import_core21.ColorInput,
|
|
1354
1406
|
{
|
|
1355
1407
|
id,
|
|
@@ -1375,7 +1427,7 @@ function ColorWidget(props) {
|
|
|
1375
1427
|
var import_react9 = require("react");
|
|
1376
1428
|
var import_utils24 = require("@rjsf/utils");
|
|
1377
1429
|
var import_core22 = require("@mantine/core");
|
|
1378
|
-
var
|
|
1430
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1379
1431
|
function addNameToDataURL(dataURL, name) {
|
|
1380
1432
|
if (dataURL === null) {
|
|
1381
1433
|
return null;
|
|
@@ -1481,13 +1533,13 @@ function FileWidget(props) {
|
|
|
1481
1533
|
(props2) => {
|
|
1482
1534
|
const filesInfo = props2.value ? extractFileInfo(Array.isArray(props2.value) ? props2.value : [props2.value]) : null;
|
|
1483
1535
|
if (Array.isArray(filesInfo) && filesInfo.length > 0) {
|
|
1484
|
-
return /* @__PURE__ */ (0,
|
|
1536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_core22.Pill.Group, { children: filesInfo.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_core22.Pill, { withRemoveButton: true, onRemove: () => handleRemoveFile(index), children: file.name }, index)) });
|
|
1485
1537
|
}
|
|
1486
1538
|
return null;
|
|
1487
1539
|
},
|
|
1488
1540
|
[handleRemoveFile]
|
|
1489
1541
|
);
|
|
1490
|
-
return /* @__PURE__ */ (0,
|
|
1542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1491
1543
|
import_core22.FileInput,
|
|
1492
1544
|
{
|
|
1493
1545
|
id,
|
|
@@ -1512,7 +1564,7 @@ function FileWidget(props) {
|
|
|
1512
1564
|
var import_react10 = require("react");
|
|
1513
1565
|
var import_utils26 = require("@rjsf/utils");
|
|
1514
1566
|
var import_core23 = require("@mantine/core");
|
|
1515
|
-
var
|
|
1567
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1516
1568
|
function PasswordWidget(props) {
|
|
1517
1569
|
const {
|
|
1518
1570
|
id,
|
|
@@ -1555,7 +1607,7 @@ function PasswordWidget(props) {
|
|
|
1555
1607
|
},
|
|
1556
1608
|
[onFocus, id]
|
|
1557
1609
|
);
|
|
1558
|
-
return /* @__PURE__ */ (0,
|
|
1610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1559
1611
|
import_core23.PasswordInput,
|
|
1560
1612
|
{
|
|
1561
1613
|
id,
|
|
@@ -1580,7 +1632,7 @@ function PasswordWidget(props) {
|
|
|
1580
1632
|
var import_react11 = require("react");
|
|
1581
1633
|
var import_utils28 = require("@rjsf/utils");
|
|
1582
1634
|
var import_core24 = require("@mantine/core");
|
|
1583
|
-
var
|
|
1635
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1584
1636
|
function RadioWidget(props) {
|
|
1585
1637
|
const {
|
|
1586
1638
|
id,
|
|
@@ -1624,7 +1676,7 @@ function RadioWidget(props) {
|
|
|
1624
1676
|
[onFocus, id, enumOptions, emptyValue]
|
|
1625
1677
|
);
|
|
1626
1678
|
const selected = (0, import_utils28.enumOptionsIndexForValue)(value, enumOptions);
|
|
1627
|
-
return /* @__PURE__ */ (0,
|
|
1679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1628
1680
|
import_core24.Radio.Group,
|
|
1629
1681
|
{
|
|
1630
1682
|
id,
|
|
@@ -1637,7 +1689,7 @@ function RadioWidget(props) {
|
|
|
1637
1689
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1638
1690
|
"aria-describedby": (0, import_utils28.ariaDescribedByIds)(id),
|
|
1639
1691
|
...themeProps,
|
|
1640
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0,
|
|
1692
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core24.Flex, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1641
1693
|
import_core24.Radio,
|
|
1642
1694
|
{
|
|
1643
1695
|
id: (0, import_utils28.optionId)(id, i),
|
|
@@ -1658,7 +1710,7 @@ function RadioWidget(props) {
|
|
|
1658
1710
|
var import_react12 = require("react");
|
|
1659
1711
|
var import_utils30 = require("@rjsf/utils");
|
|
1660
1712
|
var import_core25 = require("@mantine/core");
|
|
1661
|
-
var
|
|
1713
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1662
1714
|
function RangeWidget(props) {
|
|
1663
1715
|
const {
|
|
1664
1716
|
id,
|
|
@@ -1697,10 +1749,10 @@ function RangeWidget(props) {
|
|
|
1697
1749
|
onFocus(id, value);
|
|
1698
1750
|
}
|
|
1699
1751
|
}, [onFocus, id, value]);
|
|
1700
|
-
return /* @__PURE__ */ (0,
|
|
1701
|
-
!hideLabel && !!label && /* @__PURE__ */ (0,
|
|
1702
|
-
options?.description && /* @__PURE__ */ (0,
|
|
1703
|
-
/* @__PURE__ */ (0,
|
|
1752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
1753
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core25.Input.Label, { id: (0, import_utils30.titleId)(id), required, children: label }),
|
|
1754
|
+
options?.description && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core25.Input.Description, { children: options.description }),
|
|
1755
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1704
1756
|
import_core25.Slider,
|
|
1705
1757
|
{
|
|
1706
1758
|
id,
|
|
@@ -1718,7 +1770,7 @@ function RangeWidget(props) {
|
|
|
1718
1770
|
"aria-describedby": (0, import_utils30.ariaDescribedByIds)(id)
|
|
1719
1771
|
}
|
|
1720
1772
|
),
|
|
1721
|
-
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ (0,
|
|
1773
|
+
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core25.Input.Error, { children: error }, `range-widget-input-errors-${index}`))
|
|
1722
1774
|
] });
|
|
1723
1775
|
}
|
|
1724
1776
|
|
|
@@ -1726,7 +1778,7 @@ function RangeWidget(props) {
|
|
|
1726
1778
|
var import_react13 = require("react");
|
|
1727
1779
|
var import_utils32 = require("@rjsf/utils");
|
|
1728
1780
|
var import_core26 = require("@mantine/core");
|
|
1729
|
-
var
|
|
1781
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1730
1782
|
function SelectWidget(props) {
|
|
1731
1783
|
const {
|
|
1732
1784
|
id,
|
|
@@ -1784,7 +1836,7 @@ function SelectWidget(props) {
|
|
|
1784
1836
|
return [];
|
|
1785
1837
|
}, [enumDisabled, enumOptions]);
|
|
1786
1838
|
const Component = multiple ? import_core26.MultiSelect : import_core26.Select;
|
|
1787
|
-
return /* @__PURE__ */ (0,
|
|
1839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1788
1840
|
Component,
|
|
1789
1841
|
{
|
|
1790
1842
|
id,
|
|
@@ -1812,7 +1864,7 @@ function SelectWidget(props) {
|
|
|
1812
1864
|
var import_react14 = require("react");
|
|
1813
1865
|
var import_utils34 = require("@rjsf/utils");
|
|
1814
1866
|
var import_core27 = require("@mantine/core");
|
|
1815
|
-
var
|
|
1867
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1816
1868
|
function TextareaWidget(props) {
|
|
1817
1869
|
const {
|
|
1818
1870
|
id,
|
|
@@ -1855,7 +1907,7 @@ function TextareaWidget(props) {
|
|
|
1855
1907
|
},
|
|
1856
1908
|
[onFocus, id]
|
|
1857
1909
|
);
|
|
1858
|
-
return /* @__PURE__ */ (0,
|
|
1910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1859
1911
|
import_core27.Textarea,
|
|
1860
1912
|
{
|
|
1861
1913
|
id,
|