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