@rjsf/antd 5.2.0 → 5.2.1

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';
@@ -20,6 +20,7 @@ import Form$1 from 'antd/es/form';
20
20
  import isObject from 'lodash-es/isObject';
21
21
  import isNumber from 'lodash-es/isNumber';
22
22
  import isString from 'lodash-es/isString';
23
+ import { useState, useEffect } from 'react';
23
24
  import Checkbox from 'antd/es/checkbox';
24
25
  import dayjs from 'dayjs';
25
26
  import dayjsGenerateConfig from 'rc-picker/es/generate/dayjs';
@@ -29,10 +30,10 @@ import Slider from 'antd/es/slider';
29
30
  import Select from 'antd/es/select';
30
31
 
31
32
  var BTN_GRP_STYLE = {
32
- width: "100%"
33
+ width: '100%'
33
34
  };
34
35
  var BTN_STYLE = {
35
- width: "calc(100% / 3)"
36
+ width: 'calc(100% / 3)'
36
37
  };
37
38
  /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
38
39
  *
@@ -59,36 +60,39 @@ function ArrayFieldItemTemplate(props) {
59
60
  _registry$formContext2 = _registry$formContext.rowGutter,
60
61
  rowGutter = _registry$formContext2 === void 0 ? 24 : _registry$formContext2,
61
62
  _registry$formContext3 = _registry$formContext.toolbarAlign,
62
- toolbarAlign = _registry$formContext3 === void 0 ? "top" : _registry$formContext3;
63
- return /*#__PURE__*/React.createElement(Row, {
63
+ toolbarAlign = _registry$formContext3 === void 0 ? 'top' : _registry$formContext3;
64
+ return jsxs(Row, {
64
65
  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
- }))));
66
+ gutter: rowGutter,
67
+ children: [jsx(Col, {
68
+ flex: '1',
69
+ children: children
70
+ }), hasToolbar && jsx(Col, {
71
+ flex: '192px',
72
+ children: jsxs(Button.Group, {
73
+ style: BTN_GRP_STYLE,
74
+ children: [(hasMoveUp || hasMoveDown) && jsx(MoveUpButton, {
75
+ disabled: disabled || readonly || !hasMoveUp,
76
+ onClick: onReorderClick(index, index - 1),
77
+ style: BTN_STYLE,
78
+ uiSchema: uiSchema,
79
+ registry: registry
80
+ }), (hasMoveUp || hasMoveDown) && jsx(MoveDownButton, {
81
+ disabled: disabled || readonly || !hasMoveDown,
82
+ onClick: onReorderClick(index, index + 1),
83
+ style: BTN_STYLE,
84
+ uiSchema: uiSchema,
85
+ registry: registry
86
+ }), hasRemove && jsx(RemoveButton, {
87
+ disabled: disabled || readonly,
88
+ onClick: onDropIndexClick(index),
89
+ style: BTN_STYLE,
90
+ uiSchema: uiSchema,
91
+ registry: registry
92
+ })]
93
+ })
94
+ })]
95
+ }, "array-item-" + index);
92
96
  }
93
97
 
