@rjsf/antd 5.0.0-beta.15 → 5.0.0-beta.16
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.cjs.development.js +484 -382
- package/dist/antd.cjs.development.js.map +1 -1
- package/dist/antd.cjs.production.min.js +1 -1
- package/dist/antd.cjs.production.min.js.map +1 -1
- package/dist/antd.esm.js +480 -382
- package/dist/antd.esm.js.map +1 -1
- package/dist/antd.umd.development.js +484 -382
- package/dist/antd.umd.development.js.map +1 -1
- package/dist/antd.umd.production.min.js +1 -1
- package/dist/antd.umd.production.min.js.map +1 -1
- package/dist/index.d.ts +11 -46
- package/package.json +5 -5
|
@@ -67,19 +67,23 @@ var BTN_GRP_STYLE = {
|
|
|
67
67
|
var BTN_STYLE = {
|
|
68
68
|
width: "calc(100% / 3)"
|
|
69
69
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
71
|
+
*
|
|
72
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
73
|
+
*/
|
|
74
|
+
function ArrayFieldItemTemplate(props) {
|
|
75
|
+
var children = props.children,
|
|
76
|
+
disabled = props.disabled,
|
|
77
|
+
hasMoveDown = props.hasMoveDown,
|
|
78
|
+
hasMoveUp = props.hasMoveUp,
|
|
79
|
+
hasRemove = props.hasRemove,
|
|
80
|
+
hasToolbar = props.hasToolbar,
|
|
81
|
+
index = props.index,
|
|
82
|
+
onDropIndexClick = props.onDropIndexClick,
|
|
83
|
+
onReorderClick = props.onReorderClick,
|
|
84
|
+
readonly = props.readonly,
|
|
85
|
+
registry = props.registry,
|
|
86
|
+
uiSchema = props.uiSchema;
|
|
83
87
|
var _registry$templates$B = registry.templates.ButtonTemplates,
|
|
84
88
|
MoveDownButton = _registry$templates$B.MoveDownButton,
|
|
85
89
|
MoveUpButton = _registry$templates$B.MoveUpButton,
|
|
@@ -103,19 +107,22 @@ var ArrayFieldItemTemplate = function ArrayFieldItemTemplate(_ref) {
|
|
|
103
107
|
disabled: disabled || readonly || !hasMoveUp,
|
|
104
108
|
onClick: onReorderClick(index, index - 1),
|
|
105
109
|
style: BTN_STYLE,
|
|
106
|
-
uiSchema: uiSchema
|
|
110
|
+
uiSchema: uiSchema,
|
|
111
|
+
registry: registry
|
|
107
112
|
}), (hasMoveUp || hasMoveDown) && /*#__PURE__*/React__default["default"].createElement(MoveDownButton, {
|
|
108
113
|
disabled: disabled || readonly || !hasMoveDown,
|
|
109
114
|
onClick: onReorderClick(index, index + 1),
|
|
110
115
|
style: BTN_STYLE,
|
|
111
|
-
uiSchema: uiSchema
|
|
116
|
+
uiSchema: uiSchema,
|
|
117
|
+
registry: registry
|
|
112
118
|
}), hasRemove && /*#__PURE__*/React__default["default"].createElement(RemoveButton, {
|
|
113
119
|
disabled: disabled || readonly,
|
|
114
120
|
onClick: onDropIndexClick(index),
|
|
115
121
|
style: BTN_STYLE,
|
|
116
|
-
uiSchema: uiSchema
|
|
122
|
+
uiSchema: uiSchema,
|
|
123
|
+
registry: registry
|
|
117
124
|
}))));
|
|
118
|
-
}
|
|
125
|
+
}
|
|
119
126
|
|
|
120
127
|
function _extends() {
|
|
121
128
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -148,21 +155,24 @@ var _excluded$1 = ["key"];
|
|
|
148
155
|
var DESCRIPTION_COL_STYLE$1 = {
|
|
149
156
|
paddingBottom: "8px"
|
|
150
157
|
};
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
158
|
+
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
159
|
+
*
|
|
160
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
161
|
+
*/
|
|
162
|
+
function ArrayFieldTemplate(props) {
|
|
163
|
+
var canAdd = props.canAdd,
|
|
164
|
+
className = props.className,
|
|
165
|
+
disabled = props.disabled,
|
|
166
|
+
formContext = props.formContext,
|
|
167
|
+
idSchema = props.idSchema,
|
|
168
|
+
items = props.items,
|
|
169
|
+
onAddClick = props.onAddClick,
|
|
170
|
+
readonly = props.readonly,
|
|
171
|
+
registry = props.registry,
|
|
172
|
+
required = props.required,
|
|
173
|
+
schema = props.schema,
|
|
174
|
+
title = props.title,
|
|
175
|
+
uiSchema = props.uiSchema;
|
|
166
176
|
var uiOptions = utils.getUiOptions(uiSchema);
|
|
167
177
|
var ArrayFieldDescriptionTemplate = utils.getTemplate("ArrayFieldDescriptionTemplate", registry, uiOptions);
|
|
168
178
|
var ArrayFieldItemTemplate = utils.getTemplate("ArrayFieldItemTemplate", registry, uiOptions);
|
|
@@ -173,94 +183,102 @@ var ArrayFieldTemplate = function ArrayFieldTemplate(_ref) {
|
|
|
173
183
|
labelAlign = _formContext$labelAli === void 0 ? "right" : _formContext$labelAli,
|
|
174
184
|
_formContext$rowGutte = formContext.rowGutter,
|
|
175
185
|
rowGutter = _formContext$rowGutte === void 0 ? 24 : _formContext$rowGutte;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
186
|
+
return /*#__PURE__*/React__default["default"].createElement(context.ConfigConsumer, null, function (configProps) {
|
|
187
|
+
var getPrefixCls = configProps.getPrefixCls;
|
|
188
|
+
var prefixCls = getPrefixCls("form");
|
|
189
|
+
var labelClsBasic = prefixCls + "-item-label";
|
|
190
|
+
var labelColClassName = classNames__default["default"](labelClsBasic, labelAlign === "left" && labelClsBasic + "-left"
|
|
191
|
+
// labelCol.className,
|
|
192
|
+
);
|
|
180
193
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
})(ArrayFieldTemplate);
|
|
194
|
+
return /*#__PURE__*/React__default["default"].createElement("fieldset", {
|
|
195
|
+
className: className,
|
|
196
|
+
id: idSchema.$id
|
|
197
|
+
}, /*#__PURE__*/React__default["default"].createElement(Row__default["default"], {
|
|
198
|
+
gutter: rowGutter
|
|
199
|
+
}, (uiOptions.title || title) && /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
200
|
+
className: labelColClassName,
|
|
201
|
+
span: 24
|
|
202
|
+
}, /*#__PURE__*/React__default["default"].createElement(ArrayFieldTitleTemplate, {
|
|
203
|
+
idSchema: idSchema,
|
|
204
|
+
required: required,
|
|
205
|
+
title: uiOptions.title || title,
|
|
206
|
+
schema: schema,
|
|
207
|
+
uiSchema: uiSchema,
|
|
208
|
+
registry: registry
|
|
209
|
+
})), (uiOptions.description || schema.description) && /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
210
|
+
span: 24,
|
|
211
|
+
style: DESCRIPTION_COL_STYLE$1
|
|
212
|
+
}, /*#__PURE__*/React__default["default"].createElement(ArrayFieldDescriptionTemplate, {
|
|
213
|
+
description: uiOptions.description || schema.description || "",
|
|
214
|
+
idSchema: idSchema,
|
|
215
|
+
schema: schema,
|
|
216
|
+
uiSchema: uiSchema,
|
|
217
|
+
registry: registry
|
|
218
|
+
})), /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
219
|
+
className: "row array-item-list",
|
|
220
|
+
span: 24
|
|
221
|
+
}, items && items.map(function (_ref) {
|
|
222
|
+
var key = _ref.key,
|
|
223
|
+
itemProps = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
224
|
+
return /*#__PURE__*/React__default["default"].createElement(ArrayFieldItemTemplate, _extends({
|
|
225
|
+
key: key
|
|
226
|
+
}, itemProps));
|
|
227
|
+
})), canAdd && /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
228
|
+
span: 24
|
|
229
|
+
}, /*#__PURE__*/React__default["default"].createElement(Row__default["default"], {
|
|
230
|
+
gutter: rowGutter,
|
|
231
|
+
justify: "end"
|
|
232
|
+
}, /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
233
|
+
flex: "192px"
|
|
234
|
+
}, /*#__PURE__*/React__default["default"].createElement(AddButton, {
|
|
235
|
+
className: "array-item-add",
|
|
236
|
+
disabled: disabled || readonly,
|
|
237
|
+
onClick: onAddClick,
|
|
238
|
+
uiSchema: uiSchema,
|
|
239
|
+
registry: registry
|
|
240
|
+
}))))));
|
|
241
|
+
});
|
|
242
|
+
}
|
|
231
243
|
|
|
232
244
|
var INPUT_STYLE$2 = {
|
|
233
245
|
width: "100%"
|
|
234
246
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
248
|
+
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
|
|
249
|
+
* It can be customized/overridden for other themes or individual implementations as needed.
|
|
250
|
+
*
|
|
251
|
+
* @param props - The `WidgetProps` for this template
|
|
252
|
+
*/
|
|
253
|
+
function BaseInputTemplate(props) {
|
|
254
|
+
var disabled = props.disabled,
|
|
255
|
+
formContext = props.formContext,
|
|
256
|
+
id = props.id,
|
|
257
|
+
onBlur = props.onBlur,
|
|
258
|
+
onChange = props.onChange,
|
|
259
|
+
onFocus = props.onFocus,
|
|
260
|
+
options = props.options,
|
|
261
|
+
placeholder = props.placeholder,
|
|
262
|
+
readonly = props.readonly,
|
|
263
|
+
schema = props.schema,
|
|
264
|
+
value = props.value,
|
|
265
|
+
type = props.type;
|
|
248
266
|
var inputProps = utils.getInputProps(schema, type, options, false);
|
|
249
267
|
var _formContext$readonly = formContext.readonlyAsDisabled,
|
|
250
268
|
readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
|
|
251
269
|
var handleNumberChange = function handleNumberChange(nextValue) {
|
|
252
270
|
return onChange(nextValue);
|
|
253
271
|
};
|
|
254
|
-
var handleTextChange = function handleTextChange(
|
|
255
|
-
var target =
|
|
272
|
+
var handleTextChange = function handleTextChange(_ref) {
|
|
273
|
+
var target = _ref.target;
|
|
256
274
|
return onChange(target.value === "" ? options.emptyValue : target.value);
|
|
257
275
|
};
|
|
258
|
-
var handleBlur = function handleBlur(
|
|
259
|
-
var target =
|
|
276
|
+
var handleBlur = function handleBlur(_ref2) {
|
|
277
|
+
var target = _ref2.target;
|
|
260
278
|
return onBlur(id, target.value);
|
|
261
279
|
};
|
|
262
|
-
var handleFocus = function handleFocus(
|
|
263
|
-
var target =
|
|
280
|
+
var handleFocus = function handleFocus(_ref3) {
|
|
281
|
+
var target = _ref3.target;
|
|
264
282
|
return onFocus(id, target.value);
|
|
265
283
|
};
|
|
266
284
|
var input = inputProps.type === "number" || inputProps.type === "integer" ? /*#__PURE__*/React__default["default"].createElement(InputNumber__default["default"], _extends({
|
|
@@ -296,20 +314,28 @@ var BaseInputTemplate = function BaseInputTemplate(_ref) {
|
|
|
296
314
|
value: example
|
|
297
315
|
});
|
|
298
316
|
})));
|
|
299
|
-
}
|
|
317
|
+
}
|
|
300
318
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
319
|
+
/** The `DescriptionField` is the template to use to render the description of a field
|
|
320
|
+
*
|
|
321
|
+
* @param props - The `DescriptionFieldProps` for this component
|
|
322
|
+
*/
|
|
323
|
+
function DescriptionField(props) {
|
|
324
|
+
var id = props.id,
|
|
325
|
+
description = props.description;
|
|
304
326
|
if (!description) {
|
|
305
327
|
return null;
|
|
306
328
|
}
|
|
307
329
|
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
308
330
|
id: id
|
|
309
331
|
}, description);
|
|
310
|
-
}
|
|
332
|
+
}
|
|
311
333
|
|
|
312
|
-
|
|
334
|
+
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
335
|
+
*
|
|
336
|
+
* @param props - The `ErrorListProps` for this component
|
|
337
|
+
*/
|
|
338
|
+
function ErrorList(_ref) {
|
|
313
339
|
var errors = _ref.errors;
|
|
314
340
|
var renderErrors = function renderErrors() {
|
|
315
341
|
return /*#__PURE__*/React__default["default"].createElement(List__default["default"], {
|
|
@@ -327,9 +353,9 @@ var ErrorList = function ErrorList(_ref) {
|
|
|
327
353
|
message: "Errors",
|
|
328
354
|
type: "error"
|
|
329
355
|
});
|
|
330
|
-
}
|
|
356
|
+
}
|
|
331
357
|
|
|
332
|
-
var _excluded = ["iconType", "icon", "uiSchema"];
|
|
358
|
+
var _excluded = ["iconType", "icon", "uiSchema", "registry"];
|
|
333
359
|
function IconButton(props) {
|
|
334
360
|
var _props$iconType = props.iconType,
|
|
335
361
|
iconType = _props$iconType === void 0 ? "default" : _props$iconType,
|
|
@@ -403,28 +429,33 @@ var VERTICAL_LABEL_COL$1 = {
|
|
|
403
429
|
var VERTICAL_WRAPPER_COL$1 = {
|
|
404
430
|
span: 24
|
|
405
431
|
};
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
432
|
+
/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
|
|
433
|
+
* content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
|
|
434
|
+
*
|
|
435
|
+
* @param props - The `FieldTemplateProps` for this component
|
|
436
|
+
*/
|
|
437
|
+
function FieldTemplate(props) {
|
|
438
|
+
var children = props.children,
|
|
439
|
+
classNames = props.classNames,
|
|
440
|
+
description = props.description,
|
|
441
|
+
disabled = props.disabled,
|
|
442
|
+
displayLabel = props.displayLabel,
|
|
443
|
+
errors = props.errors,
|
|
444
|
+
formContext = props.formContext,
|
|
445
|
+
help = props.help,
|
|
446
|
+
hidden = props.hidden,
|
|
447
|
+
id = props.id,
|
|
448
|
+
label = props.label,
|
|
449
|
+
onDropPropertyClick = props.onDropPropertyClick,
|
|
450
|
+
onKeyChange = props.onKeyChange,
|
|
451
|
+
rawErrors = props.rawErrors,
|
|
452
|
+
rawDescription = props.rawDescription,
|
|
453
|
+
rawHelp = props.rawHelp,
|
|
454
|
+
readonly = props.readonly,
|
|
455
|
+
registry = props.registry,
|
|
456
|
+
required = props.required,
|
|
457
|
+
schema = props.schema,
|
|
458
|
+
uiSchema = props.uiSchema;
|
|
428
459
|
var colon = formContext.colon,
|
|
429
460
|
_formContext$labelCol = formContext.labelCol,
|
|
430
461
|
labelCol = _formContext$labelCol === void 0 ? VERTICAL_LABEL_COL$1 : _formContext$labelCol,
|
|
@@ -463,26 +494,31 @@ var FieldTemplate = function FieldTemplate(_ref) {
|
|
|
463
494
|
validateStatus: rawErrors !== null && rawErrors !== void 0 && rawErrors.length ? "error" : undefined,
|
|
464
495
|
wrapperCol: wrapperCol
|
|
465
496
|
}, children));
|
|
466
|
-
}
|
|
497
|
+
}
|
|
467
498
|
|
|
468
499
|
var DESCRIPTION_COL_STYLE = {
|
|
469
500
|
paddingBottom: "8px"
|
|
470
501
|
};
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
502
|
+
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
|
|
503
|
+
* title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
|
|
504
|
+
* the properties.
|
|
505
|
+
*
|
|
506
|
+
* @param props - The `ObjectFieldTemplateProps` for this component
|
|
507
|
+
*/
|
|
508
|
+
function ObjectFieldTemplate(props) {
|
|
509
|
+
var description = props.description,
|
|
510
|
+
disabled = props.disabled,
|
|
511
|
+
formContext = props.formContext,
|
|
512
|
+
formData = props.formData,
|
|
513
|
+
idSchema = props.idSchema,
|
|
514
|
+
onAddClick = props.onAddClick,
|
|
515
|
+
properties = props.properties,
|
|
516
|
+
readonly = props.readonly,
|
|
517
|
+
required = props.required,
|
|
518
|
+
registry = props.registry,
|
|
519
|
+
schema = props.schema,
|
|
520
|
+
title = props.title,
|
|
521
|
+
uiSchema = props.uiSchema;
|
|
486
522
|
var uiOptions = utils.getUiOptions(uiSchema);
|
|
487
523
|
var TitleFieldTemplate = utils.getTemplate("TitleFieldTemplate", registry, uiOptions);
|
|
488
524
|
var DescriptionFieldTemplate = utils.getTemplate("DescriptionFieldTemplate", registry, uiOptions);
|
|
@@ -494,11 +530,6 @@ var ObjectFieldTemplate = function ObjectFieldTemplate(_ref) {
|
|
|
494
530
|
labelAlign = _formContext$labelAli === void 0 ? "right" : _formContext$labelAli,
|
|
495
531
|
_formContext$rowGutte = formContext.rowGutter,
|
|
496
532
|
rowGutter = _formContext$rowGutte === void 0 ? 24 : _formContext$rowGutte;
|
|
497
|
-
var labelClsBasic = prefixCls + "-item-label";
|
|
498
|
-
var labelColClassName = classNames__default["default"](labelClsBasic, labelAlign === "left" && labelClsBasic + "-left"
|
|
499
|
-
// labelCol.className,
|
|
500
|
-
);
|
|
501
|
-
|
|
502
533
|
var findSchema = function findSchema(element) {
|
|
503
534
|
return element.content.props.schema;
|
|
504
535
|
};
|
|
@@ -538,55 +569,64 @@ var ObjectFieldTemplate = function ObjectFieldTemplate(_ref) {
|
|
|
538
569
|
}
|
|
539
570
|
return defaultColSpan;
|
|
540
571
|
};
|
|
541
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
className
|
|
547
|
-
|
|
548
|
-
}, /*#__PURE__*/React__default["default"].createElement(TitleFieldTemplate, {
|
|
549
|
-
id: idSchema.$id + "-title",
|
|
550
|
-
required: required,
|
|
551
|
-
title: uiOptions.title || title,
|
|
552
|
-
schema: schema,
|
|
553
|
-
uiSchema: uiSchema,
|
|
554
|
-
registry: registry
|
|
555
|
-
})), (uiOptions.description || description) && /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
556
|
-
span: 24,
|
|
557
|
-
style: DESCRIPTION_COL_STYLE
|
|
558
|
-
}, /*#__PURE__*/React__default["default"].createElement(DescriptionFieldTemplate, {
|
|
559
|
-
description: uiOptions.description || description,
|
|
560
|
-
id: idSchema.$id + "-description",
|
|
561
|
-
schema: schema,
|
|
562
|
-
uiSchema: uiSchema,
|
|
563
|
-
registry: registry
|
|
564
|
-
})), properties.filter(function (e) {
|
|
565
|
-
return !e.hidden;
|
|
566
|
-
}).map(function (element) {
|
|
567
|
-
return /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
568
|
-
key: element.name,
|
|
569
|
-
span: calculateColSpan(element)
|
|
570
|
-
}, element.content);
|
|
571
|
-
})), utils.canExpand(schema, uiSchema, formData) && /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
572
|
-
span: 24
|
|
573
|
-
}, /*#__PURE__*/React__default["default"].createElement(Row__default["default"], {
|
|
574
|
-
gutter: rowGutter,
|
|
575
|
-
justify: "end"
|
|
576
|
-
}, /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
577
|
-
flex: "192px"
|
|
578
|
-
}, /*#__PURE__*/React__default["default"].createElement(AddButton, {
|
|
579
|
-
className: "object-property-expand",
|
|
580
|
-
disabled: disabled || readonly,
|
|
581
|
-
onClick: onAddClick(schema),
|
|
582
|
-
uiSchema: uiSchema
|
|
583
|
-
})))));
|
|
584
|
-
};
|
|
585
|
-
var ObjectFieldTemplate$1 = /*#__PURE__*/context.withConfigConsumer({
|
|
586
|
-
prefixCls: "form"
|
|
587
|
-
})(ObjectFieldTemplate);
|
|
572
|
+
return /*#__PURE__*/React__default["default"].createElement(context.ConfigConsumer, null, function (configProps) {
|
|
573
|
+
var getPrefixCls = configProps.getPrefixCls;
|
|
574
|
+
var prefixCls = getPrefixCls("form");
|
|
575
|
+
var labelClsBasic = prefixCls + "-item-label";
|
|
576
|
+
var labelColClassName = classNames__default["default"](labelClsBasic, labelAlign === "left" && labelClsBasic + "-left"
|
|
577
|
+
// labelCol.className,
|
|
578
|
+
);
|
|
588
579
|
|
|
589
|
-
|
|
580
|
+
return /*#__PURE__*/React__default["default"].createElement("fieldset", {
|
|
581
|
+
id: idSchema.$id
|
|
582
|
+
}, /*#__PURE__*/React__default["default"].createElement(Row__default["default"], {
|
|
583
|
+
gutter: rowGutter
|
|
584
|
+
}, (uiOptions.title || title) && /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
585
|
+
className: labelColClassName,
|
|
586
|
+
span: 24
|
|
587
|
+
}, /*#__PURE__*/React__default["default"].createElement(TitleFieldTemplate, {
|
|
588
|
+
id: idSchema.$id + "-title",
|
|
589
|
+
required: required,
|
|
590
|
+
title: uiOptions.title || title,
|
|
591
|
+
schema: schema,
|
|
592
|
+
uiSchema: uiSchema,
|
|
593
|
+
registry: registry
|
|
594
|
+
})), (uiOptions.description || description) && /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
595
|
+
span: 24,
|
|
596
|
+
style: DESCRIPTION_COL_STYLE
|
|
597
|
+
}, /*#__PURE__*/React__default["default"].createElement(DescriptionFieldTemplate, {
|
|
598
|
+
description: uiOptions.description || description,
|
|
599
|
+
id: idSchema.$id + "-description",
|
|
600
|
+
schema: schema,
|
|
601
|
+
uiSchema: uiSchema,
|
|
602
|
+
registry: registry
|
|
603
|
+
})), properties.filter(function (e) {
|
|
604
|
+
return !e.hidden;
|
|
605
|
+
}).map(function (element) {
|
|
606
|
+
return /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
607
|
+
key: element.name,
|
|
608
|
+
span: calculateColSpan(element)
|
|
609
|
+
}, element.content);
|
|
610
|
+
})), utils.canExpand(schema, uiSchema, formData) && /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
611
|
+
span: 24
|
|
612
|
+
}, /*#__PURE__*/React__default["default"].createElement(Row__default["default"], {
|
|
613
|
+
gutter: rowGutter,
|
|
614
|
+
justify: "end"
|
|
615
|
+
}, /*#__PURE__*/React__default["default"].createElement(Col__default["default"], {
|
|
616
|
+
flex: "192px"
|
|
617
|
+
}, /*#__PURE__*/React__default["default"].createElement(AddButton, {
|
|
618
|
+
className: "object-property-expand",
|
|
619
|
+
disabled: disabled || readonly,
|
|
620
|
+
onClick: onAddClick(schema),
|
|
621
|
+
uiSchema: uiSchema,
|
|
622
|
+
registry: registry
|
|
623
|
+
})))));
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/** The `SubmitButton` renders a button that represent the `Submit` action on a form
|
|
628
|
+
*/
|
|
629
|
+
function SubmitButton(_ref) {
|
|
590
630
|
var uiSchema = _ref.uiSchema;
|
|
591
631
|
var _getSubmitButtonOptio = utils.getSubmitButtonOptions(uiSchema),
|
|
592
632
|
submitText = _getSubmitButtonOptio.submitText,
|
|
@@ -600,25 +640,24 @@ var SubmitButton = (function (_ref) {
|
|
|
600
640
|
}, submitButtonProps, {
|
|
601
641
|
htmlType: "submit"
|
|
602
642
|
}), submitText);
|
|
603
|
-
}
|
|
643
|
+
}
|
|
604
644
|
|
|
605
|
-
|
|
606
|
-
|
|
645
|
+
/** The `TitleField` is the template to use to render the title of a field
|
|
646
|
+
*
|
|
647
|
+
* @param props - The `TitleFieldProps` for this component
|
|
648
|
+
*/
|
|
649
|
+
function TitleField(_ref) {
|
|
607
650
|
var id = _ref.id,
|
|
608
|
-
prefixCls = _ref.prefixCls,
|
|
609
651
|
required = _ref.required,
|
|
610
652
|
registry = _ref.registry,
|
|
611
|
-
formContext1 = _ref.formContext,
|
|
612
653
|
title = _ref.title;
|
|
613
654
|
var formContext = registry.formContext;
|
|
614
|
-
var
|
|
615
|
-
|
|
616
|
-
colon = _formContext1$formCon2 === void 0 ? true : _formContext1$formCon2;
|
|
655
|
+
var _formContext$colon = formContext.colon,
|
|
656
|
+
colon = _formContext$colon === void 0 ? true : _formContext$colon;
|
|
617
657
|
var labelChildren = title;
|
|
618
658
|
if (colon && typeof title === "string" && title.trim() !== "") {
|
|
619
659
|
labelChildren = title.replace(/[::]\s*$/, "");
|
|
620
660
|
}
|
|
621
|
-
var labelClassName = classNames__default["default"]((_classNames = {}, _classNames[prefixCls + "-item-required"] = required, _classNames[prefixCls + "-item-no-colon"] = !colon, _classNames));
|
|
622
661
|
var handleLabelClick = function handleLabelClick() {
|
|
623
662
|
if (!id) {
|
|
624
663
|
return;
|
|
@@ -628,19 +667,19 @@ var TitleField = function TitleField(_ref) {
|
|
|
628
667
|
control.focus();
|
|
629
668
|
}
|
|
630
669
|
};
|
|
631
|
-
return title ? /*#__PURE__*/React__default["default"].createElement(
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
}
|
|
670
|
+
return title ? /*#__PURE__*/React__default["default"].createElement(context.ConfigConsumer, null, function (configProps) {
|
|
671
|
+
var _classNames;
|
|
672
|
+
var getPrefixCls = configProps.getPrefixCls;
|
|
673
|
+
var prefixCls = getPrefixCls("form");
|
|
674
|
+
var labelClassName = classNames__default["default"]((_classNames = {}, _classNames[prefixCls + "-item-required"] = required, _classNames[prefixCls + "-item-no-colon"] = !colon, _classNames));
|
|
675
|
+
return /*#__PURE__*/React__default["default"].createElement("label", {
|
|
676
|
+
className: labelClassName,
|
|
677
|
+
htmlFor: id,
|
|
678
|
+
onClick: handleLabelClick,
|
|
679
|
+
title: typeof title === "string" ? title : ""
|
|
680
|
+
}, labelChildren);
|
|
681
|
+
}) : null;
|
|
682
|
+
}
|
|
644
683
|
|
|
645
684
|
var VERTICAL_LABEL_COL = {
|
|
646
685
|
span: 24
|
|
@@ -651,20 +690,25 @@ var VERTICAL_WRAPPER_COL = {
|
|
|
651
690
|
var INPUT_STYLE$1 = {
|
|
652
691
|
width: "100%"
|
|
653
692
|
};
|
|
654
|
-
|
|
693
|
+
/** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
|
|
694
|
+
* part of an `additionalProperties` part of a schema.
|
|
695
|
+
*
|
|
696
|
+
* @param props - The `WrapIfAdditionalProps` for this component
|
|
697
|
+
*/
|
|
698
|
+
function WrapIfAdditionalTemplate(props) {
|
|
655
699
|
var _extends2;
|
|
656
|
-
var children =
|
|
657
|
-
classNames =
|
|
658
|
-
disabled =
|
|
659
|
-
id =
|
|
660
|
-
label =
|
|
661
|
-
onDropPropertyClick =
|
|
662
|
-
onKeyChange =
|
|
663
|
-
readonly =
|
|
664
|
-
required =
|
|
665
|
-
registry =
|
|
666
|
-
schema =
|
|
667
|
-
uiSchema =
|
|
700
|
+
var children = props.children,
|
|
701
|
+
classNames = props.classNames,
|
|
702
|
+
disabled = props.disabled,
|
|
703
|
+
id = props.id,
|
|
704
|
+
label = props.label,
|
|
705
|
+
onDropPropertyClick = props.onDropPropertyClick,
|
|
706
|
+
onKeyChange = props.onKeyChange,
|
|
707
|
+
readonly = props.readonly,
|
|
708
|
+
required = props.required,
|
|
709
|
+
registry = props.registry,
|
|
710
|
+
schema = props.schema,
|
|
711
|
+
uiSchema = props.uiSchema;
|
|
668
712
|
var _registry$formContext = registry.formContext,
|
|
669
713
|
colon = _registry$formContext.colon,
|
|
670
714
|
_registry$formContext2 = _registry$formContext.labelCol,
|
|
@@ -687,8 +731,8 @@ var WrapIfAdditionalTemplate = function WrapIfAdditionalTemplate(_ref) {
|
|
|
687
731
|
className: classNames
|
|
688
732
|
}, children);
|
|
689
733
|
}
|
|
690
|
-
var handleBlur = function handleBlur(
|
|
691
|
-
var target =
|
|
734
|
+
var handleBlur = function handleBlur(_ref) {
|
|
735
|
+
var target = _ref.target;
|
|
692
736
|
return onKeyChange(target.value);
|
|
693
737
|
};
|
|
694
738
|
// The `block` prop is not part of the `IconButtonProps` defined in the template, so put it into the uiSchema instead
|
|
@@ -734,29 +778,33 @@ var WrapIfAdditionalTemplate = function WrapIfAdditionalTemplate(_ref) {
|
|
|
734
778
|
className: "array-item-remove",
|
|
735
779
|
disabled: disabled || readonly,
|
|
736
780
|
onClick: onDropPropertyClick(label),
|
|
737
|
-
uiSchema: buttonUiOptions
|
|
781
|
+
uiSchema: buttonUiOptions,
|
|
782
|
+
registry: registry
|
|
738
783
|
}))));
|
|
739
|
-
}
|
|
784
|
+
}
|
|
740
785
|
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
786
|
+
function generateTemplates() {
|
|
787
|
+
return {
|
|
788
|
+
ArrayFieldItemTemplate: ArrayFieldItemTemplate,
|
|
789
|
+
ArrayFieldTemplate: ArrayFieldTemplate,
|
|
790
|
+
BaseInputTemplate: BaseInputTemplate,
|
|
791
|
+
ButtonTemplates: {
|
|
792
|
+
AddButton: AddButton,
|
|
793
|
+
MoveDownButton: MoveDownButton,
|
|
794
|
+
MoveUpButton: MoveUpButton,
|
|
795
|
+
RemoveButton: RemoveButton,
|
|
796
|
+
SubmitButton: SubmitButton
|
|
797
|
+
},
|
|
798
|
+
DescriptionFieldTemplate: DescriptionField,
|
|
799
|
+
ErrorListTemplate: ErrorList,
|
|
800
|
+
FieldErrorTemplate: FieldErrorTemplate,
|
|
801
|
+
FieldTemplate: FieldTemplate,
|
|
802
|
+
ObjectFieldTemplate: ObjectFieldTemplate,
|
|
803
|
+
TitleFieldTemplate: TitleField,
|
|
804
|
+
WrapIfAdditionalTemplate: WrapIfAdditionalTemplate
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
var index$1 = /*#__PURE__*/generateTemplates();
|
|
760
808
|
|
|
761
809
|
var rangeOptions = function rangeOptions(start, stop) {
|
|
762
810
|
var options = [];
|
|
@@ -813,19 +861,19 @@ function dateElementProps(state, time, yearsRange) {
|
|
|
813
861
|
}
|
|
814
862
|
return data;
|
|
815
863
|
}
|
|
816
|
-
|
|
817
|
-
var autofocus =
|
|
818
|
-
disabled =
|
|
819
|
-
formContext =
|
|
820
|
-
id =
|
|
821
|
-
onBlur =
|
|
822
|
-
onChange =
|
|
823
|
-
onFocus =
|
|
824
|
-
options =
|
|
825
|
-
readonly =
|
|
826
|
-
registry =
|
|
827
|
-
showTime =
|
|
828
|
-
value =
|
|
864
|
+
function AltDateWidget(props) {
|
|
865
|
+
var autofocus = props.autofocus,
|
|
866
|
+
disabled = props.disabled,
|
|
867
|
+
formContext = props.formContext,
|
|
868
|
+
id = props.id,
|
|
869
|
+
onBlur = props.onBlur,
|
|
870
|
+
onChange = props.onChange,
|
|
871
|
+
onFocus = props.onFocus,
|
|
872
|
+
options = props.options,
|
|
873
|
+
readonly = props.readonly,
|
|
874
|
+
registry = props.registry,
|
|
875
|
+
showTime = props.showTime,
|
|
876
|
+
value = props.value;
|
|
829
877
|
var SelectWidget = registry.widgets.SelectWidget;
|
|
830
878
|
var _formContext$rowGutte = formContext.rowGutter,
|
|
831
879
|
rowGutter = _formContext$rowGutte === void 0 ? 24 : _formContext$rowGutte;
|
|
@@ -921,7 +969,7 @@ var AltDateWidget = function AltDateWidget(_ref) {
|
|
|
921
969
|
onClick: handleClear,
|
|
922
970
|
type: "primary"
|
|
923
971
|
}, "Clear")));
|
|
924
|
-
}
|
|
972
|
+
}
|
|
925
973
|
AltDateWidget.defaultProps = {
|
|
926
974
|
autofocus: false,
|
|
927
975
|
disabled: false,
|
|
@@ -932,17 +980,22 @@ AltDateWidget.defaultProps = {
|
|
|
932
980
|
showTime: false
|
|
933
981
|
};
|
|
934
982
|
|
|
935
|
-
|
|
983
|
+
function AltDateTimeWidget(props) {
|
|
936
984
|
var AltDateWidget = props.registry.widgets.AltDateWidget;
|
|
937
985
|
return /*#__PURE__*/React__default["default"].createElement(AltDateWidget, _extends({
|
|
938
986
|
showTime: true
|
|
939
987
|
}, props));
|
|
940
|
-
}
|
|
988
|
+
}
|
|
941
989
|
AltDateTimeWidget.defaultProps = /*#__PURE__*/_extends({}, AltDateWidget.defaultProps, {
|
|
942
990
|
showTime: true
|
|
943
991
|
});
|
|
944
992
|
|
|
945
|
-
|
|
993
|
+
/** The `CheckboxesWidget` is a widget for rendering checkbox groups.
|
|
994
|
+
* It is typically used to represent an array of enums.
|
|
995
|
+
*
|
|
996
|
+
* @param props - The `WidgetProps` for this component
|
|
997
|
+
*/
|
|
998
|
+
function CheckboxesWidget(_ref) {
|
|
946
999
|
var autofocus = _ref.autofocus,
|
|
947
1000
|
disabled = _ref.disabled,
|
|
948
1001
|
formContext = _ref.formContext,
|
|
@@ -994,31 +1047,36 @@ var CheckboxesWidget = function CheckboxesWidget(_ref) {
|
|
|
994
1047
|
value: optionValue
|
|
995
1048
|
}, optionLabel), !inline && /*#__PURE__*/React__default["default"].createElement("br", null));
|
|
996
1049
|
})) : null;
|
|
997
|
-
}
|
|
1050
|
+
}
|
|
998
1051
|
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1052
|
+
/** The `CheckBoxWidget` is a widget for rendering boolean properties.
|
|
1053
|
+
* It is typically used to represent a boolean.
|
|
1054
|
+
*
|
|
1055
|
+
* @param props - The `WidgetProps` for this component
|
|
1056
|
+
*/
|
|
1057
|
+
function CheckboxWidget(props) {
|
|
1058
|
+
var autofocus = props.autofocus,
|
|
1059
|
+
disabled = props.disabled,
|
|
1060
|
+
formContext = props.formContext,
|
|
1061
|
+
id = props.id,
|
|
1062
|
+
label = props.label,
|
|
1063
|
+
onBlur = props.onBlur,
|
|
1064
|
+
onChange = props.onChange,
|
|
1065
|
+
onFocus = props.onFocus,
|
|
1066
|
+
readonly = props.readonly,
|
|
1067
|
+
value = props.value;
|
|
1010
1068
|
var _formContext$readonly = formContext.readonlyAsDisabled,
|
|
1011
1069
|
readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
|
|
1012
|
-
var handleChange = function handleChange(
|
|
1013
|
-
var target =
|
|
1070
|
+
var handleChange = function handleChange(_ref) {
|
|
1071
|
+
var target = _ref.target;
|
|
1014
1072
|
return onChange(target.checked);
|
|
1015
1073
|
};
|
|
1016
|
-
var handleBlur = function handleBlur(
|
|
1017
|
-
var target =
|
|
1074
|
+
var handleBlur = function handleBlur(_ref2) {
|
|
1075
|
+
var target = _ref2.target;
|
|
1018
1076
|
return onBlur(id, target.checked);
|
|
1019
1077
|
};
|
|
1020
|
-
var handleFocus = function handleFocus(
|
|
1021
|
-
var target =
|
|
1078
|
+
var handleFocus = function handleFocus(_ref3) {
|
|
1079
|
+
var target = _ref3.target;
|
|
1022
1080
|
return onFocus(id, target.checked);
|
|
1023
1081
|
};
|
|
1024
1082
|
// Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
|
|
@@ -1035,23 +1093,28 @@ var CheckboxWidget = function CheckboxWidget(_ref) {
|
|
|
1035
1093
|
name: id,
|
|
1036
1094
|
onChange: !readonly ? handleChange : undefined
|
|
1037
1095
|
}, extraProps), label);
|
|
1038
|
-
}
|
|
1096
|
+
}
|
|
1039
1097
|
|
|
1040
1098
|
var DatePicker = /*#__PURE__*/generatePicker__default["default"](dayjsGenerateConfig__default["default"]);
|
|
1041
1099
|
|
|
1042
1100
|
var DATE_PICKER_STYLE$1 = {
|
|
1043
1101
|
width: "100%"
|
|
1044
1102
|
};
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1103
|
+
/** The `DateTimeWidget` component uses the `BaseInputTemplate` changing the type to `datetime-local` and transforms
|
|
1104
|
+
* the value to/from utc using the appropriate utility functions.
|
|
1105
|
+
*
|
|
1106
|
+
* @param props - The `WidgetProps` for this component
|
|
1107
|
+
*/
|
|
1108
|
+
function DateTimeWidget(props) {
|
|
1109
|
+
var disabled = props.disabled,
|
|
1110
|
+
formContext = props.formContext,
|
|
1111
|
+
id = props.id,
|
|
1112
|
+
onBlur = props.onBlur,
|
|
1113
|
+
onChange = props.onChange,
|
|
1114
|
+
onFocus = props.onFocus,
|
|
1115
|
+
placeholder = props.placeholder,
|
|
1116
|
+
readonly = props.readonly,
|
|
1117
|
+
value = props.value;
|
|
1055
1118
|
var _formContext$readonly = formContext.readonlyAsDisabled,
|
|
1056
1119
|
readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
|
|
1057
1120
|
var handleChange = function handleChange(nextValue) {
|
|
@@ -1079,21 +1142,26 @@ var DateTimeWidget = function DateTimeWidget(_ref) {
|
|
|
1079
1142
|
style: DATE_PICKER_STYLE$1,
|
|
1080
1143
|
value: value && dayjs__default["default"](value)
|
|
1081
1144
|
});
|
|
1082
|
-
}
|
|
1145
|
+
}
|
|
1083
1146
|
|
|
1084
1147
|
var DATE_PICKER_STYLE = {
|
|
1085
1148
|
width: "100%"
|
|
1086
1149
|
};
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1150
|
+
/** The `DateWidget` component uses the `BaseInputTemplate` changing the type to `date` and transforms
|
|
1151
|
+
* the value to undefined when it is falsy during the `onChange` handling.
|
|
1152
|
+
*
|
|
1153
|
+
* @param props - The `WidgetProps` for this component
|
|
1154
|
+
*/
|
|
1155
|
+
function DateWidget(props) {
|
|
1156
|
+
var disabled = props.disabled,
|
|
1157
|
+
formContext = props.formContext,
|
|
1158
|
+
id = props.id,
|
|
1159
|
+
onBlur = props.onBlur,
|
|
1160
|
+
onChange = props.onChange,
|
|
1161
|
+
onFocus = props.onFocus,
|
|
1162
|
+
placeholder = props.placeholder,
|
|
1163
|
+
readonly = props.readonly,
|
|
1164
|
+
value = props.value;
|
|
1097
1165
|
var _formContext$readonly = formContext.readonlyAsDisabled,
|
|
1098
1166
|
readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
|
|
1099
1167
|
var handleChange = function handleChange(nextValue) {
|
|
@@ -1121,32 +1189,36 @@ var DateWidget = function DateWidget(_ref) {
|
|
|
1121
1189
|
style: DATE_PICKER_STYLE,
|
|
1122
1190
|
value: value && dayjs__default["default"](value)
|
|
1123
1191
|
});
|
|
1124
|
-
}
|
|
1192
|
+
}
|
|
1125
1193
|
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1194
|
+
/** The `PasswordWidget` component uses the `BaseInputTemplate` changing the type to `password`.
|
|
1195
|
+
*
|
|
1196
|
+
* @param props - The `WidgetProps` for this component
|
|
1197
|
+
*/
|
|
1198
|
+
function PasswordWidget(props) {
|
|
1199
|
+
var disabled = props.disabled,
|
|
1200
|
+
formContext = props.formContext,
|
|
1201
|
+
id = props.id,
|
|
1202
|
+
onBlur = props.onBlur,
|
|
1203
|
+
onChange = props.onChange,
|
|
1204
|
+
onFocus = props.onFocus,
|
|
1205
|
+
options = props.options,
|
|
1206
|
+
placeholder = props.placeholder,
|
|
1207
|
+
readonly = props.readonly,
|
|
1208
|
+
value = props.value;
|
|
1137
1209
|
var _formContext$readonly = formContext.readonlyAsDisabled,
|
|
1138
1210
|
readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
|
|
1139
1211
|
var emptyValue = options.emptyValue || "";
|
|
1140
|
-
var handleChange = function handleChange(
|
|
1141
|
-
var target =
|
|
1212
|
+
var handleChange = function handleChange(_ref) {
|
|
1213
|
+
var target = _ref.target;
|
|
1142
1214
|
return onChange(target.value === "" ? emptyValue : target.value);
|
|
1143
1215
|
};
|
|
1144
|
-
var handleBlur = function handleBlur(
|
|
1145
|
-
var target =
|
|
1216
|
+
var handleBlur = function handleBlur(_ref2) {
|
|
1217
|
+
var target = _ref2.target;
|
|
1146
1218
|
return onBlur(id, target.value);
|
|
1147
1219
|
};
|
|
1148
|
-
var handleFocus = function handleFocus(
|
|
1149
|
-
var target =
|
|
1220
|
+
var handleFocus = function handleFocus(_ref3) {
|
|
1221
|
+
var target = _ref3.target;
|
|
1150
1222
|
return onFocus(id, target.value);
|
|
1151
1223
|
};
|
|
1152
1224
|
return /*#__PURE__*/React__default["default"].createElement(Input__default["default"].Password, {
|
|
@@ -1159,9 +1231,14 @@ var PasswordWidget = function PasswordWidget(_ref) {
|
|
|
1159
1231
|
placeholder: placeholder,
|
|
1160
1232
|
value: value || ""
|
|
1161
1233
|
});
|
|
1162
|
-
}
|
|
1234
|
+
}
|
|
1163
1235
|
|
|
1164
|
-
|
|
1236
|
+
/** The `RadioWidget` is a widget for rendering a radio group.
|
|
1237
|
+
* It is typically used with a string property constrained with enum options.
|
|
1238
|
+
*
|
|
1239
|
+
* @param props - The `WidgetProps` for this component
|
|
1240
|
+
*/
|
|
1241
|
+
function RadioWidget(_ref) {
|
|
1165
1242
|
var autofocus = _ref.autofocus,
|
|
1166
1243
|
disabled = _ref.disabled,
|
|
1167
1244
|
formContext = _ref.formContext,
|
|
@@ -1209,21 +1286,26 @@ var RadioWidget = function RadioWidget(_ref) {
|
|
|
1209
1286
|
value: "" + optionValue
|
|
1210
1287
|
}, optionLabel);
|
|
1211
1288
|
}));
|
|
1212
|
-
}
|
|
1289
|
+
}
|
|
1213
1290
|
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1291
|
+
/** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
|
|
1292
|
+
* in a div, with the value along side it.
|
|
1293
|
+
*
|
|
1294
|
+
* @param props - The `WidgetProps` for this component
|
|
1295
|
+
*/
|
|
1296
|
+
function RangeWidget(props) {
|
|
1297
|
+
var autofocus = props.autofocus,
|
|
1298
|
+
disabled = props.disabled,
|
|
1299
|
+
formContext = props.formContext,
|
|
1300
|
+
id = props.id,
|
|
1301
|
+
onBlur = props.onBlur,
|
|
1302
|
+
onChange = props.onChange,
|
|
1303
|
+
onFocus = props.onFocus,
|
|
1304
|
+
options = props.options,
|
|
1305
|
+
placeholder = props.placeholder,
|
|
1306
|
+
readonly = props.readonly,
|
|
1307
|
+
schema = props.schema,
|
|
1308
|
+
value = props.value;
|
|
1227
1309
|
var _formContext$readonly = formContext.readonlyAsDisabled,
|
|
1228
1310
|
readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly;
|
|
1229
1311
|
var _rangeSpec = utils.rangeSpec(schema),
|
|
@@ -1258,15 +1340,21 @@ var RangeWidget = function RangeWidget(_ref) {
|
|
|
1258
1340
|
step: step,
|
|
1259
1341
|
value: value
|
|
1260
1342
|
}, extraProps));
|
|
1261
|
-
}
|
|
1343
|
+
}
|
|
1262
1344
|
|
|
1263
1345
|
var SELECT_STYLE = {
|
|
1264
1346
|
width: "100%"
|
|
1265
1347
|
};
|
|
1266
|
-
|
|
1348
|
+
/** The `SelectWidget` is a widget for rendering dropdowns.
|
|
1349
|
+
* It is typically used with string properties constrained with enum options.
|
|
1350
|
+
*
|
|
1351
|
+
* @param props - The `WidgetProps` for this component
|
|
1352
|
+
*/
|
|
1353
|
+
function SelectWidget(_ref) {
|
|
1267
1354
|
var autofocus = _ref.autofocus,
|
|
1268
1355
|
disabled = _ref.disabled,
|
|
1269
|
-
formContext = _ref.formContext,
|
|
1356
|
+
_ref$formContext = _ref.formContext,
|
|
1357
|
+
formContext = _ref$formContext === void 0 ? {} : _ref$formContext,
|
|
1270
1358
|
id = _ref.id,
|
|
1271
1359
|
multiple = _ref.multiple,
|
|
1272
1360
|
onBlur = _ref.onBlur,
|
|
@@ -1322,15 +1410,16 @@ var SelectWidget = function SelectWidget(_ref) {
|
|
|
1322
1410
|
value: String(optionValue)
|
|
1323
1411
|
}, optionLabel);
|
|
1324
1412
|
}));
|
|
1325
|
-
}
|
|
1326
|
-
SelectWidget.defaultProps = {
|
|
1327
|
-
formContext: {}
|
|
1328
|
-
};
|
|
1413
|
+
}
|
|
1329
1414
|
|
|
1330
1415
|
var INPUT_STYLE = {
|
|
1331
1416
|
width: "100%"
|
|
1332
1417
|
};
|
|
1333
|
-
|
|
1418
|
+
/** The `TextareaWidget` is a widget for rendering input fields as textarea.
|
|
1419
|
+
*
|
|
1420
|
+
* @param props - The `WidgetProps` for this component
|
|
1421
|
+
*/
|
|
1422
|
+
function TextareaWidget(_ref) {
|
|
1334
1423
|
var disabled = _ref.disabled,
|
|
1335
1424
|
formContext = _ref.formContext,
|
|
1336
1425
|
id = _ref.id,
|
|
@@ -1372,31 +1461,44 @@ var TextareaWidget = function TextareaWidget(_ref) {
|
|
|
1372
1461
|
style: INPUT_STYLE,
|
|
1373
1462
|
value: value
|
|
1374
1463
|
}, extraProps));
|
|
1375
|
-
}
|
|
1464
|
+
}
|
|
1376
1465
|
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1466
|
+
function generateWidgets() {
|
|
1467
|
+
return {
|
|
1468
|
+
AltDateTimeWidget: AltDateTimeWidget,
|
|
1469
|
+
AltDateWidget: AltDateWidget,
|
|
1470
|
+
CheckboxesWidget: CheckboxesWidget,
|
|
1471
|
+
CheckboxWidget: CheckboxWidget,
|
|
1472
|
+
DateTimeWidget: DateTimeWidget,
|
|
1473
|
+
DateWidget: DateWidget,
|
|
1474
|
+
PasswordWidget: PasswordWidget,
|
|
1475
|
+
RadioWidget: RadioWidget,
|
|
1476
|
+
RangeWidget: RangeWidget,
|
|
1477
|
+
SelectWidget: SelectWidget,
|
|
1478
|
+
TextareaWidget: TextareaWidget
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
var index = /*#__PURE__*/generateWidgets();
|
|
1390
1482
|
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1483
|
+
function generateTheme() {
|
|
1484
|
+
return {
|
|
1485
|
+
templates: generateTemplates(),
|
|
1486
|
+
widgets: generateWidgets()
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1489
|
+
var Theme = /*#__PURE__*/generateTheme();
|
|
1490
|
+
function generateForm() {
|
|
1491
|
+
return core.withTheme(generateTheme());
|
|
1492
|
+
}
|
|
1493
|
+
var Form = /*#__PURE__*/generateForm();
|
|
1396
1494
|
|
|
1397
1495
|
exports.Form = Form;
|
|
1398
|
-
exports.Templates =
|
|
1496
|
+
exports.Templates = index$1;
|
|
1399
1497
|
exports.Theme = Theme;
|
|
1400
|
-
exports.Widgets =
|
|
1498
|
+
exports.Widgets = index;
|
|
1401
1499
|
exports["default"] = Form;
|
|
1500
|
+
exports.generateForm = generateForm;
|
|
1501
|
+
exports.generateTemplates = generateTemplates;
|
|
1502
|
+
exports.generateTheme = generateTheme;
|
|
1503
|
+
exports.generateWidgets = generateWidgets;
|
|
1402
1504
|
//# sourceMappingURL=antd.cjs.development.js.map
|