@rjsf/mantine 6.6.1 → 6.7.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/LICENSE.md +201 -0
- package/dist/index.cjs +356 -302
- package/dist/index.cjs.map +4 -4
- package/dist/mantine.esm.js +218 -226
- package/dist/mantine.esm.js.map +4 -4
- package/dist/mantine.umd.js +175 -127
- package/lib/Form/index.d.ts +3 -3
- package/lib/Form/index.js.map +1 -1
- package/lib/Theme/index.d.ts +2 -2
- package/lib/templates/ArrayFieldItemTemplate.d.ts +2 -2
- package/lib/templates/ArrayFieldItemTemplate.js +1 -1
- package/lib/templates/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/templates/ArrayFieldTemplate.d.ts +2 -2
- package/lib/templates/ArrayFieldTemplate.js +1 -1
- package/lib/templates/ArrayFieldTemplate.js.map +1 -1
- package/lib/templates/ArrayFieldTitleTemplate.d.ts +2 -2
- package/lib/templates/ArrayFieldTitleTemplate.js +1 -1
- package/lib/templates/ArrayFieldTitleTemplate.js.map +1 -1
- package/lib/templates/BaseInputTemplate.d.ts +2 -2
- package/lib/templates/BaseInputTemplate.js +9 -7
- package/lib/templates/BaseInputTemplate.js.map +1 -1
- package/lib/templates/ButtonTemplates/AddButton.d.ts +2 -2
- package/lib/templates/ButtonTemplates/AddButton.js.map +1 -1
- package/lib/templates/ButtonTemplates/IconButton.d.ts +15 -8
- package/lib/templates/ButtonTemplates/IconButton.js +14 -6
- package/lib/templates/ButtonTemplates/IconButton.js.map +1 -1
- package/lib/templates/ButtonTemplates/SubmitButton.d.ts +2 -2
- package/lib/templates/ButtonTemplates/SubmitButton.js.map +1 -1
- package/lib/templates/ButtonTemplates/index.d.ts +1 -1
- package/lib/templates/CyclicSchemaExpandTemplate.d.ts +6 -0
- package/lib/templates/CyclicSchemaExpandTemplate.js +15 -0
- package/lib/templates/CyclicSchemaExpandTemplate.js.map +1 -0
- package/lib/templates/DescriptionField.d.ts +2 -2
- package/lib/templates/ErrorList.d.ts +2 -2
- package/lib/templates/ErrorList.js.map +1 -1
- package/lib/templates/FieldErrorTemplate.d.ts +2 -2
- package/lib/templates/FieldErrorTemplate.js +1 -1
- package/lib/templates/FieldErrorTemplate.js.map +1 -1
- package/lib/templates/FieldHelpTemplate.d.ts +2 -2
- package/lib/templates/FieldHelpTemplate.js.map +1 -1
- package/lib/templates/FieldTemplate.d.ts +2 -2
- package/lib/templates/FieldTemplate.js +1 -1
- package/lib/templates/FieldTemplate.js.map +1 -1
- package/lib/templates/GridTemplate.d.ts +2 -2
- package/lib/templates/MultiSchemaFieldTemplate.d.ts +2 -2
- package/lib/templates/ObjectFieldTemplate.d.ts +2 -2
- package/lib/templates/ObjectFieldTemplate.js +1 -1
- package/lib/templates/ObjectFieldTemplate.js.map +1 -1
- package/lib/templates/OptionalDataControlsTemplate.d.ts +2 -2
- package/lib/templates/OptionalDataControlsTemplate.js +1 -1
- package/lib/templates/OptionalDataControlsTemplate.js.map +1 -1
- package/lib/templates/TitleField.d.ts +2 -2
- package/lib/templates/WrapIfAdditionalTemplate.d.ts +2 -2
- package/lib/templates/WrapIfAdditionalTemplate.js +1 -1
- package/lib/templates/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/templates/icons.d.ts +7 -7
- package/lib/templates/index.d.ts +1 -1
- package/lib/templates/index.js +2 -0
- package/lib/templates/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js.map +1 -1
- package/lib/widgets/CheckboxWidget.d.ts +2 -2
- package/lib/widgets/CheckboxWidget.js +1 -1
- package/lib/widgets/CheckboxWidget.js.map +1 -1
- package/lib/widgets/CheckboxesWidget.d.ts +2 -2
- package/lib/widgets/CheckboxesWidget.js +1 -1
- package/lib/widgets/CheckboxesWidget.js.map +1 -1
- package/lib/widgets/ColorWidget.d.ts +2 -2
- package/lib/widgets/ColorWidget.js +3 -3
- package/lib/widgets/ColorWidget.js.map +1 -1
- package/lib/widgets/DateTime/AltDateTimeWidget.d.ts +2 -2
- package/lib/widgets/DateTime/AltDateWidget.d.ts +2 -2
- package/lib/widgets/DateTime/AltDateWidget.js +1 -1
- package/lib/widgets/DateTime/AltDateWidget.js.map +1 -1
- package/lib/widgets/DateTime/DateTimeInput.d.ts +2 -2
- package/lib/widgets/DateTime/DateTimeInput.js +1 -1
- package/lib/widgets/DateTime/DateTimeInput.js.map +1 -1
- package/lib/widgets/DateTime/DateTimeWidget.d.ts +2 -2
- package/lib/widgets/DateTime/DateWidget.d.ts +2 -2
- package/lib/widgets/DateTime/TimeWidget.d.ts +2 -2
- package/lib/widgets/DateTime/TimeWidget.js +3 -3
- package/lib/widgets/DateTime/TimeWidget.js.map +1 -1
- package/lib/widgets/FileWidget.d.ts +2 -2
- package/lib/widgets/FileWidget.js +2 -1
- package/lib/widgets/FileWidget.js.map +1 -1
- package/lib/widgets/PasswordWidget.d.ts +2 -2
- package/lib/widgets/PasswordWidget.js +4 -4
- package/lib/widgets/PasswordWidget.js.map +1 -1
- package/lib/widgets/RadioWidget.d.ts +2 -2
- package/lib/widgets/RadioWidget.js +3 -3
- package/lib/widgets/RadioWidget.js.map +1 -1
- package/lib/widgets/RangeWidget.d.ts +2 -2
- package/lib/widgets/RangeWidget.js +1 -1
- package/lib/widgets/RangeWidget.js.map +1 -1
- package/lib/widgets/SelectWidget.d.ts +2 -2
- package/lib/widgets/SelectWidget.js +8 -7
- package/lib/widgets/SelectWidget.js.map +1 -1
- package/lib/widgets/TextareaWidget.d.ts +2 -2
- package/lib/widgets/TextareaWidget.js +3 -3
- package/lib/widgets/TextareaWidget.js.map +1 -1
- package/lib/widgets/index.d.ts +1 -1
- package/package.json +27 -24
- package/src/Form/index.ts +4 -3
- package/src/Theme/index.ts +2 -2
- package/src/templates/ArrayFieldItemTemplate.tsx +2 -8
- package/src/templates/ArrayFieldTemplate.tsx +2 -9
- package/src/templates/ArrayFieldTitleTemplate.tsx +2 -8
- package/src/templates/BaseInputTemplate.tsx +10 -17
- package/src/templates/ButtonTemplates/AddButton.tsx +2 -1
- package/src/templates/ButtonTemplates/IconButton.tsx +19 -10
- package/src/templates/ButtonTemplates/SubmitButton.tsx +2 -1
- package/src/templates/ButtonTemplates/index.ts +1 -1
- package/src/templates/CyclicSchemaExpandTemplate.tsx +34 -0
- package/src/templates/DescriptionField.tsx +1 -1
- package/src/templates/ErrorList.tsx +3 -1
- package/src/templates/FieldErrorTemplate.tsx +4 -2
- package/src/templates/FieldHelpTemplate.tsx +2 -1
- package/src/templates/FieldTemplate.tsx +2 -8
- package/src/templates/GridTemplate.tsx +1 -1
- package/src/templates/MultiSchemaFieldTemplate.tsx +1 -1
- package/src/templates/ObjectFieldTemplate.tsx +4 -8
- package/src/templates/OptionalDataControlsTemplate.tsx +3 -2
- package/src/templates/TitleField.tsx +1 -1
- package/src/templates/WrapIfAdditionalTemplate.tsx +2 -10
- package/src/templates/icons.tsx +1 -1
- package/src/templates/index.ts +3 -1
- package/src/utils.ts +2 -2
- package/src/widgets/CheckboxWidget.tsx +4 -11
- package/src/widgets/CheckboxesWidget.tsx +5 -7
- package/src/widgets/ColorWidget.tsx +6 -11
- package/src/widgets/DateTime/AltDateTimeWidget.tsx +1 -1
- package/src/widgets/DateTime/AltDateWidget.tsx +4 -12
- package/src/widgets/DateTime/DateTimeInput.tsx +2 -8
- package/src/widgets/DateTime/DateTimeWidget.tsx +1 -1
- package/src/widgets/DateTime/DateWidget.tsx +1 -1
- package/src/widgets/DateTime/TimeWidget.tsx +6 -11
- package/src/widgets/FileWidget.tsx +4 -9
- package/src/widgets/PasswordWidget.tsx +7 -12
- package/src/widgets/RadioWidget.tsx +7 -9
- package/src/widgets/RangeWidget.tsx +3 -9
- package/src/widgets/SelectWidget.tsx +25 -18
- package/src/widgets/TextareaWidget.tsx +6 -11
- package/src/widgets/index.ts +1 -1
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_core31 = require("@rjsf/core");
|
|
47
47
|
|
|
48
48
|
// src/templates/ArrayFieldItemTemplate.tsx
|
|
49
49
|
var import_core = require("@mantine/core");
|
|
@@ -235,24 +235,24 @@ function BaseInputTemplate(props) {
|
|
|
235
235
|
const inputProps = (0, import_utils4.getInputProps)(schema, type, options, false);
|
|
236
236
|
const description = hideLabel ? void 0 : options.description || schema.description;
|
|
237
237
|
const themeProps = cleanupOptions(options);
|
|
238
|
-
const handleNumberChange = (0, import_react.useCallback)((
|
|
238
|
+
const handleNumberChange = (0, import_react.useCallback)((newValue) => onChange(newValue), [onChange]);
|
|
239
239
|
const handleChange = (0, import_react.useCallback)(
|
|
240
240
|
(e) => {
|
|
241
|
-
const handler = onChangeOverride
|
|
242
|
-
const
|
|
243
|
-
handler(
|
|
241
|
+
const handler = onChangeOverride || onChange;
|
|
242
|
+
const newValue = e.target.value === "" ? options.emptyValue : e.target.value;
|
|
243
|
+
handler(newValue);
|
|
244
244
|
},
|
|
245
245
|
[onChange, onChangeOverride, options]
|
|
246
246
|
);
|
|
247
247
|
const handleBlur = (0, import_react.useCallback)(
|
|
248
248
|
(e) => {
|
|
249
|
-
onBlur(id, e.target
|
|
249
|
+
onBlur(id, e.target?.value);
|
|
250
250
|
},
|
|
251
251
|
[onBlur, id]
|
|
252
252
|
);
|
|
253
253
|
const handleFocus = (0, import_react.useCallback)(
|
|
254
254
|
(e) => {
|
|
255
|
-
onFocus(id, e.target
|
|
255
|
+
onFocus(id, e.target?.value);
|
|
256
256
|
},
|
|
257
257
|
[onFocus, id]
|
|
258
258
|
);
|
|
@@ -462,10 +462,11 @@ function ExclamationCircle({ size, style, ...others }) {
|
|
|
462
462
|
}
|
|
463
463
|
|
|
464
464
|
// src/templates/ButtonTemplates/IconButton.tsx
|
|
465
|
+
var import_react2 = require("react");
|
|
465
466
|
var import_core6 = require("@mantine/core");
|
|
466
467
|
var import_utils6 = require("@rjsf/utils");
|
|
467
468
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
468
|
-
function
|
|
469
|
+
function IconButtonFn(props) {
|
|
469
470
|
const { icon, iconType = "sm", color, onClick, uiSchema, registry, ...otherProps } = props;
|
|
470
471
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
471
472
|
import_core6.ActionIcon,
|
|
@@ -478,13 +479,16 @@ function IconButton(props) {
|
|
|
478
479
|
}
|
|
479
480
|
);
|
|
480
481
|
}
|
|
481
|
-
|
|
482
|
+
var IconButton = (0, import_react2.memo)(IconButtonFn);
|
|
483
|
+
var IconButton_default = IconButton;
|
|
484
|
+
function CopyButtonFn(props) {
|
|
482
485
|
const {
|
|
483
486
|
registry: { translateString }
|
|
484
487
|
} = props;
|
|
485
488
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.CopyButton), variant: "subtle", ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Copy, {}) });
|
|
486
489
|
}
|
|
487
|
-
|
|
490
|
+
var CopyButton = (0, import_react2.memo)(CopyButtonFn);
|
|
491
|
+
function MoveDownButtonFn(props) {
|
|
488
492
|
const {
|
|
489
493
|
registry: { translateString }
|
|
490
494
|
} = props;
|
|
@@ -498,7 +502,8 @@ function MoveDownButton(props) {
|
|
|
498
502
|
}
|
|
499
503
|
);
|
|
500
504
|
}
|
|
501
|
-
|
|
505
|
+
var MoveDownButton = (0, import_react2.memo)(MoveDownButtonFn);
|
|
506
|
+
function MoveUpButtonFn(props) {
|
|
502
507
|
const {
|
|
503
508
|
registry: { translateString }
|
|
504
509
|
} = props;
|
|
@@ -512,7 +517,8 @@ function MoveUpButton(props) {
|
|
|
512
517
|
}
|
|
513
518
|
);
|
|
514
519
|
}
|
|
515
|
-
|
|
520
|
+
var MoveUpButton = (0, import_react2.memo)(MoveUpButtonFn);
|
|
521
|
+
function RemoveButtonFn(props) {
|
|
516
522
|
const {
|
|
517
523
|
registry: { translateString }
|
|
518
524
|
} = props;
|
|
@@ -527,12 +533,14 @@ function RemoveButton(props) {
|
|
|
527
533
|
}
|
|
528
534
|
);
|
|
529
535
|
}
|
|
530
|
-
|
|
536
|
+
var RemoveButton = (0, import_react2.memo)(RemoveButtonFn);
|
|
537
|
+
function ClearButtonFn(props) {
|
|
531
538
|
const {
|
|
532
539
|
registry: { translateString }
|
|
533
540
|
} = props;
|
|
534
541
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.ClearButton), variant: "subtle", ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(X, {}) });
|
|
535
542
|
}
|
|
543
|
+
var ClearButton = (0, import_react2.memo)(ClearButtonFn);
|
|
536
544
|
|
|
537
545
|
// src/templates/ButtonTemplates/AddButton.tsx
|
|
538
546
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
@@ -540,7 +548,7 @@ function AddButton(props) {
|
|
|
540
548
|
const {
|
|
541
549
|
registry: { translateString }
|
|
542
550
|
} = props;
|
|
543
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton_default, { title: translateString(import_utils7.TranslatableString.AddItemButton), variant: "subtle", ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Plus, {}) });
|
|
544
552
|
}
|
|
545
553
|
|
|
546
554
|
// src/templates/ButtonTemplates/SubmitButton.tsx
|
|
@@ -569,68 +577,95 @@ function buttonTemplates() {
|
|
|
569
577
|
}
|
|
570
578
|
var ButtonTemplates_default = buttonTemplates;
|
|
571
579
|
|
|
572
|
-
// src/templates/
|
|
580
|
+
// src/templates/CyclicSchemaExpandTemplate.tsx
|
|
573
581
|
var import_core8 = require("@mantine/core");
|
|
574
|
-
var
|
|
582
|
+
var import_utils9 = require("@rjsf/utils");
|
|
575
583
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
584
|
+
function CyclicSchemaExpandTemplate(props) {
|
|
585
|
+
const { name, fieldPathId, registry, onExpand } = props;
|
|
586
|
+
const { translateString } = registry;
|
|
587
|
+
const buttonId4 = `${fieldPathId[import_utils9.ID_KEY]}-button`;
|
|
588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
589
|
+
import_core8.Alert,
|
|
590
|
+
{
|
|
591
|
+
color: "yellow",
|
|
592
|
+
variant: "transparent",
|
|
593
|
+
title: translateString(import_utils9.TranslatableString.CycleDetected, [name]),
|
|
594
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ExclamationCircle, {}),
|
|
595
|
+
mt: "md",
|
|
596
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Button, { id: buttonId4, size: "xs", variant: "outline", color: "yellow", onClick: () => onExpand(fieldPathId[import_utils9.ID_KEY]), children: translateString(import_utils9.TranslatableString.ExpandButton) }) })
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// src/templates/DescriptionField.tsx
|
|
602
|
+
var import_core9 = require("@mantine/core");
|
|
603
|
+
var import_core10 = require("@rjsf/core");
|
|
604
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
576
605
|
function DescriptionField(props) {
|
|
577
606
|
const { id, description, registry, uiSchema } = props;
|
|
578
607
|
if (description) {
|
|
579
|
-
return /* @__PURE__ */ (0,
|
|
608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core9.Text, { id, mt: 3, mb: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core10.RichDescription, { description, registry, uiSchema }) });
|
|
580
609
|
}
|
|
581
610
|
return null;
|
|
582
611
|
}
|
|
583
612
|
|
|
584
613
|
// src/templates/ErrorList.tsx
|
|
585
|
-
var
|
|
586
|
-
var
|
|
587
|
-
var
|
|
614
|
+
var import_core11 = require("@mantine/core");
|
|
615
|
+
var import_utils10 = require("@rjsf/utils");
|
|
616
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
588
617
|
function ErrorList({
|
|
589
618
|
errors,
|
|
590
619
|
registry
|
|
591
620
|
}) {
|
|
592
621
|
const { translateString } = registry;
|
|
593
|
-
return /* @__PURE__ */ (0,
|
|
594
|
-
|
|
622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
623
|
+
import_core11.Alert,
|
|
595
624
|
{
|
|
596
625
|
color: "red",
|
|
597
626
|
variant: "transparent",
|
|
598
|
-
title: /* @__PURE__ */ (0,
|
|
599
|
-
icon: /* @__PURE__ */ (0,
|
|
600
|
-
children: /* @__PURE__ */ (0,
|
|
627
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.Title, { order: 5, fw: "normal", children: translateString(import_utils10.TranslatableString.ErrorsLabel) }),
|
|
628
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ExclamationCircle, {}),
|
|
629
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.List, { children: errors.map((error, index) => (
|
|
630
|
+
// oxlint-disable-next-line react/no-array-index-key
|
|
631
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.List.Item, { c: "red", children: error.stack }, `error-${index}`)
|
|
632
|
+
)) })
|
|
601
633
|
}
|
|
602
634
|
);
|
|
603
635
|
}
|
|
604
636
|
|
|
605
637
|
// src/templates/FieldErrorTemplate.tsx
|
|
606
|
-
var
|
|
607
|
-
var
|
|
608
|
-
var
|
|
638
|
+
var import_core12 = require("@mantine/core");
|
|
639
|
+
var import_utils11 = require("@rjsf/utils");
|
|
640
|
+
var import_jsx_runtime12 = (
|
|
641
|
+
// oxlint-disable-next-line react/no-array-index-key
|
|
642
|
+
require("react/jsx-runtime")
|
|
643
|
+
);
|
|
609
644
|
function FieldErrorTemplate({ errors, fieldPathId }) {
|
|
610
|
-
if (!errors
|
|
645
|
+
if (!errors?.length) {
|
|
611
646
|
return null;
|
|
612
647
|
}
|
|
613
|
-
const id = (0,
|
|
614
|
-
return /* @__PURE__ */ (0,
|
|
648
|
+
const id = (0, import_utils11.errorId)(fieldPathId);
|
|
649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core12.Box, { id, c: "red", display: "none", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core12.List, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core12.List.Item, { children: error }, `field-error-${index}`)) }) });
|
|
615
650
|
}
|
|
616
651
|
|
|
617
652
|
// src/templates/FieldHelpTemplate.tsx
|
|
618
|
-
var
|
|
619
|
-
var
|
|
620
|
-
var
|
|
621
|
-
var
|
|
653
|
+
var import_core13 = require("@mantine/core");
|
|
654
|
+
var import_core14 = require("@rjsf/core");
|
|
655
|
+
var import_utils12 = require("@rjsf/utils");
|
|
656
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
622
657
|
function FieldHelpTemplate(props) {
|
|
623
658
|
const { fieldPathId, help, uiSchema, registry } = props;
|
|
624
659
|
if (!help) {
|
|
625
660
|
return null;
|
|
626
661
|
}
|
|
627
|
-
return /* @__PURE__ */ (0,
|
|
662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core13.Text, { id: (0, import_utils12.helpId)(fieldPathId), size: "sm", my: "xs", c: "dimmed", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core14.RichHelp, { help, registry, uiSchema }) });
|
|
628
663
|
}
|
|
629
664
|
|
|
630
665
|
// src/templates/FieldTemplate.tsx
|
|
631
|
-
var
|
|
632
|
-
var
|
|
633
|
-
var
|
|
666
|
+
var import_core15 = require("@mantine/core");
|
|
667
|
+
var import_utils13 = require("@rjsf/utils");
|
|
668
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
634
669
|
function FieldTemplate(props) {
|
|
635
670
|
const {
|
|
636
671
|
id,
|
|
@@ -649,16 +684,16 @@ function FieldTemplate(props) {
|
|
|
649
684
|
children,
|
|
650
685
|
...otherProps
|
|
651
686
|
} = props;
|
|
652
|
-
const uiOptions = (0,
|
|
653
|
-
const WrapIfAdditionalTemplate2 = (0,
|
|
687
|
+
const uiOptions = (0, import_utils13.getUiOptions)(uiSchema);
|
|
688
|
+
const WrapIfAdditionalTemplate2 = (0, import_utils13.getTemplate)(
|
|
654
689
|
"WrapIfAdditionalTemplate",
|
|
655
690
|
registry,
|
|
656
691
|
uiOptions
|
|
657
692
|
);
|
|
658
693
|
if (hidden) {
|
|
659
|
-
return /* @__PURE__ */ (0,
|
|
694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core15.Box, { display: "none", children });
|
|
660
695
|
}
|
|
661
|
-
return /* @__PURE__ */ (0,
|
|
696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
662
697
|
WrapIfAdditionalTemplate2,
|
|
663
698
|
{
|
|
664
699
|
id,
|
|
@@ -681,33 +716,33 @@ function FieldTemplate(props) {
|
|
|
681
716
|
}
|
|
682
717
|
|
|
683
718
|
// src/templates/GridTemplate.tsx
|
|
684
|
-
var
|
|
685
|
-
var
|
|
719
|
+
var import_core16 = require("@mantine/core");
|
|
720
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
686
721
|
function GridTemplate(props) {
|
|
687
722
|
const { children, column, fluid = true, ...rest } = props;
|
|
688
723
|
if (column) {
|
|
689
|
-
return /* @__PURE__ */ (0,
|
|
724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core16.Grid.Col, { ...rest, children });
|
|
690
725
|
}
|
|
691
726
|
if (fluid) {
|
|
692
|
-
return /* @__PURE__ */ (0,
|
|
727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core16.Container, { p: "4", mx: 0, w: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core16.Grid, { ...rest, children }) });
|
|
693
728
|
}
|
|
694
|
-
return /* @__PURE__ */ (0,
|
|
729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core16.Grid, { grow: true, ...rest, children });
|
|
695
730
|
}
|
|
696
731
|
|
|
697
732
|
// src/templates/MultiSchemaFieldTemplate.tsx
|
|
698
|
-
var
|
|
699
|
-
var
|
|
733
|
+
var import_core17 = require("@mantine/core");
|
|
734
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
700
735
|
function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
|
|
701
|
-
return /* @__PURE__ */ (0,
|
|
736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core17.Stack, { style: { marginBottom: "1rem" }, children: [
|
|
702
737
|
selector,
|
|
703
738
|
optionSchemaField
|
|
704
739
|
] });
|
|
705
740
|
}
|
|
706
741
|
|
|
707
742
|
// src/templates/ObjectFieldTemplate.tsx
|
|
708
|
-
var
|
|
709
|
-
var
|
|
710
|
-
var
|
|
743
|
+
var import_core18 = require("@mantine/core");
|
|
744
|
+
var import_utils14 = require("@rjsf/utils");
|
|
745
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
711
746
|
function ObjectFieldTemplate(props) {
|
|
712
747
|
const {
|
|
713
748
|
title,
|
|
@@ -724,9 +759,9 @@ function ObjectFieldTemplate(props) {
|
|
|
724
759
|
formData,
|
|
725
760
|
registry
|
|
726
761
|
} = props;
|
|
727
|
-
const uiOptions = (0,
|
|
728
|
-
const TitleFieldTemplate = (0,
|
|
729
|
-
const DescriptionFieldTemplate = (0,
|
|
762
|
+
const uiOptions = (0, import_utils14.getUiOptions)(uiSchema);
|
|
763
|
+
const TitleFieldTemplate = (0, import_utils14.getTemplate)("TitleFieldTemplate", registry, uiOptions);
|
|
764
|
+
const DescriptionFieldTemplate = (0, import_utils14.getTemplate)(
|
|
730
765
|
"DescriptionFieldTemplate",
|
|
731
766
|
registry,
|
|
732
767
|
uiOptions
|
|
@@ -738,11 +773,11 @@ function ObjectFieldTemplate(props) {
|
|
|
738
773
|
const gridCols = typeof uiOptions?.gridCols === "number" && uiOptions?.gridCols || void 0;
|
|
739
774
|
const gridSpacing = uiOptions?.gridSpacing;
|
|
740
775
|
const gridVerticalSpacing = uiOptions?.gridVerticalSpacing;
|
|
741
|
-
return /* @__PURE__ */ (0,
|
|
742
|
-
title && /* @__PURE__ */ (0,
|
|
776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core18.Container, { id: fieldPathId.$id, p: 0, children: [
|
|
777
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
743
778
|
TitleFieldTemplate,
|
|
744
779
|
{
|
|
745
|
-
id: (0,
|
|
780
|
+
id: (0, import_utils14.titleId)(fieldPathId),
|
|
746
781
|
title,
|
|
747
782
|
required,
|
|
748
783
|
schema,
|
|
@@ -751,18 +786,18 @@ function ObjectFieldTemplate(props) {
|
|
|
751
786
|
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
752
787
|
}
|
|
753
788
|
),
|
|
754
|
-
description && /* @__PURE__ */ (0,
|
|
789
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
755
790
|
DescriptionFieldTemplate,
|
|
756
791
|
{
|
|
757
|
-
id: (0,
|
|
792
|
+
id: (0, import_utils14.descriptionId)(fieldPathId),
|
|
758
793
|
description,
|
|
759
794
|
schema,
|
|
760
795
|
uiSchema,
|
|
761
796
|
registry
|
|
762
797
|
}
|
|
763
798
|
),
|
|
764
|
-
/* @__PURE__ */ (0,
|
|
765
|
-
|
|
799
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
800
|
+
import_core18.SimpleGrid,
|
|
766
801
|
{
|
|
767
802
|
cols: gridCols,
|
|
768
803
|
spacing: gridSpacing,
|
|
@@ -770,14 +805,14 @@ function ObjectFieldTemplate(props) {
|
|
|
770
805
|
mb: "sm",
|
|
771
806
|
children: [
|
|
772
807
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
773
|
-
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ (0,
|
|
808
|
+
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core18.Box, { children: element.content }, element.name))
|
|
774
809
|
]
|
|
775
810
|
}
|
|
776
811
|
),
|
|
777
|
-
(0,
|
|
812
|
+
(0, import_utils14.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core18.Group, { mt: "xs", justify: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
778
813
|
AddButton2,
|
|
779
814
|
{
|
|
780
|
-
id: (0,
|
|
815
|
+
id: (0, import_utils14.buttonId)(fieldPathId, "add"),
|
|
781
816
|
disabled: disabled || readonly,
|
|
782
817
|
onClick: onAddProperty,
|
|
783
818
|
className: "rjsf-object-property-expand",
|
|
@@ -789,11 +824,11 @@ function ObjectFieldTemplate(props) {
|
|
|
789
824
|
}
|
|
790
825
|
|
|
791
826
|
// src/templates/OptionalDataControlsTemplate.tsx
|
|
792
|
-
var
|
|
827
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
793
828
|
function OptionalDataControlsTemplate(props) {
|
|
794
829
|
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
795
830
|
if (onAddClick) {
|
|
796
|
-
return /* @__PURE__ */ (0,
|
|
831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
797
832
|
AddButton,
|
|
798
833
|
{
|
|
799
834
|
id,
|
|
@@ -804,8 +839,9 @@ function OptionalDataControlsTemplate(props) {
|
|
|
804
839
|
title: label
|
|
805
840
|
}
|
|
806
841
|
);
|
|
807
|
-
}
|
|
808
|
-
|
|
842
|
+
}
|
|
843
|
+
if (onRemoveClick) {
|
|
844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
809
845
|
RemoveButton,
|
|
810
846
|
{
|
|
811
847
|
id,
|
|
@@ -817,28 +853,28 @@ function OptionalDataControlsTemplate(props) {
|
|
|
817
853
|
}
|
|
818
854
|
);
|
|
819
855
|
}
|
|
820
|
-
return /* @__PURE__ */ (0,
|
|
856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("em", { id, children: label });
|
|
821
857
|
}
|
|
822
858
|
|
|
823
859
|
// src/templates/TitleField.tsx
|
|
824
|
-
var
|
|
825
|
-
var
|
|
860
|
+
var import_core19 = require("@mantine/core");
|
|
861
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
826
862
|
function TitleField(props) {
|
|
827
863
|
const { id, title, optionalDataControl } = props;
|
|
828
|
-
let heading = title ? /* @__PURE__ */ (0,
|
|
864
|
+
let heading = title ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core19.Title, { id, order: 3, fw: "normal", children: title }) : null;
|
|
829
865
|
if (optionalDataControl) {
|
|
830
|
-
heading = /* @__PURE__ */ (0,
|
|
831
|
-
/* @__PURE__ */ (0,
|
|
832
|
-
/* @__PURE__ */ (0,
|
|
866
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core19.Grid, { children: [
|
|
867
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core19.Grid.Col, { span: "auto", children: heading }),
|
|
868
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core19.Grid.Col, { span: "content", children: optionalDataControl })
|
|
833
869
|
] });
|
|
834
870
|
}
|
|
835
871
|
return heading;
|
|
836
872
|
}
|
|
837
873
|
|
|
838
874
|
// src/templates/WrapIfAdditionalTemplate.tsx
|
|
839
|
-
var
|
|
840
|
-
var
|
|
841
|
-
var
|
|
875
|
+
var import_core20 = require("@mantine/core");
|
|
876
|
+
var import_utils15 = require("@rjsf/utils");
|
|
877
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
842
878
|
function WrapIfAdditionalTemplate(props) {
|
|
843
879
|
const {
|
|
844
880
|
id,
|
|
@@ -859,20 +895,20 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
859
895
|
} = props;
|
|
860
896
|
const { templates, translateString } = registry;
|
|
861
897
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
862
|
-
const keyLabel = translateString(
|
|
863
|
-
const additional =
|
|
898
|
+
const keyLabel = translateString(import_utils15.TranslatableString.KeyLabel, [label]);
|
|
899
|
+
const additional = import_utils15.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
864
900
|
if (!additional) {
|
|
865
|
-
return /* @__PURE__ */ (0,
|
|
901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: classNames, style, children });
|
|
866
902
|
}
|
|
867
|
-
const uiOptions = uiSchema ? uiSchema[
|
|
903
|
+
const uiOptions = uiSchema ? uiSchema[import_utils15.UI_OPTIONS_KEY] : {};
|
|
868
904
|
const buttonUiOptions = {
|
|
869
905
|
...uiSchema,
|
|
870
|
-
[
|
|
906
|
+
[import_utils15.UI_OPTIONS_KEY]: { ...uiOptions, block: true }
|
|
871
907
|
};
|
|
872
|
-
return /* @__PURE__ */ (0,
|
|
873
|
-
/* @__PURE__ */ (0,
|
|
874
|
-
/* @__PURE__ */ (0,
|
|
875
|
-
|
|
908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: classNames, style, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core20.Flex, { gap: "xs", align: "end", justify: "center", children: [
|
|
909
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core20.Grid, { w: "100%", align: "center", children: [
|
|
910
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core20.Grid.Col, { span: 6, className: "form-additional", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
911
|
+
import_core20.TextInput,
|
|
876
912
|
{
|
|
877
913
|
className: "form-group",
|
|
878
914
|
label: displayLabel ? keyLabel : void 0,
|
|
@@ -886,12 +922,12 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
886
922
|
},
|
|
887
923
|
label
|
|
888
924
|
) }),
|
|
889
|
-
/* @__PURE__ */ (0,
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core20.Grid.Col, { span: 6, className: "form-additional", children })
|
|
890
926
|
] }),
|
|
891
|
-
/* @__PURE__ */ (0,
|
|
927
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
892
928
|
RemoveButton2,
|
|
893
929
|
{
|
|
894
|
-
id: (0,
|
|
930
|
+
id: (0, import_utils15.buttonId)(id, "remove"),
|
|
895
931
|
iconType: "sm",
|
|
896
932
|
className: "rjsf-array-item-remove",
|
|
897
933
|
disabled: disabled || readonly,
|
|
@@ -910,6 +946,7 @@ function generateTemplates() {
|
|
|
910
946
|
ArrayFieldTemplate,
|
|
911
947
|
ArrayFieldTitleTemplate,
|
|
912
948
|
BaseInputTemplate,
|
|
949
|
+
CyclicSchemaExpandTemplate,
|
|
913
950
|
ButtonTemplates: ButtonTemplates_default(),
|
|
914
951
|
DescriptionFieldTemplate: DescriptionField,
|
|
915
952
|
ErrorListTemplate: ErrorList,
|
|
@@ -931,10 +968,10 @@ var import_dayjs2 = __toESM(require("dayjs"), 1);
|
|
|
931
968
|
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"), 1);
|
|
932
969
|
|
|
933
970
|
// src/widgets/CheckboxesWidget.tsx
|
|
934
|
-
var
|
|
935
|
-
var
|
|
936
|
-
var
|
|
937
|
-
var
|
|
971
|
+
var import_react3 = require("react");
|
|
972
|
+
var import_core21 = require("@mantine/core");
|
|
973
|
+
var import_utils16 = require("@rjsf/utils");
|
|
974
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
938
975
|
function CheckboxesWidget(props) {
|
|
939
976
|
const {
|
|
940
977
|
id,
|
|
@@ -953,37 +990,37 @@ function CheckboxesWidget(props) {
|
|
|
953
990
|
onFocus
|
|
954
991
|
} = props;
|
|
955
992
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
956
|
-
const optionValueFormat = (0,
|
|
993
|
+
const optionValueFormat = (0, import_utils16.getOptionValueFormat)(options);
|
|
957
994
|
const themeProps = cleanupOptions(options);
|
|
958
|
-
const handleChange = (0,
|
|
995
|
+
const handleChange = (0, import_react3.useCallback)(
|
|
959
996
|
(nextValue) => {
|
|
960
997
|
if (!disabled && !readonly && onChange) {
|
|
961
|
-
onChange((0,
|
|
998
|
+
onChange((0, import_utils16.enumOptionValueDecoder)(nextValue, enumOptions, optionValueFormat, emptyValue));
|
|
962
999
|
}
|
|
963
1000
|
},
|
|
964
1001
|
[onChange, disabled, readonly, enumOptions, emptyValue, optionValueFormat]
|
|
965
1002
|
);
|
|
966
|
-
const handleBlur = (0,
|
|
1003
|
+
const handleBlur = (0, import_react3.useCallback)(
|
|
967
1004
|
({ target }) => {
|
|
968
1005
|
if (onBlur) {
|
|
969
|
-
onBlur(id, (0,
|
|
1006
|
+
onBlur(id, (0, import_utils16.enumOptionValueDecoder)(target.value, enumOptions, optionValueFormat, emptyValue));
|
|
970
1007
|
}
|
|
971
1008
|
},
|
|
972
1009
|
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
973
1010
|
);
|
|
974
|
-
const handleFocus = (0,
|
|
1011
|
+
const handleFocus = (0, import_react3.useCallback)(
|
|
975
1012
|
({ target }) => {
|
|
976
1013
|
if (onFocus) {
|
|
977
|
-
onFocus(id, (0,
|
|
1014
|
+
onFocus(id, (0, import_utils16.enumOptionValueDecoder)(target.value, enumOptions, optionValueFormat, emptyValue));
|
|
978
1015
|
}
|
|
979
1016
|
},
|
|
980
1017
|
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
981
1018
|
);
|
|
982
|
-
const selectedIndexes = (0,
|
|
983
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0,
|
|
984
|
-
!hideLabel && !!label && /* @__PURE__ */ (0,
|
|
985
|
-
/* @__PURE__ */ (0,
|
|
986
|
-
|
|
1019
|
+
const selectedIndexes = (0, import_utils16.enumOptionsIndexForValue)(value, enumOptions, true);
|
|
1020
|
+
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1021
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core21.Input.Label, { id: (0, import_utils16.titleId)(id), required, children: label }),
|
|
1022
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1023
|
+
import_core21.Checkbox.Group,
|
|
987
1024
|
{
|
|
988
1025
|
id,
|
|
989
1026
|
value: selectedIndexes,
|
|
@@ -991,21 +1028,21 @@ function CheckboxesWidget(props) {
|
|
|
991
1028
|
required,
|
|
992
1029
|
readOnly: disabled || readonly,
|
|
993
1030
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
994
|
-
"aria-describedby": (0,
|
|
1031
|
+
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id),
|
|
995
1032
|
...themeProps,
|
|
996
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0,
|
|
997
|
-
|
|
1033
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core21.Flex, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1034
|
+
import_core21.Checkbox,
|
|
998
1035
|
{
|
|
999
|
-
id: (0,
|
|
1036
|
+
id: (0, import_utils16.optionId)(id, i),
|
|
1000
1037
|
name: htmlName || id,
|
|
1001
|
-
value: (0,
|
|
1038
|
+
value: (0, import_utils16.enumOptionValueEncoder)(option.value, i, optionValueFormat),
|
|
1002
1039
|
label: option.label,
|
|
1003
|
-
disabled: Array.isArray(enumDisabled) && enumDisabled.
|
|
1040
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.includes(option.value),
|
|
1004
1041
|
autoFocus: i === 0 && autofocus,
|
|
1005
1042
|
onBlur: handleBlur,
|
|
1006
1043
|
onFocus: handleFocus
|
|
1007
1044
|
},
|
|
1008
|
-
|
|
1045
|
+
String(option.value)
|
|
1009
1046
|
)) }) : null
|
|
1010
1047
|
}
|
|
1011
1048
|
)
|
|
@@ -1013,10 +1050,10 @@ function CheckboxesWidget(props) {
|
|
|
1013
1050
|
}
|
|
1014
1051
|
|
|
1015
1052
|
// src/widgets/CheckboxWidget.tsx
|
|
1016
|
-
var
|
|
1017
|
-
var
|
|
1018
|
-
var
|
|
1019
|
-
var
|
|
1053
|
+
var import_react4 = require("react");
|
|
1054
|
+
var import_core22 = require("@mantine/core");
|
|
1055
|
+
var import_utils18 = require("@rjsf/utils");
|
|
1056
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1020
1057
|
function CheckboxWidget(props) {
|
|
1021
1058
|
const {
|
|
1022
1059
|
id,
|
|
@@ -1038,12 +1075,12 @@ function CheckboxWidget(props) {
|
|
|
1038
1075
|
registry,
|
|
1039
1076
|
uiSchema
|
|
1040
1077
|
} = props;
|
|
1041
|
-
const DescriptionFieldTemplate = (0,
|
|
1078
|
+
const DescriptionFieldTemplate = (0, import_utils18.getTemplate)(
|
|
1042
1079
|
"DescriptionFieldTemplate",
|
|
1043
1080
|
registry,
|
|
1044
1081
|
options
|
|
1045
1082
|
);
|
|
1046
|
-
const handleCheckboxChange = (0,
|
|
1083
|
+
const handleCheckboxChange = (0, import_react4.useCallback)(
|
|
1047
1084
|
(e) => {
|
|
1048
1085
|
if (!disabled && !readonly && onChange) {
|
|
1049
1086
|
onChange(e.currentTarget.checked);
|
|
@@ -1051,7 +1088,7 @@ function CheckboxWidget(props) {
|
|
|
1051
1088
|
},
|
|
1052
1089
|
[onChange, disabled, readonly]
|
|
1053
1090
|
);
|
|
1054
|
-
const handleBlur = (0,
|
|
1091
|
+
const handleBlur = (0, import_react4.useCallback)(
|
|
1055
1092
|
({ target }) => {
|
|
1056
1093
|
if (onBlur) {
|
|
1057
1094
|
onBlur(id, target.checked);
|
|
@@ -1059,7 +1096,7 @@ function CheckboxWidget(props) {
|
|
|
1059
1096
|
},
|
|
1060
1097
|
[onBlur, id]
|
|
1061
1098
|
);
|
|
1062
|
-
const handleFocus = (0,
|
|
1099
|
+
const handleFocus = (0, import_react4.useCallback)(
|
|
1063
1100
|
({ target }) => {
|
|
1064
1101
|
if (onFocus) {
|
|
1065
1102
|
onFocus(id, target.checked);
|
|
@@ -1068,23 +1105,23 @@ function CheckboxWidget(props) {
|
|
|
1068
1105
|
[onFocus, id]
|
|
1069
1106
|
);
|
|
1070
1107
|
const description = options.description || schema.description;
|
|
1071
|
-
return /* @__PURE__ */ (0,
|
|
1072
|
-
!hideLabel && !!description && /* @__PURE__ */ (0,
|
|
1108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
1109
|
+
!hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1073
1110
|
DescriptionFieldTemplate,
|
|
1074
1111
|
{
|
|
1075
|
-
id: (0,
|
|
1112
|
+
id: (0, import_utils18.descriptionId)(id),
|
|
1076
1113
|
description,
|
|
1077
1114
|
schema,
|
|
1078
1115
|
uiSchema,
|
|
1079
1116
|
registry
|
|
1080
1117
|
}
|
|
1081
1118
|
),
|
|
1082
|
-
/* @__PURE__ */ (0,
|
|
1083
|
-
|
|
1119
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1120
|
+
import_core22.Checkbox,
|
|
1084
1121
|
{
|
|
1085
1122
|
id,
|
|
1086
1123
|
name: htmlName || name,
|
|
1087
|
-
label: (0,
|
|
1124
|
+
label: (0, import_utils18.labelValue)(label || void 0, hideLabel, false),
|
|
1088
1125
|
disabled: disabled || readonly,
|
|
1089
1126
|
required,
|
|
1090
1127
|
autoFocus: autofocus,
|
|
@@ -1093,17 +1130,17 @@ function CheckboxWidget(props) {
|
|
|
1093
1130
|
onBlur: handleBlur,
|
|
1094
1131
|
onFocus: handleFocus,
|
|
1095
1132
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1096
|
-
"aria-describedby": (0,
|
|
1133
|
+
"aria-describedby": (0, import_utils18.ariaDescribedByIds)(id)
|
|
1097
1134
|
}
|
|
1098
1135
|
)
|
|
1099
1136
|
] });
|
|
1100
1137
|
}
|
|
1101
1138
|
|
|
1102
1139
|
// src/widgets/ColorWidget.tsx
|
|
1103
|
-
var
|
|
1104
|
-
var
|
|
1105
|
-
var
|
|
1106
|
-
var
|
|
1140
|
+
var import_react5 = require("react");
|
|
1141
|
+
var import_core23 = require("@mantine/core");
|
|
1142
|
+
var import_utils19 = require("@rjsf/utils");
|
|
1143
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1107
1144
|
function ColorWidget(props) {
|
|
1108
1145
|
const {
|
|
1109
1146
|
id,
|
|
@@ -1123,30 +1160,30 @@ function ColorWidget(props) {
|
|
|
1123
1160
|
onFocus
|
|
1124
1161
|
} = props;
|
|
1125
1162
|
const themeProps = cleanupOptions(options);
|
|
1126
|
-
const handleChange = (0,
|
|
1163
|
+
const handleChange = (0, import_react5.useCallback)(
|
|
1127
1164
|
(nextValue) => {
|
|
1128
1165
|
onChange(nextValue);
|
|
1129
1166
|
},
|
|
1130
1167
|
[onChange]
|
|
1131
1168
|
);
|
|
1132
|
-
const handleBlur = (0,
|
|
1169
|
+
const handleBlur = (0, import_react5.useCallback)(
|
|
1133
1170
|
({ target }) => {
|
|
1134
1171
|
if (onBlur) {
|
|
1135
|
-
onBlur(id, target
|
|
1172
|
+
onBlur(id, target?.value);
|
|
1136
1173
|
}
|
|
1137
1174
|
},
|
|
1138
1175
|
[onBlur, id]
|
|
1139
1176
|
);
|
|
1140
|
-
const handleFocus = (0,
|
|
1177
|
+
const handleFocus = (0, import_react5.useCallback)(
|
|
1141
1178
|
({ target }) => {
|
|
1142
1179
|
if (onFocus) {
|
|
1143
|
-
onFocus(id, target
|
|
1180
|
+
onFocus(id, target?.value);
|
|
1144
1181
|
}
|
|
1145
1182
|
},
|
|
1146
1183
|
[onFocus, id]
|
|
1147
1184
|
);
|
|
1148
|
-
return /* @__PURE__ */ (0,
|
|
1149
|
-
|
|
1185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1186
|
+
import_core23.ColorInput,
|
|
1150
1187
|
{
|
|
1151
1188
|
id,
|
|
1152
1189
|
name,
|
|
@@ -1155,70 +1192,76 @@ function ColorWidget(props) {
|
|
|
1155
1192
|
required,
|
|
1156
1193
|
disabled: disabled || readonly,
|
|
1157
1194
|
autoFocus: autofocus,
|
|
1158
|
-
label: (0,
|
|
1195
|
+
label: (0, import_utils19.labelValue)(label || void 0, hideLabel, false),
|
|
1159
1196
|
onChange: handleChange,
|
|
1160
1197
|
onBlur: handleBlur,
|
|
1161
1198
|
onFocus: handleFocus,
|
|
1162
1199
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1163
1200
|
...themeProps,
|
|
1164
|
-
"aria-describedby": (0,
|
|
1201
|
+
"aria-describedby": (0, import_utils19.ariaDescribedByIds)(id),
|
|
1165
1202
|
popoverProps: { withinPortal: false }
|
|
1166
1203
|
}
|
|
1167
1204
|
);
|
|
1168
1205
|
}
|
|
1169
1206
|
|
|
1170
1207
|
// src/widgets/DateTime/AltDateTimeWidget.tsx
|
|
1171
|
-
var
|
|
1208
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1172
1209
|
function AltDateTimeWidget(props) {
|
|
1173
1210
|
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
1174
|
-
return /* @__PURE__ */ (0,
|
|
1211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AltDateWidget2, { time: true, ...props });
|
|
1175
1212
|
}
|
|
1176
1213
|
|
|
1177
1214
|
// src/widgets/DateTime/AltDateWidget.tsx
|
|
1178
|
-
var
|
|
1179
|
-
var
|
|
1180
|
-
var
|
|
1215
|
+
var import_core24 = require("@mantine/core");
|
|
1216
|
+
var import_utils21 = require("@rjsf/utils");
|
|
1217
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1181
1218
|
function AltDateWidget(props) {
|
|
1182
1219
|
const { id, required, disabled, readonly, label, hideLabel, rawErrors, options, registry } = props;
|
|
1183
1220
|
const { translateString } = registry;
|
|
1184
|
-
const { elements, handleChange, handleClear, handleSetNow } = (0,
|
|
1185
|
-
return /* @__PURE__ */ (0,
|
|
1186
|
-
!hideLabel && !!label && /* @__PURE__ */ (0,
|
|
1187
|
-
/* @__PURE__ */ (0,
|
|
1221
|
+
const { elements, handleChange, handleClear, handleSetNow } = (0, import_utils21.useAltDateWidgetProps)(props);
|
|
1222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
1223
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core24.Input.Label, { id: (0, import_utils21.titleId)(id), required, children: label }),
|
|
1224
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core24.Flex, { gap: "xs", align: "center", wrap: "nowrap", children: [
|
|
1188
1225
|
elements.map((elemProps, i) => {
|
|
1189
1226
|
const elemId = `${id}_${elemProps.type}`;
|
|
1190
|
-
return
|
|
1191
|
-
|
|
1192
|
-
{
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1227
|
+
return (
|
|
1228
|
+
// oxlint-disable-next-line react/no-array-index-key
|
|
1229
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core24.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1230
|
+
import_core24.Select,
|
|
1231
|
+
{
|
|
1232
|
+
id: elemId,
|
|
1233
|
+
name: elemId,
|
|
1234
|
+
placeholder: elemProps.type,
|
|
1235
|
+
disabled: disabled || readonly,
|
|
1236
|
+
data: (0, import_utils21.dateRangeOptions)(elemProps.range[0], elemProps.range[1]).map((item) => item.value.toString()),
|
|
1237
|
+
value: !elemProps.value || elemProps.value < 0 ? null : elemProps.value.toString(),
|
|
1238
|
+
onChange: (v) => handleChange(elemProps.type, v || void 0),
|
|
1239
|
+
searchable: false,
|
|
1240
|
+
allowDeselect: false,
|
|
1241
|
+
comboboxProps: { withinPortal: false },
|
|
1242
|
+
"aria-describedby": (0, import_utils21.ariaDescribedByIds)(elemId)
|
|
1243
|
+
}
|
|
1244
|
+
) }, i)
|
|
1245
|
+
);
|
|
1206
1246
|
}),
|
|
1207
|
-
/* @__PURE__ */ (0,
|
|
1208
|
-
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0,
|
|
1209
|
-
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0,
|
|
1247
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_core24.Group, { wrap: "nowrap", gap: 3, children: [
|
|
1248
|
+
(options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core24.Button, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(import_utils21.TranslatableString.NowLabel) }),
|
|
1249
|
+
(options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core24.Button, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(import_utils21.TranslatableString.ClearLabel) })
|
|
1210
1250
|
] })
|
|
1211
1251
|
] }),
|
|
1212
|
-
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) =>
|
|
1252
|
+
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => (
|
|
1253
|
+
// oxlint-disable-next-line react/no-array-index-key
|
|
1254
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core24.Input.Error, { children: error }, `alt-date-widget-input-errors-${index}`)
|
|
1255
|
+
))
|
|
1213
1256
|
] });
|
|
1214
1257
|
}
|
|
1215
1258
|
|
|
1216
1259
|
// src/widgets/DateTime/DateTimeInput.tsx
|
|
1217
|
-
var
|
|
1260
|
+
var import_react6 = require("react");
|
|
1218
1261
|
var import_dates = require("@mantine/dates");
|
|
1219
|
-
var
|
|
1262
|
+
var import_utils22 = require("@rjsf/utils");
|
|
1220
1263
|
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
1221
|
-
var
|
|
1264
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1222
1265
|
var dateParser = (input, format) => {
|
|
1223
1266
|
if (!input) {
|
|
1224
1267
|
return null;
|
|
@@ -1252,23 +1295,23 @@ function DateTimeInput(props) {
|
|
|
1252
1295
|
valueFormat,
|
|
1253
1296
|
displayFormat
|
|
1254
1297
|
} = props;
|
|
1255
|
-
const handleChange = (0,
|
|
1298
|
+
const handleChange = (0, import_react6.useCallback)(
|
|
1256
1299
|
(nextValue) => {
|
|
1257
1300
|
onChange(dateFormat(nextValue, valueFormat));
|
|
1258
1301
|
},
|
|
1259
1302
|
[onChange, valueFormat]
|
|
1260
1303
|
);
|
|
1261
|
-
const handleBlur = (0,
|
|
1304
|
+
const handleBlur = (0, import_react6.useCallback)(() => {
|
|
1262
1305
|
if (onBlur) {
|
|
1263
1306
|
onBlur(id, value);
|
|
1264
1307
|
}
|
|
1265
1308
|
}, [onBlur, id, value]);
|
|
1266
|
-
const handleFocus = (0,
|
|
1309
|
+
const handleFocus = (0, import_react6.useCallback)(() => {
|
|
1267
1310
|
if (onFocus) {
|
|
1268
1311
|
onFocus(id, value);
|
|
1269
1312
|
}
|
|
1270
1313
|
}, [onFocus, id, value]);
|
|
1271
|
-
return /* @__PURE__ */ (0,
|
|
1314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1272
1315
|
import_dates.DateInput,
|
|
1273
1316
|
{
|
|
1274
1317
|
id,
|
|
@@ -1279,13 +1322,13 @@ function DateTimeInput(props) {
|
|
|
1279
1322
|
required,
|
|
1280
1323
|
disabled: disabled || readonly,
|
|
1281
1324
|
autoFocus: autofocus,
|
|
1282
|
-
label: (0,
|
|
1325
|
+
label: (0, import_utils22.labelValue)(label || void 0, hideLabel, false),
|
|
1283
1326
|
onChange: handleChange,
|
|
1284
1327
|
onBlur: handleBlur,
|
|
1285
1328
|
onFocus: handleFocus,
|
|
1286
1329
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1287
1330
|
...options,
|
|
1288
|
-
"aria-describedby": (0,
|
|
1331
|
+
"aria-describedby": (0, import_utils22.ariaDescribedByIds)(id),
|
|
1289
1332
|
popoverProps: { withinPortal: false },
|
|
1290
1333
|
classNames: typeof options?.classNames === "object" ? options.classNames : void 0,
|
|
1291
1334
|
valueFormat: displayFormat
|
|
@@ -1294,10 +1337,10 @@ function DateTimeInput(props) {
|
|
|
1294
1337
|
}
|
|
1295
1338
|
|
|
1296
1339
|
// src/widgets/DateTime/DateWidget.tsx
|
|
1297
|
-
var
|
|
1340
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1298
1341
|
function DateWidget(props) {
|
|
1299
1342
|
const { valueFormat = "YYYY-MM-DD", displayFormat, ...otherOptions } = props.options;
|
|
1300
|
-
return /* @__PURE__ */ (0,
|
|
1343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1301
1344
|
DateTimeInput,
|
|
1302
1345
|
{
|
|
1303
1346
|
...props,
|
|
@@ -1309,10 +1352,10 @@ function DateWidget(props) {
|
|
|
1309
1352
|
}
|
|
1310
1353
|
|
|
1311
1354
|
// src/widgets/DateTime/DateTimeWidget.tsx
|
|
1312
|
-
var
|
|
1355
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1313
1356
|
function DateTimeWidget(props) {
|
|
1314
1357
|
const { valueFormat = "YYYY-MM-DD HH:mm:ss", displayFormat, ...otherOptions } = props.options;
|
|
1315
|
-
return /* @__PURE__ */ (0,
|
|
1358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1316
1359
|
DateTimeInput,
|
|
1317
1360
|
{
|
|
1318
1361
|
...props,
|
|
@@ -1324,10 +1367,10 @@ function DateTimeWidget(props) {
|
|
|
1324
1367
|
}
|
|
1325
1368
|
|
|
1326
1369
|
// src/widgets/DateTime/TimeWidget.tsx
|
|
1327
|
-
var
|
|
1370
|
+
var import_react7 = require("react");
|
|
1328
1371
|
var import_dates2 = require("@mantine/dates");
|
|
1329
|
-
var
|
|
1330
|
-
var
|
|
1372
|
+
var import_utils23 = require("@rjsf/utils");
|
|
1373
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1331
1374
|
function TimeWidget(props) {
|
|
1332
1375
|
const {
|
|
1333
1376
|
id,
|
|
@@ -1347,29 +1390,29 @@ function TimeWidget(props) {
|
|
|
1347
1390
|
onFocus
|
|
1348
1391
|
} = props;
|
|
1349
1392
|
const emptyValue = options.emptyValue || "";
|
|
1350
|
-
const handleChange = (0,
|
|
1393
|
+
const handleChange = (0, import_react7.useCallback)(
|
|
1351
1394
|
(e) => {
|
|
1352
1395
|
onChange(e.target.value === "" ? emptyValue : e.target.value);
|
|
1353
1396
|
},
|
|
1354
1397
|
[onChange, emptyValue]
|
|
1355
1398
|
);
|
|
1356
|
-
const handleBlur = (0,
|
|
1399
|
+
const handleBlur = (0, import_react7.useCallback)(
|
|
1357
1400
|
({ target }) => {
|
|
1358
1401
|
if (onBlur) {
|
|
1359
|
-
onBlur(id, target
|
|
1402
|
+
onBlur(id, target?.value);
|
|
1360
1403
|
}
|
|
1361
1404
|
},
|
|
1362
1405
|
[onBlur, id]
|
|
1363
1406
|
);
|
|
1364
|
-
const handleFocus = (0,
|
|
1407
|
+
const handleFocus = (0, import_react7.useCallback)(
|
|
1365
1408
|
({ target }) => {
|
|
1366
1409
|
if (onFocus) {
|
|
1367
|
-
onFocus(id, target
|
|
1410
|
+
onFocus(id, target?.value);
|
|
1368
1411
|
}
|
|
1369
1412
|
},
|
|
1370
1413
|
[onFocus, id]
|
|
1371
1414
|
);
|
|
1372
|
-
return /* @__PURE__ */ (0,
|
|
1415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1373
1416
|
import_dates2.TimeInput,
|
|
1374
1417
|
{
|
|
1375
1418
|
id,
|
|
@@ -1379,23 +1422,26 @@ function TimeWidget(props) {
|
|
|
1379
1422
|
required,
|
|
1380
1423
|
disabled: disabled || readonly,
|
|
1381
1424
|
autoFocus: autofocus,
|
|
1382
|
-
label: (0,
|
|
1425
|
+
label: (0, import_utils23.labelValue)(label || void 0, hideLabel, false),
|
|
1383
1426
|
onChange: handleChange,
|
|
1384
1427
|
onBlur: handleBlur,
|
|
1385
1428
|
onFocus: handleFocus,
|
|
1386
1429
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1387
1430
|
...options,
|
|
1388
|
-
"aria-describedby": (0,
|
|
1431
|
+
"aria-describedby": (0, import_utils23.ariaDescribedByIds)(id),
|
|
1389
1432
|
classNames: typeof options?.classNames === "object" ? options.classNames : void 0
|
|
1390
1433
|
}
|
|
1391
1434
|
);
|
|
1392
1435
|
}
|
|
1393
1436
|
|
|
1394
1437
|
// src/widgets/FileWidget.tsx
|
|
1395
|
-
var
|
|
1396
|
-
var
|
|
1397
|
-
var
|
|
1398
|
-
var
|
|
1438
|
+
var import_react8 = require("react");
|
|
1439
|
+
var import_core25 = require("@mantine/core");
|
|
1440
|
+
var import_utils24 = require("@rjsf/utils");
|
|
1441
|
+
var import_jsx_runtime30 = (
|
|
1442
|
+
// oxlint-disable-next-line react/no-array-index-key
|
|
1443
|
+
require("react/jsx-runtime")
|
|
1444
|
+
);
|
|
1399
1445
|
function FileWidget(props) {
|
|
1400
1446
|
const {
|
|
1401
1447
|
id,
|
|
@@ -1413,9 +1459,9 @@ function FileWidget(props) {
|
|
|
1413
1459
|
multiple,
|
|
1414
1460
|
onChange
|
|
1415
1461
|
} = props;
|
|
1416
|
-
const { filesInfo, handleChange, handleRemove } = (0,
|
|
1462
|
+
const { filesInfo, handleChange, handleRemove } = (0, import_utils24.useFileWidgetProps)(value, onChange, multiple);
|
|
1417
1463
|
const themeProps = cleanupOptions(options);
|
|
1418
|
-
const handleOnChange = (0,
|
|
1464
|
+
const handleOnChange = (0, import_react8.useCallback)(
|
|
1419
1465
|
(files) => {
|
|
1420
1466
|
if (typeof files === "object") {
|
|
1421
1467
|
void handleChange(files);
|
|
@@ -1423,14 +1469,14 @@ function FileWidget(props) {
|
|
|
1423
1469
|
},
|
|
1424
1470
|
[handleChange]
|
|
1425
1471
|
);
|
|
1426
|
-
const ValueComponent = (0,
|
|
1472
|
+
const ValueComponent = (0, import_react8.useCallback)(() => {
|
|
1427
1473
|
if (Array.isArray(filesInfo) && filesInfo.length > 0) {
|
|
1428
|
-
return /* @__PURE__ */ (0,
|
|
1474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core25.Pill.Group, { children: filesInfo.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core25.Pill, { withRemoveButton: true, onRemove: () => handleRemove(index), children: file.name }, index)) });
|
|
1429
1475
|
}
|
|
1430
1476
|
return null;
|
|
1431
1477
|
}, [handleRemove, filesInfo]);
|
|
1432
|
-
return /* @__PURE__ */ (0,
|
|
1433
|
-
|
|
1478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1479
|
+
import_core25.FileInput,
|
|
1434
1480
|
{
|
|
1435
1481
|
id,
|
|
1436
1482
|
name,
|
|
@@ -1439,22 +1485,22 @@ function FileWidget(props) {
|
|
|
1439
1485
|
required,
|
|
1440
1486
|
disabled: disabled || readonly,
|
|
1441
1487
|
autoFocus: autofocus,
|
|
1442
|
-
label: (0,
|
|
1488
|
+
label: (0, import_utils24.labelValue)(label || void 0, hideLabel, false),
|
|
1443
1489
|
multiple: !!multiple,
|
|
1444
1490
|
valueComponent: ValueComponent,
|
|
1445
1491
|
onChange: handleOnChange,
|
|
1446
1492
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1447
1493
|
...themeProps,
|
|
1448
|
-
"aria-describedby": (0,
|
|
1494
|
+
"aria-describedby": (0, import_utils24.ariaDescribedByIds)(id)
|
|
1449
1495
|
}
|
|
1450
1496
|
);
|
|
1451
1497
|
}
|
|
1452
1498
|
|
|
1453
1499
|
// src/widgets/PasswordWidget.tsx
|
|
1454
|
-
var
|
|
1455
|
-
var
|
|
1456
|
-
var
|
|
1457
|
-
var
|
|
1500
|
+
var import_react9 = require("react");
|
|
1501
|
+
var import_core26 = require("@mantine/core");
|
|
1502
|
+
var import_utils26 = require("@rjsf/utils");
|
|
1503
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1458
1504
|
function PasswordWidget(props) {
|
|
1459
1505
|
const {
|
|
1460
1506
|
id,
|
|
@@ -1473,32 +1519,32 @@ function PasswordWidget(props) {
|
|
|
1473
1519
|
onBlur,
|
|
1474
1520
|
onFocus
|
|
1475
1521
|
} = props;
|
|
1476
|
-
const emptyValue = options
|
|
1522
|
+
const { emptyValue } = options;
|
|
1477
1523
|
const themeProps = cleanupOptions(options);
|
|
1478
|
-
const handleChange = (0,
|
|
1524
|
+
const handleChange = (0, import_react9.useCallback)(
|
|
1479
1525
|
(e) => {
|
|
1480
1526
|
onChange(e.target.value === "" ? emptyValue : e.target.value);
|
|
1481
1527
|
},
|
|
1482
1528
|
[onChange, emptyValue]
|
|
1483
1529
|
);
|
|
1484
|
-
const handleBlur = (0,
|
|
1530
|
+
const handleBlur = (0, import_react9.useCallback)(
|
|
1485
1531
|
({ target }) => {
|
|
1486
1532
|
if (onBlur) {
|
|
1487
|
-
onBlur(id, target
|
|
1533
|
+
onBlur(id, target?.value);
|
|
1488
1534
|
}
|
|
1489
1535
|
},
|
|
1490
1536
|
[onBlur, id]
|
|
1491
1537
|
);
|
|
1492
|
-
const handleFocus = (0,
|
|
1538
|
+
const handleFocus = (0, import_react9.useCallback)(
|
|
1493
1539
|
({ target }) => {
|
|
1494
1540
|
if (onFocus) {
|
|
1495
|
-
onFocus(id, target
|
|
1541
|
+
onFocus(id, target?.value);
|
|
1496
1542
|
}
|
|
1497
1543
|
},
|
|
1498
1544
|
[onFocus, id]
|
|
1499
1545
|
);
|
|
1500
|
-
return /* @__PURE__ */ (0,
|
|
1501
|
-
|
|
1546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1547
|
+
import_core26.PasswordInput,
|
|
1502
1548
|
{
|
|
1503
1549
|
id,
|
|
1504
1550
|
name,
|
|
@@ -1507,22 +1553,22 @@ function PasswordWidget(props) {
|
|
|
1507
1553
|
required,
|
|
1508
1554
|
disabled: disabled || readonly,
|
|
1509
1555
|
autoFocus: autofocus,
|
|
1510
|
-
label: (0,
|
|
1556
|
+
label: (0, import_utils26.labelValue)(label || void 0, hideLabel, false),
|
|
1511
1557
|
onChange: handleChange,
|
|
1512
1558
|
onBlur: handleBlur,
|
|
1513
1559
|
onFocus: handleFocus,
|
|
1514
1560
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1515
1561
|
...themeProps,
|
|
1516
|
-
"aria-describedby": (0,
|
|
1562
|
+
"aria-describedby": (0, import_utils26.ariaDescribedByIds)(id)
|
|
1517
1563
|
}
|
|
1518
1564
|
);
|
|
1519
1565
|
}
|
|
1520
1566
|
|
|
1521
1567
|
// src/widgets/RadioWidget.tsx
|
|
1522
|
-
var
|
|
1523
|
-
var
|
|
1524
|
-
var
|
|
1525
|
-
var
|
|
1568
|
+
var import_react10 = require("react");
|
|
1569
|
+
var import_core27 = require("@mantine/core");
|
|
1570
|
+
var import_utils28 = require("@rjsf/utils");
|
|
1571
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1526
1572
|
function RadioWidget(props) {
|
|
1527
1573
|
const {
|
|
1528
1574
|
id,
|
|
@@ -1541,35 +1587,35 @@ function RadioWidget(props) {
|
|
|
1541
1587
|
onFocus
|
|
1542
1588
|
} = props;
|
|
1543
1589
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
1544
|
-
const optionValueFormat = (0,
|
|
1590
|
+
const optionValueFormat = (0, import_utils28.getOptionValueFormat)(options);
|
|
1545
1591
|
const themeProps = cleanupOptions(options);
|
|
1546
|
-
const handleChange = (0,
|
|
1592
|
+
const handleChange = (0, import_react10.useCallback)(
|
|
1547
1593
|
(nextValue) => {
|
|
1548
1594
|
if (!disabled && !readonly && onChange) {
|
|
1549
|
-
onChange((0,
|
|
1595
|
+
onChange((0, import_utils28.enumOptionValueDecoder)(nextValue, enumOptions, optionValueFormat, emptyValue));
|
|
1550
1596
|
}
|
|
1551
1597
|
},
|
|
1552
1598
|
[onChange, disabled, readonly, enumOptions, emptyValue, optionValueFormat]
|
|
1553
1599
|
);
|
|
1554
|
-
const handleBlur = (0,
|
|
1600
|
+
const handleBlur = (0, import_react10.useCallback)(
|
|
1555
1601
|
({ target }) => {
|
|
1556
1602
|
if (onBlur) {
|
|
1557
|
-
onBlur(id, (0,
|
|
1603
|
+
onBlur(id, (0, import_utils28.enumOptionValueDecoder)(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1558
1604
|
}
|
|
1559
1605
|
},
|
|
1560
1606
|
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
1561
1607
|
);
|
|
1562
|
-
const handleFocus = (0,
|
|
1608
|
+
const handleFocus = (0, import_react10.useCallback)(
|
|
1563
1609
|
({ target }) => {
|
|
1564
1610
|
if (onFocus) {
|
|
1565
|
-
onFocus(id, (0,
|
|
1611
|
+
onFocus(id, (0, import_utils28.enumOptionValueDecoder)(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1566
1612
|
}
|
|
1567
1613
|
},
|
|
1568
1614
|
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
1569
1615
|
);
|
|
1570
|
-
const selected = (0,
|
|
1571
|
-
return /* @__PURE__ */ (0,
|
|
1572
|
-
|
|
1616
|
+
const selected = (0, import_utils28.enumOptionsIndexForValue)(value, enumOptions);
|
|
1617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1618
|
+
import_core27.Radio.Group,
|
|
1573
1619
|
{
|
|
1574
1620
|
id,
|
|
1575
1621
|
name: htmlName || id,
|
|
@@ -1579,30 +1625,30 @@ function RadioWidget(props) {
|
|
|
1579
1625
|
required,
|
|
1580
1626
|
readOnly: disabled || readonly,
|
|
1581
1627
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1582
|
-
"aria-describedby": (0,
|
|
1628
|
+
"aria-describedby": (0, import_utils28.ariaDescribedByIds)(id),
|
|
1583
1629
|
...themeProps,
|
|
1584
|
-
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0,
|
|
1585
|
-
|
|
1630
|
+
children: Array.isArray(enumOptions) ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core27.Flex, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1631
|
+
import_core27.Radio,
|
|
1586
1632
|
{
|
|
1587
|
-
id: (0,
|
|
1588
|
-
value: (0,
|
|
1633
|
+
id: (0, import_utils28.optionId)(id, i),
|
|
1634
|
+
value: (0, import_utils28.enumOptionValueEncoder)(option.value, i, optionValueFormat),
|
|
1589
1635
|
label: option.label,
|
|
1590
|
-
disabled: Array.isArray(enumDisabled) && enumDisabled.
|
|
1636
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.includes(option.value),
|
|
1591
1637
|
autoFocus: i === 0 && autofocus,
|
|
1592
1638
|
onBlur: handleBlur,
|
|
1593
1639
|
onFocus: handleFocus
|
|
1594
1640
|
},
|
|
1595
|
-
|
|
1641
|
+
String(option.value)
|
|
1596
1642
|
)) }) : null
|
|
1597
1643
|
}
|
|
1598
1644
|
);
|
|
1599
1645
|
}
|
|
1600
1646
|
|
|
1601
1647
|
// src/widgets/RangeWidget.tsx
|
|
1602
|
-
var
|
|
1603
|
-
var
|
|
1604
|
-
var
|
|
1605
|
-
var
|
|
1648
|
+
var import_react11 = require("react");
|
|
1649
|
+
var import_core28 = require("@mantine/core");
|
|
1650
|
+
var import_utils30 = require("@rjsf/utils");
|
|
1651
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1606
1652
|
function RangeWidget(props) {
|
|
1607
1653
|
const {
|
|
1608
1654
|
id,
|
|
@@ -1622,8 +1668,8 @@ function RangeWidget(props) {
|
|
|
1622
1668
|
schema
|
|
1623
1669
|
} = props;
|
|
1624
1670
|
const themeProps = cleanupOptions(options);
|
|
1625
|
-
const { min, max, step } = (0,
|
|
1626
|
-
const handleChange = (0,
|
|
1671
|
+
const { min, max, step } = (0, import_utils30.rangeSpec)(schema);
|
|
1672
|
+
const handleChange = (0, import_react11.useCallback)(
|
|
1627
1673
|
(nextValue) => {
|
|
1628
1674
|
if (!disabled && !readonly && onChange) {
|
|
1629
1675
|
onChange(nextValue);
|
|
@@ -1631,21 +1677,21 @@ function RangeWidget(props) {
|
|
|
1631
1677
|
},
|
|
1632
1678
|
[onChange, disabled, readonly]
|
|
1633
1679
|
);
|
|
1634
|
-
const handleBlur = (0,
|
|
1680
|
+
const handleBlur = (0, import_react11.useCallback)(() => {
|
|
1635
1681
|
if (onBlur) {
|
|
1636
1682
|
onBlur(id, value);
|
|
1637
1683
|
}
|
|
1638
1684
|
}, [onBlur, id, value]);
|
|
1639
|
-
const handleFocus = (0,
|
|
1685
|
+
const handleFocus = (0, import_react11.useCallback)(() => {
|
|
1640
1686
|
if (onFocus) {
|
|
1641
1687
|
onFocus(id, value);
|
|
1642
1688
|
}
|
|
1643
1689
|
}, [onFocus, id, value]);
|
|
1644
|
-
return /* @__PURE__ */ (0,
|
|
1645
|
-
!hideLabel && !!label && /* @__PURE__ */ (0,
|
|
1646
|
-
options?.description && /* @__PURE__ */ (0,
|
|
1647
|
-
/* @__PURE__ */ (0,
|
|
1648
|
-
|
|
1690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
1691
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core28.Input.Label, { id: (0, import_utils30.titleId)(id), required, children: label }),
|
|
1692
|
+
options?.description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core28.Input.Description, { children: options.description }),
|
|
1693
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1694
|
+
import_core28.Slider,
|
|
1649
1695
|
{
|
|
1650
1696
|
id,
|
|
1651
1697
|
name,
|
|
@@ -1659,18 +1705,21 @@ function RangeWidget(props) {
|
|
|
1659
1705
|
onBlur: handleBlur,
|
|
1660
1706
|
onFocus: handleFocus,
|
|
1661
1707
|
...themeProps,
|
|
1662
|
-
"aria-describedby": (0,
|
|
1708
|
+
"aria-describedby": (0, import_utils30.ariaDescribedByIds)(id)
|
|
1663
1709
|
}
|
|
1664
1710
|
),
|
|
1665
|
-
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) =>
|
|
1711
|
+
rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => (
|
|
1712
|
+
// oxlint-disable-next-line react/no-array-index-key
|
|
1713
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core28.Input.Error, { children: error }, `range-widget-input-errors-${index}`)
|
|
1714
|
+
))
|
|
1666
1715
|
] });
|
|
1667
1716
|
}
|
|
1668
1717
|
|
|
1669
1718
|
// src/widgets/SelectWidget.tsx
|
|
1670
|
-
var
|
|
1671
|
-
var
|
|
1672
|
-
var
|
|
1673
|
-
var
|
|
1719
|
+
var import_react12 = require("react");
|
|
1720
|
+
var import_core29 = require("@mantine/core");
|
|
1721
|
+
var import_utils32 = require("@rjsf/utils");
|
|
1722
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1674
1723
|
function SelectWidget(props) {
|
|
1675
1724
|
const {
|
|
1676
1725
|
id,
|
|
@@ -1685,45 +1734,47 @@ function SelectWidget(props) {
|
|
|
1685
1734
|
hideLabel,
|
|
1686
1735
|
multiple,
|
|
1687
1736
|
rawErrors,
|
|
1737
|
+
schema,
|
|
1688
1738
|
options,
|
|
1689
1739
|
onChange,
|
|
1690
1740
|
onBlur,
|
|
1691
1741
|
onFocus
|
|
1692
1742
|
} = props;
|
|
1693
1743
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
1694
|
-
const optionValueFormat = (0,
|
|
1744
|
+
const optionValueFormat = (0, import_utils32.getOptionValueFormat)(options);
|
|
1695
1745
|
const themeProps = cleanupOptions(options);
|
|
1696
|
-
|
|
1746
|
+
(0, import_utils32.logUnsupportedDefaultForEnum)(id, schema, enumOptions, multiple);
|
|
1747
|
+
const handleChange = (0, import_react12.useCallback)(
|
|
1697
1748
|
(nextValue) => {
|
|
1698
1749
|
if (!disabled && !readonly && onChange) {
|
|
1699
|
-
onChange((0,
|
|
1750
|
+
onChange((0, import_utils32.enumOptionValueDecoder)(nextValue, enumOptions, optionValueFormat, emptyValue));
|
|
1700
1751
|
}
|
|
1701
1752
|
},
|
|
1702
1753
|
[onChange, disabled, readonly, enumOptions, emptyValue, optionValueFormat]
|
|
1703
1754
|
);
|
|
1704
|
-
const handleBlur = (0,
|
|
1755
|
+
const handleBlur = (0, import_react12.useCallback)(
|
|
1705
1756
|
({ target }) => {
|
|
1706
1757
|
if (onBlur) {
|
|
1707
|
-
onBlur(id, (0,
|
|
1758
|
+
onBlur(id, (0, import_utils32.enumOptionValueDecoder)(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1708
1759
|
}
|
|
1709
1760
|
},
|
|
1710
1761
|
[onBlur, id, enumOptions, emptyValue, optionValueFormat]
|
|
1711
1762
|
);
|
|
1712
|
-
const handleFocus = (0,
|
|
1763
|
+
const handleFocus = (0, import_react12.useCallback)(
|
|
1713
1764
|
({ target }) => {
|
|
1714
1765
|
if (onFocus) {
|
|
1715
|
-
onFocus(id, (0,
|
|
1766
|
+
onFocus(id, (0, import_utils32.enumOptionValueDecoder)(target?.value, enumOptions, optionValueFormat, emptyValue));
|
|
1716
1767
|
}
|
|
1717
1768
|
},
|
|
1718
1769
|
[onFocus, id, enumOptions, emptyValue, optionValueFormat]
|
|
1719
1770
|
);
|
|
1720
|
-
const selectOptions = (0,
|
|
1771
|
+
const selectOptions = (0, import_react12.useMemo)(() => {
|
|
1721
1772
|
if (Array.isArray(enumOptions)) {
|
|
1722
1773
|
return enumOptions.map((option, index) => ({
|
|
1723
1774
|
key: String(index),
|
|
1724
|
-
value: (0,
|
|
1775
|
+
value: (0, import_utils32.enumOptionValueEncoder)(option.value, index, optionValueFormat),
|
|
1725
1776
|
label: option.label,
|
|
1726
|
-
disabled: Array.isArray(enumDisabled) && enumDisabled.
|
|
1777
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.includes(option.value)
|
|
1727
1778
|
}));
|
|
1728
1779
|
}
|
|
1729
1780
|
return [];
|
|
@@ -1731,7 +1782,7 @@ function SelectWidget(props) {
|
|
|
1731
1782
|
const sharedProps = {
|
|
1732
1783
|
id,
|
|
1733
1784
|
name: htmlName || id,
|
|
1734
|
-
label: (0,
|
|
1785
|
+
label: (0, import_utils32.labelValue)(label || void 0, hideLabel, false),
|
|
1735
1786
|
data: selectOptions,
|
|
1736
1787
|
onChange: !readonly ? handleChange : void 0,
|
|
1737
1788
|
onBlur: !readonly ? handleBlur : void 0,
|
|
@@ -1742,30 +1793,33 @@ function SelectWidget(props) {
|
|
|
1742
1793
|
required,
|
|
1743
1794
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1744
1795
|
searchable: true,
|
|
1745
|
-
"aria-describedby": (0,
|
|
1796
|
+
"aria-describedby": (0, import_utils32.ariaDescribedByIds)(id),
|
|
1746
1797
|
comboboxProps: { withinPortal: false },
|
|
1747
1798
|
...themeProps
|
|
1748
1799
|
};
|
|
1749
|
-
return
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
1801
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_utils32.SelectedOptionDescription, { ...props }),
|
|
1802
|
+
multiple ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1803
|
+
import_core29.MultiSelect,
|
|
1804
|
+
{
|
|
1805
|
+
...sharedProps,
|
|
1806
|
+
value: (0, import_utils32.enumOptionSelectedValue)(value, enumOptions, true, optionValueFormat, [])
|
|
1807
|
+
}
|
|
1808
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1809
|
+
import_core29.Select,
|
|
1810
|
+
{
|
|
1811
|
+
...sharedProps,
|
|
1812
|
+
value: (0, import_utils32.enumOptionSelectedValue)(value, enumOptions, false, optionValueFormat, null)
|
|
1813
|
+
}
|
|
1814
|
+
)
|
|
1815
|
+
] });
|
|
1762
1816
|
}
|
|
1763
1817
|
|
|
1764
1818
|
// src/widgets/TextareaWidget.tsx
|
|
1765
|
-
var
|
|
1766
|
-
var
|
|
1767
|
-
var
|
|
1768
|
-
var
|
|
1819
|
+
var import_react13 = require("react");
|
|
1820
|
+
var import_core30 = require("@mantine/core");
|
|
1821
|
+
var import_utils34 = require("@rjsf/utils");
|
|
1822
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1769
1823
|
function TextareaWidget(props) {
|
|
1770
1824
|
const {
|
|
1771
1825
|
id,
|
|
@@ -1787,30 +1841,30 @@ function TextareaWidget(props) {
|
|
|
1787
1841
|
} = props;
|
|
1788
1842
|
const themeProps = cleanupOptions(options);
|
|
1789
1843
|
const emptyValue = options?.emptyValue;
|
|
1790
|
-
const handleChange = (0,
|
|
1844
|
+
const handleChange = (0, import_react13.useCallback)(
|
|
1791
1845
|
(e) => {
|
|
1792
1846
|
onChange(e.target.value === "" ? emptyValue : e.target.value);
|
|
1793
1847
|
},
|
|
1794
1848
|
[onChange, emptyValue]
|
|
1795
1849
|
);
|
|
1796
|
-
const handleBlur = (0,
|
|
1850
|
+
const handleBlur = (0, import_react13.useCallback)(
|
|
1797
1851
|
({ target }) => {
|
|
1798
1852
|
if (onBlur) {
|
|
1799
|
-
onBlur(id, target
|
|
1853
|
+
onBlur(id, target?.value);
|
|
1800
1854
|
}
|
|
1801
1855
|
},
|
|
1802
1856
|
[onBlur, id]
|
|
1803
1857
|
);
|
|
1804
|
-
const handleFocus = (0,
|
|
1858
|
+
const handleFocus = (0, import_react13.useCallback)(
|
|
1805
1859
|
({ target }) => {
|
|
1806
1860
|
if (onFocus) {
|
|
1807
|
-
onFocus(id, target
|
|
1861
|
+
onFocus(id, target?.value);
|
|
1808
1862
|
}
|
|
1809
1863
|
},
|
|
1810
1864
|
[onFocus, id]
|
|
1811
1865
|
);
|
|
1812
|
-
return /* @__PURE__ */ (0,
|
|
1813
|
-
|
|
1866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1867
|
+
import_core30.Textarea,
|
|
1814
1868
|
{
|
|
1815
1869
|
id,
|
|
1816
1870
|
name: htmlName || name,
|
|
@@ -1819,12 +1873,12 @@ function TextareaWidget(props) {
|
|
|
1819
1873
|
required,
|
|
1820
1874
|
disabled: disabled || readonly,
|
|
1821
1875
|
autoFocus: autofocus,
|
|
1822
|
-
label: (0,
|
|
1876
|
+
label: (0, import_utils34.labelValue)(label || void 0, hideLabel, false),
|
|
1823
1877
|
onChange: handleChange,
|
|
1824
1878
|
onBlur: handleBlur,
|
|
1825
1879
|
onFocus: handleFocus,
|
|
1826
1880
|
error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
|
|
1827
|
-
"aria-describedby": (0,
|
|
1881
|
+
"aria-describedby": (0, import_utils34.ariaDescribedByIds)(id),
|
|
1828
1882
|
...themeProps
|
|
1829
1883
|
}
|
|
1830
1884
|
);
|
|
@@ -1863,7 +1917,7 @@ var Theme_default = generateTheme();
|
|
|
1863
1917
|
|
|
1864
1918
|
// src/Form/index.ts
|
|
1865
1919
|
function generateForm() {
|
|
1866
|
-
return (0,
|
|
1920
|
+
return (0, import_core31.withTheme)(generateTheme());
|
|
1867
1921
|
}
|
|
1868
1922
|
var Form_default = generateForm();
|
|
1869
1923
|
|