@rjsf/semantic-ui 5.0.0-beta.2 → 5.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/ErrorList/ErrorList.d.ts +2 -2
- package/dist/HelpField/HelpField.d.ts +3 -3
- package/dist/IconButton/IconButton.d.ts +3 -3
- package/dist/RawErrors/RawErrors.d.ts +5 -5
- package/dist/semantic-ui.cjs.development.js +91 -79
- 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 +12 -5
- package/dist/semantic-ui.esm.js.map +1 -1
- package/dist/semantic-ui.umd.development.js +90 -80
- 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/dist/util.d.ts +2 -2
- package/package.json +14 -15
package/README.md
CHANGED
|
@@ -31,11 +31,16 @@
|
|
|
31
31
|
|
|
32
32
|
## Table of Contents
|
|
33
33
|
|
|
34
|
+
- [Table of Contents](#table-of-contents)
|
|
34
35
|
- [About The Project](#about-the-project)
|
|
36
|
+
- [Built With](#built-with)
|
|
35
37
|
- [Getting Started](#getting-started)
|
|
36
38
|
- [Prerequisites](#prerequisites)
|
|
37
39
|
- [Installation](#installation)
|
|
38
40
|
- [Usage](#usage)
|
|
41
|
+
- [Optional Semantic UI Theme properties](#optional-semantic-ui-theme-properties)
|
|
42
|
+
- [Semantic Widget Optional Properties](#semantic-widget-optional-properties)
|
|
43
|
+
- [Custom Semantic Widget Properties](#custom-semantic-widget-properties)
|
|
39
44
|
- [Roadmap](#roadmap)
|
|
40
45
|
- [Contributing](#contributing)
|
|
41
46
|
- [Contact](#contact)
|
|
@@ -7,8 +7,8 @@ declare function HelpField({ helpText, id }: {
|
|
|
7
7
|
id: any;
|
|
8
8
|
}): null;
|
|
9
9
|
declare namespace HelpField {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
namespace propTypes {
|
|
11
|
+
const helpText: any;
|
|
12
|
+
const id: any;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -4,8 +4,8 @@ export function RemoveButton(props: any): JSX.Element;
|
|
|
4
4
|
export default IconButton;
|
|
5
5
|
declare function IconButton(props: any): JSX.Element;
|
|
6
6
|
declare namespace IconButton {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
namespace propTypes {
|
|
8
|
+
const icon: any;
|
|
9
|
+
const className: any;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -26,13 +26,13 @@ declare class RawErrors {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
declare namespace RawErrors {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
namespace defaultProps {
|
|
30
|
+
namespace options {
|
|
31
|
+
const pointing: string;
|
|
32
|
+
const size: string;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
namespace propTypes {
|
|
36
36
|
const options_1: any;
|
|
37
37
|
export { options_1 as options };
|
|
38
38
|
export const errors: any;
|
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
-
|
|
7
5
|
var core = require('@rjsf/core');
|
|
8
6
|
var semanticUiReact = require('semantic-ui-react');
|
|
9
|
-
var React =
|
|
7
|
+
var React = require('react');
|
|
10
8
|
var utils = require('@rjsf/utils');
|
|
11
|
-
var PropTypes =
|
|
9
|
+
var PropTypes = require('prop-types');
|
|
12
10
|
var nanoid = require('nanoid');
|
|
13
|
-
var _ =
|
|
11
|
+
var _ = require('lodash');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
17
|
+
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
14
18
|
|
|
15
19
|
function _extends() {
|
|
16
20
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -30,13 +34,13 @@ function _extends() {
|
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
function AddButton(props) {
|
|
33
|
-
return /*#__PURE__*/
|
|
37
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Button, _extends({
|
|
34
38
|
title: "Add Item"
|
|
35
39
|
}, props, {
|
|
36
40
|
icon: true,
|
|
37
41
|
size: "tiny",
|
|
38
42
|
labelPosition: "left"
|
|
39
|
-
}), /*#__PURE__*/
|
|
43
|
+
}), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Icon, {
|
|
40
44
|
name: "plus"
|
|
41
45
|
}));
|
|
42
46
|
}
|
|
@@ -135,7 +139,7 @@ function MaybeWrap(_ref3) {
|
|
|
135
139
|
component: Component = "div",
|
|
136
140
|
...props
|
|
137
141
|
} = _ref3;
|
|
138
|
-
return wrap ? /*#__PURE__*/
|
|
142
|
+
return wrap ? /*#__PURE__*/React__default["default"].createElement(Component, props) : props.children;
|
|
139
143
|
}
|
|
140
144
|
|
|
141
145
|
const gridStyle = vertical => ({
|
|
@@ -173,30 +177,30 @@ const ArrayFieldItemTemplate = props => {
|
|
|
173
177
|
MoveUpButton,
|
|
174
178
|
RemoveButton
|
|
175
179
|
} = registry.templates.ButtonTemplates;
|
|
176
|
-
return /*#__PURE__*/
|
|
180
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
177
181
|
className: "array-item"
|
|
178
|
-
}, /*#__PURE__*/
|
|
182
|
+
}, /*#__PURE__*/React__default["default"].createElement(MaybeWrap, {
|
|
179
183
|
wrap: wrapItem,
|
|
180
184
|
component: semanticUiReact.Segment
|
|
181
|
-
}, /*#__PURE__*/
|
|
185
|
+
}, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid, {
|
|
182
186
|
style: !isInitialArrayItem(props) ? { ...gridStyle(!horizontalButtons),
|
|
183
187
|
alignItems: "center"
|
|
184
188
|
} : gridStyle(!horizontalButtons)
|
|
185
|
-
}, /*#__PURE__*/
|
|
189
|
+
}, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, {
|
|
186
190
|
width: 16,
|
|
187
191
|
verticalAlign: "middle"
|
|
188
|
-
}, children), hasToolbar && /*#__PURE__*/
|
|
192
|
+
}, children), hasToolbar && /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, null, (hasMoveUp || hasMoveDown || hasRemove) && /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Button.Group, {
|
|
189
193
|
size: "mini",
|
|
190
194
|
vertical: !horizontalButtons
|
|
191
|
-
}, (hasMoveUp || hasMoveDown) && /*#__PURE__*/
|
|
195
|
+
}, (hasMoveUp || hasMoveDown) && /*#__PURE__*/React__default["default"].createElement(MoveUpButton, {
|
|
192
196
|
className: "array-item-move-up",
|
|
193
197
|
disabled: disabled || readonly || !hasMoveUp,
|
|
194
198
|
onClick: onReorderClick(index, index - 1)
|
|
195
|
-
}), (hasMoveUp || hasMoveDown) && /*#__PURE__*/
|
|
199
|
+
}), (hasMoveUp || hasMoveDown) && /*#__PURE__*/React__default["default"].createElement(MoveDownButton, {
|
|
196
200
|
className: "array-item-move-down",
|
|
197
201
|
disabled: disabled || readonly || !hasMoveDown,
|
|
198
202
|
onClick: onReorderClick(index, index + 1)
|
|
199
|
-
}), hasRemove && /*#__PURE__*/
|
|
203
|
+
}), hasRemove && /*#__PURE__*/React__default["default"].createElement(RemoveButton, {
|
|
200
204
|
className: "array-item-remove",
|
|
201
205
|
disabled: disabled || readonly,
|
|
202
206
|
onClick: onDropIndexClick(index)
|
|
@@ -250,30 +254,30 @@ function ArrayFieldTemplate(_ref) {
|
|
|
250
254
|
} = registry.templates;
|
|
251
255
|
const fieldTitle = uiOptions.title || title;
|
|
252
256
|
const fieldDescription = uiOptions.description || schema.description;
|
|
253
|
-
return /*#__PURE__*/
|
|
257
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
254
258
|
className: cleanClassNames([className, classNames, utils.isFixedItems(schema) ? "" : "sortable-form-fields"])
|
|
255
|
-
}, /*#__PURE__*/
|
|
259
|
+
}, /*#__PURE__*/React__default["default"].createElement(ArrayFieldTitleTemplate, {
|
|
256
260
|
idSchema: idSchema,
|
|
257
261
|
title: fieldTitle,
|
|
258
262
|
uiSchema: uiSchema,
|
|
259
263
|
required: required,
|
|
260
264
|
registry: registry
|
|
261
|
-
}), fieldDescription && /*#__PURE__*/
|
|
265
|
+
}), fieldDescription && /*#__PURE__*/React__default["default"].createElement(ArrayFieldDescriptionTemplate, {
|
|
262
266
|
idSchema: idSchema,
|
|
263
267
|
description: fieldDescription,
|
|
264
268
|
uiSchema: uiSchema,
|
|
265
269
|
registry: registry
|
|
266
|
-
}), /*#__PURE__*/
|
|
270
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
267
271
|
key: "array-item-list-" + idSchema.$id
|
|
268
|
-
}, /*#__PURE__*/
|
|
272
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
269
273
|
className: "row array-item-list"
|
|
270
|
-
}, items && items.map(props => /*#__PURE__*/
|
|
274
|
+
}, items && items.map(props => /*#__PURE__*/React__default["default"].createElement(ArrayFieldItemTemplate, _extends({}, props, itemProps)))), canAdd && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
271
275
|
style: {
|
|
272
276
|
marginTop: "1rem",
|
|
273
277
|
position: "relative",
|
|
274
278
|
textAlign: "right"
|
|
275
279
|
}
|
|
276
|
-
}, /*#__PURE__*/
|
|
280
|
+
}, /*#__PURE__*/React__default["default"].createElement(AddButton, {
|
|
277
281
|
onClick: onAddClick,
|
|
278
282
|
disabled: disabled || readOnly
|
|
279
283
|
}))));
|
|
@@ -325,7 +329,7 @@ function BaseInputTemplate(props) {
|
|
|
325
329
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
326
330
|
|
|
327
331
|
const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema);
|
|
328
|
-
return /*#__PURE__*/
|
|
332
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Input, _extends({
|
|
329
333
|
key: id,
|
|
330
334
|
id: id,
|
|
331
335
|
placeholder: placeholder
|
|
@@ -334,14 +338,22 @@ function BaseInputTemplate(props) {
|
|
|
334
338
|
required: required,
|
|
335
339
|
autoFocus: autofocus,
|
|
336
340
|
disabled: disabled || readonly,
|
|
337
|
-
name: name
|
|
341
|
+
name: name,
|
|
342
|
+
list: schema.examples ? "examples_" + id : undefined
|
|
338
343
|
}, semanticProps, {
|
|
339
344
|
value: value || value === 0 ? value : "",
|
|
340
345
|
error: rawErrors.length > 0,
|
|
341
346
|
onChange: _onChange,
|
|
342
347
|
onBlur: _onBlur,
|
|
343
348
|
onFocus: _onFocus
|
|
344
|
-
}))
|
|
349
|
+
})), schema.examples && /*#__PURE__*/React__default["default"].createElement("datalist", {
|
|
350
|
+
id: "examples_" + id
|
|
351
|
+
}, schema.examples.concat(schema.default ? [schema.default] : []).map(example => {
|
|
352
|
+
return /*#__PURE__*/React__default["default"].createElement("option", {
|
|
353
|
+
key: example,
|
|
354
|
+
value: example
|
|
355
|
+
});
|
|
356
|
+
})));
|
|
345
357
|
}
|
|
346
358
|
|
|
347
359
|
/* eslint-disable react/prop-types */
|
|
@@ -354,7 +366,7 @@ function DescriptionField(_ref) {
|
|
|
354
366
|
} = _ref;
|
|
355
367
|
|
|
356
368
|
if (description) {
|
|
357
|
-
return /*#__PURE__*/
|
|
369
|
+
return /*#__PURE__*/React__default["default"].createElement("p", {
|
|
358
370
|
id: id,
|
|
359
371
|
className: className || "sui-description"
|
|
360
372
|
}, description);
|
|
@@ -373,15 +385,15 @@ function ErrorList(_ref) {
|
|
|
373
385
|
let {
|
|
374
386
|
errors
|
|
375
387
|
} = _ref;
|
|
376
|
-
return /*#__PURE__*/
|
|
388
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Message, {
|
|
377
389
|
negative: true
|
|
378
|
-
}, /*#__PURE__*/
|
|
390
|
+
}, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Message.Header, null, "Errors"), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Message.List, null, errors.map((error, index) => /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Message.Item, {
|
|
379
391
|
key: "error-" + index
|
|
380
392
|
}, error.stack))));
|
|
381
393
|
}
|
|
382
394
|
|
|
383
395
|
ErrorList.propTypes = {
|
|
384
|
-
errors:
|
|
396
|
+
errors: PropTypes__default["default"].array
|
|
385
397
|
};
|
|
386
398
|
|
|
387
399
|
function IconButton(props) {
|
|
@@ -391,7 +403,7 @@ function IconButton(props) {
|
|
|
391
403
|
className,
|
|
392
404
|
...otherProps
|
|
393
405
|
} = props;
|
|
394
|
-
return /*#__PURE__*/
|
|
406
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Button, _extends({
|
|
395
407
|
icon: icon,
|
|
396
408
|
size: iconType,
|
|
397
409
|
className: className
|
|
@@ -399,25 +411,25 @@ function IconButton(props) {
|
|
|
399
411
|
}
|
|
400
412
|
|
|
401
413
|
IconButton.propTypes = {
|
|
402
|
-
icon:
|
|
403
|
-
className:
|
|
414
|
+
icon: PropTypes__default["default"].string.isRequired,
|
|
415
|
+
className: PropTypes__default["default"].string
|
|
404
416
|
};
|
|
405
417
|
function MoveDownButton(props) {
|
|
406
|
-
return /*#__PURE__*/
|
|
418
|
+
return /*#__PURE__*/React__default["default"].createElement(IconButton, _extends({
|
|
407
419
|
title: "Move down"
|
|
408
420
|
}, props, {
|
|
409
421
|
icon: "angle down"
|
|
410
422
|
}));
|
|
411
423
|
}
|
|
412
424
|
function MoveUpButton(props) {
|
|
413
|
-
return /*#__PURE__*/
|
|
425
|
+
return /*#__PURE__*/React__default["default"].createElement(IconButton, _extends({
|
|
414
426
|
title: "Move up"
|
|
415
427
|
}, props, {
|
|
416
428
|
icon: "angle up"
|
|
417
429
|
}));
|
|
418
430
|
}
|
|
419
431
|
function RemoveButton(props) {
|
|
420
|
-
return /*#__PURE__*/
|
|
432
|
+
return /*#__PURE__*/React__default["default"].createElement(IconButton, _extends({
|
|
421
433
|
title: "Remove"
|
|
422
434
|
}, props, {
|
|
423
435
|
icon: "trash"
|
|
@@ -436,7 +448,7 @@ function HelpField(_ref) {
|
|
|
436
448
|
} = _ref;
|
|
437
449
|
|
|
438
450
|
if (helpText) {
|
|
439
|
-
return /*#__PURE__*/
|
|
451
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Message, {
|
|
440
452
|
size: "mini",
|
|
441
453
|
info: true,
|
|
442
454
|
id: id,
|
|
@@ -448,8 +460,8 @@ function HelpField(_ref) {
|
|
|
448
460
|
}
|
|
449
461
|
|
|
450
462
|
HelpField.propTypes = {
|
|
451
|
-
helpText:
|
|
452
|
-
id:
|
|
463
|
+
helpText: PropTypes__default["default"].string,
|
|
464
|
+
id: PropTypes__default["default"].string
|
|
453
465
|
};
|
|
454
466
|
|
|
455
467
|
/* eslint-disable react/no-array-index-key */
|
|
@@ -473,14 +485,14 @@ function RawErrors(_ref) {
|
|
|
473
485
|
} = options;
|
|
474
486
|
|
|
475
487
|
if (errors && errors.length > 0) {
|
|
476
|
-
return /*#__PURE__*/
|
|
488
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Label, {
|
|
477
489
|
color: "red",
|
|
478
490
|
pointing: pointing || "above",
|
|
479
491
|
size: size || "small",
|
|
480
492
|
basic: true
|
|
481
|
-
}, /*#__PURE__*/
|
|
493
|
+
}, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.List, {
|
|
482
494
|
bulleted: true
|
|
483
|
-
}, errors.map(error => /*#__PURE__*/
|
|
495
|
+
}, errors.map(error => /*#__PURE__*/React__default["default"].createElement(semanticUiReact.List.Item, {
|
|
484
496
|
key: nanoid.nanoid(),
|
|
485
497
|
content: error
|
|
486
498
|
}))));
|
|
@@ -496,8 +508,8 @@ RawErrors.defaultProps = {
|
|
|
496
508
|
}
|
|
497
509
|
};
|
|
498
510
|
RawErrors.propTypes = {
|
|
499
|
-
options:
|
|
500
|
-
errors:
|
|
511
|
+
options: PropTypes__default["default"].object,
|
|
512
|
+
errors: PropTypes__default["default"].array
|
|
501
513
|
};
|
|
502
514
|
|
|
503
515
|
const WrapIfAdditional = _ref => {
|
|
@@ -527,7 +539,7 @@ const WrapIfAdditional = _ref => {
|
|
|
527
539
|
const additional = (utils.ADDITIONAL_PROPERTY_FLAG in schema);
|
|
528
540
|
|
|
529
541
|
if (!additional) {
|
|
530
|
-
return /*#__PURE__*/
|
|
542
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
531
543
|
className: classNames
|
|
532
544
|
}, children);
|
|
533
545
|
}
|
|
@@ -539,17 +551,17 @@ const WrapIfAdditional = _ref => {
|
|
|
539
551
|
return onKeyChange(target.value);
|
|
540
552
|
};
|
|
541
553
|
|
|
542
|
-
return /*#__PURE__*/
|
|
554
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
543
555
|
className: classNames,
|
|
544
556
|
key: id + "-key"
|
|
545
|
-
}, /*#__PURE__*/
|
|
557
|
+
}, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid, {
|
|
546
558
|
columns: "equal"
|
|
547
|
-
}, /*#__PURE__*/
|
|
559
|
+
}, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Row, null, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, {
|
|
548
560
|
className: "form-additional"
|
|
549
|
-
}, /*#__PURE__*/
|
|
561
|
+
}, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Group, {
|
|
550
562
|
widths: "equal",
|
|
551
563
|
grouped: true
|
|
552
|
-
}, /*#__PURE__*/
|
|
564
|
+
}, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Input, {
|
|
553
565
|
className: "form-group",
|
|
554
566
|
hasFeedback: true,
|
|
555
567
|
fluid: true,
|
|
@@ -563,10 +575,10 @@ const WrapIfAdditional = _ref => {
|
|
|
563
575
|
onBlur: !readonly ? handleBlur : undefined,
|
|
564
576
|
style: wrapperStyle,
|
|
565
577
|
type: "text"
|
|
566
|
-
}))), /*#__PURE__*/
|
|
578
|
+
}))), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, {
|
|
567
579
|
className: "form-additional",
|
|
568
580
|
verticalAlign: "middle"
|
|
569
|
-
}, children), /*#__PURE__*/
|
|
581
|
+
}, children), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, null, /*#__PURE__*/React__default["default"].createElement(RemoveButton, {
|
|
570
582
|
iconType: "mini",
|
|
571
583
|
className: "array-item-remove",
|
|
572
584
|
disabled: disabled || readonly,
|
|
@@ -601,35 +613,35 @@ function FieldTemplate(_ref) {
|
|
|
601
613
|
const DescriptionFieldTemplate = utils.getTemplate("DescriptionFieldTemplate", registry, uiOptions);
|
|
602
614
|
|
|
603
615
|
if (hidden) {
|
|
604
|
-
return /*#__PURE__*/
|
|
616
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
605
617
|
style: {
|
|
606
618
|
display: "none"
|
|
607
619
|
}
|
|
608
620
|
}, children);
|
|
609
621
|
}
|
|
610
622
|
|
|
611
|
-
return /*#__PURE__*/
|
|
623
|
+
return /*#__PURE__*/React__default["default"].createElement(WrapIfAdditional, _extends({
|
|
612
624
|
classNames: classNames,
|
|
613
625
|
id: id,
|
|
614
626
|
label: label,
|
|
615
627
|
registry: registry
|
|
616
|
-
}, props), /*#__PURE__*/
|
|
628
|
+
}, props), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Group, {
|
|
617
629
|
key: id,
|
|
618
630
|
widths: "equal",
|
|
619
631
|
grouped: true
|
|
620
|
-
}, /*#__PURE__*/
|
|
632
|
+
}, /*#__PURE__*/React__default["default"].createElement(MaybeWrap, {
|
|
621
633
|
wrap: wrapContent,
|
|
622
634
|
className: "sui-field-content"
|
|
623
|
-
}, children, displayLabel && rawDescription && /*#__PURE__*/
|
|
635
|
+
}, children, displayLabel && rawDescription && /*#__PURE__*/React__default["default"].createElement(MaybeWrap, {
|
|
624
636
|
wrap: wrapLabel,
|
|
625
637
|
className: "sui-field-label"
|
|
626
|
-
}, rawDescription && /*#__PURE__*/
|
|
638
|
+
}, rawDescription && /*#__PURE__*/React__default["default"].createElement(DescriptionFieldTemplate, {
|
|
627
639
|
id: id + "-description",
|
|
628
640
|
description: rawDescription
|
|
629
|
-
})), /*#__PURE__*/
|
|
641
|
+
})), /*#__PURE__*/React__default["default"].createElement(HelpField, {
|
|
630
642
|
helpText: rawHelp,
|
|
631
643
|
id: id + "__help"
|
|
632
|
-
}), /*#__PURE__*/
|
|
644
|
+
}), /*#__PURE__*/React__default["default"].createElement(RawErrors, {
|
|
633
645
|
errors: rawErrors,
|
|
634
646
|
options: errorOptions
|
|
635
647
|
}))));
|
|
@@ -663,26 +675,26 @@ function ObjectFieldTemplate(_ref) {
|
|
|
663
675
|
} = registry.templates;
|
|
664
676
|
const fieldTitle = uiOptions.title || title;
|
|
665
677
|
const fieldDescription = uiOptions.description || description;
|
|
666
|
-
return /*#__PURE__*/
|
|
678
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, fieldTitle && /*#__PURE__*/React__default["default"].createElement(TitleFieldTemplate, {
|
|
667
679
|
id: idSchema.$id + "-title",
|
|
668
680
|
title: fieldTitle,
|
|
669
681
|
required: required,
|
|
670
682
|
uiSchema: uiSchema,
|
|
671
683
|
registry: registry
|
|
672
|
-
}), fieldDescription && /*#__PURE__*/
|
|
684
|
+
}), fieldDescription && /*#__PURE__*/React__default["default"].createElement(DescriptionFieldTemplate, {
|
|
673
685
|
id: idSchema.$id + "-description",
|
|
674
686
|
description: fieldDescription,
|
|
675
687
|
registry: registry
|
|
676
|
-
}), properties.map(prop => prop.content), utils.canExpand(schema, uiSchema, formData) && /*#__PURE__*/
|
|
688
|
+
}), properties.map(prop => prop.content), utils.canExpand(schema, uiSchema, formData) && /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, {
|
|
677
689
|
width: 16,
|
|
678
690
|
verticalAlign: "middle"
|
|
679
|
-
}, /*#__PURE__*/
|
|
691
|
+
}, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Row, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
680
692
|
style: {
|
|
681
693
|
marginTop: "1rem",
|
|
682
694
|
position: "relative",
|
|
683
695
|
textAlign: "right"
|
|
684
696
|
}
|
|
685
|
-
}, /*#__PURE__*/
|
|
697
|
+
}, /*#__PURE__*/React__default["default"].createElement(AddButton, {
|
|
686
698
|
onClick: onAddClick(schema),
|
|
687
699
|
disabled: disabled || readOnly
|
|
688
700
|
})))));
|
|
@@ -702,7 +714,7 @@ var SubmitButton = (_ref => {
|
|
|
702
714
|
return null;
|
|
703
715
|
}
|
|
704
716
|
|
|
705
|
-
return /*#__PURE__*/
|
|
717
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Button, _extends({
|
|
706
718
|
type: "submit",
|
|
707
719
|
primary: true
|
|
708
720
|
}, submitButtonProps), submitText);
|
|
@@ -727,7 +739,7 @@ function TitleField(_ref) {
|
|
|
727
739
|
} = uiOptions.options || DEFAULT_OPTIONS;
|
|
728
740
|
|
|
729
741
|
if (title) {
|
|
730
|
-
return /*#__PURE__*/
|
|
742
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Header, _extends({
|
|
731
743
|
id: id
|
|
732
744
|
}, semantic, {
|
|
733
745
|
as: "h5"
|
|
@@ -793,7 +805,7 @@ function CheckboxWidget(props) {
|
|
|
793
805
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
794
806
|
|
|
795
807
|
const checked = value == "true" || value == true;
|
|
796
|
-
return /*#__PURE__*/
|
|
808
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Checkbox, _extends({
|
|
797
809
|
id: id,
|
|
798
810
|
disabled: disabled || readonly,
|
|
799
811
|
autoFocus: autofocus
|
|
@@ -886,17 +898,17 @@ function CheckboxesWidget(props) {
|
|
|
886
898
|
} : {
|
|
887
899
|
grouped: true
|
|
888
900
|
};
|
|
889
|
-
return /*#__PURE__*/
|
|
901
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, title && /*#__PURE__*/React__default["default"].createElement(TitleFieldTemplate, {
|
|
890
902
|
id: id + "-title",
|
|
891
903
|
title: title,
|
|
892
904
|
uiSchema: uiSchema,
|
|
893
905
|
registry: registry
|
|
894
|
-
}), /*#__PURE__*/
|
|
906
|
+
}), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Group, _extends({
|
|
895
907
|
id: id
|
|
896
908
|
}, inlineOption), enumOptions.map((option, index) => {
|
|
897
909
|
const checked = value.indexOf(option.value) !== -1;
|
|
898
910
|
const itemDisabled = enumDisabled && enumDisabled.indexOf(option.value) !== -1;
|
|
899
|
-
return /*#__PURE__*/
|
|
911
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Checkbox, _extends({
|
|
900
912
|
id: id + "_" + index,
|
|
901
913
|
key: id + "_" + index,
|
|
902
914
|
label: option.label
|
|
@@ -954,9 +966,9 @@ function RadioWidget(props) {
|
|
|
954
966
|
} : {
|
|
955
967
|
grouped: true
|
|
956
968
|
};
|
|
957
|
-
return /*#__PURE__*/
|
|
969
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Group, inlineOption, enumOptions.map((option, i) => {
|
|
958
970
|
const itemDisabled = enumDisabled && enumDisabled.indexOf(option.value) !== -1;
|
|
959
|
-
return /*#__PURE__*/
|
|
971
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Field, _extends({
|
|
960
972
|
required: required,
|
|
961
973
|
control: semanticUiReact.Radio,
|
|
962
974
|
name: id + "-radio-" + option.value
|
|
@@ -1013,7 +1025,7 @@ function RangeWidget(props) {
|
|
|
1013
1025
|
|
|
1014
1026
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
1015
1027
|
|
|
1016
|
-
return /*#__PURE__*/
|
|
1028
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Input, _extends({
|
|
1017
1029
|
id: id,
|
|
1018
1030
|
key: id,
|
|
1019
1031
|
name: name,
|
|
@@ -1026,7 +1038,7 @@ function RangeWidget(props) {
|
|
|
1026
1038
|
onChange: _onChange,
|
|
1027
1039
|
onBlur: _onBlur,
|
|
1028
1040
|
onFocus: _onFocus
|
|
1029
|
-
})), /*#__PURE__*/
|
|
1041
|
+
})), /*#__PURE__*/React__default["default"].createElement("span", null, value));
|
|
1030
1042
|
}
|
|
1031
1043
|
|
|
1032
1044
|
/**
|
|
@@ -1040,7 +1052,7 @@ function createDefaultValueOptionsForDropDown(enumOptions, enumDisabled) {
|
|
|
1040
1052
|
const disabledOptions = enumDisabled || [];
|
|
1041
1053
|
let options = []; // eslint-disable-next-line no-shadow
|
|
1042
1054
|
|
|
1043
|
-
options =
|
|
1055
|
+
options = ___default["default"].map(enumOptions, _ref => {
|
|
1044
1056
|
let {
|
|
1045
1057
|
label,
|
|
1046
1058
|
value
|
|
@@ -1124,7 +1136,7 @@ function SelectWidget(props) {
|
|
|
1124
1136
|
return onFocus && onFocus(id, utils.processSelectValue(schema, value, options));
|
|
1125
1137
|
};
|
|
1126
1138
|
|
|
1127
|
-
return /*#__PURE__*/
|
|
1139
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Dropdown, _extends({
|
|
1128
1140
|
key: id,
|
|
1129
1141
|
name: name,
|
|
1130
1142
|
label: label || schema.title,
|
|
@@ -1190,7 +1202,7 @@ function TextareaWidget(props) {
|
|
|
1190
1202
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
1191
1203
|
|
|
1192
1204
|
const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema);
|
|
1193
|
-
return /*#__PURE__*/
|
|
1205
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.TextArea, _extends({
|
|
1194
1206
|
id: id,
|
|
1195
1207
|
key: id,
|
|
1196
1208
|
label: displayLabel ? label || schema.title : false,
|
|
@@ -1230,5 +1242,5 @@ exports.Form = SemanticUIForm;
|
|
|
1230
1242
|
exports.Templates = Templates;
|
|
1231
1243
|
exports.Theme = Theme;
|
|
1232
1244
|
exports.Widgets = Widgets;
|
|
1233
|
-
exports
|
|
1245
|
+
exports["default"] = SemanticUIForm;
|
|
1234
1246
|
//# sourceMappingURL=semantic-ui.cjs.development.js.map
|