@rjsf/semantic-ui 4.2.3 → 5.0.0-beta.10

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.
Files changed (71) hide show
  1. package/README.md +8 -3
  2. package/dist/index.d.ts +32 -9
  3. package/dist/semantic-ui.cjs.development.js +934 -1299
  4. package/dist/semantic-ui.cjs.development.js.map +1 -1
  5. package/dist/semantic-ui.cjs.production.min.js +1 -1
  6. package/dist/semantic-ui.cjs.production.min.js.map +1 -1
  7. package/dist/semantic-ui.esm.js +928 -1294
  8. package/dist/semantic-ui.esm.js.map +1 -1
  9. package/dist/semantic-ui.umd.development.js +936 -1303
  10. package/dist/semantic-ui.umd.development.js.map +1 -1
  11. package/dist/semantic-ui.umd.production.min.js +1 -1
  12. package/dist/semantic-ui.umd.production.min.js.map +1 -1
  13. package/package.json +43 -73
  14. package/dist/AddButton/AddButton.d.ts +0 -2
  15. package/dist/AddButton/index.d.ts +0 -2
  16. package/dist/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +0 -2
  17. package/dist/ArrayFieldTemplate/index.d.ts +0 -2
  18. package/dist/CheckboxWidget/CheckboxWidget.d.ts +0 -2
  19. package/dist/CheckboxWidget/index.d.ts +0 -2
  20. package/dist/CheckboxesWidget/CheckboxesWidget.d.ts +0 -2
  21. package/dist/CheckboxesWidget/index.d.ts +0 -2
  22. package/dist/DateTimeWidget/DateTimeWidget.d.ts +0 -2
  23. package/dist/DateTimeWidget/index.d.ts +0 -2
  24. package/dist/DateWidget/DateWidget.d.ts +0 -2
  25. package/dist/DateWidget/index.d.ts +0 -2
  26. package/dist/DescriptionField/DescriptionField.d.ts +0 -5
  27. package/dist/DescriptionField/index.d.ts +0 -2
  28. package/dist/EmailWidget/EmailWidget.d.ts +0 -2
  29. package/dist/EmailWidget/index.d.ts +0 -2
  30. package/dist/ErrorList/ErrorList.d.ts +0 -27
  31. package/dist/ErrorList/index.d.ts +0 -2
  32. package/dist/FieldTemplate/FieldTemplate.d.ts +0 -14
  33. package/dist/FieldTemplate/WrapIfAdditional.d.ts +0 -14
  34. package/dist/FieldTemplate/index.d.ts +0 -2
  35. package/dist/Fields/Fields.d.ts +0 -7
  36. package/dist/Fields/index.d.ts +0 -2
  37. package/dist/HelpField/HelpField.d.ts +0 -15
  38. package/dist/HelpField/index.d.ts +0 -2
  39. package/dist/IconButton/IconButton.d.ts +0 -9
  40. package/dist/IconButton/index.d.ts +0 -2
  41. package/dist/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +0 -16
  42. package/dist/ObjectFieldTemplate/index.d.ts +0 -2
  43. package/dist/PasswordWidget/PasswordWidget.d.ts +0 -2
  44. package/dist/PasswordWidget/index.d.ts +0 -2
  45. package/dist/RadioWidget/RadioWidget.d.ts +0 -2
  46. package/dist/RadioWidget/index.d.ts +0 -2
  47. package/dist/RangeWidget/RangeWidget.d.ts +0 -2
  48. package/dist/RangeWidget/index.d.ts +0 -2
  49. package/dist/RawErrors/RawErrors.d.ts +0 -41
  50. package/dist/RawErrors/index.d.ts +0 -2
  51. package/dist/SelectWidget/SelectWidget.d.ts +0 -2
  52. package/dist/SelectWidget/index.d.ts +0 -2
  53. package/dist/SemanticUIForm/SemanticUIForm.d.ts +0 -3
  54. package/dist/SemanticUIForm/index.d.ts +0 -2
  55. package/dist/SubmitButton/SubmitButton.d.ts +0 -4
  56. package/dist/SubmitButton/index.d.ts +0 -2
  57. package/dist/TextWidget/TextWidget.d.ts +0 -2
  58. package/dist/TextWidget/index.d.ts +0 -2
  59. package/dist/TextareaWidget/TextareaWidget.d.ts +0 -2
  60. package/dist/TextareaWidget/index.d.ts +0 -2
  61. package/dist/Theme/Theme.d.ts +0 -35
  62. package/dist/Theme/index.d.ts +0 -2
  63. package/dist/TitleField/TitleField.d.ts +0 -20
  64. package/dist/TitleField/index.d.ts +0 -2
  65. package/dist/URLWidget/URLWidget.d.ts +0 -2
  66. package/dist/URLWidget/index.d.ts +0 -2
  67. package/dist/UpDownWidget/UpDownWidget.d.ts +0 -2
  68. package/dist/UpDownWidget/index.d.ts +0 -2
  69. package/dist/Widgets/Widgets.d.ts +0 -31
  70. package/dist/Widgets/index.d.ts +0 -2
  71. package/dist/util.d.ts +0 -62
@@ -2,125 +2,101 @@
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 = _interopDefault(require('react'));
10
- var PropTypes = _interopDefault(require('prop-types'));
7
+ var React = require('react');
8
+ var utils = require('@rjsf/utils');
11
9
  var nanoid = require('nanoid');
12
- var _ = _interopDefault(require('lodash'));
13
-
14
- function _extends() {
15
- _extends = Object.assign || function (target) {
16
- for (var i = 1; i < arguments.length; i++) {
17
- var source = arguments[i];
18
-
19
- for (var key in source) {
20
- if (Object.prototype.hasOwnProperty.call(source, key)) {
21
- target[key] = source[key];
22
- }
23
- }
24
- }
25
-
26
- return target;
27
- };
28
-
29
- return _extends.apply(this, arguments);
30
- }
31
-
32
- function _objectWithoutPropertiesLoose(source, excluded) {
33
- if (source == null) return {};
34
- var target = {};
35
- var sourceKeys = Object.keys(source);
36
- var key, i;
37
-
38
- for (i = 0; i < sourceKeys.length; i++) {
39
- key = sourceKeys[i];
40
- if (excluded.indexOf(key) >= 0) continue;
41
- target[key] = source[key];
42
- }
43
-
44
- return target;
45
- }
46
-
47
- function AddButton(props) {
48
- return React.createElement(semanticUiReact.Button, _extends({}, props, {
10
+ var map = require('lodash/map');
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
+ var map__default = /*#__PURE__*/_interopDefaultLegacy(map);
16
+
17
+ function AddButton(_ref) {
18
+ let {
19
+ uiSchema,
20
+ color,
21
+ ...props
22
+ } = _ref;
23
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Button, {
24
+ title: "Add Item",
25
+ color: color,
26
+ ...props,
49
27
  icon: true,
50
- size: "tiny",
51
- labelPosition: "left"
52
- }), React.createElement(semanticUiReact.Icon, {
28
+ size: "tiny"
29
+ }, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Icon, {
53
30
  name: "plus"
54
- }), "Add Item");
31
+ }));
55
32
  }
56
33
 
57
- /**
58
- * Extract props meant for semantic UI components from props that are
59
- * passed to Widgets, Templates and Fields.
60
- * @param {Object} params
61
- * @param {Object?} params.formContext
62
- * @param {Object?} params.uiSchema
63
- * @param {Object?} params.options
64
- * @param {Object?} params.defaultSchemaProps
65
- * @param {Object?} params.defaultContextProps
66
- * @returns {any}
34
+ /**
35
+ * Extract props meant for semantic UI components from props that are
36
+ * passed to Widgets, Templates and Fields.
37
+ * @param {Object} params
38
+ * @param {Object?} params.formContext
39
+ * @param {Object?} params.uiSchema
40
+ * @param {Object?} params.options
41
+ * @param {Object?} params.defaultSchemaProps
42
+ * @param {Object?} params.defaultContextProps
43
+ * @returns {any}
67
44
  */
68
45
 
69
46
  function getSemanticProps(_ref) {
70
- var _ref$formContext = _ref.formContext,
71
- formContext = _ref$formContext === void 0 ? {} : _ref$formContext,
72
- _ref$uiSchema = _ref.uiSchema,
73
- uiSchema = _ref$uiSchema === void 0 ? {} : _ref$uiSchema,
74
- _ref$options = _ref.options,
75
- options = _ref$options === void 0 ? {} : _ref$options,
76
- _ref$defaultSchemaPro = _ref.defaultSchemaProps,
77
- defaultSchemaProps = _ref$defaultSchemaPro === void 0 ? {
78
- fluid: true,
79
- inverted: false
80
- } : _ref$defaultSchemaPro,
81
- _ref$defaultContextPr = _ref.defaultContextProps,
82
- defaultContextProps = _ref$defaultContextPr === void 0 ? {} : _ref$defaultContextPr;
83
- var formContextProps = formContext.semantic;
84
- var schemaProps = uiSchema["ui:options"] && uiSchema["ui:options"].semantic;
85
- var optionProps = options.semantic; // formContext props should overide other props
86
-
87
- return Object.assign({}, _extends({}, defaultSchemaProps && defaultSchemaProps), _extends({}, defaultContextProps && defaultContextProps), schemaProps, optionProps, formContextProps);
47
+ let {
48
+ formContext = {},
49
+ uiSchema = {},
50
+ options = {},
51
+ defaultSchemaProps = {
52
+ fluid: true,
53
+ inverted: false
54
+ },
55
+ defaultContextProps = {}
56
+ } = _ref;
57
+ const formContextProps = formContext.semantic;
58
+ const schemaProps = utils.getUiOptions(uiSchema).semantic;
59
+ const optionProps = options.semantic; // formContext props should overide other props
60
+
61
+ return Object.assign({}, { ...defaultSchemaProps
62
+ }, { ...defaultContextProps
63
+ }, schemaProps, optionProps, formContextProps);
88
64
  }
89
- /**
90
- * Extract error props meant for semantic UI components from props that are
91
- * passed to Widgets, Templates and Fields.
92
- * @param {Object} params
93
- * @param {Object?} params.formContext
94
- * @param {Object?} params.uiSchema
95
- * @param {Object?} params.defaultProps
96
- * @returns {any}
65
+ /**
66
+ * Extract error props meant for semantic UI components from props that are
67
+ * passed to Widgets, Templates and Fields.
68
+ * @param {Object} params
69
+ * @param {Object?} params.formContext
70
+ * @param {Object?} params.uiSchema
71
+ * @param {Object?} params.defaultProps
72
+ * @returns {any}
97
73
  */
98
74
 
99
75
  function getSemanticErrorProps(_ref2) {
100
- var _ref2$formContext = _ref2.formContext,
101
- formContext = _ref2$formContext === void 0 ? {} : _ref2$formContext,
102
- _ref2$uiSchema = _ref2.uiSchema,
103
- uiSchema = _ref2$uiSchema === void 0 ? {} : _ref2$uiSchema,
104
- _ref2$options = _ref2.options,
105
- options = _ref2$options === void 0 ? {} : _ref2$options,
106
- _ref2$defaultProps = _ref2.defaultProps,
107
- defaultProps = _ref2$defaultProps === void 0 ? {
108
- size: 'small',
109
- pointing: 'above'
110
- } : _ref2$defaultProps;
111
- var formContextProps = formContext.semantic && formContext.semantic.errorOptions;
112
- var schemaProps = uiSchema["ui:options"] && uiSchema["ui:options"].semantic && uiSchema["ui:options"].semantic.errorOptions;
113
- var optionProps = options.semantic && options.semantic.errorOptions;
114
- return Object.assign({}, _extends({}, defaultProps && defaultProps), schemaProps, optionProps, formContextProps);
76
+ let {
77
+ formContext = {},
78
+ uiSchema = {},
79
+ options = {},
80
+ defaultProps = {
81
+ size: "small",
82
+ pointing: "above"
83
+ }
84
+ } = _ref2;
85
+ const formContextProps = formContext.semantic && formContext.semantic.errorOptions;
86
+ const semanticOptions = utils.getUiOptions(uiSchema).semantic;
87
+ const schemaProps = semanticOptions && semanticOptions.errorOptions;
88
+ const optionProps = options.semantic && options.semantic.errorOptions;
89
+ return Object.assign({}, { ...defaultProps
90
+ }, schemaProps, optionProps, formContextProps);
115
91
  }