94
98
  function _extends() {
@@ -120,7 +124,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
120
124
 
121
125
  var _excluded$1 = ["key"];
122
126
  var DESCRIPTION_COL_STYLE$1 = {
123
- paddingBottom: "8px"
127
+ paddingBottom: '8px'
124
128
  };
125
129
  /** The `ArrayFieldTemplate` component is the template used to render all items in an array.
126
130
  *
@@ -141,75 +145,83 @@ function ArrayFieldTemplate(props) {
141
145
  title = props.title,
142
146
  uiSchema = props.uiSchema;
143
147
  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);
148
+ var ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
149
+ var ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
150
+ var ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
147
151
  // Button templates are not overridden in the uiSchema
148
152
  var AddButton = registry.templates.ButtonTemplates.AddButton;
149
153
  var _formContext$labelAli = formContext.labelAlign,
150
- labelAlign = _formContext$labelAli === void 0 ? "right" : _formContext$labelAli,
154
+ labelAlign = _formContext$labelAli === void 0 ? 'right' : _formContext$labelAli,
151
155
  _formContext$rowGutte = formContext.rowGutter,
152
156
  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
- );
157
+ return jsx(ConfigConsumer, {
158
+ children: function children(configProps) {
159
+ var getPrefixCls = configProps.getPrefixCls;
160
+ var prefixCls = getPrefixCls('form');
161
+ var labelClsBasic = prefixCls + "-item-label";
162
+ var labelColClassName = classNames(labelClsBasic, labelAlign === 'left' && labelClsBasic + "-left"
163
+ // labelCol.className,
164
+ );
160
165
 
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
- }))))));
166
+ return jsx("fieldset", {
167
+ className: className,
168
+ id: idSchema.$id,
169
+ children: jsxs(Row, {
170
+ gutter: rowGutter,
171
+ children: [(uiOptions.title || title) && jsx(Col, {
172
+ className: labelColClassName,
173
+ span: 24,
174
+ children: jsx(ArrayFieldTitleTemplate, {
175
+ idSchema: idSchema,
176
+ required: required,
177
+ title: uiOptions.title || title,
178
+ schema: schema,
179
+ uiSchema: uiSchema,
180
+ registry: registry
181
+ })
182
+ }), (uiOptions.description || schema.description) && jsx(Col, {
183
+ span: 24,
184
+ style: DESCRIPTION_COL_STYLE$1,
185
+ children: jsx(ArrayFieldDescriptionTemplate, {
186
+ description: uiOptions.description || schema.description || '',
187
+ idSchema: idSchema,
188
+ schema: schema,
189
+ uiSchema: uiSchema,
190
+ registry: registry
191
+ })
192
+ }), jsx(Col, {
193
+ className: 'row array-item-list',
194
+ span: 24,
195
+ children: items && items.map(function (_ref) {
196
+ var key = _ref.key,
197
+ itemProps = _objectWithoutPropertiesLoose(_ref, _excluded$1);
198
+ return jsx(ArrayFieldItemTemplate, _extends({}, itemProps), key);
199
+ })
200
+ }), canAdd && jsx(Col, {
201
+ span: 24,
202
+ children: jsx(Row, {
203
+ gutter: rowGutter,
204
+ justify: 'end',
205
+ children: jsx(Col, {
206
+ flex: '192px',
207
+ children: jsx(AddButton, {
208
+ className: 'array-item-add',
209
+ disabled: disabled || readonly,
210
+ onClick: onAddClick,
211
+ uiSchema: uiSchema,
212
+ registry: registry
213
+ })
214
+ })
215
+ })
216
+ })]
217
+ })
218
+ });
219
+ }
208
220
  });
209
221
  }
210
222
 
211
223
  var INPUT_STYLE$2 = {
212
- width: "100%"
224
+ width: '100%'
213
225
  };
214
226
  /** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
215
227
  * It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
@@ -223,6 +235,7 @@ function BaseInputTemplate(props) {
223
235
  id = props.id,
224
236
  onBlur = props.onBlur,
225
237
  onChange = props.onChange,
238
+ onChangeOverride = props.onChangeOverride,
226
239
  onFocus = props.onFocus,
227
240
  options = props.options,
228
241
  placeholder = props.placeholder,
@@ -236,9 +249,9 @@ function BaseInputTemplate(props) {
236
249
  var handleNumberChange = function handleNumberChange(nextValue) {
237
250
  return onChange(nextValue);
238
251
  };
239
- var handleTextChange = function handleTextChange(_ref) {
252
+ var handleTextChange = onChangeOverride ? onChangeOverride : function (_ref) {
240
253
  var target = _ref.target;
241
- return onChange(target.value === "" ? options.emptyValue : target.value);
254
+ return onChange(target.value === '' ? options.emptyValue : target.value);
242
255
  };
243
256
  var handleBlur = function handleBlur(_ref2) {
244
257
  var target = _ref2.target;
@@ -248,7 +261,7 @@ function BaseInputTemplate(props) {
248
261
  var target = _ref3.target;
249
262
  return onFocus(id, target.value);
250
263
  };
251
- var input = inputProps.type === "number" || inputProps.type === "integer" ? /*#__PURE__*/React.createElement(InputNumber, _extends({
264
+ var input = inputProps.type === 'number' || inputProps.type === 'integer' ? jsx(InputNumber, _extends({
252
265
  disabled: disabled || readonlyAsDisabled && readonly,
253
266
  id: id,
254
267
  name: id,
@@ -261,7 +274,7 @@ function BaseInputTemplate(props) {
261
274
  }, inputProps, {
262
275
  value: value,
263
276
  "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
264
- })) : /*#__PURE__*/React.createElement(Input, _extends({
277
+ })) : jsx(Input, _extends({
265
278
  disabled: disabled || readonlyAsDisabled && readonly,
266
279
  id: id,
267
280
  name: id,
@@ -275,14 +288,16 @@ function BaseInputTemplate(props) {
275
288
  value: value,
276
289
  "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
277
290
  }));
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
- })));
291
+ return jsxs(Fragment, {
292
+ children: [input, Array.isArray(schema.examples) && jsx("datalist", {
293
+ id: examplesId(id),
294
+ children: schema.examples.concat(schema["default"] && !schema.examples.includes(schema["default"]) ? [schema["default"]] : []).map(function (example) {
295
+ return jsx("option", {
296
+ value: example
297
+ }, example);
298
+ })
299
+ })]
300
+ });
286
301
  }
287
302
 
288
303
  /** The `DescriptionField` is the template to use to render the description of a field
@@ -295,9 +310,10 @@ function DescriptionField(props) {
295
310
  if (!description) {
296
311
  return null;
297
312
  }
298
- return /*#__PURE__*/React.createElement("span", {
299
- id: id
300
- }, description);
313
+ return jsx("span", {
314
+ id: id,
315
+ children: description
316
+ });
301
317
  }
302
318
 
