@rjsf/antd 5.6.0 → 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.
@@ -545,7 +545,7 @@ function FieldTemplate(props) {
545
545
  schema: schema,
546
546
  uiSchema: uiSchema,
547
547
  registry: registry,
548
- children: id === 'root' ? children : jsxRuntime.jsx(Form__default["default"].Item, _extends({
548
+ children: jsxRuntime.jsx(Form__default["default"].Item, _extends({
549
549
  colon: colon,
550
550
  hasFeedback: schema.type !== 'array' && schema.type !== 'object',
551
551
  help: !!rawHelp && help || (rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? errors : undefined),
@@ -1176,7 +1176,6 @@ function CheckboxesWidget(_ref) {
1176
1176
  * @param props - The `WidgetProps` for this component
1177
1177
  */
1178
1178
  function CheckboxWidget(props) {
1179
- var _options$description;
1180
1179
  var autofocus = props.autofocus,
1181
1180
  disabled = props.disabled,
1182
1181
  formContext = props.formContext,
@@ -1187,14 +1186,9 @@ function CheckboxWidget(props) {
1187
1186
  onChange = props.onChange,
1188
1187
  onFocus = props.onFocus,
1189
1188
  readonly = props.readonly,
1190
- value = props.value,
1191
- registry = props.registry,
1192
- options = props.options,
1193
- schema = props.schema,
1194
- uiSchema = props.uiSchema;
1189
+ value = props.value;
1195
1190
  var _formContext$readonly = formContext.readonlyAsDisabled,
1196
1191
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1197
- var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, options);
1198
1192
  var handleChange = function handleChange(_ref) {
1199
1193
  var target = _ref.target;
1200
1194
  return onChange(target.checked);
@@ -1213,28 +1207,17 @@ function CheckboxWidget(props) {
1213
1207
  onBlur: !readonly ? handleBlur : undefined,
1214
1208
  onFocus: !readonly ? handleFocus : undefined
1215
1209
  };
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
- });
1210
+ return jsxRuntime.jsx(Checkbox__default["default"], _extends({
1211
+ autoFocus: autofocus,
1212
+ checked: typeof value === 'undefined' ? false : value,
1213
+ disabled: disabled || readonlyAsDisabled && readonly,
1214
+ id: id,
1215
+ name: id,
1216
+ onChange: !readonly ? handleChange : undefined
1217
+ }, extraProps, {
1218
+ "aria-describedby": utils.ariaDescribedByIds(id),
1219
+ children: utils.labelValue(label, hideLabel, '')
1220
+ }));
1238
1221
  }
1239
1222
 
1240
1223
  var DatePicker = /*#__PURE__*/generatePicker__default["default"](dayjsGenerateConfig__default["default"]);
@@ -1504,8 +1487,6 @@ function SelectWidget(_ref) {
1504
1487
  _ref$formContext = _ref.formContext,
1505
1488
  formContext = _ref$formContext === void 0 ? {} : _ref$formContext,
1506
1489
  id = _ref.id,
1507
- label = _ref.label,
1508
- hideLabel = _ref.hideLabel,
1509
1490
  multiple = _ref.multiple,
1510
1491
  onBlur = _ref.onBlur,
1511
1492
  onChange = _ref.onChange,
@@ -1513,13 +1494,9 @@ function SelectWidget(_ref) {
1513
1494
  options = _ref.options,
1514
1495
  placeholder = _ref.placeholder,
1515
1496
  readonly = _ref.readonly,
1516
- registry = _ref.registry,
1517
- schema = _ref.schema,
1518
- uiSchema = _ref.uiSchema,
1519
1497
  value = _ref.value;
1520
1498
  var _formContext$readonly = formContext.readonlyAsDisabled,
1521
1499
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1522
- var TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, options);
1523
1500
  var enumOptions = options.enumOptions,
1524
1501
  enumDisabled = options.enumDisabled,
1525
1502
  emptyValue = options.emptyValue;
@@ -1548,39 +1525,31 @@ function SelectWidget(_ref) {
1548
1525
  var extraProps = {
1549
1526
  name: id
1550
1527
  };
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: multiple ? '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
- });
1528
+ return jsxRuntime.jsx(Select__default["default"], _extends({
1529
+ autoFocus: autofocus,
1530
+ disabled: disabled || readonlyAsDisabled && readonly,
1531
+ getPopupContainer: getPopupContainer,
1532
+ id: id,
1533
+ mode: multiple ? 'multiple' : undefined,
1534
+ onBlur: !readonly ? handleBlur : undefined,
1535
+ onChange: !readonly ? handleChange : undefined,
1536
+ onFocus: !readonly ? handleFocus : undefined,
1537
+ placeholder: placeholder,
1538
+ style: SELECT_STYLE,
1539
+ value: selectedIndexes
1540
+ }, extraProps, {
1541
+ filterOption: filterOption,
1542
+ "aria-describedby": utils.ariaDescribedByIds(id),
1543
+ children: Array.isArray(enumOptions) && enumOptions.map(function (_ref2, index) {
1544
+ var optionValue = _ref2.value,
1545
+ optionLabel = _ref2.label;
1546
+ return jsxRuntime.jsx(Select__default["default"].Option, {
1547
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
1548
+ value: String(index),
1549
+ children: optionLabel
1550
+ }, String(index));
1551
+ })
1552
+ }));
1584
1553
  }
1585
1554
 
1586
1555
  var INPUT_STYLE = {