@rjsf/semantic-ui 5.2.0 → 5.2.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/LICENSE.md +183 -183
- package/README.md +15 -12
- package/dist/semantic-ui.cjs.development.js +383 -335
- 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 +383 -334
- package/dist/semantic-ui.esm.js.map +1 -1
- package/dist/semantic-ui.umd.development.js +385 -338
- 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 +5 -5
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@rjsf/core'), require('semantic-ui-react'), require('react'), require('@rjsf/utils'), require('nanoid'), require('lodash-es/map')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@rjsf/core', 'semantic-ui-react', 'react', '@rjsf/utils', 'nanoid', 'lodash-es/map'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@rjsf/semantic-ui"] = {}, global.core, global.semanticUiReact, global.
|
|
5
|
-
})(this, (function (exports, core, semanticUiReact,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@rjsf/core'), require('semantic-ui-react'), require('react/jsx-runtime'), require('@rjsf/utils'), require('nanoid'), require('react'), require('lodash-es/map')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@rjsf/core', 'semantic-ui-react', 'react/jsx-runtime', '@rjsf/utils', 'nanoid', 'react', 'lodash-es/map'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@rjsf/semantic-ui"] = {}, global.core, global.semanticUiReact, global.jsxRuntime, global.utils, global.nanoid, global.React, global.map));
|
|
5
|
+
})(this, (function (exports, core, semanticUiReact, jsxRuntime, utils, nanoid, react, map) { '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 map__default = /*#__PURE__*/_interopDefaultLegacy(map);
|
|
11
10
|
|
|
12
11
|
function _extends() {
|
|
@@ -44,14 +43,15 @@
|
|
|
44
43
|
color = _ref.color,
|
|
45
44
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
46
45
|
var translateString = registry.translateString;
|
|
47
|
-
return
|
|
46
|
+
return jsxRuntime.jsx(semanticUiReact.Button, _extends({
|
|
48
47
|
title: translateString(utils.TranslatableString.AddItemButton),
|
|
49
48
|
color: color
|
|
50
49
|
}, props, {
|
|
51
50
|
icon: true,
|
|
52
|
-
size:
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
size: 'tiny',
|
|
52
|
+
children: jsxRuntime.jsx(semanticUiReact.Icon, {
|
|
53
|
+
name: 'plus'
|
|
54
|
+
})
|
|
55
55
|
}));
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
options = _ref2$options === void 0 ? {} : _ref2$options,
|
|
106
106
|
_ref2$defaultProps = _ref2.defaultProps,
|
|
107
107
|
defaultProps = _ref2$defaultProps === void 0 ? {
|
|
108
|
-
size:
|
|
109
|
-
pointing:
|
|
108
|
+
size: 'small',
|
|
109
|
+
pointing: 'above'
|
|
110
110
|
} : _ref2$defaultProps;
|
|
111
111
|
var formContextProps = formContext.semantic && formContext.semantic.errorOptions;
|
|
112
112
|
var semanticOptions = utils.getUiOptions(uiSchema).semantic;
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
// returning them as a string
|
|
137
137
|
return [].concat(new Set(classList.filter(function (cn) {
|
|
138
138
|
return !omit.includes(cn);
|
|
139
|
-
}))).join(
|
|
139
|
+
}))).join(' ');
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
142
|
*
|
|
@@ -149,14 +149,14 @@
|
|
|
149
149
|
function MaybeWrap(_ref3) {
|
|
150
150
|
var wrap = _ref3.wrap,
|
|
151
151
|
_ref3$component = _ref3.component,
|
|
152
|
-
Component = _ref3$component === void 0 ?
|
|
152
|
+
Component = _ref3$component === void 0 ? 'div' : _ref3$component,
|
|
153
153
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded$3);
|
|
154
|
-
return wrap ?
|
|
154
|
+
return wrap ? jsxRuntime.jsx(Component, _extends({}, props)) : props.children;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
var gridStyle = function gridStyle(vertical) {
|
|
158
158
|
return {
|
|
159
|
-
display:
|
|
159
|
+
display: 'grid',
|
|
160
160
|
gridTemplateColumns: "1fr " + (vertical ? 65 : 110) + "px"
|
|
161
161
|
};
|
|
162
162
|
};
|
|
@@ -188,40 +188,47 @@
|
|
|
188
188
|
horizontalButtons = _uiOptions$semantic$h === void 0 ? false : _uiOptions$semantic$h,
|
|
189
189
|
_uiOptions$semantic$w = _uiOptions$semantic.wrapItem,
|
|
190
190
|
wrapItem = _uiOptions$semantic$w === void 0 ? false : _uiOptions$semantic$w;
|
|
191
|
-
return
|
|
192
|
-
className:
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
191
|
+
return jsxRuntime.jsx("div", {
|
|
192
|
+
className: 'array-item',
|
|
193
|
+
children: jsxRuntime.jsx(MaybeWrap, {
|
|
194
|
+
wrap: wrapItem,
|
|
195
|
+
component: semanticUiReact.Segment,
|
|
196
|
+
children: jsxRuntime.jsxs(semanticUiReact.Grid, {
|
|
197
|
+
style: index !== 0 ? _extends({}, gridStyle(!horizontalButtons), {
|
|
198
|
+
alignItems: 'center'
|
|
199
|
+
}) : gridStyle(!horizontalButtons),
|
|
200
|
+
children: [jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
201
|
+
width: 16,
|
|
202
|
+
verticalAlign: 'middle',
|
|
203
|
+
children: children
|
|
204
|
+
}), hasToolbar && jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
205
|
+
children: (hasMoveUp || hasMoveDown || hasRemove) && jsxRuntime.jsxs(semanticUiReact.Button.Group, {
|
|
206
|
+
size: 'mini',
|
|
207
|
+
vertical: !horizontalButtons,
|
|
208
|
+
children: [(hasMoveUp || hasMoveDown) && jsxRuntime.jsx(MoveUpButton, {
|
|
209
|
+
className: 'array-item-move-up',
|
|
210
|
+
disabled: disabled || readonly || !hasMoveUp,
|
|
211
|
+
onClick: onReorderClick(index, index - 1),
|
|
212
|
+
uiSchema: uiSchema,
|
|
213
|
+
registry: registry
|
|
214
|
+
}), (hasMoveUp || hasMoveDown) && jsxRuntime.jsx(MoveDownButton, {
|
|
215
|
+
className: 'array-item-move-down',
|
|
216
|
+
disabled: disabled || readonly || !hasMoveDown,
|
|
217
|
+
onClick: onReorderClick(index, index + 1),
|
|
218
|
+
uiSchema: uiSchema,
|
|
219
|
+
registry: registry
|
|
220
|
+
}), hasRemove && jsxRuntime.jsx(RemoveButton, {
|
|
221
|
+
className: 'array-item-remove',
|
|
222
|
+
disabled: disabled || readonly,
|
|
223
|
+
onClick: onDropIndexClick(index),
|
|
224
|
+
uiSchema: uiSchema,
|
|
225
|
+
registry: registry
|
|
226
|
+
})]
|
|
227
|
+
})
|
|
228
|
+
})]
|
|
229
|
+
})
|
|
230
|
+
})
|
|
231
|
+
});
|
|
225
232
|
}
|
|
226
233
|
|
|
227
234
|
var _excluded$2 = ["key", "uiSchema"];
|
|
@@ -258,57 +265,58 @@
|
|
|
258
265
|
wrapItem: wrapItem
|
|
259
266
|
};
|
|
260
267
|
var uiOptions = utils.getUiOptions(uiSchema);
|
|
261
|
-
var ArrayFieldDescriptionTemplate = utils.getTemplate(
|
|
262
|
-
var ArrayFieldItemTemplate = utils.getTemplate(
|
|
263
|
-
var ArrayFieldTitleTemplate = utils.getTemplate(
|
|
268
|
+
var ArrayFieldDescriptionTemplate = utils.getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
|
|
269
|
+
var ArrayFieldItemTemplate = utils.getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
|
|
270
|
+
var ArrayFieldTitleTemplate = utils.getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
|
|
264
271
|
// Button templates are not overridden in the uiSchema
|
|
265
272
|
var AddButton = registry.templates.ButtonTemplates.AddButton;
|
|
266
|
-
return
|
|
267
|
-
className: cleanClassNames([className, utils.isFixedItems(schema) ?
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
273
|
+
return jsxRuntime.jsxs("div", {
|
|
274
|
+
className: cleanClassNames([className, utils.isFixedItems(schema) ? '' : 'sortable-form-fields']),
|
|
275
|
+
children: [jsxRuntime.jsx(ArrayFieldTitleTemplate, {
|
|
276
|
+
idSchema: idSchema,
|
|
277
|
+
title: uiOptions.title || title,
|
|
278
|
+
schema: schema,
|
|
279
|
+
uiSchema: uiSchema,
|
|
280
|
+
required: required,
|
|
281
|
+
registry: registry
|
|
282
|
+
}), jsxRuntime.jsx(ArrayFieldDescriptionTemplate, {
|
|
283
|
+
idSchema: idSchema,
|
|
284
|
+
description: uiOptions.description || schema.description,
|
|
285
|
+
schema: schema,
|
|
286
|
+
uiSchema: uiSchema,
|
|
287
|
+
registry: registry
|
|
288
|
+
}), jsxRuntime.jsxs("div", {
|
|
289
|
+
children: [jsxRuntime.jsx("div", {
|
|
290
|
+
className: 'row array-item-list',
|
|
291
|
+
children: items && items.map(function (_ref) {
|
|
292
|
+
var _extends2;
|
|
293
|
+
var key = _ref.key,
|
|
294
|
+
_ref$uiSchema = _ref.uiSchema,
|
|
295
|
+
itemUiSchema = _ref$uiSchema === void 0 ? {} : _ref$uiSchema,
|
|
296
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
297
|
+
// Merge in the semantic props from the ArrayFieldTemplate into each of the items
|
|
298
|
+
var mergedUiSchema = _extends({}, itemUiSchema, (_extends2 = {}, _extends2[utils.UI_OPTIONS_KEY] = _extends({}, itemUiSchema[utils.UI_OPTIONS_KEY], {
|
|
299
|
+
semantic: semantic
|
|
300
|
+
}), _extends2));
|
|
301
|
+
return jsxRuntime.jsx(ArrayFieldItemTemplate, _extends({}, props, {
|
|
302
|
+
uiSchema: mergedUiSchema
|
|
303
|
+
}), key);
|
|
304
|
+
})
|
|
305
|
+
}), canAdd && jsxRuntime.jsx("div", {
|
|
306
|
+
style: {
|
|
307
|
+
marginTop: '1rem',
|
|
308
|
+
position: 'relative',
|
|
309
|
+
textAlign: 'right'
|
|
310
|
+
},
|
|
311
|
+
children: jsxRuntime.jsx(AddButton, {
|
|
312
|
+
onClick: onAddClick,
|
|
313
|
+
disabled: disabled || readonly,
|
|
314
|
+
uiSchema: uiSchema,
|
|
315
|
+
registry: registry
|
|
316
|
+
})
|
|
317
|
+
})]
|
|
318
|
+
}, "array-item-list-" + idSchema.$id)]
|
|
319
|
+
});
|
|
312
320
|
}
|
|
313
321
|
|
|
314
322
|
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
@@ -326,6 +334,7 @@
|
|
|
326
334
|
readonly = props.readonly,
|
|
327
335
|
disabled = props.disabled,
|
|
328
336
|
onChange = props.onChange,
|
|
337
|
+
onChangeOverride = props.onChangeOverride,
|
|
329
338
|
onBlur = props.onBlur,
|
|
330
339
|
onFocus = props.onFocus,
|
|
331
340
|
autofocus = props.autofocus,
|
|
@@ -346,7 +355,7 @@
|
|
|
346
355
|
var schemaUtils = registry.schemaUtils;
|
|
347
356
|
var _onChange = function _onChange(_ref) {
|
|
348
357
|
var value = _ref.target.value;
|
|
349
|
-
return onChange(value ===
|
|
358
|
+
return onChange(value === '' ? options.emptyValue : value);
|
|
350
359
|
};
|
|
351
360
|
var _onBlur = function _onBlur() {
|
|
352
361
|
return onBlur && onBlur(id, value);
|
|
@@ -355,32 +364,33 @@
|
|
|
355
364
|
return onFocus && onFocus(id, value);
|
|
356
365
|
};
|
|
357
366
|
var displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema);
|
|
358
|
-
return
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
367
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
368
|
+
children: [jsxRuntime.jsx(semanticUiReact.Form.Input, _extends({
|
|
369
|
+
id: id,
|
|
370
|
+
name: id,
|
|
371
|
+
placeholder: placeholder
|
|
372
|
+
}, inputProps, {
|
|
373
|
+
label: displayLabel ? label || schema.title : false,
|
|
374
|
+
required: required,
|
|
375
|
+
autoFocus: autofocus,
|
|
376
|
+
disabled: disabled || readonly,
|
|
377
|
+
list: schema.examples ? utils.examplesId(id) : undefined
|
|
378
|
+
}, semanticProps, {
|
|
379
|
+
value: value || value === 0 ? value : '',
|
|
380
|
+
error: rawErrors.length > 0,
|
|
381
|
+
onChange: onChangeOverride || _onChange,
|
|
382
|
+
onBlur: _onBlur,
|
|
383
|
+
onFocus: _onFocus,
|
|
384
|
+
"aria-describedby": utils.ariaDescribedByIds(id, !!schema.examples)
|
|
385
|
+
}), id), Array.isArray(schema.examples) && jsxRuntime.jsx("datalist", {
|
|
386
|
+
id: utils.examplesId(id),
|
|
387
|
+
children: schema.examples.concat(schema["default"] && !schema.examples.includes(schema["default"]) ? [schema["default"]] : []).map(function (example) {
|
|
388
|
+
return jsxRuntime.jsx("option", {
|
|
389
|
+
value: example
|
|
390
|
+
}, example);
|
|
391
|
+
})
|
|
392
|
+
})]
|
|
393
|
+
});
|
|
384
394
|
}
|
|
385
395
|
|
|
386
396
|
/** The `DescriptionField` is the template to use to render the description of a field
|
|
@@ -393,10 +403,11 @@
|
|
|
393
403
|
if (!description) {
|
|
394
404
|
return null;
|
|
395
405
|
}
|
|
396
|
-
return
|
|
406
|
+
return jsxRuntime.jsx("p", {
|
|
397
407
|
id: id,
|
|
398
|
-
className:
|
|
399
|
-
|
|
408
|
+
className: 'sui-description',
|
|
409
|
+
children: description
|
|
410
|
+
});
|
|
400
411
|
}
|
|
401
412
|
|
|
402
413
|
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
@@ -407,13 +418,18 @@
|
|
|
407
418
|
var errors = _ref.errors,
|
|
408
419
|
registry = _ref.registry;
|
|
409
420
|
var translateString = registry.translateString;
|
|
410
|
-
return
|
|
411
|
-
negative: true
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
421
|
+
return jsxRuntime.jsxs(semanticUiReact.Message, {
|
|
422
|
+
negative: true,
|
|
423
|
+
children: [jsxRuntime.jsx(semanticUiReact.Message.Header, {
|
|
424
|
+
children: translateString(utils.TranslatableString.ErrorsLabel)
|
|
425
|
+
}), jsxRuntime.jsx(semanticUiReact.Message.List, {
|
|
426
|
+
children: errors.map(function (error, index) {
|
|
427
|
+
return jsxRuntime.jsx(semanticUiReact.Message.Item, {
|
|
428
|
+
children: error.stack
|
|
429
|
+
}, "error-" + index);
|
|
430
|
+
})
|
|
431
|
+
})]
|
|
432
|
+
});
|
|
417
433
|
}
|
|
418
434
|
|
|
419
435
|
var _excluded$1 = ["icon", "iconType", "color", "className", "uiSchema", "registry"];
|
|
@@ -423,7 +439,7 @@
|
|
|
423
439
|
color = props.color,
|
|
424
440
|
className = props.className,
|
|
425
441
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
|
|
426
|
-
return
|
|
442
|
+
return jsxRuntime.jsx(semanticUiReact.Button, _extends({
|
|
427
443
|
icon: icon,
|
|
428
444
|
size: iconType,
|
|
429
445
|
color: color,
|
|
@@ -432,33 +448,33 @@
|
|
|
432
448
|
}
|
|
433
449
|
function MoveDownButton(props) {
|
|
434
450
|
var translateString = props.registry.translateString;
|
|
435
|
-
return
|
|
451
|
+
return jsxRuntime.jsx(IconButton, _extends({
|
|
436
452
|
title: translateString(utils.TranslatableString.MoveDownButton)
|
|
437
453
|
}, props, {
|
|
438
|
-
icon:
|
|
454
|
+
icon: 'angle down'
|
|
439
455
|
}));
|
|
440
456
|
}
|
|
441
457
|
function MoveUpButton(props) {
|
|
442
458
|
var translateString = props.registry.translateString;
|
|
443
|
-
return
|
|
459
|
+
return jsxRuntime.jsx(IconButton, _extends({
|
|
444
460
|
title: translateString(utils.TranslatableString.MoveUpButton)
|
|
445
461
|
}, props, {
|
|
446
|
-
icon:
|
|
462
|
+
icon: 'angle up'
|
|
447
463
|
}));
|
|
448
464
|
}
|
|
449
465
|
function RemoveButton(props) {
|
|
450
466
|
var translateString = props.registry.translateString;
|
|
451
|
-
return
|
|
467
|
+
return jsxRuntime.jsx(IconButton, _extends({
|
|
452
468
|
title: translateString(utils.TranslatableString.RemoveButton)
|
|
453
469
|
}, props, {
|
|
454
|
-
icon:
|
|
470
|
+
icon: 'trash'
|
|
455
471
|
}));
|
|
456
472
|
}
|
|
457
473
|
|
|
458
474
|
var DEFAULT_OPTIONS$1 = {
|
|
459
475
|
options: {
|
|
460
|
-
pointing:
|
|
461
|
-
size:
|
|
476
|
+
pointing: 'above',
|
|
477
|
+
size: 'small'
|
|
462
478
|
}
|
|
463
479
|
};
|
|
464
480
|
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
@@ -480,19 +496,21 @@
|
|
|
480
496
|
size = options.size;
|
|
481
497
|
if (errors && errors.length > 0) {
|
|
482
498
|
var id = utils.errorId(idSchema);
|
|
483
|
-
return
|
|
499
|
+
return jsxRuntime.jsx(semanticUiReact.Label, {
|
|
484
500
|
id: id,
|
|
485
|
-
color:
|
|
486
|
-
pointing: pointing ||
|
|
487
|
-
size: size ||
|
|
488
|
-
basic: true
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
501
|
+
color: 'red',
|
|
502
|
+
pointing: pointing || 'above',
|
|
503
|
+
size: size || 'small',
|
|
504
|
+
basic: true,
|
|
505
|
+
children: jsxRuntime.jsx(semanticUiReact.List, {
|
|
506
|
+
bulleted: true,
|
|
507
|
+
children: errors.map(function (error) {
|
|
508
|
+
return jsxRuntime.jsx(semanticUiReact.List.Item, {
|
|
509
|
+
children: error
|
|
510
|
+
}, nanoid.nanoid());
|
|
511
|
+
})
|
|
512
|
+
})
|
|
513
|
+
});
|
|
496
514
|
}
|
|
497
515
|
return null;
|
|
498
516
|
}
|
|
@@ -506,8 +524,8 @@
|
|
|
506
524
|
help = props.help;
|
|
507
525
|
if (help) {
|
|
508
526
|
var id = utils.helpId(idSchema);
|
|
509
|
-
return
|
|
510
|
-
size:
|
|
527
|
+
return jsxRuntime.jsx(semanticUiReact.Message, {
|
|
528
|
+
size: 'mini',
|
|
511
529
|
info: true,
|
|
512
530
|
id: id,
|
|
513
531
|
content: help
|
|
@@ -541,16 +559,17 @@
|
|
|
541
559
|
var wrapLabel = semanticProps.wrapLabel,
|
|
542
560
|
wrapContent = semanticProps.wrapContent;
|
|
543
561
|
var uiOptions = utils.getUiOptions(uiSchema);
|
|
544
|
-
var WrapIfAdditionalTemplate = utils.getTemplate(
|
|
545
|
-
var DescriptionFieldTemplate = utils.getTemplate(
|
|
562
|
+
var WrapIfAdditionalTemplate = utils.getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
|
|
563
|
+
var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, uiOptions);
|
|
546
564
|
if (hidden) {
|
|
547
|
-
return
|
|
565
|
+
return jsxRuntime.jsx("div", {
|
|
548
566
|
style: {
|
|
549
|
-
display:
|
|
550
|
-
}
|
|
551
|
-
|
|
567
|
+
display: 'none'
|
|
568
|
+
},
|
|
569
|
+
children: children
|
|
570
|
+
});
|
|
552
571
|
}
|
|
553
|
-
return
|
|
572
|
+
return jsxRuntime.jsx(WrapIfAdditionalTemplate, _extends({
|
|
554
573
|
classNames: classNames,
|
|
555
574
|
style: style,
|
|
556
575
|
id: id,
|
|
@@ -558,23 +577,27 @@
|
|
|
558
577
|
registry: registry,
|
|
559
578
|
schema: schema,
|
|
560
579
|
uiSchema: uiSchema
|
|
561
|
-
}, otherProps
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
580
|
+
}, otherProps, {
|
|
581
|
+
children: jsxRuntime.jsx(semanticUiReact.Form.Group, {
|
|
582
|
+
widths: 'equal',
|
|
583
|
+
grouped: true,
|
|
584
|
+
children: jsxRuntime.jsxs(MaybeWrap, {
|
|
585
|
+
wrap: wrapContent,
|
|
586
|
+
className: 'sui-field-content',
|
|
587
|
+
children: [children, displayLabel && rawDescription && jsxRuntime.jsx(MaybeWrap, {
|
|
588
|
+
wrap: wrapLabel,
|
|
589
|
+
className: 'sui-field-label',
|
|
590
|
+
children: rawDescription && jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
591
|
+
id: utils.descriptionId(id),
|
|
592
|
+
description: rawDescription,
|
|
593
|
+
schema: schema,
|
|
594
|
+
uiSchema: uiSchema,
|
|
595
|
+
registry: registry
|
|
596
|
+
})
|
|
597
|
+
}), help, errors]
|
|
598
|
+
})
|
|
599
|
+
}, id)
|
|
600
|
+
}));
|
|
578
601
|
}
|
|
579
602
|
|
|
580
603
|
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
|
|
@@ -597,42 +620,48 @@
|
|
|
597
620
|
idSchema = props.idSchema,
|
|
598
621
|
registry = props.registry;
|
|
599
622
|
var uiOptions = utils.getUiOptions(uiSchema);
|
|
600
|
-
var TitleFieldTemplate = utils.getTemplate(
|
|
601
|
-
var DescriptionFieldTemplate = utils.getTemplate(
|
|
623
|
+
var TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, uiOptions);
|
|
624
|
+
var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, uiOptions);
|
|
602
625
|
// Button templates are not overridden in the uiSchema
|
|
603
626
|
var AddButton = registry.templates.ButtonTemplates.AddButton;
|
|
604
627
|
var fieldTitle = uiOptions.title || title;
|
|
605
628
|
var fieldDescription = uiOptions.description || description;
|
|
606
|
-
return
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
629
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
630
|
+
children: [fieldTitle && jsxRuntime.jsx(TitleFieldTemplate, {
|
|
631
|
+
id: utils.titleId(idSchema),
|
|
632
|
+
title: fieldTitle,
|
|
633
|
+
required: required,
|
|
634
|
+
schema: schema,
|
|
635
|
+
uiSchema: uiSchema,
|
|
636
|
+
registry: registry
|
|
637
|
+
}), fieldDescription && jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
638
|
+
id: utils.descriptionId(idSchema),
|
|
639
|
+
description: fieldDescription,
|
|
640
|
+
schema: schema,
|
|
641
|
+
uiSchema: uiSchema,
|
|
642
|
+
registry: registry
|
|
643
|
+
}), properties.map(function (prop) {
|
|
644
|
+
return prop.content;
|
|
645
|
+
}), utils.canExpand(schema, uiSchema, formData) && jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
646
|
+
width: 16,
|
|
647
|
+
verticalAlign: 'middle',
|
|
648
|
+
children: jsxRuntime.jsx(semanticUiReact.Grid.Row, {
|
|
649
|
+
children: jsxRuntime.jsx("div", {
|
|
650
|
+
style: {
|
|
651
|
+
marginTop: '1rem',
|
|
652
|
+
position: 'relative',
|
|
653
|
+
textAlign: 'right'
|
|
654
|
+
},
|
|
655
|
+
children: jsxRuntime.jsx(AddButton, {
|
|
656
|
+
onClick: onAddClick(schema),
|
|
657
|
+
disabled: disabled || readonly,
|
|
658
|
+
uiSchema: uiSchema,
|
|
659
|
+
registry: registry
|
|
660
|
+
})
|
|
661
|
+
})
|
|
662
|
+
})
|
|
663
|
+
})]
|
|
664
|
+
});
|
|
636
665
|
}
|
|
637
666
|
|
|
638
667
|
/** The `SubmitButton` renders a button that represent the `Submit` action on a form
|
|
@@ -647,10 +676,12 @@
|
|
|
647
676
|
if (norender) {
|
|
648
677
|
return null;
|
|
649
678
|
}
|
|
650
|
-
return
|
|
651
|
-
type:
|
|
679
|
+
return jsxRuntime.jsx(semanticUiReact.Button, _extends({
|
|
680
|
+
type: 'submit',
|
|
652
681
|
primary: true
|
|
653
|
-
}, submitButtonProps
|
|
682
|
+
}, submitButtonProps, {
|
|
683
|
+
children: submitText
|
|
684
|
+
}));
|
|
654
685
|
}
|
|
655
686
|
|
|
656
687
|
var DEFAULT_OPTIONS = {
|
|
@@ -672,11 +703,12 @@
|
|
|
672
703
|
if (!title) {
|
|
673
704
|
return null;
|
|
674
705
|
}
|
|
675
|
-
return
|
|
706
|
+
return jsxRuntime.jsx(semanticUiReact.Header, _extends({
|
|
676
707
|
id: id
|
|
677
708
|
}, semanticProps, {
|
|
678
|
-
as:
|
|
679
|
-
|
|
709
|
+
as: 'h5',
|
|
710
|
+
children: title
|
|
711
|
+
}));
|
|
680
712
|
}
|
|
681
713
|
|
|
682
714
|
/** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
|
|
@@ -709,51 +741,60 @@
|
|
|
709
741
|
wrapperStyle = _registry$formContext.wrapperStyle;
|
|
710
742
|
var additional = (utils.ADDITIONAL_PROPERTY_FLAG in schema);
|
|
711
743
|
if (!additional) {
|
|
712
|
-
return
|
|
744
|
+
return jsxRuntime.jsx("div", {
|
|
713
745
|
className: classNames,
|
|
714
|
-
style: style
|
|
715
|
-
|
|
746
|
+
style: style,
|
|
747
|
+
children: children
|
|
748
|
+
});
|
|
716
749
|
}
|
|
717
750
|
var handleBlur = function handleBlur(_ref) {
|
|
718
751
|
var target = _ref.target;
|
|
719
752
|
return onKeyChange(target.value);
|
|
720
753
|
};
|
|
721
|
-
return
|
|
754
|
+
return jsxRuntime.jsx("div", {
|
|
722
755
|
className: classNames,
|
|
723
756
|
style: style,
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
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
|
+
children: jsxRuntime.jsx(semanticUiReact.Grid, {
|
|
758
|
+
columns: 'equal',
|
|
759
|
+
children: jsxRuntime.jsxs(semanticUiReact.Grid.Row, {
|
|
760
|
+
children: [jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
761
|
+
className: 'form-additional',
|
|
762
|
+
children: jsxRuntime.jsx(semanticUiReact.Form.Group, {
|
|
763
|
+
widths: 'equal',
|
|
764
|
+
grouped: true,
|
|
765
|
+
children: jsxRuntime.jsx(semanticUiReact.Form.Input, {
|
|
766
|
+
className: 'form-group',
|
|
767
|
+
hasFeedback: true,
|
|
768
|
+
fluid: true,
|
|
769
|
+
htmlFor: "" + id,
|
|
770
|
+
label: keyLabel,
|
|
771
|
+
required: required,
|
|
772
|
+
defaultValue: label,
|
|
773
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
774
|
+
id: "" + id,
|
|
775
|
+
name: "" + id,
|
|
776
|
+
onBlur: !readonly ? handleBlur : undefined,
|
|
777
|
+
style: wrapperStyle,
|
|
778
|
+
type: 'text'
|
|
779
|
+
})
|
|
780
|
+
})
|
|
781
|
+
}), jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
782
|
+
className: 'form-additional',
|
|
783
|
+
verticalAlign: 'middle',
|
|
784
|
+
children: children
|
|
785
|
+
}), jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
786
|
+
children: jsxRuntime.jsx(RemoveButton, {
|
|
787
|
+
iconType: 'mini',
|
|
788
|
+
className: 'array-item-remove',
|
|
789
|
+
disabled: disabled || readonly,
|
|
790
|
+
onClick: onDropPropertyClick(label),
|
|
791
|
+
uiSchema: uiSchema,
|
|
792
|
+
registry: registry
|
|
793
|
+
})
|
|
794
|
+
})]
|
|
795
|
+
})
|
|
796
|
+
})
|
|
797
|
+
}, id + "-key");
|
|
757
798
|
}
|
|
758
799
|
|
|
759
800
|
function generateTemplates() {
|
|
@@ -822,20 +863,20 @@
|
|
|
822
863
|
var _onFocus = function _onFocus() {
|
|
823
864
|
return onFocus && onFocus(id, value);
|
|
824
865
|
};
|
|
825
|
-
var checked = value ==
|
|
826
|
-
return
|
|
866
|
+
var checked = value == 'true' || value == true;
|
|
867
|
+
return jsxRuntime.jsx(semanticUiReact.Form.Checkbox, _extends({
|
|
827
868
|
id: id,
|
|
828
869
|
name: id,
|
|
829
870
|
disabled: disabled || readonly,
|
|
830
871
|
autoFocus: autofocus
|
|
831
872
|
}, semanticProps, {
|
|
832
|
-
checked: typeof value ===
|
|
873
|
+
checked: typeof value === 'undefined' ? false : checked,
|
|
833
874
|
error: rawErrors.length > 0,
|
|
834
875
|
onChange: _onChange,
|
|
835
876
|
onBlur: _onBlur,
|
|
836
877
|
onFocus: _onFocus,
|
|
837
878
|
required: required,
|
|
838
|
-
label: label ||
|
|
879
|
+
label: label || '',
|
|
839
880
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
840
881
|
}));
|
|
841
882
|
}
|
|
@@ -861,7 +902,7 @@
|
|
|
861
902
|
_props$rawErrors = props.rawErrors,
|
|
862
903
|
rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors,
|
|
863
904
|
registry = props.registry;
|
|
864
|
-
var TitleFieldTemplate = utils.getTemplate(
|
|
905
|
+
var TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, options);
|
|
865
906
|
var enumOptions = options.enumOptions,
|
|
866
907
|
enumDisabled = options.enumDisabled,
|
|
867
908
|
inline = options.inline;
|
|
@@ -897,34 +938,37 @@
|
|
|
897
938
|
} : {
|
|
898
939
|
grouped: true
|
|
899
940
|
};
|
|
900
|
-
return
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
941
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
942
|
+
children: [title && jsxRuntime.jsx(TitleFieldTemplate, {
|
|
943
|
+
id: utils.titleId(id),
|
|
944
|
+
title: title,
|
|
945
|
+
schema: schema,
|
|
946
|
+
uiSchema: uiSchema,
|
|
947
|
+
registry: registry
|
|
948
|
+
}), jsxRuntime.jsx(semanticUiReact.Form.Group, _extends({
|
|
949
|
+
id: id,
|
|
950
|
+
name: id
|
|
951
|
+
}, inlineOption, {
|
|
952
|
+
children: Array.isArray(enumOptions) && enumOptions.map(function (option, index) {
|
|
953
|
+
var checked = utils.enumOptionsIsSelected(option.value, checkboxesValues);
|
|
954
|
+
var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
955
|
+
return jsxRuntime.jsx(semanticUiReact.Form.Checkbox, _extends({
|
|
956
|
+
id: utils.optionId(id, index),
|
|
957
|
+
name: id,
|
|
958
|
+
label: option.label
|
|
959
|
+
}, semanticProps, {
|
|
960
|
+
checked: checked,
|
|
961
|
+
error: rawErrors.length > 0,
|
|
962
|
+
disabled: disabled || itemDisabled || readonly,
|
|
963
|
+
autoFocus: autofocus && index === 0,
|
|
964
|
+
onChange: _onChange(index),
|
|
965
|
+
onBlur: _onBlur,
|
|
966
|
+
onFocus: _onFocus,
|
|
967
|
+
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
968
|
+
}), index);
|
|
969
|
+
})
|
|
970
|
+
}))]
|
|
971
|
+
});
|
|
928
972
|
}
|
|
929
973
|
|
|
930
974
|
/** The `RadioWidget` is a widget for rendering a radio group.
|
|
@@ -969,26 +1013,28 @@
|
|
|
969
1013
|
} : {
|
|
970
1014
|
grouped: true
|
|
971
1015
|
};
|
|
972
|
-
return
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1016
|
+
return jsxRuntime.jsx(semanticUiReact.Form.Group, _extends({}, inlineOption, {
|
|
1017
|
+
children: Array.isArray(enumOptions) && enumOptions.map(function (option, index) {
|
|
1018
|
+
var checked = utils.enumOptionsIsSelected(option.value, value);
|
|
1019
|
+
var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
1020
|
+
return /*#__PURE__*/react.createElement(semanticUiReact.Form.Field, _extends({
|
|
1021
|
+
required: required,
|
|
1022
|
+
control: semanticUiReact.Radio,
|
|
1023
|
+
id: utils.optionId(id, index),
|
|
1024
|
+
name: id
|
|
1025
|
+
}, semanticProps, {
|
|
1026
|
+
onFocus: _onFocus,
|
|
1027
|
+
onBlur: _onBlur,
|
|
1028
|
+
onChange: _onChange,
|
|
1029
|
+
label: option.label,
|
|
1030
|
+
value: String(index),
|
|
1031
|
+
error: rawErrors.length > 0,
|
|
1032
|
+
key: index,
|
|
1033
|
+
checked: checked,
|
|
1034
|
+
disabled: disabled || itemDisabled || readonly,
|
|
1035
|
+
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1036
|
+
}));
|
|
1037
|
+
})
|
|
992
1038
|
}));
|
|
993
1039
|
}
|
|
994
1040
|
|
|
@@ -1023,7 +1069,7 @@
|
|
|
1023
1069
|
// eslint-disable-next-line no-shadow
|
|
1024
1070
|
var _onChange = function _onChange(_ref) {
|
|
1025
1071
|
var value = _ref.target.value;
|
|
1026
|
-
return onChange && onChange(value ===
|
|
1072
|
+
return onChange && onChange(value === '' ? options.emptyValue : value);
|
|
1027
1073
|
};
|
|
1028
1074
|
var _onBlur = function _onBlur() {
|
|
1029
1075
|
return onBlur && onBlur(id, value);
|
|
@@ -1031,21 +1077,24 @@
|
|
|
1031
1077
|
var _onFocus = function _onFocus() {
|
|
1032
1078
|
return onFocus && onFocus(id, value);
|
|
1033
1079
|
};
|
|
1034
|
-
return
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1080
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1081
|
+
children: [jsxRuntime.jsx(semanticUiReact.Input, _extends({
|
|
1082
|
+
id: id,
|
|
1083
|
+
name: id,
|
|
1084
|
+
type: 'range',
|
|
1085
|
+
required: required,
|
|
1086
|
+
disabled: disabled || readonly
|
|
1087
|
+
}, utils.rangeSpec(schema), semanticProps, {
|
|
1088
|
+
value: value || '',
|
|
1089
|
+
error: rawErrors.length > 0,
|
|
1090
|
+
onChange: _onChange,
|
|
1091
|
+
onBlur: _onBlur,
|
|
1092
|
+
onFocus: _onFocus,
|
|
1093
|
+
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1094
|
+
}), id), jsxRuntime.jsx("span", {
|
|
1095
|
+
children: value
|
|
1096
|
+
})]
|
|
1097
|
+
});
|
|
1049
1098
|
}
|
|
1050
1099
|
|
|
1051
1100
|
/**
|
|
@@ -1097,7 +1146,7 @@
|
|
|
1097
1146
|
formContext: formContext,
|
|
1098
1147
|
options: options,
|
|
1099
1148
|
defaultSchemaProps: {
|
|
1100
|
-
inverted:
|
|
1149
|
+
inverted: 'false',
|
|
1101
1150
|
selection: true,
|
|
1102
1151
|
fluid: true,
|
|
1103
1152
|
scrolling: true,
|
|
@@ -1107,7 +1156,7 @@
|
|
|
1107
1156
|
var enumDisabled = options.enumDisabled,
|
|
1108
1157
|
enumOptions = options.enumOptions,
|
|
1109
1158
|
optEmptyVal = options.emptyValue;
|
|
1110
|
-
var emptyValue = multiple ? [] :
|
|
1159
|
+
var emptyValue = multiple ? [] : '';
|
|
1111
1160
|
var dropdownOptions = createDefaultValueOptionsForDropDown(enumOptions, enumDisabled);
|
|
1112
1161
|
var _onChange = function _onChange(_, _ref2) {
|
|
1113
1162
|
var value = _ref2.value;
|
|
@@ -1123,13 +1172,12 @@
|
|
|
1123
1172
|
return onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
|
|
1124
1173
|
};
|
|
1125
1174
|
var selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
1126
|
-
return
|
|
1127
|
-
key: id,
|
|
1175
|
+
return jsxRuntime.jsx(semanticUiReact.Form.Dropdown, _extends({
|
|
1128
1176
|
id: id,
|
|
1129
1177
|
name: id,
|
|
1130
1178
|
label: label || schema.title,
|
|
1131
|
-
multiple: typeof multiple ===
|
|
1132
|
-
value: typeof value ===
|
|
1179
|
+
multiple: typeof multiple === 'undefined' ? false : multiple,
|
|
1180
|
+
value: typeof value === 'undefined' ? emptyValue : selectedIndexes,
|
|
1133
1181
|
error: rawErrors.length > 0,
|
|
1134
1182
|
disabled: disabled,
|
|
1135
1183
|
placeholder: placeholder
|
|
@@ -1142,7 +1190,7 @@
|
|
|
1142
1190
|
onBlur: _onBlur,
|
|
1143
1191
|
onFocus: _onFocus,
|
|
1144
1192
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1145
|
-
}));
|
|
1193
|
+
}), id);
|
|
1146
1194
|
}
|
|
1147
1195
|
|
|
1148
1196
|
/** The `TextareaWidget` is a widget for rendering input fields as textarea.
|
|
@@ -1179,7 +1227,7 @@
|
|
|
1179
1227
|
// eslint-disable-next-line no-shadow
|
|
1180
1228
|
var _onChange = function _onChange(_ref) {
|
|
1181
1229
|
var value = _ref.target.value;
|
|
1182
|
-
return onChange && onChange(value ===
|
|
1230
|
+
return onChange && onChange(value === '' ? options.emptyValue : value);
|
|
1183
1231
|
};
|
|
1184
1232
|
var _onBlur = function _onBlur() {
|
|
1185
1233
|
return onBlur && onBlur(id, value);
|
|
@@ -1188,9 +1236,8 @@
|
|
|
1188
1236
|
return onFocus && onFocus(id, value);
|
|
1189
1237
|
};
|
|
1190
1238
|
var displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema);
|
|
1191
|
-
return
|
|
1239
|
+
return jsxRuntime.jsx(semanticUiReact.Form.TextArea, _extends({
|
|
1192
1240
|
id: id,
|
|
1193
|
-
key: id,
|
|
1194
1241
|
name: id,
|
|
1195
1242
|
label: displayLabel ? label || schema.title : false,
|
|
1196
1243
|
placeholder: placeholder,
|
|
@@ -1198,14 +1245,14 @@
|
|
|
1198
1245
|
required: required,
|
|
1199
1246
|
disabled: disabled || readonly
|
|
1200
1247
|
}, semanticProps, {
|
|
1201
|
-
value: value ||
|
|
1248
|
+
value: value || '',
|
|
1202
1249
|
error: rawErrors.length > 0,
|
|
1203
1250
|
rows: options.rows || 5,
|
|
1204
1251
|
onChange: _onChange,
|
|
1205
1252
|
onBlur: _onBlur,
|
|
1206
1253
|
onFocus: _onFocus,
|
|
1207
1254
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1208
|
-
}));
|
|
1255
|
+
}), id);
|
|
1209
1256
|
}
|
|
1210
1257
|
|
|
1211
1258
|
function generateWidgets() {
|