@rjsf/semantic-ui 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/README.md +15 -12
- package/dist/semantic-ui.cjs.development.js +407 -341
- 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 +407 -340
- package/dist/semantic-ui.esm.js.map +1 -1
- package/dist/semantic-ui.umd.development.js +409 -344
- 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 +11 -11
|
@@ -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,15 +149,15 @@
|
|
|
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:
|
|
160
|
-
gridTemplateColumns: "1fr " + (vertical ? 65 :
|
|
159
|
+
display: 'grid',
|
|
160
|
+
gridTemplateColumns: "1fr " + (vertical ? 65 : 150) + "px"
|
|
161
161
|
};
|
|
162
162
|
};
|
|
163
163
|
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
@@ -168,16 +168,19 @@
|
|
|
168
168
|
var children = props.children,
|
|
169
169
|
disabled = props.disabled,
|
|
170
170
|
hasToolbar = props.hasToolbar,
|
|
171
|
+
hasCopy = props.hasCopy,
|
|
171
172
|
hasMoveDown = props.hasMoveDown,
|
|
172
173
|
hasMoveUp = props.hasMoveUp,
|
|
173
174
|
hasRemove = props.hasRemove,
|
|
174
175
|
index = props.index,
|
|
176
|
+
onCopyIndexClick = props.onCopyIndexClick,
|
|
175
177
|
onDropIndexClick = props.onDropIndexClick,
|
|
176
178
|
onReorderClick = props.onReorderClick,
|
|
177
179
|
readonly = props.readonly,
|
|
178
180
|
uiSchema = props.uiSchema,
|
|
179
181
|
registry = props.registry;
|
|
180
182
|
var _registry$templates$B = registry.templates.ButtonTemplates,
|
|
183
|
+
CopyButton = _registry$templates$B.CopyButton,
|
|
181
184
|
MoveDownButton = _registry$templates$B.MoveDownButton,
|
|
182
185
|
MoveUpButton = _registry$templates$B.MoveUpButton,
|
|
183
186
|
RemoveButton = _registry$templates$B.RemoveButton;
|
|
@@ -185,43 +188,56 @@
|
|
|
185
188
|
// Pull the semantic props out of the uiOptions that were put in via the ArrayFieldTemplate
|
|
186
189
|
var _uiOptions$semantic = uiOptions.semantic,
|
|
187
190
|
_uiOptions$semantic$h = _uiOptions$semantic.horizontalButtons,
|
|
188
|
-
horizontalButtons = _uiOptions$semantic$h === void 0 ?
|
|
191
|
+
horizontalButtons = _uiOptions$semantic$h === void 0 ? true : _uiOptions$semantic$h,
|
|
189
192
|
_uiOptions$semantic$w = _uiOptions$semantic.wrapItem,
|
|
190
193
|
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
|
-
|
|
194
|
+
return jsxRuntime.jsx("div", {
|
|
195
|
+
className: 'array-item',
|
|
196
|
+
children: jsxRuntime.jsx(MaybeWrap, {
|
|
197
|
+
wrap: wrapItem,
|
|
198
|
+
component: semanticUiReact.Segment,
|
|
199
|
+
children: jsxRuntime.jsxs(semanticUiReact.Grid, {
|
|
200
|
+
style: _extends({}, gridStyle(!horizontalButtons), {
|
|
201
|
+
alignItems: 'center'
|
|
202
|
+
}),
|
|
203
|
+
children: [jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
204
|
+
width: 16,
|
|
205
|
+
verticalAlign: 'middle',
|
|
206
|
+
children: children
|
|
207
|
+
}), hasToolbar && jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
208
|
+
children: (hasMoveUp || hasMoveDown || hasRemove) && jsxRuntime.jsxs(semanticUiReact.Button.Group, {
|
|
209
|
+
size: 'mini',
|
|
210
|
+
vertical: !horizontalButtons,
|
|
211
|
+
children: [(hasMoveUp || hasMoveDown) && jsxRuntime.jsx(MoveUpButton, {
|
|
212
|
+
className: 'array-item-move-up',
|
|
213
|
+
disabled: disabled || readonly || !hasMoveUp,
|
|
214
|
+
onClick: onReorderClick(index, index - 1),
|
|
215
|
+
uiSchema: uiSchema,
|
|
216
|
+
registry: registry
|
|
217
|
+
}), (hasMoveUp || hasMoveDown) && jsxRuntime.jsx(MoveDownButton, {
|
|
218
|
+
className: 'array-item-move-down',
|
|
219
|
+
disabled: disabled || readonly || !hasMoveDown,
|
|
220
|
+
onClick: onReorderClick(index, index + 1),
|
|
221
|
+
uiSchema: uiSchema,
|
|
222
|
+
registry: registry
|
|
223
|
+
}), hasCopy && jsxRuntime.jsx(CopyButton, {
|
|
224
|
+
className: 'array-item-copy',
|
|
225
|
+
disabled: disabled || readonly,
|
|
226
|
+
onClick: onCopyIndexClick(index),
|
|
227
|
+
uiSchema: uiSchema,
|
|
228
|
+
registry: registry
|
|
229
|
+
}), hasRemove && jsxRuntime.jsx(RemoveButton, {
|
|
230
|
+
className: 'array-item-remove',
|
|
231
|
+
disabled: disabled || readonly,
|
|
232
|
+
onClick: onDropIndexClick(index),
|
|
233
|
+
uiSchema: uiSchema,
|
|
234
|
+
registry: registry
|
|
235
|
+
})]
|
|
236
|
+
})
|
|
237
|
+
})]
|
|
238
|
+
})
|
|
239
|
+
})
|
|
240
|
+
});
|
|
225
241
|
}
|
|
226
242
|
|
|
227
243
|
var _excluded$2 = ["key", "uiSchema"];
|
|
@@ -247,7 +263,7 @@
|
|
|
247
263
|
uiSchema: uiSchema,
|
|
248
264
|
formContext: formContext,
|
|
249
265
|
defaultSchemaProps: {
|
|
250
|
-
horizontalButtons:
|
|
266
|
+
horizontalButtons: true,
|
|
251
267
|
wrapItem: false
|
|
252
268
|
}
|
|
253
269
|
});
|
|
@@ -258,57 +274,58 @@
|
|
|
258
274
|
wrapItem: wrapItem
|
|
259
275
|
};
|
|
260
276
|
var uiOptions = utils.getUiOptions(uiSchema);
|
|
261
|
-
var ArrayFieldDescriptionTemplate = utils.getTemplate(
|
|
262
|
-
var ArrayFieldItemTemplate = utils.getTemplate(
|
|
263
|
-
var ArrayFieldTitleTemplate = utils.getTemplate(
|
|
277
|
+
var ArrayFieldDescriptionTemplate = utils.getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
|
|
278
|
+
var ArrayFieldItemTemplate = utils.getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
|
|
279
|
+
var ArrayFieldTitleTemplate = utils.getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
|
|
264
280
|
// Button templates are not overridden in the uiSchema
|
|
265
281
|
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
|
-
|
|
282
|
+
return jsxRuntime.jsxs("div", {
|
|
283
|
+
className: cleanClassNames([className, utils.isFixedItems(schema) ? '' : 'sortable-form-fields']),
|
|
284
|
+
children: [jsxRuntime.jsx(ArrayFieldTitleTemplate, {
|
|
285
|
+
idSchema: idSchema,
|
|
286
|
+
title: uiOptions.title || title,
|
|
287
|
+
schema: schema,
|
|
288
|
+
uiSchema: uiSchema,
|
|
289
|
+
required: required,
|
|
290
|
+
registry: registry
|
|
291
|
+
}), jsxRuntime.jsx(ArrayFieldDescriptionTemplate, {
|
|
292
|
+
idSchema: idSchema,
|
|
293
|
+
description: uiOptions.description || schema.description,
|
|
294
|
+
schema: schema,
|
|
295
|
+
uiSchema: uiSchema,
|
|
296
|
+
registry: registry
|
|
297
|
+
}), jsxRuntime.jsxs("div", {
|
|
298
|
+
children: [jsxRuntime.jsx("div", {
|
|
299
|
+
className: 'row array-item-list',
|
|
300
|
+
children: items && items.map(function (_ref) {
|
|
301
|
+
var _extends2;
|
|
302
|
+
var key = _ref.key,
|
|
303
|
+
_ref$uiSchema = _ref.uiSchema,
|
|
304
|
+
itemUiSchema = _ref$uiSchema === void 0 ? {} : _ref$uiSchema,
|
|
305
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
306
|
+
// Merge in the semantic props from the ArrayFieldTemplate into each of the items
|
|
307
|
+
var mergedUiSchema = _extends({}, itemUiSchema, (_extends2 = {}, _extends2[utils.UI_OPTIONS_KEY] = _extends({}, itemUiSchema[utils.UI_OPTIONS_KEY], {
|
|
308
|
+
semantic: semantic
|
|
309
|
+
}), _extends2));
|
|
310
|
+
return jsxRuntime.jsx(ArrayFieldItemTemplate, _extends({}, props, {
|
|
311
|
+
uiSchema: mergedUiSchema
|
|
312
|
+
}), key);
|
|
313
|
+
})
|
|
314
|
+
}), canAdd && jsxRuntime.jsx("div", {
|
|
315
|
+
style: {
|
|
316
|
+
marginTop: '1rem',
|
|
317
|
+
position: 'relative',
|
|
318
|
+
textAlign: 'right'
|
|
319
|
+
},
|
|
320
|
+
children: jsxRuntime.jsx(AddButton, {
|
|
321
|
+
onClick: onAddClick,
|
|
322
|
+
disabled: disabled || readonly,
|
|
323
|
+
uiSchema: uiSchema,
|
|
324
|
+
registry: registry
|
|
325
|
+
})
|
|
326
|
+
})]
|
|
327
|
+
}, "array-item-list-" + idSchema.$id)]
|
|
328
|
+
});
|
|
312
329
|
}
|
|
313
330
|
|
|
314
331
|
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
@@ -326,6 +343,7 @@
|
|
|
326
343
|
readonly = props.readonly,
|
|
327
344
|
disabled = props.disabled,
|
|
328
345
|
onChange = props.onChange,
|
|
346
|
+
onChangeOverride = props.onChangeOverride,
|
|
329
347
|
onBlur = props.onBlur,
|
|
330
348
|
onFocus = props.onFocus,
|
|
331
349
|
autofocus = props.autofocus,
|
|
@@ -346,7 +364,7 @@
|
|
|
346
364
|
var schemaUtils = registry.schemaUtils;
|
|
347
365
|
var _onChange = function _onChange(_ref) {
|
|
348
366
|
var value = _ref.target.value;
|
|
349
|
-
return onChange(value ===
|
|
367
|
+
return onChange(value === '' ? options.emptyValue : value);
|
|
350
368
|
};
|
|
351
369
|
var _onBlur = function _onBlur() {
|
|
352
370
|
return onBlur && onBlur(id, value);
|
|
@@ -355,32 +373,33 @@
|
|
|
355
373
|
return onFocus && onFocus(id, value);
|
|
356
374
|
};
|
|
357
375
|
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
|
-
|
|
376
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
377
|
+
children: [jsxRuntime.jsx(semanticUiReact.Form.Input, _extends({
|
|
378
|
+
id: id,
|
|
379
|
+
name: id,
|
|
380
|
+
placeholder: placeholder
|
|
381
|
+
}, inputProps, {
|
|
382
|
+
label: displayLabel ? label || schema.title : false,
|
|
383
|
+
required: required,
|
|
384
|
+
autoFocus: autofocus,
|
|
385
|
+
disabled: disabled || readonly,
|
|
386
|
+
list: schema.examples ? utils.examplesId(id) : undefined
|
|
387
|
+
}, semanticProps, {
|
|
388
|
+
value: value || value === 0 ? value : '',
|
|
389
|
+
error: rawErrors.length > 0,
|
|
390
|
+
onChange: onChangeOverride || _onChange,
|
|
391
|
+
onBlur: _onBlur,
|
|
392
|
+
onFocus: _onFocus,
|
|
393
|
+
"aria-describedby": utils.ariaDescribedByIds(id, !!schema.examples)
|
|
394
|
+
}), id), Array.isArray(schema.examples) && jsxRuntime.jsx("datalist", {
|
|
395
|
+
id: utils.examplesId(id),
|
|
396
|
+
children: schema.examples.concat(schema["default"] && !schema.examples.includes(schema["default"]) ? [schema["default"]] : []).map(function (example) {
|
|
397
|
+
return jsxRuntime.jsx("option", {
|
|
398
|
+
value: example
|
|
399
|
+
}, example);
|
|
400
|
+
})
|
|
401
|
+
})]
|
|
402
|
+
});
|
|
384
403
|
}
|
|
385
404
|
|
|
386
405
|
/** The `DescriptionField` is the template to use to render the description of a field
|
|
@@ -393,10 +412,11 @@
|
|
|
393
412
|
if (!description) {
|
|
394
413
|
return null;
|
|
395
414
|
}
|
|
396
|
-
return
|
|
415
|
+
return jsxRuntime.jsx("p", {
|
|
397
416
|
id: id,
|
|
398
|
-
className:
|
|
399
|
-
|
|
417
|
+
className: 'sui-description',
|
|
418
|
+
children: description
|
|
419
|
+
});
|
|
400
420
|
}
|
|
401
421
|
|
|
402
422
|
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
@@ -407,13 +427,18 @@
|
|
|
407
427
|
var errors = _ref.errors,
|
|
408
428
|
registry = _ref.registry;
|
|
409
429
|
var translateString = registry.translateString;
|
|
410
|
-
return
|
|
411
|
-
negative: true
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
430
|
+
return jsxRuntime.jsxs(semanticUiReact.Message, {
|
|
431
|
+
negative: true,
|
|
432
|
+
children: [jsxRuntime.jsx(semanticUiReact.Message.Header, {
|
|
433
|
+
children: translateString(utils.TranslatableString.ErrorsLabel)
|
|
434
|
+
}), jsxRuntime.jsx(semanticUiReact.Message.List, {
|
|
435
|
+
children: errors.map(function (error, index) {
|
|
436
|
+
return jsxRuntime.jsx(semanticUiReact.Message.Item, {
|
|
437
|
+
children: error.stack
|
|
438
|
+
}, "error-" + index);
|
|
439
|
+
})
|
|
440
|
+
})]
|
|
441
|
+
});
|
|
417
442
|
}
|
|
418
443
|
|
|
419
444
|
var _excluded$1 = ["icon", "iconType", "color", "className", "uiSchema", "registry"];
|
|
@@ -423,42 +448,50 @@
|
|
|
423
448
|
color = props.color,
|
|
424
449
|
className = props.className,
|
|
425
450
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
|
|
426
|
-
return
|
|
451
|
+
return jsxRuntime.jsx(semanticUiReact.Button, _extends({
|
|
427
452
|
icon: icon,
|
|
428
453
|
size: iconType,
|
|
429
454
|
color: color,
|
|
430
455
|
className: className
|
|
431
456
|
}, otherProps));
|
|
432
457
|
}
|
|
458
|
+
function CopyButton(props) {
|
|
459
|
+
var translateString = props.registry.translateString;
|
|
460
|
+
return jsxRuntime.jsx(IconButton, _extends({
|
|
461
|
+
title: translateString(utils.TranslatableString.CopyButton)
|
|
462
|
+
}, props, {
|
|
463
|
+
icon: 'copy'
|
|
464
|
+
}));
|
|
465
|
+
}
|
|
433
466
|
function MoveDownButton(props) {
|
|
434
467
|
var translateString = props.registry.translateString;
|
|
435
|
-
return
|
|
468
|
+
return jsxRuntime.jsx(IconButton, _extends({
|
|
436
469
|
title: translateString(utils.TranslatableString.MoveDownButton)
|
|
437
470
|
}, props, {
|
|
438
|
-
icon:
|
|
471
|
+
icon: 'angle down'
|
|
439
472
|
}));
|
|
440
473
|
}
|
|
441
474
|
function MoveUpButton(props) {
|
|
442
475
|
var translateString = props.registry.translateString;
|
|
443
|
-
return
|
|
476
|
+
return jsxRuntime.jsx(IconButton, _extends({
|
|
444
477
|
title: translateString(utils.TranslatableString.MoveUpButton)
|
|
445
478
|
}, props, {
|
|
446
|
-
icon:
|
|
479
|
+
icon: 'angle up'
|
|
447
480
|
}));
|
|
448
481
|
}
|
|
449
482
|
function RemoveButton(props) {
|
|
450
483
|
var translateString = props.registry.translateString;
|
|
451
|
-
return
|
|
484
|
+
return jsxRuntime.jsx(IconButton, _extends({
|
|
452
485
|
title: translateString(utils.TranslatableString.RemoveButton)
|
|
453
486
|
}, props, {
|
|
454
|
-
icon:
|
|
487
|
+
icon: 'trash'
|
|
455
488
|
}));
|
|
456
489
|
}
|
|
457
490
|
|
|
458
491
|
var DEFAULT_OPTIONS$1 = {
|
|
459
492
|
options: {
|
|
460
|
-
pointing:
|
|
461
|
-
size:
|
|
493
|
+
pointing: 'above',
|
|
494
|
+
size: 'small'
|
|
462
495
|
}
|
|
463
496
|
};
|
|
464
497
|
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
@@ -480,19 +513,21 @@
|
|
|
480
513
|
size = options.size;
|
|
481
514
|
if (errors && errors.length > 0) {
|
|
482
515
|
var id = utils.errorId(idSchema);
|
|
483
|
-
return
|
|
516
|
+
return jsxRuntime.jsx(semanticUiReact.Label, {
|
|
484
517
|
id: id,
|
|
485
|
-
color:
|
|
486
|
-
pointing: pointing ||
|
|
487
|
-
size: size ||
|
|
488
|
-
basic: true
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
518
|
+
color: 'red',
|
|
519
|
+
pointing: pointing || 'above',
|
|
520
|
+
size: size || 'small',
|
|
521
|
+
basic: true,
|
|
522
|
+
children: jsxRuntime.jsx(semanticUiReact.List, {
|
|
523
|
+
bulleted: true,
|
|
524
|
+
children: errors.map(function (error) {
|
|
525
|
+
return jsxRuntime.jsx(semanticUiReact.List.Item, {
|
|
526
|
+
children: error
|
|
527
|
+
}, nanoid.nanoid());
|
|
528
|
+
})
|
|
529
|
+
})
|
|
530
|
+
});
|
|
496
531
|
}
|
|
497
532
|
return null;
|
|
498
533
|
}
|
|
@@ -506,8 +541,8 @@
|
|
|
506
541
|
help = props.help;
|
|
507
542
|
if (help) {
|
|
508
543
|
var id = utils.helpId(idSchema);
|
|
509
|
-
return
|
|
510
|
-
size:
|
|
544
|
+
return jsxRuntime.jsx(semanticUiReact.Message, {
|
|
545
|
+
size: 'mini',
|
|
511
546
|
info: true,
|
|
512
547
|
id: id,
|
|
513
548
|
content: help
|
|
@@ -541,16 +576,17 @@
|
|
|
541
576
|
var wrapLabel = semanticProps.wrapLabel,
|
|
542
577
|
wrapContent = semanticProps.wrapContent;
|
|
543
578
|
var uiOptions = utils.getUiOptions(uiSchema);
|
|
544
|
-
var WrapIfAdditionalTemplate = utils.getTemplate(
|
|
545
|
-
var DescriptionFieldTemplate = utils.getTemplate(
|
|
579
|
+
var WrapIfAdditionalTemplate = utils.getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
|
|
580
|
+
var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, uiOptions);
|
|
546
581
|
if (hidden) {
|
|
547
|
-
return
|
|
582
|
+
return jsxRuntime.jsx("div", {
|
|
548
583
|
style: {
|
|
549
|
-
display:
|
|
550
|
-
}
|
|
551
|
-
|
|
584
|
+
display: 'none'
|
|
585
|
+
},
|
|
586
|
+
children: children
|
|
587
|
+
});
|
|
552
588
|
}
|
|
553
|
-
return
|
|
589
|
+
return jsxRuntime.jsx(WrapIfAdditionalTemplate, _extends({
|
|
554
590
|
classNames: classNames,
|
|
555
591
|
style: style,
|
|
556
592
|
id: id,
|
|
@@ -558,23 +594,27 @@
|
|
|
558
594
|
registry: registry,
|
|
559
595
|
schema: schema,
|
|
560
596
|
uiSchema: uiSchema
|
|
561
|
-
}, otherProps
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
597
|
+
}, otherProps, {
|
|
598
|
+
children: jsxRuntime.jsx(semanticUiReact.Form.Group, {
|
|
599
|
+
widths: 'equal',
|
|
600
|
+
grouped: true,
|
|
601
|
+
children: jsxRuntime.jsxs(MaybeWrap, {
|
|
602
|
+
wrap: wrapContent,
|
|
603
|
+
className: 'sui-field-content',
|
|
604
|
+
children: [children, displayLabel && rawDescription && jsxRuntime.jsx(MaybeWrap, {
|
|
605
|
+
wrap: wrapLabel,
|
|
606
|
+
className: 'sui-field-label',
|
|
607
|
+
children: rawDescription && jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
608
|
+
id: utils.descriptionId(id),
|
|
609
|
+
description: rawDescription,
|
|
610
|
+
schema: schema,
|
|
611
|
+
uiSchema: uiSchema,
|
|
612
|
+
registry: registry
|
|
613
|
+
})
|
|
614
|
+
}), help, errors]
|
|
615
|
+
})
|
|
616
|
+
}, id)
|
|
617
|
+
}));
|
|
578
618
|
}
|
|
579
619
|
|
|
580
620
|
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
|
|
@@ -597,42 +637,48 @@
|
|
|
597
637
|
idSchema = props.idSchema,
|
|
598
638
|
registry = props.registry;
|
|
599
639
|
var uiOptions = utils.getUiOptions(uiSchema);
|
|
600
|
-
var TitleFieldTemplate = utils.getTemplate(
|
|
601
|
-
var DescriptionFieldTemplate = utils.getTemplate(
|
|
640
|
+
var TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, uiOptions);
|
|
641
|
+
var DescriptionFieldTemplate = utils.getTemplate('DescriptionFieldTemplate', registry, uiOptions);
|
|
602
642
|
// Button templates are not overridden in the uiSchema
|
|
603
643
|
var AddButton = registry.templates.ButtonTemplates.AddButton;
|
|
604
644
|
var fieldTitle = uiOptions.title || title;
|
|
605
645
|
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
|
-
|
|
646
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
647
|
+
children: [fieldTitle && jsxRuntime.jsx(TitleFieldTemplate, {
|
|
648
|
+
id: utils.titleId(idSchema),
|
|
649
|
+
title: fieldTitle,
|
|
650
|
+
required: required,
|
|
651
|
+
schema: schema,
|
|
652
|
+
uiSchema: uiSchema,
|
|
653
|
+
registry: registry
|
|
654
|
+
}), fieldDescription && jsxRuntime.jsx(DescriptionFieldTemplate, {
|
|
655
|
+
id: utils.descriptionId(idSchema),
|
|
656
|
+
description: fieldDescription,
|
|
657
|
+
schema: schema,
|
|
658
|
+
uiSchema: uiSchema,
|
|
659
|
+
registry: registry
|
|
660
|
+
}), properties.map(function (prop) {
|
|
661
|
+
return prop.content;
|
|
662
|
+
}), utils.canExpand(schema, uiSchema, formData) && jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
663
|
+
width: 16,
|
|
664
|
+
verticalAlign: 'middle',
|
|
665
|
+
children: jsxRuntime.jsx(semanticUiReact.Grid.Row, {
|
|
666
|
+
children: jsxRuntime.jsx("div", {
|
|
667
|
+
style: {
|
|
668
|
+
marginTop: '1rem',
|
|
669
|
+
position: 'relative',
|
|
670
|
+
textAlign: 'right'
|
|
671
|
+
},
|
|
672
|
+
children: jsxRuntime.jsx(AddButton, {
|
|
673
|
+
onClick: onAddClick(schema),
|
|
674
|
+
disabled: disabled || readonly,
|
|
675
|
+
uiSchema: uiSchema,
|
|
676
|
+
registry: registry
|
|
677
|
+
})
|
|
678
|
+
})
|
|
679
|
+
})
|
|
680
|
+
})]
|
|
681
|
+
});
|
|
636
682
|
}
|
|
637
683
|
|
|
638
684
|
/** The `SubmitButton` renders a button that represent the `Submit` action on a form
|
|
@@ -647,10 +693,12 @@
|
|
|
647
693
|
if (norender) {
|
|
648
694
|
return null;
|
|
649
695
|
}
|
|
650
|
-
return
|
|
651
|
-
type:
|
|
696
|
+
return jsxRuntime.jsx(semanticUiReact.Button, _extends({
|
|
697
|
+
type: 'submit',
|
|
652
698
|
primary: true
|
|
653
|
-
}, submitButtonProps
|
|
699
|
+
}, submitButtonProps, {
|
|
700
|
+
children: submitText
|
|
701
|
+
}));
|
|
654
702
|
}
|
|
655
703
|
|
|
656
704
|
var DEFAULT_OPTIONS = {
|
|
@@ -672,11 +720,12 @@
|
|
|
672
720
|
if (!title) {
|
|
673
721
|
return null;
|
|
674
722
|
}
|
|
675
|
-
return
|
|
723
|
+
return jsxRuntime.jsx(semanticUiReact.Header, _extends({
|
|
676
724
|
id: id
|
|
677
725
|
}, semanticProps, {
|
|
678
|
-
as:
|
|
679
|
-
|
|
726
|
+
as: 'h5',
|
|
727
|
+
children: title
|
|
728
|
+
}));
|
|
680
729
|
}
|
|
681
730
|
|
|
682
731
|
/** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
|
|
@@ -709,51 +758,60 @@
|
|
|
709
758
|
wrapperStyle = _registry$formContext.wrapperStyle;
|
|
710
759
|
var additional = (utils.ADDITIONAL_PROPERTY_FLAG in schema);
|
|
711
760
|
if (!additional) {
|
|
712
|
-
return
|
|
761
|
+
return jsxRuntime.jsx("div", {
|
|
713
762
|
className: classNames,
|
|
714
|
-
style: style
|
|
715
|
-
|
|
763
|
+
style: style,
|
|
764
|
+
children: children
|
|
765
|
+
});
|
|
716
766
|
}
|
|
717
767
|
var handleBlur = function handleBlur(_ref) {
|
|
718
768
|
var target = _ref.target;
|
|
719
769
|
return onKeyChange(target.value);
|
|
720
770
|
};
|
|
721
|
-
return
|
|
771
|
+
return jsxRuntime.jsx("div", {
|
|
722
772
|
className: classNames,
|
|
723
773
|
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
|
-
|
|
774
|
+
children: jsxRuntime.jsx(semanticUiReact.Grid, {
|
|
775
|
+
columns: 'equal',
|
|
776
|
+
children: jsxRuntime.jsxs(semanticUiReact.Grid.Row, {
|
|
777
|
+
children: [jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
778
|
+
className: 'form-additional',
|
|
779
|
+
children: jsxRuntime.jsx(semanticUiReact.Form.Group, {
|
|
780
|
+
widths: 'equal',
|
|
781
|
+
grouped: true,
|
|
782
|
+
children: jsxRuntime.jsx(semanticUiReact.Form.Input, {
|
|
783
|
+
className: 'form-group',
|
|
784
|
+
hasFeedback: true,
|
|
785
|
+
fluid: true,
|
|
786
|
+
htmlFor: "" + id,
|
|
787
|
+
label: keyLabel,
|
|
788
|
+
required: required,
|
|
789
|
+
defaultValue: label,
|
|
790
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
791
|
+
id: "" + id,
|
|
792
|
+
name: "" + id,
|
|
793
|
+
onBlur: !readonly ? handleBlur : undefined,
|
|
794
|
+
style: wrapperStyle,
|
|
795
|
+
type: 'text'
|
|
796
|
+
})
|
|
797
|
+
})
|
|
798
|
+
}), jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
799
|
+
className: 'form-additional',
|
|
800
|
+
verticalAlign: 'middle',
|
|
801
|
+
children: children
|
|
802
|
+
}), jsxRuntime.jsx(semanticUiReact.Grid.Column, {
|
|
803
|
+
children: jsxRuntime.jsx(RemoveButton, {
|
|
804
|
+
iconType: 'mini',
|
|
805
|
+
className: 'array-item-remove',
|
|
806
|
+
disabled: disabled || readonly,
|
|
807
|
+
onClick: onDropPropertyClick(label),
|
|
808
|
+
uiSchema: uiSchema,
|
|
809
|
+
registry: registry
|
|
810
|
+
})
|
|
811
|
+
})]
|
|
812
|
+
})
|
|
813
|
+
})
|
|
814
|
+
}, id + "-key");
|
|
757
815
|
}
|
|
758
816
|
|
|
759
817
|
function generateTemplates() {
|
|
@@ -763,6 +821,7 @@
|
|
|
763
821
|
BaseInputTemplate: BaseInputTemplate,
|
|
764
822
|
ButtonTemplates: {
|
|
765
823
|
AddButton: AddButton,
|
|
824
|
+
CopyButton: CopyButton,
|
|
766
825
|
MoveDownButton: MoveDownButton,
|
|
767
826
|
MoveUpButton: MoveUpButton,
|
|
768
827
|
RemoveButton: RemoveButton,
|
|
@@ -806,7 +865,7 @@
|
|
|
806
865
|
formContext: formContext,
|
|
807
866
|
uiSchema: uiSchema,
|
|
808
867
|
defaultSchemaProps: {
|
|
809
|
-
inverted: false
|
|
868
|
+
inverted: 'false'
|
|
810
869
|
}
|
|
811
870
|
});
|
|
812
871
|
// Because an unchecked checkbox will cause html5 validation to fail, only add
|
|
@@ -822,20 +881,20 @@
|
|
|
822
881
|
var _onFocus = function _onFocus() {
|
|
823
882
|
return onFocus && onFocus(id, value);
|
|
824
883
|
};
|
|
825
|
-
var checked = value ==
|
|
826
|
-
return
|
|
884
|
+
var checked = value == 'true' || value == true;
|
|
885
|
+
return jsxRuntime.jsx(semanticUiReact.Form.Checkbox, _extends({
|
|
827
886
|
id: id,
|
|
828
887
|
name: id,
|
|
829
888
|
disabled: disabled || readonly,
|
|
830
889
|
autoFocus: autofocus
|
|
831
890
|
}, semanticProps, {
|
|
832
|
-
checked: typeof value ===
|
|
891
|
+
checked: typeof value === 'undefined' ? false : checked,
|
|
833
892
|
error: rawErrors.length > 0,
|
|
834
893
|
onChange: _onChange,
|
|
835
894
|
onBlur: _onBlur,
|
|
836
895
|
onFocus: _onFocus,
|
|
837
896
|
required: required,
|
|
838
|
-
label: label ||
|
|
897
|
+
label: label || '',
|
|
839
898
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
840
899
|
}));
|
|
841
900
|
}
|
|
@@ -861,7 +920,7 @@
|
|
|
861
920
|
_props$rawErrors = props.rawErrors,
|
|
862
921
|
rawErrors = _props$rawErrors === void 0 ? [] : _props$rawErrors,
|
|
863
922
|
registry = props.registry;
|
|
864
|
-
var TitleFieldTemplate = utils.getTemplate(
|
|
923
|
+
var TitleFieldTemplate = utils.getTemplate('TitleFieldTemplate', registry, options);
|
|
865
924
|
var enumOptions = options.enumOptions,
|
|
866
925
|
enumDisabled = options.enumDisabled,
|
|
867
926
|
inline = options.inline;
|
|
@@ -872,7 +931,7 @@
|
|
|
872
931
|
formContext: formContext,
|
|
873
932
|
uiSchema: uiSchema,
|
|
874
933
|
defaultSchemaProps: {
|
|
875
|
-
inverted: false
|
|
934
|
+
inverted: 'false'
|
|
876
935
|
}
|
|
877
936
|
});
|
|
878
937
|
var _onChange = function _onChange(index) {
|
|
@@ -897,34 +956,37 @@
|
|
|
897
956
|
} : {
|
|
898
957
|
grouped: true
|
|
899
958
|
};
|
|
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
|
-
|
|
959
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
960
|
+
children: [title && jsxRuntime.jsx(TitleFieldTemplate, {
|
|
961
|
+
id: utils.titleId(id),
|
|
962
|
+
title: title,
|
|
963
|
+
schema: schema,
|
|
964
|
+
uiSchema: uiSchema,
|
|
965
|
+
registry: registry
|
|
966
|
+
}), jsxRuntime.jsx(semanticUiReact.Form.Group, _extends({
|
|
967
|
+
id: id,
|
|
968
|
+
name: id
|
|
969
|
+
}, inlineOption, {
|
|
970
|
+
children: Array.isArray(enumOptions) && enumOptions.map(function (option, index) {
|
|
971
|
+
var checked = utils.enumOptionsIsSelected(option.value, checkboxesValues);
|
|
972
|
+
var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
973
|
+
return jsxRuntime.jsx(semanticUiReact.Form.Checkbox, _extends({
|
|
974
|
+
id: utils.optionId(id, index),
|
|
975
|
+
name: id,
|
|
976
|
+
label: option.label
|
|
977
|
+
}, semanticProps, {
|
|
978
|
+
checked: checked,
|
|
979
|
+
error: rawErrors.length > 0,
|
|
980
|
+
disabled: disabled || itemDisabled || readonly,
|
|
981
|
+
autoFocus: autofocus && index === 0,
|
|
982
|
+
onChange: _onChange(index),
|
|
983
|
+
onBlur: _onBlur,
|
|
984
|
+
onFocus: _onFocus,
|
|
985
|
+
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
986
|
+
}), index);
|
|
987
|
+
})
|
|
988
|
+
}))]
|
|
989
|
+
});
|
|
928
990
|
}
|
|
929
991
|
|
|
930
992
|
/** The `RadioWidget` is a widget for rendering a radio group.
|
|
@@ -969,26 +1031,28 @@
|
|
|
969
1031
|
} : {
|
|
970
1032
|
grouped: true
|
|
971
1033
|
};
|
|
972
|
-
return
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1034
|
+
return jsxRuntime.jsx(semanticUiReact.Form.Group, _extends({}, inlineOption, {
|
|
1035
|
+
children: Array.isArray(enumOptions) && enumOptions.map(function (option, index) {
|
|
1036
|
+
var checked = utils.enumOptionsIsSelected(option.value, value);
|
|
1037
|
+
var itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
1038
|
+
return /*#__PURE__*/react.createElement(semanticUiReact.Form.Field, _extends({
|
|
1039
|
+
required: required,
|
|
1040
|
+
control: semanticUiReact.Radio,
|
|
1041
|
+
id: utils.optionId(id, index),
|
|
1042
|
+
name: id
|
|
1043
|
+
}, semanticProps, {
|
|
1044
|
+
onFocus: _onFocus,
|
|
1045
|
+
onBlur: _onBlur,
|
|
1046
|
+
onChange: _onChange,
|
|
1047
|
+
label: option.label,
|
|
1048
|
+
value: String(index),
|
|
1049
|
+
error: rawErrors.length > 0,
|
|
1050
|
+
key: index,
|
|
1051
|
+
checked: checked,
|
|
1052
|
+
disabled: disabled || itemDisabled || readonly,
|
|
1053
|
+
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1054
|
+
}));
|
|
1055
|
+
})
|
|
992
1056
|
}));
|
|
993
1057
|
}
|
|
994
1058
|
|
|
@@ -1023,7 +1087,7 @@
|
|
|
1023
1087
|
// eslint-disable-next-line no-shadow
|
|
1024
1088
|
var _onChange = function _onChange(_ref) {
|
|
1025
1089
|
var value = _ref.target.value;
|
|
1026
|
-
return onChange && onChange(value ===
|
|
1090
|
+
return onChange && onChange(value === '' ? options.emptyValue : value);
|
|
1027
1091
|
};
|
|
1028
1092
|
var _onBlur = function _onBlur() {
|
|
1029
1093
|
return onBlur && onBlur(id, value);
|
|
@@ -1031,21 +1095,24 @@
|
|
|
1031
1095
|
var _onFocus = function _onFocus() {
|
|
1032
1096
|
return onFocus && onFocus(id, value);
|
|
1033
1097
|
};
|
|
1034
|
-
return
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1098
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1099
|
+
children: [jsxRuntime.jsx(semanticUiReact.Input, _extends({
|
|
1100
|
+
id: id,
|
|
1101
|
+
name: id,
|
|
1102
|
+
type: 'range',
|
|
1103
|
+
required: required,
|
|
1104
|
+
disabled: disabled || readonly
|
|
1105
|
+
}, utils.rangeSpec(schema), semanticProps, {
|
|
1106
|
+
value: value || '',
|
|
1107
|
+
error: rawErrors.length > 0,
|
|
1108
|
+
onChange: _onChange,
|
|
1109
|
+
onBlur: _onBlur,
|
|
1110
|
+
onFocus: _onFocus,
|
|
1111
|
+
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1112
|
+
}), id), jsxRuntime.jsx("span", {
|
|
1113
|
+
children: value
|
|
1114
|
+
})]
|
|
1115
|
+
});
|
|
1049
1116
|
}
|
|
1050
1117
|
|
|
1051
1118
|
/**
|
|
@@ -1097,7 +1164,7 @@
|
|
|
1097
1164
|
formContext: formContext,
|
|
1098
1165
|
options: options,
|
|
1099
1166
|
defaultSchemaProps: {
|
|
1100
|
-
inverted:
|
|
1167
|
+
inverted: 'false',
|
|
1101
1168
|
selection: true,
|
|
1102
1169
|
fluid: true,
|
|
1103
1170
|
scrolling: true,
|
|
@@ -1107,7 +1174,7 @@
|
|
|
1107
1174
|
var enumDisabled = options.enumDisabled,
|
|
1108
1175
|
enumOptions = options.enumOptions,
|
|
1109
1176
|
optEmptyVal = options.emptyValue;
|
|
1110
|
-
var emptyValue = multiple ? [] :
|
|
1177
|
+
var emptyValue = multiple ? [] : '';
|
|
1111
1178
|
var dropdownOptions = createDefaultValueOptionsForDropDown(enumOptions, enumDisabled);
|
|
1112
1179
|
var _onChange = function _onChange(_, _ref2) {
|
|
1113
1180
|
var value = _ref2.value;
|
|
@@ -1123,13 +1190,12 @@
|
|
|
1123
1190
|
return onFocus(id, utils.enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
|
|
1124
1191
|
};
|
|
1125
1192
|
var selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
1126
|
-
return
|
|
1127
|
-
key: id,
|
|
1193
|
+
return jsxRuntime.jsx(semanticUiReact.Form.Dropdown, _extends({
|
|
1128
1194
|
id: id,
|
|
1129
1195
|
name: id,
|
|
1130
1196
|
label: label || schema.title,
|
|
1131
|
-
multiple: typeof multiple ===
|
|
1132
|
-
value: typeof value ===
|
|
1197
|
+
multiple: typeof multiple === 'undefined' ? false : multiple,
|
|
1198
|
+
value: typeof value === 'undefined' ? emptyValue : selectedIndexes,
|
|
1133
1199
|
error: rawErrors.length > 0,
|
|
1134
1200
|
disabled: disabled,
|
|
1135
1201
|
placeholder: placeholder
|
|
@@ -1142,7 +1208,7 @@
|
|
|
1142
1208
|
onBlur: _onBlur,
|
|
1143
1209
|
onFocus: _onFocus,
|
|
1144
1210
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1145
|
-
}));
|
|
1211
|
+
}), id);
|
|
1146
1212
|
}
|
|
1147
1213
|
|
|
1148
1214
|
/** The `TextareaWidget` is a widget for rendering input fields as textarea.
|
|
@@ -1172,14 +1238,14 @@
|
|
|
1172
1238
|
formContext: formContext,
|
|
1173
1239
|
options: options,
|
|
1174
1240
|
defaultSchemaProps: {
|
|
1175
|
-
inverted: false
|
|
1241
|
+
inverted: 'false'
|
|
1176
1242
|
}
|
|
1177
1243
|
});
|
|
1178
1244
|
var schemaUtils = registry.schemaUtils;
|
|
1179
1245
|
// eslint-disable-next-line no-shadow
|
|
1180
1246
|
var _onChange = function _onChange(_ref) {
|
|
1181
1247
|
var value = _ref.target.value;
|
|
1182
|
-
return onChange && onChange(value ===
|
|
1248
|
+
return onChange && onChange(value === '' ? options.emptyValue : value);
|
|
1183
1249
|
};
|
|
1184
1250
|
var _onBlur = function _onBlur() {
|
|
1185
1251
|
return onBlur && onBlur(id, value);
|
|
@@ -1188,9 +1254,8 @@
|
|
|
1188
1254
|
return onFocus && onFocus(id, value);
|
|
1189
1255
|
};
|
|
1190
1256
|
var displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema);
|
|
1191
|
-
return
|
|
1257
|
+
return jsxRuntime.jsx(semanticUiReact.Form.TextArea, _extends({
|
|
1192
1258
|
id: id,
|
|
1193
|
-
key: id,
|
|
1194
1259
|
name: id,
|
|
1195
1260
|
label: displayLabel ? label || schema.title : false,
|
|
1196
1261
|
placeholder: placeholder,
|
|
@@ -1198,14 +1263,14 @@
|
|
|
1198
1263
|
required: required,
|
|
1199
1264
|
disabled: disabled || readonly
|
|
1200
1265
|
}, semanticProps, {
|
|
1201
|
-
value: value ||
|
|
1266
|
+
value: value || '',
|
|
1202
1267
|
error: rawErrors.length > 0,
|
|
1203
1268
|
rows: options.rows || 5,
|
|
1204
1269
|
onChange: _onChange,
|
|
1205
1270
|
onBlur: _onBlur,
|
|
1206
1271
|
onFocus: _onFocus,
|
|
1207
1272
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
1208
|
-
}));
|
|
1273
|
+
}), id);
|
|
1209
1274
|
}
|
|
1210
1275
|
|
|
1211
1276
|
function generateWidgets() {
|