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