@rjsf/chakra-ui 5.3.1 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chakra-ui.cjs.development.js +56 -54
- package/dist/chakra-ui.cjs.development.js.map +1 -1
- package/dist/chakra-ui.cjs.production.min.js +1 -1
- package/dist/chakra-ui.cjs.production.min.js.map +1 -1
- package/dist/chakra-ui.esm.js +57 -55
- package/dist/chakra-ui.esm.js.map +1 -1
- package/dist/chakra-ui.umd.development.js +56 -54
- package/dist/chakra-ui.umd.development.js.map +1 -1
- package/dist/chakra-ui.umd.production.min.js +1 -1
- package/dist/chakra-ui.umd.production.min.js.map +1 -1
- package/package.json +7 -7
|
@@ -197,6 +197,7 @@
|
|
|
197
197
|
type = props.type,
|
|
198
198
|
value = props.value,
|
|
199
199
|
label = props.label,
|
|
200
|
+
hideLabel = props.hideLabel,
|
|
200
201
|
schema = props.schema,
|
|
201
202
|
uiSchema = props.uiSchema,
|
|
202
203
|
onChange = props.onChange,
|
|
@@ -209,13 +210,11 @@
|
|
|
209
210
|
rawErrors = props.rawErrors,
|
|
210
211
|
autofocus = props.autofocus,
|
|
211
212
|
placeholder = props.placeholder,
|
|
212
|
-
disabled = props.disabled
|
|
213
|
-
registry = props.registry;
|
|
213
|
+
disabled = props.disabled;
|
|
214
214
|
var inputProps = utils.getInputProps(schema, type, options);
|
|
215
215
|
var chakraProps = getChakra({
|
|
216
216
|
uiSchema: uiSchema
|
|
217
217
|
});
|
|
218
|
-
var schemaUtils = registry.schemaUtils;
|
|
219
218
|
var _onChange = function _onChange(_ref) {
|
|
220
219
|
var value = _ref.target.value;
|
|
221
220
|
return onChange(value === '' ? options.emptyValue : value);
|
|
@@ -228,7 +227,6 @@
|
|
|
228
227
|
var value = _ref3.target.value;
|
|
229
228
|
return onFocus(id, value);
|
|
230
229
|
};
|
|
231
|
-
var displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema) && (!!label || !!schema.title);
|
|
232
230
|
return jsxRuntime.jsxs(react.FormControl, _extends({
|
|
233
231
|
mb: 1
|
|
234
232
|
}, chakraProps, {
|
|
@@ -236,11 +234,11 @@
|
|
|
236
234
|
isRequired: required,
|
|
237
235
|
isReadOnly: readonly,
|
|
238
236
|
isInvalid: rawErrors && rawErrors.length > 0,
|
|
239
|
-
children: [
|
|
237
|
+
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
240
238
|
htmlFor: id,
|
|
241
239
|
id: id + "-label",
|
|
242
|
-
children: label
|
|
243
|
-
})
|
|
240
|
+
children: label
|
|
241
|
+
}), hideLabel || !label), jsxRuntime.jsx(react.Input, _extends({
|
|
244
242
|
id: id,
|
|
245
243
|
name: id,
|
|
246
244
|
value: value || value === 0 ? value : '',
|
|
@@ -467,16 +465,16 @@
|
|
|
467
465
|
// Button templates are not overridden in the uiSchema
|
|
468
466
|
var AddButton = registry.templates.ButtonTemplates.AddButton;
|
|
469
467
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
470
|
-
children: [
|
|
468
|
+
children: [title && jsxRuntime.jsx(TitleFieldTemplate, {
|
|
471
469
|
id: utils.titleId(idSchema),
|
|
472
|
-
title:
|
|
470
|
+
title: title,
|
|
473
471
|
required: required,
|
|
474
472
|
schema: schema,
|
|
475
473
|
uiSchema: uiSchema,
|
|
476
474
|
registry: registry
|
|
477
|
-
}),
|
|
475
|
+
}), description && jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
478
476
|
id: utils.descriptionId(idSchema),
|
|
479
|
-
description:
|
|
477
|
+
description: description,
|
|
480
478
|
schema: schema,
|
|
481
479
|
uiSchema: uiSchema,
|
|
482
480
|
registry: registry
|
|
@@ -812,6 +810,9 @@
|
|
|
812
810
|
onBlur = props.onBlur,
|
|
813
811
|
onFocus = props.onFocus,
|
|
814
812
|
label = props.label,
|
|
813
|
+
hideLabel = props.hideLabel,
|
|
814
|
+
registry = props.registry,
|
|
815
|
+
options = props.options,
|
|
815
816
|
uiSchema = props.uiSchema,
|
|
816
817
|
schema = props.schema;
|
|
817
818
|
var chakraProps = getChakra({
|
|
@@ -821,6 +822,8 @@
|
|
|
821
822
|
// the "required" attribute if the field value must be "true", due to the
|
|
822
823
|
// "const" or "enum" keywords
|
|
823
824
|
var required = utils.schemaRequiresTrueValue(schema);
|
|
825
|
+
var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, options);
|
|
826
|
+
var description = options.description || schema.description;
|
|
824
827
|
var _onChange = function _onChange(_ref) {
|
|
825
828
|
var checked = _ref.target.checked;
|
|
826
829
|
return onChange(checked);
|
|
@@ -833,11 +836,17 @@
|
|
|
833
836
|
var value = _ref3.target.value;
|
|
834
837
|
return onFocus(id, value);
|
|
835
838
|
};
|
|
836
|
-
return jsxRuntime.
|
|
839
|
+
return jsxRuntime.jsxs(react.FormControl, _extends({
|
|
837
840
|
mb: 1
|
|
838
841
|
}, chakraProps, {
|
|
839
842
|
isRequired: required,
|
|
840
|
-
children: jsxRuntime.jsx(
|
|
843
|
+
children: [!hideLabel && !!description && jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
844
|
+
id: utils.descriptionId(id),
|
|
845
|
+
description: description,
|
|
846
|
+
schema: schema,
|
|
847
|
+
uiSchema: uiSchema,
|
|
848
|
+
registry: registry
|
|
849
|
+
}), jsxRuntime.jsx(react.Checkbox, {
|
|
841
850
|
id: id,
|
|
842
851
|
name: id,
|
|
843
852
|
isChecked: typeof value === 'undefined' ? false : value,
|
|
@@ -846,10 +855,10 @@
|
|
|
846
855
|
onBlur: _onBlur,
|
|
847
856
|
onFocus: _onFocus,
|
|
848
857
|
"aria-describedby": utils.ariaDescribedByIds(id),
|
|
849
|
-
children:
|
|
858
|
+
children: utils.labelValue(jsxRuntime.jsx(react.Text, {
|
|
850
859
|
children: label
|
|
851
|
-
})
|
|
852
|
-
})
|
|
860
|
+
}), hideLabel || !label)
|
|
861
|
+
})]
|
|
853
862
|
}));
|
|
854
863
|
}
|
|
855
864
|
|
|
@@ -864,10 +873,10 @@
|
|
|
864
873
|
onFocus = props.onFocus,
|
|
865
874
|
required = props.required,
|
|
866
875
|
label = props.label,
|
|
876
|
+
hideLabel = props.hideLabel,
|
|
867
877
|
uiSchema = props.uiSchema,
|
|
868
878
|
_props$rawErrors = props.rawErrors,
|
|
869
|
-
rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors
|
|
870
|
-
schema = props.schema;
|
|
879
|
+
rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors;
|
|
871
880
|
var enumOptions = options.enumOptions,
|
|
872
881
|
enumDisabled = options.enumDisabled,
|
|
873
882
|
emptyValue = options.emptyValue;
|
|
@@ -892,11 +901,11 @@
|
|
|
892
901
|
isRequired: required,
|
|
893
902
|
isReadOnly: readonly,
|
|
894
903
|
isInvalid: rawErrors && rawErrors.length > 0,
|
|
895
|
-
children: [jsxRuntime.jsx(react.FormLabel, {
|
|
904
|
+
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
896
905
|
htmlFor: id,
|
|
897
906
|
id: id + "-label",
|
|
898
|
-
children: label
|
|
899
|
-
}), jsxRuntime.jsx(react.CheckboxGroup, {
|
|
907
|
+
children: label
|
|
908
|
+
}), hideLabel || !label), jsxRuntime.jsx(react.CheckboxGroup, {
|
|
900
909
|
onChange: function onChange(option) {
|
|
901
910
|
return _onChange(utils.enumOptionsValueForIndex(option, enumOptions, emptyValue));
|
|
902
911
|
},
|
|
@@ -926,14 +935,15 @@
|
|
|
926
935
|
}
|
|
927
936
|
|
|
928
937
|
function RadioWidget(_ref) {
|
|
938
|
+
var _enumOptionsIndexForV;
|
|
929
939
|
var id = _ref.id,
|
|
930
|
-
schema = _ref.schema,
|
|
931
940
|
options = _ref.options,
|
|
932
941
|
value = _ref.value,
|
|
933
942
|
required = _ref.required,
|
|
934
943
|
disabled = _ref.disabled,
|
|
935
944
|
readonly = _ref.readonly,
|
|
936
945
|
label = _ref.label,
|
|
946
|
+
hideLabel = _ref.hideLabel,
|
|
937
947
|
onChange = _ref.onChange,
|
|
938
948
|
onBlur = _ref.onBlur,
|
|
939
949
|
onFocus = _ref.onFocus,
|
|
@@ -956,18 +966,18 @@
|
|
|
956
966
|
return onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
957
967
|
};
|
|
958
968
|
var row = options ? options.inline : false;
|
|
959
|
-
var selectedIndex = utils.enumOptionsIndexForValue(value, enumOptions);
|
|
969
|
+
var selectedIndex = (_enumOptionsIndexForV = utils.enumOptionsIndexForValue(value, enumOptions)) != null ? _enumOptionsIndexForV : null;
|
|
960
970
|
return jsxRuntime.jsxs(react.FormControl, _extends({
|
|
961
971
|
mb: 1
|
|
962
972
|
}, chakraProps, {
|
|
963
973
|
isDisabled: disabled || readonly,
|
|
964
974
|
isRequired: required,
|
|
965
975
|
isReadOnly: readonly,
|
|
966
|
-
children: [jsxRuntime.jsx(react.FormLabel, {
|
|
976
|
+
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
967
977
|
htmlFor: id,
|
|
968
978
|
id: id + "-label",
|
|
969
|
-
children: label
|
|
970
|
-
}), jsxRuntime.jsx(react.RadioGroup, {
|
|
979
|
+
children: label
|
|
980
|
+
}), hideLabel || !label), jsxRuntime.jsx(react.RadioGroup, {
|
|
971
981
|
onChange: _onChange,
|
|
972
982
|
onBlur: _onBlur,
|
|
973
983
|
onFocus: _onFocus,
|
|
@@ -1001,9 +1011,8 @@
|
|
|
1001
1011
|
uiSchema = _ref.uiSchema,
|
|
1002
1012
|
onChange = _ref.onChange,
|
|
1003
1013
|
label = _ref.label,
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
var schemaUtils = registry.schemaUtils;
|
|
1014
|
+
hideLabel = _ref.hideLabel,
|
|
1015
|
+
id = _ref.id;
|
|
1007
1016
|
var chakraProps = getChakra({
|
|
1008
1017
|
uiSchema: uiSchema
|
|
1009
1018
|
});
|
|
@@ -1012,7 +1021,6 @@
|
|
|
1012
1021
|
label: label,
|
|
1013
1022
|
id: id
|
|
1014
1023
|
}, utils.rangeSpec(schema));
|
|
1015
|
-
var displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema) && (!!label || !!schema.title);
|
|
1016
1024
|
var _onChange = function _onChange(value) {
|
|
1017
1025
|
return onChange(value === undefined ? options.emptyValue : value);
|
|
1018
1026
|
};
|
|
@@ -1027,10 +1035,10 @@
|
|
|
1027
1035
|
return jsxRuntime.jsxs(react.FormControl, _extends({
|
|
1028
1036
|
mb: 1
|
|
1029
1037
|
}, chakraProps, {
|
|
1030
|
-
children: [
|
|
1038
|
+
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
1031
1039
|
htmlFor: id,
|
|
1032
|
-
children: label
|
|
1033
|
-
})
|
|
1040
|
+
children: label
|
|
1041
|
+
}), hideLabel || !label), jsxRuntime.jsxs(react.Slider, _extends({}, sliderWidgetProps, {
|
|
1034
1042
|
id: id,
|
|
1035
1043
|
name: id,
|
|
1036
1044
|
isDisabled: disabled || readonly,
|
|
@@ -1046,10 +1054,10 @@
|
|
|
1046
1054
|
}
|
|
1047
1055
|
|
|
1048
1056
|
function SelectWidget(props) {
|
|
1049
|
-
var
|
|
1050
|
-
id = props.id,
|
|
1057
|
+
var id = props.id,
|
|
1051
1058
|
options = props.options,
|
|
1052
1059
|
label = props.label,
|
|
1060
|
+
hideLabel = props.hideLabel,
|
|
1053
1061
|
placeholder = props.placeholder,
|
|
1054
1062
|
multiple = props.multiple,
|
|
1055
1063
|
required = props.required,
|
|
@@ -1114,10 +1122,10 @@
|
|
|
1114
1122
|
isRequired: required,
|
|
1115
1123
|
isReadOnly: readonly,
|
|
1116
1124
|
isInvalid: rawErrors && rawErrors.length > 0,
|
|
1117
|
-
children: [(
|
|
1125
|
+
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
1118
1126
|
htmlFor: isMultiple ? undefined : id,
|
|
1119
|
-
children: label
|
|
1120
|
-
}), jsxRuntime.jsx(chakraReactSelect.Select, {
|
|
1127
|
+
children: label
|
|
1128
|
+
}), hideLabel || !label), jsxRuntime.jsx(chakraReactSelect.Select, {
|
|
1121
1129
|
inputId: id,
|
|
1122
1130
|
name: id,
|
|
1123
1131
|
isMulti: isMultiple,
|
|
@@ -1139,6 +1147,7 @@
|
|
|
1139
1147
|
placeholder = _ref.placeholder,
|
|
1140
1148
|
value = _ref.value,
|
|
1141
1149
|
label = _ref.label,
|
|
1150
|
+
hideLabel = _ref.hideLabel,
|
|
1142
1151
|
disabled = _ref.disabled,
|
|
1143
1152
|
autofocus = _ref.autofocus,
|
|
1144
1153
|
readonly = _ref.readonly,
|
|
@@ -1146,16 +1155,12 @@
|
|
|
1146
1155
|
onFocus = _ref.onFocus,
|
|
1147
1156
|
onChange = _ref.onChange,
|
|
1148
1157
|
options = _ref.options,
|
|
1149
|
-
schema = _ref.schema,
|
|
1150
1158
|
uiSchema = _ref.uiSchema,
|
|
1151
1159
|
required = _ref.required,
|
|
1152
|
-
rawErrors = _ref.rawErrors
|
|
1153
|
-
registry = _ref.registry;
|
|
1160
|
+
rawErrors = _ref.rawErrors;
|
|
1154
1161
|
var chakraProps = getChakra({
|
|
1155
1162
|
uiSchema: uiSchema
|
|
1156
1163
|
});
|
|
1157
|
-
var schemaUtils = registry.schemaUtils;
|
|
1158
|
-
var displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema) && (!!label || !!schema.title);
|
|
1159
1164
|
var _onChange = function _onChange(_ref2) {
|
|
1160
1165
|
var value = _ref2.target.value;
|
|
1161
1166
|
return onChange(value === '' ? options.emptyValue : value);
|
|
@@ -1175,10 +1180,10 @@
|
|
|
1175
1180
|
isRequired: required,
|
|
1176
1181
|
isReadOnly: readonly,
|
|
1177
1182
|
isInvalid: rawErrors && rawErrors.length > 0,
|
|
1178
|
-
children: [
|
|
1183
|
+
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
1179
1184
|
htmlFor: id,
|
|
1180
|
-
children: label
|
|
1181
|
-
})
|
|
1185
|
+
children: label
|
|
1186
|
+
}), hideLabel || !label), jsxRuntime.jsx(react.Textarea, {
|
|
1182
1187
|
id: id,
|
|
1183
1188
|
name: id,
|
|
1184
1189
|
value: value != null ? value : '',
|
|
@@ -1194,20 +1199,17 @@
|
|
|
1194
1199
|
|
|
1195
1200
|
function UpDownWidget(props) {
|
|
1196
1201
|
var id = props.id,
|
|
1197
|
-
schema = props.schema,
|
|
1198
1202
|
uiSchema = props.uiSchema,
|
|
1199
1203
|
readonly = props.readonly,
|
|
1200
1204
|
disabled = props.disabled,
|
|
1201
1205
|
label = props.label,
|
|
1206
|
+
hideLabel = props.hideLabel,
|
|
1202
1207
|
value = props.value,
|
|
1203
1208
|
onChange = props.onChange,
|
|
1204
1209
|
onBlur = props.onBlur,
|
|
1205
1210
|
onFocus = props.onFocus,
|
|
1206
1211
|
rawErrors = props.rawErrors,
|
|
1207
|
-
required = props.required
|
|
1208
|
-
registry = props.registry;
|
|
1209
|
-
var schemaUtils = registry.schemaUtils;
|
|
1210
|
-
var displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema) && (!!label || !!schema.title);
|
|
1212
|
+
required = props.required;
|
|
1211
1213
|
var chakraProps = getChakra({
|
|
1212
1214
|
uiSchema: uiSchema
|
|
1213
1215
|
});
|
|
@@ -1229,10 +1231,10 @@
|
|
|
1229
1231
|
isRequired: required,
|
|
1230
1232
|
isReadOnly: readonly,
|
|
1231
1233
|
isInvalid: rawErrors && rawErrors.length > 0,
|
|
1232
|
-
children: [
|
|
1234
|
+
children: [utils.labelValue(jsxRuntime.jsx(react.FormLabel, {
|
|
1233
1235
|
htmlFor: id,
|
|
1234
|
-
children: label
|
|
1235
|
-
})
|
|
1236
|
+
children: label
|
|
1237
|
+
}), hideLabel || !label), jsxRuntime.jsxs(react.NumberInput, {
|
|
1236
1238
|
value: value != null ? value : '',
|
|
1237
1239
|
onChange: _onChange,
|
|
1238
1240
|
onBlur: _onBlur,
|