@rjsf/antd 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/antd.cjs.development.js +130 -67
- package/dist/antd.cjs.development.js.map +1 -1
- package/dist/antd.cjs.production.min.js +1 -1
- package/dist/antd.cjs.production.min.js.map +1 -1
- package/dist/antd.esm.js +131 -68
- package/dist/antd.esm.js.map +1 -1
- package/dist/antd.umd.development.js +130 -67
- package/dist/antd.umd.development.js.map +1 -1
- package/dist/antd.umd.production.min.js +1 -1
- package/dist/antd.umd.production.min.js.map +1 -1
- package/package.json +6 -6
|
@@ -226,7 +226,7 @@ function ArrayFieldTemplate(props) {
|
|
|
226
226
|
span: 24,
|
|
227
227
|
style: DESCRIPTION_COL_STYLE$1,
|
|
228
228
|
children: jsxRuntime.jsx(ArrayFieldDescriptionTemplate, {
|
|
229
|
-
description: uiOptions.description || schema.description
|
|
229
|
+
description: uiOptions.description || schema.description,
|
|
230
230
|
idSchema: idSchema,
|
|
231
231
|
schema: schema,
|
|
232
232
|
uiSchema: uiSchema,
|
|
@@ -508,7 +508,9 @@ function FieldTemplate(props) {
|
|
|
508
508
|
labelCol = _formContext$labelCol === void 0 ? VERTICAL_LABEL_COL$1 : _formContext$labelCol,
|
|
509
509
|
_formContext$wrapperC = formContext.wrapperCol,
|
|
510
510
|
wrapperCol = _formContext$wrapperC === void 0 ? VERTICAL_WRAPPER_COL$1 : _formContext$wrapperC,
|
|
511
|
-
wrapperStyle = formContext.wrapperStyle
|
|
511
|
+
wrapperStyle = formContext.wrapperStyle,
|
|
512
|
+
_formContext$descript = formContext.descriptionLocation,
|
|
513
|
+
descriptionLocation = _formContext$descript === void 0 ? 'below' : _formContext$descript;
|
|
512
514
|
var uiOptions = utils.getUiOptions(uiSchema);
|
|
513
515
|
var WrapIfAdditionalTemplate = utils.getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
|
|
514
516
|
if (hidden) {
|
|
@@ -517,6 +519,19 @@ function FieldTemplate(props) {
|
|
|
517
519
|
children: children
|
|
518
520
|
});
|
|
519
521
|
}
|
|
522
|
+
// check to see if there is rawDescription(string) before using description(ReactNode)
|
|
523
|
+
// to prevent showing a blank description area
|
|
524
|
+
var descriptionNode = rawDescription ? description : undefined;
|
|
525
|
+
var descriptionProps = {};
|
|
526
|
+
switch (descriptionLocation) {
|
|
527
|
+
case 'tooltip':
|
|
528
|
+
descriptionProps.tooltip = descriptionNode;
|
|
529
|
+
break;
|
|
530
|
+
case 'below':
|
|
531
|
+
default:
|
|
532
|
+
descriptionProps.extra = descriptionNode;
|
|
533
|
+
break;
|
|
534
|
+
}
|
|
520
535
|
return jsxRuntime.jsx(WrapIfAdditionalTemplate, {
|
|
521
536
|
classNames: classNames,
|
|
522
537
|
style: style,
|
|
@@ -530,9 +545,8 @@ function FieldTemplate(props) {
|
|
|
530
545
|
schema: schema,
|
|
531
546
|
uiSchema: uiSchema,
|
|
532
547
|
registry: registry,
|
|
533
|
-
children: id === 'root' ? children : jsxRuntime.jsx(Form__default["default"].Item, {
|
|
548
|
+
children: id === 'root' ? children : jsxRuntime.jsx(Form__default["default"].Item, _extends({
|
|
534
549
|
colon: colon,
|
|
535
|
-
extra: rawDescription && description,
|
|
536
550
|
hasFeedback: schema.type !== 'array' && schema.type !== 'object',
|
|
537
551
|
help: !!rawHelp && help || (rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? errors : undefined),
|
|
538
552
|
htmlFor: id,
|
|
@@ -541,9 +555,10 @@ function FieldTemplate(props) {
|
|
|
541
555
|
required: required,
|
|
542
556
|
style: wrapperStyle,
|
|
543
557
|
validateStatus: rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? 'error' : undefined,
|
|
544
|
-
wrapperCol: wrapperCol
|
|
558
|
+
wrapperCol: wrapperCol
|
|
559
|
+
}, descriptionProps, {
|
|
545
560
|
children: children
|
|
546
|
-
})
|
|
561
|
+
}))
|
|
547
562
|
});
|
|
548
563
|
}
|
|
549
564
|
|
|
@@ -633,23 +648,23 @@ function ObjectFieldTemplate(props) {
|
|
|
633
648
|
id: idSchema.$id,
|
|
634
649
|
children: [jsxRuntime.jsxs(Row__default["default"], {
|
|
635
650
|
gutter: rowGutter,
|
|
636
|
-
children: [
|
|
651
|
+
children: [title && jsxRuntime.jsx(Col__default["default"], {
|
|
637
652
|
className: labelColClassName,
|
|
638
653
|
span: 24,
|
|
639
654
|
children: jsxRuntime.jsx(TitleFieldTemplate, {
|
|
640
655
|
id: utils.titleId(idSchema),
|
|
641
|
-
title:
|
|
656
|
+
title: title,
|
|
642
657
|
required: required,
|
|
643
658
|
schema: schema,
|
|
644
659
|
uiSchema: uiSchema,
|
|
645
660
|
registry: registry
|
|
646
661
|
})
|
|
647
|
-
}),
|
|
662
|
+
}), description && jsxRuntime.jsx(Col__default["default"], {
|
|
648
663
|
span: 24,
|
|
649
664
|
style: DESCRIPTION_COL_STYLE,
|
|
650
665
|
children: jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
651
666
|
id: utils.descriptionId(idSchema),
|
|
652
|
-
description:
|
|
667
|
+
description: description,
|
|
653
668
|
schema: schema,
|
|
654
669
|
uiSchema: uiSchema,
|
|
655
670
|
registry: registry
|
|
@@ -1086,14 +1101,20 @@ function CheckboxesWidget(_ref) {
|
|
|
1086
1101
|
disabled = _ref.disabled,
|
|
1087
1102
|
formContext = _ref.formContext,
|
|
1088
1103
|
id = _ref.id,
|
|
1104
|
+
label = _ref.label,
|
|
1105
|
+
hideLabel = _ref.hideLabel,
|
|
1089
1106
|
onBlur = _ref.onBlur,
|
|
1090
1107
|
onChange = _ref.onChange,
|
|
1091
1108
|
onFocus = _ref.onFocus,
|
|
1092
1109
|
options = _ref.options,
|
|
1093
1110
|
readonly = _ref.readonly,
|
|
1111
|
+
registry = _ref.registry,
|
|
1112
|
+
schema = _ref.schema,
|
|
1113
|
+
uiSchema = _ref.uiSchema,
|
|
1094
1114
|
value = _ref.value;
|
|
1095
1115
|
var _formContext$readonly = formContext.readonlyAsDisabled,
|
|
1096
1116
|
readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
|
|
1117
|
+
var TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, options);
|
|
1097
1118
|
var enumOptions = options.enumOptions,
|
|
1098
1119
|
enumDisabled = options.enumDisabled,
|
|
1099
1120
|
inline = options.inline,
|
|
@@ -1117,26 +1138,36 @@ function CheckboxesWidget(_ref) {
|
|
|
1117
1138
|
onFocus: !readonly ? handleFocus : undefined
|
|
1118
1139
|
};
|
|
1119
1140
|
var selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, true);
|
|
1120
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ? jsxRuntime.
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1141
|
+
return Array.isArray(enumOptions) && enumOptions.length > 0 ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1142
|
+
children: [!hideLabel && !!label && jsxRuntime.jsx("div", {
|
|
1143
|
+
children: jsxRuntime.jsx(TitleFieldTemplate, {
|
|
1144
|
+
id: utils.titleId(id),
|
|
1145
|
+
title: label,
|
|
1146
|
+
schema: schema,
|
|
1147
|
+
uiSchema: uiSchema,
|
|
1148
|
+
registry: registry
|
|
1149
|
+
})
|
|
1150
|
+
}), jsxRuntime.jsx(Checkbox__default["default"].Group, _extends({
|
|
1151
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1152
|
+
name: id,
|
|
1153
|
+
onChange: !readonly ? handleChange : undefined,
|
|
1154
|
+
value: selectedIndexes
|
|
1155
|
+
}, extraProps, {
|
|
1156
|
+
"aria-describedby": utils.ariaDescribedByIds(id),
|
|
1157
|
+
children: Array.isArray(enumOptions) && enumOptions.map(function (option, i) {
|
|
1158
|
+
return jsxRuntime.jsxs("span", {
|
|
1159
|
+
children: [jsxRuntime.jsx(Checkbox__default["default"], {
|
|
1160
|
+
id: utils.optionId(id, i),
|
|
1161
|
+
name: id,
|
|
1162
|
+
autoFocus: i === 0 ? autofocus : false,
|
|
1163
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
|
|
1164
|
+
value: String(i),
|
|
1165
|
+
children: option.label
|
|
1166
|
+
}), !inline && jsxRuntime.jsx("br", {})]
|
|
1167
|
+
}, i);
|
|
1168
|
+
})
|
|
1169
|
+
}))]
|
|
1170
|
+
}) : null;
|
|
1140
1171
|
}
|
|
1141
1172
|
|
|
1142
1173
|
/** The `CheckBoxWidget` is a widget for rendering boolean properties.
|
|
@@ -1145,18 +1176,25 @@ function CheckboxesWidget(_ref) {
|
|
|
1145
1176
|
* @param props - The `WidgetProps` for this component
|
|
1146
1177
|
*/
|
|
1147
1178
|
function CheckboxWidget(props) {
|
|
1179
|
+
var _options$description;
|
|
1148
1180
|
var autofocus = props.autofocus,
|
|
1149
1181
|
disabled = props.disabled,
|
|
1150
1182
|
formContext = props.formContext,
|
|
1151
1183
|
id = props.id,
|
|
1152
1184
|
label = props.label,
|
|
1185
|
+
hideLabel = props.hideLabel,
|
|
1153
1186
|
onBlur = props.onBlur,
|
|
1154
1187
|
onChange = props.onChange,
|
|
1155
1188
|
onFocus = props.onFocus,
|
|
1156
1189
|
readonly = props.readonly,
|
|
1157
|
-
value = props.value
|
|
1190
|
+
value = props.value,
|
|
1191
|
+
registry = props.registry,
|
|
1192
|
+
options = props.options,
|
|
1193
|
+
schema = props.schema,
|
|
1194
|
+
uiSchema = props.uiSchema;
|
|
1158
1195
|
var _formContext$readonly = formContext.readonlyAsDisabled,
|
|
1159
1196
|
readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
|
|
1197
|
+
var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, options);
|
|
1160
1198
|
var handleChange = function handleChange(_ref) {
|
|
1161
1199
|
var target = _ref.target;
|
|
1162
1200
|
return onChange(target.checked);
|
|
@@ -1175,17 +1213,28 @@ function CheckboxWidget(props) {
|
|
|
1175
1213
|
onBlur: !readonly ? handleBlur : undefined,
|
|
1176
1214
|
onFocus: !readonly ? handleFocus : undefined
|
|
1177
1215
|
};
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1216
|
+
var description = (_options$description = options.description) != null ? _options$description : schema.description;
|
|
1217
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1218
|
+
children: [!hideLabel && !!description && jsxRuntime.jsx("div", {
|
|
1219
|
+
children: jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
1220
|
+
id: utils.descriptionId(id),
|
|
1221
|
+
description: description,
|
|
1222
|
+
schema: schema,
|
|
1223
|
+
uiSchema: uiSchema,
|
|
1224
|
+
registry: registry
|
|
1225
|
+
})
|
|
1226
|
+
}), jsxRuntime.jsx(Checkbox__default["default"], _extends({
|
|
1227
|
+
autoFocus: autofocus,
|
|
1228
|
+
checked: typeof value === 'undefined' ? false : value,
|
|
1229
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1230
|
+
id: id,
|
|
1231
|
+
name: id,
|
|
1232
|
+
onChange: !readonly ? handleChange : undefined
|
|
1233
|
+
}, extraProps, {
|
|
1234
|
+
"aria-describedby": utils.ariaDescribedByIds(id),
|
|
1235
|
+
children: utils.labelValue(label, hideLabel, '')
|
|
1236
|
+
}))]
|
|
1237
|
+
});
|
|
1189
1238
|
}
|
|
1190
1239
|
|
|
1191
1240
|
var DatePicker = /*#__PURE__*/generatePicker__default["default"](dayjsGenerateConfig__default["default"]);
|
|
@@ -1455,6 +1504,8 @@ function SelectWidget(_ref) {
|
|
|
1455
1504
|
_ref$formContext = _ref.formContext,
|
|
1456
1505
|
formContext = _ref$formContext === void 0 ? {} : _ref$formContext,
|
|
1457
1506
|
id = _ref.id,
|
|
1507
|
+
label = _ref.label,
|
|
1508
|
+
hideLabel = _ref.hideLabel,
|
|
1458
1509
|
multiple = _ref.multiple,
|
|
1459
1510
|
onBlur = _ref.onBlur,
|
|
1460
1511
|
onChange = _ref.onChange,
|
|
@@ -1462,9 +1513,13 @@ function SelectWidget(_ref) {
|
|
|
1462
1513
|
options = _ref.options,
|
|
1463
1514
|
placeholder = _ref.placeholder,
|
|
1464
1515
|
readonly = _ref.readonly,
|
|
1516
|
+
registry = _ref.registry,
|
|
1517
|
+
schema = _ref.schema,
|
|
1518
|
+
uiSchema = _ref.uiSchema,
|
|
1465
1519
|
value = _ref.value;
|
|
1466
1520
|
var _formContext$readonly = formContext.readonlyAsDisabled,
|
|
1467
1521
|
readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
|
|
1522
|
+
var TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, options);
|
|
1468
1523
|
var enumOptions = options.enumOptions,
|
|
1469
1524
|
enumDisabled = options.enumDisabled,
|
|
1470
1525
|
emptyValue = options.emptyValue;
|
|
@@ -1493,31 +1548,39 @@ function SelectWidget(_ref) {
|
|
|
1493
1548
|
var extraProps = {
|
|
1494
1549
|
name: id
|
|
1495
1550
|
};
|
|
1496
|
-
return jsxRuntime.
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1551
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1552
|
+
children: [!hideLabel && !!label && jsxRuntime.jsx(TitleFieldTemplate, {
|
|
1553
|
+
id: utils.titleId(id),
|
|
1554
|
+
title: label,
|
|
1555
|
+
schema: schema,
|
|
1556
|
+
uiSchema: uiSchema,
|
|
1557
|
+
registry: registry
|
|
1558
|
+
}), jsxRuntime.jsx(Select__default["default"], _extends({
|
|
1559
|
+
autoFocus: autofocus,
|
|
1560
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1561
|
+
getPopupContainer: getPopupContainer,
|
|
1562
|
+
id: id,
|
|
1563
|
+
mode: typeof multiple !== 'undefined' ? 'multiple' : undefined,
|
|
1564
|
+
onBlur: !readonly ? handleBlur : undefined,
|
|
1565
|
+
onChange: !readonly ? handleChange : undefined,
|
|
1566
|
+
onFocus: !readonly ? handleFocus : undefined,
|
|
1567
|
+
placeholder: placeholder,
|
|
1568
|
+
style: SELECT_STYLE,
|
|
1569
|
+
value: selectedIndexes
|
|
1570
|
+
}, extraProps, {
|
|
1571
|
+
filterOption: filterOption,
|
|
1572
|
+
"aria-describedby": utils.ariaDescribedByIds(id),
|
|
1573
|
+
children: Array.isArray(enumOptions) && enumOptions.map(function (_ref2, index) {
|
|
1574
|
+
var optionValue = _ref2.value,
|
|
1575
|
+
optionLabel = _ref2.label;
|
|
1576
|
+
return jsxRuntime.jsx(Select__default["default"].Option, {
|
|
1577
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
|
|
1578
|
+
value: String(index),
|
|
1579
|
+
children: optionLabel
|
|
1580
|
+
}, String(index));
|
|
1581
|
+
})
|
|
1582
|
+
}))]
|
|
1583
|
+
});
|
|
1521
1584
|
}
|
|
1522
1585
|
|
|
1523
1586
|
var INPUT_STYLE = {
|