@rjsf/chakra-ui 6.0.0-beta.21 → 6.0.0-beta.23
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/chakra-ui.esm.js +58 -117
- package/dist/chakra-ui.esm.js.map +3 -3
- package/dist/chakra-ui.umd.js +38 -93
- package/dist/index.cjs +128 -184
- package/dist/index.cjs.map +3 -3
- package/lib/AltDateTimeWidget/AltDateTimeWidget.d.ts +1 -1
- package/lib/AltDateTimeWidget/AltDateTimeWidget.js +2 -2
- package/lib/AltDateTimeWidget/AltDateTimeWidget.js.map +1 -1
- package/lib/AltDateWidget/AltDateWidget.d.ts +1 -1
- package/lib/AltDateWidget/AltDateWidget.js +8 -49
- package/lib/AltDateWidget/AltDateWidget.js.map +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +1 -2
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js +2 -2
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +2 -2
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.js +2 -2
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/RadioWidget/RadioWidget.d.ts +1 -1
- package/lib/RadioWidget/RadioWidget.js +2 -2
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.js +2 -2
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/TextareaWidget/TextareaWidget.d.ts +1 -1
- package/lib/TextareaWidget/TextareaWidget.js +2 -2
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -3
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/AltDateTimeWidget/AltDateTimeWidget.tsx +2 -2
- package/src/AltDateWidget/AltDateWidget.tsx +13 -88
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +2 -2
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +1 -9
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +2 -1
- package/src/CheckboxWidget/CheckboxWidget.tsx +2 -1
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +2 -1
- package/src/FieldTemplate/FieldTemplate.tsx +6 -4
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +2 -2
- package/src/RadioWidget/RadioWidget.tsx +2 -1
- package/src/SelectWidget/SelectWidget.tsx +2 -1
- package/src/TextareaWidget/TextareaWidget.tsx +2 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +4 -7
package/dist/index.cjs
CHANGED
|
@@ -106,11 +106,6 @@ function ArrayFieldTemplate(props) {
|
|
|
106
106
|
registry,
|
|
107
107
|
uiOptions
|
|
108
108
|
);
|
|
109
|
-
const ArrayFieldItemTemplate2 = (0, import_utils3.getTemplate)(
|
|
110
|
-
"ArrayFieldItemTemplate",
|
|
111
|
-
registry,
|
|
112
|
-
uiOptions
|
|
113
|
-
);
|
|
114
109
|
const ArrayFieldTitleTemplate = (0, import_utils3.getTemplate)(
|
|
115
110
|
"ArrayFieldTitleTemplate",
|
|
116
111
|
registry,
|
|
@@ -146,7 +141,7 @@ function ArrayFieldTemplate(props) {
|
|
|
146
141
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react3.Grid, { children: [
|
|
147
142
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react3.GridItem, { children: [
|
|
148
143
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
149
|
-
items
|
|
144
|
+
items
|
|
150
145
|
] }),
|
|
151
146
|
canAdd && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react3.GridItem, { justifySelf: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react3.Box, { mt: 2, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
152
147
|
AddButton2,
|
|
@@ -203,6 +198,7 @@ var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
|
203
198
|
function BaseInputTemplate(props) {
|
|
204
199
|
const {
|
|
205
200
|
id,
|
|
201
|
+
htmlName,
|
|
206
202
|
type,
|
|
207
203
|
value,
|
|
208
204
|
label,
|
|
@@ -241,7 +237,7 @@ function BaseInputTemplate(props) {
|
|
|
241
237
|
import_react7.Input,
|
|
242
238
|
{
|
|
243
239
|
id,
|
|
244
|
-
name: id,
|
|
240
|
+
name: htmlName || id,
|
|
245
241
|
value: value || value === 0 ? value : "",
|
|
246
242
|
onChange: onChangeOverride || _onChange,
|
|
247
243
|
onBlur: _onBlur,
|
|
@@ -417,8 +413,9 @@ function FieldTemplate(props) {
|
|
|
417
413
|
displayLabel,
|
|
418
414
|
hidden,
|
|
419
415
|
label,
|
|
420
|
-
|
|
421
|
-
|
|
416
|
+
onKeyRename,
|
|
417
|
+
onKeyRenameBlur,
|
|
418
|
+
onRemoveProperty,
|
|
422
419
|
readonly,
|
|
423
420
|
registry,
|
|
424
421
|
required,
|
|
@@ -447,8 +444,9 @@ function FieldTemplate(props) {
|
|
|
447
444
|
disabled,
|
|
448
445
|
id,
|
|
449
446
|
label,
|
|
450
|
-
|
|
451
|
-
|
|
447
|
+
onKeyRename,
|
|
448
|
+
onKeyRenameBlur,
|
|
449
|
+
onRemoveProperty,
|
|
452
450
|
readonly,
|
|
453
451
|
required,
|
|
454
452
|
schema,
|
|
@@ -503,7 +501,7 @@ function ObjectFieldTemplate(props) {
|
|
|
503
501
|
schema,
|
|
504
502
|
formData,
|
|
505
503
|
optionalDataControl,
|
|
506
|
-
|
|
504
|
+
onAddProperty,
|
|
507
505
|
registry
|
|
508
506
|
} = props;
|
|
509
507
|
const uiOptions = (0, import_utils11.getUiOptions)(uiSchema);
|
|
@@ -550,7 +548,7 @@ function ObjectFieldTemplate(props) {
|
|
|
550
548
|
{
|
|
551
549
|
id: (0, import_utils11.buttonId)(fieldPathId, "add"),
|
|
552
550
|
className: "rjsf-object-property-expand",
|
|
553
|
-
onClick:
|
|
551
|
+
onClick: onAddProperty,
|
|
554
552
|
disabled: disabled || readonly,
|
|
555
553
|
uiSchema,
|
|
556
554
|
registry
|
|
@@ -642,8 +640,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
642
640
|
disabled,
|
|
643
641
|
id,
|
|
644
642
|
label,
|
|
645
|
-
|
|
646
|
-
|
|
643
|
+
onRemoveProperty,
|
|
644
|
+
onKeyRenameBlur,
|
|
647
645
|
readonly,
|
|
648
646
|
registry,
|
|
649
647
|
required,
|
|
@@ -657,7 +655,6 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
657
655
|
if (!additional) {
|
|
658
656
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: classNames, style, children });
|
|
659
657
|
}
|
|
660
|
-
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
661
658
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react24.Grid, { className: classNames, style, alignItems: "center", gap: 2, children: [
|
|
662
659
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react24.GridItem, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Field, { required, label: keyLabel, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
663
660
|
import_react24.Input,
|
|
@@ -666,7 +663,7 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
666
663
|
disabled: disabled || readonly,
|
|
667
664
|
id: `${id}-key`,
|
|
668
665
|
name: `${id}-key`,
|
|
669
|
-
onBlur: !readonly ?
|
|
666
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
670
667
|
type: "text",
|
|
671
668
|
mb: 1
|
|
672
669
|
}
|
|
@@ -678,7 +675,7 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
678
675
|
id: (0, import_utils13.buttonId)(id, "remove"),
|
|
679
676
|
className: "rjsf-object-property-remove",
|
|
680
677
|
disabled: disabled || readonly,
|
|
681
|
-
onClick:
|
|
678
|
+
onClick: onRemoveProperty,
|
|
682
679
|
uiSchema,
|
|
683
680
|
registry
|
|
684
681
|
}
|
|
@@ -718,94 +715,36 @@ var Templates_default = generateTemplates();
|
|
|
718
715
|
// src/AltDateWidget/AltDateWidget.tsx
|
|
719
716
|
var import_react25 = require("@chakra-ui/react");
|
|
720
717
|
var import_utils14 = require("@rjsf/utils");
|
|
721
|
-
var import_react26 = require("react");
|
|
722
718
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
723
|
-
function DateElement(props) {
|
|
724
|
-
const { SelectWidget: SelectWidget2 } = props.registry.widgets;
|
|
725
|
-
const value = props.value ? props.value : void 0;
|
|
726
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
727
|
-
SelectWidget2,
|
|
728
|
-
{
|
|
729
|
-
...props,
|
|
730
|
-
label: "",
|
|
731
|
-
className: "form-control",
|
|
732
|
-
onChange: (elemValue) => props.select(props.type, elemValue),
|
|
733
|
-
options: {
|
|
734
|
-
enumOptions: (0, import_utils14.dateRangeOptions)(props.range[0], props.range[1])
|
|
735
|
-
},
|
|
736
|
-
placeholder: props.type,
|
|
737
|
-
schema: { type: "integer" },
|
|
738
|
-
value,
|
|
739
|
-
"aria-describedby": (0, import_utils14.ariaDescribedByIds)(props.name)
|
|
740
|
-
}
|
|
741
|
-
);
|
|
742
|
-
}
|
|
743
|
-
var readyForChange = (state) => {
|
|
744
|
-
return Object.keys(state).every((key) => typeof state[key] !== "undefined" && state[key] !== -1);
|
|
745
|
-
};
|
|
746
719
|
function AltDateWidget(props) {
|
|
747
|
-
const { autofocus, disabled, id, onBlur,
|
|
720
|
+
const { autofocus, disabled, id, onBlur, onFocus, options, readonly, registry } = props;
|
|
748
721
|
const { translateString } = registry;
|
|
749
|
-
const
|
|
750
|
-
(0, import_react26.useEffect)(() => {
|
|
751
|
-
setState((0, import_utils14.parseDateString)(value, showTime));
|
|
752
|
-
}, [showTime, value]);
|
|
753
|
-
const handleChange = (property, nextValue) => {
|
|
754
|
-
const nextState = {
|
|
755
|
-
...state,
|
|
756
|
-
[property]: typeof nextValue === "undefined" ? -1 : nextValue
|
|
757
|
-
};
|
|
758
|
-
if (readyForChange(nextState)) {
|
|
759
|
-
onChange((0, import_utils14.toDateString)(nextState, showTime));
|
|
760
|
-
} else {
|
|
761
|
-
setState(nextState);
|
|
762
|
-
}
|
|
763
|
-
};
|
|
764
|
-
const handleNow = (event) => {
|
|
765
|
-
event.preventDefault();
|
|
766
|
-
if (disabled || readonly) {
|
|
767
|
-
return;
|
|
768
|
-
}
|
|
769
|
-
const nextState = (0, import_utils14.parseDateString)((/* @__PURE__ */ new Date()).toJSON(), showTime);
|
|
770
|
-
onChange((0, import_utils14.toDateString)(nextState, showTime));
|
|
771
|
-
};
|
|
772
|
-
const handleClear = (event) => {
|
|
773
|
-
event.preventDefault();
|
|
774
|
-
if (disabled || readonly) {
|
|
775
|
-
return;
|
|
776
|
-
}
|
|
777
|
-
onChange(void 0);
|
|
778
|
-
};
|
|
722
|
+
const { elements, handleChange, handleClear, handleSetNow } = (0, import_utils14.useAltDateWidgetProps)(props);
|
|
779
723
|
const chakraProps = getChakra({ uiSchema: props.uiSchema });
|
|
780
724
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react25.FieldsetRoot, { ...chakraProps, children: [
|
|
781
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react25.Box, { display: "flex", flexWrap: "wrap", alignItems: "center", children: (
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
options.format
|
|
786
|
-
).map((elemProps, i) => {
|
|
787
|
-
const elemId = id + "_" + elemProps.type;
|
|
788
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react25.Box, { mr: "2", mb: "2", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
789
|
-
DateElement,
|
|
725
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react25.Box, { display: "flex", flexWrap: "wrap", alignItems: "center", children: elements.map((elemProps, i) => {
|
|
726
|
+
const elemId = `${id}_${elemProps.type}`;
|
|
727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react25.Box, { mr: "2", mb: "2", width: "20", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
728
|
+
import_utils14.DateElement,
|
|
790
729
|
{
|
|
791
730
|
...props,
|
|
792
731
|
...elemProps,
|
|
793
732
|
autofocus: autofocus && i === 0,
|
|
794
733
|
disabled,
|
|
795
|
-
|
|
734
|
+
rootId: id,
|
|
796
735
|
name: id,
|
|
797
736
|
onBlur,
|
|
798
737
|
onFocus,
|
|
799
738
|
readonly,
|
|
800
739
|
registry,
|
|
801
740
|
select: handleChange,
|
|
802
|
-
value: elemProps.value < 0 ? "" : elemProps.value
|
|
741
|
+
value: elemProps.value && elemProps.value < 0 ? "" : elemProps.value
|
|
803
742
|
}
|
|
804
743
|
) }, elemId);
|
|
805
744
|
}) }),
|
|
806
745
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react25.Box, { display: "flex", children: [
|
|
807
|
-
!options.hideNowButton && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react25.Button, { onClick:
|
|
808
|
-
!options.hideClearButton && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react25.Button, { onClick:
|
|
746
|
+
!options.hideNowButton && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react25.Button, { onClick: handleSetNow, mr: "2", children: translateString(import_utils14.TranslatableString.NowLabel) }),
|
|
747
|
+
!options.hideClearButton && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react25.Button, { onClick: handleClear, children: translateString(import_utils14.TranslatableString.ClearLabel) })
|
|
809
748
|
] })
|
|
810
749
|
] });
|
|
811
750
|
}
|
|
@@ -813,7 +752,7 @@ AltDateWidget.defaultProps = {
|
|
|
813
752
|
autofocus: false,
|
|
814
753
|
disabled: false,
|
|
815
754
|
readonly: false,
|
|
816
|
-
|
|
755
|
+
time: false,
|
|
817
756
|
options: {
|
|
818
757
|
yearsRange: [1900, (/* @__PURE__ */ new Date()).getFullYear() + 2]
|
|
819
758
|
}
|
|
@@ -824,28 +763,28 @@ var AltDateWidget_default = AltDateWidget;
|
|
|
824
763
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
825
764
|
function AltDateTimeWidget(props) {
|
|
826
765
|
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
827
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AltDateWidget2, { ...props,
|
|
766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AltDateWidget2, { ...props, time: true });
|
|
828
767
|
}
|
|
829
768
|
AltDateTimeWidget.defaultProps = {
|
|
830
769
|
...AltDateWidget_default.defaultProps,
|
|
831
|
-
|
|
770
|
+
time: true
|
|
832
771
|
};
|
|
833
772
|
var AltDateTimeWidget_default = AltDateTimeWidget;
|
|
834
773
|
|
|
835
774
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
836
|
-
var
|
|
775
|
+
var import_react28 = require("@chakra-ui/react");
|
|
837
776
|
var import_utils16 = require("@rjsf/utils");
|
|
838
777
|
|
|
839
778
|
// src/components/ui/checkbox.tsx
|
|
840
|
-
var
|
|
841
|
-
var
|
|
779
|
+
var import_react26 = require("react");
|
|
780
|
+
var import_react27 = require("@chakra-ui/react");
|
|
842
781
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
843
|
-
var Checkbox = (0,
|
|
782
|
+
var Checkbox = (0, import_react26.forwardRef)(function Checkbox2(props, ref) {
|
|
844
783
|
const { icon, children, inputProps, rootRef, ...rest } = props;
|
|
845
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
846
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
847
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
848
|
-
children != null && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react27.Checkbox.Root, { ref: rootRef, ...rest, children: [
|
|
785
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react27.Checkbox.HiddenInput, { ref, ...inputProps }),
|
|
786
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react27.Checkbox.Control, { children: icon || /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react27.Checkbox.Indicator, {}) }),
|
|
787
|
+
children != null && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react27.Checkbox.Label, { children })
|
|
849
788
|
] });
|
|
850
789
|
});
|
|
851
790
|
|
|
@@ -854,6 +793,7 @@ var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
|
854
793
|
function CheckboxWidget(props) {
|
|
855
794
|
const {
|
|
856
795
|
id,
|
|
796
|
+
htmlName,
|
|
857
797
|
value,
|
|
858
798
|
disabled,
|
|
859
799
|
readonly,
|
|
@@ -893,26 +833,27 @@ function CheckboxWidget(props) {
|
|
|
893
833
|
Checkbox,
|
|
894
834
|
{
|
|
895
835
|
id,
|
|
896
|
-
name: id,
|
|
836
|
+
name: htmlName || id,
|
|
897
837
|
checked: typeof value === "undefined" ? false : value,
|
|
898
838
|
disabled: disabled || readonly,
|
|
899
839
|
onCheckedChange: _onChange,
|
|
900
840
|
onBlur: _onBlur,
|
|
901
841
|
onFocus: _onFocus,
|
|
902
842
|
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id),
|
|
903
|
-
children: (0, import_utils16.labelValue)(/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
843
|
+
children: (0, import_utils16.labelValue)(/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react28.Text, { children: label }), hideLabel || !label)
|
|
904
844
|
}
|
|
905
845
|
)
|
|
906
846
|
] });
|
|
907
847
|
}
|
|
908
848
|
|
|
909
849
|
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
910
|
-
var
|
|
850
|
+
var import_react29 = require("@chakra-ui/react");
|
|
911
851
|
var import_utils18 = require("@rjsf/utils");
|
|
912
852
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
913
853
|
function CheckboxesWidget(props) {
|
|
914
854
|
const {
|
|
915
855
|
id,
|
|
856
|
+
htmlName,
|
|
916
857
|
disabled,
|
|
917
858
|
options,
|
|
918
859
|
value,
|
|
@@ -933,14 +874,14 @@ function CheckboxesWidget(props) {
|
|
|
933
874
|
const selectedIndexes = (0, import_utils18.enumOptionsIndexForValue)(value, enumOptions, true);
|
|
934
875
|
const chakraProps = getChakra({ uiSchema });
|
|
935
876
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
936
|
-
|
|
877
|
+
import_react29.FieldsetRoot,
|
|
937
878
|
{
|
|
938
879
|
mb: 1,
|
|
939
880
|
disabled: disabled || readonly,
|
|
940
881
|
invalid: rawErrors && rawErrors.length > 0,
|
|
941
882
|
...chakraProps,
|
|
942
883
|
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
943
|
-
|
|
884
|
+
import_react29.CheckboxGroup,
|
|
944
885
|
{
|
|
945
886
|
onValueChange: (option) => onChange((0, import_utils18.enumOptionsValueForIndex)(option, enumOptions, emptyValue)),
|
|
946
887
|
value: selectedIndexes,
|
|
@@ -948,18 +889,18 @@ function CheckboxesWidget(props) {
|
|
|
948
889
|
readOnly: readonly,
|
|
949
890
|
required,
|
|
950
891
|
label: (0, import_utils18.labelValue)(label, hideLabel || !label),
|
|
951
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
892
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react29.Stack, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
952
893
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
953
894
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
954
895
|
Checkbox,
|
|
955
896
|
{
|
|
956
897
|
id: (0, import_utils18.optionId)(id, index),
|
|
957
|
-
name: id,
|
|
898
|
+
name: htmlName || id,
|
|
958
899
|
value: String(index),
|
|
959
900
|
disabled: disabled || itemDisabled || readonly,
|
|
960
901
|
onBlur: _onBlur,
|
|
961
902
|
onFocus: _onFocus,
|
|
962
|
-
children: option.label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
903
|
+
children: option.label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react29.Text, { children: option.label })
|
|
963
904
|
},
|
|
964
905
|
index
|
|
965
906
|
);
|
|
@@ -971,27 +912,28 @@ function CheckboxesWidget(props) {
|
|
|
971
912
|
}
|
|
972
913
|
|
|
973
914
|
// src/RadioWidget/RadioWidget.tsx
|
|
974
|
-
var
|
|
915
|
+
var import_react32 = require("@chakra-ui/react");
|
|
975
916
|
var import_utils20 = require("@rjsf/utils");
|
|
976
917
|
|
|
977
918
|
// src/components/ui/radio.tsx
|
|
978
|
-
var
|
|
979
|
-
var
|
|
919
|
+
var import_react30 = require("react");
|
|
920
|
+
var import_react31 = require("@chakra-ui/react");
|
|
980
921
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
981
|
-
var Radio = (0,
|
|
922
|
+
var Radio = (0, import_react30.forwardRef)(function Radio2(props, ref) {
|
|
982
923
|
const { children, inputProps, rootRef, ...rest } = props;
|
|
983
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
984
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
985
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
986
|
-
children && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react31.RadioGroup.Item, { ref: rootRef, ...rest, children: [
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react31.RadioGroup.ItemHiddenInput, { ref, ...inputProps }),
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react31.RadioGroup.ItemIndicator, {}),
|
|
927
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react31.RadioGroup.ItemText, { children })
|
|
987
928
|
] });
|
|
988
929
|
});
|
|
989
|
-
var RadioGroup =
|
|
930
|
+
var RadioGroup = import_react31.RadioGroup.Root;
|
|
990
931
|
|
|
991
932
|
// src/RadioWidget/RadioWidget.tsx
|
|
992
933
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
993
934
|
function RadioWidget({
|
|
994
935
|
id,
|
|
936
|
+
htmlName,
|
|
995
937
|
options,
|
|
996
938
|
value,
|
|
997
939
|
required,
|
|
@@ -1027,9 +969,9 @@ function RadioWidget({
|
|
|
1027
969
|
onBlur: _onBlur,
|
|
1028
970
|
onFocus: _onFocus,
|
|
1029
971
|
value: selectedIndex,
|
|
1030
|
-
name: id,
|
|
972
|
+
name: htmlName || id,
|
|
1031
973
|
"aria-describedby": (0, import_utils20.ariaDescribedByIds)(id),
|
|
1032
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
974
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react32.Stack, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
1033
975
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
1034
976
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1035
977
|
Radio,
|
|
@@ -1052,10 +994,10 @@ function RadioWidget({
|
|
|
1052
994
|
var import_utils22 = require("@rjsf/utils");
|
|
1053
995
|
|
|
1054
996
|
// src/components/ui/slider.tsx
|
|
1055
|
-
var
|
|
1056
|
-
var
|
|
997
|
+
var import_react33 = require("react");
|
|
998
|
+
var import_react34 = require("@chakra-ui/react");
|
|
1057
999
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1058
|
-
var Slider = (0,
|
|
1000
|
+
var Slider = (0, import_react33.forwardRef)(function Slider2(props, ref) {
|
|
1059
1001
|
const { marks: marksProp, showValue, ...rest } = props;
|
|
1060
1002
|
const value = props.defaultValue ?? props.value;
|
|
1061
1003
|
const marks = marksProp?.map((mark) => {
|
|
@@ -1065,10 +1007,10 @@ var Slider = (0, import_react34.forwardRef)(function Slider2(props, ref) {
|
|
|
1065
1007
|
return mark;
|
|
1066
1008
|
});
|
|
1067
1009
|
const hasMarkLabel = !!marks?.some((mark) => mark.label);
|
|
1068
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1069
|
-
showValue && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1070
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1071
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react34.Slider.Root, { ref, width: "200px", thumbAlignment: "center", ...rest, children: [
|
|
1011
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react34.HStack, { justify: "space-between", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react34.Slider.ValueText, {}) }),
|
|
1012
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react34.Slider.Control, { "data-has-mark-label": hasMarkLabel || void 0, children: [
|
|
1013
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react34.Slider.Track, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react34.Slider.Range, {}) }),
|
|
1072
1014
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SliderThumbs, { value }),
|
|
1073
1015
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SliderMarks, { marks })
|
|
1074
1016
|
] })
|
|
@@ -1076,18 +1018,18 @@ var Slider = (0, import_react34.forwardRef)(function Slider2(props, ref) {
|
|
|
1076
1018
|
});
|
|
1077
1019
|
function SliderThumbs(props) {
|
|
1078
1020
|
const { value } = props;
|
|
1079
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: value?.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: value?.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react34.Slider.Thumb, { index, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react34.Slider.HiddenInput, {}) }, index)) });
|
|
1080
1022
|
}
|
|
1081
|
-
var SliderMarks = (0,
|
|
1023
|
+
var SliderMarks = (0, import_react33.forwardRef)(function SliderMarks2(props, ref) {
|
|
1082
1024
|
const { marks } = props;
|
|
1083
1025
|
if (!marks?.length) {
|
|
1084
1026
|
return null;
|
|
1085
1027
|
}
|
|
1086
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react34.Slider.MarkerGroup, { ref, children: marks.map((mark, index) => {
|
|
1087
1029
|
const value = typeof mark === "number" ? mark : mark.value;
|
|
1088
1030
|
const label = typeof mark === "number" ? void 0 : mark.label;
|
|
1089
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1090
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react34.Slider.Marker, { value, children: [
|
|
1032
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react34.Slider.MarkerIndicator, {}),
|
|
1091
1033
|
label
|
|
1092
1034
|
] }, index);
|
|
1093
1035
|
}) });
|
|
@@ -1130,43 +1072,43 @@ function RangeWidget({
|
|
|
1130
1072
|
}
|
|
1131
1073
|
|
|
1132
1074
|
// src/SelectWidget/SelectWidget.tsx
|
|
1133
|
-
var
|
|
1075
|
+
var import_react37 = require("react");
|
|
1134
1076
|
var import_utils24 = require("@rjsf/utils");
|
|
1135
|
-
var
|
|
1077
|
+
var import_react38 = require("@chakra-ui/react");
|
|
1136
1078
|
|
|
1137
1079
|
// src/components/ui/select.tsx
|
|
1138
|
-
var
|
|
1139
|
-
var
|
|
1080
|
+
var import_react35 = require("react");
|
|
1081
|
+
var import_react36 = require("@chakra-ui/react");
|
|
1140
1082
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1141
|
-
var SelectTrigger = (0,
|
|
1083
|
+
var SelectTrigger = (0, import_react35.forwardRef)(function SelectTrigger2(props, ref) {
|
|
1142
1084
|
const { children, clearable, ...rest } = props;
|
|
1143
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1144
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1145
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react36.Select.Control, { ...rest, children: [
|
|
1086
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Select.Trigger, { ref, children }),
|
|
1087
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react36.Select.IndicatorGroup, { children: [
|
|
1146
1088
|
clearable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SelectClearTrigger, {}),
|
|
1147
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1089
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Select.Indicator, {})
|
|
1148
1090
|
] })
|
|
1149
1091
|
] });
|
|
1150
1092
|
});
|
|
1151
|
-
var SelectClearTrigger = (0,
|
|
1093
|
+
var SelectClearTrigger = (0, import_react35.forwardRef)(
|
|
1152
1094
|
function SelectClearTrigger2(props, ref) {
|
|
1153
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Select.ClearTrigger, { asChild: true, ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CloseButton, { size: "xs", variant: "plain", focusVisibleRing: "inside", focusRingWidth: "2px", pointerEvents: "auto" }) });
|
|
1154
1096
|
}
|
|
1155
1097
|
);
|
|
1156
|
-
var SelectContent = (0,
|
|
1098
|
+
var SelectContent = (0, import_react35.forwardRef)(function SelectContent2(props, ref) {
|
|
1157
1099
|
const { portalled = true, portalRef, ...rest } = props;
|
|
1158
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Select.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Select.Content, { ...rest, ref }) }) });
|
|
1159
1101
|
});
|
|
1160
|
-
var SelectItem = (0,
|
|
1102
|
+
var SelectItem = (0, import_react35.forwardRef)(function SelectItem2(props, ref) {
|
|
1161
1103
|
const { item, children, ...rest } = props;
|
|
1162
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react36.Select.Item, { item, ...rest, ref, children: [
|
|
1163
1105
|
children,
|
|
1164
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1106
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Select.ItemIndicator, {})
|
|
1165
1107
|
] }, item.value);
|
|
1166
1108
|
});
|
|
1167
|
-
var SelectValueText = (0,
|
|
1109
|
+
var SelectValueText = (0, import_react35.forwardRef)(function SelectValueText2(props, ref) {
|
|
1168
1110
|
const { children, ...rest } = props;
|
|
1169
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Select.ValueText, { ...rest, ref, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Select.Context, { children: (select) => {
|
|
1170
1112
|
const items = select.selectedItems;
|
|
1171
1113
|
if (items.length === 0) {
|
|
1172
1114
|
return props.placeholder;
|
|
@@ -1180,27 +1122,28 @@ var SelectValueText = (0, import_react36.forwardRef)(function SelectValueText2(p
|
|
|
1180
1122
|
return `${items.length} selected`;
|
|
1181
1123
|
} }) });
|
|
1182
1124
|
});
|
|
1183
|
-
var SelectRoot = (0,
|
|
1184
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1185
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1125
|
+
var SelectRoot = (0, import_react35.forwardRef)(function SelectRoot2(props, ref) {
|
|
1126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Select.Root, { ...props, ref, positioning: { sameWidth: true, ...props.positioning }, children: props.asChild ? props.children : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
1127
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Select.HiddenSelect, {}),
|
|
1186
1128
|
props.children
|
|
1187
1129
|
] }) });
|
|
1188
1130
|
});
|
|
1189
|
-
var SelectItemGroup = (0,
|
|
1131
|
+
var SelectItemGroup = (0, import_react35.forwardRef)(function SelectItemGroup2(props, ref) {
|
|
1190
1132
|
const { children, label, ...rest } = props;
|
|
1191
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1192
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react36.Select.ItemGroup, { ...rest, ref, children: [
|
|
1134
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react36.Select.ItemGroupLabel, { children: label }),
|
|
1193
1135
|
children
|
|
1194
1136
|
] });
|
|
1195
1137
|
});
|
|
1196
|
-
var SelectLabel =
|
|
1197
|
-
var SelectItemText =
|
|
1138
|
+
var SelectLabel = import_react36.Select.Label;
|
|
1139
|
+
var SelectItemText = import_react36.Select.ItemText;
|
|
1198
1140
|
|
|
1199
1141
|
// src/SelectWidget/SelectWidget.tsx
|
|
1200
1142
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1201
1143
|
function SelectWidget(props) {
|
|
1202
1144
|
const {
|
|
1203
1145
|
id,
|
|
1146
|
+
htmlName,
|
|
1204
1147
|
options,
|
|
1205
1148
|
label,
|
|
1206
1149
|
hideLabel,
|
|
@@ -1229,7 +1172,7 @@ function SelectWidget(props) {
|
|
|
1229
1172
|
const _onBlur = ({ target }) => onBlur(id, (0, import_utils24.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1230
1173
|
const _onFocus = ({ target }) => onFocus(id, (0, import_utils24.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1231
1174
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
1232
|
-
const { valueLabelMap, displayEnumOptions } = (0,
|
|
1175
|
+
const { valueLabelMap, displayEnumOptions } = (0, import_react37.useMemo)(() => {
|
|
1233
1176
|
const valueLabelMap2 = {};
|
|
1234
1177
|
let displayEnumOptions2 = [];
|
|
1235
1178
|
if (Array.isArray(enumOptions)) {
|
|
@@ -1263,10 +1206,10 @@ function SelectWidget(props) {
|
|
|
1263
1206
|
}
|
|
1264
1207
|
] : [];
|
|
1265
1208
|
const formValue = (isMultiple ? getMultiValue() : getSingleValue()).map((item) => item.value);
|
|
1266
|
-
const selectOptions = (0,
|
|
1209
|
+
const selectOptions = (0, import_react38.createListCollection)({
|
|
1267
1210
|
items: displayEnumOptions.filter((item) => item.value)
|
|
1268
1211
|
});
|
|
1269
|
-
const containerRef = (0,
|
|
1212
|
+
const containerRef = (0, import_react37.useRef)(null);
|
|
1270
1213
|
const chakraProps = getChakra({ uiSchema });
|
|
1271
1214
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1272
1215
|
Field,
|
|
@@ -1285,7 +1228,7 @@ function SelectWidget(props) {
|
|
|
1285
1228
|
{
|
|
1286
1229
|
collection: selectOptions,
|
|
1287
1230
|
id,
|
|
1288
|
-
name: id,
|
|
1231
|
+
name: htmlName || id,
|
|
1289
1232
|
multiple: isMultiple,
|
|
1290
1233
|
closeOnSelect: !isMultiple,
|
|
1291
1234
|
onBlur: _onBlur,
|
|
@@ -1296,10 +1239,10 @@ function SelectWidget(props) {
|
|
|
1296
1239
|
"aria-describedby": (0, import_utils24.ariaDescribedByIds)(id),
|
|
1297
1240
|
positioning: { placement: "bottom" },
|
|
1298
1241
|
children: [
|
|
1299
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1300
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1242
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react38.Select.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SelectValueText, { placeholder }) }) }),
|
|
1243
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react38.Select.Positioner, { minWidth: "100% !important", zIndex: "2 !important", top: "calc(100% + 5px) !important", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react38.Select.Content, { children: selectOptions.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react38.Select.Item, { item, children: [
|
|
1301
1244
|
item.label,
|
|
1302
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1245
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react38.Select.ItemIndicator, {})
|
|
1303
1246
|
] }, item.value)) }) })
|
|
1304
1247
|
]
|
|
1305
1248
|
}
|
|
@@ -1309,9 +1252,9 @@ function SelectWidget(props) {
|
|
|
1309
1252
|
}
|
|
1310
1253
|
|
|
1311
1254
|
// src/SelectNativeWidget/NativeSelectWidget.tsx
|
|
1312
|
-
var
|
|
1255
|
+
var import_react39 = require("react");
|
|
1313
1256
|
var import_utils26 = require("@rjsf/utils");
|
|
1314
|
-
var
|
|
1257
|
+
var import_react40 = require("@chakra-ui/react");
|
|
1315
1258
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1316
1259
|
function NativeSelectWidget(props) {
|
|
1317
1260
|
const {
|
|
@@ -1340,7 +1283,7 @@ function NativeSelectWidget(props) {
|
|
|
1340
1283
|
const _onBlur = ({ target }) => onBlur(id, (0, import_utils26.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1341
1284
|
const _onFocus = ({ target }) => onFocus(id, (0, import_utils26.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1342
1285
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
1343
|
-
const { valueLabelMap, displayEnumOptions } = (0,
|
|
1286
|
+
const { valueLabelMap, displayEnumOptions } = (0, import_react39.useMemo)(() => {
|
|
1344
1287
|
const valueLabelMap2 = {};
|
|
1345
1288
|
let displayEnumOptions2 = [];
|
|
1346
1289
|
if (Array.isArray(enumOptions)) {
|
|
@@ -1367,7 +1310,7 @@ function NativeSelectWidget(props) {
|
|
|
1367
1310
|
}
|
|
1368
1311
|
] : [];
|
|
1369
1312
|
const formValue = getSingleValue()[0]?.value || "";
|
|
1370
|
-
const selectOptions = (0,
|
|
1313
|
+
const selectOptions = (0, import_react40.createListCollection)({
|
|
1371
1314
|
items: displayEnumOptions.filter((item) => item.value)
|
|
1372
1315
|
});
|
|
1373
1316
|
const chakraProps = getChakra({ uiSchema });
|
|
@@ -1381,9 +1324,9 @@ function NativeSelectWidget(props) {
|
|
|
1381
1324
|
invalid: rawErrors && rawErrors.length > 0,
|
|
1382
1325
|
label: (0, import_utils26.labelValue)(label, hideLabel || !label),
|
|
1383
1326
|
...chakraProps,
|
|
1384
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1327
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react40.NativeSelect.Root, { children: [
|
|
1385
1328
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1386
|
-
|
|
1329
|
+
import_react40.NativeSelect.Field,
|
|
1387
1330
|
{
|
|
1388
1331
|
id,
|
|
1389
1332
|
onBlur: _onBlur,
|
|
@@ -1395,18 +1338,19 @@ function NativeSelectWidget(props) {
|
|
|
1395
1338
|
children: selectOptions.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: item.value, children: item.label }, item.value))
|
|
1396
1339
|
}
|
|
1397
1340
|
),
|
|
1398
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1341
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react40.NativeSelect.Indicator, {})
|
|
1399
1342
|
] })
|
|
1400
1343
|
}
|
|
1401
1344
|
);
|
|
1402
1345
|
}
|
|
1403
1346
|
|
|
1404
1347
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
1405
|
-
var
|
|
1348
|
+
var import_react41 = require("@chakra-ui/react");
|
|
1406
1349
|
var import_utils28 = require("@rjsf/utils");
|
|
1407
1350
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1408
1351
|
function TextareaWidget({
|
|
1409
1352
|
id,
|
|
1353
|
+
htmlName,
|
|
1410
1354
|
placeholder,
|
|
1411
1355
|
value,
|
|
1412
1356
|
label,
|
|
@@ -1437,10 +1381,10 @@ function TextareaWidget({
|
|
|
1437
1381
|
label: (0, import_utils28.labelValue)(label, hideLabel || !label),
|
|
1438
1382
|
...chakraProps,
|
|
1439
1383
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1440
|
-
|
|
1384
|
+
import_react41.Textarea,
|
|
1441
1385
|
{
|
|
1442
1386
|
id,
|
|
1443
|
-
name: id,
|
|
1387
|
+
name: htmlName || id,
|
|
1444
1388
|
value: value ?? "",
|
|
1445
1389
|
placeholder,
|
|
1446
1390
|
autoFocus: autofocus,
|
|
@@ -1459,22 +1403,22 @@ function TextareaWidget({
|
|
|
1459
1403
|
var import_utils30 = require("@rjsf/utils");
|
|
1460
1404
|
|
|
1461
1405
|
// src/components/ui/number-input.tsx
|
|
1462
|
-
var
|
|
1463
|
-
var
|
|
1406
|
+
var import_react42 = require("react");
|
|
1407
|
+
var import_react43 = require("@chakra-ui/react");
|
|
1464
1408
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1465
|
-
var NumberInputRoot = (0,
|
|
1466
|
-
const inputRef = (0,
|
|
1467
|
-
(0,
|
|
1409
|
+
var NumberInputRoot = (0, import_react42.forwardRef)(function NumberInput(props, ref) {
|
|
1410
|
+
const inputRef = (0, import_react42.useRef)(null);
|
|
1411
|
+
(0, import_react42.useEffect)(() => {
|
|
1468
1412
|
if (inputRef.current) {
|
|
1469
1413
|
inputRef.current.value = props.value || "";
|
|
1470
1414
|
}
|
|
1471
1415
|
}, [props.value]);
|
|
1472
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
1473
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
1474
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1475
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react43.NumberInput.Root, { ref, variant: "outline", ...props, children: [
|
|
1417
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react43.NumberInput.Control, { children: [
|
|
1418
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react43.NumberInput.IncrementTrigger, {}),
|
|
1419
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react43.NumberInput.DecrementTrigger, {})
|
|
1476
1420
|
] }),
|
|
1477
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1421
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react43.NumberInput.Input, { ref: inputRef })
|
|
1478
1422
|
] });
|
|
1479
1423
|
});
|
|
1480
1424
|
|
|
@@ -1545,17 +1489,17 @@ function generateForm() {
|
|
|
1545
1489
|
var Form_default = generateForm();
|
|
1546
1490
|
|
|
1547
1491
|
// src/ChakraFrameProvider.tsx
|
|
1548
|
-
var
|
|
1492
|
+
var import_react44 = require("@emotion/react");
|
|
1549
1493
|
var import_cache = __toESM(require("@emotion/cache"), 1);
|
|
1550
1494
|
var import_weak_memoize = __toESM(require("@emotion/weak-memoize"), 1);
|
|
1551
|
-
var
|
|
1495
|
+
var import_react45 = require("@chakra-ui/react");
|
|
1552
1496
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1553
1497
|
var memoizedCreateCacheWithContainer = (0, import_weak_memoize.default)((container) => {
|
|
1554
1498
|
const newCache = (0, import_cache.default)({ container, key: "rjsf" });
|
|
1555
1499
|
return newCache;
|
|
1556
1500
|
});
|
|
1557
1501
|
var __createChakraFrameProvider = (props) => ({ document }) => {
|
|
1558
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { margin: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { margin: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react44.CacheProvider, { value: memoizedCreateCacheWithContainer(document.head), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react45.ChakraProvider, { value: import_react45.defaultSystem, children: props.children }) }) });
|
|
1559
1503
|
};
|
|
1560
1504
|
|
|
1561
1505
|
// src/index.ts
|