@rjsf/antd 5.2.0 → 5.3.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
@@ -1,5 +1,5 @@
1
1
  import { withTheme } from '@rjsf/core';
2
- import React, { useState, useEffect } from 'react';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
3
  import Button from 'antd/es/button';
4
4
  import Col from 'antd/es/col';
5
5
  import Row from 'antd/es/row';
@@ -14,12 +14,14 @@ import Space from 'antd/es/space';
14
14
  import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';
15
15
  import ArrowDownOutlined from '@ant-design/icons/ArrowDownOutlined';
16
16
  import ArrowUpOutlined from '@ant-design/icons/ArrowUpOutlined';
17
+ import CopyOutlined from '@ant-design/icons/CopyOutlined';
17
18
  import DeleteOutlined from '@ant-design/icons/DeleteOutlined';
18
19
  import PlusCircleOutlined from '@ant-design/icons/PlusCircleOutlined';
19
20
  import Form$1 from 'antd/es/form';
20
21
  import isObject from 'lodash-es/isObject';
21
22
  import isNumber from 'lodash-es/isNumber';
22
23
  import isString from 'lodash-es/isString';
24
+ import { useState, useEffect } from 'react';
23
25
  import Checkbox from 'antd/es/checkbox';
24
26
  import dayjs from 'dayjs';
25
27
  import dayjsGenerateConfig from 'rc-picker/es/generate/dayjs';
@@ -29,10 +31,10 @@ import Slider from 'antd/es/slider';
29
31
  import Select from 'antd/es/select';
30
32
 
31
33
  var BTN_GRP_STYLE = {
32
- width: "100%"
34
+ width: '100%'
33
35
  };
34
36
  var BTN_STYLE = {
35
- width: "calc(100% / 3)"
37
+ width: 'calc(100% / 4)'
36
38
  };
37
39
  /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
38
40
  *
@@ -41,17 +43,20 @@ var BTN_STYLE = {
41
43
  function ArrayFieldItemTemplate(props) {
42
44
  var children = props.children,
43
45
  disabled = props.disabled,
46
+ hasCopy = props.hasCopy,
44
47
  hasMoveDown = props.hasMoveDown,
45
48
  hasMoveUp = props.hasMoveUp,
46
49
  hasRemove = props.hasRemove,
47
50
  hasToolbar = props.hasToolbar,
48
51
  index = props.index,
52
+ onCopyIndexClick = props.onCopyIndexClick,
49
53
  onDropIndexClick = props.onDropIndexClick,
50
54
  onReorderClick = props.onReorderClick,
51
55
  readonly = props.readonly,
52
56
  registry = props.registry,
53
57
  uiSchema = props.uiSchema;
54
58
  var _registry$templates$B = registry.templates.ButtonTemplates,
59
+ CopyButton = _registry$templates$B.CopyButton,
55
60
  MoveDownButton = _registry$templates$B.MoveDownButton,
56
61
  MoveUpButton = _registry$templates$B.MoveUpButton,
57
62
  RemoveButton = _registry$templates$B.RemoveButton;
@@ -59,36 +64,45 @@ function ArrayFieldItemTemplate(props) {
59
64
  _registry$formContext2 = _registry$formContext.rowGutter,
60
65
  rowGutter = _registry$formContext2 === void 0 ? 24 : _registry$formContext2,
61
66
  _registry$formContext3 = _registry$formContext.toolbarAlign,
62
- toolbarAlign = _registry$formContext3 === void 0 ? "top" : _registry$formContext3;
63
- return /*#__PURE__*/React.createElement(Row, {
67
+ toolbarAlign = _registry$formContext3 === void 0 ? 'top' : _registry$formContext3;
68
+ return jsxs(Row, {
64
69
  align: toolbarAlign,
65
- key: "array-item-" + index,
66
- gutter: rowGutter
67
- }, /*#__PURE__*/React.createElement(Col, {
68
- flex: "1"
69
- }, children), hasToolbar && /*#__PURE__*/React.createElement(Col, {
70
- flex: "192px"
71
- }, /*#__PURE__*/React.createElement(Button.Group, {
72
- style: BTN_GRP_STYLE
73
- }, (hasMoveUp || hasMoveDown) && /*#__PURE__*/React.createElement(MoveUpButton, {
74
- disabled: disabled || readonly || !hasMoveUp,
75
- onClick: onReorderClick(index, index - 1),
76
- style: BTN_STYLE,
77
- uiSchema: uiSchema,
78
- registry: registry
79
- }), (hasMoveUp || hasMoveDown) && /*#__PURE__*/React.createElement(MoveDownButton, {
80
- disabled: disabled || readonly || !hasMoveDown,
81
- onClick: onReorderClick(index, index + 1),
82
- style: BTN_STYLE,
83
- uiSchema: uiSchema,
84
- registry: registry
85
- }), hasRemove && /*#__PURE__*/React.createElement(RemoveButton, {
86
- disabled: disabled || readonly,
87
- onClick: onDropIndexClick(index),
88
- style: BTN_STYLE,
89
- uiSchema: uiSchema,
90
- registry: registry
91
- }))));
70
+ gutter: rowGutter,
71
+ children: [jsx(Col, {
72
+ flex: '1',
73
+ children: children
74
+ }), hasToolbar && jsx(Col, {
75
+ flex: '192px',
76
+ children: jsxs(Button.Group, {
77
+ style: BTN_GRP_STYLE,
78
+ children: [(hasMoveUp || hasMoveDown) && jsx(MoveUpButton, {
79
+ disabled: disabled || readonly || !hasMoveUp,
80
+ onClick: onReorderClick(index, index - 1),
81
+ style: BTN_STYLE,
82
+ uiSchema: uiSchema,
83
+ registry: registry
84
+ }), (hasMoveUp || hasMoveDown) && jsx(MoveDownButton, {
85
+ disabled: disabled || readonly || !hasMoveDown,
86
+ onClick: onReorderClick(index, index + 1),
87
+ style: BTN_STYLE,
88
+ uiSchema: uiSchema,
89
+ registry: registry
90
+ }), hasCopy && jsx(CopyButton, {
91
+ disabled: disabled || readonly,
92
+ onClick: onCopyIndexClick(index),
93
+ style: BTN_STYLE,
94
+ uiSchema: uiSchema,
95
+ registry: registry
96
+ }), hasRemove && jsx(RemoveButton, {
97
+ disabled: disabled || readonly,
98
+ onClick: onDropIndexClick(index),
99
+ style: BTN_STYLE,
100
+ uiSchema: uiSchema,
101
+ registry: registry
102
+ })]
103
+ })
104
+ })]
105
+ }, "array-item-" + index);
92
106
  }
93
107
 
94
108
  function _extends() {
@@ -120,7 +134,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
120
134
 
121
135
  var _excluded$1 = ["key"];
122
136
  var DESCRIPTION_COL_STYLE$1 = {
123
- paddingBottom: "8px"
137
+ paddingBottom: '8px'
124
138
  };
125
139
  /** The `ArrayFieldTemplate` component is the template used to render all items in an array.
126
140
  *
@@ -141,75 +155,83 @@ function ArrayFieldTemplate(props) {
141
155
  title = props.title,
142
156
  uiSchema = props.uiSchema;
143
157
  var uiOptions = getUiOptions(uiSchema);
144
- var ArrayFieldDescriptionTemplate = getTemplate("ArrayFieldDescriptionTemplate", registry, uiOptions);
145
- var ArrayFieldItemTemplate = getTemplate("ArrayFieldItemTemplate", registry, uiOptions);
146
- var ArrayFieldTitleTemplate = getTemplate("ArrayFieldTitleTemplate", registry, uiOptions);
158
+ var ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
159
+ var ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
160
+ var ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
147
161
  // Button templates are not overridden in the uiSchema
148
162
  var AddButton = registry.templates.ButtonTemplates.AddButton;
149
163
  var _formContext$labelAli = formContext.labelAlign,
150
- labelAlign = _formContext$labelAli === void 0 ? "right" : _formContext$labelAli,
164
+ labelAlign = _formContext$labelAli === void 0 ? 'right' : _formContext$labelAli,
151
165
  _formContext$rowGutte = formContext.rowGutter,
152
166
  rowGutter = _formContext$rowGutte === void 0 ? 24 : _formContext$rowGutte;
153
- return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (configProps) {
154
- var getPrefixCls = configProps.getPrefixCls;
155
- var prefixCls = getPrefixCls("form");
156
- var labelClsBasic = prefixCls + "-item-label";
157
- var labelColClassName = classNames(labelClsBasic, labelAlign === "left" && labelClsBasic + "-left"
158
- // labelCol.className,
159
- );
167
+ return jsx(ConfigConsumer, {
168
+ children: function children(configProps) {
169
+ var getPrefixCls = configProps.getPrefixCls;
170
+ var prefixCls = getPrefixCls('form');
171
+ var labelClsBasic = prefixCls + "-item-label";
172
+ var labelColClassName = classNames(labelClsBasic, labelAlign === 'left' && labelClsBasic + "-left"
173
+ // labelCol.className,
174
+ );
160
175
 
161
- return /*#__PURE__*/React.createElement("fieldset", {
162
- className: className,
163
- id: idSchema.$id
164
- }, /*#__PURE__*/React.createElement(Row, {
165
- gutter: rowGutter
166
- }, (uiOptions.title || title) && /*#__PURE__*/React.createElement(Col, {
167
- className: labelColClassName,
168
- span: 24
169
- }, /*#__PURE__*/React.createElement(ArrayFieldTitleTemplate, {
170
- idSchema: idSchema,
171
- required: required,
172
- title: uiOptions.title || title,
173
- schema: schema,
174
- uiSchema: uiSchema,
175
- registry: registry
176
- })), (uiOptions.description || schema.description) && /*#__PURE__*/React.createElement(Col, {
177
- span: 24,
178
- style: DESCRIPTION_COL_STYLE$1
179
- }, /*#__PURE__*/React.createElement(ArrayFieldDescriptionTemplate, {
180
- description: uiOptions.description || schema.description || "",
181
- idSchema: idSchema,
182
- schema: schema,
183
- uiSchema: uiSchema,
184
- registry: registry
185
- })), /*#__PURE__*/React.createElement(Col, {
186
- className: "row array-item-list",
187
- span: 24
188
- }, items && items.map(function (_ref) {
189
- var key = _ref.key,
190
- itemProps = _objectWithoutPropertiesLoose(_ref, _excluded$1);
191
- return /*#__PURE__*/React.createElement(ArrayFieldItemTemplate, _extends({
192
- key: key
193
- }, itemProps));
194
- })), canAdd && /*#__PURE__*/React.createElement(Col, {
195
- span: 24
196
- }, /*#__PURE__*/React.createElement(Row, {
197
- gutter: rowGutter,
198
- justify: "end"
199
- }, /*#__PURE__*/React.createElement(Col, {
200
- flex: "192px"
201
- }, /*#__PURE__*/React.createElement(AddButton, {
202
- className: "array-item-add",
203
- disabled: disabled || readonly,
204
- onClick: onAddClick,
205
- uiSchema: uiSchema,
206
- registry: registry
207
- }))))));
176
+ return jsx("fieldset", {
177
+ className: className,
178
+ id: idSchema.$id,
179
+ children: jsxs(Row, {
180
+ gutter: rowGutter,
181
+ children: [(uiOptions.title || title) && jsx(Col, {
182
+ className: labelColClassName,
183
+ span: 24,
184
+ children: jsx(ArrayFieldTitleTemplate, {
185
+ idSchema: idSchema,
186
+ required: required,
187
+ title: uiOptions.title || title,
188
+ schema: schema,
189
+ uiSchema: uiSchema,
190
+ registry: registry
191
+ })
192
+ }), (uiOptions.description || schema.description) && jsx(Col, {
193
+ span: 24,
194
+ style: DESCRIPTION_COL_STYLE$1,
195
+ children: jsx(ArrayFieldDescriptionTemplate, {
196
+ description: uiOptions.description || schema.description || '',
197
+ idSchema: idSchema,
198
+ schema: schema,
199
+ uiSchema: uiSchema,
200
+ registry: registry
201
+ })
202
+ }), jsx(Col, {
203
+ className: 'row array-item-list',
204
+ span: 24,
205
+ children: items && items.map(function (_ref) {
206
+ var key = _ref.key,
207
+ itemProps = _objectWithoutPropertiesLoose(_ref, _excluded$1);
208
+ return jsx(ArrayFieldItemTemplate, _extends({}, itemProps), key);
209
+ })
210
+ }), canAdd && jsx(Col, {
211
+ span: 24,
212
+ children: jsx(Row, {
213
+ gutter: rowGutter,
214
+ justify: 'end',
215
+ children: jsx(Col, {
216
+ flex: '192px',
217
+ children: jsx(AddButton, {
218
+ className: 'array-item-add',
219
+ disabled: disabled || readonly,
220
+ onClick: onAddClick,
221
+ uiSchema: uiSchema,
222
+ registry: registry
223
+ })
224
+ })
225
+ })
226
+ })]
227
+ })
228
+ });
229
+ }
208
230
  });
