@rjsf/antd 5.0.0-beta.13 → 5.0.0-beta.15

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
@@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react';
3
3
  import Button from 'antd/es/button';
4
4
  import Col from 'antd/es/col';
5
5
  import Row from 'antd/es/row';
6
- import { getUiOptions, getTemplate, getInputProps, canExpand, getSubmitButtonOptions, ADDITIONAL_PROPERTY_FLAG, UI_OPTIONS_KEY, parseDateString, toDateString, pad, rangeSpec, processSelectValue } from '@rjsf/utils';
6
+ import { getUiOptions, getTemplate, getInputProps, canExpand, getSubmitButtonOptions, UI_OPTIONS_KEY, ADDITIONAL_PROPERTY_FLAG, parseDateString, toDateString, pad, rangeSpec, processSelectValue } from '@rjsf/utils';
7
7
  import classNames from 'classnames';
8
8
  import { withConfigConsumer } from 'antd/es/config-provider/context';
9
9
  import Input from 'antd/es/input';
@@ -28,39 +28,37 @@ import Radio from 'antd/es/radio';
28
28
  import Slider from 'antd/es/slider';
29
29
  import Select from 'antd/es/select';
30
30
 
31
- const BTN_GRP_STYLE = {
31
+ var BTN_GRP_STYLE = {
32
32
  width: "100%"
33
33
  };
34
- const BTN_STYLE = {
34
+ var BTN_STYLE = {
35
35
  width: "calc(100% / 3)"
36
36
  };
37
- const ArrayFieldItemTemplate = _ref => {
38
- let {
39
- children,
40
- disabled,
41
- hasMoveDown,
42
- hasMoveUp,
43
- hasRemove,
44
- hasToolbar,
45
- index,
46
- onDropIndexClick,
47
- onReorderClick,
48
- readonly,
49
- registry,
50
- uiSchema
51
- } = _ref;
52
- const {
53
- MoveDownButton,
54
- MoveUpButton,
55
- RemoveButton
56
- } = registry.templates.ButtonTemplates;
57
- const {
58
- rowGutter = 24,
59
- toolbarAlign = "top"
60
- } = registry.formContext;
37
+ var ArrayFieldItemTemplate = function ArrayFieldItemTemplate(_ref) {
38
+ var children = _ref.children,
39
+ disabled = _ref.disabled,
40
+ hasMoveDown = _ref.hasMoveDown,
41
+ hasMoveUp = _ref.hasMoveUp,
42
+ hasRemove = _ref.hasRemove,
43
+ hasToolbar = _ref.hasToolbar,
44
+ index = _ref.index,
45
+ onDropIndexClick = _ref.onDropIndexClick,
46
+ onReorderClick = _ref.onReorderClick,
47
+ readonly = _ref.readonly,
48
+ registry = _ref.registry,
49
+ uiSchema = _ref.uiSchema;
50
+ var _registry$templates$B = registry.templates.ButtonTemplates,
51
+ MoveDownButton = _registry$templates$B.MoveDownButton,
52
+ MoveUpButton = _registry$templates$B.MoveUpButton,
53
+ RemoveButton = _registry$templates$B.RemoveButton;
54
+ var _registry$formContext = registry.formContext,
55
+ _registry$formContext2 = _registry$formContext.rowGutter,
56
+ rowGutter = _registry$formContext2 === void 0 ? 24 : _registry$formContext2,
57
+ _registry$formContext3 = _registry$formContext.toolbarAlign,
58
+ toolbarAlign = _registry$formContext3 === void 0 ? "top" : _registry$formContext3;
61
59
  return /*#__PURE__*/React.createElement(Row, {
62
60
  align: toolbarAlign,
63
- key: `array-item-${index}`,
61
+ key: "array-item-" + index,
64
62
  gutter: rowGutter
65
63
  }, /*#__PURE__*/React.createElement(Col, {
66
64
  flex: "1"
@@ -86,42 +84,64 @@ const ArrayFieldItemTemplate = _ref => {
86
84
  }))));
87
85
  };
88
86
 
89
- const DESCRIPTION_COL_STYLE$1 = {
87
+ function _extends() {
88
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
89
+ for (var i = 1; i < arguments.length; i++) {
90
+ var source = arguments[i];
91
+ for (var key in source) {
92
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
93
+ target[key] = source[key];
94
+ }
95
+ }
96
+ }
97
+ return target;
98
+ };
99
+ return _extends.apply(this, arguments);
100
+ }
101
+ function _objectWithoutPropertiesLoose(source, excluded) {
102
+ if (source == null) return {};
103
+ var target = {};
104
+ var sourceKeys = Object.keys(source);
105
+ var key, i;
106
+ for (i = 0; i < sourceKeys.length; i++) {
107
+ key = sourceKeys[i];
108
+ if (excluded.indexOf(key) >= 0) continue;
109
+ target[key] = source[key];
110
+ }
111
+ return target;
112
+ }
113
+
114
+ var _excluded$1 = ["key"];
115
+ var DESCRIPTION_COL_STYLE$1 = {
90
116
  paddingBottom: "8px"
91
117
  };
92
- const ArrayFieldTemplate = _ref => {
93
- let {
94
- canAdd,
95
- className,
96
- disabled,
97
- formContext,
98
- idSchema,
99
- items,
100
- onAddClick,
101
- prefixCls,
102
- readonly,
103
- registry,
104
- required,
105
- schema,
106
- title,
107
- uiSchema
108
- } = _ref;
109
- const uiOptions = getUiOptions(uiSchema);
110
- const ArrayFieldDescriptionTemplate = getTemplate("ArrayFieldDescriptionTemplate", registry, uiOptions);
111
- const ArrayFieldItemTemplate = getTemplate("ArrayFieldItemTemplate", registry, uiOptions);
112
- const ArrayFieldTitleTemplate = getTemplate("ArrayFieldTitleTemplate", registry, uiOptions);
118
+ var ArrayFieldTemplate = function ArrayFieldTemplate(_ref) {
119
+ var canAdd = _ref.canAdd,
120
+ className = _ref.className,
121
+ disabled = _ref.disabled,
122
+ formContext = _ref.formContext,
123
+ idSchema = _ref.idSchema,
124
+ items = _ref.items,
125
+ onAddClick = _ref.onAddClick,
126
+ prefixCls = _ref.prefixCls,
127
+ readonly = _ref.readonly,
128
+ registry = _ref.registry,
129
+ required = _ref.required,
130
+ schema = _ref.schema,
131
+ title = _ref.title,
132
+ uiSchema = _ref.uiSchema;
133
+ var uiOptions = getUiOptions(uiSchema);
134
+ var ArrayFieldDescriptionTemplate = getTemplate("ArrayFieldDescriptionTemplate", registry, uiOptions);
135
+ var ArrayFieldItemTemplate = getTemplate("ArrayFieldItemTemplate", registry, uiOptions);
136
+ var ArrayFieldTitleTemplate = getTemplate("ArrayFieldTitleTemplate", registry, uiOptions);
113
137
  // Button templates are not overridden in the uiSchema
114
- const {
115
- ButtonTemplates: {
116
- AddButton
117
- }
118
- } = registry.templates;
119
- const {
120
- labelAlign = "right",
121
- rowGutter = 24
122
- } = formContext;
123
- const labelClsBasic = `${prefixCls}-item-label`;
124
- const labelColClassName = classNames(labelClsBasic, labelAlign === "left" && `${labelClsBasic}-left`
138
+ var AddButton = registry.templates.ButtonTemplates.AddButton;
139
+ var _formContext$labelAli = formContext.labelAlign,
140
+ labelAlign = _formContext$labelAli === void 0 ? "right" : _formContext$labelAli,
141
+ _formContext$rowGutte = formContext.rowGutter,
142
+ rowGutter = _formContext$rowGutte === void 0 ? 24 : _formContext$rowGutte;
143
+ var labelClsBasic = prefixCls + "-item-label";
144
+ var labelColClassName = classNames(labelClsBasic, labelAlign === "left" && labelClsBasic + "-left"
125
145
  // labelCol.className,
126
146
  );
127
147
 
@@ -152,15 +172,12 @@ const ArrayFieldTemplate = _ref => {
152
172
  })), /*#__PURE__*/React.createElement(Col, {
153
173
  className: "row array-item-list",
154
174
  span: 24
155
- }, items && items.map(_ref2 => {
156
- let {
157
- key,
158
- ...itemProps
159
- } = _ref2;
160
- return /*#__PURE__*/React.createElement(ArrayFieldItemTemplate, {
161
- key: key,
162
- ...itemProps
163
- });
175
+ }, items && items.map(function (_ref2) {
176
+ var key = _ref2.key,
177
+ itemProps = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
178
+ return /*#__PURE__*/React.createElement(ArrayFieldItemTemplate, _extends({
179
+ key: key
180
+ }, itemProps));
164
181
  })), canAdd && /*#__PURE__*/React.createElement(Col, {
165
182
  span: 24
166
183
  }, /*#__PURE__*/React.createElement(Row, {
@@ -179,48 +196,41 @@ var ArrayFieldTemplate$1 = /*#__PURE__*/withConfigConsumer({
179
196
  prefixCls: "form"
180
197
  })(ArrayFieldTemplate);
181
198
 
182
- const INPUT_STYLE$2 = {
199
+ var INPUT_STYLE$2 = {
183
200
  width: "100%"
184
201
  };
185
- const BaseInputTemplate = _ref => {
186
- let {
187
- disabled,
188
- formContext,
189
- id,
190
- onBlur,
191
- onChange,
192
- onFocus,
193
- options,
194
- placeholder,
195
- readonly,
196
- schema,
197
- value,
198
- type
199
- } = _ref;
200
- const inputProps = getInputProps(schema, type, options, false);
201
- const {
202
- readonlyAsDisabled = true
203
- } = formContext;
204
- const handleNumberChange = nextValue => onChange(nextValue);
205
- const handleTextChange = _ref2 => {
206
- let {
207
- target
208
- } = _ref2;
202
+ var BaseInputTemplate = function BaseInputTemplate(_ref) {
203
+ var disabled = _ref.disabled,
204
+ formContext = _ref.formContext,
205
+ id = _ref.id,
206
+ onBlur = _ref.onBlur,
207
+ onChange = _ref.onChange,
208
+ onFocus = _ref.onFocus,
209
+ options = _ref.options,
210
+ placeholder = _ref.placeholder,
211
+ readonly = _ref.readonly,
212
+ schema = _ref.schema,
213
+ value = _ref.value,
214
+ type = _ref.type;
215
+ var inputProps = getInputProps(schema, type, options, false);
216
+ var _formContext$readonly = formContext.readonlyAsDisabled,
217
+ readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
218
+ var handleNumberChange = function handleNumberChange(nextValue) {
219
+ return onChange(nextValue);
220
+ };
221
+ var handleTextChange = function handleTextChange(_ref2) {
222
+ var target = _ref2.target;
209
223
  return onChange(target.value === "" ? options.emptyValue : target.value);
210
224
  };
211
- const handleBlur = _ref3 => {
212
- let {
213
- target
214
- } = _ref3;
225
+ var handleBlur = function handleBlur(_ref3) {
226
+ var target = _ref3.target;
215
227
  return onBlur(id, target.value);
216
228
  };
217
- const handleFocus = _ref4 => {
218
- let {
219
- target
220
- } = _ref4;
229
+ var handleFocus = function handleFocus(_ref4) {
230
+ var target = _ref4.target;
221
231
  return onFocus(id, target.value);
222
232
  };
223
- const input = inputProps.type === "number" || inputProps.type === "integer" ? /*#__PURE__*/React.createElement(InputNumber, {
233
+ var input = inputProps.type === "number" || inputProps.type === "integer" ? /*#__PURE__*/React.createElement(InputNumber, _extends({
224
234
  disabled: disabled || readonlyAsDisabled && readonly,
225
235
  id: id,
226
236
  name: id,
@@ -229,10 +239,10 @@ const BaseInputTemplate = _ref => {
229
239
  onFocus: !readonly ? handleFocus : undefined,
230
240
  placeholder: placeholder,
231
241
  style: INPUT_STYLE$2,
232
- list: schema.examples ? `examples_${id}` : undefined,
233
- ...inputProps,
242
+ list: schema.examples ? "examples_" + id : undefined
243
+ }, inputProps, {
234
244
  value: value
235
- }) : /*#__PURE__*/React.createElement(Input, {
245
+ })) : /*#__PURE__*/React.createElement(Input, _extends({
236
246
  disabled: disabled || readonlyAsDisabled && readonly,
237
247
  id: id,
238
248
  name: id,
@@ -241,13 +251,13 @@ const BaseInputTemplate = _ref => {
241
251
  onFocus: !readonly ? handleFocus : undefined,
242
252
  placeholder: placeholder,
243
253
  style: INPUT_STYLE$2,
244
- list: schema.examples ? `examples_${id}` : undefined,
245
- ...inputProps,
254
+ list: schema.examples ? "examples_" + id : undefined
255
+ }, inputProps, {
246
256
  value: value
247
- });
257
+ }));
248
258
  return /*#__PURE__*/React.createElement(React.Fragment, null, input, schema.examples && /*#__PURE__*/React.createElement("datalist", {
249
- id: `examples_${id}`
250
- }, schema.examples.concat(schema.default ? [schema.default] : []).map(example => {
259
+ id: "examples_" + id
260
+ }, schema.examples.concat(schema["default"] ? [schema["default"]] : []).map(function (example) {
251
261
  return /*#__PURE__*/React.createElement("option", {
252
262
  key: example,
253
263
  value: example
@@ -255,11 +265,9 @@ const BaseInputTemplate = _ref => {
255
265
  })));
256
266
  };
257
267
 
258
- const DescriptionField = _ref => {
259
- let {
260
- description,
261
- id
262
- } = _ref;
268
+ var DescriptionField = function DescriptionField(_ref) {
269
+ var description = _ref.description,
270
+ id = _ref.id;
263
271
  if (!description) {
264
272
  return null;
265
273
  }
@@ -268,16 +276,18 @@ const DescriptionField = _ref => {
268
276
  }, description);
269
277
  };
270
278
 
271
- const ErrorList = _ref => {
272
- let {
273
- errors
274
- } = _ref;
275
- const renderErrors = () => /*#__PURE__*/React.createElement(List, {
276
- className: "list-group",
277
- size: "small"
278
- }, errors.map((error, index) => /*#__PURE__*/React.createElement(List.Item, {
279
- key: index
280
- }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null), error.stack))));
279
+ var ErrorList = function ErrorList(_ref) {
280
+ var errors = _ref.errors;
281
+ var renderErrors = function renderErrors() {
282
+ return /*#__PURE__*/React.createElement(List, {
283
+ className: "list-group",
284
+ size: "small"
285
+ }, errors.map(function (error, index) {
286
+ return /*#__PURE__*/React.createElement(List.Item, {
287
+ key: index
288
+ }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null), error.stack));
289
+ }));
290
+ };
281
291
  return /*#__PURE__*/React.createElement(Alert, {
282
292
  className: "panel panel-danger errors",
283
293
  description: renderErrors(),
@@ -286,53 +296,51 @@ const ErrorList = _ref => {
286
296
  });
287
297
  };
288
298
 
299
+ var _excluded = ["iconType", "icon", "uiSchema"];
289
300
  function IconButton(props) {
290
- const {
291
- iconType = "default",
292
- icon,
293
- uiSchema,
294
- ...otherProps
295
- } = props;
296
- return /*#__PURE__*/React.createElement(Button, {
301
+ var _props$iconType = props.iconType,
302
+ iconType = _props$iconType === void 0 ? "default" : _props$iconType,
303
+ icon = props.icon,
304
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
305
+ return /*#__PURE__*/React.createElement(Button, _extends({
297
306
  type: iconType,
298
- icon: icon,
299
- ...otherProps
300
- });
307
+ icon: icon
308
+ }, otherProps));
301
309
  }
302
310
  function AddButton(props) {
303
- return /*#__PURE__*/React.createElement(IconButton, {
304
- title: "Add Item",
305
- ...props,
311
+ return /*#__PURE__*/React.createElement(IconButton, _extends({
312
+ title: "Add Item"
313
+ }, props, {
306
314
  block: true,
307
315
  iconType: "primary",
308
316
  icon: /*#__PURE__*/React.createElement(PlusCircleOutlined, null)
309
- });
317
+ }));
310
318
  }
311
319
  function MoveDownButton(props) {
312
- return /*#__PURE__*/React.createElement(IconButton, {
313
- title: "Move down",
314
- ...props,
320
+ return /*#__PURE__*/React.createElement(IconButton, _extends({
321
+ title: "Move down"
322
+ }, props, {
315
323
  icon: /*#__PURE__*/React.createElement(ArrowDownOutlined, null)
316
- });
324
+ }));
317
325
  }
318
326
  function MoveUpButton(props) {
319
- return /*#__PURE__*/React.createElement(IconButton, {
320
- title: "Move up",
321
- ...props,
327
+ return /*#__PURE__*/React.createElement(IconButton, _extends({
328
+ title: "Move up"
329
+ }, props, {
322
330
  icon: /*#__PURE__*/React.createElement(ArrowUpOutlined, null)
323
- });
331
+ }));
324
332
  }
325
333
  function RemoveButton(props) {
326
334
  // The `block` prop is not part of the `IconButtonProps` defined in the template, so get it from the uiSchema instead
327
- const options = getUiOptions(props.uiSchema);
328
- return /*#__PURE__*/React.createElement(IconButton, {
329
- title: "Remove",
330
- ...props,
335
+ var options = getUiOptions(props.uiSchema);
336
+ return /*#__PURE__*/React.createElement(IconButton, _extends({
337
+ title: "Remove"
338
+ }, props, {
331
339
  danger: true,
332
340
  block: !!options.block,
333
341
  iconType: "primary",
334
342
  icon: /*#__PURE__*/React.createElement(DeleteOutlined, null)
335
- });
343
+ }));
336
344
  }
337
345
 
338
346
  /** The `FieldErrorTemplate` component renders the errors local to the particular field
@@ -340,59 +348,58 @@ function RemoveButton(props) {
340
348
  * @param props - The `FieldErrorProps` for the errors being rendered
341
349
  */
342
350
  function FieldErrorTemplate(props) {
343
- const {
344
- errors = [],
345
- idSchema
346
- } = props;
351
+ var _props$errors = props.errors,
352
+ errors = _props$errors === void 0 ? [] : _props$errors,
353
+ idSchema = props.idSchema;
347
354
  if (errors.length === 0) {
348
355
  return null;
349
356
  }
350
- const id = `${idSchema.$id}__error`;
357
+ var id = idSchema.$id + "__error";
351
358
  return /*#__PURE__*/React.createElement("div", {
352
359
  id: id
353
- }, errors.map(error => /*#__PURE__*/React.createElement("div", {
354
- key: `field-${id}-error-${error}`
355
- }, error)));
360
+ }, errors.map(function (error) {
361
+ return /*#__PURE__*/React.createElement("div", {
362
+ key: "field-" + id + "-error-" + error
363
+ }, error);
364
+ }));
356
365
  }
357
366
 
358
- const VERTICAL_LABEL_COL$1 = {
367
+ var VERTICAL_LABEL_COL$1 = {
359
368
  span: 24
360
369
  };
361
- const VERTICAL_WRAPPER_COL$1 = {
370
+ var VERTICAL_WRAPPER_COL$1 = {
362
371
  span: 24
363
372
  };
364
- const FieldTemplate = _ref => {
365
- let {
366
- children,
367
- classNames,
368
- description,
369
- disabled,
370
- displayLabel,
371
- errors,
372
- formContext,
373
- help,
374
- hidden,
375
- id,
376
- label,
377
- onDropPropertyClick,
378
- onKeyChange,
379
- rawErrors,
380
- rawDescription,
381
- rawHelp,
382
- readonly,
383
- registry,
384
- required,
385
- schema,
386
- uiSchema
387
- } = _ref;
388
- const {
389
- colon,
390
- labelCol = VERTICAL_LABEL_COL$1,
391
- wrapperCol = VERTICAL_WRAPPER_COL$1,
392
- wrapperStyle
393
- } = formContext;
394
- const uiOptions = getUiOptions(uiSchema);
395
- const WrapIfAdditionalTemplate = getTemplate("WrapIfAdditionalTemplate", registry, uiOptions);
373
+ var FieldTemplate = function FieldTemplate(_ref) {
374
+ var children = _ref.children,
375
+ classNames = _ref.classNames,
376
+ description = _ref.description,
377
+ disabled = _ref.disabled,
378
+ displayLabel = _ref.displayLabel,
379
+ errors = _ref.errors,
380
+ formContext = _ref.formContext,
381
+ help = _ref.help,
382
+ hidden = _ref.hidden,
383
+ id = _ref.id,
384
+ label = _ref.label,
385
+ onDropPropertyClick = _ref.onDropPropertyClick,
386
+ onKeyChange = _ref.onKeyChange,
387
+ rawErrors = _ref.rawErrors,
388
+ rawDescription = _ref.rawDescription,
389
+ rawHelp = _ref.rawHelp,
390
+ readonly = _ref.readonly,
391
+ registry = _ref.registry,
392
+ required = _ref.required,
393
+ schema = _ref.schema,
394
+ uiSchema = _ref.uiSchema;
395
+ var colon = formContext.colon,
396
+ _formContext$labelCol = formContext.labelCol,
397
+ labelCol = _formContext$labelCol === void 0 ? VERTICAL_LABEL_COL$1 : _formContext$labelCol,
398
+ _formContext$wrapperC = formContext.wrapperCol,
399
+ wrapperCol = _formContext$wrapperC === void 0 ? VERTICAL_WRAPPER_COL$1 : _formContext$wrapperC,
400
+ wrapperStyle = formContext.wrapperStyle;
401
+ var uiOptions = getUiOptions(uiSchema);
402
+ var WrapIfAdditionalTemplate = getTemplate("WrapIfAdditionalTemplate", registry, uiOptions);
396
403
  if (hidden) {
397
404
  return /*#__PURE__*/React.createElement("div", {
398
405
  className: "field-hidden"
@@ -414,7 +421,7 @@ const FieldTemplate = _ref => {
414
421
  colon: colon,
415
422
  extra: rawDescription && description,
416
423
  hasFeedback: schema.type !== "array" && schema.type !== "object",
417
- help: !!rawHelp && help || (rawErrors === null || rawErrors === void 0 ? void 0 : rawErrors.length) && errors,
424
+ help: !!rawHelp && help || (rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? errors : undefined),
418
425
  htmlFor: id,
419
426
  label: displayLabel && label,
420
427
  labelCol: labelCol,
@@ -425,59 +432,64 @@ const FieldTemplate = _ref => {
425
432
  }, children));
426
433
  };
427
434
 
428
- const DESCRIPTION_COL_STYLE = {
435
+ var DESCRIPTION_COL_STYLE = {
429
436
  paddingBottom: "8px"
430
437
  };
431
- const ObjectFieldTemplate = _ref => {
432
- let {
433
- description,
434
- disabled,
435
- formContext,
436
- formData,
437
- idSchema,
438
- onAddClick,
439
- prefixCls,
440
- properties,
441
- readonly,
442
- required,
443
- registry,
444
- schema,
445
- title,
446
- uiSchema
447
- } = _ref;
448
- const uiOptions = getUiOptions(uiSchema);
449
- const TitleFieldTemplate = getTemplate("TitleFieldTemplate", registry, uiOptions);
450
- const DescriptionFieldTemplate = getTemplate("DescriptionFieldTemplate", registry, uiOptions);
438
+ var ObjectFieldTemplate = function ObjectFieldTemplate(_ref) {
439
+ var description = _ref.description,
440
+ disabled = _ref.disabled,
441
+ formContext = _ref.formContext,
442
+ formData = _ref.formData,
443
+ idSchema = _ref.idSchema,
444
+ onAddClick = _ref.onAddClick,
445
+ prefixCls = _ref.prefixCls,
446
+ properties = _ref.properties,
447
+ readonly = _ref.readonly,
448
+ required = _ref.required,
449
+ registry = _ref.registry,
450
+ schema = _ref.schema,
451
+ title = _ref.title,
452
+ uiSchema = _ref.uiSchema;
453
+ var uiOptions = getUiOptions(uiSchema);
454
+ var TitleFieldTemplate = getTemplate("TitleFieldTemplate", registry, uiOptions);
455
+ var DescriptionFieldTemplate = getTemplate("DescriptionFieldTemplate", registry, uiOptions);
451
456
  // Button templates are not overridden in the uiSchema
452
- const {
453
- ButtonTemplates: {
454
- AddButton
455
- }
456
- } = registry.templates;
457
- const {
458
- colSpan = 24,
459
- labelAlign = "right",
460
- rowGutter = 24
461
- } = formContext;
462
- const labelClsBasic = `${prefixCls}-item-label`;
463
- const labelColClassName = classNames(labelClsBasic, labelAlign === "left" && `${labelClsBasic}-left`
457
+ var AddButton = registry.templates.ButtonTemplates.AddButton;
458
+ var _formContext$colSpan = formContext.colSpan,
459
+ colSpan = _formContext$colSpan === void 0 ? 24 : _formContext$colSpan,
460
+ _formContext$labelAli = formContext.labelAlign,
461
+ labelAlign = _formContext$labelAli === void 0 ? "right" : _formContext$labelAli,
462
+ _formContext$rowGutte = formContext.rowGutter,
463
+ rowGutter = _formContext$rowGutte === void 0 ? 24 : _formContext$rowGutte;
464
+ var labelClsBasic = prefixCls + "-item-label";
465
+ var labelColClassName = classNames(labelClsBasic, labelAlign === "left" && labelClsBasic + "-left"
464
466
  // labelCol.className,
465
467
  );
466
468
 
467
- const findSchema = element => element.content.props.schema;
468
- const findSchemaType = element => findSchema(element).type;
469
- const findUiSchema = element => element.content.props.uiSchema;
470
- const findUiSchemaField = element => getUiOptions(findUiSchema(element)).field;
471
- const findUiSchemaWidget = element => getUiOptions(findUiSchema(element)).widget;
472
- const calculateColSpan = element => {
473
- const type = findSchemaType(element);
474
- const field = findUiSchemaField(element);
475
- const widget = findUiSchemaWidget(element);
476
- const defaultColSpan = properties.length < 2 ||
469
+ var findSchema = function findSchema(element) {
470
+ return element.content.props.schema;
471
+ };
472
+ var findSchemaType = function findSchemaType(element) {
473
+ return findSchema(element).type;
474
+ };
475
+ var findUiSchema = function findUiSchema(element) {
476
+ return element.content.props.uiSchema;
477
+ };
478
+ var findUiSchemaField = function findUiSchemaField(element) {
479
+ return getUiOptions(findUiSchema(element)).field;
480
+ };
481
+ var findUiSchemaWidget = function findUiSchemaWidget(element) {
482
+ return getUiOptions(findUiSchema(element)).widget;
483
+ };
484
+ var calculateColSpan = function calculateColSpan(element) {
485
+ var type = findSchemaType(element);
486
+ var field = findUiSchemaField(element);
487
+ var widget = findUiSchemaWidget(element);
488
+ var defaultColSpan = properties.length < 2 ||
477
489
  // Single or no field in object.
478
490
  type === "object" || type === "array" || widget === "textarea" ? 24 : 12;
479
491
  if (isObject(colSpan)) {
480
- const colSpanObj = colSpan;
492
+ var colSpanObj = colSpan;
481
493
  if (isString(widget)) {
482
494
  return colSpanObj[widget];
483
495
  }
@@ -501,7 +513,7 @@ const ObjectFieldTemplate = _ref => {
501
513
  className: labelColClassName,
502
514
  span: 24
503
515
  }, /*#__PURE__*/React.createElement(TitleFieldTemplate, {
504
- id: `${idSchema.$id}-title`,
516
+ id: idSchema.$id + "-title",
505
517
  required: required,
506
518
  title: uiOptions.title || title,
507
519
  schema: schema,
@@ -512,14 +524,18 @@ const ObjectFieldTemplate = _ref => {
512
524
  style: DESCRIPTION_COL_STYLE
513
525
  }, /*#__PURE__*/React.createElement(DescriptionFieldTemplate, {
514
526
  description: uiOptions.description || description,
515
- id: `${idSchema.$id}-description`,
527
+ id: idSchema.$id + "-description",
516
528
  schema: schema,
517
529
  uiSchema: uiSchema,
518
530
  registry: registry
519
- })), properties.filter(e => !e.hidden).map(element => /*#__PURE__*/React.createElement(Col, {
520
- key: element.name,
521
- span: calculateColSpan(element)
522
- }, element.content))), canExpand(schema, uiSchema, formData) && /*#__PURE__*/React.createElement(Col, {
531
+ })), properties.filter(function (e) {
532
+ return !e.hidden;
533
+ }).map(function (element) {
534
+ return /*#__PURE__*/React.createElement(Col, {
535
+ key: element.name,
536
+ span: calculateColSpan(element)
537
+ }, element.content);
538
+ })), canExpand(schema, uiSchema, formData) && /*#__PURE__*/React.createElement(Col, {
523
539
  span: 24
524
540
  }, /*#__PURE__*/React.createElement(Row, {
525
541
  gutter: rowGutter,
@@ -537,56 +553,44 @@ var ObjectFieldTemplate$1 = /*#__PURE__*/withConfigConsumer({
537
553
  prefixCls: "form"
538
554
  })(ObjectFieldTemplate);
539
555
 
540
- var SubmitButton = (_ref => {
541
- let {
542
- uiSchema
543
- } = _ref;
544
- const {
545
- submitText,
546
- norender,
547
- props: submitButtonProps
548
- } = getSubmitButtonOptions(uiSchema);
556
+ var SubmitButton = (function (_ref) {
557
+ var uiSchema = _ref.uiSchema;
558
+ var _getSubmitButtonOptio = getSubmitButtonOptions(uiSchema),
559
+ submitText = _getSubmitButtonOptio.submitText,
560
+ norender = _getSubmitButtonOptio.norender,
561
+ submitButtonProps = _getSubmitButtonOptio.props;
549
562
  if (norender) {
550
563
  return null;
551
564
  }
552
- return /*#__PURE__*/React.createElement(Button, {
553
- type: "submit",
554
- ...submitButtonProps,
565
+ return /*#__PURE__*/React.createElement(Button, _extends({
566
+ type: "submit"
567
+ }, submitButtonProps, {
555
568
  htmlType: "submit"
556
- }, submitText);
569
+ }), submitText);
557
570
  });
558
571
 
559
- const TitleField = _ref => {
560
- let {
561
- id,
562
- prefixCls,
563
- required,
564
- registry,
565
- formContext: formContext1,
566
- title
567
- } = _ref;
568
- const {
569
- formContext
570
- } = registry;
571
- const {
572
- colon = true
573
- } = {
574
- ...formContext1,
575
- ...formContext
576
- };
577
- let labelChildren = title;
572
+ var TitleField = function TitleField(_ref) {
573
+ var _classNames;
574
+ var id = _ref.id,
575
+ prefixCls = _ref.prefixCls,
576
+ required = _ref.required,
577
+ registry = _ref.registry,
578
+ formContext1 = _ref.formContext,
579
+ title = _ref.title;
580
+ var formContext = registry.formContext;
581
+ var _formContext1$formCon = _extends({}, formContext1, formContext),
582
+ _formContext1$formCon2 = _formContext1$formCon.colon,
583
+ colon = _formContext1$formCon2 === void 0 ? true : _formContext1$formCon2;
584
+ var labelChildren = title;
578
585
  if (colon && typeof title === "string" && title.trim() !== "") {
579
586
  labelChildren = title.replace(/[::]\s*$/, "");
580
587
  }
581
- const labelClassName = classNames({
582
- [`${prefixCls}-item-required`]: required,
583
- [`${prefixCls}-item-no-colon`]: !colon
584
- });
585
- const handleLabelClick = () => {
588
+ var labelClassName = classNames((_classNames = {}, _classNames[prefixCls + "-item-required"] = required, _classNames[prefixCls + "-item-no-colon"] = !colon, _classNames));
589
+ var handleLabelClick = function handleLabelClick() {
586
590
  if (!id) {
587
591
  return;
588
592
  }
589
- const control = document.querySelector(`[id="${id}"]`);
593
+ var control = document.querySelector("[id=\"" + id + "\"]");
590
594
  if (control && control.focus) {
591
595
  control.focus();
592
596
  }
@@ -605,65 +609,60 @@ var TitleField$1 = /*#__PURE__*/withConfigConsumer({
605
609
  prefixCls: "form"
606
610
  })(TitleField);
607
611
 
608
- const VERTICAL_LABEL_COL = {
612
+ var VERTICAL_LABEL_COL = {
609
613
  span: 24
610
614
  };
611
- const VERTICAL_WRAPPER_COL = {
615
+ var VERTICAL_WRAPPER_COL = {
612
616
  span: 24
613
617
  };
614
- const INPUT_STYLE$1 = {
618
+ var INPUT_STYLE$1 = {
615
619
  width: "100%"
616
620
  };
617
- const WrapIfAdditionalTemplate = _ref => {
618
- let {
619
- children,
620
- classNames,
621
- disabled,
622
- id,
623
- label,
624
- onDropPropertyClick,
625
- onKeyChange,
626
- readonly,
627
- required,
628
- registry,
629
- schema,
630
- uiSchema
631
- } = _ref;
632
- const {
633
- colon,
634
- labelCol = VERTICAL_LABEL_COL,
635
- readonlyAsDisabled = true,
636
- rowGutter = 24,
637
- toolbarAlign = "top",
638
- wrapperCol = VERTICAL_WRAPPER_COL,
639
- wrapperStyle
640
- } = registry.formContext;
621
+ var WrapIfAdditionalTemplate = function WrapIfAdditionalTemplate(_ref) {
622
+ var _extends2;
623
+ var children = _ref.children,
624
+ classNames = _ref.classNames,
625
+ disabled = _ref.disabled,
626
+ id = _ref.id,
627
+ label = _ref.label,
628
+ onDropPropertyClick = _ref.onDropPropertyClick,
629
+ onKeyChange = _ref.onKeyChange,
630
+ readonly = _ref.readonly,
631
+ required = _ref.required,
632
+ registry = _ref.registry,
633
+ schema = _ref.schema,
634
+ uiSchema = _ref.uiSchema;
635
+ var _registry$formContext = registry.formContext,
636
+ colon = _registry$formContext.colon,
637
+ _registry$formContext2 = _registry$formContext.labelCol,
638
+ labelCol = _registry$formContext2 === void 0 ? VERTICAL_LABEL_COL : _registry$formContext2,
639
+ _registry$formContext3 = _registry$formContext.readonlyAsDisabled,
640
+ readonlyAsDisabled = _registry$formContext3 === void 0 ? true : _registry$formContext3,
641
+ _registry$formContext4 = _registry$formContext.rowGutter,
642
+ rowGutter = _registry$formContext4 === void 0 ? 24 : _registry$formContext4,
643
+ _registry$formContext5 = _registry$formContext.toolbarAlign,
644
+ toolbarAlign = _registry$formContext5 === void 0 ? "top" : _registry$formContext5,
645
+ _registry$formContext6 = _registry$formContext.wrapperCol,
646
+ wrapperCol = _registry$formContext6 === void 0 ? VERTICAL_WRAPPER_COL : _registry$formContext6,
647
+ wrapperStyle = _registry$formContext.wrapperStyle;
641
648
  // Button templates are not overridden in the uiSchema
642
- const {
643
- RemoveButton
644
- } = registry.templates.ButtonTemplates;
645
- const keyLabel = `${label} Key`; // i18n ?
646
- const additional = (ADDITIONAL_PROPERTY_FLAG in schema);
649
+ var RemoveButton = registry.templates.ButtonTemplates.RemoveButton;
650
+ var keyLabel = label + " Key"; // i18n ?
651
+ var additional = (ADDITIONAL_PROPERTY_FLAG in schema);
647
652
  if (!additional) {
648
653
  return /*#__PURE__*/React.createElement("div", {
649
654
  className: classNames
650
655
  }, children);
651
656
  }
652
- const handleBlur = _ref2 => {
653
- let {
654
- target
655
- } = _ref2;
657
+ var handleBlur = function handleBlur(_ref2) {
658
+ var target = _ref2.target;
656
659
  return onKeyChange(target.value);
657
660
  };
658
661
  // The `block` prop is not part of the `IconButtonProps` defined in the template, so put it into the uiSchema instead
659
- const uiOptions = uiSchema ? uiSchema[UI_OPTIONS_KEY] : {};
660
- const buttonUiOptions = {
661
- ...uiSchema,
662
- [UI_OPTIONS_KEY]: {
663
- ...uiOptions,
664
- block: true
665
- }
666
- };
662
+ var uiOptions = uiSchema ? uiSchema[UI_OPTIONS_KEY] : {};
663
+ var buttonUiOptions = _extends({}, uiSchema, (_extends2 = {}, _extends2[UI_OPTIONS_KEY] = _extends({}, uiOptions, {
664
+ block: true
665
+ }), _extends2));
667
666
  return /*#__PURE__*/React.createElement("div", {
668
667
  className: classNames
669
668
  }, /*#__PURE__*/React.createElement(Row, {
@@ -678,7 +677,7 @@ const WrapIfAdditionalTemplate = _ref => {
678
677
  colon: colon,
679
678
  className: "form-group",
680
679
  hasFeedback: true,
681
- htmlFor: `${id}-key`,
680
+ htmlFor: id + "-key",
682
681
  label: keyLabel,
683
682
  labelCol: labelCol,
684
683
  required: required,
@@ -688,8 +687,8 @@ const WrapIfAdditionalTemplate = _ref => {
688
687
  className: "form-control",
689
688
  defaultValue: label,
690
689
  disabled: disabled || readonlyAsDisabled && readonly,
691
- id: `${id}-key`,
692
- name: `${id}-key`,
690
+ id: id + "-key",
691
+ name: id + "-key",
693
692
  onBlur: !readonly ? handleBlur : undefined,
694
693
  style: INPUT_STYLE$1,
695
694
  type: "text"
@@ -706,29 +705,29 @@ const WrapIfAdditionalTemplate = _ref => {
706
705
  }))));
707
706
  };
708
707
 
709
- const Index = {
710
- ArrayFieldItemTemplate,
708
+ var Index = {
709
+ ArrayFieldItemTemplate: ArrayFieldItemTemplate,
711
710
  ArrayFieldTemplate: ArrayFieldTemplate$1,
712
- BaseInputTemplate,
711
+ BaseInputTemplate: BaseInputTemplate,
713
712
  ButtonTemplates: {
714
- AddButton,
715
- MoveDownButton,
716
- MoveUpButton,
717
- RemoveButton,
718
- SubmitButton
713
+ AddButton: AddButton,
714
+ MoveDownButton: MoveDownButton,
715
+ MoveUpButton: MoveUpButton,
716
+ RemoveButton: RemoveButton,
717
+ SubmitButton: SubmitButton
719
718
  },
720
719
  DescriptionFieldTemplate: DescriptionField,
721
720
  ErrorListTemplate: ErrorList,
722
- FieldErrorTemplate,
723
- FieldTemplate,
721
+ FieldErrorTemplate: FieldErrorTemplate,
722
+ FieldTemplate: FieldTemplate,
724
723
  ObjectFieldTemplate: ObjectFieldTemplate$1,
725
724
  TitleFieldTemplate: TitleField$1,
726
- WrapIfAdditionalTemplate
725
+ WrapIfAdditionalTemplate: WrapIfAdditionalTemplate
727
726
  };
728
727
 
729
- const rangeOptions = (start, stop) => {
730
- const options = [];
731
- for (let i = start; i <= stop; i++) {
728
+ var rangeOptions = function rangeOptions(start, stop) {
729
+ var options = [];
730
+ for (var i = start; i <= stop; i++) {
732
731
  options.push({
733
732
  value: i,
734
733
  label: pad(i, 2)
@@ -736,22 +735,22 @@ const rangeOptions = (start, stop) => {
736
735
  }
737
736
  return options;
738
737
  };
739
- const readyForChange = state => {
740
- return Object.values(state).every(value => value !== -1);
738
+ var readyForChange = function readyForChange(state) {
739
+ return Object.values(state).every(function (value) {
740
+ return value !== -1;
741
+ });
741
742
  };
742
743
  function dateElementProps(state, time, yearsRange) {
743
744
  if (yearsRange === void 0) {
744
745
  yearsRange = [1900, new Date().getFullYear() + 2];
745
746
  }
746
- const {
747
- year,
748
- month,
749
- day,
750
- hour,
751
- minute,
752
- second
753
- } = state;
754
- const data = [{
747
+ var year = state.year,
748
+ month = state.month,
749
+ day = state.day,
750
+ hour = state.hour,
751
+ minute = state.minute,
752
+ second = state.second;
753
+ var data = [{
755
754
  type: "year",
756
755
  range: yearsRange,
757
756
  value: year
@@ -781,100 +780,98 @@ function dateElementProps(state, time, yearsRange) {
781
780
  }
782
781
  return data;
783
782
  }
784
- const AltDateWidget = _ref => {
785
- let {
786
- autofocus,
787
- disabled,
788
- formContext,
789
- id,
790
- onBlur,
791
- onChange,
792
- onFocus,
793
- options,
794
- readonly,
795
- registry,
796
- showTime,
797
- value
798
- } = _ref;
799
- const {
800
- SelectWidget
801
- } = registry.widgets;
802
- const {
803
- rowGutter = 24
804
- } = formContext;
805
- const [state, setState] = useState(parseDateString(value, showTime));
806
- useEffect(() => {
783
+ var AltDateWidget = function AltDateWidget(_ref) {
784
+ var autofocus = _ref.autofocus,
785
+ disabled = _ref.disabled,
786
+ formContext = _ref.formContext,
787
+ id = _ref.id,
788
+ onBlur = _ref.onBlur,
789
+ onChange = _ref.onChange,
790
+ onFocus = _ref.onFocus,
791
+ options = _ref.options,
792
+ readonly = _ref.readonly,
793
+ registry = _ref.registry,
794
+ showTime = _ref.showTime,
795
+ value = _ref.value;
796
+ var SelectWidget = registry.widgets.SelectWidget;
797
+ var _formContext$rowGutte = formContext.rowGutter,
798
+ rowGutter = _formContext$rowGutte === void 0 ? 24 : _formContext$rowGutte;
799
+ var _useState = useState(parseDateString(value, showTime)),
800
+ state = _useState[0],
801
+ setState = _useState[1];
802
+ useEffect(function () {
807
803
  setState(parseDateString(value, showTime));
808
804
  }, [showTime, value]);
809
- const handleChange = (property, nextValue) => {
810
- const nextState = {
811
- ...state,
812
- [property]: typeof nextValue === "undefined" ? -1 : nextValue
813
- };
805
+ var handleChange = function handleChange(property, nextValue) {
806
+ var _extends2;
807
+ var nextState = _extends({}, state, (_extends2 = {}, _extends2[property] = typeof nextValue === "undefined" ? -1 : nextValue, _extends2));
814
808
  if (readyForChange(nextState)) {
815
809
  onChange(toDateString(nextState, showTime));
816
810
  } else {
817
811
  setState(nextState);
818
812
  }
819
813
  };
820
- const handleNow = event => {
814
+ var handleNow = function handleNow(event) {
821
815
  event.preventDefault();
822
816
  if (disabled || readonly) {
823
817
  return;
824
818
  }
825
- const nextState = parseDateString(new Date().toJSON(), showTime);
819
+ var nextState = parseDateString(new Date().toJSON(), showTime);
826
820
  onChange(toDateString(nextState, showTime));
827
821
  };
828
- const handleClear = event => {
822
+ var handleClear = function handleClear(event) {
829
823
  event.preventDefault();
830
824
  if (disabled || readonly) {
831
825
  return;
832
826
  }
833
827
  onChange(undefined);
834
828
  };
835
- const renderDateElement = elemProps => /*#__PURE__*/React.createElement(SelectWidget, {
836
- autofocus: elemProps.autofocus,
837
- className: "form-control",
838
- disabled: elemProps.disabled,
839
- id: elemProps.id,
840
- name: elemProps.name,
841
- onBlur: elemProps.onBlur,
842
- onChange: elemValue => elemProps.select(elemProps.type, elemValue),
843
- onFocus: elemProps.onFocus,
844
- options: {
845
- enumOptions: rangeOptions(elemProps.range[0], elemProps.range[1])
846
- },
847
- placeholder: elemProps.type,
848
- readonly: elemProps.readonly,
849
- schema: {
850
- type: "integer"
851
- },
852
- value: elemProps.value,
853
- registry: registry,
854
- label: ""
855
- });
829
+ var renderDateElement = function renderDateElement(elemProps) {
830
+ return /*#__PURE__*/React.createElement(SelectWidget, {
831
+ autofocus: elemProps.autofocus,
832
+ className: "form-control",
833
+ disabled: elemProps.disabled,
834
+ id: elemProps.id,
835
+ name: elemProps.name,
836
+ onBlur: elemProps.onBlur,
837
+ onChange: function onChange(elemValue) {
838
+ return elemProps.select(elemProps.type, elemValue);
839
+ },
840
+ onFocus: elemProps.onFocus,
841
+ options: {
842
+ enumOptions: rangeOptions(elemProps.range[0], elemProps.range[1])
843
+ },
844
+ placeholder: elemProps.type,
845
+ readonly: elemProps.readonly,
846
+ schema: {
847
+ type: "integer"
848
+ },
849
+ value: elemProps.value,
850
+ registry: registry,
851
+ label: ""
852
+ });
853
+ };
856
854
  return /*#__PURE__*/React.createElement(Row, {
857
855
  gutter: [Math.floor(rowGutter / 2), Math.floor(rowGutter / 2)]
858
- }, dateElementProps(state, showTime, options.yearsRange).map((elemProps, i) => {
859
- const elemId = id + "_" + elemProps.type;
856
+ }, dateElementProps(state, showTime, options.yearsRange).map(function (elemProps, i) {
857
+ var elemId = id + "_" + elemProps.type;
860
858
  return /*#__PURE__*/React.createElement(Col, {
861
859
  flex: "88px",
862
860
  key: elemId
863
- }, renderDateElement({
864
- ...elemProps,
861
+ }, renderDateElement(_extends({}, elemProps, {
865
862
  autofocus: autofocus && i === 0,
866
- disabled,
863
+ disabled: disabled,
867
864
  id: elemId,
868
865
  name: id,
869
- onBlur,
870
- onFocus,
871
- readonly,
872
- registry,
866
+ onBlur: onBlur,
867
+ onFocus: onFocus,
868
+ readonly: readonly,
869
+ registry: registry,
873
870
  select: handleChange,
874
871
  // NOTE: antd components accept -1 rather than issue a warning
875
872
  // like material-ui, so we need to convert -1 to undefined here.
876
873
  value: elemProps.value < 0 ? undefined : elemProps.value
877
- }));
874
+ })));
878
875
  }), !options.hideNowButton && /*#__PURE__*/React.createElement(Col, {
879
876
  flex: "88px"
880
877
  }, /*#__PURE__*/React.createElement(Button, {
@@ -902,76 +899,62 @@ AltDateWidget.defaultProps = {
902
899
  showTime: false
903
900
  };
904
901
 
905
- const AltDateTimeWidget = props => {
906
- const {
907
- AltDateWidget
908
- } = props.registry.widgets;
909
- return /*#__PURE__*/React.createElement(AltDateWidget, {
910
- showTime: true,
911
- ...props
912
- });
902
+ var AltDateTimeWidget = function AltDateTimeWidget(props) {
903
+ var AltDateWidget = props.registry.widgets.AltDateWidget;
904
+ return /*#__PURE__*/React.createElement(AltDateWidget, _extends({
905
+ showTime: true
906
+ }, props));
913
907
  };
914
- AltDateTimeWidget.defaultProps = {
915
- ...AltDateWidget.defaultProps,
908
+ AltDateTimeWidget.defaultProps = /*#__PURE__*/_extends({}, AltDateWidget.defaultProps, {
916
909
  showTime: true
917
- };
910
+ });
918
911
 
919
- const CheckboxesWidget = _ref => {
920
- let {
921
- autofocus,
922
- disabled,
923
- formContext,
924
- id,
925
- onBlur,
926
- onChange,
927
- onFocus,
928
- options,
929
- readonly,
930
- value
931
- } = _ref;
932
- const {
933
- readonlyAsDisabled = true
934
- } = formContext;
935
- const {
936
- enumOptions,
937
- enumDisabled,
938
- inline
939
- } = options;
940
- const handleChange = nextValue => onChange(nextValue);
941
- const handleBlur = _ref2 => {
942
- let {
943
- target
944
- } = _ref2;
912
+ var CheckboxesWidget = function CheckboxesWidget(_ref) {
913
+ var autofocus = _ref.autofocus,
914
+ disabled = _ref.disabled,
915
+ formContext = _ref.formContext,
916
+ id = _ref.id,
917
+ onBlur = _ref.onBlur,
918
+ onChange = _ref.onChange,
919
+ onFocus = _ref.onFocus,
920
+ options = _ref.options,
921
+ readonly = _ref.readonly,
922
+ value = _ref.value;
923
+ var _formContext$readonly = formContext.readonlyAsDisabled,
924
+ readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
925
+ var enumOptions = options.enumOptions,
926
+ enumDisabled = options.enumDisabled,
927
+ inline = options.inline;
928
+ var handleChange = function handleChange(nextValue) {
929
+ return onChange(nextValue);
930
+ };
931
+ var handleBlur = function handleBlur(_ref2) {
932
+ var target = _ref2.target;
945
933
  return onBlur(id, target.value);
946
934
  };
947
- const handleFocus = _ref3 => {
948
- let {
949
- target
950
- } = _ref3;
935
+ var handleFocus = function handleFocus(_ref3) {
936
+ var target = _ref3.target;
951
937
  return onFocus(id, target.value);
952
938
  };
953
939
  // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
954
940
  // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
955
- const extraProps = {
956
- id,
941
+ var extraProps = {
942
+ id: id,
957
943
  onBlur: !readonly ? handleBlur : undefined,
958
944
  onFocus: !readonly ? handleFocus : undefined
959
945
  };
960
- return Array.isArray(enumOptions) && enumOptions.length > 0 ? /*#__PURE__*/React.createElement(Checkbox.Group, {
946
+ return Array.isArray(enumOptions) && enumOptions.length > 0 ? /*#__PURE__*/React.createElement(Checkbox.Group, _extends({
961
947
  disabled: disabled || readonlyAsDisabled && readonly,
962
948
  name: id,
963
949
  onChange: !readonly ? handleChange : undefined,
964
- value: value,
965
- ...extraProps
966
- }, Array.isArray(enumOptions) && enumOptions.map((_ref4, i) => {
967
- let {
968
- value: optionValue,
969
- label: optionLabel
970
- } = _ref4;
950
+ value: value
951
+ }, extraProps), Array.isArray(enumOptions) && enumOptions.map(function (_ref4, i) {
952
+ var optionValue = _ref4.value,
953
+ optionLabel = _ref4.label;
971
954
  return /*#__PURE__*/React.createElement("span", {
972
955
  key: optionValue
973
956
  }, /*#__PURE__*/React.createElement(Checkbox, {
974
- id: `${id}-${optionValue}`,
957
+ id: id + "-" + optionValue,
975
958
  name: id,
976
959
  autoFocus: i === 0 ? autofocus : false,
977
960
  disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
@@ -980,81 +963,76 @@ const CheckboxesWidget = _ref => {
980
963
  })) : null;
981
964
  };
982
965
 
983
- const CheckboxWidget = _ref => {
984
- let {
985
- autofocus,
986
- disabled,
987
- formContext,
988
- id,
989
- label,
990
- onBlur,
991
- onChange,
992
- onFocus,
993
- readonly,
994
- value
995
- } = _ref;
996
- const {
997
- readonlyAsDisabled = true
998
- } = formContext;
999
- const handleChange = _ref2 => {
1000
- let {
1001
- target
1002
- } = _ref2;
966
+ var CheckboxWidget = function CheckboxWidget(_ref) {
967
+ var autofocus = _ref.autofocus,
968
+ disabled = _ref.disabled,
969
+ formContext = _ref.formContext,
970
+ id = _ref.id,
971
+ label = _ref.label,
972
+ onBlur = _ref.onBlur,
973
+ onChange = _ref.onChange,
974
+ onFocus = _ref.onFocus,
975
+ readonly = _ref.readonly,
976
+ value = _ref.value;
977
+ var _formContext$readonly = formContext.readonlyAsDisabled,
978
+ readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
979
+ var handleChange = function handleChange(_ref2) {
980
+ var target = _ref2.target;
1003
981
  return onChange(target.checked);
1004
982
  };
1005
- const handleBlur = _ref3 => {
1006
- let {
1007
- target
1008
- } = _ref3;
983
+ var handleBlur = function handleBlur(_ref3) {
984
+ var target = _ref3.target;
1009
985
  return onBlur(id, target.checked);
1010
986
  };
1011
- const handleFocus = _ref4 => {
1012
- let {
1013
- target
1014
- } = _ref4;
987
+ var handleFocus = function handleFocus(_ref4) {
988
+ var target = _ref4.target;
1015
989
  return onFocus(id, target.checked);
1016
990
  };
1017
991
  // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
1018
992
  // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
1019
- const extraProps = {
993
+ var extraProps = {
1020
994
  onBlur: !readonly ? handleBlur : undefined,
1021
995
  onFocus: !readonly ? handleFocus : undefined
1022
996
  };
1023
- return /*#__PURE__*/React.createElement(Checkbox, {
997
+ return /*#__PURE__*/React.createElement(Checkbox, _extends({
1024
998
  autoFocus: autofocus,
1025
999
  checked: typeof value === "undefined" ? false : value,
1026
1000
  disabled: disabled || readonlyAsDisabled && readonly,
1027
1001
  id: id,
1028
1002
  name: id,
1029
- onChange: !readonly ? handleChange : undefined,
1030
- ...extraProps
1031
- }, label);
1003
+ onChange: !readonly ? handleChange : undefined
1004
+ }, extraProps), label);
1032
1005
  };
1033
1006
 
1034
- const DatePicker = /*#__PURE__*/generatePicker(dayjsGenerateConfig);
1007
+ var DatePicker = /*#__PURE__*/generatePicker(dayjsGenerateConfig);
1035
1008
 
1036
- const DATE_PICKER_STYLE$1 = {
1009
+ var DATE_PICKER_STYLE$1 = {
1037
1010
  width: "100%"
1038
1011
  };
1039
- const DateTimeWidget = _ref => {
1040
- let {
1041
- disabled,
1042
- formContext,
1043
- id,
1044
- onBlur,
1045
- onChange,
1046
- onFocus,
1047
- placeholder,
1048
- readonly,
1049
- value
1050
- } = _ref;
1051
- const {
1052
- readonlyAsDisabled = true
1053
- } = formContext;
1054
- const handleChange = nextValue => onChange(nextValue && nextValue.toISOString());
1055
- const handleBlur = () => onBlur(id, value);
1056
- const handleFocus = () => onFocus(id, value);
1057
- const getPopupContainer = node => node.parentNode;
1012
+ var DateTimeWidget = function DateTimeWidget(_ref) {
1013
+ var disabled = _ref.disabled,
1014
+ formContext = _ref.formContext,
1015
+ id = _ref.id,
1016
+ onBlur = _ref.onBlur,
1017
+ onChange = _ref.onChange,
1018
+ onFocus = _ref.onFocus,
1019
+ placeholder = _ref.placeholder,
1020
+ readonly = _ref.readonly,
1021
+ value = _ref.value;
1022
+ var _formContext$readonly = formContext.readonlyAsDisabled,
1023
+ readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1024
+ var handleChange = function handleChange(nextValue) {
1025
+ return onChange(nextValue && nextValue.toISOString());
1026
+ };
1027
+ var handleBlur = function handleBlur() {
1028
+ return onBlur(id, value);
1029
+ };
1030
+ var handleFocus = function handleFocus() {
1031
+ return onFocus(id, value);
1032
+ };
1033
+ var getPopupContainer = function getPopupContainer(node) {
1034
+ return node.parentNode;
1035
+ };
1058
1036
  return /*#__PURE__*/React.createElement(DatePicker, {
1059
1037
  disabled: disabled || readonlyAsDisabled && readonly,
1060
1038
  getPopupContainer: getPopupContainer,
@@ -1070,28 +1048,33 @@ const DateTimeWidget = _ref => {
1070
1048
  });
1071
1049
  };
1072
1050
 
1073
- const DATE_PICKER_STYLE = {
1051
+ var DATE_PICKER_STYLE = {
1074
1052
  width: "100%"
1075
1053
  };
1076
- const DateWidget = _ref => {
1077
- let {
1078
- disabled,
1079
- formContext,
1080
- id,
1081
- onBlur,
1082
- onChange,
1083
- onFocus,
1084
- placeholder,
1085
- readonly,
1086
- value
1087
- } = _ref;
1088
- const {
1089
- readonlyAsDisabled = true
1090
- } = formContext;
1091
- const handleChange = nextValue => onChange(nextValue && nextValue.format("YYYY-MM-DD"));
1092
- const handleBlur = () => onBlur(id, value);
1093
- const handleFocus = () => onFocus(id, value);
1094
- const getPopupContainer = node => node.parentNode;
1054
+ var DateWidget = function DateWidget(_ref) {
1055
+ var disabled = _ref.disabled,
1056
+ formContext = _ref.formContext,
1057
+ id = _ref.id,
1058
+ onBlur = _ref.onBlur,
1059
+ onChange = _ref.onChange,
1060
+ onFocus = _ref.onFocus,
1061
+ placeholder = _ref.placeholder,
1062
+ readonly = _ref.readonly,
1063
+ value = _ref.value;
1064
+ var _formContext$readonly = formContext.readonlyAsDisabled,
1065
+ readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1066
+ var handleChange = function handleChange(nextValue) {
1067
+ return onChange(nextValue && nextValue.format("YYYY-MM-DD"));
1068
+ };
1069
+ var handleBlur = function handleBlur() {
1070
+ return onBlur(id, value);
1071
+ };
1072
+ var handleFocus = function handleFocus() {
1073
+ return onFocus(id, value);
1074
+ };
1075
+ var getPopupContainer = function getPopupContainer(node) {
1076
+ return node.parentNode;
1077
+ };
1095
1078
  return /*#__PURE__*/React.createElement(DatePicker, {
1096
1079
  disabled: disabled || readonlyAsDisabled && readonly,
1097
1080
  getPopupContainer: getPopupContainer,
@@ -1107,39 +1090,30 @@ const DateWidget = _ref => {
1107
1090
  });
1108
1091
  };
1109
1092
 
1110
- const PasswordWidget = _ref => {
1111
- let {
1112
- disabled,
1113
- formContext,
1114
- id,
1115
- onBlur,
1116
- onChange,
1117
- onFocus,
1118
- options,
1119
- placeholder,
1120
- readonly,
1121
- value
1122
- } = _ref;
1123
- const {
1124
- readonlyAsDisabled = true
1125
- } = formContext;
1126
- const emptyValue = options.emptyValue || "";
1127
- const handleChange = _ref2 => {
1128
- let {
1129
- target
1130
- } = _ref2;
1093
+ var PasswordWidget = function PasswordWidget(_ref) {
1094
+ var disabled = _ref.disabled,
1095
+ formContext = _ref.formContext,
1096
+ id = _ref.id,
1097
+ onBlur = _ref.onBlur,
1098
+ onChange = _ref.onChange,
1099
+ onFocus = _ref.onFocus,
1100
+ options = _ref.options,
1101
+ placeholder = _ref.placeholder,
1102
+ readonly = _ref.readonly,
1103
+ value = _ref.value;
1104
+ var _formContext$readonly = formContext.readonlyAsDisabled,
1105
+ readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1106
+ var emptyValue = options.emptyValue || "";
1107
+ var handleChange = function handleChange(_ref2) {
1108
+ var target = _ref2.target;
1131
1109
  return onChange(target.value === "" ? emptyValue : target.value);
1132
1110
  };
1133
- const handleBlur = _ref3 => {
1134
- let {
1135
- target
1136
- } = _ref3;
1111
+ var handleBlur = function handleBlur(_ref3) {
1112
+ var target = _ref3.target;
1137
1113
  return onBlur(id, target.value);
1138
1114
  };
1139
- const handleFocus = _ref4 => {
1140
- let {
1141
- target
1142
- } = _ref4;
1115
+ var handleFocus = function handleFocus(_ref4) {
1116
+ var target = _ref4.target;
1143
1117
  return onFocus(id, target.value);
1144
1118
  };
1145
1119
  return /*#__PURE__*/React.createElement(Input.Password, {
@@ -1154,45 +1128,32 @@ const PasswordWidget = _ref => {
1154
1128
  });
1155
1129
  };
1156
1130
 
1157
- const RadioWidget = _ref => {
1158
- let {
1159
- autofocus,
1160
- disabled,
1161
- formContext,
1162
- id,
1163
- onBlur,
1164
- onChange,
1165
- onFocus,
1166
- options,
1167
- readonly,
1168
- schema,
1169
- value
1170
- } = _ref;
1171
- const {
1172
- readonlyAsDisabled = true
1173
- } = formContext;
1174
- const {
1175
- enumOptions,
1176
- enumDisabled
1177
- } = options;
1178
- const handleChange = _ref2 => {
1179
- let {
1180
- target: {
1181
- value: nextValue
1182
- }
1183
- } = _ref2;
1131
+ var RadioWidget = function RadioWidget(_ref) {
1132
+ var autofocus = _ref.autofocus,
1133
+ disabled = _ref.disabled,
1134
+ formContext = _ref.formContext,
1135
+ id = _ref.id,
1136
+ onBlur = _ref.onBlur,
1137
+ onChange = _ref.onChange,
1138
+ onFocus = _ref.onFocus,
1139
+ options = _ref.options,
1140
+ readonly = _ref.readonly,
1141
+ schema = _ref.schema,
1142
+ value = _ref.value;
1143
+ var _formContext$readonly = formContext.readonlyAsDisabled,
1144
+ readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1145
+ var enumOptions = options.enumOptions,
1146
+ enumDisabled = options.enumDisabled;
1147
+ var handleChange = function handleChange(_ref2) {
1148
+ var nextValue = _ref2.target.value;
1184
1149
  return onChange(schema.type === "boolean" ? nextValue !== "false" : nextValue);
1185
1150
  };
1186
- const handleBlur = _ref3 => {
1187
- let {
1188
- target
1189
- } = _ref3;
1151
+ var handleBlur = function handleBlur(_ref3) {
1152
+ var target = _ref3.target;
1190
1153
  return onBlur(id, target.value);
1191
1154
  };
1192
- const handleFocus = _ref4 => {
1193
- let {
1194
- target
1195
- } = _ref4;
1155
+ var handleFocus = function handleFocus(_ref4) {
1156
+ var target = _ref4.target;
1196
1157
  return onFocus(id, target.value);
1197
1158
  };
1198
1159
  return /*#__PURE__*/React.createElement(Radio.Group, {
@@ -1202,58 +1163,58 @@ const RadioWidget = _ref => {
1202
1163
  onChange: !readonly ? handleChange : undefined,
1203
1164
  onBlur: !readonly ? handleBlur : undefined,
1204
1165
  onFocus: !readonly ? handleFocus : undefined,
1205
- value: `${value}`
1206
- }, Array.isArray(enumOptions) && enumOptions.map((_ref5, i) => {
1207
- let {
1208
- value: optionValue,
1209
- label: optionLabel
1210
- } = _ref5;
1166
+ value: "" + value
1167
+ }, Array.isArray(enumOptions) && enumOptions.map(function (_ref5, i) {
1168
+ var optionValue = _ref5.value,
1169
+ optionLabel = _ref5.label;
1211
1170
  return /*#__PURE__*/React.createElement(Radio, {
1212
- id: `${id}-${optionValue}`,
1171
+ id: id + "-" + optionValue,
1213
1172
  name: id,
1214
1173
  autoFocus: i === 0 ? autofocus : false,
1215
1174
  disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
1216
1175
  key: optionValue,
1217
- value: `${optionValue}`
1176
+ value: "" + optionValue
1218
1177
  }, optionLabel);
1219
1178
  }));
1220
1179
  };
1221
1180
 
1222
- const RangeWidget = _ref => {
1223
- let {
1224
- autofocus,
1225
- disabled,
1226
- formContext,
1227
- id,
1228
- onBlur,
1229
- onChange,
1230
- onFocus,
1231
- options,
1232
- placeholder,
1233
- readonly,
1234
- schema,
1235
- value
1236
- } = _ref;
1237
- const {
1238
- readonlyAsDisabled = true
1239
- } = formContext;
1240
- const {
1241
- min,
1242
- max,
1243
- step
1244
- } = rangeSpec(schema);
1245
- const emptyValue = options.emptyValue || "";
1246
- const handleChange = nextValue => onChange(nextValue === "" ? emptyValue : nextValue);
1247
- const handleBlur = () => onBlur(id, value);
1248
- const handleFocus = () => onFocus(id, value);
1181
+ var RangeWidget = function RangeWidget(_ref) {
1182
+ var autofocus = _ref.autofocus,
1183
+ disabled = _ref.disabled,
1184
+ formContext = _ref.formContext,
1185
+ id = _ref.id,
1186
+ onBlur = _ref.onBlur,
1187
+ onChange = _ref.onChange,
1188
+ onFocus = _ref.onFocus,
1189
+ options = _ref.options,
1190
+ placeholder = _ref.placeholder,
1191
+ readonly = _ref.readonly,
1192
+ schema = _ref.schema,
1193
+ value = _ref.value;
1194
+ var _formContext$readonly = formContext.readonlyAsDisabled,
1195
+ readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1196
+ var _rangeSpec = rangeSpec(schema),
1197
+ min = _rangeSpec.min,
1198
+ max = _rangeSpec.max,
1199
+ step = _rangeSpec.step;
1200
+ var emptyValue = options.emptyValue || "";
1201
+ var handleChange = function handleChange(nextValue) {
1202
+ return onChange(nextValue === "" ? emptyValue : nextValue);
1203
+ };
1204
+ var handleBlur = function handleBlur() {
1205
+ return onBlur(id, value);
1206
+ };
1207
+ var handleFocus = function handleFocus() {
1208
+ return onFocus(id, value);
1209
+ };
1249
1210
  // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
1250
1211
  // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
1251
- const extraProps = {
1252
- placeholder,
1212
+ var extraProps = {
1213
+ placeholder: placeholder,
1253
1214
  onBlur: !readonly ? handleBlur : undefined,
1254
1215
  onFocus: !readonly ? handleFocus : undefined
1255
1216
  };
1256
- return /*#__PURE__*/React.createElement(Slider, {
1217
+ return /*#__PURE__*/React.createElement(Slider, _extends({
1257
1218
  autoFocus: autofocus,
1258
1219
  disabled: disabled || readonlyAsDisabled && readonly,
1259
1220
  id: id,
@@ -1262,48 +1223,52 @@ const RangeWidget = _ref => {
1262
1223
  onChange: !readonly ? handleChange : undefined,
1263
1224
  range: false,
1264
1225
  step: step,
1265
- value: value,
1266
- ...extraProps
1267
- });
1226
+ value: value
1227
+ }, extraProps));
1268
1228
  };
1269
1229
 
1270
- const SELECT_STYLE = {
1230
+ var SELECT_STYLE = {
1271
1231
  width: "100%"
1272
1232
  };
1273
- const SelectWidget = _ref => {
1274
- let {
1275
- autofocus,
1276
- disabled,
1277
- formContext,
1278
- id,
1279
- multiple,
1280
- onBlur,
1281
- onChange,
1282
- onFocus,
1283
- options,
1284
- placeholder,
1285
- readonly,
1286
- schema,
1287
- value
1288
- } = _ref;
1289
- const {
1290
- readonlyAsDisabled = true
1291
- } = formContext;
1292
- const {
1293
- enumOptions,
1294
- enumDisabled
1295
- } = options;
1296
- const handleChange = nextValue => onChange(processSelectValue(schema, nextValue, options));
1297
- const handleBlur = () => onBlur(id, processSelectValue(schema, value, options));
1298
- const handleFocus = () => onFocus(id, processSelectValue(schema, value, options));
1299
- const getPopupContainer = node => node.parentNode;
1300
- const stringify = currentValue => Array.isArray(currentValue) ? value.map(String) : String(value);
1233
+ var SelectWidget = function SelectWidget(_ref) {
1234
+ var autofocus = _ref.autofocus,
1235
+ disabled = _ref.disabled,
1236
+ formContext = _ref.formContext,
1237
+ id = _ref.id,
1238
+ multiple = _ref.multiple,
1239
+ onBlur = _ref.onBlur,
1240
+ onChange = _ref.onChange,
1241
+ onFocus = _ref.onFocus,
1242
+ options = _ref.options,
1243
+ placeholder = _ref.placeholder,
1244
+ readonly = _ref.readonly,
1245
+ schema = _ref.schema,
1246
+ value = _ref.value;
1247
+ var _formContext$readonly = formContext.readonlyAsDisabled,
1248
+ readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1249
+ var enumOptions = options.enumOptions,
1250
+ enumDisabled = options.enumDisabled;
1251
+ var handleChange = function handleChange(nextValue) {
1252
+ return onChange(processSelectValue(schema, nextValue, options));
1253
+ };
1254
+ var handleBlur = function handleBlur() {
1255
+ return onBlur(id, processSelectValue(schema, value, options));
1256
+ };
1257
+ var handleFocus = function handleFocus() {
1258
+ return onFocus(id, processSelectValue(schema, value, options));
1259
+ };
1260
+ var getPopupContainer = function getPopupContainer(node) {
1261
+ return node.parentNode;
1262
+ };
1263
+ var stringify = function stringify(currentValue) {
1264
+ return Array.isArray(currentValue) ? value.map(String) : String(value);
1265
+ };
1301
1266
  // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
1302
1267
  // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
1303
- const extraProps = {
1268
+ var extraProps = {
1304
1269
  name: id
1305
1270
  };
1306
- return /*#__PURE__*/React.createElement(Select, {
1271
+ return /*#__PURE__*/React.createElement(Select, _extends({
1307
1272
  autoFocus: autofocus,
1308
1273
  disabled: disabled || readonlyAsDisabled && readonly,
1309
1274
  getPopupContainer: getPopupContainer,
@@ -1314,13 +1279,10 @@ const SelectWidget = _ref => {
1314
1279
  onFocus: !readonly ? handleFocus : undefined,
1315
1280
  placeholder: placeholder,
1316
1281
  style: SELECT_STYLE,
1317
- value: typeof value !== "undefined" ? stringify(value) : undefined,
1318
- ...extraProps
1319
- }, Array.isArray(enumOptions) && enumOptions.map(_ref2 => {
1320
- let {
1321
- value: optionValue,
1322
- label: optionLabel
1323
- } = _ref2;
1282
+ value: typeof value !== "undefined" ? stringify(value) : undefined
1283
+ }, extraProps), Array.isArray(enumOptions) && enumOptions.map(function (_ref2) {
1284
+ var optionValue = _ref2.value,
1285
+ optionLabel = _ref2.label;
1324
1286
  return /*#__PURE__*/React.createElement(Select.Option, {
1325
1287
  disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
1326
1288
  key: String(optionValue),
@@ -1332,49 +1294,40 @@ SelectWidget.defaultProps = {
1332
1294
  formContext: {}
1333
1295
  };
1334
1296
 
1335
- const INPUT_STYLE = {
1297
+ var INPUT_STYLE = {
1336
1298
  width: "100%"
1337
1299
  };
1338
- const TextareaWidget = _ref => {
1339
- let {
1340
- disabled,
1341
- formContext,
1342
- id,
1343
- onBlur,
1344
- onChange,
1345
- onFocus,
1346
- options,
1347
- placeholder,
1348
- readonly,
1349
- value
1350
- } = _ref;
1351
- const {
1352
- readonlyAsDisabled = true
1353
- } = formContext;
1354
- const handleChange = _ref2 => {
1355
- let {
1356
- target
1357
- } = _ref2;
1300
+ var TextareaWidget = function TextareaWidget(_ref) {
1301
+ var disabled = _ref.disabled,
1302
+ formContext = _ref.formContext,
1303
+ id = _ref.id,
1304
+ onBlur = _ref.onBlur,
1305
+ onChange = _ref.onChange,
1306
+ onFocus = _ref.onFocus,
1307
+ options = _ref.options,
1308
+ placeholder = _ref.placeholder,
1309
+ readonly = _ref.readonly,
1310
+ value = _ref.value;
1311
+ var _formContext$readonly = formContext.readonlyAsDisabled,
1312
+ readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
1313
+ var handleChange = function handleChange(_ref2) {
1314
+ var target = _ref2.target;
1358
1315
  return onChange(target.value === "" ? options.emptyValue : target.value);
1359
1316
  };
1360
- const handleBlur = _ref3 => {
1361
- let {
1362
- target
1363
- } = _ref3;
1317
+ var handleBlur = function handleBlur(_ref3) {
1318
+ var target = _ref3.target;
1364
1319
  return onBlur(id, target.value);
1365
1320
  };
1366
- const handleFocus = _ref4 => {
1367
- let {
1368
- target
1369
- } = _ref4;
1321
+ var handleFocus = function handleFocus(_ref4) {
1322
+ var target = _ref4.target;
1370
1323
  return onFocus(id, target.value);
1371
1324
  };
1372
1325
  // Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
1373
1326
  // they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
1374
- const extraProps = {
1327
+ var extraProps = {
1375
1328
  type: "textarea"
1376
1329
  };
1377
- return /*#__PURE__*/React.createElement(Input.TextArea, {
1330
+ return /*#__PURE__*/React.createElement(Input.TextArea, _extends({
1378
1331
  disabled: disabled || readonlyAsDisabled && readonly,
1379
1332
  id: id,
1380
1333
  name: id,
@@ -1384,30 +1337,29 @@ const TextareaWidget = _ref => {
1384
1337
  placeholder: placeholder,
1385
1338
  rows: options.rows || 4,
1386
1339
  style: INPUT_STYLE,
1387
- value: value,
1388
- ...extraProps
1389
- });
1340
+ value: value
1341
+ }, extraProps));
1390
1342
  };
1391
1343
 
1392
- const Widgets = {
1393
- AltDateTimeWidget,
1394
- AltDateWidget,
1395
- CheckboxesWidget,
1396
- CheckboxWidget,
1397
- DateTimeWidget,
1398
- DateWidget,
1399
- PasswordWidget,
1400
- RadioWidget,
1401
- RangeWidget,
1402
- SelectWidget,
1403
- TextareaWidget
1344
+ var Widgets = {
1345
+ AltDateTimeWidget: AltDateTimeWidget,
1346
+ AltDateWidget: AltDateWidget,
1347
+ CheckboxesWidget: CheckboxesWidget,
1348
+ CheckboxWidget: CheckboxWidget,
1349
+ DateTimeWidget: DateTimeWidget,
1350
+ DateWidget: DateWidget,
1351
+ PasswordWidget: PasswordWidget,
1352
+ RadioWidget: RadioWidget,
1353
+ RangeWidget: RangeWidget,
1354
+ SelectWidget: SelectWidget,
1355
+ TextareaWidget: TextareaWidget
1404
1356
  };
1405
1357
 
1406
- const Theme = {
1358
+ var Theme = {
1407
1359
  templates: Index,
1408
1360
  widgets: Widgets
1409
1361
  };
1410
- const Form = /*#__PURE__*/withTheme(Theme);
1362
+ var Form = /*#__PURE__*/withTheme(Theme);
1411
1363
 
1412
1364
  export { Form, Index as Templates, Theme, Widgets, Form as default };
1413
1365
  //# sourceMappingURL=antd.esm.js.map