@jsonforms/core 3.0.0-alpha.3 → 3.0.0-beta.2

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 (206) hide show
  1. package/docs/assets/js/search.json +1 -1
  2. package/docs/globals.html +207 -165
  3. package/docs/index.html +7 -4
  4. package/docs/interfaces/arraycontrolprops.html +21 -21
  5. package/docs/interfaces/arraylayoutprops.html +21 -21
  6. package/docs/interfaces/cellprops.html +12 -12
  7. package/docs/interfaces/combinatorrendererprops.html +143 -36
  8. package/docs/interfaces/controlprops.html +16 -16
  9. package/docs/interfaces/controlstate.html +2 -2
  10. package/docs/interfaces/controlwithdetailprops.html +17 -17
  11. package/docs/interfaces/dispatchcellprops.html +10 -10
  12. package/docs/interfaces/dispatchcellstateprops.html +10 -10
  13. package/docs/interfaces/dispatchpropsofarraycontrol.html +4 -4
  14. package/docs/interfaces/dispatchpropsofcontrol.html +1 -1
  15. package/docs/interfaces/dispatchpropsofmultienumcontrol.html +2 -2
  16. package/docs/interfaces/enumcellprops.html +13 -13
  17. package/docs/interfaces/enumoption.html +2 -2
  18. package/docs/interfaces/jsonformsprops.html +9 -9
  19. package/docs/interfaces/layoutprops.html +10 -10
  20. package/docs/interfaces/ownpropsofcell.html +9 -9
  21. package/docs/interfaces/ownpropsofcontrol.html +9 -12
  22. package/docs/interfaces/ownpropsofenum.html +1 -1
  23. package/docs/interfaces/ownpropsofenumcell.html +10 -10
  24. package/docs/interfaces/ownpropsofjsonformsrenderer.html +8 -8
  25. package/docs/interfaces/ownpropsoflayout.html +9 -9
  26. package/docs/interfaces/ownpropsofmasterlistitem.html +6 -6
  27. package/docs/interfaces/ownpropsofrenderer.html +8 -8
  28. package/docs/interfaces/rendererprops.html +9 -9
  29. package/docs/interfaces/statepropsofarraycontrol.html +17 -17
  30. package/docs/interfaces/statepropsofarraylayout.html +17 -17
  31. package/docs/interfaces/statepropsofcell.html +11 -11
  32. package/docs/interfaces/statepropsofcombinator.html +147 -40
  33. package/docs/interfaces/statepropsofcontrol.html +18 -15
  34. package/docs/interfaces/statepropsofcontrolwithdetail.html +16 -16
  35. package/docs/interfaces/statepropsofenumcell.html +12 -12
  36. package/docs/interfaces/statepropsofjsonformsrenderer.html +9 -9
  37. package/docs/interfaces/statepropsoflayout.html +10 -10
  38. package/docs/interfaces/statepropsofmasteritem.html +7 -7
  39. package/docs/interfaces/statepropsofrenderer.html +9 -9
  40. package/docs/interfaces/statepropsofscopedrenderer.html +12 -12
  41. package/docs/interfaces/withclassname.html +1 -1
  42. package/lib/Helpers.d.ts +5 -5
  43. package/lib/actions/actions.d.ts +181 -181
  44. package/lib/actions/index.d.ts +1 -1
  45. package/lib/configDefault.d.ts +6 -6
  46. package/lib/generators/Generate.d.ts +6 -6
  47. package/lib/generators/index.d.ts +3 -3
  48. package/lib/generators/schema.d.ts +8 -8
  49. package/lib/generators/uischema.d.ts +12 -12
  50. package/lib/i18n/i18nTypes.d.ts +15 -15
  51. package/lib/i18n/i18nUtil.d.ts +18 -18
  52. package/lib/i18n/index.d.ts +2 -2
  53. package/lib/index.d.ts +11 -11
  54. package/lib/jsonforms-core.cjs.js +2441 -0
  55. package/lib/jsonforms-core.cjs.js.map +1 -0
  56. package/lib/jsonforms-core.esm.js +2152 -0
  57. package/lib/jsonforms-core.esm.js.map +1 -0
  58. package/lib/models/draft4.d.ts +198 -198
  59. package/lib/models/index.d.ts +5 -5
  60. package/lib/models/jsonSchema.d.ts +3 -3
  61. package/lib/models/jsonSchema4.d.ts +110 -110
  62. package/lib/models/jsonSchema7.d.ts +119 -119
  63. package/lib/models/uischema.d.ts +201 -201
  64. package/lib/reducers/cells.d.ts +11 -11
  65. package/lib/reducers/config.d.ts +3 -3
  66. package/lib/reducers/core.d.ts +24 -24
  67. package/lib/reducers/default-data.d.ts +10 -10
  68. package/lib/reducers/i18n.d.ts +8 -8
  69. package/lib/reducers/index.d.ts +9 -9
  70. package/lib/reducers/reducers.d.ts +29 -29
  71. package/lib/reducers/renderers.d.ts +10 -10
  72. package/lib/reducers/selectors.d.ts +15 -15
  73. package/lib/reducers/uischemas.d.ts +10 -10
  74. package/lib/store.d.ts +53 -53
  75. package/lib/testers/index.d.ts +1 -1
  76. package/lib/testers/testers.d.ts +204 -203
  77. package/lib/util/Formatted.d.ts +19 -19
  78. package/lib/util/array.d.ts +3 -3
  79. package/lib/util/cell.d.ts +79 -79
  80. package/lib/util/combinators.d.ts +9 -10
  81. package/lib/util/ids.d.ts +3 -3
  82. package/lib/util/index.d.ts +15 -15
  83. package/lib/util/label.d.ts +9 -9
  84. package/lib/util/path.d.ts +35 -25
  85. package/lib/util/renderer.d.ts +398 -397
  86. package/lib/util/resolvers.d.ts +25 -25
  87. package/lib/util/runtime.d.ts +18 -18
  88. package/lib/util/schema.d.ts +1 -1
  89. package/lib/util/type.d.ts +174 -174
  90. package/lib/util/uischema.d.ts +5 -5
  91. package/lib/util/util.d.ts +31 -31
  92. package/lib/util/validator.d.ts +3 -3
  93. package/package.json +16 -13
  94. package/rollup.config.js +44 -0
  95. package/src/generators/uischema.ts +4 -4
  96. package/src/reducers/reducers.ts +14 -6
  97. package/src/testers/testers.ts +60 -33
  98. package/src/util/cell.ts +4 -4
  99. package/src/util/combinators.ts +17 -32
  100. package/src/util/label.ts +2 -2
  101. package/src/util/path.ts +18 -6
  102. package/src/util/renderer.ts +22 -36
  103. package/src/util/resolvers.ts +57 -68
  104. package/src/util/util.ts +1 -1
  105. package/stats.html +3279 -0
  106. package/test/generators/uischema.test.ts +18 -0
  107. package/test/testers.test.ts +208 -120
  108. package/test/util/path.test.ts +37 -20
  109. package/test/util/resolvers.test.ts +99 -8
  110. package/lib/Helpers.js +0 -33
  111. package/lib/Helpers.js.map +0 -1
  112. package/lib/actions/actions.js +0 -173
  113. package/lib/actions/actions.js.map +0 -1
  114. package/lib/actions/index.js +0 -29
  115. package/lib/actions/index.js.map +0 -1
  116. package/lib/configDefault.js +0 -48
  117. package/lib/configDefault.js.map +0 -1
  118. package/lib/generators/Generate.js +0 -35
  119. package/lib/generators/Generate.js.map +0 -1
  120. package/lib/generators/index.js +0 -31
  121. package/lib/generators/index.js.map +0 -1
  122. package/lib/generators/schema.js +0 -154
  123. package/lib/generators/schema.js.map +0 -1
  124. package/lib/generators/uischema.js +0 -169
  125. package/lib/generators/uischema.js.map +0 -1
  126. package/lib/i18n/i18nTypes.js +0 -3
  127. package/lib/i18n/i18nTypes.js.map +0 -1
  128. package/lib/i18n/i18nUtil.js +0 -71
  129. package/lib/i18n/i18nUtil.js.map +0 -1
  130. package/lib/i18n/index.js +0 -6
  131. package/lib/i18n/index.js.map +0 -1
  132. package/lib/index.js +0 -40
  133. package/lib/index.js.map +0 -1
  134. package/lib/jsonforms-core.js +0 -25
  135. package/lib/jsonforms-core.js.map +0 -1
  136. package/lib/models/draft4.js +0 -174
  137. package/lib/models/draft4.js.map +0 -1
  138. package/lib/models/index.js +0 -33
  139. package/lib/models/index.js.map +0 -1
  140. package/lib/models/jsonSchema.js +0 -27
  141. package/lib/models/jsonSchema.js.map +0 -1
  142. package/lib/models/jsonSchema4.js +0 -30
  143. package/lib/models/jsonSchema4.js.map +0 -1
  144. package/lib/models/jsonSchema7.js +0 -30
  145. package/lib/models/jsonSchema7.js.map +0 -1
  146. package/lib/models/uischema.js +0 -58
  147. package/lib/models/uischema.js.map +0 -1
  148. package/lib/reducers/cells.js +0 -42
  149. package/lib/reducers/cells.js.map +0 -1
  150. package/lib/reducers/config.js +0 -46
  151. package/lib/reducers/config.js.map +0 -1
  152. package/lib/reducers/core.js +0 -294
  153. package/lib/reducers/core.js.map +0 -1
  154. package/lib/reducers/default-data.js +0 -45
  155. package/lib/reducers/default-data.js.map +0 -1
  156. package/lib/reducers/i18n.js +0 -83
  157. package/lib/reducers/i18n.js.map +0 -1
  158. package/lib/reducers/index.js +0 -37
  159. package/lib/reducers/index.js.map +0 -1
  160. package/lib/reducers/reducers.js +0 -98
  161. package/lib/reducers/reducers.js.map +0 -1
  162. package/lib/reducers/renderers.js +0 -43
  163. package/lib/reducers/renderers.js.map +0 -1
  164. package/lib/reducers/selectors.js +0 -56
  165. package/lib/reducers/selectors.js.map +0 -1
  166. package/lib/reducers/uischemas.js +0 -60
  167. package/lib/reducers/uischemas.js.map +0 -1
  168. package/lib/store.js +0 -27
  169. package/lib/store.js.map +0 -1
  170. package/lib/testers/index.js +0 -29
  171. package/lib/testers/index.js.map +0 -1
  172. package/lib/testers/testers.js +0 -421
  173. package/lib/testers/testers.js.map +0 -1
  174. package/lib/util/Formatted.js +0 -27
  175. package/lib/util/Formatted.js.map +0 -1
  176. package/lib/util/array.js +0 -44
  177. package/lib/util/array.js.map +0 -1
  178. package/lib/util/cell.js +0 -148
  179. package/lib/util/cell.js.map +0 -1
  180. package/lib/util/combinators.js +0 -59
  181. package/lib/util/combinators.js.map +0 -1
  182. package/lib/util/ids.js +0 -54
  183. package/lib/util/ids.js.map +0 -1
  184. package/lib/util/index.js +0 -43
  185. package/lib/util/index.js.map +0 -1
  186. package/lib/util/label.js +0 -73
  187. package/lib/util/label.js.map +0 -1
  188. package/lib/util/path.js +0 -90
  189. package/lib/util/path.js.map +0 -1
  190. package/lib/util/renderer.js +0 -530
  191. package/lib/util/renderer.js.map +0 -1
  192. package/lib/util/resolvers.js +0 -169
  193. package/lib/util/resolvers.js.map +0 -1
  194. package/lib/util/runtime.js +0 -167
  195. package/lib/util/runtime.js.map +0 -1
  196. package/lib/util/schema.js +0 -42
  197. package/lib/util/schema.js.map +0 -1
  198. package/lib/util/type.js +0 -27
  199. package/lib/util/type.js.map +0 -1
  200. package/lib/util/uischema.js +0 -56
  201. package/lib/util/uischema.js.map +0 -1
  202. package/lib/util/util.js +0 -112
  203. package/lib/util/util.js.map +0 -1
  204. package/lib/util/validator.js +0 -37
  205. package/lib/util/validator.js.map +0 -1
  206. package/webpack.build.js +0 -13
