@rjsf/semantic-ui 5.9.0 → 5.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/semantic-ui.cjs.development.js +649 -632
- package/dist/semantic-ui.cjs.development.js.map +1 -1
- package/dist/semantic-ui.cjs.production.min.js +1 -1
- package/dist/semantic-ui.cjs.production.min.js.map +1 -1
- package/dist/semantic-ui.esm.js +649 -632
- package/dist/semantic-ui.esm.js.map +1 -1
- package/dist/semantic-ui.umd.development.js +649 -632
- package/dist/semantic-ui.umd.development.js.map +1 -1
- package/dist/semantic-ui.umd.production.min.js +1 -1
- package/dist/semantic-ui.umd.production.min.js.map +1 -1
- package/package.json +14 -14
|
@@ -8,54 +8,29 @@
|
|
|
8
8
|
|
|
9
9
|
var map__default = /*#__PURE__*/_interopDefaultLegacy(map);
|
|
10
10
|
|
|
11
|
-
function _extends() {
|
|
12
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
13
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
14
|
-
var source = arguments[i];
|
|
15
|
-
for (var key in source) {
|
|
16
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
17
|
-
target[key] = source[key];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return target;
|
|
22
|
-
};
|
|
23
|
-
return _extends.apply(this, arguments);
|
|
24
|
-
}
|
|
25
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
26
|
-
if (source == null) return {};
|
|
27
|
-
var target = {};
|
|
28
|
-
var sourceKeys = Object.keys(source);
|
|
29
|
-
var key, i;
|
|
30
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
31
|
-
key = sourceKeys[i];
|
|
32
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
33
|
-
target[key] = source[key];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var _excluded$4 = ["uiSchema", "registry", "color"];
|
|
39
11
|
/** The `AddButton` renders a button that represent the `Add` action on a form
|
|
40
12
|
*/
|
|
41
|
-
function AddButton(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
13
|
+
function AddButton({
|
|
14
|
+
uiSchema,
|
|
15
|
+
registry,
|
|
16
|
+
color,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
const {
|
|
20
|
+
translateString
|
|
21
|
+
} = registry;
|
|
22
|
+
return jsxRuntime.jsx(semanticUiReact.Button, {
|
|
47
23
|
title: translateString(utils.TranslatableString.AddItemButton),
|
|
48
|
-
color: color
|
|
49
|
-
|
|
24
|
+
color: color,
|
|
25
|
+
...props,
|
|
50
26
|
icon: true,
|
|
51
27
|
size: 'tiny',
|
|
52
28
|
children: jsxRuntime.jsx(semanticUiReact.Icon, {
|
|
53
29
|
name: 'plus'
|
|
54
30
|
})
|
|
55
|
-
})
|
|
31
|
+
});
|
|
56
32
|
}
|
|
57
33
|
|
|
58
|
-
var _excluded$3 = ["wrap", "component"];
|
|
59
34
|
/**
|
|
60
35
|
* Extract props meant for semantic UI components from props that are
|
|
61
36
|
* passed to Widgets, Templates and Fields.
|
|
@@ -67,25 +42,25 @@
|
|
|
67
42
|
* @param {Object?} params.defaultContextProps
|
|
68
43
|
* @returns {any}
|
|
69
44
|
*/
|
|
70
|
-
function getSemanticProps(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
defaultContextProps = _ref$defaultContextPr === void 0 ? {} : _ref$defaultContextPr;
|
|
84
|
-
var formContextProps = formContext.semantic;
|
|
85
|
-
var schemaProps = utils.getUiOptions(uiSchema).semantic;
|
|
86
|
-
var optionProps = options.semantic;
|
|
45
|
+
function getSemanticProps({
|
|
46
|
+
formContext = {},
|
|
47
|
+
uiSchema = {},
|
|
48
|
+
options = {},
|
|
49
|
+
defaultSchemaProps = {
|
|
50
|
+
fluid: true,
|
|
51
|
+
inverted: false
|
|
52
|
+
},
|
|
53
|
+
defaultContextProps = {}
|
|
54
|
+
}) {
|
|
55
|
+
const formContextProps = formContext.semantic;
|
|
56
|
+
const schemaProps = utils.getUiOptions(uiSchema).semantic;
|
|
57
|
+
const optionProps = options.semantic;
|
|
87
58
|
// formContext props should overide other props
|
|
88
|
-
return Object.assign({},
|
|
59
|
+
return Object.assign({}, {
|
|
60
|
+
...defaultSchemaProps
|
|
61
|
+
}, {
|
|
62
|
+
...defaultContextProps
|
|
63
|
+
}, schemaProps, optionProps, formContextProps);
|
|
89
64
|
}
|
|
90
65
|
/**
|
|
91
66
|
* Extract error props meant for semantic UI components from props that are
|
|
@@ -96,23 +71,22 @@
|
|
|
96
71
|
* @param {Object?} params.defaultProps
|
|
97
72
|
* @returns {any}
|
|
98
73
|
*/
|
|
99
|
-
function getSemanticErrorProps(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return Object.assign({}, _extends({}, defaultProps), schemaProps, optionProps, formContextProps);
|
|
74
|
+
function getSemanticErrorProps({
|
|
75
|
+
formContext = {},
|
|
76
|
+
uiSchema = {},
|
|
77
|
+
options = {},
|
|
78
|
+
defaultProps = {
|
|
79
|
+
size: 'small',
|
|
80
|
+
pointing: 'above'
|
|
81
|
+
}
|
|
82
|
+
}) {
|
|
83
|
+
const formContextProps = formContext.semantic && formContext.semantic.errorOptions;
|
|
84
|
+
const semanticOptions = utils.getUiOptions(uiSchema).semantic;
|
|
85
|
+
const schemaProps = semanticOptions && semanticOptions.errorOptions;
|
|
86
|
+
const optionProps = options.semantic && options.semantic.errorOptions;
|
|
87
|
+
return Object.assign({}, {
|
|
88
|
+
...defaultProps
|
|
89
|
+
}, schemaProps, optionProps, formContextProps);
|
|
116
90
|
}
|
|
117
91
|
/**
|
|
118
92
|
* Combine multiple strings containing class names into a single string,
|
|
@@ -123,20 +97,13 @@
|
|
|
123
97
|
* @param {Array} omit
|
|
124
98
|
* @returns {string}
|
|
125
99
|
*/
|
|
126
|
-
function cleanClassNames(classNameArr, omit) {
|
|
127
|
-
if (omit === void 0) {
|
|
128
|
-
omit = [];
|
|
129
|
-
}
|
|
100
|
+
function cleanClassNames(classNameArr, omit = []) {
|
|
130
101
|
// Split each arg on whitespace, and add it to an array. Skip false-y args
|
|
131
102
|
// like "" and undefined.
|
|
132
|
-
|
|
133
|
-
return previous.concat(current.trim().split(/\s+/));
|
|
134
|
-
}, []);
|
|
103
|
+
const classList = classNameArr.filter(Boolean).reduce((previous, current) => previous.concat(current.trim().split(/\s+/)), []);
|
|
135
104
|
// Remove any class names from omit, and make the rest unique before
|
|
136
105
|
// returning them as a string
|
|
137
|
-
return [
|
|
138
|
-
return !omit.includes(cn);
|
|
139
|
-
}))).join(' ');
|
|
106
|
+
return [...new Set(classList.filter(cn => !omit.includes(cn)))].join(' ');
|
|
140
107
|
}
|
|
141
108
|
/**
|
|
142
109
|
*
|
|
@@ -146,60 +113,63 @@
|
|
|
146
113
|
* @returns {*}
|
|
147
114
|
* @constructor
|
|
148
115
|
*/
|
|
149
|
-
function MaybeWrap(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return wrap ? jsxRuntime.jsx(Component,
|
|
116
|
+
function MaybeWrap({
|
|
117
|
+
wrap,
|
|
118
|
+
component: Component = 'div',
|
|
119
|
+
...props
|
|
120
|
+
}) {
|
|
121
|
+
return wrap ? jsxRuntime.jsx(Component, {
|
|
122
|
+
...props
|
|
123
|
+
}) : props.children;
|
|
155
124
|
}
|
|
156
125
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
};
|
|
162
|
-
};
|
|
126
|
+
const gridStyle = vertical => ({
|
|
127
|
+
display: 'grid',
|
|
128
|
+
gridTemplateColumns: `1fr ${vertical ? 65 : 150}px`
|
|
129
|
+
});
|
|
163
130
|
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
164
131
|
*
|
|
165
132
|
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
166
133
|
*/
|
|
167
134
|
function ArrayFieldItemTemplate(props) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
135
|
+
const {
|
|
136
|
+
children,
|
|
137
|
+
disabled,
|
|
138
|
+
hasToolbar,
|
|
139
|
+
hasCopy,
|
|
140
|
+
hasMoveDown,
|
|
141
|
+
hasMoveUp,
|
|
142
|
+
hasRemove,
|
|
143
|
+
index,
|
|
144
|
+
onCopyIndexClick,
|
|
145
|
+
onDropIndexClick,
|
|
146
|
+
onReorderClick,
|
|
147
|
+
readonly,
|
|
148
|
+
uiSchema,
|
|
149
|
+
registry
|
|
150
|
+
} = props;
|
|
151
|
+
const {
|
|
152
|
+
CopyButton,
|
|
153
|
+
MoveDownButton,
|
|
154
|
+
MoveUpButton,
|
|
155
|
+
RemoveButton
|
|
156
|
+
} = registry.templates.ButtonTemplates;
|
|
157
|
+
const uiOptions = utils.getUiOptions(uiSchema);
|
|
188
158
|
// Pull the semantic props out of the uiOptions that were put in via the ArrayFieldTemplate
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
wrapItem = _uiOptions$semantic$w === void 0 ? false : _uiOptions$semantic$w;
|
|
159
|
+
const {
|
|
160
|
+
horizontalButtons = true,
|
|
161
|
+
wrapItem = false
|
|
162
|
+
} = uiOptions.semantic;
|
|
194
163
|
return jsxRuntime.jsx("div", {
|
|
195
164
|
className: 'array-item',
|
|
196
165
|
children: jsxRuntime.jsx(MaybeWrap, {
|
|
197
166
|
wrap: wrapItem,
|
|
198
167
|
component: semanticUiReact.Segment,
|
|
199
168
|
children: jsxRuntime.jsxs(semanticUiReact.Grid, {
|
|
200
|
-
style:
|
|
169
|
+
style: {
|
|
170
|
+
...gridStyle(!horizontalButtons),
|
|
201
171
|
alignItems: 'center'
|
|
202
|
-
}
|
|
172
|
+
},
|
|
203
173
|
children: [jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
204
174
|
width: 16,
|
|
205
175
|
verticalAlign: 'middle',
|
|
@@ -240,45 +210,54 @@
|
|
|
240
210
|
});
|
|
241
211
|
}
|
|
242
212
|
|
|
243
|
-
var _excluded$2 = ["key", "uiSchema"];
|
|
244
213
|
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
245
214
|
*
|
|
246
215
|
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
247
216
|
*/
|
|
248
217
|
function ArrayFieldTemplate(props) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
218
|
+
const {
|
|
219
|
+
uiSchema,
|
|
220
|
+
idSchema,
|
|
221
|
+
canAdd,
|
|
222
|
+
className,
|
|
223
|
+
// classNames, This is not part of the type, so it is likely never passed in
|
|
224
|
+
disabled,
|
|
225
|
+
formContext,
|
|
226
|
+
items,
|
|
227
|
+
onAddClick,
|
|
228
|
+
// options, This is not part of the type, so it is likely never passed in
|
|
229
|
+
readonly,
|
|
230
|
+
required,
|
|
231
|
+
schema,
|
|
232
|
+
title,
|
|
233
|
+
registry
|
|
234
|
+
} = props;
|
|
235
|
+
const semanticProps = getSemanticProps({
|
|
236
|
+
uiSchema,
|
|
237
|
+
formContext,
|
|
265
238
|
defaultSchemaProps: {
|
|
266
239
|
horizontalButtons: true,
|
|
267
240
|
wrapItem: false
|
|
268
241
|
}
|
|
269
242
|
});
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
243
|
+
const {
|
|
244
|
+
horizontalButtons,
|
|
245
|
+
wrapItem
|
|
246
|
+
} = semanticProps;
|
|
247
|
+
const semantic = {
|
|
248
|
+
horizontalButtons,
|
|
249
|
+
wrapItem
|
|
275
250
|
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
251
|
+
const uiOptions = utils.getUiOptions(uiSchema);
|
|
252
|
+
const ArrayFieldDescriptionTemplate = utils.getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
|
|
253
|
+
const ArrayFieldItemTemplate = utils.getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
|
|
254
|
+
const ArrayFieldTitleTemplate = utils.getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
|
|
280
255
|
// Button templates are not overridden in the uiSchema
|
|
281
|
-
|
|
256
|
+
const {
|
|
257
|
+
ButtonTemplates: {
|
|
258
|
+
AddButton
|
|
259
|
+
}
|
|
260
|
+
} = registry.templates;
|
|
282
261
|
return jsxRuntime.jsxs("div", {
|
|
283
262
|
className: cleanClassNames([className, utils.isFixedItems(schema) ? '' : 'sortable-form-fields']),
|
|
284
263
|
children: [jsxRuntime.jsx(ArrayFieldTitleTemplate, {
|
|
@@ -297,19 +276,23 @@
|
|
|
297
276
|
}), jsxRuntime.jsxs("div", {
|
|
298
277
|
children: [jsxRuntime.jsx("div", {
|
|
299
278
|
className: 'row array-item-list',
|
|
300
|
-
children: items && items.map(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
279
|
+
children: items && items.map(({
|
|
280
|
+
key,
|
|
281
|
+
uiSchema: itemUiSchema = {},
|
|
282
|
+
...props
|
|
283
|
+
}) => {
|
|
306
284
|
// Merge in the semantic props from the ArrayFieldTemplate into each of the items
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
285
|
+
const mergedUiSchema = {
|
|
286
|
+
...itemUiSchema,
|
|
287
|
+
[utils.UI_OPTIONS_KEY]: {
|
|
288
|
+
...itemUiSchema[utils.UI_OPTIONS_KEY],
|
|
289
|
+
semantic
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
return jsxRuntime.jsx(ArrayFieldItemTemplate, {
|
|
293
|
+
...props,
|
|
311
294
|
uiSchema: mergedUiSchema
|
|
312
|
-
}
|
|
295
|
+
}, key);
|
|
313
296
|
})
|
|
314
297
|
}), canAdd && jsxRuntime.jsx("div", {
|
|
315
298
|
style: {
|
|
@@ -324,7 +307,7 @@
|
|
|
324
307
|
registry: registry
|
|
325
308
|
})
|
|
326
309
|
})]
|
|
327
|
-
},
|
|
310
|
+
}, `array-item-list-${idSchema.$id}`)]
|
|
328
311
|
});
|
|
329
312
|
}
|
|
330
313
|
|
|
@@ -335,63 +318,61 @@
|
|
|
335
318
|
* @param props - The `WidgetProps` for this template
|
|
336
319
|
*/
|
|
337
320
|
function BaseInputTemplate(props) {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
rawErrors =
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
321
|
+
const {
|
|
322
|
+
id,
|
|
323
|
+
placeholder,
|
|
324
|
+
label,
|
|
325
|
+
hideLabel,
|
|
326
|
+
value,
|
|
327
|
+
required,
|
|
328
|
+
readonly,
|
|
329
|
+
disabled,
|
|
330
|
+
onChange,
|
|
331
|
+
onChangeOverride,
|
|
332
|
+
onBlur,
|
|
333
|
+
onFocus,
|
|
334
|
+
autofocus,
|
|
335
|
+
options,
|
|
336
|
+
schema,
|
|
337
|
+
uiSchema,
|
|
338
|
+
formContext,
|
|
339
|
+
type,
|
|
340
|
+
rawErrors = []
|
|
341
|
+
} = props;
|
|
342
|
+
const inputProps = utils.getInputProps(schema, type, options);
|
|
343
|
+
const semanticProps = getSemanticProps({
|
|
344
|
+
uiSchema,
|
|
345
|
+
formContext,
|
|
346
|
+
options
|
|
363
347
|
});
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
var _onFocus = function _onFocus() {
|
|
372
|
-
return onFocus && onFocus(id, value);
|
|
373
|
-
};
|
|
348
|
+
const _onChange = ({
|
|
349
|
+
target: {
|
|
350
|
+
value
|
|
351
|
+
}
|
|
352
|
+
}) => onChange(value === '' ? options.emptyValue : value);
|
|
353
|
+
const _onBlur = () => onBlur && onBlur(id, value);
|
|
354
|
+
const _onFocus = () => onFocus && onFocus(id, value);
|
|
374
355
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
375
|
-
children: [jsxRuntime.jsx(semanticUiReact.Form.Input,
|
|
356
|
+
children: [jsxRuntime.jsx(semanticUiReact.Form.Input, {
|
|
376
357
|
id: id,
|
|
377
358
|
name: id,
|
|
378
|
-
placeholder: placeholder
|
|
379
|
-
|
|
359
|
+
placeholder: placeholder,
|
|
360
|
+
...inputProps,
|
|
380
361
|
label: utils.labelValue(label || undefined, hideLabel, false),
|
|
381
362
|
required: required,
|
|
382
363
|
autoFocus: autofocus,
|
|
383
364
|
disabled: disabled || readonly,
|
|
384
|
-
list: schema.examples ? utils.examplesId(id) : undefined
|
|
385
|
-
|
|
365
|
+
list: schema.examples ? utils.examplesId(id) : undefined,
|
|
366
|
+
...semanticProps,
|
|
386
367
|
value: value || value === 0 ? value : '',
|
|
387
368
|
error: rawErrors.length > 0,
|
|
388
369
|
onChange: onChangeOverride || _onChange,
|
|
389
370
|
onBlur: _onBlur,
|
|
390
371
|
onFocus: _onFocus,
|
|
391
372
|
"aria-describedby": utils.ariaDescribedByIds(id, !!schema.examples)
|
|
392
|
-
}
|
|
373
|
+
}, id), Array.isArray(schema.examples) && jsxRuntime.jsx("datalist", {
|
|
393
374
|
id: utils.examplesId(id),
|
|
394
|
-
children: schema.examples.concat(schema
|
|
375
|
+
children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map(example => {
|
|
395
376
|
return jsxRuntime.jsx("option", {
|
|
396
377
|
value: example
|
|
397
378
|
}, example);
|
|
@@ -405,8 +386,10 @@
|
|
|
405
386
|
* @param props - The `DescriptionFieldProps` for this component
|
|
406
387
|
*/
|
|
407
388
|
function DescriptionField(props) {
|
|
408
|
-
|
|
409
|
-
|
|
389
|
+
const {
|
|
390
|
+
id,
|
|
391
|
+
description
|
|
392
|
+
} = props;
|
|
410
393
|
if (!description) {
|
|
411
394
|
return null;
|
|
412
395
|
}
|
|
@@ -421,72 +404,93 @@
|
|
|
421
404
|
*
|
|
422
405
|
* @param props - The `ErrorListProps` for this component
|
|
423
406
|
*/
|
|
424
|
-
function ErrorList(
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
407
|
+
function ErrorList({
|
|
408
|
+
errors,
|
|
409
|
+
registry
|
|
410
|
+
}) {
|
|
411
|
+
const {
|
|
412
|
+
translateString
|
|
413
|
+
} = registry;
|
|
428
414
|
return jsxRuntime.jsxs(semanticUiReact.Message, {
|
|
429
415
|
negative: true,
|
|
430
416
|
children: [jsxRuntime.jsx(semanticUiReact.Message.Header, {
|
|
431
417
|
children: translateString(utils.TranslatableString.ErrorsLabel)
|
|
432
418
|
}), jsxRuntime.jsx(semanticUiReact.Message.List, {
|
|
433
|
-
children: errors.map(
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
}, "error-" + index);
|
|
437
|
-
})
|
|
419
|
+
children: errors.map((error, index) => jsxRuntime.jsx(semanticUiReact.Message.Item, {
|
|
420
|
+
children: error.stack
|
|
421
|
+
}, `error-${index}`))
|
|
438
422
|
})]
|
|
439
423
|
});
|
|
440
424
|
}
|
|
441
425
|
|
|
442
|
-
var _excluded$1 = ["icon", "iconType", "color", "className", "uiSchema", "registry"];
|
|
443
426
|
function IconButton(props) {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
427
|
+
const {
|
|
428
|
+
icon,
|
|
429
|
+
iconType,
|
|
430
|
+
color,
|
|
431
|
+
className,
|
|
432
|
+
uiSchema,
|
|
433
|
+
registry,
|
|
434
|
+
...otherProps
|
|
435
|
+
} = props;
|
|
436
|
+
return jsxRuntime.jsx(semanticUiReact.Button, {
|
|
450
437
|
icon: icon,
|
|
451
438
|
size: iconType,
|
|
452
439
|
color: color,
|
|
453
|
-
className: className
|
|
454
|
-
|
|
440
|
+
className: className,
|
|
441
|
+
...otherProps
|
|
442
|
+
});
|
|
455
443
|
}
|
|
456
444
|
function CopyButton(props) {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
445
|
+
const {
|
|
446
|
+
registry: {
|
|
447
|
+
translateString
|
|
448
|
+
}
|
|
449
|
+
} = props;
|
|
450
|
+
return jsxRuntime.jsx(IconButton, {
|
|
451
|
+
title: translateString(utils.TranslatableString.CopyButton),
|
|
452
|
+
...props,
|
|
461
453
|
icon: 'copy'
|
|
462
|
-
})
|
|
454
|
+
});
|
|
463
455
|
}
|
|
464
456
|
function MoveDownButton(props) {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
457
|
+
const {
|
|
458
|
+
registry: {
|
|
459
|
+
translateString
|
|
460
|
+
}
|
|
461
|
+
} = props;
|
|
462
|
+
return jsxRuntime.jsx(IconButton, {
|
|
463
|
+
title: translateString(utils.TranslatableString.MoveDownButton),
|
|
464
|
+
...props,
|
|
469
465
|
icon: 'angle down'
|
|
470
|
-
})
|
|
466
|
+
});
|
|
471
467
|
}
|
|
472
468
|
function MoveUpButton(props) {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
469
|
+
const {
|
|
470
|
+
registry: {
|
|
471
|
+
translateString
|
|
472
|
+
}
|
|
473
|
+
} = props;
|
|
474
|
+
return jsxRuntime.jsx(IconButton, {
|
|
475
|
+
title: translateString(utils.TranslatableString.MoveUpButton),
|
|
476
|
+
...props,
|
|
477
477
|
icon: 'angle up'
|
|
478
|
-
})
|
|
478
|
+
});
|
|
479
479
|
}
|
|
480
480
|
function RemoveButton(props) {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
481
|
+
const {
|
|
482
|
+
registry: {
|
|
483
|
+
translateString
|
|
484
|
+
}
|
|
485
|
+
} = props;
|
|
486
|
+
return jsxRuntime.jsx(IconButton, {
|
|
487
|
+
title: translateString(utils.TranslatableString.RemoveButton),
|
|
488
|
+
...props,
|
|
485
489
|
icon: 'trash'
|
|
486
|
-
})
|
|
490
|
+
});
|
|
487
491
|
}
|
|
488
492
|
|
|
489
|
-
|
|
493
|
+
const DEFAULT_OPTIONS$1 = {
|
|
490
494
|
options: {
|
|
491
495
|
pointing: 'above',
|
|
492
496
|
size: 'small'
|
|
@@ -496,21 +500,26 @@
|
|
|
496
500
|
*
|
|
497
501
|
* @param props - The `FieldErrorProps` for the errors being rendered
|
|
498
502
|
*/
|
|
499
|
-
function FieldErrorTemplate(
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
formContext
|
|
507
|
-
|
|
503
|
+
function FieldErrorTemplate({
|
|
504
|
+
errors,
|
|
505
|
+
idSchema,
|
|
506
|
+
uiSchema,
|
|
507
|
+
registry
|
|
508
|
+
}) {
|
|
509
|
+
const {
|
|
510
|
+
formContext
|
|
511
|
+
} = registry;
|
|
512
|
+
const options = getSemanticErrorProps({
|
|
513
|
+
formContext,
|
|
514
|
+
uiSchema,
|
|
508
515
|
defaultProps: DEFAULT_OPTIONS$1
|
|
509
516
|
});
|
|
510
|
-
|
|
511
|
-
|
|
517
|
+
const {
|
|
518
|
+
pointing,
|
|
519
|
+
size
|
|
520
|
+
} = options;
|
|
512
521
|
if (errors && errors.length > 0) {
|
|
513
|
-
|
|
522
|
+
const id = utils.errorId(idSchema);
|
|
514
523
|
return jsxRuntime.jsx(semanticUiReact.Label, {
|
|
515
524
|
id: id,
|
|
516
525
|
color: 'red',
|
|
@@ -519,11 +528,9 @@
|
|
|
519
528
|
basic: true,
|
|
520
529
|
children: jsxRuntime.jsx(semanticUiReact.List, {
|
|
521
530
|
bulleted: true,
|
|
522
|
-
children: errors.map(
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
}, nanoid.nanoid());
|
|
526
|
-
})
|
|
531
|
+
children: errors.map(error => jsxRuntime.jsx(semanticUiReact.List.Item, {
|
|
532
|
+
children: error
|
|
533
|
+
}, nanoid.nanoid()))
|
|
527
534
|
})
|
|
528
535
|
});
|
|
529
536
|
}
|
|
@@ -535,10 +542,12 @@
|
|
|
535
542
|
* @param props - The `FieldHelpProps` to be rendered
|
|
536
543
|
*/
|
|
537
544
|
function FieldHelpTemplate(props) {
|
|
538
|
-
|
|
539
|
-
|
|
545
|
+
const {
|
|
546
|
+
idSchema,
|
|
547
|
+
help
|
|
548
|
+
} = props;
|
|
540
549
|
if (help) {
|
|
541
|
-
|
|
550
|
+
const id = utils.helpId(idSchema);
|
|
542
551
|
return jsxRuntime.jsx(semanticUiReact.Message, {
|
|
543
552
|
size: 'mini',
|
|
544
553
|
info: true,
|
|
@@ -549,33 +558,36 @@
|
|
|
549
558
|
return null;
|
|
550
559
|
}
|
|
551
560
|
|
|
552
|
-
var _excluded = ["id", "children", "classNames", "style", "displayLabel", "label", "errors", "help", "hidden", "description", "rawDescription", "registry", "schema", "uiSchema"];
|
|
553
561
|
/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
|
|
554
562
|
* content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
|
|
555
563
|
*
|
|
556
564
|
* @param props - The `FieldTemplateProps` for this component
|
|
557
565
|
*/
|
|
558
566
|
function FieldTemplate(props) {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
567
|
+
const {
|
|
568
|
+
id,
|
|
569
|
+
children,
|
|
570
|
+
classNames,
|
|
571
|
+
style,
|
|
572
|
+
displayLabel,
|
|
573
|
+
label,
|
|
574
|
+
errors,
|
|
575
|
+
help,
|
|
576
|
+
hidden,
|
|
577
|
+
description,
|
|
578
|
+
rawDescription,
|
|
579
|
+
registry,
|
|
580
|
+
schema,
|
|
581
|
+
uiSchema,
|
|
582
|
+
...otherProps
|
|
583
|
+
} = props;
|
|
584
|
+
const semanticProps = getSemanticProps(otherProps);
|
|
585
|
+
const {
|
|
586
|
+
wrapLabel,
|
|
587
|
+
wrapContent
|
|
588
|
+
} = semanticProps;
|
|
589
|
+
const uiOptions = utils.getUiOptions(uiSchema);
|
|
590
|
+
const WrapIfAdditionalTemplate = utils.getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
|
|
579
591
|
if (hidden) {
|
|
580
592
|
return jsxRuntime.jsx("div", {
|
|
581
593
|
style: {
|
|
@@ -584,15 +596,15 @@
|
|
|
584
596
|
children: children
|
|
585
597
|
});
|
|
586
598
|
}
|
|
587
|
-
return jsxRuntime.jsx(WrapIfAdditionalTemplate,
|
|
599
|
+
return jsxRuntime.jsx(WrapIfAdditionalTemplate, {
|
|
588
600
|
classNames: classNames,
|
|
589
601
|
style: style,
|
|
590
602
|
id: id,
|
|
591
603
|
label: label,
|
|
592
604
|
registry: registry,
|
|
593
605
|
schema: schema,
|
|
594
|
-
uiSchema: uiSchema
|
|
595
|
-
|
|
606
|
+
uiSchema: uiSchema,
|
|
607
|
+
...otherProps,
|
|
596
608
|
children: jsxRuntime.jsx(semanticUiReact.Form.Group, {
|
|
597
609
|
widths: 'equal',
|
|
598
610
|
grouped: true,
|
|
@@ -606,7 +618,7 @@
|
|
|
606
618
|
}), help, errors]
|
|
607
619
|
})
|
|
608
620
|
}, id)
|
|
609
|
-
})
|
|
621
|
+
});
|
|
610
622
|
}
|
|
611
623
|
|
|
612
624
|
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
|
|
@@ -616,23 +628,29 @@
|
|
|
616
628
|
* @param props - The `ObjectFieldTemplateProps` for this component
|
|
617
629
|
*/
|
|
618
630
|
function ObjectFieldTemplate(props) {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
631
|
+
const {
|
|
632
|
+
description,
|
|
633
|
+
onAddClick,
|
|
634
|
+
title,
|
|
635
|
+
properties,
|
|
636
|
+
disabled,
|
|
637
|
+
readonly,
|
|
638
|
+
required,
|
|
639
|
+
uiSchema,
|
|
640
|
+
schema,
|
|
641
|
+
formData,
|
|
642
|
+
idSchema,
|
|
643
|
+
registry
|
|
644
|
+
} = props;
|
|
645
|
+
const uiOptions = utils.getUiOptions(uiSchema);
|
|
646
|
+
const TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, uiOptions);
|
|
647
|
+
const DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, uiOptions);
|
|
634
648
|
// Button templates are not overridden in the uiSchema
|
|
635
|
-
|
|
649
|
+
const {
|
|
650
|
+
ButtonTemplates: {
|
|
651
|
+
AddButton
|
|
652
|
+
}
|
|
653
|
+
} = registry.templates;
|
|
636
654
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
637
655
|
children: [title && jsxRuntime.jsx(TitleFieldTemplate, {
|
|
638
656
|
id: utils.titleId(idSchema),
|
|
@@ -647,9 +665,7 @@
|
|
|
647
665
|
schema: schema,
|
|
648
666
|
uiSchema: uiSchema,
|
|
649
667
|
registry: registry
|
|
650
|
-
}), properties.map(
|
|
651
|
-
return prop.content;
|
|
652
|
-
}), utils.canExpand(schema, uiSchema, formData) && jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
668
|
+
}), properties.map(prop => prop.content), utils.canExpand(schema, uiSchema, formData) && jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
653
669
|
width: 16,
|
|
654
670
|
verticalAlign: 'middle',
|
|
655
671
|
children: jsxRuntime.jsx(semanticUiReact.Grid.Row, {
|
|
@@ -673,25 +689,26 @@
|
|
|
673
689
|
|
|
674
690
|
/** The `SubmitButton` renders a button that represent the `Submit` action on a form
|
|
675
691
|
*/
|
|
676
|
-
function SubmitButton(
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
submitButtonProps =
|
|
692
|
+
function SubmitButton({
|
|
693
|
+
uiSchema
|
|
694
|
+
}) {
|
|
695
|
+
const {
|
|
696
|
+
submitText,
|
|
697
|
+
norender,
|
|
698
|
+
props: submitButtonProps = {}
|
|
699
|
+
} = utils.getSubmitButtonOptions(uiSchema);
|
|
683
700
|
if (norender) {
|
|
684
701
|
return null;
|
|
685
702
|
}
|
|
686
|
-
return jsxRuntime.jsx(semanticUiReact.Button,
|
|
703
|
+
return jsxRuntime.jsx(semanticUiReact.Button, {
|
|
687
704
|
type: 'submit',
|
|
688
|
-
primary: true
|
|
689
|
-
|
|
705
|
+
primary: true,
|
|
706
|
+
...submitButtonProps,
|
|
690
707
|
children: submitText
|
|
691
|
-
})
|
|
708
|
+
});
|
|
692
709
|
}
|
|
693
710
|
|
|
694
|
-
|
|
711
|
+
const DEFAULT_OPTIONS = {
|
|
695
712
|
inverted: false,
|
|
696
713
|
dividing: true
|
|
697
714
|
};
|
|
@@ -699,23 +716,24 @@
|
|
|
699
716
|
*
|
|
700
717
|
* @param props - The `TitleFieldProps` for this component
|
|
701
718
|
*/
|
|
702
|
-
function TitleField(
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
719
|
+
function TitleField({
|
|
720
|
+
id,
|
|
721
|
+
title,
|
|
722
|
+
uiSchema
|
|
723
|
+
}) {
|
|
724
|
+
const semanticProps = getSemanticProps({
|
|
725
|
+
uiSchema,
|
|
708
726
|
defaultSchemaProps: DEFAULT_OPTIONS
|
|
709
727
|
});
|
|
710
728
|
if (!title) {
|
|
711
729
|
return null;
|
|
712
730
|
}
|
|
713
|
-
return jsxRuntime.jsx(semanticUiReact.Header,
|
|
714
|
-
id: id
|
|
715
|
-
|
|
731
|
+
return jsxRuntime.jsx(semanticUiReact.Header, {
|
|
732
|
+
id: id,
|
|
733
|
+
...semanticProps,
|
|
716
734
|
as: 'h5',
|
|
717
735
|
children: title
|
|
718
|
-
})
|
|
736
|
+
});
|
|
719
737
|
}
|
|
720
738
|
|
|
721
739
|
/** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
|
|
@@ -724,29 +742,35 @@
|
|
|
724
742
|
* @param props - The `WrapIfAdditionalProps` for this component
|
|
725
743
|
*/
|
|
726
744
|
function WrapIfAdditionalTemplate(props) {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
745
|
+
const {
|
|
746
|
+
children,
|
|
747
|
+
classNames,
|
|
748
|
+
style,
|
|
749
|
+
disabled,
|
|
750
|
+
id,
|
|
751
|
+
label,
|
|
752
|
+
onDropPropertyClick,
|
|
753
|
+
onKeyChange,
|
|
754
|
+
readonly,
|
|
755
|
+
required,
|
|
756
|
+
schema,
|
|
757
|
+
uiSchema,
|
|
758
|
+
registry
|
|
759
|
+
} = props;
|
|
760
|
+
const {
|
|
761
|
+
templates,
|
|
762
|
+
translateString
|
|
763
|
+
} = registry;
|
|
742
764
|
// Button templates are not overridden in the uiSchema
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
765
|
+
const {
|
|
766
|
+
RemoveButton
|
|
767
|
+
} = templates.ButtonTemplates;
|
|
768
|
+
const keyLabel = translateString(utils.TranslatableString.KeyLabel, [label]);
|
|
769
|
+
const {
|
|
770
|
+
readonlyAsDisabled = true,
|
|
771
|
+
wrapperStyle
|
|
772
|
+
} = registry.formContext;
|
|
773
|
+
const additional = (utils.ADDITIONAL_PROPERTY_FLAG in schema);
|
|
750
774
|
if (!additional) {
|
|
751
775
|
return jsxRuntime.jsx("div", {
|
|
752
776
|
className: classNames,
|
|
@@ -754,10 +778,9 @@
|
|
|
754
778
|
children: children
|
|
755
779
|
});
|
|
756
780
|
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
};
|
|
781
|
+
const handleBlur = ({
|
|
782
|
+
target
|
|
783
|
+
}) => onKeyChange(target.value);
|
|
761
784
|
return jsxRuntime.jsx("div", {
|
|
762
785
|
className: classNames,
|
|
763
786
|
style: style,
|
|
@@ -773,13 +796,13 @@
|
|
|
773
796
|
className: 'form-group',
|
|
774
797
|
hasFeedback: true,
|
|
775
798
|
fluid: true,
|
|
776
|
-
htmlFor:
|
|
799
|
+
htmlFor: `${id}`,
|
|
777
800
|
label: keyLabel,
|
|
778
801
|
required: required,
|
|
779
802
|
defaultValue: label,
|
|
780
803
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
781
|
-
id:
|
|
782
|
-
name:
|
|
804
|
+
id: `${id}`,
|
|
805
|
+
name: `${id}`,
|
|
783
806
|
onBlur: !readonly ? handleBlur : undefined,
|
|
784
807
|
style: wrapperStyle,
|
|
785
808
|
type: 'text'
|
|
@@ -801,30 +824,30 @@
|
|
|
801
824
|
})]
|
|
802
825
|
})
|
|
803
826
|
})
|
|
804
|
-
}, id
|
|
827
|
+
}, `${id}-key`);
|
|
805
828
|
}
|
|
806
829
|
|
|
807
830
|
function generateTemplates() {
|
|
808
831
|
return {
|
|
809
|
-
ArrayFieldItemTemplate
|
|
810
|
-
ArrayFieldTemplate
|
|
811
|
-
BaseInputTemplate
|
|
832
|
+
ArrayFieldItemTemplate,
|
|
833
|
+
ArrayFieldTemplate,
|
|
834
|
+
BaseInputTemplate,
|
|
812
835
|
ButtonTemplates: {
|
|
813
|
-
AddButton
|
|
814
|
-
CopyButton
|
|
815
|
-
MoveDownButton
|
|
816
|
-
MoveUpButton
|
|
817
|
-
RemoveButton
|
|
818
|
-
SubmitButton
|
|
836
|
+
AddButton,
|
|
837
|
+
CopyButton,
|
|
838
|
+
MoveDownButton,
|
|
839
|
+
MoveUpButton,
|
|
840
|
+
RemoveButton,
|
|
841
|
+
SubmitButton
|
|
819
842
|
},
|
|
820
843
|
DescriptionFieldTemplate: DescriptionField,
|
|
821
844
|
ErrorListTemplate: ErrorList,
|
|
822
|
-
FieldErrorTemplate
|
|
823
|
-
FieldHelpTemplate
|
|
824
|
-
FieldTemplate
|
|
825
|
-
ObjectFieldTemplate
|
|
845
|
+
FieldErrorTemplate,
|
|
846
|
+
FieldHelpTemplate,
|
|
847
|
+
FieldTemplate,
|
|
848
|
+
ObjectFieldTemplate,
|
|
826
849
|
TitleFieldTemplate: TitleField,
|
|
827
|
-
WrapIfAdditionalTemplate
|
|
850
|
+
WrapIfAdditionalTemplate
|
|
828
851
|
};
|
|
829
852
|
}
|
|
830
853
|
var Templates = /*#__PURE__*/generateTemplates();
|
|
@@ -835,49 +858,42 @@
|
|
|
835
858
|
* @param props - The `WidgetProps` for this component
|
|
836
859
|
*/
|
|
837
860
|
function CheckboxWidget(props) {
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
value
|
|
841
|
-
disabled
|
|
842
|
-
readonly
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
uiSchema: uiSchema,
|
|
861
|
+
const {
|
|
862
|
+
id,
|
|
863
|
+
value,
|
|
864
|
+
disabled,
|
|
865
|
+
readonly,
|
|
866
|
+
label = '',
|
|
867
|
+
hideLabel,
|
|
868
|
+
autofocus,
|
|
869
|
+
onChange,
|
|
870
|
+
onBlur,
|
|
871
|
+
options,
|
|
872
|
+
onFocus,
|
|
873
|
+
formContext,
|
|
874
|
+
schema,
|
|
875
|
+
uiSchema,
|
|
876
|
+
rawErrors = [],
|
|
877
|
+
registry
|
|
878
|
+
} = props;
|
|
879
|
+
const semanticProps = getSemanticProps({
|
|
880
|
+
options,
|
|
881
|
+
formContext,
|
|
882
|
+
uiSchema,
|
|
861
883
|
defaultSchemaProps: {
|
|
862
884
|
inverted: 'false'
|
|
863
885
|
}
|
|
864
886
|
});
|
|
865
|
-
|
|
887
|
+
const DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, options);
|
|
866
888
|
// Because an unchecked checkbox will cause html5 validation to fail, only add
|
|
867
889
|
// the "required" attribute if the field value must be "true", due to the
|
|
868
890
|
// "const" or "enum" keywords
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
};
|
|
876
|
-
var _onFocus = function _onFocus() {
|
|
877
|
-
return onFocus && onFocus(id, value);
|
|
878
|
-
};
|
|
879
|
-
var checked = value == 'true' || value == true;
|
|
880
|
-
var description = (_options$description = options.description) != null ? _options$description : schema.description;
|
|
891
|
+
const required = utils.schemaRequiresTrueValue(schema);
|
|
892
|
+
const _onChange = (_, data) => onChange && onChange(data.checked);
|
|
893
|
+
const _onBlur = () => onBlur && onBlur(id, value);
|
|
894
|
+
const _onFocus = () => onFocus && onFocus(id, value);
|
|
895
|
+
const checked = value == 'true' || value == true;
|
|
896
|
+
const description = options.description ?? schema.description;
|
|
881
897
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
882
898
|
children: [!hideLabel && !!description && jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
883
899
|
id: utils.descriptionId(id),
|
|
@@ -885,12 +901,12 @@
|
|
|
885
901
|
schema: schema,
|
|
886
902
|
uiSchema: uiSchema,
|
|
887
903
|
registry: registry
|
|
888
|
-
}), jsxRuntime.jsx(semanticUiReact.Form.Checkbox,
|
|
904
|
+
}), jsxRuntime.jsx(semanticUiReact.Form.Checkbox, {
|
|
889
905
|
id: id,
|
|
890
906
|
name: id,
|
|
891
907
|
disabled: disabled || readonly,
|
|
892
|
-
autoFocus: autofocus
|
|
893
|
-
|
|
908
|
+
autoFocus: autofocus,
|
|
909
|
+
...semanticProps,
|
|
894
910
|
checked: typeof value === 'undefined' ? false : checked,
|
|
895
911
|
error: rawErrors.length > 0,
|
|
896
912
|
onChange: _onChange,
|
|
@@ -899,7 +915,7 @@
|
|
|
899
915
|
required: required,
|
|
900
916
|
label: utils.labelValue(label, hideLabel, false),
|
|
901
917
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
902
|
-
})
|
|
918
|
+
})]
|
|
903
919
|
});
|
|
904
920
|
}
|
|
905
921
|
|
|
@@ -909,54 +925,54 @@
|
|
|
909
925
|
* @param props - The `WidgetProps` for this component
|
|
910
926
|
*/
|
|
911
927
|
function CheckboxesWidget(props) {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
rawErrors =
|
|
928
|
-
registry
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
928
|
+
const {
|
|
929
|
+
id,
|
|
930
|
+
disabled,
|
|
931
|
+
options,
|
|
932
|
+
value,
|
|
933
|
+
autofocus,
|
|
934
|
+
readonly,
|
|
935
|
+
label,
|
|
936
|
+
hideLabel,
|
|
937
|
+
onChange,
|
|
938
|
+
onBlur,
|
|
939
|
+
onFocus,
|
|
940
|
+
formContext,
|
|
941
|
+
schema,
|
|
942
|
+
uiSchema,
|
|
943
|
+
rawErrors = [],
|
|
944
|
+
registry
|
|
945
|
+
} = props;
|
|
946
|
+
const TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, options);
|
|
947
|
+
const {
|
|
948
|
+
enumOptions,
|
|
949
|
+
enumDisabled,
|
|
950
|
+
inline
|
|
951
|
+
} = options;
|
|
952
|
+
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
953
|
+
const semanticProps = getSemanticProps({
|
|
954
|
+
options,
|
|
955
|
+
formContext,
|
|
956
|
+
uiSchema,
|
|
938
957
|
defaultSchemaProps: {
|
|
939
958
|
inverted: 'false'
|
|
940
959
|
}
|
|
941
960
|
});
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
var _onBlur = function _onBlur() {
|
|
954
|
-
return onBlur(id, value);
|
|
955
|
-
};
|
|
956
|
-
var _onFocus = function _onFocus() {
|
|
957
|
-
return onFocus(id, value);
|
|
961
|
+
const _onChange = index => ({
|
|
962
|
+
target: {
|
|
963
|
+
checked
|
|
964
|
+
}
|
|
965
|
+
}) => {
|
|
966
|
+
// eslint-disable-next-line no-shadow
|
|
967
|
+
if (checked) {
|
|
968
|
+
onChange(utils.enumOptionsSelectValue(index, checkboxesValues, enumOptions));
|
|
969
|
+
} else {
|
|
970
|
+
onChange(utils.enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
|
|
971
|
+
}
|
|
958
972
|
};
|
|
959
|
-
|
|
973
|
+
const _onBlur = () => onBlur(id, value);
|
|
974
|
+
const _onFocus = () => onFocus(id, value);
|
|
975
|
+
const inlineOption = inline ? {
|
|
960
976
|
inline: true
|
|
961
977
|
} : {
|
|
962
978
|
grouped: true
|
|
@@ -968,18 +984,18 @@
|
|
|
968
984
|
schema: schema,
|
|
969
985
|
uiSchema: uiSchema,
|
|
970
986
|
registry: registry
|
|
971
|
-
}), jsxRuntime.jsx(semanticUiReact.Form.Group,
|
|
987
|
+
}), jsxRuntime.jsx(semanticUiReact.Form.Group, {
|
|
972
988
|
id: id,
|
|
973
|
-
name: id
|
|
974
|
-
|
|
975
|
-
children: Array.isArray(enumOptions) && enumOptions.map(
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
return jsxRuntime.jsx(semanticUiReact.Form.Checkbox,
|
|
989
|
+
name: id,
|
|
990
|
+
...inlineOption,
|
|
991
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
992
|
+
const checked = utils.enumOptionsIsSelected(option.value, checkboxesValues);
|
|
993
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
994
|
+
return jsxRuntime.jsx(semanticUiReact.Form.Checkbox, {
|
|
979
995
|
id: utils.optionId(id, index),
|
|
980
996
|
name: id,
|
|
981
|
-
label: option.label
|
|
982
|
-
|
|
997
|
+
label: option.label,
|
|
998
|
+
...semanticProps,
|
|
983
999
|
checked: checked,
|
|
984
1000
|
error: rawErrors.length > 0,
|
|
985
1001
|
disabled: disabled || itemDisabled || readonly,
|
|
@@ -988,9 +1004,9 @@
|
|
|
988
1004
|
onBlur: _onBlur,
|
|
989
1005
|
onFocus: _onFocus,
|
|
990
1006
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
991
|
-
}
|
|
1007
|
+
}, index);
|
|
992
1008
|
})
|
|
993
|
-
})
|
|
1009
|
+
})]
|
|
994
1010
|
});
|
|
995
1011
|
}
|
|
996
1012
|
|
|
@@ -1000,52 +1016,53 @@
|
|
|
1000
1016
|
* @param props - The `WidgetProps` for this component
|
|
1001
1017
|
*/
|
|
1002
1018
|
function RadioWidget(props) {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
rawErrors =
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1019
|
+
const {
|
|
1020
|
+
id,
|
|
1021
|
+
value,
|
|
1022
|
+
required,
|
|
1023
|
+
disabled,
|
|
1024
|
+
readonly,
|
|
1025
|
+
onChange,
|
|
1026
|
+
onBlur,
|
|
1027
|
+
onFocus,
|
|
1028
|
+
options,
|
|
1029
|
+
formContext,
|
|
1030
|
+
uiSchema,
|
|
1031
|
+
rawErrors = []
|
|
1032
|
+
} = props;
|
|
1033
|
+
const {
|
|
1034
|
+
enumOptions,
|
|
1035
|
+
enumDisabled,
|
|
1036
|
+
emptyValue
|
|
1037
|
+
} = options;
|
|
1038
|
+
const semanticProps = getSemanticProps({
|
|
1039
|
+
formContext,
|
|
1040
|
+
options,
|
|
1041
|
+
uiSchema
|
|
1023
1042
|
});
|
|
1024
|
-
|
|
1025
|
-
|
|
1043
|
+
const _onChange = (_, {
|
|
1044
|
+
value: eventValue
|
|
1045
|
+
}) => {
|
|
1026
1046
|
return onChange(utils.enumOptionsValueForIndex(eventValue, enumOptions, emptyValue));
|
|
1027
1047
|
};
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
var _onFocus = function _onFocus() {
|
|
1032
|
-
return onFocus(id, value);
|
|
1033
|
-
};
|
|
1034
|
-
var inlineOption = options.inline ? {
|
|
1048
|
+
const _onBlur = () => onBlur(id, value);
|
|
1049
|
+
const _onFocus = () => onFocus(id, value);
|
|
1050
|
+
const inlineOption = options.inline ? {
|
|
1035
1051
|
inline: true
|
|
1036
1052
|
} : {
|
|
1037
1053
|
grouped: true
|
|
1038
1054
|
};
|
|
1039
|
-
return jsxRuntime.jsx(semanticUiReact.Form.Group,
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1055
|
+
return jsxRuntime.jsx(semanticUiReact.Form.Group, {
|
|
1056
|
+
...inlineOption,
|
|
1057
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
1058
|
+
const checked = utils.enumOptionsIsSelected(option.value, value);
|
|
1059
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
1060
|
+
return /*#__PURE__*/react.createElement(semanticUiReact.Form.Field, {
|
|
1044
1061
|
required: required,
|
|
1045
1062
|
control: semanticUiReact.Radio,
|
|
1046
1063
|
id: utils.optionId(id, index),
|
|
1047
|
-
name: id
|
|
1048
|
-
|
|
1064
|
+
name: id,
|
|
1065
|
+
...semanticProps,
|
|
1049
1066
|
onFocus: _onFocus,
|
|
1050
1067
|
onBlur: _onBlur,
|
|
1051
1068
|
onChange: _onChange,
|
|
@@ -1056,9 +1073,9 @@
|
|
|
1056
1073
|
checked: checked,
|
|
1057
1074
|
disabled: disabled || itemDisabled || readonly,
|
|
1058
1075
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1059
|
-
})
|
|
1076
|
+
});
|
|
1060
1077
|
})
|
|
1061
|
-
})
|
|
1078
|
+
});
|
|
1062
1079
|
}
|
|
1063
1080
|
|
|
1064
1081
|
/** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
|
|
@@ -1067,54 +1084,53 @@
|
|
|
1067
1084
|
* @param props - The `WidgetProps` for this component
|
|
1068
1085
|
*/
|
|
1069
1086
|
function RangeWidget(props) {
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
rawErrors =
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1087
|
+
const {
|
|
1088
|
+
id,
|
|
1089
|
+
value,
|
|
1090
|
+
required,
|
|
1091
|
+
readonly,
|
|
1092
|
+
disabled,
|
|
1093
|
+
onChange,
|
|
1094
|
+
onBlur,
|
|
1095
|
+
onFocus,
|
|
1096
|
+
options,
|
|
1097
|
+
schema,
|
|
1098
|
+
uiSchema,
|
|
1099
|
+
formContext,
|
|
1100
|
+
rawErrors = []
|
|
1101
|
+
} = props;
|
|
1102
|
+
const semanticProps = getSemanticProps({
|
|
1103
|
+
formContext,
|
|
1104
|
+
options,
|
|
1105
|
+
uiSchema,
|
|
1088
1106
|
defaultSchemaProps: {
|
|
1089
1107
|
fluid: true
|
|
1090
1108
|
}
|
|
1091
1109
|
});
|
|
1092
1110
|
// eslint-disable-next-line no-shadow
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
var _onFocus = function _onFocus() {
|
|
1101
|
-
return onFocus && onFocus(id, value);
|
|
1102
|
-
};
|
|
1111
|
+
const _onChange = ({
|
|
1112
|
+
target: {
|
|
1113
|
+
value
|
|
1114
|
+
}
|
|
1115
|
+
}) => onChange && onChange(value === '' ? options.emptyValue : value);
|
|
1116
|
+
const _onBlur = () => onBlur && onBlur(id, value);
|
|
1117
|
+
const _onFocus = () => onFocus && onFocus(id, value);
|
|
1103
1118
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1104
|
-
children: [jsxRuntime.jsx(semanticUiReact.Input,
|
|
1119
|
+
children: [jsxRuntime.jsx(semanticUiReact.Input, {
|
|
1105
1120
|
id: id,
|
|
1106
1121
|
name: id,
|
|
1107
1122
|
type: 'range',
|
|
1108
1123
|
required: required,
|
|
1109
|
-
disabled: disabled || readonly
|
|
1110
|
-
|
|
1124
|
+
disabled: disabled || readonly,
|
|
1125
|
+
...utils.rangeSpec(schema),
|
|
1126
|
+
...semanticProps,
|
|
1111
1127
|
value: value || '',
|
|
1112
1128
|
error: rawErrors.length > 0,
|
|
1113
1129
|
onChange: _onChange,
|
|
1114
1130
|
onBlur: _onBlur,
|
|
1115
1131
|
onFocus: _onFocus,
|
|
1116
1132
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1117
|
-
}
|
|
1133
|
+
}, id), jsxRuntime.jsx("span", {
|
|
1118
1134
|
children: value
|
|
1119
1135
|
})]
|
|
1120
1136
|
});
|
|
@@ -1127,17 +1143,16 @@
|
|
|
1127
1143
|
* @returns {*}
|
|
1128
1144
|
*/
|
|
1129
1145
|
function createDefaultValueOptionsForDropDown(enumOptions, enumDisabled) {
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
});
|
|
1146
|
+
const disabledOptions = enumDisabled || [];
|
|
1147
|
+
const options = map__default["default"](enumOptions, ({
|
|
1148
|
+
label,
|
|
1149
|
+
value
|
|
1150
|
+
}, index) => ({
|
|
1151
|
+
disabled: disabledOptions.indexOf(value) !== -1,
|
|
1152
|
+
key: label,
|
|
1153
|
+
text: label,
|
|
1154
|
+
value: String(index)
|
|
1155
|
+
}));
|
|
1141
1156
|
return options;
|
|
1142
1157
|
}
|
|
1143
1158
|
/** The `SelectWidget` is a widget for rendering dropdowns.
|
|
@@ -1146,28 +1161,29 @@
|
|
|
1146
1161
|
* @param props - The `WidgetProps` for this component
|
|
1147
1162
|
*/
|
|
1148
1163
|
function SelectWidget(props) {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
rawErrors =
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1164
|
+
const {
|
|
1165
|
+
uiSchema,
|
|
1166
|
+
formContext,
|
|
1167
|
+
id,
|
|
1168
|
+
options,
|
|
1169
|
+
label,
|
|
1170
|
+
hideLabel,
|
|
1171
|
+
required,
|
|
1172
|
+
disabled,
|
|
1173
|
+
readonly,
|
|
1174
|
+
value,
|
|
1175
|
+
multiple,
|
|
1176
|
+
placeholder,
|
|
1177
|
+
autofocus,
|
|
1178
|
+
onChange,
|
|
1179
|
+
onBlur,
|
|
1180
|
+
onFocus,
|
|
1181
|
+
rawErrors = []
|
|
1182
|
+
} = props;
|
|
1183
|
+
const semanticProps = getSemanticProps({
|
|
1184
|
+
uiSchema,
|
|
1185
|
+
formContext,
|
|
1186
|
+
options,
|
|
1171
1187
|
defaultSchemaProps: {
|
|
1172
1188
|
inverted: 'false',
|
|
1173
1189
|
selection: true,
|
|
@@ -1176,26 +1192,29 @@
|
|
|
1176
1192
|
upward: false
|
|
1177
1193
|
}
|
|
1178
1194
|
});
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1195
|
+
const {
|
|
1196
|
+
enumDisabled,
|
|
1197
|
+
enumOptions,
|
|
1198
|
+
emptyValue: optEmptyVal
|
|
1199
|
+
} = options;
|
|
1200
|
+
const emptyValue = multiple ? [] : '';
|
|
1201
|
+
const dropdownOptions = createDefaultValueOptionsForDropDown(enumOptions, enumDisabled);
|
|
1202
|
+
const _onChange = (_, {
|
|
1203
|
+
value
|
|
1204
|
+
}) => onChange(utils.enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
|
|
1188
1205
|
// eslint-disable-next-line no-shadow
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1206
|
+
const _onBlur = (_, {
|
|
1207
|
+
target: {
|
|
1208
|
+
value
|
|
1209
|
+
}
|
|
1210
|
+
}) => onBlur(id, utils.enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
|
|
1211
|
+
const _onFocus = (_, {
|
|
1212
|
+
target: {
|
|
1213
|
+
value
|
|
1214
|
+
}
|
|
1215
|
+
}) => onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
|
|
1216
|
+
const selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
1217
|
+
return jsxRuntime.jsx(semanticUiReact.Form.Dropdown, {
|
|
1199
1218
|
id: id,
|
|
1200
1219
|
name: id,
|
|
1201
1220
|
label: utils.labelValue(label || undefined, hideLabel, false),
|
|
@@ -1203,8 +1222,8 @@
|
|
|
1203
1222
|
value: typeof value === 'undefined' ? emptyValue : selectedIndexes,
|
|
1204
1223
|
error: rawErrors.length > 0,
|
|
1205
1224
|
disabled: disabled,
|
|
1206
|
-
placeholder: placeholder
|
|
1207
|
-
|
|
1225
|
+
placeholder: placeholder,
|
|
1226
|
+
...semanticProps,
|
|
1208
1227
|
required: required,
|
|
1209
1228
|
autoFocus: autofocus,
|
|
1210
1229
|
readOnly: readonly,
|
|
@@ -1213,7 +1232,7 @@
|
|
|
1213
1232
|
onBlur: _onBlur,
|
|
1214
1233
|
onFocus: _onFocus,
|
|
1215
1234
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1216
|
-
}
|
|
1235
|
+
}, id);
|
|
1217
1236
|
}
|
|
1218
1237
|
|
|
1219
1238
|
/** The `TextareaWidget` is a widget for rendering input fields as textarea.
|
|
@@ -1221,49 +1240,47 @@
|
|
|
1221
1240
|
* @param props - The `WidgetProps` for this component
|
|
1222
1241
|
*/
|
|
1223
1242
|
function TextareaWidget(props) {
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
rawErrors =
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
+
const {
|
|
1244
|
+
id,
|
|
1245
|
+
placeholder,
|
|
1246
|
+
value,
|
|
1247
|
+
required,
|
|
1248
|
+
disabled,
|
|
1249
|
+
autofocus,
|
|
1250
|
+
label,
|
|
1251
|
+
hideLabel,
|
|
1252
|
+
readonly,
|
|
1253
|
+
onBlur,
|
|
1254
|
+
onFocus,
|
|
1255
|
+
onChange,
|
|
1256
|
+
options,
|
|
1257
|
+
formContext,
|
|
1258
|
+
rawErrors = []
|
|
1259
|
+
} = props;
|
|
1260
|
+
const semanticProps = getSemanticProps({
|
|
1261
|
+
formContext,
|
|
1262
|
+
options,
|
|
1243
1263
|
defaultSchemaProps: {
|
|
1244
1264
|
inverted: 'false'
|
|
1245
1265
|
}
|
|
1246
1266
|
});
|
|
1247
1267
|
// eslint-disable-next-line no-shadow
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
return onFocus && onFocus(id, value);
|
|
1257
|
-
};
|
|
1258
|
-
return jsxRuntime.jsx(semanticUiReact.Form.TextArea, _extends({
|
|
1268
|
+
const _onChange = ({
|
|
1269
|
+
target: {
|
|
1270
|
+
value
|
|
1271
|
+
}
|
|
1272
|
+
}) => onChange && onChange(value === '' ? options.emptyValue : value);
|
|
1273
|
+
const _onBlur = () => onBlur && onBlur(id, value);
|
|
1274
|
+
const _onFocus = () => onFocus && onFocus(id, value);
|
|
1275
|
+
return jsxRuntime.jsx(semanticUiReact.Form.TextArea, {
|
|
1259
1276
|
id: id,
|
|
1260
1277
|
name: id,
|
|
1261
1278
|
label: utils.labelValue(label || undefined, hideLabel, false),
|
|
1262
1279
|
placeholder: placeholder,
|
|
1263
1280
|
autoFocus: autofocus,
|
|
1264
1281
|
required: required,
|
|
1265
|
-
disabled: disabled || readonly
|
|
1266
|
-
|
|
1282
|
+
disabled: disabled || readonly,
|
|
1283
|
+
...semanticProps,
|
|
1267
1284
|
value: value || '',
|
|
1268
1285
|
error: rawErrors.length > 0,
|
|
1269
1286
|
rows: options.rows || 5,
|
|
@@ -1271,17 +1288,17 @@
|
|
|
1271
1288
|
onBlur: _onBlur,
|
|
1272
1289
|
onFocus: _onFocus,
|
|
1273
1290
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1274
|
-
}
|
|
1291
|
+
}, id);
|
|
1275
1292
|
}
|
|
1276
1293
|
|
|
1277
1294
|
function generateWidgets() {
|
|
1278
1295
|
return {
|
|
1279
|
-
CheckboxWidget
|
|
1280
|
-
CheckboxesWidget
|
|
1281
|
-
RadioWidget
|
|
1282
|
-
RangeWidget
|
|
1283
|
-
SelectWidget
|
|
1284
|
-
TextareaWidget
|
|
1296
|
+
CheckboxWidget,
|
|
1297
|
+
CheckboxesWidget,
|
|
1298
|
+
RadioWidget,
|
|
1299
|
+
RangeWidget,
|
|
1300
|
+
SelectWidget,
|
|
1301
|
+
TextareaWidget
|
|
1285
1302
|
};
|
|
1286
1303
|
}
|
|
1287
1304
|
var Widgets = /*#__PURE__*/generateWidgets();
|