@rjsf/chakra-ui 6.0.0 → 6.0.2
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 +60 -55
- package/dist/chakra-ui.esm.js.map +3 -3
- package/dist/chakra-ui.umd.js +34 -30
- package/dist/index.cjs +34 -30
- package/dist/index.cjs.map +2 -2
- package/lib/CheckboxWidget/CheckboxWidget.js +5 -2
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +9 -9
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/CheckboxWidget/CheckboxWidget.tsx +4 -1
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +4 -4
package/dist/chakra-ui.umd.js
CHANGED
|
@@ -639,7 +639,9 @@
|
|
|
639
639
|
registry,
|
|
640
640
|
options
|
|
641
641
|
);
|
|
642
|
-
const
|
|
642
|
+
const uiOptions = utils.getUiOptions(uiSchema);
|
|
643
|
+
const isCheckbox = uiOptions.widget === "checkbox";
|
|
644
|
+
const description = isCheckbox ? void 0 : options.description ?? schema.description;
|
|
643
645
|
const _onChange = ({ checked }) => onChange(checked);
|
|
644
646
|
const _onBlur = ({ target }) => onBlur(id, target && target.checked);
|
|
645
647
|
const _onFocus = ({ target }) => onFocus(id, target && target.checked);
|
|
@@ -684,8 +686,8 @@
|
|
|
684
686
|
onFocus,
|
|
685
687
|
required,
|
|
686
688
|
label,
|
|
687
|
-
hideLabel,
|
|
688
689
|
rawErrors = [],
|
|
690
|
+
hideLabel,
|
|
689
691
|
uiSchema
|
|
690
692
|
} = props;
|
|
691
693
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
@@ -694,40 +696,42 @@
|
|
|
694
696
|
const row = options ? options.inline : false;
|
|
695
697
|
const selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, true);
|
|
696
698
|
const chakraProps = getChakra({ });
|
|
697
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
699
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
698
700
|
react$1.FieldsetRoot,
|
|
699
701
|
{
|
|
700
702
|
mb: 1,
|
|
701
703
|
disabled: disabled || readonly,
|
|
702
704
|
invalid: rawErrors && rawErrors.length > 0,
|
|
703
705
|
...chakraProps,
|
|
704
|
-
children:
|
|
705
|
-
react$1.
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
706
|
+
children: [
|
|
707
|
+
!hideLabel && label && /* @__PURE__ */ jsxRuntime.jsx(react$1.FieldsetLegend, { children: utils.labelValue(label) }),
|
|
708
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
709
|
+
react$1.CheckboxGroup,
|
|
710
|
+
{
|
|
711
|
+
onValueChange: (option) => onChange(utils.enumOptionsValueForIndex(option, enumOptions, emptyValue)),
|
|
712
|
+
value: selectedIndexes,
|
|
713
|
+
"aria-describedby": utils.ariaDescribedByIds(id),
|
|
714
|
+
readOnly: readonly,
|
|
715
|
+
required,
|
|
716
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Stack, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
717
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
718
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
719
|
+
Checkbox,
|
|
720
|
+
{
|
|
721
|
+
id: utils.optionId(id, index),
|
|
722
|
+
name: htmlName || id,
|
|
723
|
+
value: String(index),
|
|
724
|
+
disabled: disabled || itemDisabled || readonly,
|
|
725
|
+
onBlur: _onBlur,
|
|
726
|
+
onFocus: _onFocus,
|
|
727
|
+
children: option.label && /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { children: option.label })
|
|
728
|
+
},
|
|
729
|
+
index
|
|
730
|
+
);
|
|
731
|
+
}) })
|
|
732
|
+
}
|
|
733
|
+
)
|
|
734
|
+
]
|
|
731
735
|
}
|
|
732
736
|
);
|
|
733
737
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -813,7 +813,9 @@ function CheckboxWidget(props) {
|
|
|
813
813
|
registry,
|
|
814
814
|
options
|
|
815
815
|
);
|
|
816
|
-
const
|
|
816
|
+
const uiOptions = (0, import_utils16.getUiOptions)(uiSchema);
|
|
817
|
+
const isCheckbox = uiOptions.widget === "checkbox";
|
|
818
|
+
const description = isCheckbox ? void 0 : options.description ?? schema.description;
|
|
817
819
|
const _onChange = ({ checked }) => onChange(checked);
|
|
818
820
|
const _onBlur = ({ target }) => onBlur(id, target && target.checked);
|
|
819
821
|
const _onFocus = ({ target }) => onFocus(id, target && target.checked);
|
|
@@ -863,8 +865,8 @@ function CheckboxesWidget(props) {
|
|
|
863
865
|
onFocus,
|
|
864
866
|
required,
|
|
865
867
|
label,
|
|
866
|
-
hideLabel,
|
|
867
868
|
rawErrors = [],
|
|
869
|
+
hideLabel,
|
|
868
870
|
uiSchema
|
|
869
871
|
} = props;
|
|
870
872
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
@@ -873,40 +875,42 @@ function CheckboxesWidget(props) {
|
|
|
873
875
|
const row = options ? options.inline : false;
|
|
874
876
|
const selectedIndexes = (0, import_utils18.enumOptionsIndexForValue)(value, enumOptions, true);
|
|
875
877
|
const chakraProps = getChakra({ uiSchema });
|
|
876
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.
|
|
878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
877
879
|
import_react29.FieldsetRoot,
|
|
878
880
|
{
|
|
879
881
|
mb: 1,
|
|
880
882
|
disabled: disabled || readonly,
|
|
881
883
|
invalid: rawErrors && rawErrors.length > 0,
|
|
882
884
|
...chakraProps,
|
|
883
|
-
children:
|
|
884
|
-
import_react29.
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
885
|
+
children: [
|
|
886
|
+
!hideLabel && label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react29.FieldsetLegend, { children: (0, import_utils18.labelValue)(label) }),
|
|
887
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
888
|
+
import_react29.CheckboxGroup,
|
|
889
|
+
{
|
|
890
|
+
onValueChange: (option) => onChange((0, import_utils18.enumOptionsValueForIndex)(option, enumOptions, emptyValue)),
|
|
891
|
+
value: selectedIndexes,
|
|
892
|
+
"aria-describedby": (0, import_utils18.ariaDescribedByIds)(id),
|
|
893
|
+
readOnly: readonly,
|
|
894
|
+
required,
|
|
895
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react29.Stack, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
896
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
898
|
+
Checkbox,
|
|
899
|
+
{
|
|
900
|
+
id: (0, import_utils18.optionId)(id, index),
|
|
901
|
+
name: htmlName || id,
|
|
902
|
+
value: String(index),
|
|
903
|
+
disabled: disabled || itemDisabled || readonly,
|
|
904
|
+
onBlur: _onBlur,
|
|
905
|
+
onFocus: _onFocus,
|
|
906
|
+
children: option.label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react29.Text, { children: option.label })
|
|
907
|
+
},
|
|
908
|
+
index
|
|
909
|
+
);
|
|
910
|
+
}) })
|
|
911
|
+
}
|
|
912
|
+
)
|
|
913
|
+
]
|
|
910
914
|
}
|
|
911
915
|
);
|
|
912
916
|
}
|