209
231
  }
210
232
 
211
233
  var INPUT_STYLE$2 = {
212
- width: "100%"
234
+ width: '100%'
213
235
  };
214
236
  /** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
215
237
  * It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
@@ -223,6 +245,7 @@ function BaseInputTemplate(props) {
223
245
  id = props.id,
224
246
  onBlur = props.onBlur,
225
247
  onChange = props.onChange,
248
+ onChangeOverride = props.onChangeOverride,
226
249
  onFocus = props.onFocus,
227
250
  options = props.options,
228
251
  placeholder = props.placeholder,
@@ -236,9 +259,9 @@ function BaseInputTemplate(props) {
236
259
  var handleNumberChange = function handleNumberChange(nextValue) {
237
260
  return onChange(nextValue);
238
261
  };
239
- var handleTextChange = function handleTextChange(_ref) {
262
+ var handleTextChange = onChangeOverride ? onChangeOverride : function (_ref) {
240
263
  var target = _ref.target;
241
- return onChange(target.value === "" ? options.emptyValue : target.value);
264
+ return onChange(target.value === '' ? options.emptyValue : target.value);
242
265
  };
243
266
  var handleBlur = function handleBlur(_ref2) {
244
267
  var target = _ref2.target;
@@ -248,7 +271,7 @@ function BaseInputTemplate(props) {
248
271
  var target = _ref3.target;
249
272
  return onFocus(id, target.value);
250
273
  };
251
- var input = inputProps.type === "number" || inputProps.type === "integer" ? /*#__PURE__*/React.createElement(InputNumber, _extends({
274
+ var input = inputProps.type === 'number' || inputProps.type === 'integer' ? jsx(InputNumber, _extends({
252
275
  disabled: disabled || readonlyAsDisabled && readonly,
253
276
  id: id,
254
277
  name: id,
@@ -261,7 +284,7 @@ function BaseInputTemplate(props) {
261
284
  }, inputProps, {
262
285
  value: value,
263
286
  "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
264
- })) : /*#__PURE__*/React.createElement(Input, _extends({
287
+ })) : jsx(Input, _extends({
265
288
  disabled: disabled || readonlyAsDisabled && readonly,
266
289
  id: id,
267
290
  name: id,
@@ -275,14 +298,16 @@ function BaseInputTemplate(props) {
275
298
  value: value,
276
299
  "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
277
300
  }));
278
- return /*#__PURE__*/React.createElement(React.Fragment, null, input, Array.isArray(schema.examples) && /*#__PURE__*/React.createElement("datalist", {
279
- id: examplesId(id)
280
- }, schema.examples.concat(schema["default"] && !schema.examples.includes(schema["default"]) ? [schema["default"]] : []).map(function (example) {
281
- return /*#__PURE__*/React.createElement("option", {
282
- key: example,
283
- value: example
284
- });
285
- })));
301
+ return jsxs(Fragment, {
302
+ children: [input, Array.isArray(schema.examples) && jsx("datalist", {
303
+ id: examplesId(id),
304
+ children: schema.examples.concat(schema["default"] && !schema.examples.includes(schema["default"]) ? [schema["default"]] : []).map(function (example) {
305
+ return jsx("option", {
306
+ value: example
307
+ }, example);
308
+ })
309
+ })]
310
+ });
286
311
  }
287
312
 
288
313
  /** The `DescriptionField` is the template to use to render the description of a field
@@ -295,9 +320,10 @@ function DescriptionField(props) {
295
320
  if (!description) {
296
321
  return null;
297
322
  }
298
- return /*#__PURE__*/React.createElement("span", {
299
- id: id
300
- }, description);
323
+ return jsx("span", {
324
+ id: id,
325
+ children: description
326
+ });
301
327
  }
302
328
 
303
329
  /** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
@@ -309,71 +335,82 @@ function ErrorList(_ref) {
309
335
  registry = _ref.registry;
310
336
  var translateString = registry.translateString;
311
337
  var renderErrors = function renderErrors() {
312
- return /*#__PURE__*/React.createElement(List, {
313
- className: "list-group",
314
- size: "small"
315
- }, errors.map(function (error, index) {
316
- return /*#__PURE__*/React.createElement(List.Item, {
317
- key: index
318
- }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null), error.stack));
319
- }));
338
+ return jsx(List, {
339
+ className: 'list-group',
340
+ size: 'small',
341
+ children: errors.map(function (error, index) {
342
+ return jsx(List.Item, {
343
+ children: jsxs(Space, {
344
+ children: [jsx(ExclamationCircleOutlined, {}), error.stack]
345
+ })
346
+ }, index);
347
+ })
348
+ });
320
349
  };