116
- /**
117
- * Combine multiple strings containing class names into a single string,
118
- * removing duplicates. E.g.
119
- * cleanClassNames('bar', 'baz bar', 'x y ', undefined)
120
- * // 'bar baz x y'
121
- * @param {Array} classNameArr
122
- * @param {Array} omit
123
- * @returns {string}
92
+ /**
93
+ * Combine multiple strings containing class names into a single string,
94
+ * removing duplicates. E.g.
95
+ * cleanClassNames('bar', 'baz bar', 'x y ', undefined)
96
+ * // 'bar baz x y'
97
+ * @param {Array} classNameArr
98
+ * @param {Array} omit
99
+ * @returns {string}
124
100
  */
125
101
 
126
102
  function cleanClassNames(classNameArr, omit) {
@@ -130,432 +106,615 @@ function cleanClassNames(classNameArr, omit) {
130
106
 
131
107
  // Split each arg on whitespace, and add it to an array. Skip false-y args
132
108
  // like "" and undefined.
133
- var classList = classNameArr.filter(Boolean).reduce(function (previous, current) {
134
- return previous.concat(current.trim().split(/\s+/));
135
- }, []); // Remove any class names from omit, and make the rest unique before
109
+ const classList = classNameArr.filter(Boolean).reduce((previous, current) => previous.concat(current.trim().split(/\s+/)), []); // Remove any class names from omit, and make the rest unique before
136
110
  // returning them as a string
137
111
 
138
- return [].concat(new Set(classList.filter(function (cn) {
139
- return !omit.includes(cn);
140
- }))).join(" ");
112
+ return [...new Set(classList.filter(cn => !omit.includes(cn)))].join(" ");
141
113
  }
142
- /**
143
- *
144
- * @param {boolean} wrap
145
- * @param Component
146
- * @param {Object} props
147
- * @returns {*}
148
- * @constructor
114
+ /**
115
+ *
116
+ * @param {boolean} wrap
117
+ * @param Component
118
+ * @param {Object} props
119
+ * @returns {*}
120
+ * @constructor
149
121
  */
150
122
 
151
123
  function MaybeWrap(_ref3) {
152
- var wrap = _ref3.wrap,
153
- _ref3$component = _ref3.component,
154
- Component = _ref3$component === void 0 ? "div" : _ref3$component,
155
- props = _objectWithoutPropertiesLoose(_ref3, ["wrap", "component"]);
156
-
157
- return wrap ? React.createElement(Component, props) : props.children;
124
+ let {
125
+ wrap,
126
+ component: Component = "div",
127
+ ...props
128
+ } = _ref3;
129
+ return wrap ? /*#__PURE__*/React__default["default"].createElement(Component, { ...props
130
+ }) : props.children;
158
131
  }
159
132
 
160
- var isFixedItems = core.utils.isFixedItems;
161
-
162
- var ArrayFieldTitle = function ArrayFieldTitle(_ref) {
163
- var TitleField = _ref.TitleField,
164
- idSchema = _ref.idSchema,
165
- uiSchema = _ref.uiSchema,
166
- title = _ref.title;
167
-
168
- if (!title) {
169
- return null;
170
- }
171
-
172
- var id = idSchema.$id + "__title";
173
- return React.createElement(TitleField, {
174
- id: id,
175
- title: title,
176
- options: uiSchema["ui:options"]
177
- });
178
- };
179
-
180
- function ArrayFieldDescription(_ref2) {
181
- var DescriptionField = _ref2.DescriptionField,
182
- idSchema = _ref2.idSchema,
183
- description = _ref2.description;
184
-
185
- if (!description) {
186
- // See #312: Ensure compatibility with old versions of React.
187
- return null;
188
- }
189
-
190
- var id = idSchema.$id + "__description";
191
- return React.createElement(DescriptionField, {
192
- id: id,
193
- description: description
194
- });
195
- }
196
-
197
- var gridStyle = function gridStyle(vertical) {
198
- return {
199
- display: "grid",
200
- gridTemplateColumns: "1fr " + (vertical ? 65 : 110) + "px"
201
- };
202
- }; // checks if its the first array item
203
-
204
-
205
- function isInitialArrayItem(props) {
206
- // no underscore because im not sure if we want to import a library here
207
- var idSchema = props.children.props.idSchema;
208
- return idSchema.target && idSchema.conditions;
209
- } // Used in the two templates
210
-
133
+ const gridStyle = vertical => ({
134
+ display: "grid",
135
+ gridTemplateColumns: "1fr " + (vertical ? 65 : 110) + "px"
136
+ });
211
137
 
212
- function DefaultArrayItem(props) {
213
- return React.createElement("div", {
214
- className: "array-item",
215
- key: props.key
216
- }, React.createElement(MaybeWrap, {
217
- wrap: props.wrapItem,
138
+ const ArrayFieldItemTemplate = props => {
139
+ const {
140
+ children,
141
+ disabled,
142
+ hasToolbar,
143
+ hasMoveDown,
144
+ hasMoveUp,
145
+ hasRemove,
146
+ index,
147
+ onDropIndexClick,
148
+ onReorderClick,
149
+ readonly,
150
+ uiSchema,
151
+ registry
152
+ } = props;
153
+ const {
154
+ MoveDownButton,
155
+ MoveUpButton,
156
+ RemoveButton
157
+ } = registry.templates.ButtonTemplates;
158
+ const uiOptions = utils.getUiOptions(uiSchema); // Pull the semantic props out of the uiOptions that were put in via the ArrayFieldTemplate
159
+
160
+ const {
161
+ horizontalButtons = false,
162
+ wrapItem = false
163
+ } = uiOptions.semantic;
164
+ return /*#__PURE__*/React__default["default"].createElement("div", {
165
+ className: "array-item"
166
+ }, /*#__PURE__*/React__default["default"].createElement(MaybeWrap, {
167
+ wrap: wrapItem,
218
168
  component: semanticUiReact.Segment
219
- }, React.createElement(semanticUiReact.Grid, {
220
- style: !isInitialArrayItem(props) ? _extends({}, gridStyle(!props.horizontalButtons), {
169
+ }, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid, {
170
+ style: index !== 0 ? { ...gridStyle(!horizontalButtons),
221
171
  alignItems: "center"
222
- }) : gridStyle(!props.horizontalButtons)
223
- }, React.createElement(semanticUiReact.Grid.Column, {
172
+ } : gridStyle(!horizontalButtons)
173
+ }, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, {
224
174
  width: 16,
225
175
  verticalAlign: "middle"
226
- }, props.children), props.hasToolbar && React.createElement(semanticUiReact.Grid.Column, null, (props.hasMoveUp || props.hasMoveDown || props.hasRemove) && React.createElement(semanticUiReact.Button.Group, {
176
+ }, children), hasToolbar && /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, null, (hasMoveUp || hasMoveDown || hasRemove) && /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Button.Group, {
227
177
  size: "mini",
228
- vertical: !props.horizontalButtons
229
- }, (props.hasMoveUp || props.hasMoveDown) && React.createElement(semanticUiReact.Button, {
230
- icon: "angle up",
178
+ vertical: !horizontalButtons
179
+ }, (hasMoveUp || hasMoveDown) && /*#__PURE__*/React__default["default"].createElement(MoveUpButton, {
231
180
  className: "array-item-move-up",
232
- tabIndex: "-1",
233
- disabled: props.disabled || props.readOnly || !props.hasMoveUp,
234
- onClick: props.onReorderClick(props.index, props.index - 1)
235
- }), (props.hasMoveUp || props.hasMoveDown) && React.createElement(semanticUiReact.Button, {
236
- icon: "angle down",
181
+ disabled: disabled || readonly || !hasMoveUp,
182
+ onClick: onReorderClick(index, index - 1),
183
+ uiSchema: uiSchema
184
+ }), (hasMoveUp || hasMoveDown) && /*#__PURE__*/React__default["default"].createElement(MoveDownButton, {
237
185
  className: "array-item-move-down",
238
- tabIndex: "-1",
239
- disabled: props.disabled || props.readOnly || !props.hasMoveDown,
240
- onClick: props.onReorderClick(props.index, props.index + 1)
241
- }), props.hasRemove && React.createElement(semanticUiReact.Button, {
242
- icon: "trash",
186
+ disabled: disabled || readonly || !hasMoveDown,
187
+ onClick: onReorderClick(index, index + 1),
188
+ uiSchema: uiSchema
189
+ }), hasRemove && /*#__PURE__*/React__default["default"].createElement(RemoveButton, {
243
190
  className: "array-item-remove",
244
- tabIndex: "-1",
245
- disabled: props.disabled || props.readOnly,
246
- onClick: props.onDropIndexClick(props.index)
191
+ disabled: disabled || readonly,
192
+ onClick: onDropIndexClick(index),
193
+ uiSchema: uiSchema
247
194
  }))))));
248
- } // Used for arrays that are represented as multiple selection fields
249
- // (displayed as a multi select or checkboxes)
250
-
251
-
252
- function DefaultFixedArrayFieldTemplate(_ref3) {
253
- var uiSchema = _ref3.uiSchema,
254
- idSchema = _ref3.idSchema,
255
- canAdd = _ref3.canAdd,
256
- className = _ref3.className,
257
- classNames = _ref3.classNames,
258
- disabled = _ref3.disabled,
259
- items = _ref3.items,
260
- onAddClick = _ref3.onAddClick,
261
- readOnly = _ref3.readOnly,
262
- required = _ref3.required,
263
- schema = _ref3.schema,
264
- title = _ref3.title,
265
- TitleField = _ref3.TitleField,
266
- itemProps = _ref3.itemProps;
267
- var fieldTitle = uiSchema["ui:title"] || title;
268
- var fieldDescription = uiSchema["ui:description"] || schema.description;
269
- return React.createElement("div", {
270
- className: cleanClassNames([className, classNames])
271
- }, React.createElement(ArrayFieldTitle, {
272
- key: "array-field-title-" + idSchema.$id,
273
- TitleField: TitleField,
274
- idSchema: idSchema,
275
- uiSchema: uiSchema,
276
- title: fieldTitle,
277
- required: required
278
- }), fieldDescription && React.createElement("div", {
279
- className: "field-description",
280
- key: "field-description-" + idSchema.$id
281
- }, fieldDescription), React.createElement("div", {
282
- key: "array-item-list-" + idSchema.$id
283
- }, React.createElement("div", {
284
- className: "row array-item-list"
285
- }, items && items.map(function (p) {
286
- return DefaultArrayItem(_extends({}, p, itemProps));
287
- })), canAdd && React.createElement("div", {
288
- style: {
289
- marginTop: "1rem",
290
- position: "relative",
291
- textAlign: "right"
292
- }
293
- }, React.createElement(AddButton, {
294
- onClick: onAddClick,
295
- disabled: disabled || readOnly
296
- }))));
297
- }
195
+ };
298
196
 
299
- function DefaultNormalArrayFieldTemplate(_ref4) {
300
- var uiSchema = _ref4.uiSchema,
301
- idSchema = _ref4.idSchema,
302
- canAdd = _ref4.canAdd,
303
- className = _ref4.className,
304
- classNames = _ref4.classNames,
305
- disabled = _ref4.disabled,
306
- DescriptionField = _ref4.DescriptionField,
307
- items = _ref4.items,
308
- onAddClick = _ref4.onAddClick,
309
- readOnly = _ref4.readOnly,
310
- required = _ref4.required,
311
- schema = _ref4.schema,
312
- title = _ref4.title,
313
- TitleField = _ref4.TitleField,
314
- itemProps = _ref4.itemProps;
315
- var fieldTitle = uiSchema["ui:title"] || title;
316
- var fieldDescription = uiSchema["ui:description"] || schema.description;
317
- return React.createElement("div", {
318
- className: cleanClassNames([className, classNames, "sortable-form-fields"])
319
- }, React.createElement(ArrayFieldTitle, {
320
- key: "array-field-title-" + idSchema.$id,
321
- TitleField: TitleField,
197
+ function ArrayFieldTemplate(_ref) {
198
+ let {
199
+ uiSchema,
200
+ idSchema,
201
+ canAdd,
202
+ className,
203
+ // classNames, This is not part of the type, so it is likely never passed in
204
+ disabled,
205
+ formContext,
206
+ items,
207
+ onAddClick,
208
+ // options, This is not part of the type, so it is likely never passed in
209
+ readonly,
210
+ required,
211
+ schema,
212
+ title,
213
+ registry
214
+ } = _ref;
215
+ const semanticProps = getSemanticProps({
216
+ uiSchema,
217
+ formContext,
218
+ defaultSchemaProps: {
219
+ horizontalButtons: false,
220
+ wrapItem: false
221
+ }
222
+ });
223
+ const {
224
+ horizontalButtons,
225
+ wrapItem
226
+ } = semanticProps;
227
+ const semantic = {
228
+ horizontalButtons,
229
+ wrapItem
230
+ };
231
+ const uiOptions = utils.getUiOptions(uiSchema);
232
+ const ArrayFieldDescriptionTemplate = utils.getTemplate("ArrayFieldDescriptionTemplate", registry, uiOptions);
233
+ const ArrayFieldItemTemplate = utils.getTemplate("ArrayFieldItemTemplate", registry, uiOptions);
234
+ const ArrayFieldTitleTemplate = utils.getTemplate("ArrayFieldTitleTemplate", registry, uiOptions); // Button templates are not overridden in the uiSchema
235
+
236
+ const {
237
+ ButtonTemplates: {
238
+ AddButton
239
+ }
240
+ } = registry.templates;
241
+ const fieldTitle = uiOptions.title || title;
242
+ const fieldDescription = uiOptions.description || schema.description;
243
+ return /*#__PURE__*/React__default["default"].createElement("div", {
244
+ className: cleanClassNames([className, utils.isFixedItems(schema) ? "" : "sortable-form-fields"])
245
+ }, /*#__PURE__*/React__default["default"].createElement(ArrayFieldTitleTemplate, {
322
246
  idSchema: idSchema,
323
- uiSchema: uiSchema,
324
247
  title: fieldTitle,
325
- required: required
326
- }), fieldDescription && React.createElement(ArrayFieldDescription, {
327
- key: "array-field-description-" + idSchema.$id,
328
- DescriptionField: DescriptionField,
248
+ uiSchema: uiSchema,
249
+ required: required,
250
+ registry: registry
251
+ }), fieldDescription && /*#__PURE__*/React__default["default"].createElement(ArrayFieldDescriptionTemplate, {
329
252
  idSchema: idSchema,
330
- description: fieldDescription
331
- }), React.createElement("div", {
253
+ description: fieldDescription,
254
+ uiSchema: uiSchema,
255
+ registry: registry
256
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
332
257
  key: "array-item-list-" + idSchema.$id
333
- }, React.createElement("div", {
258
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
334
259
  className: "row array-item-list"
335
- }, items && items.map(function (p) {
336
- return DefaultArrayItem(_extends({}, p, itemProps));
337
- })), canAdd && React.createElement("div", {
260
+ }, items && items.map(_ref2 => {
261
+ let {
262
+ key,
263
+ uiSchema: itemUiSchema = {},
264
+ ...props
265
+ } = _ref2;
266
+ // Merge in the semantic props from the ArrayFieldTemplate into each of the items
267
+ const mergedUiSchema = { ...itemUiSchema,
268
+ [utils.UI_OPTIONS_KEY]: { ...itemUiSchema[utils.UI_OPTIONS_KEY],
269
+ semantic
270
+ }
271
+ };
272
+ return /*#__PURE__*/React__default["default"].createElement(ArrayFieldItemTemplate, {
273
+ key: key,
274
+ ...props,
275
+ uiSchema: mergedUiSchema
276
+ });
277
+ })), canAdd && /*#__PURE__*/React__default["default"].createElement("div", {
338
278
  style: {
339
279
  marginTop: "1rem",
340
280
  position: "relative",
341
281
  textAlign: "right"
342
282
  }
343
- }, React.createElement(AddButton, {
283
+ }, /*#__PURE__*/React__default["default"].createElement(AddButton, {
344
284
  onClick: onAddClick,
345
- disabled: disabled || readOnly
285
+ disabled: disabled || readonly,
286
+ uiSchema: uiSchema
346
287
  }))));
347
288
  }
348
289
 
349
- function ArrayFieldTemplate(props) {
350
- var options = props.options,
351
- schema = props.schema,
352
- uiSchema = props.uiSchema,
353
- formContext = props.formContext;
354
- var semanticProps = getSemanticProps({
355
- options: options,
356
- uiSchema: uiSchema,
357
- formContext: formContext,
358
- defaultSchemaProps: {
359
- horizontalButtons: false,
360
- wrapItem: false
361
- }
290
+ function BaseInputTemplate(props) {
291
+ const {
292
+ id,
293
+ placeholder,
294
+ label,
295
+ value,
296
+ required,
297
+ readonly,
298
+ disabled,
299
+ onChange,
300
+ onBlur,
301
+ onFocus,
302
+ autofocus,
303
+ options,
304
+ schema,
305
+ uiSchema,
306
+ formContext,
307
+ type,
308
+ registry,
309
+ rawErrors = []
310
+ } = props;
311
+ const inputProps = utils.getInputProps(schema, type, options);
312
+ const semanticProps = getSemanticProps({
313
+ uiSchema,
314
+ formContext,
315
+ options
362
316
  });
363
- var horizontalButtons = semanticProps.horizontalButtons,
364
- wrapItem = semanticProps.wrapItem;
365
- var itemProps = {
366
- horizontalButtons: horizontalButtons,
367
- wrapItem: wrapItem
317
+ const {
318
+ schemaUtils
319
+ } = registry;
320
+
321
+ const _onChange = _ref => {
322
+ let {
323
+ target: {
324
+ value
325
+ }
326
+ } = _ref;
327
+ return onChange(value === "" ? options.emptyValue : value);
368
328
  };
369
329
 
370
- if (isFixedItems(schema)) {
371
- return React.createElement(DefaultFixedArrayFieldTemplate, _extends({}, props, {
372
- itemProps: itemProps
373
- }));
330
+ const _onBlur = () => onBlur && onBlur(id, value);
331
+
332
+ const _onFocus = () => onFocus && onFocus(id, value);
333
+
334
+ const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema);
335
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Input, {
336
+ key: id,
337
+ id: id,
338
+ name: id,
339
+ placeholder: placeholder,
340
+ ...inputProps,
341
+ label: displayLabel ? label || schema.title : false,
342
+ required: required,
343
+ autoFocus: autofocus,
344
+ disabled: disabled || readonly,
345
+ list: schema.examples ? "examples_" + id : undefined,
346
+ ...semanticProps,
347
+ value: value || value === 0 ? value : "",
348
+ error: rawErrors.length > 0,
349
+ onChange: _onChange,
350
+ onBlur: _onBlur,
351
+ onFocus: _onFocus
352
+ }), schema.examples && /*#__PURE__*/React__default["default"].createElement("datalist", {
353
+ id: "examples_" + id
354
+ }, schema.examples.concat(schema.default ? [schema.default] : []).map(example => {
355
+ return /*#__PURE__*/React__default["default"].createElement("option", {
356
+ key: example,
357
+ value: example
358
+ });
359
+ })));
360
+ }
361
+
362
+ function DescriptionField(_ref) {
363
+ let {
364
+ description,
365
+ id
366
+ } = _ref;
367
+
368
+ if (!description) {
369
+ return null;
374
370
  }
375
371
 
376
- return React.createElement(DefaultNormalArrayFieldTemplate, _extends({}, props, {
377
- itemProps: itemProps
378
- }));
372
+ return /*#__PURE__*/React__default["default"].createElement("p", {
373
+ id: id,
374
+ className: "sui-description"
375
+ }, description);
379
376
  }
380
377
 
381
- /* eslint-disable react/no-array-index-key */
382
- /**
383
- *
384
- * @param errors
385
- * @returns {*}
386
- * @constructor
378
+ /**
379
+ *
380
+ * @param errors
381
+ * @returns {*}
382
+ * @constructor
387
383
  */
388
384
 
389
385
  function ErrorList(_ref) {
390
- var errors = _ref.errors;
391
- return React.createElement(semanticUiReact.Message, {
386
+ let {
387
+ errors
388
+ } = _ref;
389
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Message, {
392
390
  negative: true
393
- }, React.createElement(semanticUiReact.Message.Header, null, "Errors"), React.createElement(semanticUiReact.Message.List, null, errors.map(function (error, index) {
394
- return React.createElement(semanticUiReact.Message.Item, {
395
- key: "error-" + index
396
- }, error.stack);
397
- })));
391
+ }, /*#__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, {
392
+ key: "error-" + index
393
+ }, error.stack))));
398
394
  }
399
395
 
400
- ErrorList.propTypes = {
401
- errors: PropTypes.array
402
- };
403
-
404
- /* eslint-disable react/prop-types */
405
-
406
- function DescriptionField(_ref) {
407
- var className = _ref.className,
408
- description = _ref.description;
409
-
410
- if (description) {
411
- return React.createElement("p", {
412
- className: className || "sui-description"
413
- }, description);
414
- }
396
+ function IconButton(props) {
397
+ const {
398
+ icon,
399
+ iconType,
400
+ color,
401
+ className,
402
+ uiSchema,
403
+ ...otherProps
404
+ } = props;
405
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Button, {
406
+ icon: icon,
407
+ size: iconType,
408
+ color: color,
409
+ className: className,
410
+ ...otherProps
411
+ });
415
412
  }
416
-
417
- function TitleField(_ref) {
418
- var title = _ref.title,
419
- options = _ref.options;
420
- var semantic = options.semantic;
421
-
422
- if (title) {
423
- return React.createElement(semanticUiReact.Header, _extends({}, semantic, {
424
- as: "h5"
425
- }), title);
426
- }
413
+ function MoveDownButton(props) {
414
+ return /*#__PURE__*/React__default["default"].createElement(IconButton, {
415
+ title: "Move down",
416
+ ...props,
417
+ icon: "angle down"
418
+ });
419
+ }
420
+ function MoveUpButton(props) {
421
+ return /*#__PURE__*/React__default["default"].createElement(IconButton, {
422
+ title: "Move up",
423
+ ...props,
424
+ icon: "angle up"
425
+ });
426
+ }
427
+ function RemoveButton(props) {
428
+ return /*#__PURE__*/React__default["default"].createElement(IconButton, {
429
+ title: "Remove",
430
+ ...props,
431
+ icon: "trash"
432
+ });
427
433
  }
428
434
 
429
- TitleField.defaultProps = {
435
+ const DEFAULT_OPTIONS$1 = {
430
436
  options: {
431
- semantic: {
432
- inverted: false,
433
- dividing: true
434
- }
437
+ pointing: "above",
438
+ size: "small"
435
439
  }
436
440
  };
437
- TitleField.propTypes = {
438
- options: PropTypes.object
439
- };
441
+ /**
442
+ *
443
+ * @param errors
444
+ * @param displayError
445
+ * @returns {*}
446
+ * @constructor
447
+ * @return {null}
448
+ */
440
449
 
441
- var Fields = {
442
- DescriptionField: DescriptionField,
443
- TitleField: TitleField
444
- };
450
+ function FieldErrorTemplate(_ref) {
451
+ let {
452
+ errors,
453
+ idSchema,
454
+ uiSchema,
455
+ registry
456
+ } = _ref;
457
+ const {
458
+ formContext
459
+ } = registry;
460
+ const options = getSemanticErrorProps({
461
+ formContext,
462
+ uiSchema,
463
+ defaultProps: DEFAULT_OPTIONS$1
464
+ });
465
+ const {
466
+ pointing,
467
+ size
468
+ } = options;
445
469
 
446
- /* eslint-disable react/prop-types */
447
- /**
448
- * @return {null}
470
+ if (errors && errors.length > 0) {
471
+ const id = idSchema.$id + "__error";
472
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Label, {
473
+ id: id,
474
+ color: "red",
475
+ pointing: pointing || "above",
476
+ size: size || "small",
477
+ basic: true
478
+ }, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.List, {
479
+ bulleted: true
480
+ }, errors.map(error => /*#__PURE__*/React__default["default"].createElement(semanticUiReact.List.Item, {
481
+ key: nanoid.nanoid()
482
+ }, error))));
483
+ }
484
+
485
+ return null;
486
+ }
487
+
488
+ /**
489
+ * @return {null}
449
490
  */
450
491
 
451
- function HelpField(_ref) {
452
- var helpText = _ref.helpText,
453
- id = _ref.id;
492
+ function FieldHelpTemplate(_ref) {
493
+ let {
494
+ help,
495
+ idSchema
496
+ } = _ref;
454
497
 
455
- if (helpText) {
456
- return React.createElement(semanticUiReact.Message, {
498
+ if (help) {
499
+ const id = idSchema.$id + "__help";
500
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Message, {
457
501
  size: "mini",
458
502
  info: true,
459
503
  id: id,
460
- content: helpText
504
+ content: help
461
505
  });
462
506
  }
463
507
 
464
508
  return null;
465
509
  }
466
510
 
467
- HelpField.propTypes = {
468
- helpText: PropTypes.string,
469
- id: PropTypes.string
470
- };
471
-
472
- /* eslint-disable react/no-array-index-key */
473
- /**
474
- *
475
- * @param errors
476
- * @param displayError
477
- * @returns {*}
478
- * @constructor
479
- * @return {null}
480
- */
481
-
482
- function RawErrors(_ref) {
483
- var errors = _ref.errors,
484
- options = _ref.options;
485
- var pointing = options.pointing,
486
- size = options.size;
511
+ function FieldTemplate(_ref) {
512
+ let {
513
+ id,
514
+ children,
515
+ classNames,
516
+ displayLabel,
517
+ label,
518
+ errors,
519
+ help,
520
+ hidden,
521
+ rawDescription,
522
+ registry,
523
+ uiSchema,
524
+ ...props
525
+ } = _ref;
526
+ const semanticProps = getSemanticProps(props);
527
+ const {
528
+ wrapLabel,
529
+ wrapContent
530
+ } = semanticProps;
531
+ const uiOptions = utils.getUiOptions(uiSchema);
532
+ const WrapIfAdditionalTemplate = utils.getTemplate("WrapIfAdditionalTemplate", registry, uiOptions);
533
+ const DescriptionFieldTemplate = utils.getTemplate("DescriptionFieldTemplate", registry, uiOptions);
487
534
 
488
- if (errors && errors.length > 0) {
489
- return React.createElement(semanticUiReact.Label, {
490
- color: "red",
491
- pointing: pointing || "above",
492
- size: size || "small",
493
- basic: true
494
- }, React.createElement(semanticUiReact.List, {
495
- bulleted: true
496
- }, errors.map(function (error) {
497
- return React.createElement(semanticUiReact.List.Item, {
498
- key: nanoid.nanoid(),
499
- content: error
500
- });
501
- })));
535
+ if (hidden) {
536
+ return /*#__PURE__*/React__default["default"].createElement("div", {
537
+ style: {
538
+ display: "none"
539
+ }
540
+ }, children);
502
541
  }
503
542
 
504
- return null;
543
+ return /*#__PURE__*/React__default["default"].createElement(WrapIfAdditionalTemplate, {
544
+ classNames: classNames,
545
+ id: id,
546
+ label: label,
547
+ registry: registry,
548
+ uiSchema: uiSchema,
549
+ ...props
550
+ }, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Group, {
551
+ key: id,
552
+ widths: "equal",
553
+ grouped: true
554
+ }, /*#__PURE__*/React__default["default"].createElement(MaybeWrap, {
555
+ wrap: wrapContent,
556
+ className: "sui-field-content"
557
+ }, children, displayLabel && rawDescription && /*#__PURE__*/React__default["default"].createElement(MaybeWrap, {
558
+ wrap: wrapLabel,
559
+ className: "sui-field-label"
560
+ }, rawDescription && /*#__PURE__*/React__default["default"].createElement(DescriptionFieldTemplate, {
561
+ id: id + "-description",
562
+ description: rawDescription,
563
+ registry: registry
564
+ })), help, errors)));
505
565
  }
506
566
 
507
- RawErrors.defaultProps = {
508
- options: {
509
- pointing: "above",
510
- size: "small"
567
+ function ObjectFieldTemplate(_ref) {
568
+ let {
569
+ description,
570
+ onAddClick,
571
+ title,
572
+ properties,
573
+ disabled,
574
+ readonly,
575
+ required,
576
+ uiSchema,
577
+ schema,
578
+ formData,
579
+ idSchema,
580
+ registry
581
+ } = _ref;
582
+ const uiOptions = utils.getUiOptions(uiSchema);
583
+ const TitleFieldTemplate = utils.getTemplate("TitleFieldTemplate", registry, uiOptions);
584
+ const DescriptionFieldTemplate = utils.getTemplate("DescriptionFieldTemplate", registry, uiOptions); // Button templates are not overridden in the uiSchema
585
+
586
+ const {
587
+ ButtonTemplates: {
588
+ AddButton
589
+ }
590
+ } = registry.templates;
591
+ const fieldTitle = uiOptions.title || title;
592
+ const fieldDescription = uiOptions.description || description;
593
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, fieldTitle && /*#__PURE__*/React__default["default"].createElement(TitleFieldTemplate, {
594
+ id: idSchema.$id + "-title",
595
+ title: fieldTitle,
596
+ required: required,
597
+ uiSchema: uiSchema,
598
+ registry: registry
599
+ }), fieldDescription && /*#__PURE__*/React__default["default"].createElement(DescriptionFieldTemplate, {
600
+ id: idSchema.$id + "-description",
601
+ description: fieldDescription,
602
+ registry: registry
603
+ }), properties.map(prop => prop.content), utils.canExpand(schema, uiSchema, formData) && /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, {
604
+ width: 16,
605
+ verticalAlign: "middle"
606
+ }, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Row, null, /*#__PURE__*/React__default["default"].createElement("div", {
607
+ style: {
608
+ marginTop: "1rem",
609
+ position: "relative",
610
+ textAlign: "right"
611
+ }
612
+ }, /*#__PURE__*/React__default["default"].createElement(AddButton, {
613
+ onClick: onAddClick(schema),
614
+ disabled: disabled || readonly,
615
+ uiSchema: uiSchema
616
+ })))));
617
+ }
618
+
619
+ var SubmitButton = (_ref => {
620
+ let {
621
+ uiSchema
622
+ } = _ref;
623
+ const {
624
+ submitText,
625
+ norender,
626
+ props: submitButtonProps
627
+ } = utils.getSubmitButtonOptions(uiSchema);
628
+
629
+ if (norender) {
630
+ return null;
511
631
  }
632
+
633
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Button, {
634
+ type: "submit",
635
+ primary: true,
636
+ ...submitButtonProps
637
+ }, submitText);
638
+ });
639
+
640
+ const DEFAULT_OPTIONS = {
641
+ inverted: false,
642
+ dividing: true
512
643
  };
513
- RawErrors.propTypes = {
514
- options: PropTypes.object,
515
- errors: PropTypes.array
516
- };
517
644
 
518
- var ADDITIONAL_PROPERTY_FLAG = core.utils.ADDITIONAL_PROPERTY_FLAG;
519
-
520
- var WrapIfAdditional = function WrapIfAdditional(_ref) {
521
- var children = _ref.children,
522
- classNames = _ref.classNames,
523
- disabled = _ref.disabled,
524
- formContext = _ref.formContext,
525
- id = _ref.id,
526
- label = _ref.label,
527
- onDropPropertyClick = _ref.onDropPropertyClick,
528
- onKeyChange = _ref.onKeyChange,
529
- readonly = _ref.readonly,
530
- required = _ref.required,
531
- schema = _ref.schema;
532
- var _formContext$readonly = formContext.readonlyAsDisabled,
533
- readonlyAsDisabled = _formContext$readonly === void 0 ? true : _formContext$readonly,
534
- wrapperStyle = formContext.wrapperStyle;
535
- var keyLabel = label + " Key"; // i18n ?
536
-
537
- var additional = schema.hasOwnProperty(ADDITIONAL_PROPERTY_FLAG);
645
+ function TitleField(_ref) {
646
+ let {
647
+ id,
648
+ title,
649
+ uiSchema
650
+ } = _ref;
651
+ const semanticProps = getSemanticProps({
652
+ uiSchema,
653
+ defaultSchemaProps: DEFAULT_OPTIONS
654
+ });
655
+
656
+ if (!title) {
657
+ return null;
658
+ }
659
+
660
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Header, {
661
+ id: id,
662
+ ...semanticProps,
663
+ as: "h5"
664
+ }, title);
665
+ }
666
+
667
+ const WrapIfAdditionalTemplate = _ref => {
668
+ let {
669
+ children,
670
+ classNames,
671
+ disabled,
672
+ id,
673
+ label,
674
+ onDropPropertyClick,
675
+ onKeyChange,
676
+ readonly,
677
+ required,
678
+ schema,
679
+ uiSchema,
680
+ registry
681
+ } = _ref;
682
+ // Button templates are not overridden in the uiSchema
683
+ const {
684
+ RemoveButton
685
+ } = registry.templates.ButtonTemplates;
686
+ const {
687
+ readonlyAsDisabled = true,
688
+ wrapperStyle
689
+ } = registry.formContext;
690
+ const keyLabel = label + " Key"; // i18n ?
691
+
692
+ const additional = (utils.ADDITIONAL_PROPERTY_FLAG in schema);
538
693
 
539
694
  if (!additional) {
540
- return React.createElement(React.Fragment, null, children);
695
+ return /*#__PURE__*/React__default["default"].createElement("div", {
696
+ className: classNames
697
+ }, children);
541
698
  }
542
699
 
543
- var handleBlur = function handleBlur(_ref2) {
544
- var target = _ref2.target;
700
+ const handleBlur = _ref2 => {
701
+ let {
702
+ target
703
+ } = _ref2;
545
704
  return onKeyChange(target.value);
546
705
  };
547
706
 
548
- return React.createElement("div", {
707
+ return /*#__PURE__*/React__default["default"].createElement("div", {
549
708
  className: classNames,
550
709
  key: id + "-key"
551
- }, React.createElement(semanticUiReact.Grid, {
710
+ }, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid, {
552
711
  columns: "equal"
553
- }, React.createElement(semanticUiReact.Grid.Row, null, React.createElement(semanticUiReact.Grid.Column, {
712
+ }, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Row, null, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, {
554
713
  className: "form-additional"
555
- }, React.createElement(semanticUiReact.Form.Group, {
714
+ }, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Group, {
556
715
  widths: "equal",
557
716
  grouped: true
558
- }, React.createElement(semanticUiReact.Form.Input, {
717
+ }, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Input, {
559
718
  className: "form-group",
560
719
  hasFeedback: true,
561
720
  fluid: true,
@@ -569,518 +728,367 @@ var WrapIfAdditional = function WrapIfAdditional(_ref) {
569
728
  onBlur: !readonly ? handleBlur : undefined,
570
729
  style: wrapperStyle,
571
730
  type: "text"
572
- }))), React.createElement(semanticUiReact.Grid.Column, {
731
+ }))), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, {
573
732
  className: "form-additional",
574
733
  verticalAlign: "middle"
575
- }, children), React.createElement(semanticUiReact.Grid.Column, null, React.createElement(semanticUiReact.Button, {
576
- size: "mini",
577
- icon: "trash",
734
+ }, children), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Grid.Column, null, /*#__PURE__*/React__default["default"].createElement(RemoveButton, {
735
+ iconType: "mini",
578
736
  className: "array-item-remove",
579
- tabIndex: "-1",
580
737
  disabled: disabled || readonly,
581
- onClick: onDropPropertyClick(label)
738
+ onClick: onDropPropertyClick(label),
739
+ uiSchema: uiSchema
582
740
  })))));
583
741
  };
584
742
 
585
- function FieldTemplate(_ref) {
586
- var id = _ref.id,
587
- children = _ref.children,
588
- classNames = _ref.classNames,
589
- displayLabel = _ref.displayLabel,
590
- label = _ref.label,
591
- _ref$rawErrors = _ref.rawErrors,
592
- rawErrors = _ref$rawErrors === void 0 ? [] : _ref$rawErrors,
593
- rawHelp = _ref.rawHelp,
594
- hidden = _ref.hidden,
595
- rawDescription = _ref.rawDescription,
596
- props = _objectWithoutPropertiesLoose(_ref, ["id", "children", "className", "classNames", "displayLabel", "label", "rawErrors", "rawHelp", "hidden", "rawDescription"]);
597
-
598
- var semanticProps = getSemanticProps(props);
599
- var wrapLabel = semanticProps.wrapLabel,
600
- wrapContent = semanticProps.wrapContent;
601
- var errorOptions = getSemanticErrorProps(props);
602
-
603
- if (hidden) {
604
- return children;
605
- }
606
-
607
- return React.createElement(WrapIfAdditional, _extends({
608
- classNames: classNames,
609
- id: id,
610
- label: label
611
- }, props), React.createElement(semanticUiReact.Form.Group, {
612
- key: id,
613
- widths: "equal",
614
- grouped: true
615
- }, React.createElement(MaybeWrap, {
616
- wrap: wrapContent,
617
- className: "sui-field-content"
618
- }, children, displayLabel && rawDescription && React.createElement(MaybeWrap, {
619
- wrap: wrapLabel,
620
- className: "sui-field-label"
621
- }, rawDescription && React.createElement(DescriptionField, {
622
- description: rawDescription
623
- })), React.createElement(HelpField, {
624
- helpText: rawHelp,
625
- id: id + "__help"
626
- }), React.createElement(RawErrors, {
627
- errors: rawErrors,
628
- options: errorOptions
629
- }))));
630
- }
631
-
632
- /* eslint-disable react/prop-types */
633
- var canExpand = core.utils.canExpand;
634
-
635
- function ObjectFieldTemplate(_ref) {
636
- var DescriptionField = _ref.DescriptionField,
637
- description = _ref.description,
638
- TitleField = _ref.TitleField,
639
- onAddClick = _ref.onAddClick,
640
- title = _ref.title,
641
- properties = _ref.properties,
642
- disabled = _ref.disabled,
643
- readOnly = _ref.readOnly,
644
- required = _ref.required,
645
- uiSchema = _ref.uiSchema,
646
- schema = _ref.schema,
647
- formData = _ref.formData,
648
- idSchema = _ref.idSchema;
649
- var fieldTitle = uiSchema["ui:title"] || title;
650
- var fieldDescription = uiSchema["ui:description"] || description;
651
- return React.createElement(React.Fragment, null, fieldTitle && React.createElement(TitleField, {
652
- id: idSchema.$id + "-title",
653
- title: fieldTitle,
654
- options: uiSchema["ui:options"],
655
- required: required
656
- }), fieldDescription && React.createElement(DescriptionField, {
657
- id: idSchema.$id + "-description",
658
- description: fieldDescription
659
- }), properties.map(function (prop) {
660
- return prop.content;
661
- }), canExpand(schema, uiSchema, formData) && React.createElement(semanticUiReact.Grid.Column, {
662
- width: 16,
663
- verticalAlign: "middle"
664
- }, React.createElement(semanticUiReact.Grid.Row, null, React.createElement("div", {
665
- style: {
666
- marginTop: "1rem",
667
- position: "relative",
668
- textAlign: "right"
669
- }
670
- }, React.createElement(AddButton, {
671
- onClick: onAddClick(schema),
672
- disabled: disabled || readOnly
673
- })))));
674
- }
675
-
676
- var getDisplayLabel = core.utils.getDisplayLabel;
743
+ const Templates = {
744
+ ArrayFieldItemTemplate,
745
+ ArrayFieldTemplate,
746
+ BaseInputTemplate,
747
+ ButtonTemplates: {
748
+ AddButton,
749
+ MoveDownButton,
750
+ MoveUpButton,
751
+ RemoveButton,
752
+ SubmitButton
753
+ },
754
+ DescriptionFieldTemplate: DescriptionField,
755
+ ErrorListTemplate: ErrorList,
756
+ FieldErrorTemplate,
757
+ FieldHelpTemplate,
758
+ FieldTemplate,
759
+ ObjectFieldTemplate,
760
+ TitleFieldTemplate: TitleField,
761
+ WrapIfAdditionalTemplate
762
+ };
677
763
 
678
764
  function CheckboxWidget(props) {
679
- var id = props.id,
680
- value = props.value,
681
- required = props.required,
682
- disabled = props.disabled,
683
- readonly = props.readonly,
684
- label = props.label,
685
- autofocus = props.autofocus,
686
- onChange = props.onChange,
687
- onBlur = props.onBlur,
688
- options = props.options,
689
- onFocus = props.onFocus,
690
- formContext = props.formContext,
691
- schema = props.schema,
692
- uiSchema = props.uiSchema;
693
- var semanticProps = getSemanticProps({
694
- options: options,
695
- formContext: formContext,
696
- schema: schema,
697
- uiSchema: uiSchema,
765
+ const {
766
+ id,
767
+ value,
768
+ required,
769
+ disabled,
770
+ readonly,
771
+ label,
772
+ autofocus,
773
+ onChange,
774
+ onBlur,
775
+ options,
776
+ onFocus,
777
+ formContext,
778
+ schema,
779
+ uiSchema,
780
+ registry,
781
+ rawErrors = []
782
+ } = props;
783
+ const semanticProps = getSemanticProps({
784
+ options,
785
+ formContext,
786
+ uiSchema,
698
787
  defaultSchemaProps: {
699
788
  inverted: false
700
789
  }
701
790
  });
702
- var displayLabel = getDisplayLabel(schema, uiSchema
703
- /* TODO: , rootSchema */
704
- );
791
+ const {
792
+ schemaUtils
793
+ } = registry;
794
+ const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema);
705
795
 
706
- var _onChange = function _onChange(event, data) {
707
- return onChange && onChange(data.checked);
708
- };
796
+ const _onChange = (_, data) => onChange && onChange(data.checked);
709
797
 
710
- var _onBlur = function _onBlur() {
711
- return onBlur && onBlur(id, value);
712
- };
798
+ const _onBlur = () => onBlur && onBlur(id, value);
713
799
 
714
- var _onFocus = function _onFocus() {
715
- return onFocus && onFocus(id, value);
716
- };
800
+ const _onFocus = () => onFocus && onFocus(id, value);
717
801
 
718
- var checked = value == "true" || value == true;
719
- return React.createElement(semanticUiReact.Form.Checkbox, _extends({
802
+ const checked = value == "true" || value == true;
803
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Checkbox, {
720
804
  id: id,
805
+ name: id,
721
806
  disabled: disabled || readonly,
722
- autoFocus: autofocus
723
- }, semanticProps, {
807
+ autoFocus: autofocus,
808
+ ...semanticProps,
724
809
  checked: typeof value === "undefined" ? false : checked,
810
+ error: rawErrors.length > 0,
725
811
  onChange: _onChange,
726
812
  onBlur: _onBlur,
727
813
  onFocus: _onFocus,
728
814
  required: required,
729
815
  label: displayLabel ? label || schema.title : false
730
- }));
816
+ });
731
817
  }
732
818
 
733
819
  function selectValue(value, selected, all) {
734
- var at = all.indexOf(value);
735
- var updated = selected.slice(0, at).concat(value, selected.slice(at)); // As inserting values at predefined index positions doesn't work with empty
820
+ const at = all.indexOf(value);
821
+ const updated = selected.slice(0, at).concat(value, selected.slice(at)); // As inserting values at predefined index positions doesn't work with empty
736
822
  // arrays, we need to reorder the updated selection to match the initial order
737
823
 
738
- return updated.sort(function (a, b) {
739
- return all.indexOf(a) > all.indexOf(b);
740
- });
824
+ return updated.sort((a, b) => all.indexOf(a) > all.indexOf(b));
741
825
  }
742
826
 
743
827
  function deselectValue(value, selected) {
744
- return selected.filter(function (v) {
745
- return v !== value;
746
- });
828
+ return selected.filter(v => v !== value);
747
829
  }
748
830
 
749
831
  function CheckboxesWidget(props) {
750
- var id = props.id,
751
- disabled = props.disabled,
752
- options = props.options,
753
- value = props.value,
754
- autofocus = props.autofocus,
755
- readonly = props.readonly,
756
- onChange = props.onChange,
757
- onBlur = props.onBlur,
758
- onFocus = props.onFocus,
759
- formContext = props.formContext,
760
- schema = props.schema,
761
- uiSchema = props.uiSchema;
762
- var enumOptions = options.enumOptions,
763
- enumDisabled = options.enumDisabled,
764
- inline = options.inline;
765
- var title = schema.title;
766
- var semanticProps = getSemanticProps({
767
- options: options,
768
- formContext: formContext,
769
- schema: schema,
770
- uiSchema: uiSchema,
832
+ const {
833
+ id,
834
+ disabled,
835
+ options,
836
+ value,
837
+ autofocus,
838
+ readonly,
839
+ onChange,
840
+ onBlur,
841
+ onFocus,
842
+ formContext,
843
+ schema,
844
+ uiSchema,
845
+ rawErrors = [],
846
+ registry
847
+ } = props;
848
+ const TitleFieldTemplate = utils.getTemplate("TitleFieldTemplate", registry, options);
849
+ const {
850
+ enumOptions,
851
+ enumDisabled,
852
+ inline
853
+ } = options;
854
+ const {
855
+ title
856
+ } = schema;
857
+ const semanticProps = getSemanticProps({
858
+ options,
859
+ formContext,
860
+ uiSchema,
771
861
  defaultSchemaProps: {
772
862
  inverted: false
773
863
  }
774
864
  });
775
865
 
776
- var _onChange = function _onChange(option) {
777
- return function (_ref) {
778
- var checked = _ref.target.checked;
779
- // eslint-disable-next-line no-shadow
780
- var all = enumOptions.map(function (_ref2) {
781
- var value = _ref2.value;
782
- return value;
783
- });
784
-
785
- if (checked) {
786
- onChange(selectValue(option.value, value, all));
787
- } else {
788
- onChange(deselectValue(option.value, value));
866
+ const _onChange = option => _ref => {
867
+ let {
868
+ target: {
869
+ checked
789
870
  }
790
- };
871
+ } = _ref;
872
+ // eslint-disable-next-line no-shadow
873
+ const all = enumOptions ? enumOptions.map(_ref2 => {
874
+ let {
875
+ value
876
+ } = _ref2;
877
+ return value;
878
+ }) : [];
879
+
880
+ if (checked) {
881
+ onChange(selectValue(option.value, value, all));
882
+ } else {
883
+ onChange(deselectValue(option.value, value));
884
+ }
791
885
  };
792
886
 
793
- var _onBlur = function _onBlur() {
794
- return onBlur && onBlur(id, value);
795
- };
887
+ const _onBlur = () => onBlur && onBlur(id, value);
796
888
 
797
- var _onFocus = function _onFocus() {
798
- return onFocus && onFocus(id, value);
799
- };
889
+ const _onFocus = () => onFocus && onFocus(id, value);
800
890
 
801
- var inlineOption = inline ? {
891
+ const inlineOption = inline ? {
802
892
  inline: true
803
893
  } : {
804
894
  grouped: true
805
895
  };
806
- return React.createElement(React.Fragment, null, title && React.createElement(TitleField, {
807
- title: title
808
- }), React.createElement(semanticUiReact.Form.Group, inlineOption, enumOptions.map(function (option, index) {
809
- var checked = value.indexOf(option.value) !== -1;
810
- var itemDisabled = enumDisabled && enumDisabled.indexOf(option.value) !== -1;
811
- return React.createElement(semanticUiReact.Form.Checkbox, _extends({
812
- id: id + "_" + index,
813
- key: id + "_" + index,
814
- label: option.label
815
- }, semanticProps, {
896
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, title && /*#__PURE__*/React__default["default"].createElement(TitleFieldTemplate, {
897
+ id: id + "-title",
898
+ title: title,
899
+ uiSchema: uiSchema,
900
+ registry: registry
901
+ }), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Group, {
902
+ id: id,
903
+ name: id,
904
+ ...inlineOption
905
+ }, Array.isArray(enumOptions) && enumOptions.map((option, index) => {
906
+ const checked = value.indexOf(option.value) !== -1;
907
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
908
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Checkbox, {
909
+ id: id + "-" + option.value,
910
+ name: id,
911
+ key: option.value,
912
+ label: option.label,
913
+ ...semanticProps,
816
914
  checked: checked,
915
+ error: rawErrors.length > 0,
817
916
  disabled: disabled || itemDisabled || readonly,
818
917
  autoFocus: autofocus && index === 0,
819
918
  onChange: _onChange(option),
820
919
  onBlur: _onBlur,
821
920
  onFocus: _onFocus
822
- }));
921
+ });
823
922
  })));
824
923
  }
825
924
 
826
- var getDisplayLabel$1 = core.utils.getDisplayLabel;
827
-
828
- function PasswordWidget(props) {
829
- var id = props.id,
830
- required = props.required,
831
- readonly = props.readonly,
832
- disabled = props.disabled,
833
- label = props.label,
834
- name = props.name,
835
- value = props.value,
836
- onChange = props.onChange,
837
- onBlur = props.onBlur,
838
- onFocus = props.onFocus,
839
- autofocus = props.autofocus,
840
- options = props.options,
841
- schema = props.schema,
842
- uiSchema = props.uiSchema,
843
- formContext = props.formContext;
844
- var semanticProps = getSemanticProps({
845
- schema: schema,
846
- uiSchema: uiSchema,
847
- formContext: formContext,
848
- options: options
849
- }); // eslint-disable-next-line no-shadow
850
-
851
- var _onChange = function _onChange(_ref) {
852
- var value = _ref.target.value;
853
- return onChange && onChange(value === "" ? options.emptyValue : value);
854
- };
855
-
856
- var _onBlur = function _onBlur() {
857
- return onBlur && onBlur(id, value);
858
- };
859
-
860
- var _onFocus = function _onFocus() {
861
- return onFocus && onFocus(id, value);
862
- };
863
-
864
- var displayLabel = getDisplayLabel$1(schema, uiSchema
865
- /* TODO: , rootSchema */
866
- );
867
- return React.createElement(semanticUiReact.Form.Input, _extends({
868
- id: id,
869
- key: id,
870
- label: displayLabel ? label || schema.title : false,
871
- autoFocus: autofocus,
872
- required: required,
873
- disabled: disabled || readonly,
874
- name: name
875
- }, semanticProps, {
876
- type: "password",
877
- value: value || "",
878
- onChange: _onChange,
879
- onBlur: _onBlur,
880
- onFocus: _onFocus
881
- }));
882
- }
883
-
884
925
  function RadioWidget(props) {
885
- var id = props.id,
886
- value = props.value,
887
- required = props.required,
888
- disabled = props.disabled,
889
- readonly = props.readonly,
890
- onChange = props.onChange,
891
- onBlur = props.onBlur,
892
- onFocus = props.onFocus,
893
- schema = props.schema,
894
- options = props.options,
895
- formContext = props.formContext,
896
- uiSchema = props.uiSchema; // Generating a unique field name to identify this set of radio buttons
897
-
898
- var name = Math.random().toString();
899
- var enumOptions = options.enumOptions,
900
- enumDisabled = options.enumDisabled;
901
- var semanticProps = getSemanticProps({
902
- formContext: formContext,
903
- options: options,
904
- uiSchema: uiSchema
926
+ const {
927
+ id,
928
+ value,
929
+ required,
930
+ disabled,
931
+ readonly,
932
+ onChange,
933
+ onBlur,
934
+ onFocus,
935
+ schema,
936
+ options,
937
+ formContext,
938
+ uiSchema,
939
+ rawErrors = []
940
+ } = props;
941
+ const {
942
+ enumOptions,
943
+ enumDisabled
944
+ } = options;
945
+ const semanticProps = getSemanticProps({
946
+ formContext,
947
+ options,
948
+ uiSchema
905
949
  }); // eslint-disable-next-line no-shadow
906
950
 
907
- var _onChange = function _onChange(event, _ref) {
908
- var eventValue = _ref.value;
951
+ const _onChange = (_, _ref) => {
952
+ let {
953
+ value: eventValue
954
+ } = _ref;
909
955
  return onChange && onChange(schema.type === "boolean" ? eventValue !== "false" : eventValue);
910
956
  };
911
957
 
912
- var _onBlur = function _onBlur() {
913
- return onBlur && onBlur(id, value);
914
- };
958
+ const _onBlur = () => onBlur && onBlur(id, value);
915
959
 
916
- var _onFocus = function _onFocus() {
917
- return onFocus && onFocus(id, value);
918
- };
960
+ const _onFocus = () => onFocus && onFocus(id, value);
919
961
 
920
- var inlineOption = options.inline ? {
962
+ const inlineOption = options.inline ? {
921
963
  inline: true
922
964
  } : {
923
965
  grouped: true
924
966
  };
925
- return React.createElement(semanticUiReact.Form.Group, inlineOption, enumOptions.map(function (option, i) {
926
- var itemDisabled = enumDisabled && enumDisabled.indexOf(option.value) !== -1;
927
- return React.createElement(semanticUiReact.Form.Field, _extends({
967
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Group, { ...inlineOption
968
+ }, Array.isArray(enumOptions) && enumOptions.map(option => {
969
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
970
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Field, {
928
971
  required: required,
929
972
  control: semanticUiReact.Radio,
930
- name: name
931
- }, semanticProps, {
973
+ id: id + "-" + option.value,
974
+ name: id,
975
+ ...semanticProps,
932
976
  onFocus: _onFocus,
933
977
  onBlur: _onBlur,
934
978
  label: "" + option.label,
935
979
  value: "" + option.value,
936
- key: option.value + "-" + i,
980
+ error: rawErrors.length > 0,
981
+ key: option.value,
937
982
  checked: value == option.value,
938
983
  onChange: _onChange,
939
984
  disabled: disabled || itemDisabled || readonly
940
- }));
985
+ });
941
986
  }));
942
987
  }
943
988
 
944
- var rangeSpec = core.utils.rangeSpec;
945
-
946
989
  function RangeWidget(props) {
947
- var id = props.id,
948
- name = props.name,
949
- value = props.value,
950
- required = props.required,
951
- readonly = props.readonly,
952
- disabled = props.disabled,
953
- onChange = props.onChange,
954
- onBlur = props.onBlur,
955
- onFocus = props.onFocus,
956
- options = props.options,
957
- schema = props.schema,
958
- uiSchema = props.uiSchema,
959
- formContext = props.formContext;
960
- var semanticProps = getSemanticProps({
961
- formContext: formContext,
962
- options: options,
963
- uiSchema: uiSchema,
990
+ const {
991
+ id,
992
+ value,
993
+ required,
994
+ readonly,
995
+ disabled,
996
+ onChange,
997
+ onBlur,
998
+ onFocus,
999
+ options,
1000
+ schema,
1001
+ uiSchema,
1002
+ formContext,
1003
+ rawErrors = []
1004
+ } = props;
1005
+ const semanticProps = getSemanticProps({
1006
+ formContext,
1007
+ options,
1008
+ uiSchema,
964
1009
  defaultSchemaProps: {
965
1010
  fluid: true
966
1011
  }
967
1012
  }); // eslint-disable-next-line no-shadow
968
1013
 
969
- var _onChange = function _onChange(_ref) {
970
- var value = _ref.target.value;
1014
+ const _onChange = _ref => {
1015
+ let {
1016
+ target: {
1017
+ value
1018
+ }
1019
+ } = _ref;
971
1020
  return onChange && onChange(value === "" ? options.emptyValue : value);
972
1021
  };
973
1022
 
974
- var _onBlur = function _onBlur() {
975
- return onBlur && onBlur(id, value);
976
- };
1023
+ const _onBlur = () => onBlur && onBlur(id, value);
977
1024
 
978
- var _onFocus = function _onFocus() {
979
- return onFocus && onFocus(id, value);
980
- };
1025
+ const _onFocus = () => onFocus && onFocus(id, value);
981
1026
 
982
- return React.createElement(React.Fragment, null, React.createElement(semanticUiReact.Input, _extends({
1027
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Input, {
983
1028
  id: id,
984
1029
  key: id,
985
- name: name,
1030
+ name: id,
986
1031
  type: "range",
987
1032
  required: required,
988
- disabled: disabled || readonly
989
- }, rangeSpec(schema), semanticProps, {
1033
+ disabled: disabled || readonly,
1034
+ ...utils.rangeSpec(schema),
1035
+ ...semanticProps,
990
1036
  value: value || "",
1037
+ error: rawErrors.length > 0,
991
1038
  onChange: _onChange,
992
1039
  onBlur: _onBlur,
993
1040
  onFocus: _onFocus
994
- })), React.createElement("span", null, value));
1041
+ }), /*#__PURE__*/React__default["default"].createElement("span", null, value));
995
1042
  }
996
1043
 
997
- var asNumber = core.utils.asNumber,
998
- guessType = core.utils.guessType;
999
- var nums = /*#__PURE__*/new Set(["number", "integer"]);
1000
- /**
1001
- * * Returns and creates an array format required for semantic drop down
1002
- * @param {array} enumOptions- array of items for the dropdown
1003
- * @param {array} enumDisabled - array of enum option values to disable
1004
- * @returns {*}
1044
+ /**
1045
+ * * Returns and creates an array format required for semantic drop down
1046
+ * @param {array} enumOptions- array of items for the dropdown
1047
+ * @param {array} enumDisabled - array of enum option values to disable
1048
+ * @returns {*}
1005
1049
  */
1006
1050
 
1007
1051
  function createDefaultValueOptionsForDropDown(enumOptions, enumDisabled) {
1008
- var disabledOptions = enumDisabled || [];
1009
- var options = []; // eslint-disable-next-line no-shadow
1010
-
1011
- options = _.map(enumOptions, function (_ref) {
1012
- var label = _ref.label,
1013
- value = _ref.value;
1052
+ const disabledOptions = enumDisabled || [];
1053
+ const options = map__default["default"](enumOptions, _ref => {
1054
+ let {
1055
+ label,
1056
+ value
1057
+ } = _ref;
1014
1058
  return {
1015
1059
  disabled: disabledOptions.indexOf(value) !== -1,
1016
1060
  key: label,
1017
1061
  text: label,
1018
- value: value
1062
+ value
1019
1063
  };
1020
1064
  });
1021
1065
  return options;
1022
1066
  }
1023
- /**
1024
- * This is a silly limitation in the DOM where option change event values are
1025
- * always retrieved as strings.
1026
- */
1027
-
1028
-
1029
- var processValue = function processValue(schema, value) {
1030
- // "enum" is a reserved word, so only "type" and "items" can be destructured
1031
- var type = schema.type,
1032
- items = schema.items;
1033
-
1034
- if (value === "") {
1035
- return undefined;
1036
- } else if (type === "array" && items && nums.has(items.type)) {
1037
- return value.map(asNumber);
1038
- } else if (type === "boolean") {
1039
- return value === "true" || value === true;
1040
- } else if (type === "number") {
1041
- return asNumber(value);
1042
- } // If type is undefined, but an enum is present, try and infer the type from
1043
- // the enum values
1044
-
1045
-
1046
- if (schema.enum) {
1047
- if (schema.enum.every(function (x) {
1048
- return guessType(x) === "number";
1049
- })) {
1050
- return asNumber(value);
1051
- } else if (schema.enum.every(function (x) {
1052
- return guessType(x) === "boolean";
1053
- })) {
1054
- return value === "true";
1055
- }
1056
- }
1057
-
1058
- return value;
1059
- };
1060
1067
 
1061
1068
  function SelectWidget(props) {
1062
- var schema = props.schema,
1063
- uiSchema = props.uiSchema,
1064
- formContext = props.formContext,
1065
- id = props.id,
1066
- options = props.options,
1067
- name = props.name,
1068
- label = props.label,
1069
- required = props.required,
1070
- disabled = props.disabled,
1071
- readonly = props.readonly,
1072
- value = props.value,
1073
- multiple = props.multiple,
1074
- placeholder = props.placeholder,
1075
- autofocus = props.autofocus,
1076
- onChange = props.onChange,
1077
- onBlur = props.onBlur,
1078
- onFocus = props.onFocus;
1079
- var semanticProps = getSemanticProps({
1080
- schema: schema,
1081
- uiSchema: uiSchema,
1082
- formContext: formContext,
1083
- options: options,
1069
+ const {
1070
+ schema,
1071
+ uiSchema,
1072
+ formContext,
1073
+ id,
1074
+ options,
1075
+ label,
1076
+ required,
1077
+ disabled,
1078
+ readonly,
1079
+ value,
1080
+ multiple,
1081
+ placeholder,
1082
+ autofocus,
1083
+ onChange,
1084
+ onBlur,
1085
+ onFocus,
1086
+ rawErrors = []
1087
+ } = props;
1088
+ const semanticProps = getSemanticProps({
1089
+ uiSchema,
1090
+ formContext,
1091
+ options,
1084
1092
  defaultSchemaProps: {
1085
1093
  inverted: "false",
1086
1094
  selection: true,
@@ -1089,37 +1097,51 @@ function SelectWidget(props) {
1089
1097
  upward: false
1090
1098
  }
1091
1099
  });
1092
- var enumDisabled = options.enumDisabled,
1093
- enumOptions = options.enumOptions;
1094
- var emptyValue = multiple ? [] : "";
1095
- var dropdownOptions = createDefaultValueOptionsForDropDown(enumOptions, enumDisabled);
1096
-
1097
- var _onChange = function _onChange(event, // eslint-disable-next-line no-shadow
1098
- _ref2) {
1099
- var value = _ref2.value;
1100
- return onChange && onChange(processValue(schema, value));
1100
+ const {
1101
+ enumDisabled,
1102
+ enumOptions
1103
+ } = options;
1104
+ const emptyValue = multiple ? [] : "";
1105
+ const dropdownOptions = createDefaultValueOptionsForDropDown(enumOptions, enumDisabled);
1106
+
1107
+ const _onChange = (_, _ref2) => {
1108
+ let {
1109
+ value
1110
+ } = _ref2;
1111
+ return onChange && onChange(utils.processSelectValue(schema, value, options));
1101
1112
  }; // eslint-disable-next-line no-shadow
1102
1113
 
1103
1114
 
1104
- var _onBlur = function _onBlur(_ref3) {
1105
- var value = _ref3.target.value;
1106
- return onBlur && onBlur(id, processValue(schema, value));
1115
+ const _onBlur = (_, _ref3) => {
1116
+ let {
1117
+ target: {
1118
+ value
1119
+ }
1120
+ } = _ref3;
1121
+ return onBlur && onBlur(id, utils.processSelectValue(schema, value, options));
1107
1122
  };
1108
1123
 
1109
- var _onFocus = function _onFocus(_ref4) {
1110
- var value = _ref4.target.value;
1111
- return onFocus && onFocus(id, processValue(schema, value));
1124
+ const _onFocus = (_, _ref4) => {
1125
+ let {
1126
+ // eslint-disable-next-line no-shadow
1127
+ target: {
1128
+ value
1129
+ }
1130
+ } = _ref4;
1131
+ return onFocus && onFocus(id, utils.processSelectValue(schema, value, options));
1112
1132
  };
1113
1133
 
1114
- return React.createElement(semanticUiReact.Form.Dropdown, _extends({
1134
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.Dropdown, {
1115
1135
  key: id,
1116
- name: name,
1136
+ id: id,
1137
+ name: id,
1117
1138
  label: label || schema.title,
1118
1139
  multiple: typeof multiple === "undefined" ? false : multiple,
1119
1140
  value: typeof value === "undefined" ? emptyValue : value,
1141
+ error: rawErrors.length > 0,
1120
1142
  disabled: disabled,
1121
- placeholder: placeholder
1122
- }, semanticProps, {
1143
+ placeholder: placeholder,
1144
+ ...semanticProps,
1123
1145
  required: required,
1124
1146
  autoFocus: autofocus,
1125
1147
  readOnly: readonly,
@@ -1127,480 +1149,93 @@ function SelectWidget(props) {
1127
1149
  onChange: _onChange,
1128
1150
  onBlur: _onBlur,
1129
1151
  onFocus: _onFocus
1130
- }));
1152
+ });
1131
1153
  }
1132
1154
 
1133
- var getDisplayLabel$2 = core.utils.getDisplayLabel;
1134
-
1135
1155
  function TextareaWidget(props) {
1136
- var id = props.id,
1137
- placeholder = props.placeholder,
1138
- value = props.value,
1139
- required = props.required,
1140
- disabled = props.disabled,
1141
- autofocus = props.autofocus,
1142
- label = props.label,
1143
- name = props.name,
1144
- readonly = props.readonly,
1145
- onBlur = props.onBlur,
1146
- onFocus = props.onFocus,
1147
- onChange = props.onChange,
1148
- options = props.options,
1149
- schema = props.schema,
1150
- uiSchema = props.uiSchema,
1151
- formContext = props.formContext;
1152
- var semanticProps = getSemanticProps({
1153
- formContext: formContext,
1154
- options: options,
1156
+ const {
1157
+ id,
1158
+ placeholder,
1159
+ value,
1160
+ required,
1161
+ disabled,
1162
+ autofocus,
1163
+ label,
1164
+ readonly,
1165
+ onBlur,
1166
+ onFocus,
1167
+ onChange,
1168
+ options,
1169
+ schema,
1170
+ uiSchema,
1171
+ formContext,
1172
+ registry,
1173
+ rawErrors = []
1174
+ } = props;
1175
+ const semanticProps = getSemanticProps({
1176
+ formContext,
1177
+ options,
1155
1178
  defaultSchemaProps: {
1156
1179
  inverted: false
1157
1180
  }
1158
- }); // eslint-disable-next-line no-shadow
1159
-
1160
- var _onChange = function _onChange(_ref) {
1161
- var value = _ref.target.value;
1181
+ });
1182
+ const {
1183
+ schemaUtils
1184
+ } = registry; // eslint-disable-next-line no-shadow
1185
+
1186
+ const _onChange = _ref => {
1187
+ let {
1188
+ target: {
1189
+ value
1190
+ }
1191
+ } = _ref;
1162
1192
  return onChange && onChange(value === "" ? options.emptyValue : value);
1163
1193
  };
1164
1194
 
1165
- var _onBlur = function _onBlur() {
1166
- return onBlur && onBlur(id, value);
1167
- };
1195
+ const _onBlur = () => onBlur && onBlur(id, value);
1168
1196
 
1169
- var _onFocus = function _onFocus() {
1170
- return onFocus && onFocus(id, value);
1171
- };
1197
+ const _onFocus = () => onFocus && onFocus(id, value);
1172
1198
 
1173
- var displayLabel = getDisplayLabel$2(schema, uiSchema
1174
- /* TODO: , rootSchema */
1175
- );
1176
- return React.createElement(semanticUiReact.Form.TextArea, _extends({
1199
+ const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema);
1200
+ return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Form.TextArea, {
1177
1201
  id: id,
1178
1202
  key: id,
1203
+ name: id,
1179
1204
  label: displayLabel ? label || schema.title : false,
1180
1205
  placeholder: placeholder,
1181
1206
  autoFocus: autofocus,
1182
1207
  required: required,
1183
1208
  disabled: disabled || readonly,
1184
- name: name
1185
- }, semanticProps, {
1209
+ ...semanticProps,
1186
1210
  value: value || "",
1211
+ error: rawErrors.length > 0,
1187
1212
  rows: options.rows || 5,
1188
1213
  onChange: _onChange,
1189
1214
  onBlur: _onBlur,
1190
1215
  onFocus: _onFocus
1191
- }));
1192
- }
1193
-
1194
- var getDisplayLabel$3 = core.utils.getDisplayLabel;
1195
-
1196
- function TextWidget(props) {
1197
- var id = props.id,
1198
- placeholder = props.placeholder,
1199
- name = props.name,
1200
- label = props.label,
1201
- value = props.value,
1202
- required = props.required,
1203
- readonly = props.readonly,
1204
- disabled = props.disabled,
1205
- onChange = props.onChange,
1206
- onBlur = props.onBlur,
1207
- onFocus = props.onFocus,
1208
- autofocus = props.autofocus,
1209
- options = props.options,
1210
- schema = props.schema,
1211
- uiSchema = props.uiSchema,
1212
- formContext = props.formContext;
1213
- var semanticProps = getSemanticProps({
1214
- formContext: formContext,
1215
- options: options,
1216
- uiSchema: uiSchema
1217
- }); // eslint-disable-next-line no-shadow
1218
-
1219
- var _onChange = function _onChange(_ref) {
1220
- var value = _ref.target.value;
1221
- return onChange(value === "" ? options.emptyValue : value);
1222
- };
1223
-
1224
- var _onBlur = function _onBlur() {
1225
- return onBlur && onBlur(id, value);
1226
- };
1227
-
1228
- var _onFocus = function _onFocus() {
1229
- return onFocus && onFocus(id, value);
1230
- };
1231
-
1232
- var displayLabel = getDisplayLabel$3(schema, uiSchema
1233
- /* TODO: , rootSchema */
1234
- );
1235
- return React.createElement(semanticUiReact.Form.Input, _extends({
1236
- key: id,
1237
- id: id,
1238
- placeholder: placeholder,
1239
- type: schema.type === 'string' ? 'text' : "" + schema.type,
1240
- label: displayLabel ? label || schema.title : false,
1241
- required: required,
1242
- autoFocus: autofocus,
1243
- disabled: disabled || readonly,
1244
- name: name
1245
- }, semanticProps, {
1246
- value: value || value === 0 ? value : "",
1247
- onChange: _onChange,
1248
- onBlur: _onBlur,
1249
- onFocus: _onFocus
1250
- }));
1251
- }
1252
-
1253
- var getDisplayLabel$4 = core.utils.getDisplayLabel;
1254
-
1255
- function UpDownWidget(props) {
1256
- var id = props.id,
1257
- name = props.name,
1258
- label = props.label,
1259
- value = props.value,
1260
- required = props.required,
1261
- readonly = props.readonly,
1262
- disabled = props.disabled,
1263
- onChange = props.onChange,
1264
- onBlur = props.onBlur,
1265
- onFocus = props.onFocus,
1266
- autofocus = props.autofocus,
1267
- options = props.options,
1268
- schema = props.schema,
1269
- uiSchema = props.uiSchema,
1270
- formContext = props.formContext;
1271
- var semanticProps = getSemanticProps({
1272
- formContext: formContext,
1273
- options: options,
1274
- uiSchema: uiSchema
1275
- }); // eslint-disable-next-line no-shadow
1276
-
1277
- var _onChange = function _onChange(_ref) {
1278
- var value = _ref.target.value;
1279
- return onChange && onChange(value);
1280
- };
1281
-
1282
- var _onBlur = function _onBlur() {
1283
- return onBlur && onBlur(id, value);
1284
- };
1285
-
1286
- var _onFocus = function _onFocus() {
1287
- return onFocus && onFocus(id, value);
1288
- };
1289
-
1290
- var displayLabel = getDisplayLabel$4(schema, uiSchema
1291
- /* TODO: , rootSchema */
1292
- );
1293
- return React.createElement(React.Fragment, null, React.createElement(semanticUiReact.Form.Input, _extends({
1294
- id: id,
1295
- key: id,
1296
- autoFocus: autofocus,
1297
- required: required,
1298
- type: "number",
1299
- label: displayLabel ? label || schema.title : false,
1300
- disabled: disabled || readonly,
1301
- name: name
1302
- }, semanticProps, {
1303
- value: value || value === 0 ? value : "",
1304
- onChange: _onChange,
1305
- onBlur: _onBlur,
1306
- onFocus: _onFocus
1307
- })));
1308
- }
1309
-
1310
- var getDisplayLabel$5 = core.utils.getDisplayLabel;
1311
-
1312
- function DateWidget(props) {
1313
- var id = props.id,
1314
- required = props.required,
1315
- readonly = props.readonly,
1316
- disabled = props.disabled,
1317
- name = props.name,
1318
- label = props.label,
1319
- value = props.value,
1320
- onChange = props.onChange,
1321
- onBlur = props.onBlur,
1322
- onFocus = props.onFocus,
1323
- autofocus = props.autofocus,
1324
- options = props.options,
1325
- formContext = props.formContext,
1326
- schema = props.schema,
1327
- uiSchema = props.uiSchema;
1328
- var semanticProps = getSemanticProps({
1329
- uiSchema: uiSchema,
1330
- schema: schema,
1331
- formContext: formContext,
1332
- options: options
1333
- });
1334
-
1335
- var _onChange = function _onChange(_ref) {
1336
- var value = _ref.target.value;
1337
- return onChange && onChange(value);
1338
- };
1339
-
1340
- var _onBlur = function _onBlur() {
1341
- return onBlur && onBlur(id, value);
1342
- };
1343
-
1344
- var _onFocus = function _onFocus() {
1345
- return onFocus && onFocus(id, value);
1346
- };
1347
-
1348
- var displayLabel = getDisplayLabel$5(schema, uiSchema
1349
- /* TODO: , rootSchema */
1350
- );
1351
- return React.createElement(semanticUiReact.Form.Input, _extends({
1352
- key: id,
1353
- id: id,
1354
- type: "date",
1355
- label: displayLabel ? label || schema.title : false,
1356
- required: required,
1357
- autoFocus: autofocus,
1358
- disabled: disabled || readonly,
1359
- name: name
1360
- }, semanticProps, {
1361
- value: value || value === 0 ? value : "",
1362
- onChange: _onChange,
1363
- onBlur: _onBlur,
1364
- onFocus: _onFocus
1365
- }));
1366
- }
1367
-
1368
- var localToUTC = core.utils.localToUTC,
1369
- utcToLocal = core.utils.utcToLocal,
1370
- getDisplayLabel$6 = core.utils.getDisplayLabel;
1371
-
1372
- function DateTimeWidget(props) {
1373
- var id = props.id,
1374
- required = props.required,
1375
- readonly = props.readonly,
1376
- disabled = props.disabled,
1377
- name = props.name,
1378
- label = props.label,
1379
- schema = props.schema,
1380
- uiSchema = props.uiSchema,
1381
- value = props.value,
1382
- onChange = props.onChange,
1383
- onBlur = props.onBlur,
1384
- onFocus = props.onFocus,
1385
- autofocus = props.autofocus,
1386
- options = props.options,
1387
- formContext = props.formContext;
1388
- var semanticProps = getSemanticProps({
1389
- uiSchema: uiSchema,
1390
- schema: schema,
1391
- formContext: formContext,
1392
- options: options
1393
1216
  });
1394
-
1395
- var _onChange = function _onChange(_ref) {
1396
- var value = _ref.target.value;
1397
- return onChange && onChange(localToUTC(value));
1398
- };
1399
-
1400
- var _onBlur = function _onBlur() {
1401
- return onBlur && onBlur(id, value);
1402
- };
1403
-
1404
- var _onFocus = function _onFocus() {
1405
- return onFocus && onFocus(id, value);
1406
- };
1407
-
1408
- var dateValue = utcToLocal(value);
1409
- var displayLabel = getDisplayLabel$6(schema, uiSchema
1410
- /* TODO: , rootSchema */
1411
- );
1412
- return React.createElement(semanticUiReact.Form.Input, _extends({
1413
- key: id,
1414
- id: id,
1415
- type: "datetime-local",
1416
- label: displayLabel ? label || schema.title : false,
1417
- required: required,
1418
- autoFocus: autofocus,
1419
- disabled: disabled || readonly,
1420
- name: name
1421
- }, semanticProps, {
1422
- value: dateValue,
1423
- onChange: _onChange,
1424
- onBlur: _onBlur,
1425
- onFocus: _onFocus
1426
- }));
1427
- }
1428
-
1429
- var getDisplayLabel$7 = core.utils.getDisplayLabel;
1430
-
1431
- function EmailWidget(props) {
1432
- var id = props.id,
1433
- required = props.required,
1434
- readonly = props.readonly,
1435
- disabled = props.disabled,
1436
- name = props.name,
1437
- label = props.label,
1438
- schema = props.schema,
1439
- uiSchema = props.uiSchema,
1440
- value = props.value,
1441
- onChange = props.onChange,
1442
- onBlur = props.onBlur,
1443
- onFocus = props.onFocus,
1444
- autofocus = props.autofocus,
1445
- options = props.options,
1446
- formContext = props.formContext;
1447
- var semanticProps = getSemanticProps({
1448
- schema: schema,
1449
- uiSchema: uiSchema,
1450
- formContext: formContext,
1451
- options: options
1452
- }); // eslint-disable-next-line no-shadow
1453
-
1454
- var _onChange = function _onChange(_ref) {
1455
- var value = _ref.target.value;
1456
- return onChange(value === "" ? options.emptyValue : value);
1457
- };
1458
-
1459
- var _onBlur = function _onBlur() {
1460
- return onBlur && onBlur(id, value);
1461
- };
1462
-
1463
- var _onFocus = function _onFocus() {
1464
- return onFocus && onFocus(id, value);
1465
- };
1466
-
1467
- var displayLabel = getDisplayLabel$7(schema, uiSchema
1468
- /* TODO: , rootSchema */
1469
- );
1470
- return React.createElement(semanticUiReact.Form.Input, _extends({
1471
- key: id,
1472
- id: id,
1473
- type: "email",
1474
- label: displayLabel ? label || schema.title : false,
1475
- required: required,
1476
- autoFocus: autofocus,
1477
- disabled: disabled || readonly,
1478
- name: name
1479
- }, semanticProps, {
1480
- value: value || value === 0 ? value : "",
1481
- onChange: _onChange,
1482
- onBlur: _onBlur,
1483
- onFocus: _onFocus
1484
- }));
1485
- }
1486
-
1487
- var getDisplayLabel$8 = core.utils.getDisplayLabel;
1488
-
1489
- function URLWidget(props) {
1490
- var id = props.id,
1491
- name = props.name,
1492
- label = props.label,
1493
- value = props.value,
1494
- required = props.required,
1495
- readonly = props.readonly,
1496
- disabled = props.disabled,
1497
- onChange = props.onChange,
1498
- onBlur = props.onBlur,
1499
- onFocus = props.onFocus,
1500
- autofocus = props.autofocus,
1501
- options = props.options,
1502
- schema = props.schema,
1503
- uiSchema = props.uiSchema,
1504
- formContext = props.formContext;
1505
- var semanticProps = getSemanticProps({
1506
- formContext: formContext,
1507
- options: options,
1508
- uiSchema: uiSchema
1509
- }); // eslint-disable-next-line no-shadow
1510
-
1511
- var _onChange = function _onChange(_ref) {
1512
- var value = _ref.target.value;
1513
- return onChange(value === "" ? options.emptyValue : value);
1514
- };
1515
-
1516
- var _onBlur = function _onBlur() {
1517
- return onBlur && onBlur(id, value);
1518
- };
1519
-
1520
- var _onFocus = function _onFocus() {
1521
- return onFocus && onFocus(id, value);
1522
- };
1523
-
1524
- var displayLabel = getDisplayLabel$8(schema, uiSchema
1525
- /* TODO: , rootSchema */
1526
- );
1527
- return React.createElement(semanticUiReact.Form.Input, _extends({
1528
- key: id,
1529
- id: id,
1530
- type: "url",
1531
- label: displayLabel ? label || schema.title : false,
1532
- required: required,
1533
- autoFocus: autofocus,
1534
- disabled: disabled || readonly,
1535
- name: name
1536
- }, semanticProps, {
1537
- value: value || value === 0 ? value : "",
1538
- onChange: _onChange,
1539
- onBlur: _onBlur,
1540
- onFocus: _onFocus
1541
- }));
1542
1217
  }
1543
1218
 
1544
- var getSubmitButtonOptions = core.utils.getSubmitButtonOptions;
1545
- var SubmitButton = (function (_ref) {
1546
- var uiSchema = _ref.uiSchema;
1547
-
1548
- var _getSubmitButtonOptio = getSubmitButtonOptions(uiSchema),
1549
- submitText = _getSubmitButtonOptio.submitText,
1550
- norender = _getSubmitButtonOptio.norender,
1551
- submitButtonProps = _getSubmitButtonOptio.props;
1552
-
1553
- if (norender) {
1554
- return null;
1555
- }
1556
-
1557
- return React.createElement(semanticUiReact.Button, _extends({
1558
- type: "submit",
1559
- primary: true
1560
- }, submitButtonProps), submitText);
1561
- });
1562
-
1563
1219
  var Widgets = {
1564
- CheckboxWidget: CheckboxWidget,
1565
- CheckboxesWidget: CheckboxesWidget,
1566
- DateWidget: DateWidget,
1567
- DateTimeWidget: DateTimeWidget,
1568
- PasswordWidget: PasswordWidget,
1569
- EmailWidget: EmailWidget,
1570
- URLWidget: URLWidget,
1571
- RadioWidget: RadioWidget,
1572
- RangeWidget: RangeWidget,
1573
- SelectWidget: SelectWidget,
1574
- TextareaWidget: TextareaWidget,
1575
- TextWidget: TextWidget,
1576
- UpDownWidget: UpDownWidget,
1577
- SubmitButton: SubmitButton
1220
+ CheckboxWidget,
1221
+ CheckboxesWidget,
1222
+ RadioWidget,
1223
+ RangeWidget,
1224
+ SelectWidget,
1225
+ TextareaWidget
1578
1226
  };
1579
1227
 
1580
- var getDefaultRegistry = core.utils.getDefaultRegistry;
1581
-
1582
- var _getDefaultRegistry = /*#__PURE__*/getDefaultRegistry(),
1583
- fields = _getDefaultRegistry.fields,
1584
- widgets = _getDefaultRegistry.widgets;
1585
-
1586
- var Theme = {
1587
- ArrayFieldTemplate: ArrayFieldTemplate,
1588
- ErrorList: ErrorList,
1589
- fields: /*#__PURE__*/_extends({}, fields, Fields),
1590
- FieldTemplate: FieldTemplate,
1591
- ObjectFieldTemplate: ObjectFieldTemplate,
1592
- _internalFormWrapper: semanticUiReact.Form,
1593
- widgets: /*#__PURE__*/_extends({}, widgets, Widgets)
1228
+ const Theme = {
1229
+ templates: Templates,
1230
+ widgets: Widgets,
1231
+ _internalFormWrapper: semanticUiReact.Form
1594
1232
  };
1595
1233
 
1596
- var SemanticUIForm = /*#__PURE__*/core.withTheme(Theme);
1234
+ const SemanticUIForm = /*#__PURE__*/core.withTheme(Theme);
1597
1235
 
1598
- exports.ArrayFieldTemplate = ArrayFieldTemplate;
1599
- exports.FieldTemplate = FieldTemplate;
1600
- exports.Fields = Fields;
1601
- exports.ObjectFieldTemplate = ObjectFieldTemplate;
1602
- exports.SemanticUIForm = SemanticUIForm;
1236
+ exports.Form = SemanticUIForm;
1237
+ exports.Templates = Templates;
1603
1238
  exports.Theme = Theme;
1604
1239
  exports.Widgets = Widgets;
1605
- exports.default = SemanticUIForm;
1240
+ exports["default"] = SemanticUIForm;
1606
1241
  //# sourceMappingURL=semantic-ui.cjs.development.js.map