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