321
- return /*#__PURE__*/React.createElement(Alert, {
322
- className: "panel panel-danger errors",
350
+ return jsx(Alert, {
351
+ className: 'panel panel-danger errors',
323
352
  description: renderErrors(),
324
353
  message: translateString(TranslatableString.ErrorsLabel),
325
- type: "error"
354
+ type: 'error'
326
355
  });
327
356
  }
328
357
 
329
358
  var _excluded = ["iconType", "icon", "uiSchema", "registry"];
330
359
  function IconButton(props) {
331
360
  var _props$iconType = props.iconType,
332
- iconType = _props$iconType === void 0 ? "default" : _props$iconType,
361
+ iconType = _props$iconType === void 0 ? 'default' : _props$iconType,
333
362
  icon = props.icon,
334
363
  otherProps = _objectWithoutPropertiesLoose(props, _excluded);
335
- return /*#__PURE__*/React.createElement(Button, _extends({
364
+ return jsx(Button, _extends({
336
365
  type: iconType,
337
366
  icon: icon
338
367
  }, otherProps));
339
368
  }
340
369
  function AddButton(props) {
341
370
  var translateString = props.registry.translateString;
342
- return /*#__PURE__*/React.createElement(IconButton, _extends({
371
+ return jsx(IconButton, _extends({
343
372
  title: translateString(TranslatableString.AddItemButton)
344
373
  }, props, {
345
374
  block: true,
346
- iconType: "primary",
347
- icon: /*#__PURE__*/React.createElement(PlusCircleOutlined, null)
375
+ iconType: 'primary',
376
+ icon: jsx(PlusCircleOutlined, {})
377
+ }));
378
+ }
379
+ function CopyButton(props) {
380
+ var translateString = props.registry.translateString;
381
+ return jsx(IconButton, _extends({
382
+ title: translateString(TranslatableString.CopyButton)
383
+ }, props, {
384
+ icon: jsx(CopyOutlined, {})
348
385
  }));
349
386
  }
350
387
  function MoveDownButton(props) {
351
388
  var translateString = props.registry.translateString;
352
- return /*#__PURE__*/React.createElement(IconButton, _extends({
389
+ return jsx(IconButton, _extends({
353
390
  title: translateString(TranslatableString.MoveDownButton)
354
391
  }, props, {
355
- icon: /*#__PURE__*/React.createElement(ArrowDownOutlined, null)
392
+ icon: jsx(ArrowDownOutlined, {})
356
393
  }));
357
394
  }
358
395
  function MoveUpButton(props) {
359
396
  var translateString = props.registry.translateString;
360
- return /*#__PURE__*/React.createElement(IconButton, _extends({
397
+ return jsx(IconButton, _extends({
361
398
  title: translateString(TranslatableString.MoveUpButton)
362
399
  }, props, {
363
- icon: /*#__PURE__*/React.createElement(ArrowUpOutlined, null)
400
+ icon: jsx(ArrowUpOutlined, {})
364
401
  }));
365
402
  }
366
403
  function RemoveButton(props) {
367
404
  // The `block` prop is not part of the `IconButtonProps` defined in the template, so get it from the uiSchema instead
368
405
  var options = getUiOptions(props.uiSchema);
369
406
  var translateString = props.registry.translateString;
370
- return /*#__PURE__*/React.createElement(IconButton, _extends({
407
+ return jsx(IconButton, _extends({
371
408
  title: translateString(TranslatableString.RemoveButton)
372
409
  }, props, {
373
410
  danger: true,
374
411
  block: !!options.block,
375
- iconType: "primary",
376
- icon: /*#__PURE__*/React.createElement(DeleteOutlined, null)
412
+ iconType: 'primary',
413
+ icon: jsx(DeleteOutlined, {})
377
414
  }));
378
415
  }
379
416
 
@@ -389,13 +426,14 @@ function FieldErrorTemplate(props) {
389
426
  return null;
390
427
  }
391
428
  var id = errorId(idSchema);
392
- return /*#__PURE__*/React.createElement("div", {
393
- id: id
394
- }, errors.map(function (error) {
395
- return /*#__PURE__*/React.createElement("div", {
396
- key: "field-" + id + "-error-" + error
397
- }, error);
398
- }));
429
+ return jsx("div", {
430
+ id: id,
431
+ children: errors.map(function (error) {
432
+ return jsx("div", {
433
+ children: error
434
+ }, "field-" + id + "-error-" + error);
435
+ })
436
+ });
399
437
  }
400
438
 
401
439
  var VERTICAL_LABEL_COL$1 = {
@@ -439,13 +477,14 @@ function FieldTemplate(props) {
439
477
  wrapperCol = _formContext$wrapperC === void 0 ? VERTICAL_WRAPPER_COL$1 : _formContext$wrapperC,
440
478
  wrapperStyle = formContext.wrapperStyle;
441
479
  var uiOptions = getUiOptions(uiSchema);
442
- var WrapIfAdditionalTemplate = getTemplate("WrapIfAdditionalTemplate", registry, uiOptions);
480
+ var WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
443
481
  if (hidden) {
444
- return /*#__PURE__*/React.createElement("div", {
445
- className: "field-hidden"
446
- }, children);
482
+ return jsx("div", {
483
+ className: 'field-hidden',
484
+ children: children
485
+ });
447
486
  }
448
- return /*#__PURE__*/React.createElement(WrapIfAdditionalTemplate, {
487
+ return jsx(WrapIfAdditionalTemplate, {
449
488
  classNames: classNames,
450
489
  style: style,
451
490
  disabled: disabled,
@@ -457,24 +496,26 @@ function FieldTemplate(props) {
457
496
  required: required,
458
497
  schema: schema,
459
498
  uiSchema: uiSchema,
460
- registry: registry
461
- }, id === "root" ? children : /*#__PURE__*/React.createElement(Form$1.Item, {
462
- colon: colon,
463
- extra: rawDescription && description,
464
- hasFeedback: schema.type !== "array" && schema.type !== "object",
465
- help: !!rawHelp && help || (rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? errors : undefined),
466
- htmlFor: id,
467
- label: displayLabel && label,
468
- labelCol: labelCol,
469
- required: required,
470
- style: wrapperStyle,
471
- validateStatus: rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? "error" : undefined,
472
- wrapperCol: wrapperCol
473
- }, children));
499
+ registry: registry,
500
+ children: id === 'root' ? children : jsx(Form$1.Item, {
501
+ colon: colon,
502
+ extra: rawDescription && description,
503
+ hasFeedback: schema.type !== 'array' && schema.type !== 'object',
504
+ help: !!rawHelp && help || (rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? errors : undefined),
505
+ htmlFor: id,
506
+ label: displayLabel && label,
507
+ labelCol: labelCol,
508
+ required: required,
509
+ style: wrapperStyle,
510
+ validateStatus: rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? 'error' : undefined,
511
+ wrapperCol: wrapperCol,
512
+ children: children
513
+ })
514
+ });
474
515
  }
475
516
 
476
517
  var DESCRIPTION_COL_STYLE = {
477
- paddingBottom: "8px"
518
+ paddingBottom: '8px'
478
519
  };
479
520
  /** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
480
521
  * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
@@ -497,14 +538,14 @@ function ObjectFieldTemplate(props) {
497
538
  title = props.title,
498
539
  uiSchema = props.uiSchema;
499
540
  var uiOptions = getUiOptions(uiSchema);
500
- var TitleFieldTemplate = getTemplate("TitleFieldTemplate", registry, uiOptions);
501
- var DescriptionFieldTemplate = getTemplate("DescriptionFieldTemplate", registry, uiOptions);
541
+ var TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
542
+ var DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
502
543
  // Button templates are not overridden in the uiSchema
503
544
  var AddButton = registry.templates.ButtonTemplates.AddButton;
504
545
  var _formContext$colSpan = formContext.colSpan,
505
546
  colSpan = _formContext$colSpan === void 0 ? 24 : _formContext$colSpan,
506
547
  _formContext$labelAli = formContext.labelAlign,
507
- labelAlign = _formContext$labelAli === void 0 ? "right" : _formContext$labelAli,
548
+ labelAlign = _formContext$labelAli === void 0 ? 'right' : _formContext$labelAli,
508
549
  _formContext$rowGutte = formContext.rowGutter,
509
550
  rowGutter = _formContext$rowGutte === void 0 ? 24 : _formContext$rowGutte;
510
551
  var findSchema = function findSchema(element) {
@@ -528,7 +569,7 @@ function ObjectFieldTemplate(props) {
528
569
  var widget = findUiSchemaWidget(element);
529
570
  var defaultColSpan = properties.length < 2 ||
530
571
  // Single or no field in object.
531
- type === "object" || type === "array" || widget === "textarea" ? 24 : 12;
572
+ type === 'object' || type === 'array' || widget === 'textarea' ? 24 : 12;
532
573
  if (isObject(colSpan)) {
533
574
  var colSpanObj = colSpan;
534
575
  if (isString(widget)) {
@@ -546,58 +587,67 @@ function ObjectFieldTemplate(props) {
546
587
  }
547
588
  return defaultColSpan;
548
589
  };
549
- return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (configProps) {
550
- var getPrefixCls = configProps.getPrefixCls;
551
- var prefixCls = getPrefixCls("form");
552
- var labelClsBasic = prefixCls + "-item-label";
553
- var labelColClassName = classNames(labelClsBasic, labelAlign === "left" && labelClsBasic + "-left"
554
- // labelCol.className,
555
- );
590
+ return jsx(ConfigConsumer, {
591
+ children: function children(configProps) {
592
+ var getPrefixCls = configProps.getPrefixCls;
593
+ var prefixCls = getPrefixCls('form');
594
+ var labelClsBasic = prefixCls + "-item-label";
595
+ var labelColClassName = classNames(labelClsBasic, labelAlign === 'left' && labelClsBasic + "-left"
596
+ // labelCol.className,
597
+ );
556
598
 
557
- return /*#__PURE__*/React.createElement("fieldset", {
558
- id: idSchema.$id
559
- }, /*#__PURE__*/React.createElement(Row, {
560
- gutter: rowGutter
561
- }, (uiOptions.title || title) && /*#__PURE__*/React.createElement(Col, {
562
- className: labelColClassName,
563
- span: 24
564
- }, /*#__PURE__*/React.createElement(TitleFieldTemplate, {
565
- id: titleId(idSchema),
566
- title: uiOptions.title || title,
567
- required: required,
568
- schema: schema,
569
- uiSchema: uiSchema,
570
- registry: registry
571
- })), (uiOptions.description || description) && /*#__PURE__*/React.createElement(Col, {
572
- span: 24,
573
- style: DESCRIPTION_COL_STYLE
574
- }, /*#__PURE__*/React.createElement(DescriptionFieldTemplate, {
575
- id: descriptionId(idSchema),
576
- description: uiOptions.description || description,
577
- schema: schema,
578
- uiSchema: uiSchema,
579
- registry: registry
580
- })), properties.filter(function (e) {
581
- return !e.hidden;
582
- }).map(function (element) {
583
- return /*#__PURE__*/React.createElement(Col, {
584
- key: element.name,
585
- span: calculateColSpan(element)
586
- }, element.content);
587
- })), canExpand(schema, uiSchema, formData) && /*#__PURE__*/React.createElement(Col, {
588
- span: 24
589
- }, /*#__PURE__*/React.createElement(Row, {
590
- gutter: rowGutter,
591
- justify: "end"
592
- }, /*#__PURE__*/React.createElement(Col, {
593
- flex: "192px"
594
- }, /*#__PURE__*/React.createElement(AddButton, {
595
- className: "object-property-expand",
596
- disabled: disabled || readonly,
597
- onClick: onAddClick(schema),
598
- uiSchema: uiSchema,
599
- registry: registry
600
- })))));
599
+ return jsxs("fieldset", {
600
+ id: idSchema.$id,
601
+ children: [jsxs(Row, {
602
+ gutter: rowGutter,
603
+ children: [(uiOptions.title || title) && jsx(Col, {
604
+ className: labelColClassName,
605
+ span: 24,
606
+ children: jsx(TitleFieldTemplate, {
607
+ id: titleId(idSchema),
608
+ title: uiOptions.title || title,
609
+ required: required,
610
+ schema: schema,
611
+ uiSchema: uiSchema,
612
+ registry: registry
613
+ })
614
+ }), (uiOptions.description || description) && jsx(Col, {
615
+ span: 24,
616
+ style: DESCRIPTION_COL_STYLE,
617
+ children: jsx(DescriptionFieldTemplate, {
618
+ id: descriptionId(idSchema),
619
+ description: uiOptions.description || description,
620
+ schema: schema,
621
+ uiSchema: uiSchema,
622
+ registry: registry
623
+ })
624
+ }), properties.filter(function (e) {
625
+ return !e.hidden;
626
+ }).map(function (element) {
627
+ return jsx(Col, {
628
+ span: calculateColSpan(element),
629
+ children: element.content
630
+ }, element.name);
631
+ })]
632
+ }), canExpand(schema, uiSchema, formData) && jsx(Col, {
633
+ span: 24,
634
+ children: jsx(Row, {
635
+ gutter: rowGutter,
636
+ justify: 'end',
637
+ children: jsx(Col, {
638
+ flex: '192px',
639
+ children: jsx(AddButton, {
640
+ className: 'object-property-expand',
641
+ disabled: disabled || readonly,
642
+ onClick: onAddClick(schema),
643
+ uiSchema: uiSchema,
644
+ registry: registry
645
+ })
646
+ })
647
+ })
648
+ })]
649
+ });
650
+ }
601
651
  });
602
652
  }
603
653
 
@@ -612,11 +662,12 @@ function SubmitButton(_ref) {
612
662
  if (norender) {
613
663
  return null;
614
664
  }
615
- return /*#__PURE__*/React.createElement(Button, _extends({
616
- type: "submit"
665
+ return jsx(Button, _extends({
666
+ type: 'submit'
617
667
  }, submitButtonProps, {
618
- htmlType: "submit"
619
- }), submitText);
668
+ htmlType: 'submit',
669
+ children: submitText
670
+ }));
620
671
  }
621
672
 
622
673
  /** The `TitleField` is the template to use to render the title of a field
@@ -632,8 +683,8 @@ function TitleField(_ref) {
632
683
  var _formContext$colon = formContext.colon,
633
684
  colon = _formContext$colon === void 0 ? true : _formContext$colon;
634
685
  var labelChildren = title;
635
- if (colon && typeof title === "string" && title.trim() !== "") {
636
- labelChildren = title.replace(/[::]\s*$/, "");
686
+ if (colon && typeof title === 'string' && title.trim() !== '') {
687
+ labelChildren = title.replace(/[::]\s*$/, '');
637
688
  }
638
689
  var handleLabelClick = function handleLabelClick() {
639
690
  if (!id) {
@@ -644,17 +695,20 @@ function TitleField(_ref) {
644
695
  control.focus();
645
696
  }
646
697
  };
647
- return title ? /*#__PURE__*/React.createElement(ConfigConsumer, null, function (configProps) {
648
- var _classNames;
649
- var getPrefixCls = configProps.getPrefixCls;
650
- var prefixCls = getPrefixCls("form");
651
- var labelClassName = classNames((_classNames = {}, _classNames[prefixCls + "-item-required"] = required, _classNames[prefixCls + "-item-no-colon"] = !colon, _classNames));
652
- return /*#__PURE__*/React.createElement("label", {
653
- className: labelClassName,
654
- htmlFor: id,
655
- onClick: handleLabelClick,
656
- title: typeof title === "string" ? title : ""
657
- }, labelChildren);
698
+ return title ? jsx(ConfigConsumer, {
699
+ children: function children(configProps) {
700
+ var _classNames;
701
+ var getPrefixCls = configProps.getPrefixCls;
702
+ var prefixCls = getPrefixCls('form');
703
+ var labelClassName = classNames((_classNames = {}, _classNames[prefixCls + "-item-required"] = required, _classNames[prefixCls + "-item-no-colon"] = !colon, _classNames));
704
+ return jsx("label", {
705
+ className: labelClassName,
706
+ htmlFor: id,
707
+ onClick: handleLabelClick,
708
+ title: typeof title === 'string' ? title : '',
709
+ children: labelChildren
710
+ });
711
+ }
658
712
  }) : null;
659
713
  }
660
714
 
@@ -665,7 +719,7 @@ var VERTICAL_WRAPPER_COL = {
665
719
  span: 24
666
720
  };
667
721
  var INPUT_STYLE$1 = {
668
- width: "100%"
722
+ width: '100%'
669
723
  };
670
724
  /** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
671
725
  * part of an `additionalProperties` part of a schema.
@@ -696,7 +750,7 @@ function WrapIfAdditionalTemplate(props) {
696
750
  _registry$formContext4 = _registry$formContext.rowGutter,
697
751
  rowGutter = _registry$formContext4 === void 0 ? 24 : _registry$formContext4,
698
752
  _registry$formContext5 = _registry$formContext.toolbarAlign,
699
- toolbarAlign = _registry$formContext5 === void 0 ? "top" : _registry$formContext5,
753
+ toolbarAlign = _registry$formContext5 === void 0 ? 'top' : _registry$formContext5,
700
754
  _registry$formContext6 = _registry$formContext.wrapperCol,
701
755
  wrapperCol = _registry$formContext6 === void 0 ? VERTICAL_WRAPPER_COL : _registry$formContext6,
702
756
  wrapperStyle = _registry$formContext.wrapperStyle;
@@ -707,10 +761,11 @@ function WrapIfAdditionalTemplate(props) {
707
761
  var keyLabel = translateString(TranslatableString.KeyLabel, [label]);
708
762
  var additional = (ADDITIONAL_PROPERTY_FLAG in schema);
709
763
  if (!additional) {
710
- return /*#__PURE__*/React.createElement("div", {
764
+ return jsx("div", {
711
765
  className: classNames,
712
- style: style
713
- }, children);
766
+ style: style,
767
+ children: children
768
+ });
714
769
  }
715
770
  var handleBlur = function handleBlur(_ref) {
716
771
  var target = _ref.target;
@@ -721,48 +776,55 @@ function WrapIfAdditionalTemplate(props) {
721
776
  var buttonUiOptions = _extends({}, uiSchema, (_extends2 = {}, _extends2[UI_OPTIONS_KEY] = _extends({}, uiOptions, {
722
777
  block: true
723
778
  }), _extends2));
724
- return /*#__PURE__*/React.createElement("div", {
779
+ return jsx("div", {
725
780
  className: classNames,
726
- style: style
727
- }, /*#__PURE__*/React.createElement(Row, {
728
- align: toolbarAlign,
729
- gutter: rowGutter
730
- }, /*#__PURE__*/React.createElement(Col, {
731
- className: "form-additional",
732
- flex: "1"
733
- }, /*#__PURE__*/React.createElement("div", {
734
- className: "form-group"
735
- }, /*#__PURE__*/React.createElement(Form$1.Item, {
736
- colon: colon,
737
- className: "form-group",
738
- hasFeedback: true,
739
- htmlFor: id + "-key",
740
- label: keyLabel,
741
- labelCol: labelCol,
742
- required: required,
743
- style: wrapperStyle,
744
- wrapperCol: wrapperCol
745
- }, /*#__PURE__*/React.createElement(Input, {
746
- className: "form-control",
747
- defaultValue: label,
748
- disabled: disabled || readonlyAsDisabled && readonly,
749
- id: id + "-key",
750
- name: id + "-key",
751
- onBlur: !readonly ? handleBlur : undefined,
752
- style: INPUT_STYLE$1,
753
- type: "text"
754
- })))), /*#__PURE__*/React.createElement(Col, {
755
- className: "form-additional",
756
- flex: "1"
757
- }, children), /*#__PURE__*/React.createElement(Col, {
758
- flex: "192px"
759
- }, /*#__PURE__*/React.createElement(RemoveButton, {
760
- className: "array-item-remove",
761
- disabled: disabled || readonly,
762
- onClick: onDropPropertyClick(label),
763
- uiSchema: buttonUiOptions,
764
- registry: registry
765
- }))));
781
+ style: style,
782
+ children: jsxs(Row, {
783
+ align: toolbarAlign,
784
+ gutter: rowGutter,
785
+ children: [jsx(Col, {
786
+ className: 'form-additional',
787
+ flex: '1',
788
+ children: jsx("div", {
789
+ className: 'form-group',
790
+ children: jsx(Form$1.Item, {
791
+ colon: colon,
792
+ className: 'form-group',
793
+ hasFeedback: true,
794
+ htmlFor: id + "-key",
795
+ label: keyLabel,
796
+ labelCol: labelCol,
797
+ required: required,
798
+ style: wrapperStyle,
799
+ wrapperCol: wrapperCol,
800
+ children: jsx(Input, {
801
+ className: 'form-control',
802
+ defaultValue: label,
803
+ disabled: disabled || readonlyAsDisabled && readonly,
804
+ id: id + "-key",
805
+ name: id + "-key",
806
+ onBlur: !readonly ? handleBlur : undefined,
807
+ style: INPUT_STYLE$1,
808
+ type: 'text'
809
+ })
810
+ })
811
+ })
812
+ }), jsx(Col, {
813
+ className: 'form-additional',
814
+ flex: '1',
815
+ children: children
816
+ }), jsx(Col, {
817
+ flex: '192px',
818
+ children: jsx(RemoveButton, {
819
+ className: 'array-item-remove',
820
+ disabled: disabled || readonly,
821
+ onClick: onDropPropertyClick(label),
822
+ uiSchema: buttonUiOptions,
823
+ registry: registry
824
+ })
825
+ })]
826
+ })
827
+ });
766
828
  }
767
829
 
768
830
  function generateTemplates() {
@@ -772,6 +834,7 @@ function generateTemplates() {
772
834
  BaseInputTemplate: BaseInputTemplate,
773
835
  ButtonTemplates: {
774
836
  AddButton: AddButton,
837
+ CopyButton: CopyButton,
775
838
  MoveDownButton: MoveDownButton,
776
839
  MoveUpButton: MoveUpButton,
777
840
  RemoveButton: RemoveButton,
@@ -814,29 +877,29 @@ function dateElementProps(state, time, yearsRange) {
814
877
  minute = state.minute,
815
878
  second = state.second;
816
879
  var data = [{
817
- type: "year",
880
+ type: 'year',
818
881
  range: yearsRange,
819
882
  value: year
820
883
  }, {
821
- type: "month",
884
+ type: 'month',
822
885
  range: [1, 12],
823
886
  value: month
824
887
  }, {
825
- type: "day",
888
+ type: 'day',
826
889
  range: [1, 31],
827
890
  value: day
828
891
  }];
829
892
  if (time) {
830
893
  data.push({
831
- type: "hour",
894
+ type: 'hour',
832
895
  range: [0, 23],
833
896
  value: hour || -1
834
897
  }, {
835
- type: "minute",
898
+ type: 'minute',
836
899
  range: [0, 59],
837
900
  value: minute || -1
838
901
  }, {
839
- type: "second",
902
+ type: 'second',
840
903
  range: [0, 59],
841
904
  value: second || -1
842
905
  });
@@ -869,7 +932,7 @@ function AltDateWidget(props) {
869
932
  }, [showTime, value]);
870
933
  var handleChange = function handleChange(property, nextValue) {
871
934
  var _extends2;
872
- var nextState = _extends({}, state, (_extends2 = {}, _extends2[property] = typeof nextValue === "undefined" ? -1 : nextValue, _extends2));
935
+ var nextState = _extends({}, state, (_extends2 = {}, _extends2[property] = typeof nextValue === 'undefined' ? -1 : nextValue, _extends2));
873
936
  if (readyForChange(nextState)) {
874
937
  onChange(toDateString(nextState, showTime));
875
938
  } else {
@@ -892,9 +955,9 @@ function AltDateWidget(props) {
892
955
  onChange(undefined);
893
956
  };
894
957
  var renderDateElement = function renderDateElement(elemProps) {
895
- return /*#__PURE__*/React.createElement(SelectWidget, {
958
+ return jsx(SelectWidget, {
896
959
  autofocus: elemProps.autofocus,
897
- className: "form-control",
960
+ className: 'form-control',
898
961
  disabled: elemProps.disabled,
899
962
  id: elemProps.id,
900
963
  name: elemProps.name,
@@ -909,51 +972,56 @@ function AltDateWidget(props) {
909
972
  placeholder: elemProps.type,
910
973
  readonly: elemProps.readonly,
911
974
  schema: {
912
- type: "integer"
975
+ type: 'integer'
913
976
  },
914
977
  value: elemProps.value,
915
978
  registry: registry,
916
- label: "",
979
+ label: '',
917
980
  "aria-describedby": ariaDescribedByIds(id)
918
981
  });
919
982
  };
920
- return /*#__PURE__*/React.createElement(Row, {
921
- gutter: [Math.floor(rowGutter / 2), Math.floor(rowGutter / 2)]
922
- }, dateElementProps(state, showTime, options.yearsRange).map(function (elemProps, i) {
923
- var elemId = id + "_" + elemProps.type;
924
- return /*#__PURE__*/React.createElement(Col, {
925
- flex: "88px",
926
- key: elemId
927
- }, renderDateElement(_extends({}, elemProps, {
928
- autofocus: autofocus && i === 0,
929
- disabled: disabled,
930
- id: elemId,
931
- name: id,
932
- onBlur: onBlur,
933
- onFocus: onFocus,
934
- readonly: readonly,
935
- registry: registry,
936
- select: handleChange,
937
- // NOTE: antd components accept -1 rather than issue a warning
938
- // like material-ui, so we need to convert -1 to undefined here.
939
- value: elemProps.value < 0 ? undefined : elemProps.value
940
- })));
941
- }), !options.hideNowButton && /*#__PURE__*/React.createElement(Col, {
942
- flex: "88px"
943
- }, /*#__PURE__*/React.createElement(Button, {
944
- block: true,
945
- className: "btn-now",
946
- onClick: handleNow,
947
- type: "primary"
948
- }, translateString(TranslatableString.NowLabel))), !options.hideClearButton && /*#__PURE__*/React.createElement(Col, {
949
- flex: "88px"
950
- }, /*#__PURE__*/React.createElement(Button, {
951
- block: true,
952
- className: "btn-clear",
953
- danger: true,
954
- onClick: handleClear,
955
- type: "primary"
956
- }, translateString(TranslatableString.ClearLabel))));
983
+ return jsxs(Row, {
984
+ gutter: [Math.floor(rowGutter / 2), Math.floor(rowGutter / 2)],
985
+ children: [dateElementProps(state, showTime, options.yearsRange).map(function (elemProps, i) {
986
+ var elemId = id + '_' + elemProps.type;
987
+ return jsx(Col, {
988
+ flex: '88px',
989
+ children: renderDateElement(_extends({}, elemProps, {
990
+ autofocus: autofocus && i === 0,
991
+ disabled: disabled,
992
+ id: elemId,
993
+ name: id,
994
+ onBlur: onBlur,
995
+ onFocus: onFocus,
996
+ readonly: readonly,
997
+ registry: registry,
998
+ select: handleChange,
999
+ // NOTE: antd components accept -1 rather than issue a warning
1000
+ // like material-ui, so we need to convert -1 to undefined here.
1001
+ value: elemProps.value < 0 ? undefined : elemProps.value
1002
+ }))
1003
+ }, elemId);
1004
+ }), !options.hideNowButton && jsx(Col, {
1005
+ flex: '88px',
1006
+ children: jsx(Button, {
1007
+ block: true,
1008
+ className: 'btn-now',
1009
+ onClick: handleNow,
1010
+ type: 'primary',
1011
+ children: translateString(TranslatableString.NowLabel)
1012
+ })
1013
+ }), !options.hideClearButton && jsx(Col, {
1014
+ flex: '88px',
1015
+ children: jsx(Button, {
1016
+ block: true,
1017
+ className: 'btn-clear',
1018
+ danger: true,
1019
+ onClick: handleClear,
1020
+ type: 'primary',
1021
+ children: translateString(TranslatableString.ClearLabel)
1022
+ })
1023
+ })]
1024
+ });
957
1025
  }
958
1026
  AltDateWidget.defaultProps = {
959
1027
  autofocus: false,
@@ -967,7 +1035,7 @@ AltDateWidget.defaultProps = {
967
1035
 
968
1036
  function AltDateTimeWidget(props) {
969
1037
  var AltDateWidget = props.registry.widgets.AltDateWidget;
970
- return /*#__PURE__*/React.createElement(AltDateWidget, _extends({
1038
+ return jsx(AltDateWidget, _extends({
971
1039
  showTime: true
972
1040
  }, props));
973
1041
  }
@@ -1016,23 +1084,25 @@ function CheckboxesWidget(_ref) {
1016
1084
  onFocus: !readonly ? handleFocus : undefined
1017
1085
  };
1018
1086
  var selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
1019
- return Array.isArray(enumOptions) && enumOptions.length > 0 ? /*#__PURE__*/React.createElement(Checkbox.Group, _extends({
1087
+ return Array.isArray(enumOptions) && enumOptions.length > 0 ? jsx(Checkbox.Group, _extends({
1020
1088
  disabled: disabled || readonlyAsDisabled && readonly,
1021
1089
  name: id,
1022
1090
  onChange: !readonly ? handleChange : undefined,
1023
1091
  value: selectedIndexes
1024
1092
  }, extraProps, {
1025
- "aria-describedby": ariaDescribedByIds(id)
1026
- }), Array.isArray(enumOptions) && enumOptions.map(function (option, i) {
1027
- return /*#__PURE__*/React.createElement("span", {
1028
- key: i
1029
- }, /*#__PURE__*/React.createElement(Checkbox, {
1030
- id: optionId(id, i),
1031
- name: id,
1032
- autoFocus: i === 0 ? autofocus : false,
1033
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
1034
- value: String(i)
1035
- }, option.label), !inline && /*#__PURE__*/React.createElement("br", null));
1093
+ "aria-describedby": ariaDescribedByIds(id),
1094
+ children: Array.isArray(enumOptions) && enumOptions.map(function (option, i) {
1095
+ return jsxs("span", {
1096
+ children: [jsx(Checkbox, {
1097
+ id: optionId(id, i),
1098
+ name: id,
1099
+ autoFocus: i === 0 ? autofocus : false,
1100
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
1101
+ value: String(i),
1102
+ children: option.label
1103
+ }), !inline && jsx("br", {})]
1104
+ }, i);
1105
+ })
1036
1106
  })) : null;
1037
1107
  }
1038
1108
 
@@ -1072,22 +1142,23 @@ function CheckboxWidget(props) {
1072
1142
  onBlur: !readonly ? handleBlur : undefined,
1073
1143
  onFocus: !readonly ? handleFocus : undefined
1074
1144
  };
1075
- return /*#__PURE__*/React.createElement(Checkbox, _extends({
1145
+ return jsx(Checkbox, _extends({
1076
1146
  autoFocus: autofocus,
1077
- checked: typeof value === "undefined" ? false : value,
1147
+ checked: typeof value === 'undefined' ? false : value,
1078
1148
  disabled: disabled || readonlyAsDisabled && readonly,
1079
1149
  id: id,
1080
1150
  name: id,
1081
1151
  onChange: !readonly ? handleChange : undefined
1082
1152
  }, extraProps, {
1083
- "aria-describedby": ariaDescribedByIds(id)
1084
- }), label);
1153
+ "aria-describedby": ariaDescribedByIds(id),
1154
+ children: label
1155
+ }));
1085
1156
  }
1086
1157
 
1087
1158
  var DatePicker = /*#__PURE__*/generatePicker(dayjsGenerateConfig);
1088
1159
 
1089
1160
  var DATE_PICKER_STYLE$1 = {
1090
- width: "100%"
1161
+ width: '100%'
1091
1162
  };
1092
1163
  /** The `DateTimeWidget` component uses the `BaseInputTemplate` changing the type to `datetime-local` and transforms
1093
1164
  * the value to/from utc using the appropriate utility functions.
@@ -1118,7 +1189,7 @@ function DateTimeWidget(props) {
1118
1189
  var getPopupContainer = function getPopupContainer(node) {
1119
1190
  return node.parentNode;
1120
1191
  };
1121
- return /*#__PURE__*/React.createElement(DatePicker, {
1192
+ return jsx(DatePicker, {
1122
1193
  disabled: disabled || readonlyAsDisabled && readonly,
1123
1194
  getPopupContainer: getPopupContainer,
1124
1195
  id: id,
@@ -1135,7 +1206,7 @@ function DateTimeWidget(props) {
1135
1206
  }
1136
1207
 
1137
1208
  var DATE_PICKER_STYLE = {
1138
- width: "100%"
1209
+ width: '100%'
1139
1210
  };
1140
1211
  /** The `DateWidget` component uses the `BaseInputTemplate` changing the type to `date` and transforms
1141
1212
  * the value to undefined when it is falsy during the `onChange` handling.
@@ -1155,7 +1226,7 @@ function DateWidget(props) {
1155
1226
  var _formContext$readonly = formContext.readonlyAsDisabled,
1156
1227
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1157
1228
  var handleChange = function handleChange(nextValue) {
1158
- return onChange(nextValue && nextValue.format("YYYY-MM-DD"));
1229
+ return onChange(nextValue && nextValue.format('YYYY-MM-DD'));
1159
1230
  };
1160
1231
  var handleBlur = function handleBlur() {
1161
1232
  return onBlur(id, value);
@@ -1166,7 +1237,7 @@ function DateWidget(props) {
1166
1237
  var getPopupContainer = function getPopupContainer(node) {
1167
1238
  return node.parentNode;
1168
1239
  };
1169
- return /*#__PURE__*/React.createElement(DatePicker, {
1240
+ return jsx(DatePicker, {
1170
1241
  disabled: disabled || readonlyAsDisabled && readonly,
1171
1242
  getPopupContainer: getPopupContainer,
1172
1243
  id: id,
@@ -1199,10 +1270,10 @@ function PasswordWidget(props) {
1199
1270
  value = props.value;
1200
1271
  var _formContext$readonly = formContext.readonlyAsDisabled,
1201
1272
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1202
- var emptyValue = options.emptyValue || "";
1273
+ var emptyValue = options.emptyValue || '';
1203
1274
  var handleChange = function handleChange(_ref) {
1204
1275
  var target = _ref.target;
1205
- return onChange(target.value === "" ? emptyValue : target.value);
1276
+ return onChange(target.value === '' ? emptyValue : target.value);
1206
1277
  };
1207
1278
  var handleBlur = function handleBlur(_ref2) {
1208
1279
  var target = _ref2.target;
@@ -1212,7 +1283,7 @@ function PasswordWidget(props) {
1212
1283
  var target = _ref3.target;
1213
1284
  return onFocus(id, target.value);
1214
1285
  };
1215
- return /*#__PURE__*/React.createElement(Input.Password, {
1286
+ return jsx(Input.Password, {
1216
1287
  disabled: disabled || readonlyAsDisabled && readonly,
1217
1288
  id: id,
1218
1289
  name: id,
@@ -1220,7 +1291,7 @@ function PasswordWidget(props) {
1220
1291
  onChange: !readonly ? handleChange : undefined,
1221
1292
  onFocus: !readonly ? handleFocus : undefined,
1222
1293
  placeholder: placeholder,
1223
- value: value || "",
1294
+ value: value || '',
1224
1295
  "aria-describedby": ariaDescribedByIds(id)
1225
1296
  });
1226
1297
  }
@@ -1259,7 +1330,7 @@ function RadioWidget(_ref) {
1259
1330
  return onFocus(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
1260
1331
  };
1261
1332
  var selectedIndexes = enumOptionsIndexForValue(value, enumOptions);
1262
- return /*#__PURE__*/React.createElement(Radio.Group, {
1333
+ return jsx(Radio.Group, {
1263
1334
  disabled: disabled || readonlyAsDisabled && readonly,
1264
1335
  id: id,
1265
1336
  name: id,
@@ -1267,17 +1338,18 @@ function RadioWidget(_ref) {
1267
1338
  onBlur: !readonly ? handleBlur : undefined,
1268
1339
  onFocus: !readonly ? handleFocus : undefined,
1269
1340
  value: selectedIndexes,
1270
- "aria-describedby": ariaDescribedByIds(id)
1271
- }, Array.isArray(enumOptions) && enumOptions.map(function (option, i) {
1272
- return /*#__PURE__*/React.createElement(Radio, {
1273
- id: optionId(id, i),
1274
- name: id,
1275
- autoFocus: i === 0 ? autofocus : false,
1276
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
1277
- key: i,
1278
- value: String(i)
1279
- }, option.label);
1280
- }));
1341
+ "aria-describedby": ariaDescribedByIds(id),
1342
+ children: Array.isArray(enumOptions) && enumOptions.map(function (option, i) {
1343
+ return jsx(Radio, {
1344
+ id: optionId(id, i),
1345
+ name: id,
1346
+ autoFocus: i === 0 ? autofocus : false,
1347
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
1348
+ value: String(i),
1349
+ children: option.label
1350
+ }, i);
1351
+ })
1352
+ });
1281
1353
  }
1282
1354
 
1283
1355
  /** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
@@ -1304,9 +1376,9 @@ function RangeWidget(props) {
1304
1376
  min = _rangeSpec.min,
1305
1377
  max = _rangeSpec.max,
1306
1378
  step = _rangeSpec.step;
1307
- var emptyValue = options.emptyValue || "";
1379
+ var emptyValue = options.emptyValue || '';
1308
1380
  var handleChange = function handleChange(nextValue) {
1309
- return onChange(nextValue === "" ? emptyValue : nextValue);
1381
+ return onChange(nextValue === '' ? emptyValue : nextValue);
1310
1382
  };
1311
1383
  var handleBlur = function handleBlur() {
1312
1384
  return onBlur(id, value);
@@ -1321,7 +1393,7 @@ function RangeWidget(props) {
1321
1393
  onBlur: !readonly ? handleBlur : undefined,
1322
1394
  onFocus: !readonly ? handleFocus : undefined
1323
1395
  };
1324
- return /*#__PURE__*/React.createElement(Slider, _extends({
1396
+ return jsx(Slider, _extends({
1325
1397
  autoFocus: autofocus,
1326
1398
  disabled: disabled || readonlyAsDisabled && readonly,
1327
1399
  id: id,
@@ -1337,7 +1409,7 @@ function RangeWidget(props) {
1337
1409
  }
1338
1410
 
1339
1411
  var SELECT_STYLE = {
1340
- width: "100%"
1412
+ width: '100%'
1341
1413
  };
1342
1414
  /** The `SelectWidget` is a widget for rendering dropdowns.
1343
1415
  * It is typically used with string properties constrained with enum options.
@@ -1388,12 +1460,12 @@ function SelectWidget(_ref) {
1388
1460
  var extraProps = {
1389
1461
  name: id
1390
1462
  };
1391
- return /*#__PURE__*/React.createElement(Select, _extends({
1463
+ return jsx(Select, _extends({
1392
1464
  autoFocus: autofocus,
1393
1465
  disabled: disabled || readonlyAsDisabled && readonly,
1394
1466
  getPopupContainer: getPopupContainer,
1395
1467
  id: id,
1396
- mode: typeof multiple !== "undefined" ? "multiple" : undefined,
1468
+ mode: typeof multiple !== 'undefined' ? 'multiple' : undefined,
1397
1469
  onBlur: !readonly ? handleBlur : undefined,
1398
1470
  onChange: !readonly ? handleChange : undefined,
1399
1471
  onFocus: !readonly ? handleFocus : undefined,
@@ -1402,20 +1474,21 @@ function SelectWidget(_ref) {
1402
1474
  value: selectedIndexes
1403
1475
  }, extraProps, {
1404
1476
  filterOption: filterOption,
1405
- "aria-describedby": ariaDescribedByIds(id)
1406
- }), Array.isArray(enumOptions) && enumOptions.map(function (_ref2, index) {
1407
- var optionValue = _ref2.value,
1408
- optionLabel = _ref2.label;
1409
- return /*#__PURE__*/React.createElement(Select.Option, {
1410
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
1411
- key: String(index),
1412
- value: String(index)
1413
- }, optionLabel);
1477
+ "aria-describedby": ariaDescribedByIds(id),
1478
+ children: Array.isArray(enumOptions) && enumOptions.map(function (_ref2, index) {
1479
+ var optionValue = _ref2.value,
1480
+ optionLabel = _ref2.label;
1481
+ return jsx(Select.Option, {
1482
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
1483
+ value: String(index),
1484
+ children: optionLabel
1485
+ }, String(index));
1486
+ })
1414
1487
  }));
1415
1488
  }
1416
1489
 
1417
1490
  var INPUT_STYLE = {
1418
- width: "100%"
1491
+ width: '100%'
1419
1492
  };
1420
1493
  /** The `TextareaWidget` is a widget for rendering input fields as textarea.
1421
1494
  *
@@ -1436,7 +1509,7 @@ function TextareaWidget(_ref) {
1436
1509
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1437
1510
  var handleChange = function handleChange(_ref2) {
1438
1511
  var target = _ref2.target;
1439
- return onChange(target.value === "" ? options.emptyValue : target.value);
1512
+ return onChange(target.value === '' ? options.emptyValue : target.value);
1440
1513
  };
1441
1514
  var handleBlur = function handleBlur(_ref3) {
1442
1515
  var target = _ref3.target;
@@ -1449,9 +1522,9 @@ function TextareaWidget(_ref) {
1449
1522
  // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
1450
1523
  // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
1451
1524
  var extraProps = {
1452
- type: "textarea"
1525
+ type: 'textarea'
1453
1526
  };
1454
- return /*#__PURE__*/React.createElement(Input.TextArea, _extends({
1527
+ return jsx(Input.TextArea, _extends({
1455
1528
  disabled: disabled || readonlyAsDisabled && readonly,
1456
1529
  id: id,
1457
1530
  name: id,