@rjsf/mantine 6.0.2 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +100 -91
- package/dist/index.cjs.map +2 -2
- package/dist/mantine.esm.js +83 -74
- package/dist/mantine.esm.js.map +3 -3
- package/dist/mantine.umd.js +40 -32
- 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/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/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 {
|
|
@@ -1273,7 +1282,7 @@ function CheckboxWidget(props) {
|
|
|
1273
1282
|
}
|
|
1274
1283
|
),
|
|
1275
1284
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1276
|
-
|
|
1285
|
+
import_core21.Checkbox,
|
|
1277
1286
|
{
|
|
1278
1287
|
id,
|
|
1279
1288
|
name: htmlName || name,
|
|
@@ -1295,7 +1304,7 @@ function CheckboxWidget(props) {
|
|
|
1295
1304
|
// src/widgets/ColorWidget.tsx
|
|
1296
1305
|
var import_react6 = require("react");
|
|
1297
1306
|
var import_utils21 = require("@rjsf/utils");
|
|
1298
|
-
var
|
|
1307
|
+
var import_core22 = require("@mantine/core");
|
|
1299
1308
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1300
1309
|
function ColorWidget(props) {
|
|
1301
1310
|
const {
|
|
@@ -1339,7 +1348,7 @@ function ColorWidget(props) {
|
|
|
1339
1348
|
[onFocus, id]
|
|
1340
1349
|
);
|
|
1341
1350
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1342
|
-
|
|
1351
|
+
import_core22.ColorInput,
|
|
1343
1352
|
{
|
|
1344
1353
|
id,
|
|
1345
1354
|
name,
|
|
@@ -1363,7 +1372,7 @@ function ColorWidget(props) {
|
|
|
1363
1372
|
// src/widgets/FileWidget.tsx
|
|
1364
1373
|
var import_react7 = require("react");
|
|
1365
1374
|
var import_utils23 = require("@rjsf/utils");
|
|
1366
|
-
var
|
|
1375
|
+
var import_core23 = require("@mantine/core");
|
|
1367
1376
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1368
1377
|
function FileWidget(props) {
|
|
1369
1378
|
const {
|
|
@@ -1394,12 +1403,12 @@ function FileWidget(props) {
|
|
|
1394
1403
|
);
|
|
1395
1404
|
const ValueComponent = (0, import_react7.useCallback)(() => {
|
|
1396
1405
|
if (Array.isArray(filesInfo) && filesInfo.length > 0) {
|
|
1397
|
-
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)) });
|
|
1398
1407
|
}
|
|
1399
1408
|
return null;
|
|
1400
1409
|
}, [handleRemove, filesInfo]);
|
|
1401
1410
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1402
|
-
|
|
1411
|
+
import_core23.FileInput,
|
|
1403
1412
|
{
|
|
1404
1413
|
id,
|
|
1405
1414
|
name,
|
|
@@ -1422,7 +1431,7 @@ function FileWidget(props) {
|
|
|
1422
1431
|
// src/widgets/PasswordWidget.tsx
|
|
1423
1432
|
var import_react8 = require("react");
|
|
1424
1433
|
var import_utils25 = require("@rjsf/utils");
|
|
1425
|
-
var
|
|
1434
|
+
var import_core24 = require("@mantine/core");
|
|
1426
1435
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1427
1436
|
function PasswordWidget(props) {
|
|
1428
1437
|
const {
|
|
@@ -1467,7 +1476,7 @@ function PasswordWidget(props) {
|
|
|
1467
1476
|
[onFocus, id]
|
|
1468
1477
|
);
|
|
1469
1478
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1470
|
-
|
|
1479
|
+
import_core24.PasswordInput,
|
|
1471
1480
|
{
|
|
1472
1481
|
id,
|
|
1473
1482
|
name,
|
|
@@ -1490,7 +1499,7 @@ function PasswordWidget(props) {
|
|
|
1490
1499
|
// src/widgets/RadioWidget.tsx
|
|
1491
1500
|
var import_react9 = require("react");
|
|
1492
1501
|
var import_utils27 = require("@rjsf/utils");
|
|
1493
|
-
var
|
|
1502
|
+
var import_core25 = require("@mantine/core");
|
|
1494
1503
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1495
1504
|
function RadioWidget(props) {
|
|
1496
1505
|
const {
|
|
@@ -1537,7 +1546,7 @@ function RadioWidget(props) {
|
|
|
1537
1546
|
);
|
|
1538
1547
|
const selected = (0, import_utils27.enumOptionsIndexForValue)(value, enumOptions);
|
|
1539
1548
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1540
|
-
|
|
1549
|
+
import_core25.Radio.Group,
|
|
1541
1550
|
{
|
|
1542
1551
|
id,
|
|
1543
1552
|
name: htmlName || id,
|
|
@@ -1549,8 +1558,8 @@ function RadioWidget(props) {
|
|
|
1549
1558
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1550
1559
|
"aria-describedby": (0, import_utils27.ariaDescribedByIds)(id),
|
|
1551
1560
|
...themeProps,
|
|
1552
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1553
|
-
|
|
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,
|
|
1554
1563
|
{
|
|
1555
1564
|
id: (0, import_utils27.optionId)(id, i),
|
|
1556
1565
|
value: String(i),
|
|
@@ -1569,7 +1578,7 @@ function RadioWidget(props) {
|
|
|
1569
1578
|
// src/widgets/RangeWidget.tsx
|
|
1570
1579
|
var import_react10 = require("react");
|
|
1571
1580
|
var import_utils29 = require("@rjsf/utils");
|
|
1572
|
-
var
|
|
1581
|
+
var import_core26 = require("@mantine/core");
|
|
1573
1582
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1574
1583
|
function RangeWidget(props) {
|
|
1575
1584
|
const {
|
|
@@ -1610,10 +1619,10 @@ function RangeWidget(props) {
|
|
|
1610
1619
|
}
|
|
1611
1620
|
}, [onFocus, id, value]);
|
|
1612
1621
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
1613
|
-
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1614
|
-
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 }),
|
|
1615
1624
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1616
|
-
|
|
1625
|
+
import_core26.Slider,
|
|
1617
1626
|
{
|
|
1618
1627
|
id,
|
|
1619
1628
|
name,
|
|
@@ -1630,14 +1639,14 @@ function RangeWidget(props) {
|
|
|
1630
1639
|
"aria-describedby": (0, import_utils29.ariaDescribedByIds)(id)
|
|
1631
1640
|
}
|
|
1632
1641
|
),
|
|
1633
|
-
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}`))
|
|
1634
1643
|
] });
|
|
1635
1644
|
}
|
|
1636
1645
|
|
|
1637
1646
|
// src/widgets/SelectWidget.tsx
|
|
1638
1647
|
var import_react11 = require("react");
|
|
1639
1648
|
var import_utils31 = require("@rjsf/utils");
|
|
1640
|
-
var
|
|
1649
|
+
var import_core27 = require("@mantine/core");
|
|
1641
1650
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1642
1651
|
function SelectWidget(props) {
|
|
1643
1652
|
const {
|
|
@@ -1696,7 +1705,7 @@ function SelectWidget(props) {
|
|
|
1696
1705
|
}
|
|
1697
1706
|
return [];
|
|
1698
1707
|
}, [enumDisabled, enumOptions]);
|
|
1699
|
-
const Component = multiple ?
|
|
1708
|
+
const Component = multiple ? import_core27.MultiSelect : import_core27.Select;
|
|
1700
1709
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1701
1710
|
Component,
|
|
1702
1711
|
{
|
|
@@ -1724,7 +1733,7 @@ function SelectWidget(props) {
|
|
|
1724
1733
|
// src/widgets/TextareaWidget.tsx
|
|
1725
1734
|
var import_react12 = require("react");
|
|
1726
1735
|
var import_utils33 = require("@rjsf/utils");
|
|
1727
|
-
var
|
|
1736
|
+
var import_core28 = require("@mantine/core");
|
|
1728
1737
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1729
1738
|
function TextareaWidget(props) {
|
|
1730
1739
|
const {
|
|
@@ -1770,7 +1779,7 @@ function TextareaWidget(props) {
|
|
|
1770
1779
|
[onFocus, id]
|
|
1771
1780
|
);
|
|
1772
1781
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1773
|
-
|
|
1782
|
+
import_core28.Textarea,
|
|
1774
1783
|
{
|
|
1775
1784
|
id,
|
|
1776
1785
|
name: htmlName || name,
|
|
@@ -1823,7 +1832,7 @@ var Theme_default = generateTheme();
|
|
|
1823
1832
|
|
|
1824
1833
|
// src/Form/index.ts
|
|
1825
1834
|
function generateForm() {
|
|
1826
|
-
return (0,
|
|
1835
|
+
return (0, import_core29.withTheme)(generateTheme());
|
|
1827
1836
|
}
|
|
1828
1837
|
var Form_default = generateForm();
|
|
1829
1838
|
|