@rjsf/antd 5.6.2 → 5.7.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.esm.js CHANGED
@@ -512,7 +512,7 @@ function FieldTemplate(props) {
512
512
  schema: schema,
513
513
  uiSchema: uiSchema,
514
514
  registry: registry,
515
- children: id === 'root' ? children : jsx(Form$1.Item, _extends({
515
+ children: jsx(Form$1.Item, _extends({
516
516
  colon: colon,
517
517
  hasFeedback: schema.type !== 'array' && schema.type !== 'object',
518
518
  help: !!rawHelp && help || (rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? errors : undefined),
@@ -1143,7 +1143,6 @@ function CheckboxesWidget(_ref) {
1143
1143
  * @param props - The `WidgetProps` for this component
1144
1144
  */
1145
1145
  function CheckboxWidget(props) {
1146
- var _options$description;
1147
1146
  var autofocus = props.autofocus,
1148
1147
  disabled = props.disabled,
1149
1148
  formContext = props.formContext,
@@ -1154,14 +1153,9 @@ function CheckboxWidget(props) {
1154
1153
  onChange = props.onChange,
1155
1154
  onFocus = props.onFocus,
1156
1155
  readonly = props.readonly,
1157
- value = props.value,
1158
- registry = props.registry,
1159
- options = props.options,
1160
- schema = props.schema,
1161
- uiSchema = props.uiSchema;
1156
+ value = props.value;
1162
1157
  var _formContext$readonly = formContext.readonlyAsDisabled,
1163
1158
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1164
- var DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, options);
1165
1159
  var handleChange = function handleChange(_ref) {
1166
1160
  var target = _ref.target;
1167
1161
  return onChange(target.checked);
@@ -1180,28 +1174,17 @@ function CheckboxWidget(props) {
1180
1174
  onBlur: !readonly ? handleBlur : undefined,
1181
1175
  onFocus: !readonly ? handleFocus : undefined
1182
1176
  };
1183
- var description = (_options$description = options.description) != null ? _options$description : schema.description;
1184
- return jsxs(Fragment, {
1185
- children: [!hideLabel && !!description && jsx("div", {
1186
- children: jsx(DescriptionFieldTemplate, {
1187
- id: descriptionId(id),
1188
- description: description,
1189
- schema: schema,
1190
- uiSchema: uiSchema,
1191
- registry: registry
1192
- })
1193
- }), jsx(Checkbox, _extends({
1194
- autoFocus: autofocus,
1195
- checked: typeof value === 'undefined' ? false : value,
1196
- disabled: disabled || readonlyAsDisabled && readonly,
1197
- id: id,
1198
- name: id,
1199
- onChange: !readonly ? handleChange : undefined
1200
- }, extraProps, {
1201
- "aria-describedby": ariaDescribedByIds(id),
1202
- children: labelValue(label, hideLabel, '')
1203
- }))]
1204
- });
1177
+ return jsx(Checkbox, _extends({
1178
+ autoFocus: autofocus,
1179
+ checked: typeof value === 'undefined' ? false : value,
1180
+ disabled: disabled || readonlyAsDisabled && readonly,
1181
+ id: id,
1182
+ name: id,
1183
+ onChange: !readonly ? handleChange : undefined
1184
+ }, extraProps, {
1185
+ "aria-describedby": ariaDescribedByIds(id),
1186
+ children: labelValue(label, hideLabel, '')
1187
+ }));
1205
1188
  }
1206
1189
 
1207
1190
  var DatePicker = /*#__PURE__*/generatePicker(dayjsGenerateConfig);
@@ -1471,8 +1454,6 @@ function SelectWidget(_ref) {
1471
1454
  _ref$formContext = _ref.formContext,
1472
1455
  formContext = _ref$formContext === void 0 ? {} : _ref$formContext,
1473
1456
  id = _ref.id,
1474
- label = _ref.label,
1475
- hideLabel = _ref.hideLabel,
1476
1457
  multiple = _ref.multiple,
1477
1458
  onBlur = _ref.onBlur,
1478
1459
  onChange = _ref.onChange,
@@ -1480,13 +1461,9 @@ function SelectWidget(_ref) {
1480
1461
  options = _ref.options,
1481
1462
  placeholder = _ref.placeholder,
1482
1463
  readonly = _ref.readonly,
1483
- registry = _ref.registry,
1484
- schema = _ref.schema,
1485
- uiSchema = _ref.uiSchema,
1486
1464
  value = _ref.value;
1487
1465
  var _formContext$readonly = formContext.readonlyAsDisabled,
1488
1466
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1489
- var TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options);
1490
1467
  var enumOptions = options.enumOptions,
1491
1468
  enumDisabled = options.enumDisabled,
1492
1469
  emptyValue = options.emptyValue;
@@ -1515,39 +1492,31 @@ function SelectWidget(_ref) {
1515
1492
  var extraProps = {
1516
1493
  name: id
1517
1494
  };
1518
- return jsxs(Fragment, {
1519
- children: [!hideLabel && !!label && jsx(TitleFieldTemplate, {
1520
- id: titleId(id),
1521
- title: label,
1522
- schema: schema,
1523
- uiSchema: uiSchema,
1524
- registry: registry
1525
- }), jsx(Select, _extends({
1526
- autoFocus: autofocus,
1527
- disabled: disabled || readonlyAsDisabled && readonly,
1528
- getPopupContainer: getPopupContainer,
1529
- id: id,
1530
- mode: multiple ? 'multiple' : undefined,
1531
- onBlur: !readonly ? handleBlur : undefined,
1532
- onChange: !readonly ? handleChange : undefined,
1533
- onFocus: !readonly ? handleFocus : undefined,
1534
- placeholder: placeholder,
1535
- style: SELECT_STYLE,
1536
- value: selectedIndexes
1537
- }, extraProps, {
1538
- filterOption: filterOption,
1539
- "aria-describedby": ariaDescribedByIds(id),
1540
- children: Array.isArray(enumOptions) && enumOptions.map(function (_ref2, index) {
1541
- var optionValue = _ref2.value,
1542
- optionLabel = _ref2.label;
1543
- return jsx(Select.Option, {
1544
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
1545
- value: String(index),
1546
- children: optionLabel
1547
- }, String(index));
1548
- })
1549
- }))]
1550
- });
1495
+ return jsx(Select, _extends({
1496
+ autoFocus: autofocus,
1497
+ disabled: disabled || readonlyAsDisabled && readonly,
1498
+ getPopupContainer: getPopupContainer,
1499
+ id: id,
1500
+ mode: multiple ? 'multiple' : undefined,
1501
+ onBlur: !readonly ? handleBlur : undefined,
1502
+ onChange: !readonly ? handleChange : undefined,
1503
+ onFocus: !readonly ? handleFocus : undefined,
1504
+ placeholder: placeholder,
1505
+ style: SELECT_STYLE,
1506
+ value: selectedIndexes
1507
+ }, extraProps, {
1508
+ filterOption: filterOption,
1509
+ "aria-describedby": ariaDescribedByIds(id),
1510
+ children: Array.isArray(enumOptions) && enumOptions.map(function (_ref2, index) {
1511
+ var optionValue = _ref2.value,
1512
+ optionLabel = _ref2.label;
1513
+ return jsx(Select.Option, {
1514
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
1515
+ value: String(index),
1516
+ children: optionLabel
1517
+ }, String(index));
1518
+ })
1519
+ }));
1551
1520
  }
1552
1521
 
1553
1522
  var INPUT_STYLE = {