@rjsf/mantine 6.0.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +131 -124
- package/dist/index.cjs.map +2 -2
- package/dist/mantine.esm.js +84 -77
- package/dist/mantine.esm.js.map +3 -3
- package/dist/mantine.umd.js +41 -35
- package/lib/templates/ArrayFieldTitleTemplate.js +8 -4
- package/lib/templates/ArrayFieldTitleTemplate.js.map +1 -1
- package/lib/templates/BaseInputTemplate.js +15 -1
- package/lib/templates/BaseInputTemplate.js.map +1 -1
- package/lib/templates/FieldHelpTemplate.js +3 -3
- package/lib/templates/FieldHelpTemplate.js.map +1 -1
- package/lib/templates/FieldTemplate.js +1 -1
- package/lib/templates/FieldTemplate.js.map +1 -1
- package/lib/templates/WrapIfAdditionalTemplate.js +2 -2
- package/lib/templates/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils.js +1 -0
- package/lib/utils.js.map +1 -1
- package/lib/widgets/CheckboxWidget.js +1 -3
- package/lib/widgets/CheckboxWidget.js.map +1 -1
- package/package.json +1 -1
- package/src/templates/ArrayFieldTitleTemplate.tsx +13 -4
- package/src/templates/BaseInputTemplate.tsx +19 -22
- package/src/templates/FieldHelpTemplate.tsx +4 -5
- package/src/templates/FieldTemplate.tsx +2 -0
- package/src/templates/WrapIfAdditionalTemplate.tsx +24 -21
- package/src/utils.ts +1 -0
- package/src/widgets/CheckboxWidget.tsx +0 -5
package/dist/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@ __export(index_exports, {
|
|
|
43
43
|
module.exports = __toCommonJS(index_exports);
|
|
44
44
|
|
|
45
45
|
// src/Form/index.ts
|
|
46
|
-
var
|
|
46
|
+
var import_core29 = require("@rjsf/core");
|
|
47
47
|
|
|
48
48
|
// src/templates/ArrayFieldItemTemplate.tsx
|
|
49
49
|
var import_utils = require("@rjsf/utils");
|
|
@@ -145,13 +145,20 @@ var import_utils3 = require("@rjsf/utils");
|
|
|
145
145
|
var import_core3 = require("@mantine/core");
|
|
146
146
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
147
147
|
function ArrayFieldTitleTemplate(props) {
|
|
148
|
-
const { fieldPathId, title, uiSchema, registry } = props;
|
|
148
|
+
const { fieldPathId, title, uiSchema, registry, optionalDataControl } = props;
|
|
149
149
|
const options = (0, import_utils3.getUiOptions)(uiSchema, registry.globalUiOptions);
|
|
150
150
|
const { label: displayLabel = true } = options;
|
|
151
151
|
if (!title || !displayLabel) {
|
|
152
152
|
return null;
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
let heading = title ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Title, { id: (0, import_utils3.titleId)(fieldPathId), order: 4, fw: "normal", children: title }) : null;
|
|
155
|
+
if (optionalDataControl) {
|
|
156
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core3.Grid, { children: [
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Grid.Col, { span: "auto", children: heading }),
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Grid.Col, { span: "content", children: optionalDataControl })
|
|
159
|
+
] });
|
|
160
|
+
}
|
|
161
|
+
return heading;
|
|
155
162
|
}
|
|
156
163
|
|
|
157
164
|
// src/templates/BaseInputTemplate.tsx
|
|
@@ -164,6 +171,7 @@ var uiOptionsKeys = [
|
|
|
164
171
|
"emptyValue",
|
|
165
172
|
"classNames",
|
|
166
173
|
"title",
|
|
174
|
+
"label",
|
|
167
175
|
"help",
|
|
168
176
|
"autocomplete",
|
|
169
177
|
"disabled",
|
|
@@ -220,6 +228,7 @@ function BaseInputTemplate(props) {
|
|
|
220
228
|
children
|
|
221
229
|
} = props;
|
|
222
230
|
const inputProps = (0, import_utils4.getInputProps)(schema, type, options, false);
|
|
231
|
+
const description = hideLabel ? void 0 : options.description || schema.description;
|
|
223
232
|
const themeProps = cleanupOptions(options);
|
|
224
233
|
const handleNumberChange = (0, import_react.useCallback)((value2) => onChange(value2), [onChange]);
|
|
225
234
|
const handleChange = (0, import_react.useCallback)(
|
|
@@ -242,45 +251,40 @@ function BaseInputTemplate(props) {
|
|
|
242
251
|
},
|
|
243
252
|
[onFocus, id]
|
|
244
253
|
);
|
|
254
|
+
const componentProps = {
|
|
255
|
+
id,
|
|
256
|
+
name: htmlName || id,
|
|
257
|
+
label: (0, import_utils4.labelValue)(label || void 0, hideLabel, false),
|
|
258
|
+
required,
|
|
259
|
+
autoFocus: autofocus,
|
|
260
|
+
disabled: disabled || readonly,
|
|
261
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
262
|
+
onFocus: !readonly ? handleFocus : void 0,
|
|
263
|
+
placeholder,
|
|
264
|
+
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
265
|
+
list: schema.examples ? (0, import_utils4.examplesId)(id) : void 0
|
|
266
|
+
};
|
|
245
267
|
const input = inputProps.type === "number" || inputProps.type === "integer" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
246
268
|
import_core4.NumberInput,
|
|
247
269
|
{
|
|
248
|
-
id,
|
|
249
|
-
name: htmlName || id,
|
|
250
|
-
label: (0, import_utils4.labelValue)(label || void 0, hideLabel, false),
|
|
251
|
-
required,
|
|
252
|
-
autoFocus: autofocus,
|
|
253
|
-
disabled: disabled || readonly,
|
|
254
|
-
onBlur: !readonly ? handleBlur : void 0,
|
|
255
270
|
onChange: !readonly ? handleNumberChange : void 0,
|
|
256
|
-
|
|
257
|
-
placeholder,
|
|
258
|
-
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
259
|
-
list: schema.examples ? (0, import_utils4.examplesId)(id) : void 0,
|
|
271
|
+
...componentProps,
|
|
260
272
|
...inputProps,
|
|
261
273
|
...themeProps,
|
|
262
274
|
step: typeof inputProps.step === "number" ? inputProps.step : 1,
|
|
263
275
|
type: "text",
|
|
276
|
+
description,
|
|
264
277
|
value,
|
|
265
278
|
"aria-describedby": (0, import_utils4.ariaDescribedByIds)(id, !!schema.examples)
|
|
266
279
|
}
|
|
267
280
|
) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
268
281
|
import_core4.TextInput,
|
|
269
282
|
{
|
|
270
|
-
id,
|
|
271
|
-
name: htmlName || id,
|
|
272
|
-
label: (0, import_utils4.labelValue)(label || void 0, hideLabel, false),
|
|
273
|
-
required,
|
|
274
|
-
autoFocus: autofocus,
|
|
275
|
-
disabled: disabled || readonly,
|
|
276
|
-
onBlur: !readonly ? handleBlur : void 0,
|
|
277
283
|
onChange: !readonly ? handleChange : void 0,
|
|
278
|
-
|
|
279
|
-
placeholder,
|
|
280
|
-
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
281
|
-
list: schema.examples ? (0, import_utils4.examplesId)(id) : void 0,
|
|
284
|
+
...componentProps,
|
|
282
285
|
...inputProps,
|
|
283
286
|
...themeProps,
|
|
287
|
+
description,
|
|
284
288
|
value,
|
|
285
289
|
"aria-describedby": (0, import_utils4.ariaDescribedByIds)(id, !!schema.examples)
|
|
286
290
|
}
|
|
@@ -628,6 +632,8 @@ function FieldTemplate(props) {
|
|
|
628
632
|
classNames,
|
|
629
633
|
style,
|
|
630
634
|
label,
|
|
635
|
+
displayLabel,
|
|
636
|
+
rawDescription,
|
|
631
637
|
schema,
|
|
632
638
|
uiSchema,
|
|
633
639
|
registry,
|
|
@@ -644,32 +650,32 @@ function FieldTemplate(props) {
|
|
|
644
650
|
// src/templates/FieldHelpTemplate.tsx
|
|
645
651
|
var import_utils12 = require("@rjsf/utils");
|
|
646
652
|
var import_core12 = require("@mantine/core");
|
|
653
|
+
var import_core13 = require("@rjsf/core");
|
|
647
654
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
648
655
|
function FieldHelpTemplate(props) {
|
|
649
|
-
const { fieldPathId, help } = props;
|
|
656
|
+
const { fieldPathId, help, uiSchema, registry } = props;
|
|
650
657
|
if (!help) {
|
|
651
658
|
return null;
|
|
652
659
|
}
|
|
653
|
-
|
|
654
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Text, { id, size: "sm", my: "xs", c: "dimmed", children: help });
|
|
660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Text, { id: (0, import_utils12.helpId)(fieldPathId), size: "sm", my: "xs", c: "dimmed", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core13.RichHelp, { help, registry, uiSchema }) });
|
|
655
661
|
}
|
|
656
662
|
|
|
657
663
|
// src/templates/GridTemplate.tsx
|
|
658
|
-
var
|
|
664
|
+
var import_core14 = require("@mantine/core");
|
|
659
665
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
660
666
|
function GridTemplate(props) {
|
|
661
667
|
const { children, column, fluid = true, ...rest } = props;
|
|
662
668
|
if (column) {
|
|
663
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core14.Grid.Col, { ...rest, children });
|
|
664
670
|
}
|
|
665
671
|
if (fluid) {
|
|
666
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core14.Container, { p: "4", mx: 0, w: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core14.Grid, { ...rest, children }) });
|
|
667
673
|
}
|
|
668
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core14.Grid, { grow: true, ...rest, children });
|
|
669
675
|
}
|
|
670
676
|
|
|
671
677
|
// src/templates/ObjectFieldTemplate.tsx
|
|
672
|
-
var
|
|
678
|
+
var import_core15 = require("@mantine/core");
|
|
673
679
|
var import_utils13 = require("@rjsf/utils");
|
|
674
680
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
675
681
|
function ObjectFieldTemplate(props) {
|
|
@@ -702,7 +708,7 @@ function ObjectFieldTemplate(props) {
|
|
|
702
708
|
const gridCols = typeof uiOptions?.gridCols === "number" && uiOptions?.gridCols || void 0;
|
|
703
709
|
const gridSpacing = uiOptions?.gridSpacing;
|
|
704
710
|
const gridVerticalSpacing = uiOptions?.gridVerticalSpacing;
|
|
705
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core15.Container, { id: fieldPathId.$id, p: 0, children: [
|
|
706
712
|
title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
707
713
|
TitleFieldTemplate,
|
|
708
714
|
{
|
|
@@ -726,7 +732,7 @@ function ObjectFieldTemplate(props) {
|
|
|
726
732
|
}
|
|
727
733
|
),
|
|
728
734
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
729
|
-
|
|
735
|
+
import_core15.SimpleGrid,
|
|
730
736
|
{
|
|
731
737
|
cols: gridCols,
|
|
732
738
|
spacing: gridSpacing,
|
|
@@ -734,11 +740,11 @@ function ObjectFieldTemplate(props) {
|
|
|
734
740
|
mb: "sm",
|
|
735
741
|
children: [
|
|
736
742
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
737
|
-
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
743
|
+
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core15.Box, { children: element.content }, element.name))
|
|
738
744
|
]
|
|
739
745
|
}
|
|
740
746
|
),
|
|
741
|
-
(0, import_utils13.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
747
|
+
(0, import_utils13.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core15.Group, { mt: "xs", justify: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
742
748
|
AddButton2,
|
|
743
749
|
{
|
|
744
750
|
id: (0, import_utils13.buttonId)(fieldPathId, "add"),
|
|
@@ -785,15 +791,15 @@ function OptionalDataControlsTemplate(props) {
|
|
|
785
791
|
}
|
|
786
792
|
|
|
787
793
|
// src/templates/TitleField.tsx
|
|
788
|
-
var
|
|
794
|
+
var import_core16 = require("@mantine/core");
|
|
789
795
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
790
796
|
function TitleField(props) {
|
|
791
797
|
const { id, title, optionalDataControl } = props;
|
|
792
|
-
let heading = title ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
798
|
+
let heading = title ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Title, { id, order: 3, fw: "normal", children: title }) : null;
|
|
793
799
|
if (optionalDataControl) {
|
|
794
|
-
heading = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
795
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
796
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
800
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Grid, { children: [
|
|
801
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Grid.Col, { span: "auto", children: heading }),
|
|
802
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Grid.Col, { span: "content", children: optionalDataControl })
|
|
797
803
|
] });
|
|
798
804
|
}
|
|
799
805
|
return heading;
|
|
@@ -801,7 +807,7 @@ function TitleField(props) {
|
|
|
801
807
|
|
|
802
808
|
// src/templates/WrapIfAdditionalTemplate.tsx
|
|
803
809
|
var import_utils14 = require("@rjsf/utils");
|
|
804
|
-
var
|
|
810
|
+
var import_core17 = require("@mantine/core");
|
|
805
811
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
806
812
|
function WrapIfAdditionalTemplate(props) {
|
|
807
813
|
const {
|
|
@@ -809,6 +815,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
809
815
|
classNames,
|
|
810
816
|
style,
|
|
811
817
|
label,
|
|
818
|
+
displayLabel,
|
|
819
|
+
rawDescription,
|
|
812
820
|
required,
|
|
813
821
|
readonly,
|
|
814
822
|
disabled,
|
|
@@ -831,24 +839,25 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
831
839
|
...uiSchema,
|
|
832
840
|
[import_utils14.UI_OPTIONS_KEY]: { ...uiOptions, block: true }
|
|
833
841
|
};
|
|
834
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: classNames, style, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
835
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
836
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
837
|
-
|
|
842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: classNames, style, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core17.Flex, { gap: "xs", align: "end", justify: "center", children: [
|
|
843
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core17.Grid, { w: "100%", align: "center", children: [
|
|
844
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.Grid.Col, { span: 6, className: "form-additional", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
845
|
+
import_core17.TextInput,
|
|
838
846
|
{
|
|
839
847
|
className: "form-group",
|
|
840
|
-
label: keyLabel,
|
|
848
|
+
label: displayLabel ? keyLabel : void 0,
|
|
841
849
|
defaultValue: label,
|
|
842
850
|
required,
|
|
851
|
+
description: rawDescription ? "\xA0" : void 0,
|
|
843
852
|
disabled: disabled || readonly,
|
|
844
853
|
id: `${id}-key`,
|
|
845
854
|
name: `${id}-key`,
|
|
846
855
|
onBlur: !readonly ? onKeyRenameBlur : void 0
|
|
847
856
|
}
|
|
848
|
-
) })
|
|
849
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
857
|
+
) }),
|
|
858
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.Grid.Col, { span: 6, className: "form-additional", children })
|
|
850
859
|
] }),
|
|
851
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
860
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
852
861
|
RemoveButton2,
|
|
853
862
|
{
|
|
854
863
|
id: (0, import_utils14.buttonId)(id, "remove"),
|
|
@@ -859,15 +868,15 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
859
868
|
uiSchema: buttonUiOptions,
|
|
860
869
|
registry
|
|
861
870
|
}
|
|
862
|
-
)
|
|
871
|
+
) })
|
|
863
872
|
] }) });
|
|
864
873
|
}
|
|
865
874
|
|
|
866
875
|
// src/templates/MultiSchemaFieldTemplate.tsx
|
|
867
|
-
var
|
|
876
|
+
var import_core18 = require("@mantine/core");
|
|
868
877
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
869
878
|
function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
|
|
870
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core18.Stack, { style: { marginBottom: "1rem" }, children: [
|
|
871
880
|
selector,
|
|
872
881
|
optionSchemaField
|
|
873
882
|
] });
|
|
@@ -909,19 +918,19 @@ function AltDateTimeWidget(props) {
|
|
|
909
918
|
|
|
910
919
|
// src/widgets/DateTime/AltDateWidget.tsx
|
|
911
920
|
var import_utils15 = require("@rjsf/utils");
|
|
912
|
-
var
|
|
921
|
+
var import_core19 = require("@mantine/core");
|
|
913
922
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
914
923
|
function AltDateWidget(props) {
|
|
915
924
|
const { id, required, disabled, readonly, label, hideLabel, rawErrors, options, registry } = props;
|
|
916
925
|
const { translateString } = registry;
|
|
917
926
|
const { elements, handleChange, handleClear, handleSetNow } = (0, import_utils15.useAltDateWidgetProps)(props);
|
|
918
927
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
919
|
-
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
920
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
928
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core19.Input.Label, { id: (0, import_utils15.titleId)(id), required, children: label }),
|
|
929
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_core19.Flex, { gap: "xs", align: "center", wrap: "nowrap", children: [
|
|
921
930
|
elements.map((elemProps, i) => {
|
|
922
931
|
const elemId = `${id}_${elemProps.type}`;
|
|
923
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
924
|
-
|
|
932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core19.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
933
|
+
import_core19.Select,
|
|
925
934
|
{
|
|
926
935
|
id: elemId,
|
|
927
936
|
name: elemId,
|
|
@@ -937,12 +946,12 @@ function AltDateWidget(props) {
|
|
|
937
946
|
}
|
|
938
947
|
) }, i);
|
|
939
948
|
}),
|
|
940
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
941
|
-
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
942
|
-
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
949
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_core19.Group, { wrap: "nowrap", gap: 3, children: [
|
|
950
|
+
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core19.Button, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(import_utils15.TranslatableString.NowLabel) }),
|
|
951
|
+
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core19.Button, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(import_utils15.TranslatableString.ClearLabel) })
|
|
943
952
|
] })
|
|
944
953
|
] }),
|
|
945
|
-
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
954
|
+
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core19.Input.Error, { children: error }, `alt-date-widget-input-errors-${index}`))
|
|
946
955
|
] });
|
|
947
956
|
}
|
|
948
957
|
|
|
@@ -1127,7 +1136,7 @@ function TimeWidget(props) {
|
|
|
1127
1136
|
// src/widgets/CheckboxesWidget.tsx
|
|
1128
1137
|
var import_react4 = require("react");
|
|
1129
1138
|
var import_utils18 = require("@rjsf/utils");
|
|
1130
|
-
var
|
|
1139
|
+
var import_core20 = require("@mantine/core");
|
|
1131
1140
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1132
1141
|
function CheckboxesWidget(props) {
|
|
1133
1142
|
const {
|
|
@@ -1174,9 +1183,9 @@ function CheckboxesWidget(props) {
|
|
|
1174
1183
|
);
|
|
1175
1184
|
const selectedIndexes = (0, import_utils18.enumOptionsIndexForValue)(value, enumOptions, true);
|
|
1176
1185
|
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
1177
|
-
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1186
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core20.Input.Label, { id: (0, import_utils18.titleId)(id), required, children: label }),
|
|
1178
1187
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1179
|
-
|
|
1188
|
+
import_core20.Checkbox.Group,
|
|
1180
1189
|
{
|
|
1181
1190
|
id,
|
|
1182
1191
|
value: selectedIndexes,
|
|
@@ -1186,8 +1195,8 @@ function CheckboxesWidget(props) {
|
|
|
1186
1195
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1187
1196
|
"aria-describedby": (0, import_utils18.ariaDescribedByIds)(id),
|
|
1188
1197
|
...themeProps,
|
|
1189
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1190
|
-
|
|
1198
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core20.Flex, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1199
|
+
import_core20.Checkbox,
|
|
1191
1200
|
{
|
|
1192
1201
|
id: (0, import_utils18.optionId)(id, i),
|
|
1193
1202
|
name: htmlName || id,
|
|
@@ -1208,7 +1217,7 @@ function CheckboxesWidget(props) {
|
|
|
1208
1217
|
// src/widgets/CheckboxWidget.tsx
|
|
1209
1218
|
var import_react5 = require("react");
|
|
1210
1219
|
var import_utils20 = require("@rjsf/utils");
|
|
1211
|
-
var
|
|
1220
|
+
var import_core21 = require("@mantine/core");
|
|
1212
1221
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1213
1222
|
function CheckboxWidget(props) {
|
|
1214
1223
|
const {
|
|
@@ -1231,7 +1240,6 @@ function CheckboxWidget(props) {
|
|
|
1231
1240
|
registry,
|
|
1232
1241
|
uiSchema
|
|
1233
1242
|
} = props;
|
|
1234
|
-
const themeProps = cleanupOptions(options);
|
|
1235
1243
|
const DescriptionFieldTemplate = (0, import_utils20.getTemplate)(
|
|
1236
1244
|
"DescriptionFieldTemplate",
|
|
1237
1245
|
registry,
|
|
@@ -1274,7 +1282,7 @@ function CheckboxWidget(props) {
|
|
|
1274
1282
|
}
|
|
1275
1283
|
),
|
|
1276
1284
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1277
|
-
|
|
1285
|
+
import_core21.Checkbox,
|
|
1278
1286
|
{
|
|
1279
1287
|
id,
|
|
1280
1288
|
name: htmlName || name,
|
|
@@ -1287,8 +1295,7 @@ function CheckboxWidget(props) {
|
|
|
1287
1295
|
onBlur: handleBlur,
|
|
1288
1296
|
onFocus: handleFocus,
|
|
1289
1297
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1290
|
-
"aria-describedby": (0, import_utils20.ariaDescribedByIds)(id)
|
|
1291
|
-
...themeProps
|
|
1298
|
+
"aria-describedby": (0, import_utils20.ariaDescribedByIds)(id)
|
|
1292
1299
|
}
|
|
1293
1300
|
)
|
|
1294
1301
|
] });
|
|
@@ -1296,8 +1303,8 @@ function CheckboxWidget(props) {
|
|
|
1296
1303
|
|
|
1297
1304
|
// src/widgets/ColorWidget.tsx
|
|
1298
1305
|
var import_react6 = require("react");
|
|
1299
|
-
var
|
|
1300
|
-
var
|
|
1306
|
+
var import_utils21 = require("@rjsf/utils");
|
|
1307
|
+
var import_core22 = require("@mantine/core");
|
|
1301
1308
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1302
1309
|
function ColorWidget(props) {
|
|
1303
1310
|
const {
|
|
@@ -1341,7 +1348,7 @@ function ColorWidget(props) {
|
|
|
1341
1348
|
[onFocus, id]
|
|
1342
1349
|
);
|
|
1343
1350
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1344
|
-
|
|
1351
|
+
import_core22.ColorInput,
|
|
1345
1352
|
{
|
|
1346
1353
|
id,
|
|
1347
1354
|
name,
|
|
@@ -1350,13 +1357,13 @@ function ColorWidget(props) {
|
|
|
1350
1357
|
required,
|
|
1351
1358
|
disabled: disabled || readonly,
|
|
1352
1359
|
autoFocus: autofocus,
|
|
1353
|
-
label: (0,
|
|
1360
|
+
label: (0, import_utils21.labelValue)(label || void 0, hideLabel, false),
|
|
1354
1361
|
onChange: handleChange,
|
|
1355
1362
|
onBlur: handleBlur,
|
|
1356
1363
|
onFocus: handleFocus,
|
|
1357
1364
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1358
1365
|
...themeProps,
|
|
1359
|
-
"aria-describedby": (0,
|
|
1366
|
+
"aria-describedby": (0, import_utils21.ariaDescribedByIds)(id),
|
|
1360
1367
|
popoverProps: { withinPortal: false }
|
|
1361
1368
|
}
|
|
1362
1369
|
);
|
|
@@ -1364,8 +1371,8 @@ function ColorWidget(props) {
|
|
|
1364
1371
|
|
|
1365
1372
|
// src/widgets/FileWidget.tsx
|
|
1366
1373
|
var import_react7 = require("react");
|
|
1367
|
-
var
|
|
1368
|
-
var
|
|
1374
|
+
var import_utils23 = require("@rjsf/utils");
|
|
1375
|
+
var import_core23 = require("@mantine/core");
|
|
1369
1376
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1370
1377
|
function FileWidget(props) {
|
|
1371
1378
|
const {
|
|
@@ -1384,7 +1391,7 @@ function FileWidget(props) {
|
|
|
1384
1391
|
multiple,
|
|
1385
1392
|
onChange
|
|
1386
1393
|
} = props;
|
|
1387
|
-
const { filesInfo, handleChange, handleRemove } = (0,
|
|
1394
|
+
const { filesInfo, handleChange, handleRemove } = (0, import_utils23.useFileWidgetProps)(value, onChange, multiple);
|
|
1388
1395
|
const themeProps = cleanupOptions(options);
|
|
1389
1396
|
const handleOnChange = (0, import_react7.useCallback)(
|
|
1390
1397
|
(files) => {
|
|
@@ -1396,12 +1403,12 @@ function FileWidget(props) {
|
|
|
1396
1403
|
);
|
|
1397
1404
|
const ValueComponent = (0, import_react7.useCallback)(() => {
|
|
1398
1405
|
if (Array.isArray(filesInfo) && filesInfo.length > 0) {
|
|
1399
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_core23.Pill.Group, { children: filesInfo.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_core23.Pill, { withRemoveButton: true, onRemove: () => handleRemove(index), children: file.name }, index)) });
|
|
1400
1407
|
}
|
|
1401
1408
|
return null;
|
|
1402
1409
|
}, [handleRemove, filesInfo]);
|
|
1403
1410
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1404
|
-
|
|
1411
|
+
import_core23.FileInput,
|
|
1405
1412
|
{
|
|
1406
1413
|
id,
|
|
1407
1414
|
name,
|
|
@@ -1410,21 +1417,21 @@ function FileWidget(props) {
|
|
|
1410
1417
|
required,
|
|
1411
1418
|
disabled: disabled || readonly,
|
|
1412
1419
|
autoFocus: autofocus,
|
|
1413
|
-
label: (0,
|
|
1420
|
+
label: (0, import_utils23.labelValue)(label || void 0, hideLabel, false),
|
|
1414
1421
|
multiple: !!multiple,
|
|
1415
1422
|
valueComponent: ValueComponent,
|
|
1416
1423
|
onChange: handleOnChange,
|
|
1417
1424
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1418
1425
|
...themeProps,
|
|
1419
|
-
"aria-describedby": (0,
|
|
1426
|
+
"aria-describedby": (0, import_utils23.ariaDescribedByIds)(id)
|
|
1420
1427
|
}
|
|
1421
1428
|
);
|
|
1422
1429
|
}
|
|
1423
1430
|
|
|
1424
1431
|
// src/widgets/PasswordWidget.tsx
|
|
1425
1432
|
var import_react8 = require("react");
|
|
1426
|
-
var
|
|
1427
|
-
var
|
|
1433
|
+
var import_utils25 = require("@rjsf/utils");
|
|
1434
|
+
var import_core24 = require("@mantine/core");
|
|
1428
1435
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1429
1436
|
function PasswordWidget(props) {
|
|
1430
1437
|
const {
|
|
@@ -1469,7 +1476,7 @@ function PasswordWidget(props) {
|
|
|
1469
1476
|
[onFocus, id]
|
|
1470
1477
|
);
|
|
1471
1478
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1472
|
-
|
|
1479
|
+
import_core24.PasswordInput,
|
|
1473
1480
|
{
|
|
1474
1481
|
id,
|
|
1475
1482
|
name,
|
|
@@ -1478,21 +1485,21 @@ function PasswordWidget(props) {
|
|
|
1478
1485
|
required,
|
|
1479
1486
|
disabled: disabled || readonly,
|
|
1480
1487
|
autoFocus: autofocus,
|
|
1481
|
-
label: (0,
|
|
1488
|
+
label: (0, import_utils25.labelValue)(label || void 0, hideLabel, false),
|
|
1482
1489
|
onChange: handleChange,
|
|
1483
1490
|
onBlur: handleBlur,
|
|
1484
1491
|
onFocus: handleFocus,
|
|
1485
1492
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1486
1493
|
...themeProps,
|
|
1487
|
-
"aria-describedby": (0,
|
|
1494
|
+
"aria-describedby": (0, import_utils25.ariaDescribedByIds)(id)
|
|
1488
1495
|
}
|
|
1489
1496
|
);
|
|
1490
1497
|
}
|
|
1491
1498
|
|
|
1492
1499
|
// src/widgets/RadioWidget.tsx
|
|
1493
1500
|
var import_react9 = require("react");
|
|
1494
|
-
var
|
|
1495
|
-
var
|
|
1501
|
+
var import_utils27 = require("@rjsf/utils");
|
|
1502
|
+
var import_core25 = require("@mantine/core");
|
|
1496
1503
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1497
1504
|
function RadioWidget(props) {
|
|
1498
1505
|
const {
|
|
@@ -1516,7 +1523,7 @@ function RadioWidget(props) {
|
|
|
1516
1523
|
const handleChange = (0, import_react9.useCallback)(
|
|
1517
1524
|
(nextValue) => {
|
|
1518
1525
|
if (!disabled && !readonly && onChange) {
|
|
1519
|
-
onChange((0,
|
|
1526
|
+
onChange((0, import_utils27.enumOptionsValueForIndex)(nextValue, enumOptions, emptyValue));
|
|
1520
1527
|
}
|
|
1521
1528
|
},
|
|
1522
1529
|
[onChange, disabled, readonly, enumOptions, emptyValue]
|
|
@@ -1524,7 +1531,7 @@ function RadioWidget(props) {
|
|
|
1524
1531
|
const handleBlur = (0, import_react9.useCallback)(
|
|
1525
1532
|
({ target }) => {
|
|
1526
1533
|
if (onBlur) {
|
|
1527
|
-
onBlur(id, (0,
|
|
1534
|
+
onBlur(id, (0, import_utils27.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1528
1535
|
}
|
|
1529
1536
|
},
|
|
1530
1537
|
[onBlur, id, enumOptions, emptyValue]
|
|
@@ -1532,14 +1539,14 @@ function RadioWidget(props) {
|
|
|
1532
1539
|
const handleFocus = (0, import_react9.useCallback)(
|
|
1533
1540
|
({ target }) => {
|
|
1534
1541
|
if (onFocus) {
|
|
1535
|
-
onFocus(id, (0,
|
|
1542
|
+
onFocus(id, (0, import_utils27.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1536
1543
|
}
|
|
1537
1544
|
},
|
|
1538
1545
|
[onFocus, id, enumOptions, emptyValue]
|
|
1539
1546
|
);
|
|
1540
|
-
const selected = (0,
|
|
1547
|
+
const selected = (0, import_utils27.enumOptionsIndexForValue)(value, enumOptions);
|
|
1541
1548
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1542
|
-
|
|
1549
|
+
import_core25.Radio.Group,
|
|
1543
1550
|
{
|
|
1544
1551
|
id,
|
|
1545
1552
|
name: htmlName || id,
|
|
@@ -1549,12 +1556,12 @@ function RadioWidget(props) {
|
|
|
1549
1556
|
required,
|
|
1550
1557
|
readOnly: disabled || readonly,
|
|
1551
1558
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1552
|
-
"aria-describedby": (0,
|
|
1559
|
+
"aria-describedby": (0, import_utils27.ariaDescribedByIds)(id),
|
|
1553
1560
|
...themeProps,
|
|
1554
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1555
|
-
|
|
1561
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core25.Flex, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1562
|
+
import_core25.Radio,
|
|
1556
1563
|
{
|
|
1557
|
-
id: (0,
|
|
1564
|
+
id: (0, import_utils27.optionId)(id, i),
|
|
1558
1565
|
value: String(i),
|
|
1559
1566
|
label: option.label,
|
|
1560
1567
|
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1,
|
|
@@ -1570,8 +1577,8 @@ function RadioWidget(props) {
|
|
|
1570
1577
|
|
|
1571
1578
|
// src/widgets/RangeWidget.tsx
|
|
1572
1579
|
var import_react10 = require("react");
|
|
1573
|
-
var
|
|
1574
|
-
var
|
|
1580
|
+
var import_utils29 = require("@rjsf/utils");
|
|
1581
|
+
var import_core26 = require("@mantine/core");
|
|
1575
1582
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1576
1583
|
function RangeWidget(props) {
|
|
1577
1584
|
const {
|
|
@@ -1592,7 +1599,7 @@ function RangeWidget(props) {
|
|
|
1592
1599
|
schema
|
|
1593
1600
|
} = props;
|
|
1594
1601
|
const themeProps = cleanupOptions(options);
|
|
1595
|
-
const { min, max, step } = (0,
|
|
1602
|
+
const { min, max, step } = (0, import_utils29.rangeSpec)(schema);
|
|
1596
1603
|
const handleChange = (0, import_react10.useCallback)(
|
|
1597
1604
|
(nextValue) => {
|
|
1598
1605
|
if (!disabled && !readonly && onChange) {
|
|
@@ -1612,10 +1619,10 @@ function RangeWidget(props) {
|
|
|
1612
1619
|
}
|
|
1613
1620
|
}, [onFocus, id, value]);
|
|
1614
1621
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
1615
|
-
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1616
|
-
options?.description && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1622
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core26.Input.Label, { id: (0, import_utils29.titleId)(id), required, children: label }),
|
|
1623
|
+
options?.description && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core26.Input.Description, { children: options.description }),
|
|
1617
1624
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1618
|
-
|
|
1625
|
+
import_core26.Slider,
|
|
1619
1626
|
{
|
|
1620
1627
|
id,
|
|
1621
1628
|
name,
|
|
@@ -1629,17 +1636,17 @@ function RangeWidget(props) {
|
|
|
1629
1636
|
onBlur: handleBlur,
|
|
1630
1637
|
onFocus: handleFocus,
|
|
1631
1638
|
...themeProps,
|
|
1632
|
-
"aria-describedby": (0,
|
|
1639
|
+
"aria-describedby": (0, import_utils29.ariaDescribedByIds)(id)
|
|
1633
1640
|
}
|
|
1634
1641
|
),
|
|
1635
|
-
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1642
|
+
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core26.Input.Error, { children: error }, `range-widget-input-errors-${index}`))
|
|
1636
1643
|
] });
|
|
1637
1644
|
}
|
|
1638
1645
|
|
|
1639
1646
|
// src/widgets/SelectWidget.tsx
|
|
1640
1647
|
var import_react11 = require("react");
|
|
1641
|
-
var
|
|
1642
|
-
var
|
|
1648
|
+
var import_utils31 = require("@rjsf/utils");
|
|
1649
|
+
var import_core27 = require("@mantine/core");
|
|
1643
1650
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1644
1651
|
function SelectWidget(props) {
|
|
1645
1652
|
const {
|
|
@@ -1665,7 +1672,7 @@ function SelectWidget(props) {
|
|
|
1665
1672
|
const handleChange = (0, import_react11.useCallback)(
|
|
1666
1673
|
(nextValue) => {
|
|
1667
1674
|
if (!disabled && !readonly && onChange) {
|
|
1668
|
-
onChange((0,
|
|
1675
|
+
onChange((0, import_utils31.enumOptionsValueForIndex)(nextValue, enumOptions, emptyValue));
|
|
1669
1676
|
}
|
|
1670
1677
|
},
|
|
1671
1678
|
[onChange, disabled, readonly, enumOptions, emptyValue]
|
|
@@ -1673,7 +1680,7 @@ function SelectWidget(props) {
|
|
|
1673
1680
|
const handleBlur = (0, import_react11.useCallback)(
|
|
1674
1681
|
({ target }) => {
|
|
1675
1682
|
if (onBlur) {
|
|
1676
|
-
onBlur(id, (0,
|
|
1683
|
+
onBlur(id, (0, import_utils31.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1677
1684
|
}
|
|
1678
1685
|
},
|
|
1679
1686
|
[onBlur, id, enumOptions, emptyValue]
|
|
@@ -1681,12 +1688,12 @@ function SelectWidget(props) {
|
|
|
1681
1688
|
const handleFocus = (0, import_react11.useCallback)(
|
|
1682
1689
|
({ target }) => {
|
|
1683
1690
|
if (onFocus) {
|
|
1684
|
-
onFocus(id, (0,
|
|
1691
|
+
onFocus(id, (0, import_utils31.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1685
1692
|
}
|
|
1686
1693
|
},
|
|
1687
1694
|
[onFocus, id, enumOptions, emptyValue]
|
|
1688
1695
|
);
|
|
1689
|
-
const selectedIndexes = (0,
|
|
1696
|
+
const selectedIndexes = (0, import_utils31.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
1690
1697
|
const selectOptions = (0, import_react11.useMemo)(() => {
|
|
1691
1698
|
if (Array.isArray(enumOptions)) {
|
|
1692
1699
|
return enumOptions.map((option, index) => ({
|
|
@@ -1698,13 +1705,13 @@ function SelectWidget(props) {
|
|
|
1698
1705
|
}
|
|
1699
1706
|
return [];
|
|
1700
1707
|
}, [enumDisabled, enumOptions]);
|
|
1701
|
-
const Component = multiple ?
|
|
1708
|
+
const Component = multiple ? import_core27.MultiSelect : import_core27.Select;
|
|
1702
1709
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1703
1710
|
Component,
|
|
1704
1711
|
{
|
|
1705
1712
|
id,
|
|
1706
1713
|
name: htmlName || id,
|
|
1707
|
-
label: (0,
|
|
1714
|
+
label: (0, import_utils31.labelValue)(label || void 0, hideLabel, false),
|
|
1708
1715
|
data: selectOptions,
|
|
1709
1716
|
value: multiple ? selectedIndexes : selectedIndexes,
|
|
1710
1717
|
onChange: !readonly ? handleChange : void 0,
|
|
@@ -1717,7 +1724,7 @@ function SelectWidget(props) {
|
|
|
1717
1724
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1718
1725
|
searchable: true,
|
|
1719
1726
|
...themeProps,
|
|
1720
|
-
"aria-describedby": (0,
|
|
1727
|
+
"aria-describedby": (0, import_utils31.ariaDescribedByIds)(id),
|
|
1721
1728
|
comboboxProps: { withinPortal: false }
|
|
1722
1729
|
}
|
|
1723
1730
|
);
|
|
@@ -1725,8 +1732,8 @@ function SelectWidget(props) {
|
|
|
1725
1732
|
|
|
1726
1733
|
// src/widgets/TextareaWidget.tsx
|
|
1727
1734
|
var import_react12 = require("react");
|
|
1728
|
-
var
|
|
1729
|
-
var
|
|
1735
|
+
var import_utils33 = require("@rjsf/utils");
|
|
1736
|
+
var import_core28 = require("@mantine/core");
|
|
1730
1737
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1731
1738
|
function TextareaWidget(props) {
|
|
1732
1739
|
const {
|
|
@@ -1772,7 +1779,7 @@ function TextareaWidget(props) {
|
|
|
1772
1779
|
[onFocus, id]
|
|
1773
1780
|
);
|
|
1774
1781
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1775
|
-
|
|
1782
|
+
import_core28.Textarea,
|
|
1776
1783
|
{
|
|
1777
1784
|
id,
|
|
1778
1785
|
name: htmlName || name,
|
|
@@ -1781,12 +1788,12 @@ function TextareaWidget(props) {
|
|
|
1781
1788
|
required,
|
|
1782
1789
|
disabled: disabled || readonly,
|
|
1783
1790
|
autoFocus: autofocus,
|
|
1784
|
-
label: (0,
|
|
1791
|
+
label: (0, import_utils33.labelValue)(label || void 0, hideLabel, false),
|
|
1785
1792
|
onChange: handleChange,
|
|
1786
1793
|
onBlur: handleBlur,
|
|
1787
1794
|
onFocus: handleFocus,
|
|
1788
1795
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1789
|
-
"aria-describedby": (0,
|
|
1796
|
+
"aria-describedby": (0, import_utils33.ariaDescribedByIds)(id),
|
|
1790
1797
|
...themeProps
|
|
1791
1798
|
}
|
|
1792
1799
|
);
|
|
@@ -1825,7 +1832,7 @@ var Theme_default = generateTheme();
|
|
|
1825
1832
|
|
|
1826
1833
|
// src/Form/index.ts
|
|
1827
1834
|
function generateForm() {
|
|
1828
|
-
return (0,
|
|
1835
|
+
return (0, import_core29.withTheme)(generateTheme());
|
|
1829
1836
|
}
|
|
1830
1837
|
var Form_default = generateForm();
|
|
1831
1838
|
|