303
319
  /** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
@@ -309,71 +325,74 @@ function ErrorList(_ref) {
309
325
  registry = _ref.registry;
310
326
  var translateString = registry.translateString;
311
327
  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
- }));
328
+ return jsx(List, {
329
+ className: 'list-group',
330
+ size: 'small',
331
+ children: errors.map(function (error, index) {
332
+ return jsx(List.Item, {
333
+ children: jsxs(Space, {
334
+ children: [jsx(ExclamationCircleOutlined, {}), error.stack]
335
+ })
336
+ }, index);
337
+ })
338
+ });
320
339
  };
321
- return /*#__PURE__*/React.createElement(Alert, {
322
- className: "panel panel-danger errors",
340
+ return jsx(Alert, {
341
+ className: 'panel panel-danger errors',
323
342
  description: renderErrors(),
324
343
  message: translateString(TranslatableString.ErrorsLabel),
325
- type: "error"
344
+ type: 'error'
326
345
  });
327
346
  }
328
347
 
329
348
  var _excluded = ["iconType", "icon", "uiSchema", "registry"];
330
349
  function IconButton(props) {
331
350
  var _props$iconType = props.iconType,
332
- iconType = _props$iconType === void 0 ? "default" : _props$iconType,
351
+ iconType = _props$iconType === void 0 ? 'default' : _props$iconType,
333
352
  icon = props.icon,
334
353
  otherProps = _objectWithoutPropertiesLoose(props, _excluded);
335
- return /*#__PURE__*/React.createElement(Button, _extends({
354
+ return jsx(Button, _extends({
336
355
  type: iconType,
337
356
  icon: icon
338
357
  }, otherProps));
339
358
  }
340
359
  function AddButton(props) {
341
360
  var translateString = props.registry.translateString;
342
- return /*#__PURE__*/React.createElement(IconButton, _extends({
361
+ return jsx(IconButton, _extends({
343
362
  title: translateString(TranslatableString.AddItemButton)
344
363
  }, props, {
345
364
  block: true,
346
- iconType: "primary",
347
- icon: /*#__PURE__*/React.createElement(PlusCircleOutlined, null)
365
+ iconType: 'primary',
366
+ icon: jsx(PlusCircleOutlined, {})
348
367
  }));
349
368
  }
350
369
  function MoveDownButton(props) {
351
370
  var translateString = props.registry.translateString;
352
- return /*#__PURE__*/React.createElement(IconButton, _extends({
371
+ return jsx(IconButton, _extends({
353
372
  title: translateString(TranslatableString.MoveDownButton)
354
373
  }, props, {
355
- icon: /*#__PURE__*/React.createElement(ArrowDownOutlined, null)
374
+ icon: jsx(ArrowDownOutlined, {})
356
375
  }));
357
376
  }
358
377
  function MoveUpButton(props) {
359
378
  var translateString = props.registry.translateString;
360
- return /*#__PURE__*/React.createElement(IconButton, _extends({
379
+ return jsx(IconButton, _extends({
361
380
  title: translateString(TranslatableString.MoveUpButton)
362
381
  }, props, {
363
- icon: /*#__PURE__*/React.createElement(ArrowUpOutlined, null)
382
+ icon: jsx(ArrowUpOutlined, {})
364
383
  }));
365
384
  }
366
385
  function RemoveButton(props) {
367
386
  // The `block` prop is not part of the `IconButtonProps` defined in the template, so get it from the uiSchema instead
368
387
  var options = getUiOptions(props.uiSchema);
369
388
  var translateString = props.registry.translateString;
370
- return /*#__PURE__*/React.createElement(IconButton, _extends({
389
+ return jsx(IconButton, _extends({
371
390
  title: translateString(TranslatableString.RemoveButton)
372
391
  }, props, {
373
392
  danger: true,
374
393
  block: !!options.block,
375
- iconType: "primary",
376
- icon: /*#__PURE__*/React.createElement(DeleteOutlined, null)
394
+ iconType: 'primary',
395
+ icon: jsx(DeleteOutlined, {})
377
396
  }));
378
397
  }
379
398
 
@@ -389,13 +408,14 @@ function FieldErrorTemplate(props) {
389
408
  return null;
390
409
  }
391
410
  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
- }));
411
+ return jsx("div", {
412
+ id: id,
413
+ children: errors.map(function (error) {
414
+ return jsx("div", {
415
+ children: error
416
+ }, "field-" + id + "-error-" + error);
417
+ })
418
+ });
399
419
  }
400
420
 
401
421
  var VERTICAL_LABEL_COL$1 = {
@@ -439,13 +459,14 @@ function FieldTemplate(props) {
439
459
  wrapperCol = _formContext$wrapperC === void 0 ? VERTICAL_WRAPPER_COL$1 : _formContext$wrapperC,
440
460
  wrapperStyle = formContext.wrapperStyle;
441
461
  var uiOptions = getUiOptions(uiSchema);
442
- var WrapIfAdditionalTemplate = getTemplate("WrapIfAdditionalTemplate", registry, uiOptions);
462
+ var WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
443
463
  if (hidden) {
444
- return /*#__PURE__*/React.createElement("div", {
445
- className: "field-hidden"
446
- }, children);
464
+ return jsx("div", {
465
+ className: 'field-hidden',
466
+ children: children
467
+ });
447
468
  }
448
- return /*#__PURE__*/React.createElement(WrapIfAdditionalTemplate, {
469
+ return jsx(WrapIfAdditionalTemplate, {
449
470
  classNames: classNames,
450
471
  style: style,
451
472
  disabled: disabled,
@@ -457,24 +478,26 @@ function FieldTemplate(props) {
457
478
  required: required,
458
479
  schema: schema,
459
480
  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));
481
+ registry: registry,
482
+ children: id === 'root' ? children : jsx(Form$1.Item, {
483
+ colon: colon,
484
+ extra: rawDescription && description,
485
+ hasFeedback: schema.type !== 'array' && schema.type !== 'object',
486
+ help: !!rawHelp && help || (rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? errors : undefined),
487
+ htmlFor: id,
488
+ label: displayLabel && label,
489
+ labelCol: labelCol,
490
+ required: required,
491
+ style: wrapperStyle,
492
+ validateStatus: rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? 'error' : undefined,
493
+ wrapperCol: wrapperCol,
494
+ children: children
495
+ })
496
+ });
474
497
  }
475
498
 
476
499
  var DESCRIPTION_COL_STYLE = {
477
- paddingBottom: "8px"
500
+ paddingBottom: '8px'
478
501
  };
479
502
  /** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
480
503
  * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
@@ -497,14 +520,14 @@ function ObjectFieldTemplate(props) {
497
520
  title = props.title,
498
521
  uiSchema = props.uiSchema;
499
522
  var uiOptions = getUiOptions(uiSchema);
500
- var TitleFieldTemplate = getTemplate("TitleFieldTemplate", registry, uiOptions);
501
- var DescriptionFieldTemplate = getTemplate("DescriptionFieldTemplate", registry, uiOptions);
523
+ var TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
524
+ var DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
502
525
  // Button templates are not overridden in the uiSchema
503
526
  var AddButton = registry.templates.ButtonTemplates.AddButton;
504
527
  var _formContext$colSpan = formContext.colSpan,
505
528
  colSpan = _formContext$colSpan === void 0 ? 24 : _formContext$colSpan,
506
529
  _formContext$labelAli = formContext.labelAlign,
507
- labelAlign = _formContext$labelAli === void 0 ? "right" : _formContext$labelAli,
530
+ labelAlign = _formContext$labelAli === void 0 ? 'right' : _formContext$labelAli,
508
531
  _formContext$rowGutte = formContext.rowGutter,
509
532
  rowGutter = _formContext$rowGutte === void 0 ? 24 : _formContext$rowGutte;
510
533
  var findSchema = function findSchema(element) {
@@ -528,7 +551,7 @@ function ObjectFieldTemplate(props) {
528
551
  var widget = findUiSchemaWidget(element);
529
552
  var defaultColSpan = properties.length < 2 ||
530
553
  // Single or no field in object.
531
- type === "object" || type === "array" || widget === "textarea" ? 24 : 12;
554
+ type === 'object' || type === 'array' || widget === 'textarea' ? 24 : 12;
532
555
  if (isObject(colSpan)) {
533
556
  var colSpanObj = colSpan;
534
557
  if (isString(widget)) {
@@ -546,58 +569,67 @@ function ObjectFieldTemplate(props) {
546
569
  }
547
570
  return defaultColSpan;
548
571
  };
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
- );
572
+ return jsx(ConfigConsumer, {
573
+ children: function children(configProps) {
574
+ var getPrefixCls = configProps.getPrefixCls;
575
+ var prefixCls = getPrefixCls('form');
576
+ var labelClsBasic = prefixCls + "-item-label";
577
+ var labelColClassName = classNames(labelClsBasic, labelAlign === 'left' && labelClsBasic + "-left"
578
+ // labelCol.className,
579
+ );
556
580
 
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
- })))));
581
+ return jsxs("fieldset", {
582
+ id: idSchema.$id,
583
+ children: [jsxs(Row, {
584
+ gutter: rowGutter,
585
+ children: [(uiOptions.title || title) && jsx(Col, {
586
+ className: labelColClassName,
587
+ span: 24,
588
+ children: jsx(TitleFieldTemplate, {
589
+ id: titleId(idSchema),
590
+ title: uiOptions.title || title,
591
+ required: required,
592
+ schema: schema,
593
+ uiSchema: uiSchema,
594
+ registry: registry
595
+ })
596
+ }), (uiOptions.description || description) && jsx(Col, {
597
+ span: 24,
598
+ style: DESCRIPTION_COL_STYLE,
599
+ children: jsx(DescriptionFieldTemplate, {
600
+ id: descriptionId(idSchema),
601
+ description: uiOptions.description || description,
602
+ schema: schema,
603
+ uiSchema: uiSchema,
604
+ registry: registry
605
+ })
606
+ }), properties.filter(function (e) {
607
+ return !e.hidden;
608
+ }).map(function (element) {
609
+ return jsx(Col, {
610
+ span: calculateColSpan(element),
611
+ children: element.content
612
+ }, element.name);
613
+ })]
614
+ }), canExpand(schema, uiSchema, formData) && jsx(Col, {
615
+ span: 24,
616
+ children: jsx(Row, {
617
+ gutter: rowGutter,
618
+ justify: 'end',
619
+ children: jsx(Col, {
620
+ flex: '192px',
621
+ children: jsx(AddButton, {
622
+ className: 'object-property-expand',
623
+ disabled: disabled || readonly,
624
+ onClick: onAddClick(schema),
625
+ uiSchema: uiSchema,
626
+ registry: registry
627
+ })
628
+ })
629
+ })
630
+ })]
631
+ });
632
+ }
601
633
  });
602
634
  }
603
635
 
@@ -612,11 +644,12 @@ function SubmitButton(_ref) {
612
644
  if (norender) {
613
645
  return null;
614
646
  }
615
- return /*#__PURE__*/React.createElement(Button, _extends({
616
- type: "submit"
647
+ return jsx(Button, _extends({
648
+ type: 'submit'
617
649
  }, submitButtonProps, {
618
- htmlType: "submit"
619
- }), submitText);
650
+ htmlType: 'submit',
651
+ children: submitText
652
+ }));
620
653
  }
621
654
 
622
655
  /** The `TitleField` is the template to use to render the title of a field
@@ -632,8 +665,8 @@ function TitleField(_ref) {
632
665
  var _formContext$colon = formContext.colon,
633
666
  colon = _formContext$colon === void 0 ? true : _formContext$colon;
634
667
  var labelChildren = title;
635
- if (colon && typeof title === "string" && title.trim() !== "") {
636
- labelChildren = title.replace(/[::]\s*$/, "");
668
+ if (colon && typeof title === 'string' && title.trim() !== '') {
669
+ labelChildren = title.replace(/[::]\s*$/, '');
637
670
  }
638
671
  var handleLabelClick = function handleLabelClick() {
639
672
  if (!id) {
@@ -644,17 +677,20 @@ function TitleField(_ref) {
644
677
  control.focus();
645
678
  }
646
679
  };
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);
680
+ return title ? jsx(ConfigConsumer, {
681
+ children: function children(configProps) {
682
+ var _classNames;
683
+ var getPrefixCls = configProps.getPrefixCls;
684
+ var prefixCls = getPrefixCls('form');
685
+ var labelClassName = classNames((_classNames = {}, _classNames[prefixCls + "-item-required"] = required, _classNames[prefixCls + "-item-no-colon"] = !colon, _classNames));
686
+ return jsx("label", {
687
+ className: labelClassName,
688
+ htmlFor: id,
689
+ onClick: handleLabelClick,
690
+ title: typeof title === 'string' ? title : '',
691
+ children: labelChildren
692
+ });
693
+ }
658
694
  }) : null;
659
695
  }
660
696
 
@@ -665,7 +701,7 @@ var VERTICAL_WRAPPER_COL = {
665
701
  span: 24
666
702
  };
667
703
  var INPUT_STYLE$1 = {
668
- width: "100%"
704
+ width: '100%'
669
705
  };
670
706
  /** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
671
707
  * part of an `additionalProperties` part of a schema.
@@ -696,7 +732,7 @@ function WrapIfAdditionalTemplate(props) {
696
732
  _registry$formContext4 = _registry$formContext.rowGutter,
697
733
  rowGutter = _registry$formContext4 === void 0 ? 24 : _registry$formContext4,
698
734
  _registry$formContext5 = _registry$formContext.toolbarAlign,
699
- toolbarAlign = _registry$formContext5 === void 0 ? "top" : _registry$formContext5,
735
+ toolbarAlign = _registry$formContext5 === void 0 ? 'top' : _registry$formContext5,
700
736
  _registry$formContext6 = _registry$formContext.wrapperCol,
701
737
  wrapperCol = _registry$formContext6 === void 0 ? VERTICAL_WRAPPER_COL : _registry$formContext6,
702
738
  wrapperStyle = _registry$formContext.wrapperStyle;
@@ -707,10 +743,11 @@ function WrapIfAdditionalTemplate(props) {
707
743
  var keyLabel = translateString(TranslatableString.KeyLabel, [label]);
708
744
  var additional = (ADDITIONAL_PROPERTY_FLAG in schema);
709
745
  if (!additional) {
710
- return /*#__PURE__*/React.createElement("div", {
746
+ return jsx("div", {
711
747
  className: classNames,
712
- style: style
713
- }, children);
748
+ style: style,
749
+ children: children
750
+ });
714
751
  }
715
752
  var handleBlur = function handleBlur(_ref) {
716
753
  var target = _ref.target;
@@ -721,48 +758,55 @@ function WrapIfAdditionalTemplate(props) {
721
758
  var buttonUiOptions = _extends({}, uiSchema, (_extends2 = {}, _extends2[UI_OPTIONS_KEY] = _extends({}, uiOptions, {
722
759
  block: true
723
760
  }), _extends2));
724
- return /*#__PURE__*/React.createElement("div", {
761
+ return jsx("div", {
725
762
  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
- }))));
763
+ style: style,
764
+ children: jsxs(Row, {
765
+ align: toolbarAlign,
766
+ gutter: rowGutter,
767
+ children: [jsx(Col, {
768
+ className: 'form-additional',
769
+ flex: '1',
770
+ children: jsx("div", {
771
+ className: 'form-group',
772
+ children: jsx(Form$1.Item, {
773
+ colon: colon,
774
+ className: 'form-group',
775
+ hasFeedback: true,
776
+ htmlFor: id + "-key",
777
+ label: keyLabel,
778
+ labelCol: labelCol,
779
+ required: required,
780
+ style: wrapperStyle,
781
+ wrapperCol: wrapperCol,
782
+ children: jsx(Input, {
783
+ className: 'form-control',
784
+ defaultValue: label,
785
+ disabled: disabled || readonlyAsDisabled && readonly,
786
+ id: id + "-key",
787
+ name: id + "-key",
788
+ onBlur: !readonly ? handleBlur : undefined,
789
+ style: INPUT_STYLE$1,
790
+ type: 'text'
791
+ })
792
+ })
793
+ })
794
+ }), jsx(Col, {
795
+ className: 'form-additional',
796
+ flex: '1',
797
+ children: children
798
+ }), jsx(Col, {
799
+ flex: '192px',
800
+ children: jsx(RemoveButton, {
801
+ className: 'array-item-remove',
802
+ disabled: disabled || readonly,
803
+ onClick: onDropPropertyClick(label),
804
+ uiSchema: buttonUiOptions,
805
+ registry: registry
806
+ })
807
+ })]
808
+ })
809
+ });
766
810
  }
767
811
 
768
812
  function generateTemplates() {
@@ -814,29 +858,29 @@ function dateElementProps(state, time, yearsRange) {
814
858
  minute = state.minute,
815
859
  second = state.second;
816
860
  var data = [{
817
- type: "year",
861
+ type: 'year',
818
862
  range: yearsRange,
819
863
  value: year
820
864
  }, {
821
- type: "month",
865
+ type: 'month',
822
866
  range: [1, 12],
823
867
  value: month
824
868
  }, {
825
- type: "day",
869
+ type: 'day',
826
870
  range: [1, 31],
827
871
  value: day
828
872
  }];
829
873
  if (time) {
830
874
  data.push({
831
- type: "hour",
875
+ type: 'hour',
832
876
  range: [0, 23],
833
877
  value: hour || -1
834
878
  }, {
835
- type: "minute",
879
+ type: 'minute',
836
880
  range: [0, 59],
837
881
  value: minute || -1
838
882
  }, {
839
- type: "second",
883
+ type: 'second',
840
884
  range: [0, 59],
841
885
  value: second || -1
842
886
  });
@@ -869,7 +913,7 @@ function AltDateWidget(props) {
869
913
  }, [showTime, value]);
870
914
  var handleChange = function handleChange(property, nextValue) {
871
915
  var _extends2;
872
- var nextState = _extends({}, state, (_extends2 = {}, _extends2[property] = typeof nextValue === "undefined" ? -1 : nextValue, _extends2));
916
+ var nextState = _extends({}, state, (_extends2 = {}, _extends2[property] = typeof nextValue === 'undefined' ? -1 : nextValue, _extends2));
873
917
  if (readyForChange(nextState)) {
874
918
  onChange(toDateString(nextState, showTime));
875
919
  } else {
@@ -892,9 +936,9 @@ function AltDateWidget(props) {
892
936
  onChange(undefined);
893
937
  };
894
938
  var renderDateElement = function renderDateElement(elemProps) {
895
- return /*#__PURE__*/React.createElement(SelectWidget, {
939
+ return jsx(SelectWidget, {
896
940
  autofocus: elemProps.autofocus,
897
- className: "form-control",
941
+ className: 'form-control',
898
942
  disabled: elemProps.disabled,
899
943
  id: elemProps.id,
900
944
  name: elemProps.name,
@@ -909,51 +953,56 @@ function AltDateWidget(props) {
909
953
  placeholder: elemProps.type,
910
954
  readonly: elemProps.readonly,
911
955
  schema: {
912
- type: "integer"
956
+ type: 'integer'
913
957
  },
914
958
  value: elemProps.value,
915
959
  registry: registry,
916
- label: "",
960
+ label: '',
917
961
  "aria-describedby": ariaDescribedByIds(id)
918
962
  });
919
963
  };
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))));
964
+ return jsxs(Row, {
965
+ gutter: [Math.floor(rowGutter / 2), Math.floor(rowGutter / 2)],
966
+ children: [dateElementProps(state, showTime, options.yearsRange).map(function (elemProps, i) {
967
+ var elemId = id + '_' + elemProps.type;
968
+ return jsx(Col, {
969
+ flex: '88px',
970
+ children: renderDateElement(_extends({}, elemProps, {
971
+ autofocus: autofocus && i === 0,
972
+ disabled: disabled,
973
+ id: elemId,
974
+ name: id,
975
+ onBlur: onBlur,
976
+ onFocus: onFocus,
977
+ readonly: readonly,
978
+ registry: registry,
979
+ select: handleChange,
980
+ // NOTE: antd components accept -1 rather than issue a warning
981
+ // like material-ui, so we need to convert -1 to undefined here.
982
+ value: elemProps.value < 0 ? undefined : elemProps.value
983
+ }))
984
+ }, elemId);
985
+ }), !options.hideNowButton && jsx(Col, {
986
+ flex: '88px',
987
+ children: jsx(Button, {
988
+ block: true,
989
+ className: 'btn-now',
990
+ onClick: handleNow,
991
+ type: 'primary',
992
+ children: translateString(TranslatableString.NowLabel)
993
+ })
994
+ }), !options.hideClearButton && jsx(Col, {
995
+ flex: '88px',
996
+ children: jsx(Button, {
997
+ block: true,
998
+ className: 'btn-clear',
999
+ danger: true,
1000
+ onClick: handleClear,
1001
+ type: 'primary',
1002
+ children: translateString(TranslatableString.ClearLabel)
1003
+ })
1004
+ })]
1005
+ });
957
1006
  }
958
1007
  AltDateWidget.defaultProps = {
959
1008
  autofocus: false,
@@ -967,7 +1016,7 @@ AltDateWidget.defaultProps = {
967
1016
 
968
1017
  function AltDateTimeWidget(props) {
969
1018
  var AltDateWidget = props.registry.widgets.AltDateWidget;
970
- return /*#__PURE__*/React.createElement(AltDateWidget, _extends({
1019
+ return jsx(AltDateWidget, _extends({
971
1020
  showTime: true
972
1021
  }, props));
973
1022
  }
@@ -1016,23 +1065,25 @@ function CheckboxesWidget(_ref) {
1016
1065
  onFocus: !readonly ? handleFocus : undefined
1017
1066
  };
1018
1067
  var selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
1019
- return Array.isArray(enumOptions) && enumOptions.length > 0 ? /*#__PURE__*/React.createElement(Checkbox.Group, _extends({
1068
+ return Array.isArray(enumOptions) && enumOptions.length > 0 ? jsx(Checkbox.Group, _extends({
1020
1069
  disabled: disabled || readonlyAsDisabled && readonly,
1021
1070
  name: id,
1022
1071
  onChange: !readonly ? handleChange : undefined,
1023
1072
  value: selectedIndexes
1024
1073
  }, 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));
1074
+ "aria-describedby": ariaDescribedByIds(id),
1075
+ children: Array.isArray(enumOptions) && enumOptions.map(function (option, i) {
1076
+ return jsxs("span", {
1077
+ children: [jsx(Checkbox, {
1078
+ id: optionId(id, i),
1079
+ name: id,
1080
+ autoFocus: i === 0 ? autofocus : false,
1081
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
1082
+ value: String(i),
1083
+ children: option.label
1084
+ }), !inline && jsx("br", {})]
1085
+ }, i);
1086
+ })
1036
1087
  })) : null;
1037
1088
  }
1038
1089
 
@@ -1072,22 +1123,23 @@ function CheckboxWidget(props) {
1072
1123
  onBlur: !readonly ? handleBlur : undefined,
1073
1124
  onFocus: !readonly ? handleFocus : undefined
1074
1125
  };
1075
- return /*#__PURE__*/React.createElement(Checkbox, _extends({
1126
+ return jsx(Checkbox, _extends({
1076
1127
  autoFocus: autofocus,
1077
- checked: typeof value === "undefined" ? false : value,
1128
+ checked: typeof value === 'undefined' ? false : value,
1078
1129
  disabled: disabled || readonlyAsDisabled && readonly,
1079
1130
  id: id,
1080
1131
  name: id,
1081
1132
  onChange: !readonly ? handleChange : undefined
1082
1133
  }, extraProps, {
1083
- "aria-describedby": ariaDescribedByIds(id)
1084
- }), label);
1134
+ "aria-describedby": ariaDescribedByIds(id),
1135
+ children: label
1136
+ }));
1085
1137
  }
1086
1138
 
1087
1139
  var DatePicker = /*#__PURE__*/generatePicker(dayjsGenerateConfig);
1088
1140
 
1089
1141
  var DATE_PICKER_STYLE$1 = {
1090
- width: "100%"
1142
+ width: '100%'
1091
1143
  };
1092
1144
  /** The `DateTimeWidget` component uses the `BaseInputTemplate` changing the type to `datetime-local` and transforms
1093
1145
  * the value to/from utc using the appropriate utility functions.
@@ -1118,7 +1170,7 @@ function DateTimeWidget(props) {
1118
1170
  var getPopupContainer = function getPopupContainer(node) {
1119
1171
  return node.parentNode;
1120
1172
  };
1121
- return /*#__PURE__*/React.createElement(DatePicker, {
1173
+ return jsx(DatePicker, {
1122
1174
  disabled: disabled || readonlyAsDisabled && readonly,
1123
1175
  getPopupContainer: getPopupContainer,
1124
1176
  id: id,
@@ -1135,7 +1187,7 @@ function DateTimeWidget(props) {
1135
1187
  }
1136
1188
 
1137
1189
  var DATE_PICKER_STYLE = {
1138
- width: "100%"
1190
+ width: '100%'
1139
1191
  };
1140
1192
  /** The `DateWidget` component uses the `BaseInputTemplate` changing the type to `date` and transforms
1141
1193
  * the value to undefined when it is falsy during the `onChange` handling.
@@ -1155,7 +1207,7 @@ function DateWidget(props) {
1155
1207
  var _formContext$readonly = formContext.readonlyAsDisabled,
1156
1208
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1157
1209
  var handleChange = function handleChange(nextValue) {
1158
- return onChange(nextValue && nextValue.format("YYYY-MM-DD"));
1210
+ return onChange(nextValue && nextValue.format('YYYY-MM-DD'));
1159
1211
  };
1160
1212
  var handleBlur = function handleBlur() {
1161
1213
  return onBlur(id, value);
@@ -1166,7 +1218,7 @@ function DateWidget(props) {
1166
1218
  var getPopupContainer = function getPopupContainer(node) {
1167
1219
  return node.parentNode;
1168
1220
  };
1169
- return /*#__PURE__*/React.createElement(DatePicker, {
1221
+ return jsx(DatePicker, {
1170
1222
  disabled: disabled || readonlyAsDisabled && readonly,
1171
1223
  getPopupContainer: getPopupContainer,
1172
1224
  id: id,
@@ -1199,10 +1251,10 @@ function PasswordWidget(props) {
1199
1251
  value = props.value;
1200
1252
  var _formContext$readonly = formContext.readonlyAsDisabled,
1201
1253
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1202
- var emptyValue = options.emptyValue || "";
1254
+ var emptyValue = options.emptyValue || '';
1203
1255
  var handleChange = function handleChange(_ref) {
1204
1256
  var target = _ref.target;
1205
- return onChange(target.value === "" ? emptyValue : target.value);
1257
+ return onChange(target.value === '' ? emptyValue : target.value);
1206
1258
  };
1207
1259
  var handleBlur = function handleBlur(_ref2) {
1208
1260
  var target = _ref2.target;
@@ -1212,7 +1264,7 @@ function PasswordWidget(props) {
1212
1264
  var target = _ref3.target;
1213
1265
  return onFocus(id, target.value);
1214
1266
  };
1215
- return /*#__PURE__*/React.createElement(Input.Password, {
1267
+ return jsx(Input.Password, {
1216
1268
  disabled: disabled || readonlyAsDisabled && readonly,
1217
1269
  id: id,
1218
1270
  name: id,
@@ -1220,7 +1272,7 @@ function PasswordWidget(props) {
1220
1272
  onChange: !readonly ? handleChange : undefined,
1221
1273
  onFocus: !readonly ? handleFocus : undefined,
1222
1274
  placeholder: placeholder,
1223
- value: value || "",
1275
+ value: value || '',
1224
1276
  "aria-describedby": ariaDescribedByIds(id)
1225
1277
  });
1226
1278
  }
@@ -1259,7 +1311,7 @@ function RadioWidget(_ref) {
1259
1311
  return onFocus(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
1260
1312
  };
1261
1313
  var selectedIndexes = enumOptionsIndexForValue(value, enumOptions);
1262
- return /*#__PURE__*/React.createElement(Radio.Group, {
1314
+ return jsx(Radio.Group, {
1263
1315
  disabled: disabled || readonlyAsDisabled && readonly,
1264
1316
  id: id,
1265
1317
  name: id,
@@ -1267,17 +1319,18 @@ function RadioWidget(_ref) {
1267
1319
  onBlur: !readonly ? handleBlur : undefined,
1268
1320
  onFocus: !readonly ? handleFocus : undefined,
1269
1321
  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
- }));
1322
+ "aria-describedby": ariaDescribedByIds(id),
1323
+ children: Array.isArray(enumOptions) && enumOptions.map(function (option, i) {
1324
+ return jsx(Radio, {
1325
+ id: optionId(id, i),
1326
+ name: id,
1327
+ autoFocus: i === 0 ? autofocus : false,
1328
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
1329
+ value: String(i),
1330
+ children: option.label
1331
+ }, i);
1332
+ })
1333
+ });
1281
1334
  }
1282
1335
 
1283
1336
  /** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
@@ -1304,9 +1357,9 @@ function RangeWidget(props) {
1304
1357
  min = _rangeSpec.min,
1305
1358
  max = _rangeSpec.max,
1306
1359
  step = _rangeSpec.step;
1307
- var emptyValue = options.emptyValue || "";
1360
+ var emptyValue = options.emptyValue || '';
1308
1361
  var handleChange = function handleChange(nextValue) {
1309
- return onChange(nextValue === "" ? emptyValue : nextValue);
1362
+ return onChange(nextValue === '' ? emptyValue : nextValue);
1310
1363
  };
1311
1364
  var handleBlur = function handleBlur() {
1312
1365
  return onBlur(id, value);
@@ -1321,7 +1374,7 @@ function RangeWidget(props) {
1321
1374
  onBlur: !readonly ? handleBlur : undefined,
1322
1375
  onFocus: !readonly ? handleFocus : undefined
1323
1376
  };
1324
- return /*#__PURE__*/React.createElement(Slider, _extends({
1377
+ return jsx(Slider, _extends({
1325
1378
  autoFocus: autofocus,
1326
1379
  disabled: disabled || readonlyAsDisabled && readonly,
1327
1380
  id: id,
@@ -1337,7 +1390,7 @@ function RangeWidget(props) {
1337
1390
  }
1338
1391
 
1339
1392
  var SELECT_STYLE = {
1340
- width: "100%"
1393
+ width: '100%'
1341
1394
  };
1342
1395
  /** The `SelectWidget` is a widget for rendering dropdowns.
1343
1396
  * It is typically used with string properties constrained with enum options.
@@ -1388,12 +1441,12 @@ function SelectWidget(_ref) {
1388
1441
  var extraProps = {
1389
1442
  name: id
1390
1443
  };
1391
- return /*#__PURE__*/React.createElement(Select, _extends({
1444
+ return jsx(Select, _extends({
1392
1445
  autoFocus: autofocus,
1393
1446
  disabled: disabled || readonlyAsDisabled && readonly,
1394
1447
  getPopupContainer: getPopupContainer,
1395
1448
  id: id,
1396
- mode: typeof multiple !== "undefined" ? "multiple" : undefined,
1449
+ mode: typeof multiple !== 'undefined' ? 'multiple' : undefined,
1397
1450
  onBlur: !readonly ? handleBlur : undefined,
1398
1451
  onChange: !readonly ? handleChange : undefined,
1399
1452
  onFocus: !readonly ? handleFocus : undefined,
@@ -1402,20 +1455,21 @@ function SelectWidget(_ref) {
1402
1455
  value: selectedIndexes
1403
1456
  }, extraProps, {
1404
1457
  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);
1458
+ "aria-describedby": ariaDescribedByIds(id),
1459
+ children: Array.isArray(enumOptions) && enumOptions.map(function (_ref2, index) {
1460
+ var optionValue = _ref2.value,
1461
+ optionLabel = _ref2.label;
1462
+ return jsx(Select.Option, {
1463
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
1464
+ value: String(index),
1465
+ children: optionLabel
1466
+ }, String(index));
1467
+ })
1414
1468
  }));
1415
1469
  }
1416
1470
 
1417
1471
  var INPUT_STYLE = {
1418
- width: "100%"
1472
+ width: '100%'
1419
1473
  };
1420
1474
  /** The `TextareaWidget` is a widget for rendering input fields as textarea.
1421
1475
  *
@@ -1436,7 +1490,7 @@ function TextareaWidget(_ref) {
1436
1490
  readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1437
1491
  var handleChange = function handleChange(_ref2) {
1438
1492
  var target = _ref2.target;
1439
- return onChange(target.value === "" ? options.emptyValue : target.value);
1493
+ return onChange(target.value === '' ? options.emptyValue : target.value);
1440
1494
  };
1441
1495
  var handleBlur = function handleBlur(_ref3) {
1442
1496
  var target = _ref3.target;
@@ -1449,9 +1503,9 @@ function TextareaWidget(_ref) {
1449
1503
  // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
1450
1504
  // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
1451
1505
  var extraProps = {
1452
- type: "textarea"
1506
+ type: 'textarea'
1453
1507
  };
1454
- return /*#__PURE__*/React.createElement(Input.TextArea, _extends({
1508
+ return jsx(Input.TextArea, _extends({
1455
1509
  disabled: disabled || readonlyAsDisabled && readonly,
1456
1510
  id: id,
1457
1511
  name: id,