@@ -0,0 +1,2441 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var isEmpty = require('lodash/isEmpty');
6
+ var startCase = require('lodash/startCase');
7
+ var keys = require('lodash/keys');
8
+ var union = require('lodash/union');
9
+ var merge = require('lodash/merge');
10
+ var cloneDeep = require('lodash/cloneDeep');
11
+ var setFp = require('lodash/fp/set');
12
+ var get = require('lodash/get');
13
+ var filter = require('lodash/filter');
14
+ var isEqual = require('lodash/isEqual');
15
+ var isFunction = require('lodash/isFunction');
16
+ var maxBy = require('lodash/maxBy');
17
+ var remove = require('lodash/remove');
18
+ var endsWith = require('lodash/endsWith');
19
+ var last = require('lodash/last');
20
+ var isArray = require('lodash/isArray');
21
+ var reduce = require('lodash/reduce');
22
+ var toPairs = require('lodash/toPairs');
23
+ var includes = require('lodash/includes');
24
+ var find = require('lodash/find');
25
+ var range = require('lodash/range');
26
+ var has = require('lodash/has');
27
+ var Ajv = require('ajv');
28
+ var addFormats = require('ajv-formats');
29
+
30
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
31
+
32
+ var isEmpty__default = /*#__PURE__*/_interopDefaultLegacy(isEmpty);
33
+ var startCase__default = /*#__PURE__*/_interopDefaultLegacy(startCase);
34
+ var keys__default = /*#__PURE__*/_interopDefaultLegacy(keys);
35
+ var union__default = /*#__PURE__*/_interopDefaultLegacy(union);
36
+ var merge__default = /*#__PURE__*/_interopDefaultLegacy(merge);
37
+ var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
38
+ var setFp__default = /*#__PURE__*/_interopDefaultLegacy(setFp);
39
+ var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
40
+ var filter__default = /*#__PURE__*/_interopDefaultLegacy(filter);
41
+ var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
42
+ var isFunction__default = /*#__PURE__*/_interopDefaultLegacy(isFunction);
43
+ var maxBy__default = /*#__PURE__*/_interopDefaultLegacy(maxBy);
44
+ var remove__default = /*#__PURE__*/_interopDefaultLegacy(remove);
45
+ var endsWith__default = /*#__PURE__*/_interopDefaultLegacy(endsWith);
46
+ var last__default = /*#__PURE__*/_interopDefaultLegacy(last);
47
+ var isArray__default = /*#__PURE__*/_interopDefaultLegacy(isArray);
48
+ var reduce__default = /*#__PURE__*/_interopDefaultLegacy(reduce);
49
+ var toPairs__default = /*#__PURE__*/_interopDefaultLegacy(toPairs);
50
+ var includes__default = /*#__PURE__*/_interopDefaultLegacy(includes);
51
+ var find__default = /*#__PURE__*/_interopDefaultLegacy(find);
52
+ var range__default = /*#__PURE__*/_interopDefaultLegacy(range);
53
+ var has__default = /*#__PURE__*/_interopDefaultLegacy(has);
54
+ var Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv);
55
+ var addFormats__default = /*#__PURE__*/_interopDefaultLegacy(addFormats);
56
+
57
+ var ADDITIONAL_PROPERTIES = 'additionalProperties';
58
+ var REQUIRED_PROPERTIES = 'required';
59
+ var distinct = function (properties, discriminator) {
60
+ var known = {};
61
+ return properties.filter(function (item) {
62
+ var discriminatorValue = discriminator(item);
63
+ if (known.hasOwnProperty(discriminatorValue)) {
64
+ return false;
65
+ }
66
+ else {
67
+ known[discriminatorValue] = true;
68
+ return true;
69
+ }
70
+ });
71
+ };
72
+ var Gen = (function () {
73
+ function Gen(findOption) {
74
+ var _this = this;
75
+ this.findOption = findOption;
76
+ this.schemaObject = function (data) {
77
+ var props = _this.properties(data);
78
+ var schema = {
79
+ type: 'object',
80
+ properties: props,
81
+ additionalProperties: _this.findOption(props)(ADDITIONAL_PROPERTIES)
82
+ };
83
+ var required = _this.findOption(props)(REQUIRED_PROPERTIES);
84
+ if (required.length > 0) {
85
+ schema.required = required;
86
+ }
87
+ return schema;
88
+ };
89
+ this.properties = function (data) {
90
+ var emptyProps = {};
91
+ return Object.keys(data).reduce(function (acc, propName) {
92
+ acc[propName] = _this.property(data[propName]);
93
+ return acc;
94
+ }, emptyProps);
95
+ };
96
+ this.property = function (data) {
97
+ switch (typeof data) {
98
+ case 'string':
99
+ return { type: 'string' };
100
+ case 'boolean':
101
+ return { type: 'boolean' };
102
+ case 'number':
103
+ if (Number.isInteger(data)) {
104
+ return { type: 'integer' };
105
+ }
106
+ return { type: 'number' };
107
+ case 'object':
108
+ if (data == null) {
109
+ return { type: 'null' };
110
+ }
111
+ return _this.schemaObjectOrArray(data);
112
+ default:
113
+ return {};
114
+ }
115
+ };
116
+ this.schemaObjectOrArray = function (data) {
117
+ if (data instanceof Array) {
118
+ return _this.schemaArray(data);
119
+ }
120
+ else {
121
+ return _this.schemaObject(data);
122
+ }
123
+ };
124
+ this.schemaArray = function (data) {
125
+ if (data.length > 0) {
126
+ var allProperties = data.map(_this.property);
127
+ var uniqueProperties = distinct(allProperties, function (prop) {
128
+ return JSON.stringify(prop);
129
+ });
130
+ if (uniqueProperties.length === 1) {
131
+ return {
132
+ type: 'array',
133
+ items: uniqueProperties[0]
134
+ };
135
+ }
136
+ else {
137
+ return {
138
+ type: 'array',
139
+ items: {
140
+ oneOf: uniqueProperties
141
+ }
142
+ };
143
+ }
144
+ }
145
+ else {
146
+ return {
147
+ type: 'array',
148
+ items: {}
149
+ };
150
+ }
151
+ };
152
+ }
153
+ return Gen;
154
+ }());
155
+ var generateJsonSchema = function (instance, options) {
156
+ if (options === void 0) { options = {}; }
157
+ var findOption = function (props) { return function (optionName) {
158
+ switch (optionName) {
159
+ case ADDITIONAL_PROPERTIES:
160
+ if (options.hasOwnProperty(ADDITIONAL_PROPERTIES)) {
161
+ return options[ADDITIONAL_PROPERTIES];
162
+ }
163
+ return true;
164
+ case REQUIRED_PROPERTIES:
165
+ if (options.hasOwnProperty(REQUIRED_PROPERTIES)) {
166
+ return options[REQUIRED_PROPERTIES](props);
167
+ }
168
+ return Object.keys(props);
169
+ default:
170
+ return;
171
+ }
172
+ }; };
173
+ var gen = new Gen(findOption);
174
+ return gen.schemaObject(instance);
175
+ };
176
+
177
+ var Draft4 = {
178
+ id: 'http://json-schema.org/draft-04/schema#',
179
+ $schema: 'http://json-schema.org/draft-04/schema#',
180
+ description: 'Core schema meta-schema',
181
+ definitions: {
182
+ schemaArray: {
183
+ type: 'array',
184
+ minItems: 1,
185
+ items: { $ref: '#' }
186
+ },
187
+ positiveInteger: {
188
+ type: 'integer',
189
+ minimum: 0
190
+ },
191
+ positiveIntegerDefault0: {
192
+ allOf: [{ $ref: '#/definitions/positiveInteger' }, { default: 0 }]
193
+ },
194
+ simpleTypes: {
195
+ enum: [
196
+ 'array',
197
+ 'boolean',
198
+ 'integer',
199
+ 'null',
200
+ 'number',
201
+ 'object',
202
+ 'string'
203
+ ]
204
+ },
205
+ stringArray: {
206
+ type: 'array',
207
+ items: { type: 'string' },
208
+ minItems: 1,
209
+ uniqueItems: true
210
+ }
211
+ },
212
+ type: 'object',
213
+ properties: {
214
+ id: {
215
+ type: 'string',
216
+ format: 'uri'
217
+ },
218
+ $schema: {
219
+ type: 'string',
220
+ format: 'uri'
221
+ },
222
+ title: {
223
+ type: 'string'
224
+ },
225
+ description: {
226
+ type: 'string'
227
+ },
228
+ default: {},
229
+ multipleOf: {
230
+ type: 'number',
231
+ minimum: 0,
232
+ exclusiveMinimum: true
233
+ },
234
+ maximum: {
235
+ type: 'number'
236
+ },
237
+ exclusiveMaximum: {
238
+ type: 'boolean',
239
+ default: false
240
+ },
241
+ minimum: {
242
+ type: 'number'
243
+ },
244
+ exclusiveMinimum: {
245
+ type: 'boolean',
246
+ default: false
247
+ },
248
+ maxLength: { $ref: '#/definitions/positiveInteger' },
249
+ minLength: { $ref: '#/definitions/positiveIntegerDefault0' },
250
+ pattern: {
251
+ type: 'string',
252
+ format: 'regex'
253
+ },
254
+ additionalItems: {
255
+ anyOf: [{ type: 'boolean' }, { $ref: '#' }],
256
+ default: {}
257
+ },
258
+ items: {
259
+ anyOf: [{ $ref: '#' }, { $ref: '#/definitions/schemaArray' }],
260
+ default: {}
261
+ },
262
+ maxItems: { $ref: '#/definitions/positiveInteger' },
263
+ minItems: { $ref: '#/definitions/positiveIntegerDefault0' },
264
+ uniqueItems: {
265
+ type: 'boolean',
266
+ default: false
267
+ },
268
+ maxProperties: { $ref: '#/definitions/positiveInteger' },
269
+ minProperties: { $ref: '#/definitions/positiveIntegerDefault0' },
270
+ required: { $ref: '#/definitions/stringArray' },
271
+ additionalProperties: {
272
+ anyOf: [{ type: 'boolean' }, { $ref: '#' }],
273
+ default: {}
274
+ },
275
+ definitions: {
276
+ type: 'object',
277
+ additionalProperties: { $ref: '#' },
278
+ default: {}
279
+ },
280
+ properties: {
281
+ type: 'object',
282
+ additionalProperties: { $ref: '#' },
283
+ default: {}
284
+ },
285
+ patternProperties: {
286
+ type: 'object',
287
+ additionalProperties: { $ref: '#' },
288
+ default: {}
289
+ },
290
+ dependencies: {
291
+ type: 'object',
292
+ additionalProperties: {
293
+ anyOf: [{ $ref: '#' }, { $ref: '#/definitions/stringArray' }]
294
+ }
295
+ },
296
+ enum: {
297
+ type: 'array',
298
+ minItems: 1,
299
+ uniqueItems: true
300
+ },
301
+ type: {
302
+ anyOf: [
303
+ { $ref: '#/definitions/simpleTypes' },
304
+ {
305
+ type: 'array',
306
+ items: { $ref: '#/definitions/simpleTypes' },
307
+ minItems: 1,
308
+ uniqueItems: true
309
+ }
310
+ ]
311
+ },
312
+ allOf: { $ref: '#/definitions/schemaArray' },
313
+ anyOf: { $ref: '#/definitions/schemaArray' },
314
+ oneOf: { $ref: '#/definitions/schemaArray' },
315
+ not: { $ref: '#' }
316
+ },
317
+ dependencies: {
318
+ exclusiveMaximum: ['maximum'],
319
+ exclusiveMinimum: ['minimum']
320
+ },
321
+ default: {}
322
+ };
323
+
324
+ exports.RuleEffect = void 0;
325
+ (function (RuleEffect) {
326
+ RuleEffect["HIDE"] = "HIDE";
327
+ RuleEffect["SHOW"] = "SHOW";
328
+ RuleEffect["ENABLE"] = "ENABLE";
329
+ RuleEffect["DISABLE"] = "DISABLE";
330
+ })(exports.RuleEffect || (exports.RuleEffect = {}));
331
+ var isGroup = function (layout) {
332
+ return layout.type === 'Group';
333
+ };
334
+ var isLayout = function (uischema) {
335
+ return uischema.elements !== undefined;
336
+ };
337
+
338
+ var move = function (array, index, delta) {
339
+ var newIndex = index + delta;
340
+ if (newIndex < 0 || newIndex >= array.length) {
341
+ return;
342
+ }
343
+ var indexes = [index, newIndex].sort(function (a, b) { return a - b; });
344
+ array.splice(indexes[0], 2, array[indexes[1]], array[indexes[0]]);
345
+ };
346
+ var moveUp = function (array, toMove) {
347
+ move(array, toMove, -1);
348
+ };
349
+ var moveDown = function (array, toMove) {
350
+ move(array, toMove, 1);
351
+ };
352
+
353
+ /*! *****************************************************************************
354
+ Copyright (c) Microsoft Corporation.
355
+
356
+ Permission to use, copy, modify, and/or distribute this software for any
357
+ purpose with or without fee is hereby granted.
358
+
359
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
360
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
361
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
362
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
363
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
364
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
365
+ PERFORMANCE OF THIS SOFTWARE.
366
+ ***************************************************************************** */
367
+
368
+ var __assign = function() {
369
+ __assign = Object.assign || function __assign(t) {
370
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
371
+ s = arguments[i];
372
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
373
+ }
374
+ return t;
375
+ };
376
+ return __assign.apply(this, arguments);
377
+ };
378
+
379
+ function __rest(s, e) {
380
+ var t = {};
381
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
382
+ t[p] = s[p];
383
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
384
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
385
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
386
+ t[p[i]] = s[p[i]];
387
+ }
388
+ return t;
389
+ }
390
+
391
+ function __spreadArray(to, from, pack) {
392
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
393
+ if (ar || !(i in from)) {
394
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
395
+ ar[i] = from[i];
396
+ }
397
+ }
398
+ return to.concat(ar || Array.prototype.slice.call(from));
399
+ }
400
+
401
+ var cellReducer = function (state, _a) {
402
+ if (state === void 0) { state = []; }
403
+ var type = _a.type, tester = _a.tester, cell = _a.cell;
404
+ switch (type) {
405
+ case ADD_CELL:
406
+ return state.concat([{ tester: tester, cell: cell }]);
407
+ case REMOVE_CELL:
408
+ return state.filter(function (t) { return t.tester !== tester; });
409
+ default:
410
+ return state;
411
+ }
412
+ };
413
+
414
+ var configDefault = {
415
+ restrict: false,
416
+ trim: false,
417
+ showUnfocusedDescription: false,
418
+ hideRequiredAsterisk: false
419
+ };
420
+
421
+ var applyDefaultConfiguration = function (config) {
422
+ if (config === void 0) { config = {}; }
423
+ return merge__default["default"]({}, configDefault, config);
424
+ };
425
+ var configReducer = function (state, action) {
426
+ if (state === void 0) { state = applyDefaultConfiguration(); }
427
+ switch (action.type) {
428
+ case SET_CONFIG:
429
+ return applyDefaultConfiguration(action.config);
430
+ default:
431
+ return state;
432
+ }
433
+ };
434
+
435
+ var validate = function (validator, data) {
436
+ if (validator === undefined) {
437
+ return [];
438
+ }
439
+ var valid = validator(data);
440
+ if (valid) {
441
+ return [];
442
+ }
443
+ return validator.errors;
444
+ };
445
+ var initState = {
446
+ data: {},
447
+ schema: {},
448
+ uischema: undefined,
449
+ errors: [],
450
+ validator: undefined,
451
+ ajv: undefined,
452
+ validationMode: 'ValidateAndShow',
453
+ };
454
+ var reuseAjvForSchema = function (ajv, schema) {
455
+ if (schema.hasOwnProperty('id') || schema.hasOwnProperty('$id')) {
456
+ ajv.removeSchema(schema);
457
+ }
458
+ return ajv;
459
+ };
460
+ var getOrCreateAjv = function (state, action) {
461
+ if (action) {
462
+ if (hasAjvOption(action.options)) {
463
+ return action.options.ajv;
464
+ }
465
+ else if (action.options !== undefined) {
466
+ if (isFunction__default["default"](action.options.compile)) {
467
+ return action.options;
468
+ }
469
+ }
470
+ }
471
+ if (state.ajv) {
472
+ return (action === null || action === void 0 ? void 0 : action.schema)
473
+ ? reuseAjvForSchema(state.ajv, action.schema)
474
+ : state.ajv;
475
+ }
476
+ return createAjv();
477
+ };
478
+ var hasAjvOption = function (option) {
479
+ if (option) {
480
+ return option.ajv !== undefined;
481
+ }
482
+ return false;
483
+ };
484
+ var getValidationMode = function (state, action) {
485
+ if (action && hasValidationModeOption(action.options)) {
486
+ return action.options.validationMode;
487
+ }
488
+ return state.validationMode;
489
+ };
490
+ var hasValidationModeOption = function (option) {
491
+ if (option) {
492
+ return option.validationMode !== undefined;
493
+ }
494
+ return false;
495
+ };
496
+ var coreReducer = function (state, action) {
497
+ if (state === void 0) { state = initState; }
498
+ switch (action.type) {
499
+ case INIT: {
500
+ var thisAjv = getOrCreateAjv(state, action);
501
+ var validationMode = getValidationMode(state, action);
502
+ var v = validationMode === 'NoValidation' ? undefined : thisAjv.compile(action.schema);
503
+ var e = validate(v, action.data);
504
+ return __assign(__assign({}, state), { data: action.data, schema: action.schema, uischema: action.uischema, errors: e, validator: v, ajv: thisAjv, validationMode: validationMode });
505
+ }
506
+ case UPDATE_CORE: {
507
+ var thisAjv = getOrCreateAjv(state, action);
508
+ var validationMode = getValidationMode(state, action);
509
+ var validator = state.validator;
510
+ var errors = state.errors;
511
+ if (state.schema !== action.schema ||
512
+ state.validationMode !== validationMode ||
513
+ state.ajv !== thisAjv) {
514
+ validator =
515
+ validationMode === 'NoValidation'
516
+ ? undefined
517
+ : thisAjv.compile(action.schema);
518
+ errors = validate(validator, action.data);
519
+ }
520
+ else if (state.data !== action.data) {
521
+ errors = validate(validator, action.data);
522
+ }
523
+ var stateChanged = state.data !== action.data ||
524
+ state.schema !== action.schema ||
525
+ state.uischema !== action.uischema ||
526
+ state.ajv !== thisAjv ||
527
+ state.errors !== errors ||
528
+ state.validator !== validator ||
529
+ state.validationMode !== validationMode;
530
+ return stateChanged
531
+ ? __assign(__assign({}, state), { data: action.data, schema: action.schema, uischema: action.uischema, ajv: thisAjv, errors: isEqual__default["default"](errors, state.errors) ? state.errors : errors, validator: validator, validationMode: validationMode }) : state;
532
+ }
533
+ case SET_AJV: {
534
+ var currentAjv = action.ajv;
535
+ var validator = state.validationMode === 'NoValidation' ? undefined : currentAjv.compile(state.schema);
536
+ var errors = validate(validator, state.data);
537
+ return __assign(__assign({}, state), { validator: validator,
538
+ errors: errors });
539
+ }
540
+ case SET_SCHEMA: {
541
+ var needsNewValidator = action.schema && state.ajv && state.validationMode !== 'NoValidation';
542
+ var v = needsNewValidator
543
+ ? reuseAjvForSchema(state.ajv, action.schema).compile(action.schema)
544
+ : state.validator;
545
+ var errors = validate(v, state.data);
546
+ return __assign(__assign({}, state), { validator: v, schema: action.schema, errors: errors });
547
+ }
548
+ case SET_UISCHEMA: {
549
+ return __assign(__assign({}, state), { uischema: action.uischema });
550
+ }
551
+ case UPDATE_DATA: {
552
+ if (action.path === undefined || action.path === null) {
553
+ return state;
554
+ }
555
+ else if (action.path === '') {
556
+ var result = action.updater(cloneDeep__default["default"](state.data));
557
+ var errors = validate(state.validator, result);
558
+ return __assign(__assign({}, state), { data: result, errors: errors });
559
+ }
560
+ else {
561
+ var oldData = get__default["default"](state.data, action.path);
562
+ var newData = action.updater(cloneDeep__default["default"](oldData));
563
+ var newState = setFp__default["default"](action.path, newData, state.data === undefined ? {} : state.data);
564
+ var errors = validate(state.validator, newState);
565
+ return __assign(__assign({}, state), { data: newState, errors: errors });
566
+ }
567
+ }
568
+ case UPDATE_ERRORS: {
569
+ return __assign(__assign({}, state), { errors: action.errors });
570
+ }
571
+ case SET_VALIDATION_MODE: {
572
+ if (state.validationMode === action.validationMode) {
573
+ return state;
574
+ }
575
+ if (action.validationMode === 'NoValidation') {
576
+ var errors = validate(undefined, state.data);
577
+ return __assign(__assign({}, state), { errors: errors, validationMode: action.validationMode });
578
+ }
579
+ if (state.validationMode === 'NoValidation') {
580
+ var validator = reuseAjvForSchema(state.ajv, state.schema).compile(state.schema);
581
+ var errors = validate(validator, state.data);
582
+ return __assign(__assign({}, state), { validator: validator,
583
+ errors: errors, validationMode: action.validationMode });
584
+ }
585
+ return __assign(__assign({}, state), { validationMode: action.validationMode });
586
+ }
587
+ default:
588
+ return state;
589
+ }
590
+ };
591
+ var extractData = function (state) { return get__default["default"](state, 'data'); };
592
+ var extractSchema = function (state) { return get__default["default"](state, 'schema'); };
593
+ var extractUiSchema = function (state) { return get__default["default"](state, 'uischema'); };
594
+ var extractAjv = function (state) { return get__default["default"](state, 'ajv'); };
595
+ var getInvalidProperty = function (error) {
596
+ switch (error.keyword) {
597
+ case 'required':
598
+ case 'dependencies':
599
+ return error.params.missingProperty;
600
+ case 'additionalProperties':
601
+ return error.params.additionalProperty;
602
+ default:
603
+ return undefined;
604
+ }
605
+ };
606
+ var getControlPath = function (error) {
607
+ var dataPath = error.dataPath;
608
+ if (dataPath) {
609
+ return dataPath.replace(/\//g, '.').substr(1);
610
+ }
611
+ var controlPath = error.instancePath;
612
+ controlPath = controlPath.replace(/\//g, '.');
613
+ var invalidProperty = getInvalidProperty(error);
614
+ if (invalidProperty !== undefined && !controlPath.endsWith(invalidProperty)) {
615
+ controlPath = controlPath + "." + invalidProperty;
616
+ }
617
+ controlPath = controlPath.replace(/^./, '');
618
+ return controlPath;
619
+ };
620
+ var errorsAt = function (instancePath, schema, matchPath) { return function (errors) {
621
+ var combinatorPaths = filter__default["default"](errors, function (error) { return error.keyword === 'oneOf' || error.keyword === 'anyOf'; }).map(function (error) { return getControlPath(error); });
622
+ return filter__default["default"](errors, function (error) {
623
+ if (filteredErrorKeywords.indexOf(error.keyword) !== -1) {
624
+ return false;
625
+ }
626
+ var controlPath = getControlPath(error);
627
+ var result = matchPath(controlPath);
628
+ var parentSchema = error.parentSchema;
629
+ if (result && !isObjectSchema$1(parentSchema)
630
+ && combinatorPaths.findIndex(function (p) { return instancePath.startsWith(p); }) !== -1) {
631
+ result = result && isEqual__default["default"](parentSchema, schema);
632
+ }
633
+ return result;
634
+ });
635
+ }; };
636
+ var isObjectSchema$1 = function (schema) {
637
+ return (schema === null || schema === void 0 ? void 0 : schema.type) === 'object' || !!(schema === null || schema === void 0 ? void 0 : schema.properties);
638
+ };
639
+ var filteredErrorKeywords = ['additionalProperties', 'allOf', 'anyOf', 'oneOf'];
640
+ var getErrorsAt = function (instancePath, schema, matchPath) { return function (state) {
641
+ return errorsAt(instancePath, schema, matchPath)(state.validationMode === 'ValidateAndHide' ? [] : state.errors);
642
+ }; };
643
+ var errorAt = function (instancePath, schema) {
644
+ return getErrorsAt(instancePath, schema, function (path) { return path === instancePath; });
645
+ };
646
+ var subErrorsAt = function (instancePath, schema) {
647
+ return getErrorsAt(instancePath, schema, function (path) { return path.startsWith(instancePath); });
648
+ };
649
+
650
+ var defaultDataReducer = function (state, action) {
651
+ if (state === void 0) { state = []; }
652
+ switch (action.type) {
653
+ case ADD_DEFAULT_DATA:
654
+ return state.concat([
655
+ { schemaPath: action.schemaPath, data: action.data }
656
+ ]);
657
+ case REMOVE_DEFAULT_DATA:
658
+ return state.filter(function (t) { return t.schemaPath !== action.schemaPath; });
659
+ default:
660
+ return state;
661
+ }
662
+ };
663
+ var extractDefaultData = function (state) { return state; };
664
+
665
+ var getI18nKeyPrefixBySchema = function (schema, uischema) {
666
+ var _a, _b, _c;
667
+ return (_c = (_b = (_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.i18n) !== null && _b !== void 0 ? _b : schema === null || schema === void 0 ? void 0 : schema.i18n) !== null && _c !== void 0 ? _c : undefined;
668
+ };
669
+ var transformPathToI18nPrefix = function (path) {
670
+ return ((path === null || path === void 0 ? void 0 : path.split('.').filter(function (segment) { return !/^\d+$/.test(segment); }).join('.')) || 'root');
671
+ };
672
+ var getI18nKeyPrefix = function (schema, uischema, path) {
673
+ var _a;
674
+ return ((_a = getI18nKeyPrefixBySchema(schema, uischema)) !== null && _a !== void 0 ? _a : transformPathToI18nPrefix(path));
675
+ };
676
+ var getI18nKey = function (schema, uischema, path, key) {
677
+ return getI18nKeyPrefix(schema, uischema, path) + "." + key;
678
+ };
679
+ var defaultTranslator = function (_id, defaultMessage) { return defaultMessage; };
680
+ var defaultErrorTranslator = function (error, t, uischema) {
681
+ var _a;
682
+ var i18nKey = getI18nKey(error.parentSchema, uischema, getControlPath(error), "error." + error.keyword);
683
+ var specializedKeywordMessage = t(i18nKey, undefined);
684
+ if (specializedKeywordMessage !== undefined) {
685
+ return specializedKeywordMessage;
686
+ }
687
+ var genericKeywordMessage = t("error." + error.keyword, undefined);
688
+ if (genericKeywordMessage !== undefined) {
689
+ return genericKeywordMessage;
690
+ }
691
+ var messageCustomization = t(error.message, undefined);
692
+ if (messageCustomization !== undefined) {
693
+ return messageCustomization;
694
+ }
695
+ if (error.keyword === 'required' && ((_a = error.message) === null || _a === void 0 ? void 0 : _a.startsWith('must have required property'))) {
696
+ return t('is a required property', 'is a required property');
697
+ }
698
+ return error.message;
699
+ };
700
+ var getCombinedErrorMessage = function (errors, et, t, schema, uischema, path) {
701
+ if (errors.length > 0 && t) {
702
+ var customErrorKey = getI18nKey(schema, uischema, path, 'error.custom');
703
+ var specializedErrorMessage = t(customErrorKey, undefined);
704
+ if (specializedErrorMessage !== undefined) {
705
+ return specializedErrorMessage;
706
+ }
707
+ }
708
+ return formatErrorMessage(errors.map(function (error) { return et(error, t, uischema); }));
709
+ };
710
+
711
+ var defaultJsonFormsI18nState = {
712
+ locale: 'en',
713
+ translate: defaultTranslator,
714
+ translateError: defaultErrorTranslator
715
+ };
716
+ var i18nReducer = function (state, action) {
717
+ var _a, _b, _c, _d, _e, _f;
718
+ if (state === void 0) { state = defaultJsonFormsI18nState; }
719
+ switch (action.type) {
720
+ case UPDATE_I18N: {
721
+ var locale = (_a = action.locale) !== null && _a !== void 0 ? _a : defaultJsonFormsI18nState.locale;
722
+ var translate = (_b = action.translator) !== null && _b !== void 0 ? _b : defaultJsonFormsI18nState.translate;
723
+ var translateError = (_c = action.errorTranslator) !== null && _c !== void 0 ? _c : defaultJsonFormsI18nState.translateError;
724
+ if (locale !== state.locale ||
725
+ translate !== state.translate ||
726
+ translateError !== state.translateError) {
727
+ return __assign(__assign({}, state), { locale: locale,
728
+ translate: translate,
729
+ translateError: translateError });
730
+ }
731
+ return state;
732
+ }
733
+ case SET_TRANSLATOR:
734
+ return __assign(__assign({}, state), { translate: (_d = action.translator) !== null && _d !== void 0 ? _d : defaultTranslator, translateError: (_e = action.errorTranslator) !== null && _e !== void 0 ? _e : defaultErrorTranslator });
735
+ case SET_LOCALE:
736
+ return __assign(__assign({}, state), { locale: (_f = action.locale) !== null && _f !== void 0 ? _f : navigator.languages[0] });
737
+ default:
738
+ return state;
739
+ }
740
+ };
741
+ var fetchLocale = function (state) {
742
+ if (state === undefined) {
743
+ return undefined;
744
+ }
745
+ return state.locale;
746
+ };
747
+ var fetchTranslator = function (state) {
748
+ if (state === undefined) {
749
+ return defaultTranslator;
750
+ }
751
+ return state.translate;
752
+ };
753
+ var fetchErrorTranslator = function (state) {
754
+ if (state === undefined) {
755
+ return defaultErrorTranslator;
756
+ }
757
+ return state.translateError;
758
+ };
759
+
760
+ var rendererReducer = function (state, action) {
761
+ if (state === void 0) { state = []; }
762
+ switch (action.type) {
763
+ case ADD_RENDERER:
764
+ return state.concat([
765
+ { tester: action.tester, renderer: action.renderer }
766
+ ]);
767
+ case REMOVE_RENDERER:
768
+ return state.filter(function (t) { return t.tester !== action.tester; });
769
+ default:
770
+ return state;
771
+ }
772
+ };
773
+
774
+ var NOT_APPLICABLE = -1;
775
+ var isControl = function (uischema) {
776
+ return !isEmpty__default["default"](uischema) && uischema.scope !== undefined;
777
+ };
778
+ var schemaMatches = function (predicate) { return function (uischema, schema, rootSchema) {
779
+ if (isEmpty__default["default"](uischema) || !isControl(uischema)) {
780
+ return false;
781
+ }
782
+ if (isEmpty__default["default"](schema)) {
783
+ return false;
784
+ }
785
+ var schemaPath = uischema.scope;
786
+ if (isEmpty__default["default"](schemaPath)) {
787
+ return false;
788
+ }
789
+ var currentDataSchema = schema;
790
+ if (hasType(schema, 'object')) {
791
+ currentDataSchema = resolveSchema(schema, schemaPath, rootSchema);
792
+ }
793
+ if (currentDataSchema === undefined) {
794
+ return false;
795
+ }
796
+ return predicate(currentDataSchema, rootSchema);
797
+ }; };
798
+ var schemaSubPathMatches = function (subPath, predicate) { return function (uischema, schema, rootSchema) {
799
+ if (isEmpty__default["default"](uischema) || !isControl(uischema)) {
800
+ return false;
801
+ }
802
+ var schemaPath = uischema.scope;
803
+ var currentDataSchema = schema;
804
+ if (hasType(schema, 'object')) {
805
+ currentDataSchema = resolveSchema(schema, schemaPath, rootSchema);
806
+ }
807
+ currentDataSchema = get__default["default"](currentDataSchema, subPath);
808
+ if (currentDataSchema === undefined) {
809
+ return false;
810
+ }
811
+ return predicate(currentDataSchema, rootSchema);
812
+ }; };
813
+ var schemaTypeIs = function (expectedType) {
814
+ return schemaMatches(function (schema) { return !isEmpty__default["default"](schema) && hasType(schema, expectedType); });
815
+ };
816
+ var formatIs = function (expectedFormat) {
817
+ return schemaMatches(function (schema) {
818
+ return !isEmpty__default["default"](schema) &&
819
+ schema.format === expectedFormat &&
820
+ schema.type === 'string';
821
+ });
822
+ };
823
+ var uiTypeIs = function (expected) { return function (uischema) { return !isEmpty__default["default"](uischema) && uischema.type === expected; }; };
824
+ var optionIs = function (optionName, optionValue) { return function (uischema) {
825
+ if (isEmpty__default["default"](uischema)) {
826
+ return false;
827
+ }
828
+ var options = uischema.options;
829
+ return !isEmpty__default["default"](options) && options[optionName] === optionValue;
830
+ }; };
831
+ var scopeEndsWith = function (expected) { return function (uischema) {
832
+ if (isEmpty__default["default"](expected) || !isControl(uischema)) {
833
+ return false;
834
+ }
835
+ return endsWith__default["default"](uischema.scope, expected);
836
+ }; };
837
+ var scopeEndIs = function (expected) { return function (uischema) {
838
+ if (isEmpty__default["default"](expected) || !isControl(uischema)) {
839
+ return false;
840
+ }
841
+ var schemaPath = uischema.scope;
842
+ return !isEmpty__default["default"](schemaPath) && last__default["default"](schemaPath.split('/')) === expected;
843
+ }; };
844
+ var and = function () {
845
+ var testers = [];
846
+ for (var _i = 0; _i < arguments.length; _i++) {
847
+ testers[_i] = arguments[_i];
848
+ }
849
+ return function (uischema, schema, rootSchema) { return testers.reduce(function (acc, tester) { return acc && tester(uischema, schema, rootSchema); }, true); };
850
+ };
851
+ var or = function () {
852
+ var testers = [];
853
+ for (var _i = 0; _i < arguments.length; _i++) {
854
+ testers[_i] = arguments[_i];
855
+ }
856
+ return function (uischema, schema, rootSchema) { return testers.reduce(function (acc, tester) { return acc || tester(uischema, schema, rootSchema); }, false); };
857
+ };
858
+ var rankWith = function (rank, tester) { return function (uischema, schema, rootSchema) {
859
+ if (tester(uischema, schema, rootSchema)) {
860
+ return rank;
861
+ }
862
+ return NOT_APPLICABLE;
863
+ }; };
864
+ var withIncreasedRank = function (by, rankedTester) { return function (uischema, schema, rootSchema) {
865
+ var rank = rankedTester(uischema, schema, rootSchema);
866
+ if (rank === NOT_APPLICABLE) {
867
+ return NOT_APPLICABLE;
868
+ }
869
+ return rank + by;
870
+ }; };
871
+ var isBooleanControl = and(uiTypeIs('Control'), schemaTypeIs('boolean'));
872
+ var isObjectControl = and(uiTypeIs('Control'), schemaTypeIs('object'));
873
+ var isAllOfControl = and(uiTypeIs('Control'), schemaMatches(function (schema) { return schema.hasOwnProperty('allOf'); }));
874
+ var isAnyOfControl = and(uiTypeIs('Control'), schemaMatches(function (schema) { return schema.hasOwnProperty('anyOf'); }));
875
+ var isOneOfControl = and(uiTypeIs('Control'), schemaMatches(function (schema) { return schema.hasOwnProperty('oneOf'); }));
876
+ var isEnumControl = and(uiTypeIs('Control'), or(schemaMatches(function (schema) { return schema.hasOwnProperty('enum'); }), schemaMatches(function (schema) { return schema.hasOwnProperty('const'); })));
877
+ var isOneOfEnumControl = and(uiTypeIs('Control'), schemaMatches(function (schema) {
878
+ return schema.hasOwnProperty('oneOf') &&
879
+ schema.oneOf.every(function (s) { return s.const !== undefined; });
880
+ }));
881
+ var isIntegerControl = and(uiTypeIs('Control'), schemaTypeIs('integer'));
882
+ var isNumberControl = and(uiTypeIs('Control'), schemaTypeIs('number'));
883
+ var isStringControl = and(uiTypeIs('Control'), schemaTypeIs('string'));
884
+ var isMultiLineControl = and(uiTypeIs('Control'), optionIs('multi', true));
885
+ var isDateControl = and(uiTypeIs('Control'), or(formatIs('date'), optionIs('format', 'date')));
886
+ var isTimeControl = and(uiTypeIs('Control'), or(formatIs('time'), optionIs('format', 'time')));
887
+ var isDateTimeControl = and(uiTypeIs('Control'), or(formatIs('date-time'), optionIs('format', 'date-time')));
888
+ var isObjectArray = and(schemaMatches(function (schema, rootSchema) { return hasType(schema, 'array') && !Array.isArray(resolveSchema(schema, 'items', rootSchema)); }
889
+ ), schemaSubPathMatches('items', function (schema, rootSchema) {
890
+ var resolvedSchema = schema.$ref ? resolveSchema(rootSchema, schema.$ref, rootSchema) : schema;
891
+ return hasType(resolvedSchema, 'object');
892
+ }));
893
+ var isObjectArrayControl = and(uiTypeIs('Control'), isObjectArray);
894
+ var traverse = function (any, pred, rootSchema) {
895
+ if (isArray__default["default"](any)) {
896
+ return reduce__default["default"](any, function (acc, el) { return acc || traverse(el, pred, rootSchema); }, false);
897
+ }
898
+ if (pred(any)) {
899
+ return true;
900
+ }
901
+ if (any.$ref) {
902
+ var toTraverse = resolveSchema(rootSchema, any.$ref, rootSchema);
903
+ if (toTraverse && !toTraverse.$ref) {
904
+ return traverse(toTraverse, pred, rootSchema);
905
+ }
906
+ }
907
+ if (any.items) {
908
+ return traverse(any.items, pred, rootSchema);
909
+ }
910
+ if (any.properties) {
911
+ return reduce__default["default"](toPairs__default["default"](any.properties), function (acc, _a) {
912
+ _a[0]; var val = _a[1];
913
+ return acc || traverse(val, pred, rootSchema);
914
+ }, false);
915
+ }
916
+ return false;
917
+ };
918
+ var isObjectArrayWithNesting = function (uischema, schema, rootSchema) {
919
+ if (!uiTypeIs('Control')(uischema, schema, rootSchema)) {
920
+ return false;
921
+ }
922
+ var schemaPath = uischema.scope;
923
+ var resolvedSchema = resolveSchema(schema, schemaPath, rootSchema !== null && rootSchema !== void 0 ? rootSchema : schema);
924
+ var wantedNestingByType = {
925
+ object: 2,
926
+ array: 1
927
+ };
928
+ if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {
929
+ if (traverse(resolvedSchema.items, function (val) {
930
+ if (val === schema) {
931
+ return false;
932
+ }
933
+ if (val.$ref !== undefined) {
934
+ return false;
935
+ }
936
+ if (typeof val.type !== 'string') {
937
+ return true;
938
+ }
939
+ var typeCount = wantedNestingByType[val.type];
940
+ if (typeCount === undefined) {
941
+ return false;
942
+ }
943
+ wantedNestingByType[val.type] = typeCount - 1;
944
+ return wantedNestingByType[val.type] === 0;
945
+ }, rootSchema)) {
946
+ return true;
947
+ }
948
+ if (uischema.options && uischema.options.detail) {
949
+ if (typeof uischema.options.detail === 'string') {
950
+ return uischema.options.detail.toUpperCase() !== 'DEFAULT';
951
+ }
952
+ else if (typeof uischema.options.detail === 'object' &&
953
+ uischema.options.detail.type) {
954
+ return true;
955
+ }
956
+ }
957
+ }
958
+ return false;
959
+ };
960
+ var isArrayObjectControl = isObjectArrayControl;
961
+ var isPrimitiveArrayControl = and(uiTypeIs('Control'), schemaMatches(function (schema, rootSchema) {
962
+ return deriveTypes(schema).length !== 0 &&
963
+ !Array.isArray(resolveSchema(schema, 'items', rootSchema));
964
+ }
965
+ ), schemaSubPathMatches('items', function (schema, rootSchema) {
966
+ var resolvedSchema = schema.$ref ? resolveSchema(rootSchema, schema.$ref, rootSchema) : schema;
967
+ var types = deriveTypes(resolvedSchema);
968
+ return (types.length === 1 &&
969
+ includes__default["default"](['integer', 'number', 'boolean', 'string'], types[0]));
970
+ }));
971
+ var isRangeControl = and(uiTypeIs('Control'), or(schemaTypeIs('number'), schemaTypeIs('integer')), schemaMatches(function (schema) {
972
+ return schema.hasOwnProperty('maximum') &&
973
+ schema.hasOwnProperty('minimum') &&
974
+ schema.hasOwnProperty('default');
975
+ }), optionIs('slider', true));
976
+ var isNumberFormatControl = and(uiTypeIs('Control'), schemaTypeIs('integer'), optionIs('format', true));
977
+ var isCategorization = function (category) { return category.type === 'Categorization'; };
978
+ var isCategory = function (uischema) {
979
+ return uischema.type === 'Category';
980
+ };
981
+ var hasCategory = function (categorization) {
982
+ if (isEmpty__default["default"](categorization.elements)) {
983
+ return false;
984
+ }
985
+ return categorization.elements
986
+ .map(function (elem) {
987
+ return isCategorization(elem) ? hasCategory(elem) : isCategory(elem);
988
+ })
989
+ .reduce(function (prev, curr) { return prev && curr; }, true);
990
+ };
991
+ var categorizationHasCategory = function (uischema) {
992
+ return hasCategory(uischema);
993
+ };
994
+ var not = function (tester) { return function (uischema, schema, rootSchema) { return !tester(uischema, schema, rootSchema); }; };
995
+
996
+ var index$1 = /*#__PURE__*/Object.freeze({
997
+ __proto__: null,
998
+ NOT_APPLICABLE: NOT_APPLICABLE,
999
+ isControl: isControl,
1000
+ schemaMatches: schemaMatches,
1001
+ schemaSubPathMatches: schemaSubPathMatches,
1002
+ schemaTypeIs: schemaTypeIs,
1003
+ formatIs: formatIs,
1004
+ uiTypeIs: uiTypeIs,
1005
+ optionIs: optionIs,
1006
+ scopeEndsWith: scopeEndsWith,
1007
+ scopeEndIs: scopeEndIs,
1008
+ and: and,
1009
+ or: or,
1010
+ rankWith: rankWith,
1011
+ withIncreasedRank: withIncreasedRank,
1012
+ isBooleanControl: isBooleanControl,
1013
+ isObjectControl: isObjectControl,
1014
+ isAllOfControl: isAllOfControl,
1015
+ isAnyOfControl: isAnyOfControl,
1016
+ isOneOfControl: isOneOfControl,
1017
+ isEnumControl: isEnumControl,
1018
+ isOneOfEnumControl: isOneOfEnumControl,
1019
+ isIntegerControl: isIntegerControl,
1020
+ isNumberControl: isNumberControl,
1021
+ isStringControl: isStringControl,
1022
+ isMultiLineControl: isMultiLineControl,
1023
+ isDateControl: isDateControl,
1024
+ isTimeControl: isTimeControl,
1025
+ isDateTimeControl: isDateTimeControl,
1026
+ isObjectArray: isObjectArray,
1027
+ isObjectArrayControl: isObjectArrayControl,
1028
+ isObjectArrayWithNesting: isObjectArrayWithNesting,
1029
+ isArrayObjectControl: isArrayObjectControl,
1030
+ isPrimitiveArrayControl: isPrimitiveArrayControl,
1031
+ isRangeControl: isRangeControl,
1032
+ isNumberFormatControl: isNumberFormatControl,
1033
+ isCategorization: isCategorization,
1034
+ isCategory: isCategory,
1035
+ hasCategory: hasCategory,
1036
+ categorizationHasCategory: categorizationHasCategory,
1037
+ not: not
1038
+ });
1039
+
1040
+ var uischemaRegistryReducer = function (state, action) {
1041
+ if (state === void 0) { state = []; }
1042
+ switch (action.type) {
1043
+ case ADD_UI_SCHEMA:
1044
+ return state
1045
+ .slice()
1046
+ .concat({ tester: action.tester, uischema: action.uischema });
1047
+ case REMOVE_UI_SCHEMA:
1048
+ var copy = state.slice();
1049
+ remove__default["default"](copy, function (entry) { return entry.tester === action.tester; });
1050
+ return copy;
1051
+ default:
1052
+ return state;
1053
+ }
1054
+ };
1055
+ var findMatchingUISchema = function (state) { return function (jsonSchema, schemaPath, path) {
1056
+ var match = maxBy__default["default"](state, function (entry) {
1057
+ return entry.tester(jsonSchema, schemaPath, path);
1058
+ });
1059
+ if (match !== undefined &&
1060
+ match.tester(jsonSchema, schemaPath, path) !== NOT_APPLICABLE) {
1061
+ return match.uischema;
1062
+ }
1063
+ return undefined;
1064
+ }; };
1065
+
1066
+ var jsonFormsReducerConfig = {
1067
+ core: coreReducer,
1068
+ renderers: rendererReducer,
1069
+ cells: cellReducer,
1070
+ config: configReducer,
1071
+ uischemas: uischemaRegistryReducer,
1072
+ defaultData: defaultDataReducer,
1073
+ i18n: i18nReducer,
1074
+ };
1075
+ var findUISchema = function (uischemas, schema, schemaPath, path, fallback, control, rootSchema) {
1076
+ if (fallback === void 0) { fallback = 'VerticalLayout'; }
1077
+ if (control && control.options && control.options.detail) {
1078
+ if (typeof control.options.detail === 'string') {
1079
+ if (control.options.detail.toUpperCase() === 'GENERATE') {
1080
+ if (typeof fallback === "function") {
1081
+ return fallback();
1082
+ }
1083
+ return Generate.uiSchema(schema, fallback);
1084
+ }
1085
+ }
1086
+ else if (typeof control.options.detail === 'object') {
1087
+ if (control.options.detail.type &&
1088
+ typeof control.options.detail.type === 'string') {
1089
+ return control.options.detail;
1090
+ }
1091
+ }
1092
+ }
1093
+ var uiSchema = findMatchingUISchema(uischemas)(schema, schemaPath, path);
1094
+ if (uiSchema === undefined) {
1095
+ if (typeof fallback === 'function') {
1096
+ return fallback();
1097
+ }
1098
+ return Generate.uiSchema(schema, fallback, '#', rootSchema);
1099
+ }
1100
+ return uiSchema;
1101
+ };
1102
+ var getErrorAt = function (instancePath, schema) { return function (state) {
1103
+ return errorAt(instancePath, schema)(state.jsonforms.core);
1104
+ }; };
1105
+ var getSubErrorsAt = function (instancePath, schema) { return function (state) { return subErrorsAt(instancePath, schema)(state.jsonforms.core); }; };
1106
+ var getConfig = function (state) { return state.jsonforms.config; };
1107
+ var getLocale = function (state) {
1108
+ return fetchLocale(get__default["default"](state, 'jsonforms.i18n'));
1109
+ };
1110
+ var getTranslator = function () { return function (state) { return fetchTranslator(get__default["default"](state, 'jsonforms.i18n')); }; };
1111
+ var getErrorTranslator = function () { return function (state) { return fetchErrorTranslator(get__default["default"](state, 'jsonforms.i18n')); }; };
1112
+
1113
+ var getData = function (state) {
1114
+ return extractData(get__default["default"](state, 'jsonforms.core'));
1115
+ };
1116
+ var getSchema = function (state) {
1117
+ return extractSchema(get__default["default"](state, 'jsonforms.core'));
1118
+ };
1119
+ var getUiSchema = function (state) {
1120
+ return extractUiSchema(get__default["default"](state, 'jsonforms.core'));
1121
+ };
1122
+ var getAjv = function (state) { return extractAjv(get__default["default"](state, 'jsonforms.core')); };
1123
+ var getDefaultData = function (state) {
1124
+ return extractDefaultData(get__default["default"](state, 'jsonforms.defaultData'));
1125
+ };
1126
+ var getRenderers = function (state) { return get__default["default"](state, 'jsonforms.renderers'); };
1127
+ var getCells = function (state) { return get__default["default"](state, 'jsonforms.cells'); };
1128
+ var getUISchemas = function (state) { return get__default["default"](state, 'jsonforms.uischemas'); };
1129
+
1130
+ var compose = function (path1, path2) {
1131
+ var p1 = path1;
1132
+ if (!isEmpty__default["default"](path1) && !isEmpty__default["default"](path2) && !path2.startsWith('[')) {
1133
+ p1 = path1 + '.';
1134
+ }
1135
+ if (isEmpty__default["default"](p1)) {
1136
+ return path2;
1137
+ }
1138
+ else if (isEmpty__default["default"](path2)) {
1139
+ return p1;
1140
+ }
1141
+ else {
1142
+ return "" + p1 + path2;
1143
+ }
1144
+ };
1145
+ var toDataPathSegments = function (schemaPath) {
1146
+ var s = schemaPath
1147
+ .replace(/(anyOf|allOf|oneOf)\/[\d]\//g, '')
1148
+ .replace(/(then|else)\//g, '');
1149
+ var segments = s.split('/');
1150
+ var decodedSegments = segments.map(decode);
1151
+ var startFromRoot = decodedSegments[0] === '#' || decodedSegments[0] === '';
1152
+ var startIndex = startFromRoot ? 2 : 1;
1153
+ return range__default["default"](startIndex, decodedSegments.length, 2).map(function (idx) { return decodedSegments[idx]; });
1154
+ };
1155
+ var toDataPath = function (schemaPath) {
1156
+ return toDataPathSegments(schemaPath).join('.');
1157
+ };
1158
+ var composeWithUi = function (scopableUi, path) {
1159
+ var segments = toDataPathSegments(scopableUi.scope);
1160
+ if (isEmpty__default["default"](segments) && path === undefined) {
1161
+ return '';
1162
+ }
1163
+ return isEmpty__default["default"](segments) ? path : compose(path, segments.join('.'));
1164
+ };
1165
+ var encode = function (segment) { return segment === null || segment === void 0 ? void 0 : segment.replace(/~/g, '~0').replace(/\//g, '~1'); };
1166
+ var decode = function (pointerSegment) { return pointerSegment === null || pointerSegment === void 0 ? void 0 : pointerSegment.replace(/~1/g, '/').replace(/~0/, '~'); };
1167
+
1168
+ var isObjectSchema = function (schema) {
1169
+ return schema.properties !== undefined;
1170
+ };
1171
+ var isArraySchema = function (schema) {
1172
+ return schema.type === 'array' && schema.items !== undefined;
1173
+ };
1174
+ var resolveData = function (instance, dataPath) {
1175
+ if (isEmpty__default["default"](dataPath)) {
1176
+ return instance;
1177
+ }
1178
+ var dataPathSegments = dataPath.split('.');
1179
+ return dataPathSegments
1180
+ .map(function (segment) { return decodeURIComponent(segment); })
1181
+ .reduce(function (curInstance, decodedSegment) {
1182
+ if (!curInstance || !curInstance.hasOwnProperty(decodedSegment)) {
1183
+ return undefined;
1184
+ }
1185
+ return curInstance[decodedSegment];
1186
+ }, instance);
1187
+ };
1188
+ var findAllRefs = function (schema, result, resolveTuples) {
1189
+ if (result === void 0) { result = {}; }
1190
+ if (resolveTuples === void 0) { resolveTuples = false; }
1191
+ if (isObjectSchema(schema)) {
1192
+ Object.keys(schema.properties).forEach(function (key) {
1193
+ return findAllRefs(schema.properties[key], result);
1194
+ });
1195
+ }
1196
+ if (isArraySchema(schema)) {
1197
+ if (Array.isArray(schema.items)) {
1198
+ if (resolveTuples) {
1199
+ var items = schema.items;
1200
+ items.forEach(function (child) { return findAllRefs(child, result); });
1201
+ }
1202
+ }
1203
+ else {
1204
+ findAllRefs(schema.items, result);
1205
+ }
1206
+ }
1207
+ if (Array.isArray(schema.anyOf)) {
1208
+ var anyOf = schema.anyOf;
1209
+ anyOf.forEach(function (child) { return findAllRefs(child, result); });
1210
+ }
1211
+ if (schema.$ref !== undefined) {
1212
+ result[schema.$ref] = schema;
1213
+ }
1214
+ return result;
1215
+ };
1216
+ var invalidSegment = function (pathSegment) {
1217
+ return pathSegment === '#' || pathSegment === undefined || pathSegment === '';
1218
+ };
1219
+ var resolveSchema = function (schema, schemaPath, rootSchema) {
1220
+ var segments = schemaPath === null || schemaPath === void 0 ? void 0 : schemaPath.split('/').map(decode);
1221
+ return resolveSchemaWithSegments(schema, segments, rootSchema);
1222
+ };
1223
+ var resolveSchemaWithSegments = function (schema, pathSegments, rootSchema) {
1224
+ var _a, _b, _c, _d, _e;
1225
+ if (isEmpty__default["default"](schema)) {
1226
+ return undefined;
1227
+ }
1228
+ if (schema.$ref) {
1229
+ schema = resolveSchema(rootSchema, schema.$ref, rootSchema);
1230
+ }
1231
+ if (!pathSegments || pathSegments.length === 0) {
1232
+ return schema;
1233
+ }
1234
+ var segment = pathSegments[0], remainingSegments = pathSegments.slice(1);
1235
+ if (invalidSegment(segment)) {
1236
+ return resolveSchemaWithSegments(schema, remainingSegments, rootSchema);
1237
+ }
1238
+ var singleSegmentResolveSchema = get__default["default"](schema, segment);
1239
+ var resolvedSchema = resolveSchemaWithSegments(singleSegmentResolveSchema, remainingSegments, rootSchema);
1240
+ if (resolvedSchema) {
1241
+ return resolvedSchema;
1242
+ }
1243
+ if (segment === 'properties' || segment === 'items') {
1244
+ var alternativeResolveResult = undefined;
1245
+ var subSchemas = [].concat((_a = schema.oneOf) !== null && _a !== void 0 ? _a : [], (_b = schema.allOf) !== null && _b !== void 0 ? _b : [], (_c = schema.anyOf) !== null && _c !== void 0 ? _c : [], (_d = schema.then) !== null && _d !== void 0 ? _d : [], (_e = schema.else) !== null && _e !== void 0 ? _e : []);
1246
+ for (var _i = 0, subSchemas_1 = subSchemas; _i < subSchemas_1.length; _i++) {
1247
+ var subSchema = subSchemas_1[_i];
1248
+ alternativeResolveResult = resolveSchemaWithSegments(subSchema, __spreadArray([segment], remainingSegments), rootSchema);
1249
+ if (alternativeResolveResult) {
1250
+ break;
1251
+ }
1252
+ }
1253
+ return alternativeResolveResult;
1254
+ }
1255
+ return undefined;
1256
+ };
1257
+
1258
+ var isOrCondition = function (condition) {
1259
+ return condition.type === 'OR';
1260
+ };
1261
+ var isAndCondition = function (condition) {
1262
+ return condition.type === 'AND';
1263
+ };
1264
+ var isLeafCondition = function (condition) {
1265
+ return condition.type === 'LEAF';
1266
+ };
1267
+ var isSchemaCondition = function (condition) { return has__default["default"](condition, 'schema'); };
1268
+ var getConditionScope = function (condition, path) {
1269
+ return composeWithUi(condition, path);
1270
+ };
1271
+ var evaluateCondition = function (data, condition, path, ajv) {
1272
+ if (isAndCondition(condition)) {
1273
+ return condition.conditions.reduce(function (acc, cur) { return acc && evaluateCondition(data, cur, path, ajv); }, true);
1274
+ }
1275
+ else if (isOrCondition(condition)) {
1276
+ return condition.conditions.reduce(function (acc, cur) { return acc || evaluateCondition(data, cur, path, ajv); }, false);
1277
+ }
1278
+ else if (isLeafCondition(condition)) {
1279
+ var value = resolveData(data, getConditionScope(condition, path));
1280
+ return value === condition.expectedValue;
1281
+ }
1282
+ else if (isSchemaCondition(condition)) {
1283
+ var value = resolveData(data, getConditionScope(condition, path));
1284
+ return ajv.validate(condition.schema, value);
1285
+ }
1286
+ else {
1287
+ return true;
1288
+ }
1289
+ };
1290
+ var isRuleFulfilled = function (uischema, data, path, ajv) {
1291
+ var condition = uischema.rule.condition;
1292
+ return evaluateCondition(data, condition, path, ajv);
1293
+ };
1294
+ var evalVisibility = function (uischema, data, path, ajv) {
1295
+ if (path === void 0) { path = undefined; }
1296
+ var fulfilled = isRuleFulfilled(uischema, data, path, ajv);
1297
+ switch (uischema.rule.effect) {
1298
+ case exports.RuleEffect.HIDE:
1299
+ return !fulfilled;
1300
+ case exports.RuleEffect.SHOW:
1301
+ return fulfilled;
1302
+ default:
1303
+ return true;
1304
+ }
1305
+ };
1306
+ var evalEnablement = function (uischema, data, path, ajv) {
1307
+ if (path === void 0) { path = undefined; }
1308
+ var fulfilled = isRuleFulfilled(uischema, data, path, ajv);
1309
+ switch (uischema.rule.effect) {
1310
+ case exports.RuleEffect.DISABLE:
1311
+ return !fulfilled;
1312
+ case exports.RuleEffect.ENABLE:
1313
+ return fulfilled;
1314
+ default:
1315
+ return true;
1316
+ }
1317
+ };
1318
+ var hasShowRule = function (uischema) {
1319
+ if (uischema.rule &&
1320
+ (uischema.rule.effect === exports.RuleEffect.SHOW ||
1321
+ uischema.rule.effect === exports.RuleEffect.HIDE)) {
1322
+ return true;
1323
+ }
1324
+ return false;
1325
+ };
1326
+ var hasEnableRule = function (uischema) {
1327
+ if (uischema.rule &&
1328
+ (uischema.rule.effect === exports.RuleEffect.ENABLE ||
1329
+ uischema.rule.effect === exports.RuleEffect.DISABLE)) {
1330
+ return true;
1331
+ }
1332
+ return false;
1333
+ };
1334
+ var isVisible = function (uischema, data, path, ajv) {
1335
+ if (path === void 0) { path = undefined; }
1336
+ if (uischema.rule) {
1337
+ return evalVisibility(uischema, data, path, ajv);
1338
+ }
1339
+ return true;
1340
+ };
1341
+ var isEnabled = function (uischema, data, path, ajv) {
1342
+ if (path === void 0) { path = undefined; }
1343
+ if (uischema.rule) {
1344
+ return evalEnablement(uischema, data, path, ajv);
1345
+ }
1346
+ return true;
1347
+ };
1348
+ var isInherentlyEnabled = function (state, ownProps, uischema, schema, rootData, config) {
1349
+ var _a, _b, _c;
1350
+ if ((_a = state === null || state === void 0 ? void 0 : state.jsonforms) === null || _a === void 0 ? void 0 : _a.readonly) {
1351
+ return false;
1352
+ }
1353
+ if (uischema && hasEnableRule(uischema)) {
1354
+ return isEnabled(uischema, rootData, ownProps === null || ownProps === void 0 ? void 0 : ownProps.path, getAjv(state));
1355
+ }
1356
+ if (typeof ((_b = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _b === void 0 ? void 0 : _b.readonly) === 'boolean') {
1357
+ return !uischema.options.readonly;
1358
+ }
1359
+ if (typeof ((_c = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _c === void 0 ? void 0 : _c.readOnly) === 'boolean') {
1360
+ return !uischema.options.readOnly;
1361
+ }
1362
+ if (typeof (config === null || config === void 0 ? void 0 : config.readonly) === 'boolean') {
1363
+ return !config.readonly;
1364
+ }
1365
+ if (typeof (config === null || config === void 0 ? void 0 : config.readOnly) === 'boolean') {
1366
+ return !config.readOnly;
1367
+ }
1368
+ if ((schema === null || schema === void 0 ? void 0 : schema.readOnly) === true) {
1369
+ return false;
1370
+ }
1371
+ if (typeof (ownProps === null || ownProps === void 0 ? void 0 : ownProps.enabled) === 'boolean') {
1372
+ return ownProps.enabled;
1373
+ }
1374
+ return true;
1375
+ };
1376
+
1377
+ var convertToValidClassName = function (s) {
1378
+ return s.replace('#', 'root').replace(new RegExp('/', 'g'), '_');
1379
+ };
1380
+ var formatErrorMessage = function (errors) {
1381
+ if (errors === undefined || errors === null) {
1382
+ return '';
1383
+ }
1384
+ return errors.join('\n');
1385
+ };
1386
+ var hasType = function (jsonSchema, expected) {
1387
+ return includes__default["default"](deriveTypes(jsonSchema), expected);
1388
+ };
1389
+ var deriveTypes = function (jsonSchema) {
1390
+ if (isEmpty__default["default"](jsonSchema)) {
1391
+ return [];
1392
+ }
1393
+ if (!isEmpty__default["default"](jsonSchema.type) && typeof jsonSchema.type === 'string') {
1394
+ return [jsonSchema.type];
1395
+ }
1396
+ if (isArray__default["default"](jsonSchema.type)) {
1397
+ return jsonSchema.type;
1398
+ }
1399
+ if (!isEmpty__default["default"](jsonSchema.properties) ||
1400
+ !isEmpty__default["default"](jsonSchema.additionalProperties)) {
1401
+ return ['object'];
1402
+ }
1403
+ if (!isEmpty__default["default"](jsonSchema.items)) {
1404
+ return ['array'];
1405
+ }
1406
+ if (!isEmpty__default["default"](jsonSchema.allOf)) {
1407
+ var allOfType = find__default["default"](jsonSchema.allOf, function (schema) { return deriveTypes(schema).length !== 0; });
1408
+ if (allOfType) {
1409
+ return deriveTypes(allOfType);
1410
+ }
1411
+ }
1412
+ return [];
1413
+ };
1414
+ var Resolve = {
1415
+ schema: resolveSchema,
1416
+ data: resolveData
1417
+ };
1418
+ var fromScopable = function (scopable) {
1419
+ return toDataPathSegments(scopable.scope).join('.');
1420
+ };
1421
+ var Paths = {
1422
+ compose: compose,
1423
+ fromScopable: fromScopable
1424
+ };
1425
+ var Runtime = {
1426
+ isEnabled: function (uischema, data, ajv) {
1427
+ return isEnabled(uischema, data, undefined, ajv);
1428
+ },
1429
+ isVisible: function (uischema, data, ajv) {
1430
+ return isVisible(uischema, data, undefined, ajv);
1431
+ }
1432
+ };
1433
+
1434
+ var deriveLabel = function (controlElement, schemaElement) {
1435
+ if (schemaElement && typeof schemaElement.title === 'string') {
1436
+ return schemaElement.title;
1437
+ }
1438
+ if (typeof controlElement.scope === 'string') {
1439
+ var ref = controlElement.scope;
1440
+ var label = decode(ref.substr(ref.lastIndexOf('/') + 1));
1441
+ return startCase__default["default"](label);
1442
+ }
1443
+ return '';
1444
+ };
1445
+ var createCleanLabel = function (label) {
1446
+ return startCase__default["default"](label.replace('_', ' '));
1447
+ };
1448
+ var createLabelDescriptionFrom = function (withLabel, schema) {
1449
+ var labelProperty = withLabel.label;
1450
+ if (typeof labelProperty === 'boolean') {
1451
+ return labelDescription(deriveLabel(withLabel, schema), labelProperty);
1452
+ }
1453
+ if (typeof labelProperty === 'string') {
1454
+ return labelDescription(labelProperty, true);
1455
+ }
1456
+ if (typeof labelProperty === 'object') {
1457
+ var label = typeof labelProperty.text === 'string'
1458
+ ? labelProperty.text
1459
+ : deriveLabel(withLabel, schema);
1460
+ var show = typeof labelProperty.show === 'boolean' ? labelProperty.show : true;
1461
+ return labelDescription(label, show);
1462
+ }
1463
+ return labelDescription(deriveLabel(withLabel, schema), true);
1464
+ };
1465
+ var labelDescription = function (text, show) { return ({
1466
+ text: text,
1467
+ show: show
1468
+ }); };
1469
+
1470
+ var isRequired = function (schema, schemaPath, rootSchema) {
1471
+ var pathSegments = schemaPath.split('/');
1472
+ var lastSegment = pathSegments[pathSegments.length - 1];
1473
+ var nextHigherSchemaSegments = pathSegments.slice(0, pathSegments.length - 2);
1474
+ var nextHigherSchemaPath = nextHigherSchemaSegments.join('/');
1475
+ var nextHigherSchema = Resolve.schema(schema, nextHigherSchemaPath, rootSchema);
1476
+ return (nextHigherSchema !== undefined &&
1477
+ nextHigherSchema.required !== undefined &&
1478
+ nextHigherSchema.required.indexOf(lastSegment) !== -1);
1479
+ };
1480
+ var computeLabel = function (label, required, hideRequiredAsterisk) {
1481
+ return "" + (label !== null && label !== void 0 ? label : '') + (required && !hideRequiredAsterisk ? '*' : '');
1482
+ };
1483
+ var showAsRequired = function (required, hideRequiredAsterisk) {
1484
+ return required && !hideRequiredAsterisk;
1485
+ };
1486
+ var createDefaultValue = function (schema) {
1487
+ switch (schema.type) {
1488
+ case 'string':
1489
+ if (schema.format === 'date-time' ||
1490
+ schema.format === 'date' ||
1491
+ schema.format === 'time') {
1492
+ return new Date();
1493
+ }
1494
+ return '';
1495
+ case 'integer':
1496
+ case 'number':
1497
+ return 0;
1498
+ case 'boolean':
1499
+ return false;
1500
+ case 'array':
1501
+ return [];
1502
+ case 'null':
1503
+ return null;
1504
+ default:
1505
+ return {};
1506
+ }
1507
+ };
1508
+ var isDescriptionHidden = function (visible, description, isFocused, showUnfocusedDescription) {
1509
+ return (description === undefined ||
1510
+ (description !== undefined && !visible) ||
1511
+ (!showUnfocusedDescription && !isFocused));
1512
+ };
1513
+ var enumToEnumOptionMapper = function (e, t, i18nKey) {
1514
+ var label = typeof e === 'string' ? e : JSON.stringify(e);
1515
+ if (t) {
1516
+ if (i18nKey) {
1517
+ label = t(i18nKey + "." + label, label);
1518
+ }
1519
+ else {
1520
+ label = t(label, label);
1521
+ }
1522
+ }
1523
+ return { label: label, value: e };
1524
+ };
1525
+ var oneOfToEnumOptionMapper = function (e, t, fallbackI18nKey) {
1526
+ var _a;
1527
+ var label = (_a = e.title) !== null && _a !== void 0 ? _a : (typeof e.const === 'string' ? e.const : JSON.stringify(e.const));
1528
+ if (t) {
1529
+ if (e.i18n) {
1530
+ label = t(e.i18n, label);
1531
+ }
1532
+ else if (fallbackI18nKey) {
1533
+ label = t(fallbackI18nKey + "." + label, label);
1534
+ }
1535
+ else {
1536
+ label = t(label, label);
1537
+ }
1538
+ }
1539
+ return {
1540
+ label: label,
1541
+ value: e.const,
1542
+ };
1543
+ };
1544
+ var mapStateToControlProps = function (state, ownProps) {
1545
+ var uischema = ownProps.uischema;
1546
+ var rootData = getData(state);
1547
+ var path = composeWithUi(uischema, ownProps.path);
1548
+ var visible = ownProps.visible === undefined || hasShowRule(uischema)
1549
+ ? isVisible(uischema, rootData, ownProps.path, getAjv(state))
1550
+ : ownProps.visible;
1551
+ var controlElement = uischema;
1552
+ var id = ownProps.id;
1553
+ var rootSchema = getSchema(state);
1554
+ var required = controlElement.scope !== undefined &&
1555
+ isRequired(ownProps.schema, controlElement.scope, rootSchema);
1556
+ var resolvedSchema = Resolve.schema(ownProps.schema || rootSchema, controlElement.scope, rootSchema);
1557
+ var errors = getErrorAt(path, resolvedSchema)(state);
1558
+ var description = resolvedSchema !== undefined ? resolvedSchema.description : '';
1559
+ var data = Resolve.data(rootData, path);
1560
+ var labelDesc = createLabelDescriptionFrom(uischema, resolvedSchema);
1561
+ var label = labelDesc.show ? labelDesc.text : '';
1562
+ var config = getConfig(state);
1563
+ var enabled = isInherentlyEnabled(state, ownProps, uischema, resolvedSchema || rootSchema, rootData, config);
1564
+ var schema = resolvedSchema !== null && resolvedSchema !== void 0 ? resolvedSchema : rootSchema;
1565
+ var t = getTranslator()(state);
1566
+ var te = getErrorTranslator()(state);
1567
+ var i18nLabel = t(getI18nKey(schema, uischema, path, 'label'), label);
1568
+ var i18nDescription = t(getI18nKey(schema, uischema, path, 'description'), description);
1569
+ var i18nErrorMessage = getCombinedErrorMessage(errors, te, t, schema, uischema, path);
1570
+ return {
1571
+ data: data,
1572
+ description: i18nDescription,
1573
+ errors: i18nErrorMessage,
1574
+ label: i18nLabel,
1575
+ visible: visible,
1576
+ enabled: enabled,
1577
+ id: id,
1578
+ path: path,
1579
+ required: required,
1580
+ uischema: uischema,
1581
+ schema: schema,
1582
+ config: getConfig(state),
1583
+ cells: ownProps.cells || state.jsonforms.cells,
1584
+ rootSchema: rootSchema
1585
+ };
1586
+ };
1587
+ var mapDispatchToControlProps = function (dispatch) { return ({
1588
+ handleChange: function (path, value) {
1589
+ dispatch(update(path, function () { return value; }));
1590
+ }
1591
+ }); };
1592
+ var mapStateToEnumControlProps = function (state, ownProps) {
1593
+ var _a;
1594
+ var props = mapStateToControlProps(state, ownProps);
1595
+ var options = ownProps.options ||
1596
+ ((_a = props.schema.enum) === null || _a === void 0 ? void 0 : _a.map(function (e) {
1597
+ return enumToEnumOptionMapper(e, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path));
1598
+ })) ||
1599
+ (props.schema.const && [
1600
+ enumToEnumOptionMapper(props.schema.const, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))
1601
+ ]);
1602
+ return __assign(__assign({}, props), { options: options });
1603
+ };
1604
+ var mapStateToOneOfEnumControlProps = function (state, ownProps) {
1605
+ var _a;
1606
+ var props = mapStateToControlProps(state, ownProps);
1607
+ var options = ownProps.options ||
1608
+ ((_a = props.schema.oneOf) === null || _a === void 0 ? void 0 : _a.map(function (oneOfSubSchema) {
1609
+ return oneOfToEnumOptionMapper(oneOfSubSchema, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path));
1610
+ }));
1611
+ return __assign(__assign({}, props), { options: options });
1612
+ };
1613
+ var mapStateToMultiEnumControlProps = function (state, ownProps) {
1614
+ var _a;
1615
+ var props = mapStateToControlProps(state, ownProps);
1616
+ var items = props.schema.items;
1617
+ var options = ownProps.options ||
1618
+ ((items === null || items === void 0 ? void 0 : items.oneOf) &&
1619
+ items.oneOf.map(function (oneOfSubSchema) {
1620
+ var _a;
1621
+ return oneOfToEnumOptionMapper(oneOfSubSchema, (_a = state.jsonforms.i18n) === null || _a === void 0 ? void 0 : _a.translate, getI18nKeyPrefix(props.schema, props.uischema, props.path));
1622
+ })) ||
1623
+ ((_a = items === null || items === void 0 ? void 0 : items.enum) === null || _a === void 0 ? void 0 : _a.map(function (e) {
1624
+ var _a;
1625
+ return enumToEnumOptionMapper(e, (_a = state.jsonforms.i18n) === null || _a === void 0 ? void 0 : _a.translate, getI18nKeyPrefix(props.schema, props.uischema, props.path));
1626
+ }));
1627
+ return __assign(__assign({}, props), { options: options });
1628
+ };
1629
+ var mapStateToMasterListItemProps = function (state, ownProps) {
1630
+ var schema = ownProps.schema, path = ownProps.path, index = ownProps.index;
1631
+ var firstPrimitiveProp = schema.properties
1632
+ ? find__default["default"](Object.keys(schema.properties), function (propName) {
1633
+ var prop = schema.properties[propName];
1634
+ return (prop.type === 'string' ||
1635
+ prop.type === 'number' ||
1636
+ prop.type === 'integer');
1637
+ })
1638
+ : undefined;
1639
+ var childPath = compose(path, "" + index);
1640
+ var childData = Resolve.data(getData(state), childPath);
1641
+ var childLabel = firstPrimitiveProp ? childData[firstPrimitiveProp] : '';
1642
+ return __assign(__assign({}, ownProps), { childLabel: childLabel });
1643
+ };
1644
+ var mapStateToControlWithDetailProps = function (state, ownProps) {
1645
+ var props = __rest(mapStateToControlProps(state, ownProps), []);
1646
+ return __assign(__assign({}, props), { uischemas: state.jsonforms.uischemas });
1647
+ };
1648
+ var mapStateToArrayControlProps = function (state, ownProps) {
1649
+ var _a = mapStateToControlWithDetailProps(state, ownProps), path = _a.path, schema = _a.schema, uischema = _a.uischema, props = __rest(_a, ["path", "schema", "uischema"]);
1650
+ var resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);
1651
+ var childErrors = getSubErrorsAt(path, resolvedSchema)(state);
1652
+ return __assign(__assign({}, props), { path: path,
1653
+ uischema: uischema, schema: resolvedSchema, childErrors: childErrors, renderers: ownProps.renderers || getRenderers(state), cells: ownProps.cells || getCells(state) });
1654
+ };
1655
+ var mapDispatchToArrayControlProps = function (dispatch) { return ({
1656
+ addItem: function (path, value) { return function () {
1657
+ dispatch(update(path, function (array) {
1658
+ if (array === undefined || array === null) {
1659
+ return [value];
1660
+ }
1661
+ array.push(value);
1662
+ return array;
1663
+ }));
1664
+ }; },
1665
+ removeItems: function (path, toDelete) { return function () {
1666
+ dispatch(update(path, function (array) {
1667
+ toDelete
1668
+ .sort()
1669
+ .reverse()
1670
+ .forEach(function (s) { return array.splice(s, 1); });
1671
+ return array;
1672
+ }));
1673
+ }; },
1674
+ moveUp: function (path, toMove) { return function () {
1675
+ dispatch(update(path, function (array) {
1676
+ moveUp(array, toMove);
1677
+ return array;
1678
+ }));
1679
+ }; },
1680
+ moveDown: function (path, toMove) { return function () {
1681
+ dispatch(update(path, function (array) {
1682
+ moveDown(array, toMove);
1683
+ return array;
1684
+ }));
1685
+ }; }
1686
+ }); };
1687
+ var mapDispatchToMultiEnumProps = function (dispatch) { return ({
1688
+ addItem: function (path, value) {
1689
+ dispatch(update(path, function (data) {
1690
+ if (data === undefined || data === null) {
1691
+ return [value];
1692
+ }
1693
+ data.push(value);
1694
+ return data;
1695
+ }));
1696
+ },
1697
+ removeItem: function (path, toDelete) {
1698
+ dispatch(update(path, function (data) {
1699
+ var indexInData = data.indexOf(toDelete);
1700
+ data.splice(indexInData, 1);
1701
+ return data;
1702
+ }));
1703
+ }
1704
+ }); };
1705
+ var layoutDefaultProps = {
1706
+ visible: true,
1707
+ enabled: true,
1708
+ path: '',
1709
+ direction: 'column'
1710
+ };
1711
+ var getDirection = function (uischema) {
1712
+ if (uischema.type === 'HorizontalLayout') {
1713
+ return 'row';
1714
+ }
1715
+ if (uischema.type === 'VerticalLayout') {
1716
+ return 'column';
1717
+ }
1718
+ return layoutDefaultProps.direction;
1719
+ };
1720
+ var mapStateToLayoutProps = function (state, ownProps) {
1721
+ var _a;
1722
+ var rootData = getData(state);
1723
+ var uischema = ownProps.uischema;
1724
+ var visible = ownProps.visible === undefined || hasShowRule(uischema)
1725
+ ? isVisible(ownProps.uischema, rootData, ownProps.path, getAjv(state))
1726
+ : ownProps.visible;
1727
+ var data = Resolve.data(rootData, ownProps.path);
1728
+ var config = getConfig(state);
1729
+ var enabled = isInherentlyEnabled(state, ownProps, uischema, undefined,
1730
+ rootData, config);
1731
+ return __assign(__assign({}, layoutDefaultProps), { renderers: ownProps.renderers || getRenderers(state), cells: ownProps.cells || getCells(state), visible: visible,
1732
+ enabled: enabled, path: ownProps.path, data: data, uischema: ownProps.uischema, schema: ownProps.schema, direction: (_a = ownProps.direction) !== null && _a !== void 0 ? _a : getDirection(uischema), config: config });
1733
+ };
1734
+ var mapStateToJsonFormsRendererProps = function (state, ownProps) {
1735
+ var uischema = ownProps.uischema;
1736
+ if (uischema === undefined) {
1737
+ if (ownProps.schema) {
1738
+ uischema = findUISchema(state.jsonforms.uischemas, ownProps.schema, undefined, ownProps.path);
1739
+ }
1740
+ else {
1741
+ uischema = getUiSchema(state);
1742
+ }
1743
+ }
1744
+ return {
1745
+ renderers: ownProps.renderers || get__default["default"](state.jsonforms, 'renderers') || [],
1746
+ cells: ownProps.cells || get__default["default"](state.jsonforms, 'cells') || [],
1747
+ schema: ownProps.schema || getSchema(state),
1748
+ rootSchema: getSchema(state),
1749
+ uischema: uischema,
1750
+ path: ownProps.path
1751
+ };
1752
+ };
1753
+ var controlDefaultProps = __assign(__assign({}, layoutDefaultProps), { errors: [] });
1754
+ var mapStateToCombinatorRendererProps = function (state, ownProps, keyword) {
1755
+ var _a;
1756
+ var _b = mapStateToControlProps(state, ownProps), data = _b.data, schema = _b.schema, props = __rest(_b, ["data", "schema"]);
1757
+ var ajv = state.jsonforms.core.ajv;
1758
+ var structuralKeywords = [
1759
+ 'required',
1760
+ 'additionalProperties',
1761
+ 'type',
1762
+ 'enum',
1763
+ 'const'
1764
+ ];
1765
+ var dataIsValid = function (errors) {
1766
+ return (!errors ||
1767
+ errors.length === 0 ||
1768
+ !errors.find(function (e) { return structuralKeywords.indexOf(e.keyword) !== -1; }));
1769
+ };
1770
+ var indexOfFittingSchema;
1771
+ for (var i = 0; i < ((_a = schema[keyword]) === null || _a === void 0 ? void 0 : _a.length); i++) {
1772
+ try {
1773
+ var valFn = ajv.compile(schema[keyword][i]);
1774
+ valFn(data);
1775
+ if (dataIsValid(valFn.errors)) {
1776
+ indexOfFittingSchema = i;
1777
+ break;
1778
+ }
1779
+ }
1780
+ catch (error) {
1781
+ console.debug("Combinator subschema is not self contained, can't hand it over to AJV");
1782
+ }
1783
+ }
1784
+ return __assign(__assign({ data: data,
1785
+ schema: schema }, props), { indexOfFittingSchema: indexOfFittingSchema, uischemas: getUISchemas(state) });
1786
+ };
1787
+ var mapStateToAllOfProps = function (state, ownProps) {
1788
+ return mapStateToCombinatorRendererProps(state, ownProps, 'allOf');
1789
+ };
1790
+ var mapStateToAnyOfProps = function (state, ownProps) {
1791
+ return mapStateToCombinatorRendererProps(state, ownProps, 'anyOf');
1792
+ };
1793
+ var mapStateToOneOfProps = function (state, ownProps) {
1794
+ return mapStateToCombinatorRendererProps(state, ownProps, 'oneOf');
1795
+ };
1796
+ var mapStateToArrayLayoutProps = function (state, ownProps) {
1797
+ var _a = mapStateToControlWithDetailProps(state, ownProps), path = _a.path, schema = _a.schema, uischema = _a.uischema, errors = _a.errors, props = __rest(_a, ["path", "schema", "uischema", "errors"]);
1798
+ var resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);
1799
+ var childErrors = getCombinedErrorMessage(getSubErrorsAt(path, resolvedSchema)(state), getErrorTranslator()(state), getTranslator()(state), undefined, undefined, undefined);
1800
+ var allErrors = errors +
1801
+ (errors.length > 0 && childErrors.length > 0 ? '\n' : '') +
1802
+ childErrors;
1803
+ return __assign(__assign({}, props), { path: path,
1804
+ uischema: uischema, schema: resolvedSchema, data: props.data ? props.data.length : 0, errors: allErrors, minItems: schema.minItems });
1805
+ };
1806
+
1807
+ var mapStateToCellProps = function (state, ownProps) {
1808
+ var id = ownProps.id, schema = ownProps.schema, path = ownProps.path, uischema = ownProps.uischema, renderers = ownProps.renderers, cells = ownProps.cells;
1809
+ var rootData = getData(state);
1810
+ var visible = ownProps.visible !== undefined
1811
+ ? ownProps.visible
1812
+ : isVisible(uischema, rootData, undefined, getAjv(state));
1813
+ var rootSchema = getSchema(state);
1814
+ var config = getConfig(state);
1815
+ var enabled;
1816
+ if (state.jsonforms.readonly === true) {
1817
+ enabled = false;
1818
+ }
1819
+ else if (typeof ownProps.enabled === 'boolean') {
1820
+ enabled = ownProps.enabled;
1821
+ }
1822
+ else {
1823
+ enabled = isInherentlyEnabled(state, ownProps, uischema, schema || rootSchema, rootData, config);
1824
+ }
1825
+ var errors = formatErrorMessage(union__default["default"](getErrorAt(path, schema)(state).map(function (error) { return error.message; })));
1826
+ var isValid = isEmpty__default["default"](errors);
1827
+ return {
1828
+ data: Resolve.data(rootData, path),
1829
+ visible: visible,
1830
+ enabled: enabled,
1831
+ id: id,
1832
+ path: path,
1833
+ errors: errors,
1834
+ isValid: isValid,
1835
+ schema: schema,
1836
+ uischema: uischema,
1837
+ config: getConfig(state),
1838
+ rootSchema: rootSchema,
1839
+ renderers: renderers,
1840
+ cells: cells
1841
+ };
1842
+ };
1843
+ var mapStateToDispatchCellProps = function (state, ownProps) {
1844
+ var props = mapStateToCellProps(state, ownProps);
1845
+ ownProps.renderers; var cells = ownProps.cells, otherOwnProps = __rest(ownProps, ["renderers", "cells"]);
1846
+ return __assign(__assign(__assign({}, props), otherOwnProps), { cells: cells || state.jsonforms.cells || [] });
1847
+ };
1848
+ var defaultMapStateToEnumCellProps = function (state, ownProps) {
1849
+ var _a;
1850
+ var props = mapStateToCellProps(state, ownProps);
1851
+ var options = ownProps.options ||
1852
+ ((_a = props.schema.enum) === null || _a === void 0 ? void 0 : _a.map(function (e) {
1853
+ return enumToEnumOptionMapper(e, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path));
1854
+ })) ||
1855
+ (props.schema.const && [
1856
+ enumToEnumOptionMapper(props.schema.const, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))
1857
+ ]);
1858
+ return __assign(__assign({}, props), { options: options });
1859
+ };
1860
+ var mapStateToOneOfEnumCellProps = function (state, ownProps) {
1861
+ var _a;
1862
+ var props = mapStateToCellProps(state, ownProps);
1863
+ var options = ownProps.options ||
1864
+ ((_a = props.schema.oneOf) === null || _a === void 0 ? void 0 : _a.map(function (oneOfSubSchema) {
1865
+ return oneOfToEnumOptionMapper(oneOfSubSchema, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path));
1866
+ }));
1867
+ return __assign(__assign({}, props), { options: options });
1868
+ };
1869
+ var mapDispatchToCellProps = mapDispatchToControlProps;
1870
+ var defaultMapDispatchToControlProps =
1871
+ function (dispatch, ownProps) {
1872
+ var handleChange = mapDispatchToCellProps(dispatch).handleChange;
1873
+ return {
1874
+ handleChange: ownProps.handleChange || handleChange
1875
+ };
1876
+ };
1877
+
1878
+ var createLabel = function (subSchema, subSchemaIndex, keyword) {
1879
+ if (subSchema.title) {
1880
+ return subSchema.title;
1881
+ }
1882
+ else {
1883
+ return keyword + '-' + subSchemaIndex;
1884
+ }
1885
+ };
1886
+ var createCombinatorRenderInfos = function (combinatorSubSchemas, rootSchema, keyword, control, path, uischemas) {
1887
+ return combinatorSubSchemas.map(function (subSchema, subSchemaIndex) {
1888
+ var schema = subSchema.$ref ? Resolve.schema(rootSchema, subSchema.$ref, rootSchema) : subSchema;
1889
+ return {
1890
+ schema: schema,
1891
+ uischema: findUISchema(uischemas, schema, control.scope, path, undefined, control, rootSchema),
1892
+ label: createLabel(subSchema, subSchemaIndex, keyword)
1893
+ };
1894
+ });
1895
+ };
1896
+
1897
+ var usedIds = new Set();
1898
+ var makeId = function (idBase, iteration) {
1899
+ return iteration <= 1 ? idBase : idBase + iteration.toString();
1900
+ };
1901
+ var isUniqueId = function (idBase, iteration) {
1902
+ var newID = makeId(idBase, iteration);
1903
+ return !usedIds.has(newID);
1904
+ };
1905
+ var createId = function (proposedId) {
1906
+ if (proposedId === undefined) {
1907
+ proposedId = 'undefined';
1908
+ }
1909
+ var tries = 0;
1910
+ while (!isUniqueId(proposedId, tries)) {
1911
+ tries++;
1912
+ }
1913
+ var newID = makeId(proposedId, tries);
1914
+ usedIds.add(newID);
1915
+ return newID;
1916
+ };
1917
+ var removeId = function (id) { return usedIds.delete(id); };
1918
+ var clearAllIds = function () { return usedIds.clear(); };
1919
+
1920
+ var getFirstPrimitiveProp = function (schema) {
1921
+ if (schema.properties) {
1922
+ return find__default["default"](Object.keys(schema.properties), function (propName) {
1923
+ var prop = schema.properties[propName];
1924
+ return (prop.type === 'string' ||
1925
+ prop.type === 'number' ||
1926
+ prop.type === 'integer');
1927
+ });
1928
+ }
1929
+ return undefined;
1930
+ };
1931
+
1932
+ var setReadonlyPropertyValue = function (value) { return function (child) {
1933
+ if (!child.options) {
1934
+ child.options = {};
1935
+ }
1936
+ child.options.readonly = value;
1937
+ }; };
1938
+ var setReadonly = function (uischema) {
1939
+ iterateSchema(uischema, setReadonlyPropertyValue(true));
1940
+ };
1941
+ var unsetReadonly = function (uischema) {
1942
+ iterateSchema(uischema, setReadonlyPropertyValue(false));
1943
+ };
1944
+ var iterateSchema = function (uischema, toApply) {
1945
+ if (isEmpty__default["default"](uischema)) {
1946
+ return;
1947
+ }
1948
+ if (isLayout(uischema)) {
1949
+ uischema.elements.forEach(function (child) { return iterateSchema(child, toApply); });
1950
+ return;
1951
+ }
1952
+ toApply(uischema);
1953
+ };
1954
+
1955
+ var createAjv = function (options) {
1956
+ var ajv = new Ajv__default["default"](__assign({ allErrors: true, verbose: true, strict: false }, options));
1957
+ addFormats__default["default"](ajv);
1958
+ return ajv;
1959
+ };
1960
+
1961
+ var createLayout = function (layoutType) { return ({
1962
+ type: layoutType,
1963
+ elements: []
1964
+ }); };
1965
+ var createControlElement = function (ref) { return ({
1966
+ type: 'Control',
1967
+ scope: ref
1968
+ }); };
1969
+ var wrapInLayoutIfNecessary = function (uischema, layoutType) {
1970
+ if (!isEmpty__default["default"](uischema) && !isLayout(uischema)) {
1971
+ var verticalLayout = createLayout(layoutType);
1972
+ verticalLayout.elements.push(uischema);
1973
+ return verticalLayout;
1974
+ }
1975
+ return uischema;
1976
+ };
1977
+ var addLabel = function (layout, labelName) {
1978
+ if (!isEmpty__default["default"](labelName)) {
1979
+ var fixedLabel = startCase__default["default"](labelName);
1980
+ if (isGroup(layout)) {
1981
+ layout.label = fixedLabel;
1982
+ }
1983
+ else {
1984
+ var label = {
1985
+ type: 'Label',
1986
+ text: fixedLabel
1987
+ };
1988
+ layout.elements.push(label);
1989
+ }
1990
+ }
1991
+ };
1992
+ var isCombinator = function (jsonSchema) {
1993
+ return (!isEmpty__default["default"](jsonSchema) &&
1994
+ (!isEmpty__default["default"](jsonSchema.oneOf) ||
1995
+ !isEmpty__default["default"](jsonSchema.anyOf) ||
1996
+ !isEmpty__default["default"](jsonSchema.allOf)));
1997
+ };
1998
+ var generateUISchema = function (jsonSchema, schemaElements, currentRef, schemaName, layoutType, rootSchema) {
1999
+ if (!isEmpty__default["default"](jsonSchema) && jsonSchema.$ref !== undefined) {
2000
+ return generateUISchema(resolveSchema(rootSchema, jsonSchema.$ref, rootSchema), schemaElements, currentRef, schemaName, layoutType, rootSchema);
2001
+ }
2002
+ if (isCombinator(jsonSchema)) {
2003
+ var controlObject = createControlElement(currentRef);
2004
+ schemaElements.push(controlObject);
2005
+ return controlObject;
2006
+ }
2007
+ var types = deriveTypes(jsonSchema);
2008
+ if (types.length === 0) {
2009
+ return null;
2010
+ }
2011
+ if (types.length > 1) {
2012
+ var controlObject = createControlElement(currentRef);
2013
+ schemaElements.push(controlObject);
2014
+ return controlObject;
2015
+ }
2016
+ if (currentRef === '#' && types[0] === 'object') {
2017
+ var layout_1 = createLayout(layoutType);
2018
+ schemaElements.push(layout_1);
2019
+ if (jsonSchema.properties && keys__default["default"](jsonSchema.properties).length > 1) {
2020
+ addLabel(layout_1, schemaName);
2021
+ }
2022
+ if (!isEmpty__default["default"](jsonSchema.properties)) {
2023
+ var nextRef_1 = currentRef + '/properties';
2024
+ Object.keys(jsonSchema.properties).map(function (propName) {
2025
+ var value = jsonSchema.properties[propName];
2026
+ var ref = nextRef_1 + "/" + encode(propName);
2027
+ if (value.$ref !== undefined) {
2028
+ value = resolveSchema(rootSchema, value.$ref, rootSchema);
2029
+ }
2030
+ generateUISchema(value, layout_1.elements, ref, propName, layoutType, rootSchema);
2031
+ });
2032
+ }
2033
+ return layout_1;
2034
+ }
2035
+ switch (types[0]) {
2036
+ case 'object':
2037
+ case 'array':
2038
+ case 'string':
2039
+ case 'number':
2040
+ case 'integer':
2041
+ case 'boolean':
2042
+ var controlObject = createControlElement(currentRef);
2043
+ schemaElements.push(controlObject);
2044
+ return controlObject;
2045
+ default:
2046
+ throw new Error('Unknown type: ' + JSON.stringify(jsonSchema));
2047
+ }
2048
+ };
2049
+ var generateDefaultUISchema = function (jsonSchema, layoutType, prefix, rootSchema) {
2050
+ if (layoutType === void 0) { layoutType = 'VerticalLayout'; }
2051
+ if (prefix === void 0) { prefix = '#'; }
2052
+ if (rootSchema === void 0) { rootSchema = jsonSchema; }
2053
+ return wrapInLayoutIfNecessary(generateUISchema(jsonSchema, [], prefix, '', layoutType, rootSchema), layoutType);
2054
+ };
2055
+
2056
+ var Generate = {
2057
+ jsonSchema: generateJsonSchema,
2058
+ uiSchema: generateDefaultUISchema,
2059
+ controlElement: createControlElement
2060
+ };
2061
+
2062
+ var INIT = 'jsonforms/INIT';
2063
+ var UPDATE_CORE = "jsonforms/UPDATE_CORE";
2064
+ var SET_AJV = 'jsonforms/SET_AJV';
2065
+ var UPDATE_DATA = 'jsonforms/UPDATE';
2066
+ var UPDATE_ERRORS = 'jsonforms/UPDATE_ERRORS';
2067
+ var VALIDATE = 'jsonforms/VALIDATE';
2068
+ var ADD_RENDERER = 'jsonforms/ADD_RENDERER';
2069
+ var REMOVE_RENDERER = 'jsonforms/REMOVE_RENDERER';
2070
+ var ADD_CELL = 'jsonforms/ADD_CELL';
2071
+ var REMOVE_CELL = 'jsonforms/REMOVE_CELL';
2072
+ var SET_CONFIG = 'jsonforms/SET_CONFIG';
2073
+ var ADD_UI_SCHEMA = "jsonforms/ADD_UI_SCHEMA";
2074
+ var REMOVE_UI_SCHEMA = "jsonforms/REMOVE_UI_SCHEMA";
2075
+ var SET_SCHEMA = "jsonforms/SET_SCHEMA";
2076
+ var SET_UISCHEMA = "jsonforms/SET_UISCHEMA";
2077
+ var SET_VALIDATION_MODE = 'jsonforms/SET_VALIDATION_MODE';
2078
+ var SET_LOCALE = "jsonforms/SET_LOCALE";
2079
+ var SET_TRANSLATOR = 'jsonforms/SET_TRANSLATOR';
2080
+ var UPDATE_I18N = 'jsonforms/UPDATE_I18N';
2081
+ var ADD_DEFAULT_DATA = "jsonforms/ADD_DEFAULT_DATA";
2082
+ var REMOVE_DEFAULT_DATA = "jsonforms/REMOVE_DEFAULT_DATA";
2083
+ var init = function (data, schema, uischema, options) {
2084
+ if (schema === void 0) { schema = generateJsonSchema(data); }
2085
+ return ({
2086
+ type: INIT,
2087
+ data: data,
2088
+ schema: schema,
2089
+ uischema: typeof uischema === 'object' ? uischema : generateDefaultUISchema(schema),
2090
+ options: options
2091
+ });
2092
+ };
2093
+ var updateCore = function (data, schema, uischema, options) { return ({
2094
+ type: UPDATE_CORE,
2095
+ data: data,
2096
+ schema: schema,
2097
+ uischema: uischema,
2098
+ options: options
2099
+ }); };
2100
+ var registerDefaultData = function (schemaPath, data) { return ({
2101
+ type: ADD_DEFAULT_DATA,
2102
+ schemaPath: schemaPath,
2103
+ data: data
2104
+ }); };
2105
+ var unregisterDefaultData = function (schemaPath) { return ({
2106
+ type: REMOVE_DEFAULT_DATA,
2107
+ schemaPath: schemaPath
2108
+ }); };
2109
+ var setAjv = function (ajv) { return ({
2110
+ type: SET_AJV,
2111
+ ajv: ajv
2112
+ }); };
2113
+ var update = function (path, updater) { return ({
2114
+ type: UPDATE_DATA,
2115
+ path: path,
2116
+ updater: updater
2117
+ }); };
2118
+ var updateErrors = function (errors) { return ({
2119
+ type: UPDATE_ERRORS,
2120
+ errors: errors
2121
+ }); };
2122
+ var registerRenderer = function (tester, renderer) { return ({
2123
+ type: ADD_RENDERER,
2124
+ tester: tester,
2125
+ renderer: renderer
2126
+ }); };
2127
+ var registerCell = function (tester, cell) { return ({
2128
+ type: ADD_CELL,
2129
+ tester: tester,
2130
+ cell: cell
2131
+ }); };
2132
+ var unregisterCell = function (tester, cell) { return ({
2133
+ type: REMOVE_CELL,
2134
+ tester: tester,
2135
+ cell: cell
2136
+ }); };
2137
+ var unregisterRenderer = function (tester, renderer) { return ({
2138
+ type: REMOVE_RENDERER,
2139
+ tester: tester,
2140
+ renderer: renderer
2141
+ }); };
2142
+ var setConfig = function (config) { return ({
2143
+ type: SET_CONFIG,
2144
+ config: config
2145
+ }); };
2146
+ var setValidationMode = function (validationMode) { return ({
2147
+ type: SET_VALIDATION_MODE,
2148
+ validationMode: validationMode
2149
+ }); };
2150
+ var registerUISchema = function (tester, uischema) {
2151
+ return {
2152
+ type: ADD_UI_SCHEMA,
2153
+ tester: tester,
2154
+ uischema: uischema
2155
+ };
2156
+ };
2157
+ var unregisterUISchema = function (tester) {
2158
+ return {
2159
+ type: REMOVE_UI_SCHEMA,
2160
+ tester: tester
2161
+ };
2162
+ };
2163
+ var setLocale = function (locale) { return ({
2164
+ type: SET_LOCALE,
2165
+ locale: locale
2166
+ }); };
2167
+ var setSchema = function (schema) { return ({
2168
+ type: SET_SCHEMA,
2169
+ schema: schema
2170
+ }); };
2171
+ var setTranslator = function (translator, errorTranslator) { return ({
2172
+ type: SET_TRANSLATOR,
2173
+ translator: translator,
2174
+ errorTranslator: errorTranslator
2175
+ }); };
2176
+ var updateI18n = function (locale, translator, errorTranslator) { return ({
2177
+ type: UPDATE_I18N,
2178
+ locale: locale,
2179
+ translator: translator,
2180
+ errorTranslator: errorTranslator
2181
+ }); };
2182
+ var setUISchema = function (uischema) { return ({
2183
+ type: SET_UISCHEMA,
2184
+ uischema: uischema
2185
+ }); };
2186
+
2187
+ var index = /*#__PURE__*/Object.freeze({
2188
+ __proto__: null,
2189
+ INIT: INIT,
2190
+ UPDATE_CORE: UPDATE_CORE,
2191
+ SET_AJV: SET_AJV,
2192
+ UPDATE_DATA: UPDATE_DATA,
2193
+ UPDATE_ERRORS: UPDATE_ERRORS,
2194
+ VALIDATE: VALIDATE,
2195
+ ADD_RENDERER: ADD_RENDERER,
2196
+ REMOVE_RENDERER: REMOVE_RENDERER,
2197
+ ADD_CELL: ADD_CELL,
2198
+ REMOVE_CELL: REMOVE_CELL,
2199
+ SET_CONFIG: SET_CONFIG,
2200
+ ADD_UI_SCHEMA: ADD_UI_SCHEMA,
2201
+ REMOVE_UI_SCHEMA: REMOVE_UI_SCHEMA,
2202
+ SET_SCHEMA: SET_SCHEMA,
2203
+ SET_UISCHEMA: SET_UISCHEMA,
2204
+ SET_VALIDATION_MODE: SET_VALIDATION_MODE,
2205
+ SET_LOCALE: SET_LOCALE,
2206
+ SET_TRANSLATOR: SET_TRANSLATOR,
2207
+ UPDATE_I18N: UPDATE_I18N,
2208
+ ADD_DEFAULT_DATA: ADD_DEFAULT_DATA,
2209
+ REMOVE_DEFAULT_DATA: REMOVE_DEFAULT_DATA,
2210
+ init: init,
2211
+ updateCore: updateCore,
2212
+ registerDefaultData: registerDefaultData,
2213
+ unregisterDefaultData: unregisterDefaultData,
2214
+ setAjv: setAjv,
2215
+ update: update,
2216
+ updateErrors: updateErrors,
2217
+ registerRenderer: registerRenderer,
2218
+ registerCell: registerCell,
2219
+ unregisterCell: unregisterCell,
2220
+ unregisterRenderer: unregisterRenderer,
2221
+ setConfig: setConfig,
2222
+ setValidationMode: setValidationMode,
2223
+ registerUISchema: registerUISchema,
2224
+ unregisterUISchema: unregisterUISchema,
2225
+ setLocale: setLocale,
2226
+ setSchema: setSchema,
2227
+ setTranslator: setTranslator,
2228
+ updateI18n: updateI18n,
2229
+ setUISchema: setUISchema
2230
+ });
2231
+
2232
+ var Helpers = {
2233
+ createLabelDescriptionFrom: createLabelDescriptionFrom,
2234
+ convertToValidClassName: convertToValidClassName
2235
+ };
2236
+
2237
+ exports.ADD_CELL = ADD_CELL;
2238
+ exports.ADD_DEFAULT_DATA = ADD_DEFAULT_DATA;
2239
+ exports.ADD_RENDERER = ADD_RENDERER;
2240
+ exports.ADD_UI_SCHEMA = ADD_UI_SCHEMA;
2241
+ exports.Actions = index;
2242
+ exports.Draft4 = Draft4;
2243
+ exports.Generate = Generate;
2244
+ exports.Helpers = Helpers;
2245
+ exports.INIT = INIT;
2246
+ exports.NOT_APPLICABLE = NOT_APPLICABLE;
2247
+ exports.Paths = Paths;
2248
+ exports.REMOVE_CELL = REMOVE_CELL;
2249
+ exports.REMOVE_DEFAULT_DATA = REMOVE_DEFAULT_DATA;
2250
+ exports.REMOVE_RENDERER = REMOVE_RENDERER;
2251
+ exports.REMOVE_UI_SCHEMA = REMOVE_UI_SCHEMA;
2252
+ exports.Resolve = Resolve;
2253
+ exports.Runtime = Runtime;
2254
+ exports.SET_AJV = SET_AJV;
2255
+ exports.SET_CONFIG = SET_CONFIG;
2256
+ exports.SET_LOCALE = SET_LOCALE;
2257
+ exports.SET_SCHEMA = SET_SCHEMA;
2258
+ exports.SET_TRANSLATOR = SET_TRANSLATOR;
2259
+ exports.SET_UISCHEMA = SET_UISCHEMA;
2260
+ exports.SET_VALIDATION_MODE = SET_VALIDATION_MODE;
2261
+ exports.Test = index$1;
2262
+ exports.UPDATE_CORE = UPDATE_CORE;
2263
+ exports.UPDATE_DATA = UPDATE_DATA;
2264
+ exports.UPDATE_ERRORS = UPDATE_ERRORS;
2265
+ exports.UPDATE_I18N = UPDATE_I18N;
2266
+ exports.VALIDATE = VALIDATE;
2267
+ exports.and = and;
2268
+ exports.categorizationHasCategory = categorizationHasCategory;
2269
+ exports.cellReducer = cellReducer;
2270
+ exports.clearAllIds = clearAllIds;
2271
+ exports.compose = compose;
2272
+ exports.composePaths = compose;
2273
+ exports.composeWithUi = composeWithUi;
2274
+ exports.computeLabel = computeLabel;
2275
+ exports.configReducer = configReducer;
2276
+ exports.controlDefaultProps = controlDefaultProps;
2277
+ exports.convertToValidClassName = convertToValidClassName;
2278
+ exports.coreReducer = coreReducer;
2279
+ exports.createAjv = createAjv;
2280
+ exports.createCleanLabel = createCleanLabel;
2281
+ exports.createCombinatorRenderInfos = createCombinatorRenderInfos;
2282
+ exports.createControlElement = createControlElement;
2283
+ exports.createDefaultValue = createDefaultValue;
2284
+ exports.createId = createId;
2285
+ exports.createLabelDescriptionFrom = createLabelDescriptionFrom;
2286
+ exports.decode = decode;
2287
+ exports.defaultDataReducer = defaultDataReducer;
2288
+ exports.defaultErrorTranslator = defaultErrorTranslator;
2289
+ exports.defaultJsonFormsI18nState = defaultJsonFormsI18nState;
2290
+ exports.defaultMapDispatchToControlProps = defaultMapDispatchToControlProps;
2291
+ exports.defaultMapStateToEnumCellProps = defaultMapStateToEnumCellProps;
2292
+ exports.defaultTranslator = defaultTranslator;
2293
+ exports.deriveTypes = deriveTypes;
2294
+ exports.encode = encode;
2295
+ exports.enumToEnumOptionMapper = enumToEnumOptionMapper;
2296
+ exports.errorAt = errorAt;
2297
+ exports.errorsAt = errorsAt;
2298
+ exports.evalEnablement = evalEnablement;
2299
+ exports.evalVisibility = evalVisibility;
2300
+ exports.extractAjv = extractAjv;
2301
+ exports.extractData = extractData;
2302
+ exports.extractDefaultData = extractDefaultData;
2303
+ exports.extractSchema = extractSchema;
2304
+ exports.extractUiSchema = extractUiSchema;
2305
+ exports.fetchErrorTranslator = fetchErrorTranslator;
2306
+ exports.fetchLocale = fetchLocale;
2307
+ exports.fetchTranslator = fetchTranslator;
2308
+ exports.findAllRefs = findAllRefs;
2309
+ exports.findMatchingUISchema = findMatchingUISchema;
2310
+ exports.findUISchema = findUISchema;
2311
+ exports.formatErrorMessage = formatErrorMessage;
2312
+ exports.formatIs = formatIs;
2313
+ exports.generateDefaultUISchema = generateDefaultUISchema;
2314
+ exports.generateJsonSchema = generateJsonSchema;
2315
+ exports.getAjv = getAjv;
2316
+ exports.getCells = getCells;
2317
+ exports.getCombinedErrorMessage = getCombinedErrorMessage;
2318
+ exports.getConfig = getConfig;
2319
+ exports.getControlPath = getControlPath;
2320
+ exports.getData = getData;
2321
+ exports.getDefaultData = getDefaultData;
2322
+ exports.getErrorAt = getErrorAt;
2323
+ exports.getErrorTranslator = getErrorTranslator;
2324
+ exports.getFirstPrimitiveProp = getFirstPrimitiveProp;
2325
+ exports.getI18nKey = getI18nKey;
2326
+ exports.getI18nKeyPrefix = getI18nKeyPrefix;
2327
+ exports.getI18nKeyPrefixBySchema = getI18nKeyPrefixBySchema;
2328
+ exports.getLocale = getLocale;
2329
+ exports.getRenderers = getRenderers;
2330
+ exports.getSchema = getSchema;
2331
+ exports.getSubErrorsAt = getSubErrorsAt;
2332
+ exports.getTranslator = getTranslator;
2333
+ exports.getUISchemas = getUISchemas;
2334
+ exports.getUiSchema = getUiSchema;
2335
+ exports.hasCategory = hasCategory;
2336
+ exports.hasEnableRule = hasEnableRule;
2337
+ exports.hasShowRule = hasShowRule;
2338
+ exports.hasType = hasType;
2339
+ exports.i18nReducer = i18nReducer;
2340
+ exports.init = init;
2341
+ exports.isAllOfControl = isAllOfControl;
2342
+ exports.isAnyOfControl = isAnyOfControl;
2343
+ exports.isArrayObjectControl = isArrayObjectControl;
2344
+ exports.isBooleanControl = isBooleanControl;
2345
+ exports.isCategorization = isCategorization;
2346
+ exports.isCategory = isCategory;
2347
+ exports.isControl = isControl;
2348
+ exports.isDateControl = isDateControl;
2349
+ exports.isDateTimeControl = isDateTimeControl;
2350
+ exports.isDescriptionHidden = isDescriptionHidden;
2351
+ exports.isEnabled = isEnabled;
2352
+ exports.isEnumControl = isEnumControl;
2353
+ exports.isGroup = isGroup;
2354
+ exports.isInherentlyEnabled = isInherentlyEnabled;
2355
+ exports.isIntegerControl = isIntegerControl;
2356
+ exports.isLayout = isLayout;
2357
+ exports.isMultiLineControl = isMultiLineControl;
2358
+ exports.isNumberControl = isNumberControl;
2359
+ exports.isNumberFormatControl = isNumberFormatControl;
2360
+ exports.isObjectArray = isObjectArray;
2361
+ exports.isObjectArrayControl = isObjectArrayControl;
2362
+ exports.isObjectArrayWithNesting = isObjectArrayWithNesting;
2363
+ exports.isObjectControl = isObjectControl;
2364
+ exports.isOneOfControl = isOneOfControl;
2365
+ exports.isOneOfEnumControl = isOneOfEnumControl;
2366
+ exports.isPrimitiveArrayControl = isPrimitiveArrayControl;
2367
+ exports.isRangeControl = isRangeControl;
2368
+ exports.isStringControl = isStringControl;
2369
+ exports.isTimeControl = isTimeControl;
2370
+ exports.isVisible = isVisible;
2371
+ exports.iterateSchema = iterateSchema;
2372
+ exports.jsonFormsReducerConfig = jsonFormsReducerConfig;
2373
+ exports.layoutDefaultProps = layoutDefaultProps;
2374
+ exports.mapDispatchToArrayControlProps = mapDispatchToArrayControlProps;
2375
+ exports.mapDispatchToCellProps = mapDispatchToCellProps;
2376
+ exports.mapDispatchToControlProps = mapDispatchToControlProps;
2377
+ exports.mapDispatchToMultiEnumProps = mapDispatchToMultiEnumProps;
2378
+ exports.mapStateToAllOfProps = mapStateToAllOfProps;
2379
+ exports.mapStateToAnyOfProps = mapStateToAnyOfProps;
2380
+ exports.mapStateToArrayControlProps = mapStateToArrayControlProps;
2381
+ exports.mapStateToArrayLayoutProps = mapStateToArrayLayoutProps;
2382
+ exports.mapStateToCellProps = mapStateToCellProps;
2383
+ exports.mapStateToCombinatorRendererProps = mapStateToCombinatorRendererProps;
2384
+ exports.mapStateToControlProps = mapStateToControlProps;
2385
+ exports.mapStateToControlWithDetailProps = mapStateToControlWithDetailProps;
2386
+ exports.mapStateToDispatchCellProps = mapStateToDispatchCellProps;
2387
+ exports.mapStateToEnumControlProps = mapStateToEnumControlProps;
2388
+ exports.mapStateToJsonFormsRendererProps = mapStateToJsonFormsRendererProps;
2389
+ exports.mapStateToLayoutProps = mapStateToLayoutProps;
2390
+ exports.mapStateToMasterListItemProps = mapStateToMasterListItemProps;
2391
+ exports.mapStateToMultiEnumControlProps = mapStateToMultiEnumControlProps;
2392
+ exports.mapStateToOneOfEnumCellProps = mapStateToOneOfEnumCellProps;
2393
+ exports.mapStateToOneOfEnumControlProps = mapStateToOneOfEnumControlProps;
2394
+ exports.mapStateToOneOfProps = mapStateToOneOfProps;
2395
+ exports.moveDown = moveDown;
2396
+ exports.moveUp = moveUp;
2397
+ exports.not = not;
2398
+ exports.oneOfToEnumOptionMapper = oneOfToEnumOptionMapper;
2399
+ exports.optionIs = optionIs;
2400
+ exports.or = or;
2401
+ exports.rankWith = rankWith;
2402
+ exports.registerCell = registerCell;
2403
+ exports.registerDefaultData = registerDefaultData;
2404
+ exports.registerRenderer = registerRenderer;
2405
+ exports.registerUISchema = registerUISchema;
2406
+ exports.removeId = removeId;
2407
+ exports.rendererReducer = rendererReducer;
2408
+ exports.resolveData = resolveData;
2409
+ exports.resolveSchema = resolveSchema;
2410
+ exports.schemaMatches = schemaMatches;
2411
+ exports.schemaSubPathMatches = schemaSubPathMatches;
2412
+ exports.schemaTypeIs = schemaTypeIs;
2413
+ exports.scopeEndIs = scopeEndIs;
2414
+ exports.scopeEndsWith = scopeEndsWith;
2415
+ exports.setAjv = setAjv;
2416
+ exports.setConfig = setConfig;
2417
+ exports.setLocale = setLocale;
2418
+ exports.setReadonly = setReadonly;
2419
+ exports.setSchema = setSchema;
2420
+ exports.setTranslator = setTranslator;
2421
+ exports.setUISchema = setUISchema;
2422
+ exports.setValidationMode = setValidationMode;
2423
+ exports.showAsRequired = showAsRequired;
2424
+ exports.subErrorsAt = subErrorsAt;
2425
+ exports.toDataPath = toDataPath;
2426
+ exports.toDataPathSegments = toDataPathSegments;
2427
+ exports.transformPathToI18nPrefix = transformPathToI18nPrefix;
2428
+ exports.uiTypeIs = uiTypeIs;
2429
+ exports.uischemaRegistryReducer = uischemaRegistryReducer;
2430
+ exports.unregisterCell = unregisterCell;
2431
+ exports.unregisterDefaultData = unregisterDefaultData;
2432
+ exports.unregisterRenderer = unregisterRenderer;
2433
+ exports.unregisterUISchema = unregisterUISchema;
2434
+ exports.unsetReadonly = unsetReadonly;
2435
+ exports.update = update;
2436
+ exports.updateCore = updateCore;
2437
+ exports.updateErrors = updateErrors;
2438
+ exports.updateI18n = updateI18n;
2439
+ exports.validate = validate;
2440
+ exports.withIncreasedRank = withIncreasedRank;
2441
+ //# sourceMappingURL=jsonforms-core.cjs.js.map