@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.
@@ -515,7 +515,7 @@
515
515
  schema: schema,
516
516
  uiSchema: uiSchema,
517
517
  registry: registry,
518
- children: id === 'root' ? children : jsxRuntime.jsx(Form__default["default"].Item, _extends({
518
+ children: jsxRuntime.jsx(Form__default["default"].Item, _extends({
519
519
  colon: colon,
520
520
  hasFeedback: schema.type !== 'array' && schema.type !== 'object',
521
521
  help: !!rawHelp && help || (rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? errors : undefined),
@@ -1146,7 +1146,6 @@
1146
1146
  * @param props - The `WidgetProps` for this component
1147
1147
  */
1148
1148
  function CheckboxWidget(props) {
1149
- var _options$description;
1150
1149
  var autofocus = props.autofocus,
1151
1150
  disabled = props.disabled,
1152
1151
  formContext = props.formContext,
@@ -1157,14 +1156,9 @@
1157
1156
  onChange = props.onChange,
1158
1157
  onFocus = props.onFocus,
1159
1158
  readonly = props.readonly,
1160
- value = props.value,
1161
- registry = props.registry,
1162
- options = props.options,
1163
- schema = props.schema,
1164
- uiSchema = props.uiSchema;
1159
+ value = props.value;
1165
1160
  var _formContext$readonly = formContext.readonlyAsDisabled,
1166
1161
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1167
- var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, options);
1168
1162
  var handleChange = function handleChange(_ref) {
1169
1163
  var target = _ref.target;
1170
1164
  return onChange(target.checked);
@@ -1183,28 +1177,17 @@
1183
1177
  onBlur: !readonly ? handleBlur : undefined,
1184
1178
  onFocus: !readonly ? handleFocus : undefined
1185
1179
  };
1186
- var description = (_options$description = options.description) != null ? _options$description : schema.description;
1187
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
1188
- children: [!hideLabel && !!description && jsxRuntime.jsx("div", {
1189
- children: jsxRuntime.jsx(DescriptionFieldTemplate, {
1190
- id: utils.descriptionId(id),
1191
- description: description,
1192
- schema: schema,
1193
- uiSchema: uiSchema,
1194
- registry: registry
1195
- })
1196
- }), jsxRuntime.jsx(Checkbox__default["default"], _extends({
1197
- autoFocus: autofocus,
1198
- checked: typeof value === 'undefined' ? false : value,
1199
- disabled: disabled || readonlyAsDisabled && readonly,
1200
- id: id,
1201
- name: id,
1202
- onChange: !readonly ? handleChange : undefined
1203
- }, extraProps, {
1204
- "aria-describedby": utils.ariaDescribedByIds(id),
1205
- children: utils.labelValue(label, hideLabel, '')
1206
- }))]
1207
- });
1180
+ return jsxRuntime.jsx(Checkbox__default["default"], _extends({
1181
+ autoFocus: autofocus,
1182
+ checked: typeof value === 'undefined' ? false : value,
1183
+ disabled: disabled || readonlyAsDisabled && readonly,
1184
+ id: id,
1185
+ name: id,
1186
+ onChange: !readonly ? handleChange : undefined
1187
+ }, extraProps, {
1188
+ "aria-describedby": utils.ariaDescribedByIds(id),
1189
+ children: utils.labelValue(label, hideLabel, '')
1190
+ }));
1208
1191
  }
1209
1192
 
1210
1193
  var DatePicker = /*#__PURE__*/generatePicker__default["default"](dayjsGenerateConfig__default["default"]);
@@ -1474,8 +1457,6 @@
1474
1457
  _ref$formContext = _ref.formContext,
1475
1458
  formContext = _ref$formContext === void 0 ? {} : _ref$formContext,
1476
1459
  id = _ref.id,
1477
- label = _ref.label,
1478
- hideLabel = _ref.hideLabel,
1479
1460
  multiple = _ref.multiple,
1480
1461
  onBlur = _ref.onBlur,
1481
1462
  onChange = _ref.onChange,
@@ -1483,13 +1464,9 @@
1483
1464
  options = _ref.options,
1484
1465
  placeholder = _ref.placeholder,
1485
1466
  readonly = _ref.readonly,
1486
- registry = _ref.registry,
1487
- schema = _ref.schema,
1488
- uiSchema = _ref.uiSchema,
1489
1467
  value = _ref.value;
1490
1468
  var _formContext$readonly = formContext.readonlyAsDisabled,
1491
1469
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1492
- var TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, options);
1493
1470
  var enumOptions = options.enumOptions,
1494
1471
  enumDisabled = options.enumDisabled,
1495
1472
  emptyValue = options.emptyValue;
@@ -1518,39 +1495,31 @@
1518
1495
  var extraProps = {
1519
1496
  name: id
1520
1497
  };
1521
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
1522
- children: [!hideLabel && !!label && jsxRuntime.jsx(TitleFieldTemplate, {
1523
- id: utils.titleId(id),
1524
- title: label,
1525
- schema: schema,
1526
- uiSchema: uiSchema,
1527
- registry: registry
1528
- }), 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
- }))]
1553
- });
1498
+ return jsxRuntime.jsx(Select__default["default"], _extends({
1499
+ autoFocus: autofocus,
1500
+ disabled: disabled || readonlyAsDisabled && readonly,
1501
+ getPopupContainer: getPopupContainer,
1502
+ id: id,
1503
+ mode: multiple ? 'multiple' : undefined,
1504
+ onBlur: !readonly ? handleBlur : undefined,
1505
+ onChange: !readonly ? handleChange : undefined,
1506
+ onFocus: !readonly ? handleFocus : undefined,
1507
+ placeholder: placeholder,
1508
+ style: SELECT_STYLE,
1509
+ value: selectedIndexes
1510
+ }, extraProps, {
1511
+ filterOption: filterOption,
1512
+ "aria-describedby": utils.ariaDescribedByIds(id),
1513
+ children: Array.isArray(enumOptions) && enumOptions.map(function (_ref2, index) {
1514
+ var optionValue = _ref2.value,
1515
+ optionLabel = _ref2.label;
1516
+ return jsxRuntime.jsx(Select__default["default"].Option, {
1517
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
1518
+ value: String(index),
1519
+ children: optionLabel
1520
+ }, String(index));
1521
+ })
1522
+ }));
1554
1523
  }
1555
1524
 
1556
1525
  var INPUT_STYLE = {