@rjsf/semantic-ui 5.3.0 → 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/semantic-ui.cjs.development.js +46 -39
- package/dist/semantic-ui.cjs.development.js.map +1 -1
- package/dist/semantic-ui.cjs.production.min.js +1 -1
- package/dist/semantic-ui.cjs.production.min.js.map +1 -1
- package/dist/semantic-ui.esm.js +47 -40
- package/dist/semantic-ui.esm.js.map +1 -1
- package/dist/semantic-ui.umd.development.js +46 -39
- package/dist/semantic-ui.umd.development.js.map +1 -1
- package/dist/semantic-ui.umd.production.min.js +1 -1
- package/dist/semantic-ui.umd.production.min.js.map +1 -1
- package/package.json +6 -6
|
@@ -338,6 +338,7 @@
|
|
|
338
338
|
var id = props.id,
|
|
339
339
|
placeholder = props.placeholder,
|
|
340
340
|
label = props.label,
|
|
341
|
+
hideLabel = props.hideLabel,
|
|
341
342
|
value = props.value,
|
|
342
343
|
required = props.required,
|
|
343
344
|
readonly = props.readonly,
|
|
@@ -352,7 +353,6 @@
|
|
|
352
353
|
uiSchema = props.uiSchema,
|
|
353
354
|
formContext = props.formContext,
|
|
354
355
|
type = props.type,
|
|
355
|
-
registry = props.registry,
|
|
356
356
|
_props$rawErrors = props.rawErrors,
|
|
357
357
|
rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors;
|
|
358
358
|
var inputProps = utils.getInputProps(schema, type, options);
|
|
@@ -361,7 +361,6 @@
|
|
|
361
361
|
formContext: formContext,
|
|
362
362
|
options: options
|
|
363
363
|
});
|
|
364
|
-
var schemaUtils = registry.schemaUtils;
|
|
365
364
|
var _onChange = function _onChange(_ref) {
|
|
366
365
|
var value = _ref.target.value;
|
|
367
366
|
return onChange(value === '' ? options.emptyValue : value);
|
|
@@ -372,14 +371,13 @@
|
|
|
372
371
|
var _onFocus = function _onFocus() {
|
|
373
372
|
return onFocus && onFocus(id, value);
|
|
374
373
|
};
|
|
375
|
-
var displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema);
|
|
376
374
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
377
375
|
children: [jsxRuntime.jsx(semanticUiReact.Form.Input, _extends({
|
|
378
376
|
id: id,
|
|
379
377
|
name: id,
|
|
380
378
|
placeholder: placeholder
|
|
381
379
|
}, inputProps, {
|
|
382
|
-
label:
|
|
380
|
+
label: utils.labelValue(label || undefined, hideLabel, false),
|
|
383
381
|
required: required,
|
|
384
382
|
autoFocus: autofocus,
|
|
385
383
|
disabled: disabled || readonly,
|
|
@@ -641,19 +639,17 @@
|
|
|
641
639
|
var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, uiOptions);
|
|
642
640
|
// Button templates are not overridden in the uiSchema
|
|
643
641
|
var AddButton = registry.templates.ButtonTemplates.AddButton;
|
|
644
|
-
var fieldTitle = uiOptions.title || title;
|
|
645
|
-
var fieldDescription = uiOptions.description || description;
|
|
646
642
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
647
|
-
children: [
|
|
643
|
+
children: [title && jsxRuntime.jsx(TitleFieldTemplate, {
|
|
648
644
|
id: utils.titleId(idSchema),
|
|
649
|
-
title:
|
|
645
|
+
title: title,
|
|
650
646
|
required: required,
|
|
651
647
|
schema: schema,
|
|
652
648
|
uiSchema: uiSchema,
|
|
653
649
|
registry: registry
|
|
654
|
-
}),
|
|
650
|
+
}), description && jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
655
651
|
id: utils.descriptionId(idSchema),
|
|
656
|
-
description:
|
|
652
|
+
description: description,
|
|
657
653
|
schema: schema,
|
|
658
654
|
uiSchema: uiSchema,
|
|
659
655
|
registry: registry
|
|
@@ -845,11 +841,14 @@
|
|
|
845
841
|
* @param props - The `WidgetProps` for this component
|
|
846
842
|
*/
|
|
847
843
|
function CheckboxWidget(props) {
|
|
844
|
+
var _options$description;
|
|
848
845
|
var id = props.id,
|
|
849
846
|
value = props.value,
|
|
850
847
|
disabled = props.disabled,
|
|
851
848
|
readonly = props.readonly,
|
|
852
|
-
label = props.label,
|
|
849
|
+
_props$label = props.label,
|
|
850
|
+
label = _props$label === void 0 ? '' : _props$label,
|
|
851
|
+
hideLabel = props.hideLabel,
|
|
853
852
|
autofocus = props.autofocus,
|
|
854
853
|
onChange = props.onChange,
|
|
855
854
|
onBlur = props.onBlur,
|
|
@@ -859,7 +858,8 @@
|
|
|
859
858
|
schema = props.schema,
|
|
860
859
|
uiSchema = props.uiSchema,
|
|
861
860
|
_props$rawErrors = props.rawErrors,
|
|
862
|
-
rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors
|
|
861
|
+
rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors,
|
|
862
|
+
registry = props.registry;
|
|
863
863
|
var semanticProps = getSemanticProps({
|
|
864
864
|
options: options,
|
|
865
865
|
formContext: formContext,
|
|
@@ -868,6 +868,7 @@
|
|
|
868
868
|
inverted: 'false'
|
|
869
869
|
}
|
|
870
870
|
});
|
|
871
|
+
var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, options);
|
|
871
872
|
// Because an unchecked checkbox will cause html5 validation to fail, only add
|
|
872
873
|
// the "required" attribute if the field value must be "true", due to the
|
|
873
874
|
// "const" or "enum" keywords
|
|
@@ -882,21 +883,30 @@
|
|
|
882
883
|
return onFocus && onFocus(id, value);
|
|
883
884
|
};
|
|
884
885
|
var checked = value == 'true' || value == true;
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
886
|
+
var description = (_options$description = options.description) != null ? _options$description : schema.description;
|
|
887
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
888
|
+
children: [!hideLabel && !!description && jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
889
|
+
id: utils.descriptionId(id),
|
|
890
|
+
description: description,
|
|
891
|
+
schema: schema,
|
|
892
|
+
uiSchema: uiSchema,
|
|
893
|
+
registry: registry
|
|
894
|
+
}), jsxRuntime.jsx(semanticUiReact.Form.Checkbox, _extends({
|
|
895
|
+
id: id,
|
|
896
|
+
name: id,
|
|
897
|
+
disabled: disabled || readonly,
|
|
898
|
+
autoFocus: autofocus
|
|
899
|
+
}, semanticProps, {
|
|
900
|
+
checked: typeof value === 'undefined' ? false : checked,
|
|
901
|
+
error: rawErrors.length > 0,
|
|
902
|
+
onChange: _onChange,
|
|
903
|
+
onBlur: _onBlur,
|
|
904
|
+
onFocus: _onFocus,
|
|
905
|
+
required: required,
|
|
906
|
+
label: utils.labelValue(label, hideLabel, false),
|
|
907
|
+
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
908
|
+
}))]
|
|
909
|
+
});
|
|
900
910
|
}
|
|
901
911
|
|
|
902
912
|
/** The `CheckboxesWidget` is a widget for rendering checkbox groups.
|
|
@@ -911,6 +921,8 @@
|
|
|
911
921
|
value = props.value,
|
|
912
922
|
autofocus = props.autofocus,
|
|
913
923
|
readonly = props.readonly,
|
|
924
|
+
label = props.label,
|
|
925
|
+
hideLabel = props.hideLabel,
|
|
914
926
|
onChange = props.onChange,
|
|
915
927
|
onBlur = props.onBlur,
|
|
916
928
|
onFocus = props.onFocus,
|
|
@@ -925,7 +937,6 @@
|
|
|
925
937
|
enumDisabled = options.enumDisabled,
|
|
926
938
|
inline = options.inline;
|
|
927
939
|
var checkboxesValues = Array.isArray(value) ? value : [value];
|
|
928
|
-
var title = schema.title;
|
|
929
940
|
var semanticProps = getSemanticProps({
|
|
930
941
|
options: options,
|
|
931
942
|
formContext: formContext,
|
|
@@ -957,9 +968,9 @@
|
|
|
957
968
|
grouped: true
|
|
958
969
|
};
|
|
959
970
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
960
|
-
children: [
|
|
971
|
+
children: [!hideLabel && !!label && jsxRuntime.jsx(TitleFieldTemplate, {
|
|
961
972
|
id: utils.titleId(id),
|
|
962
|
-
title:
|
|
973
|
+
title: label,
|
|
963
974
|
schema: schema,
|
|
964
975
|
uiSchema: uiSchema,
|
|
965
976
|
registry: registry
|
|
@@ -1141,12 +1152,12 @@
|
|
|
1141
1152
|
* @param props - The `WidgetProps` for this component
|
|
1142
1153
|
*/
|
|
1143
1154
|
function SelectWidget(props) {
|
|
1144
|
-
var
|
|
1145
|
-
uiSchema = props.uiSchema,
|
|
1155
|
+
var uiSchema = props.uiSchema,
|
|
1146
1156
|
formContext = props.formContext,
|
|
1147
1157
|
id = props.id,
|
|
1148
1158
|
options = props.options,
|
|
1149
1159
|
label = props.label,
|
|
1160
|
+
hideLabel = props.hideLabel,
|
|
1150
1161
|
required = props.required,
|
|
1151
1162
|
disabled = props.disabled,
|
|
1152
1163
|
readonly = props.readonly,
|
|
@@ -1193,7 +1204,7 @@
|
|
|
1193
1204
|
return jsxRuntime.jsx(semanticUiReact.Form.Dropdown, _extends({
|
|
1194
1205
|
id: id,
|
|
1195
1206
|
name: id,
|
|
1196
|
-
label: label ||
|
|
1207
|
+
label: utils.labelValue(label || undefined, hideLabel, false),
|
|
1197
1208
|
multiple: typeof multiple === 'undefined' ? false : multiple,
|
|
1198
1209
|
value: typeof value === 'undefined' ? emptyValue : selectedIndexes,
|
|
1199
1210
|
error: rawErrors.length > 0,
|
|
@@ -1223,15 +1234,13 @@
|
|
|
1223
1234
|
disabled = props.disabled,
|
|
1224
1235
|
autofocus = props.autofocus,
|
|
1225
1236
|
label = props.label,
|
|
1237
|
+
hideLabel = props.hideLabel,
|
|
1226
1238
|
readonly = props.readonly,
|
|
1227
1239
|
onBlur = props.onBlur,
|
|
1228
1240
|
onFocus = props.onFocus,
|
|
1229
1241
|
onChange = props.onChange,
|
|
1230
1242
|
options = props.options,
|
|
1231
|
-
schema = props.schema,
|
|
1232
|
-
uiSchema = props.uiSchema,
|
|
1233
1243
|
formContext = props.formContext,
|
|
1234
|
-
registry = props.registry,
|
|
1235
1244
|
_props$rawErrors = props.rawErrors,
|
|
1236
1245
|
rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors;
|
|
1237
1246
|
var semanticProps = getSemanticProps({
|
|
@@ -1241,7 +1250,6 @@
|
|
|
1241
1250
|
inverted: 'false'
|
|
1242
1251
|
}
|
|
1243
1252
|
});
|
|
1244
|
-
var schemaUtils = registry.schemaUtils;
|
|
1245
1253
|
// eslint-disable-next-line no-shadow
|
|
1246
1254
|
var _onChange = function _onChange(_ref) {
|
|
1247
1255
|
var value = _ref.target.value;
|
|
@@ -1253,11 +1261,10 @@
|
|
|
1253
1261
|
var _onFocus = function _onFocus() {
|
|
1254
1262
|
return onFocus && onFocus(id, value);
|
|
1255
1263
|
};
|
|
1256
|
-
var displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema);
|
|
1257
1264
|
return jsxRuntime.jsx(semanticUiReact.Form.TextArea, _extends({
|
|
1258
1265
|
id: id,
|
|
1259
1266
|
name: id,
|
|
1260
|
-
label:
|
|
1267
|
+
label: utils.labelValue(label || undefined, hideLabel, false),
|
|
1261
1268
|
placeholder: placeholder,
|
|
1262
1269
|
autoFocus: autofocus,
|
|
1263
1270
|
required: required,
|