@jsonforms/core 3.1.0-alpha.0 → 3.1.0-alpha.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.
- package/README.md +3 -3
- package/lib/Helpers.d.ts +1 -1
- package/lib/actions/actions.d.ts +27 -26
- package/lib/generators/Generate.d.ts +1 -1
- package/lib/generators/schema.d.ts +1 -1
- package/lib/i18n/arrayTranslations.d.ts +24 -0
- package/lib/i18n/i18nTypes.d.ts +3 -2
- package/lib/i18n/i18nUtil.d.ts +5 -2
- package/lib/i18n/index.d.ts +1 -0
- package/lib/jsonforms-core.cjs.js +428 -259
- package/lib/jsonforms-core.cjs.js.map +1 -1
- package/lib/jsonforms-core.esm.js +313 -200
- package/lib/jsonforms-core.esm.js.map +1 -1
- package/lib/models/jsonSchema.d.ts +2 -2
- package/lib/models/uischema.d.ts +1 -1
- package/lib/reducers/cells.d.ts +2 -2
- package/lib/reducers/config.d.ts +1 -1
- package/lib/reducers/core.d.ts +3 -2
- package/lib/reducers/default-data.d.ts +1 -1
- package/lib/reducers/i18n.d.ts +1 -1
- package/lib/reducers/reducers.d.ts +4 -4
- package/lib/reducers/renderers.d.ts +2 -2
- package/lib/reducers/selectors.d.ts +6 -6
- package/lib/reducers/uischemas.d.ts +2 -2
- package/lib/store.d.ts +3 -3
- package/lib/testers/testers.d.ts +1 -1
- package/lib/util/cell.d.ts +3 -4
- package/lib/util/combinators.d.ts +1 -1
- package/lib/util/label.d.ts +1 -1
- package/lib/util/path.d.ts +6 -3
- package/lib/util/renderer.d.ts +11 -7
- package/lib/util/resolvers.d.ts +1 -1
- package/lib/util/runtime.d.ts +2 -2
- package/lib/util/util.d.ts +2 -2
- package/lib/util/validator.d.ts +1 -1
- package/package.json +16 -5
- package/src/Helpers.ts +2 -2
- package/src/actions/actions.ts +59 -61
- package/src/configDefault.ts +1 -1
- package/src/generators/Generate.ts +4 -2
- package/src/generators/schema.ts +30 -26
- package/src/generators/uischema.ts +7 -6
- package/src/i18n/arrayTranslations.ts +54 -0
- package/src/i18n/i18nTypes.ts +12 -7
- package/src/i18n/i18nUtil.ts +66 -16
- package/src/i18n/index.ts +1 -0
- package/src/models/draft4.ts +33 -33
- package/src/models/jsonSchema.ts +2 -2
- package/src/models/uischema.ts +18 -7
- package/src/reducers/cells.ts +10 -9
- package/src/reducers/config.ts +1 -1
- package/src/reducers/core.ts +115 -75
- package/src/reducers/default-data.ts +8 -8
- package/src/reducers/i18n.ts +22 -10
- package/src/reducers/reducers.ts +24 -34
- package/src/reducers/renderers.ts +9 -9
- package/src/reducers/selectors.ts +10 -11
- package/src/reducers/uischemas.ts +27 -26
- package/src/store.ts +4 -4
- package/src/testers/testers.ts +200 -147
- package/src/util/cell.ts +27 -29
- package/src/util/combinators.ts +6 -4
- package/src/util/label.ts +2 -2
- package/src/util/path.ts +15 -8
- package/src/util/renderer.ts +123 -72
- package/src/util/resolvers.ts +16 -14
- package/src/util/runtime.ts +4 -4
- package/src/util/schema.ts +1 -1
- package/src/util/type.ts +5 -3
- package/src/util/uischema.ts +9 -9
- package/src/util/util.ts +54 -54
- package/src/util/validator.ts +2 -2
- package/.nycrc +0 -6
- package/docs/assets/css/main.css +0 -1
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +0 -51
- package/docs/assets/js/search.json +0 -1
- package/docs/classes/gen.html +0 -406
- package/docs/enums/ruleeffect.html +0 -214
- package/docs/globals.html +0 -10568
- package/docs/index.html +0 -1297
- package/docs/interfaces/action.html +0 -166
- package/docs/interfaces/addcellrendereraction.html +0 -181
- package/docs/interfaces/addrendereraction.html +0 -181
- package/docs/interfaces/adduischemaaction.html +0 -181
- package/docs/interfaces/andcondition.html +0 -181
- package/docs/interfaces/anyaction.html +0 -189
- package/docs/interfaces/arraycontrolprops.html +0 -653
- package/docs/interfaces/arraylayoutprops.html +0 -648
- package/docs/interfaces/categorization.html +0 -281
- package/docs/interfaces/category.html +0 -279
- package/docs/interfaces/cellprops.html +0 -452
- package/docs/interfaces/combinatorrendererprops.html +0 -503
- package/docs/interfaces/combinatorsubschemarenderinfo.html +0 -181
- package/docs/interfaces/composablecondition.html +0 -193
- package/docs/interfaces/condition.html +0 -176
- package/docs/interfaces/controlelement.html +0 -280
- package/docs/interfaces/controlprops.html +0 -497
- package/docs/interfaces/controlstate.html +0 -184
- package/docs/interfaces/controlwithdetailprops.html +0 -501
- package/docs/interfaces/dispatchcellprops.html +0 -388
- package/docs/interfaces/dispatchcellstateprops.html +0 -408
- package/docs/interfaces/dispatchpropsofarraycontrol.html +0 -322
- package/docs/interfaces/dispatchpropsofcontrol.html +0 -204
- package/docs/interfaces/dispatchpropsofmultienumcontrol.html +0 -215
- package/docs/interfaces/enumcellprops.html +0 -467
- package/docs/interfaces/enumoption.html +0 -167
- package/docs/interfaces/formatted.html +0 -226
- package/docs/interfaces/grouplayout.html +0 -284
- package/docs/interfaces/horizontallayout.html +0 -234
- package/docs/interfaces/initaction.html +0 -209
- package/docs/interfaces/initactionoptions.html +0 -181
- package/docs/interfaces/internationalizable.html +0 -170
- package/docs/interfaces/jsonformscellrendererregistryentry.html +0 -167
- package/docs/interfaces/jsonformscore.html +0 -251
- package/docs/interfaces/jsonformsdefaultdataregistryentry.html +0 -167
- package/docs/interfaces/jsonformsextendedstate.html +0 -175
- package/docs/interfaces/jsonformsi18nstate.html +0 -181
- package/docs/interfaces/jsonformsprops.html +0 -321
- package/docs/interfaces/jsonformsrendererregistryentry.html +0 -167
- package/docs/interfaces/jsonformsstate.html +0 -170
- package/docs/interfaces/jsonformsstore.html +0 -376
- package/docs/interfaces/jsonformssubstates.html +0 -276
- package/docs/interfaces/jsonformsuischemaregistryentry.html +0 -167
- package/docs/interfaces/jsonschema4.html +0 -758
- package/docs/interfaces/jsonschema7.html +0 -884
- package/docs/interfaces/labelable.html +0 -184
- package/docs/interfaces/labeldescription.html +0 -184
- package/docs/interfaces/labeled.html +0 -182
- package/docs/interfaces/labelelement.html +0 -251
- package/docs/interfaces/labelprops.html +0 -339
- package/docs/interfaces/layout.html +0 -253
- package/docs/interfaces/layoutprops.html +0 -359
- package/docs/interfaces/leafcondition.html +0 -209
- package/docs/interfaces/orcondition.html +0 -181
- package/docs/interfaces/ownpropsofcell.html +0 -321
- package/docs/interfaces/ownpropsofcontrol.html +0 -305
- package/docs/interfaces/ownpropsofenum.html +0 -161
- package/docs/interfaces/ownpropsofenumcell.html +0 -335
- package/docs/interfaces/ownpropsofjsonformsrenderer.html +0 -296
- package/docs/interfaces/ownpropsoflabel.html +0 -286
- package/docs/interfaces/ownpropsoflayout.html +0 -305
- package/docs/interfaces/ownpropsofmasterlistitem.html +0 -289
- package/docs/interfaces/ownpropsofrenderer.html +0 -292
- package/docs/interfaces/referenceschemamap.html +0 -138
- package/docs/interfaces/registerdefaultdataaction.html +0 -181
- package/docs/interfaces/removecellrendereraction.html +0 -181
- package/docs/interfaces/removerendereraction.html +0 -181
- package/docs/interfaces/removeuischemaaction.html +0 -167
- package/docs/interfaces/rendererprops.html +0 -331
- package/docs/interfaces/rule.html +0 -185
- package/docs/interfaces/schemabasedcondition.html +0 -202
- package/docs/interfaces/scopable.html +0 -171
- package/docs/interfaces/scoped.html +0 -183
- package/docs/interfaces/setajvaction.html +0 -167
- package/docs/interfaces/setconfigaction.html +0 -167
- package/docs/interfaces/setlocaleaction.html +0 -167
- package/docs/interfaces/setschemaaction.html +0 -167
- package/docs/interfaces/settranslatoraction.html +0 -181
- package/docs/interfaces/setuischemaaction.html +0 -167
- package/docs/interfaces/setvalidationmodeaction.html +0 -167
- package/docs/interfaces/statepropsofarraycontrol.html +0 -474
- package/docs/interfaces/statepropsofarraylayout.html +0 -461
- package/docs/interfaces/statepropsofcell.html +0 -408
- package/docs/interfaces/statepropsofcombinator.html +0 -449
- package/docs/interfaces/statepropsofcontrol.html +0 -451
- package/docs/interfaces/statepropsofcontrolwithdetail.html +0 -463
- package/docs/interfaces/statepropsofenumcell.html +0 -422
- package/docs/interfaces/statepropsofjsonformsrenderer.html +0 -324
- package/docs/interfaces/statepropsoflabel.html +0 -343
- package/docs/interfaces/statepropsoflayout.html +0 -369
- package/docs/interfaces/statepropsofmasteritem.html +0 -309
- package/docs/interfaces/statepropsofrenderer.html +0 -331
- package/docs/interfaces/statepropsofscopedrenderer.html +0 -391
- package/docs/interfaces/store.html +0 -386
- package/docs/interfaces/testercontext.html +0 -184
- package/docs/interfaces/uischemaelement.html +0 -225
- package/docs/interfaces/unregisterdefaultdataaction.html +0 -167
- package/docs/interfaces/updateaction.html +0 -202
- package/docs/interfaces/updatecoreaction.html +0 -209
- package/docs/interfaces/updateerrorsaction.html +0 -167
- package/docs/interfaces/updatei18naction.html +0 -195
- package/docs/interfaces/verticallayout.html +0 -234
- package/docs/interfaces/withclassname.html +0 -153
- package/rollup.config.js +0 -44
- package/stats.html +0 -3279
- package/test/actions/actions.test.ts +0 -93
- package/test/generators/schema.test.ts +0 -224
- package/test/generators/uischema.test.ts +0 -576
- package/test/i18n/i18nUtil.test.ts +0 -88
- package/test/reducers/core.test.ts +0 -1682
- package/test/reducers/uischemas.test.ts +0 -173
- package/test/testers.test.ts +0 -948
- package/test/util/array.test.ts +0 -28
- package/test/util/cell.test.ts +0 -354
- package/test/util/derivetype.test.ts +0 -101
- package/test/util/label.test.ts +0 -364
- package/test/util/path.test.ts +0 -259
- package/test/util/renderer.test.ts +0 -1830
- package/test/util/resolvers.test.ts +0 -157
- package/test/util/runtime.test.ts +0 -779
- package/tsconfig.json +0 -13
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import isEmpty from 'lodash/isEmpty';
|
|
2
2
|
import startCase from 'lodash/startCase';
|
|
3
3
|
import keys from 'lodash/keys';
|
|
4
|
-
import union from 'lodash/union';
|
|
5
4
|
import merge from 'lodash/merge';
|
|
6
5
|
import cloneDeep from 'lodash/cloneDeep';
|
|
7
6
|
import setFp from 'lodash/fp/set';
|
|
@@ -27,7 +26,7 @@ const ADDITIONAL_PROPERTIES = 'additionalProperties';
|
|
|
27
26
|
const REQUIRED_PROPERTIES = 'required';
|
|
28
27
|
const distinct = (properties, discriminator) => {
|
|
29
28
|
const known = {};
|
|
30
|
-
return properties.filter(item => {
|
|
29
|
+
return properties.filter((item) => {
|
|
31
30
|
const discriminatorValue = discriminator(item);
|
|
32
31
|
if (known.hasOwnProperty(discriminatorValue)) {
|
|
33
32
|
return false;
|
|
@@ -46,7 +45,7 @@ class Gen {
|
|
|
46
45
|
const schema = {
|
|
47
46
|
type: 'object',
|
|
48
47
|
properties: props,
|
|
49
|
-
additionalProperties: this.findOption(props)(ADDITIONAL_PROPERTIES)
|
|
48
|
+
additionalProperties: this.findOption(props)(ADDITIONAL_PROPERTIES),
|
|
50
49
|
};
|
|
51
50
|
const required = this.findOption(props)(REQUIRED_PROPERTIES);
|
|
52
51
|
if (required.length > 0) {
|
|
@@ -92,32 +91,33 @@ class Gen {
|
|
|
92
91
|
this.schemaArray = (data) => {
|
|
93
92
|
if (data.length > 0) {
|
|
94
93
|
const allProperties = data.map(this.property);
|
|
95
|
-
const uniqueProperties = distinct(allProperties, prop => JSON.stringify(prop));
|
|
94
|
+
const uniqueProperties = distinct(allProperties, (prop) => JSON.stringify(prop));
|
|
96
95
|
if (uniqueProperties.length === 1) {
|
|
97
96
|
return {
|
|
98
97
|
type: 'array',
|
|
99
|
-
items: uniqueProperties[0]
|
|
98
|
+
items: uniqueProperties[0],
|
|
100
99
|
};
|
|
101
100
|
}
|
|
102
101
|
else {
|
|
103
102
|
return {
|
|
104
103
|
type: 'array',
|
|
105
104
|
items: {
|
|
106
|
-
oneOf: uniqueProperties
|
|
107
|
-
}
|
|
105
|
+
oneOf: uniqueProperties,
|
|
106
|
+
},
|
|
108
107
|
};
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
else {
|
|
112
111
|
return {
|
|
113
112
|
type: 'array',
|
|
114
|
-
items: {}
|
|
113
|
+
items: {},
|
|
115
114
|
};
|
|
116
115
|
}
|
|
117
116
|
};
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
|
-
const generateJsonSchema = (
|
|
119
|
+
const generateJsonSchema = (
|
|
120
|
+
instance, options = {}) => {
|
|
121
121
|
const findOption = (props) => (optionName) => {
|
|
122
122
|
switch (optionName) {
|
|
123
123
|
case ADDITIONAL_PROPERTIES:
|
|
@@ -146,14 +146,14 @@ const Draft4 = {
|
|
|
146
146
|
schemaArray: {
|
|
147
147
|
type: 'array',
|
|
148
148
|
minItems: 1,
|
|
149
|
-
items: { $ref: '#' }
|
|
149
|
+
items: { $ref: '#' },
|
|
150
150
|
},
|
|
151
151
|
positiveInteger: {
|
|
152
152
|
type: 'integer',
|
|
153
|
-
minimum: 0
|
|
153
|
+
minimum: 0,
|
|
154
154
|
},
|
|
155
155
|
positiveIntegerDefault0: {
|
|
156
|
-
allOf: [{ $ref: '#/definitions/positiveInteger' }, { default: 0 }]
|
|
156
|
+
allOf: [{ $ref: '#/definitions/positiveInteger' }, { default: 0 }],
|
|
157
157
|
},
|
|
158
158
|
simpleTypes: {
|
|
159
159
|
enum: [
|
|
@@ -163,104 +163,104 @@ const Draft4 = {
|
|
|
163
163
|
'null',
|
|
164
164
|
'number',
|
|
165
165
|
'object',
|
|
166
|
-
'string'
|
|
167
|
-
]
|
|
166
|
+
'string',
|
|
167
|
+
],
|
|
168
168
|
},
|
|
169
169
|
stringArray: {
|
|
170
170
|
type: 'array',
|
|
171
171
|
items: { type: 'string' },
|
|
172
172
|
minItems: 1,
|
|
173
|
-
uniqueItems: true
|
|
174
|
-
}
|
|
173
|
+
uniqueItems: true,
|
|
174
|
+
},
|
|
175
175
|
},
|
|
176
176
|
type: 'object',
|
|
177
177
|
properties: {
|
|
178
178
|
id: {
|
|
179
179
|
type: 'string',
|
|
180
|
-
format: 'uri'
|
|
180
|
+
format: 'uri',
|
|
181
181
|
},
|
|
182
182
|
$schema: {
|
|
183
183
|
type: 'string',
|
|
184
|
-
format: 'uri'
|
|
184
|
+
format: 'uri',
|
|
185
185
|
},
|
|
186
186
|
title: {
|
|
187
|
-
type: 'string'
|
|
187
|
+
type: 'string',
|
|
188
188
|
},
|
|
189
189
|
description: {
|
|
190
|
-
type: 'string'
|
|
190
|
+
type: 'string',
|
|
191
191
|
},
|
|
192
192
|
default: {},
|
|
193
193
|
multipleOf: {
|
|
194
194
|
type: 'number',
|
|
195
195
|
minimum: 0,
|
|
196
|
-
exclusiveMinimum: true
|
|
196
|
+
exclusiveMinimum: true,
|
|
197
197
|
},
|
|
198
198
|
maximum: {
|
|
199
|
-
type: 'number'
|
|
199
|
+
type: 'number',
|
|
200
200
|
},
|
|
201
201
|
exclusiveMaximum: {
|
|
202
202
|
type: 'boolean',
|
|
203
|
-
default: false
|
|
203
|
+
default: false,
|
|
204
204
|
},
|
|
205
205
|
minimum: {
|
|
206
|
-
type: 'number'
|
|
206
|
+
type: 'number',
|
|
207
207
|
},
|
|
208
208
|
exclusiveMinimum: {
|
|
209
209
|
type: 'boolean',
|
|
210
|
-
default: false
|
|
210
|
+
default: false,
|
|
211
211
|
},
|
|
212
212
|
maxLength: { $ref: '#/definitions/positiveInteger' },
|
|
213
213
|
minLength: { $ref: '#/definitions/positiveIntegerDefault0' },
|
|
214
214
|
pattern: {
|
|
215
215
|
type: 'string',
|
|
216
|
-
format: 'regex'
|
|
216
|
+
format: 'regex',
|
|
217
217
|
},
|
|
218
218
|
additionalItems: {
|
|
219
219
|
anyOf: [{ type: 'boolean' }, { $ref: '#' }],
|
|
220
|
-
default: {}
|
|
220
|
+
default: {},
|
|
221
221
|
},
|
|
222
222
|
items: {
|
|
223
223
|
anyOf: [{ $ref: '#' }, { $ref: '#/definitions/schemaArray' }],
|
|
224
|
-
default: {}
|
|
224
|
+
default: {},
|
|
225
225
|
},
|
|
226
226
|
maxItems: { $ref: '#/definitions/positiveInteger' },
|
|
227
227
|
minItems: { $ref: '#/definitions/positiveIntegerDefault0' },
|
|
228
228
|
uniqueItems: {
|
|
229
229
|
type: 'boolean',
|
|
230
|
-
default: false
|
|
230
|
+
default: false,
|
|
231
231
|
},
|
|
232
232
|
maxProperties: { $ref: '#/definitions/positiveInteger' },
|
|
233
233
|
minProperties: { $ref: '#/definitions/positiveIntegerDefault0' },
|
|
234
234
|
required: { $ref: '#/definitions/stringArray' },
|
|
235
235
|
additionalProperties: {
|
|
236
236
|
anyOf: [{ type: 'boolean' }, { $ref: '#' }],
|
|
237
|
-
default: {}
|
|
237
|
+
default: {},
|
|
238
238
|
},
|
|
239
239
|
definitions: {
|
|
240
240
|
type: 'object',
|
|
241
241
|
additionalProperties: { $ref: '#' },
|
|
242
|
-
default: {}
|
|
242
|
+
default: {},
|
|
243
243
|
},
|
|
244
244
|
properties: {
|
|
245
245
|
type: 'object',
|
|
246
246
|
additionalProperties: { $ref: '#' },
|
|
247
|
-
default: {}
|
|
247
|
+
default: {},
|
|
248
248
|
},
|
|
249
249
|
patternProperties: {
|
|
250
250
|
type: 'object',
|
|
251
251
|
additionalProperties: { $ref: '#' },
|
|
252
|
-
default: {}
|
|
252
|
+
default: {},
|
|
253
253
|
},
|
|
254
254
|
dependencies: {
|
|
255
255
|
type: 'object',
|
|
256
256
|
additionalProperties: {
|
|
257
|
-
anyOf: [{ $ref: '#' }, { $ref: '#/definitions/stringArray' }]
|
|
258
|
-
}
|
|
257
|
+
anyOf: [{ $ref: '#' }, { $ref: '#/definitions/stringArray' }],
|
|
258
|
+
},
|
|
259
259
|
},
|
|
260
260
|
enum: {
|
|
261
261
|
type: 'array',
|
|
262
262
|
minItems: 1,
|
|
263
|
-
uniqueItems: true
|
|
263
|
+
uniqueItems: true,
|
|
264
264
|
},
|
|
265
265
|
type: {
|
|
266
266
|
anyOf: [
|
|
@@ -269,20 +269,20 @@ const Draft4 = {
|
|
|
269
269
|
type: 'array',
|
|
270
270
|
items: { $ref: '#/definitions/simpleTypes' },
|
|
271
271
|
minItems: 1,
|
|
272
|
-
uniqueItems: true
|
|
273
|
-
}
|
|
274
|
-
]
|
|
272
|
+
uniqueItems: true,
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
275
|
},
|
|
276
276
|
allOf: { $ref: '#/definitions/schemaArray' },
|
|
277
277
|
anyOf: { $ref: '#/definitions/schemaArray' },
|
|
278
278
|
oneOf: { $ref: '#/definitions/schemaArray' },
|
|
279
|
-
not: { $ref: '#' }
|
|
279
|
+
not: { $ref: '#' },
|
|
280
280
|
},
|
|
281
281
|
dependencies: {
|
|
282
282
|
exclusiveMaximum: ['maximum'],
|
|
283
|
-
exclusiveMinimum: ['minimum']
|
|
283
|
+
exclusiveMinimum: ['minimum'],
|
|
284
284
|
},
|
|
285
|
-
default: {}
|
|
285
|
+
default: {},
|
|
286
286
|
};
|
|
287
287
|
|
|
288
288
|
var RuleEffect;
|
|
@@ -292,7 +292,9 @@ var RuleEffect;
|
|
|
292
292
|
RuleEffect["ENABLE"] = "ENABLE";
|
|
293
293
|
RuleEffect["DISABLE"] = "DISABLE";
|
|
294
294
|
})(RuleEffect || (RuleEffect = {}));
|
|
295
|
-
const isInternationalized = (element) => typeof element === 'object' &&
|
|
295
|
+
const isInternationalized = (element) => typeof element === 'object' &&
|
|
296
|
+
element !== null &&
|
|
297
|
+
typeof element.i18n === 'string';
|
|
296
298
|
const isGroup = (layout) => layout.type === 'Group';
|
|
297
299
|
const isLayout = (uischema) => uischema.elements !== undefined;
|
|
298
300
|
const isScopable = (obj) => !!obj && typeof obj === 'object';
|
|
@@ -320,7 +322,7 @@ const cellReducer = (state = [], { type, tester, cell }) => {
|
|
|
320
322
|
case ADD_CELL:
|
|
321
323
|
return state.concat([{ tester, cell }]);
|
|
322
324
|
case REMOVE_CELL:
|
|
323
|
-
return state.filter(t => t.tester !== tester);
|
|
325
|
+
return state.filter((t) => t.tester !== tester);
|
|
324
326
|
default:
|
|
325
327
|
return state;
|
|
326
328
|
}
|
|
@@ -330,7 +332,7 @@ const configDefault = {
|
|
|
330
332
|
restrict: false,
|
|
331
333
|
trim: false,
|
|
332
334
|
showUnfocusedDescription: false,
|
|
333
|
-
hideRequiredAsterisk: false
|
|
335
|
+
hideRequiredAsterisk: false,
|
|
334
336
|
};
|
|
335
337
|
|
|
336
338
|
const applyDefaultConfiguration = (config = {}) => merge({}, configDefault, config);
|
|
@@ -361,7 +363,7 @@ const initState = {
|
|
|
361
363
|
validator: undefined,
|
|
362
364
|
ajv: undefined,
|
|
363
365
|
validationMode: 'ValidateAndShow',
|
|
364
|
-
additionalErrors: []
|
|
366
|
+
additionalErrors: [],
|
|
365
367
|
};
|
|
366
368
|
const reuseAjvForSchema = (ajv, schema) => {
|
|
367
369
|
if (schema.hasOwnProperty('id') || schema.hasOwnProperty('$id')) {
|
|
@@ -422,7 +424,9 @@ const coreReducer = (state = initState, action) => {
|
|
|
422
424
|
case INIT: {
|
|
423
425
|
const thisAjv = getOrCreateAjv(state, action);
|
|
424
426
|
const validationMode = getValidationMode(state, action);
|
|
425
|
-
const v = validationMode === 'NoValidation'
|
|
427
|
+
const v = validationMode === 'NoValidation'
|
|
428
|
+
? undefined
|
|
429
|
+
: thisAjv.compile(action.schema);
|
|
426
430
|
const e = validate(v, action.data);
|
|
427
431
|
const additionalErrors = getAdditionalErrors(state, action);
|
|
428
432
|
return {
|
|
@@ -473,18 +477,20 @@ const coreReducer = (state = initState, action) => {
|
|
|
473
477
|
errors: isEqual(errors, state.errors) ? state.errors : errors,
|
|
474
478
|
validator: validator,
|
|
475
479
|
validationMode: validationMode,
|
|
476
|
-
additionalErrors
|
|
480
|
+
additionalErrors,
|
|
477
481
|
}
|
|
478
482
|
: state;
|
|
479
483
|
}
|
|
480
484
|
case SET_AJV: {
|
|
481
485
|
const currentAjv = action.ajv;
|
|
482
|
-
const validator = state.validationMode === 'NoValidation'
|
|
486
|
+
const validator = state.validationMode === 'NoValidation'
|
|
487
|
+
? undefined
|
|
488
|
+
: currentAjv.compile(state.schema);
|
|
483
489
|
const errors = validate(validator, state.data);
|
|
484
490
|
return {
|
|
485
491
|
...state,
|
|
486
492
|
validator,
|
|
487
|
-
errors
|
|
493
|
+
errors,
|
|
488
494
|
};
|
|
489
495
|
}
|
|
490
496
|
case SET_SCHEMA: {
|
|
@@ -497,13 +503,13 @@ const coreReducer = (state = initState, action) => {
|
|
|
497
503
|
...state,
|
|
498
504
|
validator: v,
|
|
499
505
|
schema: action.schema,
|
|
500
|
-
errors
|
|
506
|
+
errors,
|
|
501
507
|
};
|
|
502
508
|
}
|
|
503
509
|
case SET_UISCHEMA: {
|
|
504
510
|
return {
|
|
505
511
|
...state,
|
|
506
|
-
uischema: action.uischema
|
|
512
|
+
uischema: action.uischema,
|
|
507
513
|
};
|
|
508
514
|
}
|
|
509
515
|
case UPDATE_DATA: {
|
|
@@ -516,7 +522,7 @@ const coreReducer = (state = initState, action) => {
|
|
|
516
522
|
return {
|
|
517
523
|
...state,
|
|
518
524
|
data: result,
|
|
519
|
-
errors
|
|
525
|
+
errors,
|
|
520
526
|
};
|
|
521
527
|
}
|
|
522
528
|
else {
|
|
@@ -527,14 +533,14 @@ const coreReducer = (state = initState, action) => {
|
|
|
527
533
|
return {
|
|
528
534
|
...state,
|
|
529
535
|
data: newState,
|
|
530
|
-
errors
|
|
536
|
+
errors,
|
|
531
537
|
};
|
|
532
538
|
}
|
|
533
539
|
}
|
|
534
540
|
case UPDATE_ERRORS: {
|
|
535
541
|
return {
|
|
536
542
|
...state,
|
|
537
|
-
errors: action.errors
|
|
543
|
+
errors: action.errors,
|
|
538
544
|
};
|
|
539
545
|
}
|
|
540
546
|
case SET_VALIDATION_MODE: {
|
|
@@ -546,7 +552,7 @@ const coreReducer = (state = initState, action) => {
|
|
|
546
552
|
return {
|
|
547
553
|
...state,
|
|
548
554
|
errors,
|
|
549
|
-
validationMode: action.validationMode
|
|
555
|
+
validationMode: action.validationMode,
|
|
550
556
|
};
|
|
551
557
|
}
|
|
552
558
|
if (state.validationMode === 'NoValidation') {
|
|
@@ -556,12 +562,12 @@ const coreReducer = (state = initState, action) => {
|
|
|
556
562
|
...state,
|
|
557
563
|
validator,
|
|
558
564
|
errors,
|
|
559
|
-
validationMode: action.validationMode
|
|
565
|
+
validationMode: action.validationMode,
|
|
560
566
|
};
|
|
561
567
|
}
|
|
562
568
|
return {
|
|
563
569
|
...state,
|
|
564
|
-
validationMode: action.validationMode
|
|
570
|
+
validationMode: action.validationMode,
|
|
565
571
|
};
|
|
566
572
|
}
|
|
567
573
|
default:
|
|
@@ -588,7 +594,7 @@ const getControlPath = (error) => {
|
|
|
588
594
|
if (dataPath) {
|
|
589
595
|
return dataPath.replace(/\//g, '.').substr(1);
|
|
590
596
|
}
|
|
591
|
-
|
|
597
|
+
let controlPath = error.instancePath;
|
|
592
598
|
controlPath = controlPath.replace(/\//g, '.');
|
|
593
599
|
const invalidProperty = getInvalidProperty(error);
|
|
594
600
|
if (invalidProperty !== undefined && !controlPath.endsWith(invalidProperty)) {
|
|
@@ -598,16 +604,17 @@ const getControlPath = (error) => {
|
|
|
598
604
|
return controlPath;
|
|
599
605
|
};
|
|
600
606
|
const errorsAt = (instancePath, schema, matchPath) => (errors) => {
|
|
601
|
-
const combinatorPaths = filter(errors, error => error.keyword === 'oneOf' || error.keyword === 'anyOf').map(error => getControlPath(error));
|
|
602
|
-
return filter(errors, error => {
|
|
607
|
+
const combinatorPaths = filter(errors, (error) => error.keyword === 'oneOf' || error.keyword === 'anyOf').map((error) => getControlPath(error));
|
|
608
|
+
return filter(errors, (error) => {
|
|
603
609
|
if (filteredErrorKeywords.indexOf(error.keyword) !== -1) {
|
|
604
610
|
return false;
|
|
605
611
|
}
|
|
606
612
|
const controlPath = getControlPath(error);
|
|
607
613
|
let result = matchPath(controlPath);
|
|
608
614
|
const parentSchema = error.parentSchema;
|
|
609
|
-
if (result &&
|
|
610
|
-
|
|
615
|
+
if (result &&
|
|
616
|
+
!isObjectSchema$1(parentSchema) &&
|
|
617
|
+
combinatorPaths.findIndex((p) => instancePath.startsWith(p)) !== -1) {
|
|
611
618
|
result = result && isEqual(parentSchema, schema);
|
|
612
619
|
}
|
|
613
620
|
return result;
|
|
@@ -616,23 +623,30 @@ const errorsAt = (instancePath, schema, matchPath) => (errors) => {
|
|
|
616
623
|
const isObjectSchema$1 = (schema) => {
|
|
617
624
|
return schema?.type === 'object' || !!schema?.properties;
|
|
618
625
|
};
|
|
619
|
-
const filteredErrorKeywords = [
|
|
626
|
+
const filteredErrorKeywords = [
|
|
627
|
+
'additionalProperties',
|
|
628
|
+
'allOf',
|
|
629
|
+
'anyOf',
|
|
630
|
+
'oneOf',
|
|
631
|
+
];
|
|
620
632
|
const getErrorsAt = (instancePath, schema, matchPath) => (state) => {
|
|
621
633
|
const errors = state.errors ?? [];
|
|
622
634
|
const additionalErrors = state.additionalErrors ?? [];
|
|
623
|
-
return errorsAt(instancePath, schema, matchPath)(state.validationMode === 'ValidateAndHide'
|
|
635
|
+
return errorsAt(instancePath, schema, matchPath)(state.validationMode === 'ValidateAndHide'
|
|
636
|
+
? additionalErrors
|
|
637
|
+
: [...errors, ...additionalErrors]);
|
|
624
638
|
};
|
|
625
|
-
const errorAt = (instancePath, schema) => getErrorsAt(instancePath, schema, path => path === instancePath);
|
|
626
|
-
const subErrorsAt = (instancePath, schema) => getErrorsAt(instancePath, schema, path => path.startsWith(instancePath));
|
|
639
|
+
const errorAt = (instancePath, schema) => getErrorsAt(instancePath, schema, (path) => path === instancePath);
|
|
640
|
+
const subErrorsAt = (instancePath, schema) => getErrorsAt(instancePath, schema, (path) => path.startsWith(instancePath + '.'));
|
|
627
641
|
|
|
628
642
|
const defaultDataReducer = (state = [], action) => {
|
|
629
643
|
switch (action.type) {
|
|
630
644
|
case ADD_DEFAULT_DATA:
|
|
631
645
|
return state.concat([
|
|
632
|
-
{ schemaPath: action.schemaPath, data: action.data }
|
|
646
|
+
{ schemaPath: action.schemaPath, data: action.data },
|
|
633
647
|
]);
|
|
634
648
|
case REMOVE_DEFAULT_DATA:
|
|
635
|
-
return state.filter(t => t.schemaPath !== action.schemaPath);
|
|
649
|
+
return state.filter((t) => t.schemaPath !== action.schemaPath);
|
|
636
650
|
default:
|
|
637
651
|
return state;
|
|
638
652
|
}
|
|
@@ -648,7 +662,7 @@ const getI18nKeyPrefixBySchema = (schema, uischema) => {
|
|
|
648
662
|
const transformPathToI18nPrefix = (path) => {
|
|
649
663
|
return (path
|
|
650
664
|
?.split('.')
|
|
651
|
-
.filter(segment => !/^\d+$/.test(segment))
|
|
665
|
+
.filter((segment) => !/^\d+$/.test(segment))
|
|
652
666
|
.join('.') || 'root');
|
|
653
667
|
};
|
|
654
668
|
const getI18nKeyPrefix = (schema, uischema, path) => {
|
|
@@ -658,6 +672,9 @@ const getI18nKeyPrefix = (schema, uischema, path) => {
|
|
|
658
672
|
const getI18nKey = (schema, uischema, path, key) => {
|
|
659
673
|
return `${getI18nKeyPrefix(schema, uischema, path)}.${key}`;
|
|
660
674
|
};
|
|
675
|
+
const addI18nKeyToPrefix = (i18nKeyPrefix, key) => {
|
|
676
|
+
return `${i18nKeyPrefix}.${key}`;
|
|
677
|
+
};
|
|
661
678
|
const defaultTranslator = (_id, defaultMessage) => defaultMessage;
|
|
662
679
|
const defaultErrorTranslator = (error, t, uischema) => {
|
|
663
680
|
const i18nKey = getI18nKey(error.parentSchema, uischema, getControlPath(error), `error.${error.keyword}`);
|
|
@@ -665,7 +682,9 @@ const defaultErrorTranslator = (error, t, uischema) => {
|
|
|
665
682
|
if (specializedKeywordMessage !== undefined) {
|
|
666
683
|
return specializedKeywordMessage;
|
|
667
684
|
}
|
|
668
|
-
const genericKeywordMessage = t(`error.${error.keyword}`, undefined, {
|
|
685
|
+
const genericKeywordMessage = t(`error.${error.keyword}`, undefined, {
|
|
686
|
+
error,
|
|
687
|
+
});
|
|
669
688
|
if (genericKeywordMessage !== undefined) {
|
|
670
689
|
return genericKeywordMessage;
|
|
671
690
|
}
|
|
@@ -673,7 +692,8 @@ const defaultErrorTranslator = (error, t, uischema) => {
|
|
|
673
692
|
if (messageCustomization !== undefined) {
|
|
674
693
|
return messageCustomization;
|
|
675
694
|
}
|
|
676
|
-
if (error.keyword === 'required' &&
|
|
695
|
+
if (error.keyword === 'required' &&
|
|
696
|
+
error.message?.startsWith('must have required property')) {
|
|
677
697
|
return t('is a required property', 'is a required property', { error });
|
|
678
698
|
}
|
|
679
699
|
return error.message;
|
|
@@ -681,30 +701,96 @@ const defaultErrorTranslator = (error, t, uischema) => {
|
|
|
681
701
|
const getCombinedErrorMessage = (errors, et, t, schema, uischema, path) => {
|
|
682
702
|
if (errors.length > 0 && t) {
|
|
683
703
|
const customErrorKey = getI18nKey(schema, uischema, path, 'error.custom');
|
|
684
|
-
const specializedErrorMessage = t(customErrorKey, undefined, {
|
|
704
|
+
const specializedErrorMessage = t(customErrorKey, undefined, {
|
|
705
|
+
schema,
|
|
706
|
+
uischema,
|
|
707
|
+
path,
|
|
708
|
+
errors,
|
|
709
|
+
});
|
|
685
710
|
if (specializedErrorMessage !== undefined) {
|
|
686
711
|
return specializedErrorMessage;
|
|
687
712
|
}
|
|
688
713
|
}
|
|
689
|
-
return formatErrorMessage(errors.map(error => et(error, t, uischema)));
|
|
714
|
+
return formatErrorMessage(errors.map((error) => et(error, t, uischema)));
|
|
690
715
|
};
|
|
691
716
|
const deriveLabelForUISchemaElement = (uischema, t) => {
|
|
692
717
|
if (uischema.label === false) {
|
|
693
718
|
return undefined;
|
|
694
719
|
}
|
|
695
|
-
if ((uischema.label === undefined ||
|
|
720
|
+
if ((uischema.label === undefined ||
|
|
721
|
+
uischema.label === null ||
|
|
722
|
+
uischema.label === true) &&
|
|
723
|
+
!isInternationalized(uischema)) {
|
|
696
724
|
return undefined;
|
|
697
725
|
}
|
|
698
|
-
const stringifiedLabel = typeof uischema.label === 'string'
|
|
726
|
+
const stringifiedLabel = typeof uischema.label === 'string'
|
|
727
|
+
? uischema.label
|
|
728
|
+
: JSON.stringify(uischema.label);
|
|
699
729
|
const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);
|
|
700
|
-
const i18nKey = typeof i18nKeyPrefix === 'string'
|
|
730
|
+
const i18nKey = typeof i18nKeyPrefix === 'string'
|
|
731
|
+
? `${i18nKeyPrefix}.label`
|
|
732
|
+
: stringifiedLabel;
|
|
701
733
|
return t(i18nKey, stringifiedLabel, { uischema: uischema });
|
|
702
734
|
};
|
|
735
|
+
const getArrayTranslations = (t, defaultTranslations, i18nKeyPrefix, label) => {
|
|
736
|
+
const translations = {};
|
|
737
|
+
defaultTranslations.forEach((controlElement) => {
|
|
738
|
+
const key = addI18nKeyToPrefix(i18nKeyPrefix, controlElement.key);
|
|
739
|
+
translations[controlElement.key] = t(key, controlElement.default(label));
|
|
740
|
+
});
|
|
741
|
+
return translations;
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
var ArrayTranslationEnum;
|
|
745
|
+
(function (ArrayTranslationEnum) {
|
|
746
|
+
ArrayTranslationEnum["addTooltip"] = "addTooltip";
|
|
747
|
+
ArrayTranslationEnum["addAriaLabel"] = "addAriaLabel";
|
|
748
|
+
ArrayTranslationEnum["removeTooltip"] = "removeTooltip";
|
|
749
|
+
ArrayTranslationEnum["upAriaLabel"] = "upAriaLabel";
|
|
750
|
+
ArrayTranslationEnum["downAriaLabel"] = "downAriaLabel";
|
|
751
|
+
ArrayTranslationEnum["noSelection"] = "noSelection";
|
|
752
|
+
ArrayTranslationEnum["removeAriaLabel"] = "removeAriaLabel";
|
|
753
|
+
ArrayTranslationEnum["noDataMessage"] = "noDataMessage";
|
|
754
|
+
ArrayTranslationEnum["deleteDialogTitle"] = "deleteDialogTitle";
|
|
755
|
+
ArrayTranslationEnum["deleteDialogMessage"] = "deleteDialogMessage";
|
|
756
|
+
ArrayTranslationEnum["deleteDialogAccept"] = "deleteDialogAccept";
|
|
757
|
+
ArrayTranslationEnum["deleteDialogDecline"] = "deleteDialogDecline";
|
|
758
|
+
ArrayTranslationEnum["up"] = "up";
|
|
759
|
+
ArrayTranslationEnum["down"] = "down";
|
|
760
|
+
})(ArrayTranslationEnum || (ArrayTranslationEnum = {}));
|
|
761
|
+
const arrayDefaultTranslations = [
|
|
762
|
+
{
|
|
763
|
+
key: ArrayTranslationEnum.addTooltip,
|
|
764
|
+
default: (input) => (input ? `Add to ${input}` : 'Add'),
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
key: ArrayTranslationEnum.addAriaLabel,
|
|
768
|
+
default: (input) => (input ? `Add to ${input} button` : 'Add button'),
|
|
769
|
+
},
|
|
770
|
+
{ key: ArrayTranslationEnum.removeTooltip, default: () => 'Delete' },
|
|
771
|
+
{ key: ArrayTranslationEnum.removeAriaLabel, default: () => 'Delete button' },
|
|
772
|
+
{ key: ArrayTranslationEnum.upAriaLabel, default: () => `Move item up` },
|
|
773
|
+
{ key: ArrayTranslationEnum.up, default: () => 'Up' },
|
|
774
|
+
{ key: ArrayTranslationEnum.down, default: () => 'Down' },
|
|
775
|
+
{ key: ArrayTranslationEnum.downAriaLabel, default: () => `Move item down` },
|
|
776
|
+
{ key: ArrayTranslationEnum.noDataMessage, default: () => 'No data' },
|
|
777
|
+
{ key: ArrayTranslationEnum.noSelection, default: () => 'No selection' },
|
|
778
|
+
{
|
|
779
|
+
key: ArrayTranslationEnum.deleteDialogTitle,
|
|
780
|
+
default: () => 'Confirm Deletion',
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
key: ArrayTranslationEnum.deleteDialogMessage,
|
|
784
|
+
default: () => 'Are you sure you want to delete the selected entry?',
|
|
785
|
+
},
|
|
786
|
+
{ key: ArrayTranslationEnum.deleteDialogAccept, default: () => 'Yes' },
|
|
787
|
+
{ key: ArrayTranslationEnum.deleteDialogDecline, default: () => 'No' },
|
|
788
|
+
];
|
|
703
789
|
|
|
704
790
|
const defaultJsonFormsI18nState = {
|
|
705
791
|
locale: 'en',
|
|
706
792
|
translate: defaultTranslator,
|
|
707
|
-
translateError: defaultErrorTranslator
|
|
793
|
+
translateError: defaultErrorTranslator,
|
|
708
794
|
};
|
|
709
795
|
const i18nReducer = (state = defaultJsonFormsI18nState, action) => {
|
|
710
796
|
switch (action.type) {
|
|
@@ -719,7 +805,7 @@ const i18nReducer = (state = defaultJsonFormsI18nState, action) => {
|
|
|
719
805
|
...state,
|
|
720
806
|
locale,
|
|
721
807
|
translate,
|
|
722
|
-
translateError
|
|
808
|
+
translateError,
|
|
723
809
|
};
|
|
724
810
|
}
|
|
725
811
|
return state;
|
|
@@ -728,12 +814,12 @@ const i18nReducer = (state = defaultJsonFormsI18nState, action) => {
|
|
|
728
814
|
return {
|
|
729
815
|
...state,
|
|
730
816
|
translate: action.translator ?? defaultTranslator,
|
|
731
|
-
translateError: action.errorTranslator ?? defaultErrorTranslator
|
|
817
|
+
translateError: action.errorTranslator ?? defaultErrorTranslator,
|
|
732
818
|
};
|
|
733
819
|
case SET_LOCALE:
|
|
734
820
|
return {
|
|
735
821
|
...state,
|
|
736
|
-
locale: action.locale ?? navigator.languages[0]
|
|
822
|
+
locale: action.locale ?? navigator.languages[0],
|
|
737
823
|
};
|
|
738
824
|
default:
|
|
739
825
|
return state;
|
|
@@ -762,10 +848,10 @@ const rendererReducer = (state = [], action) => {
|
|
|
762
848
|
switch (action.type) {
|
|
763
849
|
case ADD_RENDERER:
|
|
764
850
|
return state.concat([
|
|
765
|
-
{ tester: action.tester, renderer: action.renderer }
|
|
851
|
+
{ tester: action.tester, renderer: action.renderer },
|
|
766
852
|
]);
|
|
767
853
|
case REMOVE_RENDERER:
|
|
768
|
-
return state.filter(t => t.tester !== action.tester);
|
|
854
|
+
return state.filter((t) => t.tester !== action.tester);
|
|
769
855
|
default:
|
|
770
856
|
return state;
|
|
771
857
|
}
|
|
@@ -808,8 +894,8 @@ const schemaSubPathMatches = (subPath, predicate) => (uischema, schema, context)
|
|
|
808
894
|
}
|
|
809
895
|
return predicate(currentDataSchema, context?.rootSchema);
|
|
810
896
|
};
|
|
811
|
-
const schemaTypeIs = (expectedType) => schemaMatches(schema => !isEmpty(schema) && hasType(schema, expectedType));
|
|
812
|
-
const formatIs = (expectedFormat) => schemaMatches(schema => !isEmpty(schema) &&
|
|
897
|
+
const schemaTypeIs = (expectedType) => schemaMatches((schema) => !isEmpty(schema) && hasType(schema, expectedType));
|
|
898
|
+
const formatIs = (expectedFormat) => schemaMatches((schema) => !isEmpty(schema) &&
|
|
813
899
|
schema.format === expectedFormat &&
|
|
814
900
|
hasType(schema, 'string'));
|
|
815
901
|
const uiTypeIs = (expected) => (uischema) => !isEmpty(uischema) && uischema.type === expected;
|
|
@@ -850,12 +936,12 @@ const withIncreasedRank = (by, rankedTester) => (uischema, schema, context) => {
|
|
|
850
936
|
};
|
|
851
937
|
const isBooleanControl = and(uiTypeIs('Control'), schemaTypeIs('boolean'));
|
|
852
938
|
const isObjectControl = and(uiTypeIs('Control'), schemaTypeIs('object'));
|
|
853
|
-
const isAllOfControl = and(uiTypeIs('Control'), schemaMatches(schema => schema.hasOwnProperty('allOf')));
|
|
854
|
-
const isAnyOfControl = and(uiTypeIs('Control'), schemaMatches(schema => schema.hasOwnProperty('anyOf')));
|
|
855
|
-
const isOneOfControl = and(uiTypeIs('Control'), schemaMatches(schema => schema.hasOwnProperty('oneOf')));
|
|
856
|
-
const isEnumControl = and(uiTypeIs('Control'), or(schemaMatches(schema => schema.hasOwnProperty('enum')), schemaMatches(schema => schema.hasOwnProperty('const'))));
|
|
857
|
-
const isOneOfEnumControl = and(uiTypeIs('Control'), schemaMatches(schema => schema.hasOwnProperty('oneOf') &&
|
|
858
|
-
schema.oneOf.every(s => s.const !== undefined)));
|
|
939
|
+
const isAllOfControl = and(uiTypeIs('Control'), schemaMatches((schema) => schema.hasOwnProperty('allOf')));
|
|
940
|
+
const isAnyOfControl = and(uiTypeIs('Control'), schemaMatches((schema) => schema.hasOwnProperty('anyOf')));
|
|
941
|
+
const isOneOfControl = and(uiTypeIs('Control'), schemaMatches((schema) => schema.hasOwnProperty('oneOf')));
|
|
942
|
+
const isEnumControl = and(uiTypeIs('Control'), or(schemaMatches((schema) => schema.hasOwnProperty('enum')), schemaMatches((schema) => schema.hasOwnProperty('const'))));
|
|
943
|
+
const isOneOfEnumControl = and(uiTypeIs('Control'), schemaMatches((schema) => schema.hasOwnProperty('oneOf') &&
|
|
944
|
+
schema.oneOf.every((s) => s.const !== undefined)));
|
|
859
945
|
const isIntegerControl = and(uiTypeIs('Control'), schemaTypeIs('integer'));
|
|
860
946
|
const isNumberControl = and(uiTypeIs('Control'), schemaTypeIs('number'));
|
|
861
947
|
const isStringControl = and(uiTypeIs('Control'), schemaTypeIs('string'));
|
|
@@ -863,9 +949,12 @@ const isMultiLineControl = and(uiTypeIs('Control'), optionIs('multi', true));
|
|
|
863
949
|
const isDateControl = and(uiTypeIs('Control'), or(formatIs('date'), optionIs('format', 'date')));
|
|
864
950
|
const isTimeControl = and(uiTypeIs('Control'), or(formatIs('time'), optionIs('format', 'time')));
|
|
865
951
|
const isDateTimeControl = and(uiTypeIs('Control'), or(formatIs('date-time'), optionIs('format', 'date-time')));
|
|
866
|
-
const isObjectArray = and(schemaMatches((schema, rootSchema) => hasType(schema, 'array') &&
|
|
952
|
+
const isObjectArray = and(schemaMatches((schema, rootSchema) => hasType(schema, 'array') &&
|
|
953
|
+
!Array.isArray(resolveSchema(schema, 'items', rootSchema))
|
|
867
954
|
), schemaSubPathMatches('items', (schema, rootSchema) => {
|
|
868
|
-
const resolvedSchema = schema.$ref
|
|
955
|
+
const resolvedSchema = schema.$ref
|
|
956
|
+
? resolveSchema(rootSchema, schema.$ref, rootSchema)
|
|
957
|
+
: schema;
|
|
869
958
|
return hasType(resolvedSchema, 'object');
|
|
870
959
|
}));
|
|
871
960
|
const isObjectArrayControl = and(uiTypeIs('Control'), isObjectArray);
|
|
@@ -898,14 +987,17 @@ const isObjectArrayWithNesting = (uischema, schema, context) => {
|
|
|
898
987
|
const resolvedSchema = resolveSchema(schema, schemaPath, context?.rootSchema ?? schema);
|
|
899
988
|
let objectDepth = 0;
|
|
900
989
|
if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {
|
|
901
|
-
if (traverse(resolvedSchema.items, val => {
|
|
990
|
+
if (traverse(resolvedSchema.items, (val) => {
|
|
902
991
|
if (val === schema) {
|
|
903
992
|
return false;
|
|
904
993
|
}
|
|
905
994
|
if (val.$ref !== undefined) {
|
|
906
995
|
return false;
|
|
907
996
|
}
|
|
908
|
-
if (val.anyOf || val.
|
|
997
|
+
if (val.anyOf || val.allOf) {
|
|
998
|
+
return true;
|
|
999
|
+
}
|
|
1000
|
+
if (val.oneOf && !isOneOfEnumControl(uischema, val, context)) {
|
|
909
1001
|
return true;
|
|
910
1002
|
}
|
|
911
1003
|
if (hasType(val, 'object')) {
|
|
@@ -937,12 +1029,14 @@ const isArrayObjectControl = isObjectArrayControl;
|
|
|
937
1029
|
const isPrimitiveArrayControl = and(uiTypeIs('Control'), schemaMatches((schema, rootSchema) => deriveTypes(schema).length !== 0 &&
|
|
938
1030
|
!Array.isArray(resolveSchema(schema, 'items', rootSchema))
|
|
939
1031
|
), schemaSubPathMatches('items', (schema, rootSchema) => {
|
|
940
|
-
const resolvedSchema = schema.$ref
|
|
1032
|
+
const resolvedSchema = schema.$ref
|
|
1033
|
+
? resolveSchema(rootSchema, schema.$ref, rootSchema)
|
|
1034
|
+
: schema;
|
|
941
1035
|
const types = deriveTypes(resolvedSchema);
|
|
942
1036
|
return (types.length === 1 &&
|
|
943
1037
|
includes(['integer', 'number', 'boolean', 'string'], types[0]));
|
|
944
1038
|
}));
|
|
945
|
-
const isRangeControl = and(uiTypeIs('Control'), or(schemaTypeIs('number'), schemaTypeIs('integer')), schemaMatches(schema => schema.hasOwnProperty('maximum') &&
|
|
1039
|
+
const isRangeControl = and(uiTypeIs('Control'), or(schemaTypeIs('number'), schemaTypeIs('integer')), schemaMatches((schema) => schema.hasOwnProperty('maximum') &&
|
|
946
1040
|
schema.hasOwnProperty('minimum') &&
|
|
947
1041
|
schema.hasOwnProperty('default')), optionIs('slider', true));
|
|
948
1042
|
const isNumberFormatControl = and(uiTypeIs('Control'), schemaTypeIs('integer'), optionIs('format', true));
|
|
@@ -953,7 +1047,7 @@ const hasCategory = (categorization) => {
|
|
|
953
1047
|
return false;
|
|
954
1048
|
}
|
|
955
1049
|
return categorization.elements
|
|
956
|
-
.map(elem => isCategorization(elem) ? hasCategory(elem) : isCategory(elem))
|
|
1050
|
+
.map((elem) => isCategorization(elem) ? hasCategory(elem) : isCategory(elem))
|
|
957
1051
|
.reduce((prev, curr) => prev && curr, true);
|
|
958
1052
|
};
|
|
959
1053
|
const categorizationHasCategory = (uischema) => hasCategory(uischema);
|
|
@@ -1009,16 +1103,17 @@ const uischemaRegistryReducer = (state = [], action) => {
|
|
|
1009
1103
|
return state
|
|
1010
1104
|
.slice()
|
|
1011
1105
|
.concat({ tester: action.tester, uischema: action.uischema });
|
|
1012
|
-
case REMOVE_UI_SCHEMA:
|
|
1106
|
+
case REMOVE_UI_SCHEMA: {
|
|
1013
1107
|
const copy = state.slice();
|
|
1014
|
-
remove(copy, entry => entry.tester === action.tester);
|
|
1108
|
+
remove(copy, (entry) => entry.tester === action.tester);
|
|
1015
1109
|
return copy;
|
|
1110
|
+
}
|
|
1016
1111
|
default:
|
|
1017
1112
|
return state;
|
|
1018
1113
|
}
|
|
1019
1114
|
};
|
|
1020
1115
|
const findMatchingUISchema = (state) => (jsonSchema, schemaPath, path) => {
|
|
1021
|
-
const match = maxBy(state, entry => entry.tester(jsonSchema, schemaPath, path));
|
|
1116
|
+
const match = maxBy(state, (entry) => entry.tester(jsonSchema, schemaPath, path));
|
|
1022
1117
|
if (match !== undefined &&
|
|
1023
1118
|
match.tester(jsonSchema, schemaPath, path) !== NOT_APPLICABLE) {
|
|
1024
1119
|
return match.uischema;
|
|
@@ -1039,7 +1134,7 @@ const findUISchema = (uischemas, schema, schemaPath, path, fallback = 'VerticalL
|
|
|
1039
1134
|
if (control && control.options && control.options.detail) {
|
|
1040
1135
|
if (typeof control.options.detail === 'string') {
|
|
1041
1136
|
if (control.options.detail.toUpperCase() === 'GENERATE') {
|
|
1042
|
-
if (typeof fallback ===
|
|
1137
|
+
if (typeof fallback === 'function') {
|
|
1043
1138
|
return fallback();
|
|
1044
1139
|
}
|
|
1045
1140
|
return Generate.uiSchema(schema, fallback);
|
|
@@ -1102,7 +1197,7 @@ const toDataPathSegments = (schemaPath) => {
|
|
|
1102
1197
|
const decodedSegments = segments.map(decode);
|
|
1103
1198
|
const startFromRoot = decodedSegments[0] === '#' || decodedSegments[0] === '';
|
|
1104
1199
|
const startIndex = startFromRoot ? 2 : 1;
|
|
1105
|
-
return range(startIndex, decodedSegments.length, 2).map(idx => decodedSegments[idx]);
|
|
1200
|
+
return range(startIndex, decodedSegments.length, 2).map((idx) => decodedSegments[idx]);
|
|
1106
1201
|
};
|
|
1107
1202
|
const toDataPath = (schemaPath) => {
|
|
1108
1203
|
return toDataPathSegments(schemaPath).join('.');
|
|
@@ -1131,9 +1226,7 @@ const resolveData = (instance, dataPath) => {
|
|
|
1131
1226
|
return instance;
|
|
1132
1227
|
}
|
|
1133
1228
|
const dataPathSegments = dataPath.split('.');
|
|
1134
|
-
return dataPathSegments
|
|
1135
|
-
.map(segment => decodeURIComponent(segment))
|
|
1136
|
-
.reduce((curInstance, decodedSegment) => {
|
|
1229
|
+
return dataPathSegments.reduce((curInstance, decodedSegment) => {
|
|
1137
1230
|
if (!curInstance || !curInstance.hasOwnProperty(decodedSegment)) {
|
|
1138
1231
|
return undefined;
|
|
1139
1232
|
}
|
|
@@ -1142,13 +1235,13 @@ const resolveData = (instance, dataPath) => {
|
|
|
1142
1235
|
};
|
|
1143
1236
|
const findAllRefs = (schema, result = {}, resolveTuples = false) => {
|
|
1144
1237
|
if (isObjectSchema(schema)) {
|
|
1145
|
-
Object.keys(schema.properties).forEach(key => findAllRefs(schema.properties[key], result));
|
|
1238
|
+
Object.keys(schema.properties).forEach((key) => findAllRefs(schema.properties[key], result));
|
|
1146
1239
|
}
|
|
1147
1240
|
if (isArraySchema(schema)) {
|
|
1148
1241
|
if (Array.isArray(schema.items)) {
|
|
1149
1242
|
if (resolveTuples) {
|
|
1150
1243
|
const items = schema.items;
|
|
1151
|
-
items.forEach(child => findAllRefs(child, result));
|
|
1244
|
+
items.forEach((child) => findAllRefs(child, result));
|
|
1152
1245
|
}
|
|
1153
1246
|
}
|
|
1154
1247
|
else {
|
|
@@ -1157,7 +1250,7 @@ const findAllRefs = (schema, result = {}, resolveTuples = false) => {
|
|
|
1157
1250
|
}
|
|
1158
1251
|
if (Array.isArray(schema.anyOf)) {
|
|
1159
1252
|
const anyOf = schema.anyOf;
|
|
1160
|
-
anyOf.forEach(child => findAllRefs(child, result));
|
|
1253
|
+
anyOf.forEach((child) => findAllRefs(child, result));
|
|
1161
1254
|
}
|
|
1162
1255
|
if (schema.$ref !== undefined) {
|
|
1163
1256
|
result[schema.$ref] = schema;
|
|
@@ -1347,12 +1440,12 @@ const deriveTypes = (jsonSchema) => {
|
|
|
1347
1440
|
};
|
|
1348
1441
|
const Resolve = {
|
|
1349
1442
|
schema: resolveSchema,
|
|
1350
|
-
data: resolveData
|
|
1443
|
+
data: resolveData,
|
|
1351
1444
|
};
|
|
1352
1445
|
const fromScoped = (scopable) => toDataPathSegments(scopable.scope).join('.');
|
|
1353
1446
|
const Paths = {
|
|
1354
1447
|
compose: compose,
|
|
1355
|
-
fromScoped
|
|
1448
|
+
fromScoped,
|
|
1356
1449
|
};
|
|
1357
1450
|
const Runtime = {
|
|
1358
1451
|
isEnabled(uischema, data, ajv) {
|
|
@@ -1360,7 +1453,7 @@ const Runtime = {
|
|
|
1360
1453
|
},
|
|
1361
1454
|
isVisible(uischema, data, ajv) {
|
|
1362
1455
|
return isVisible(uischema, data, undefined, ajv);
|
|
1363
|
-
}
|
|
1456
|
+
},
|
|
1364
1457
|
};
|
|
1365
1458
|
|
|
1366
1459
|
const deriveLabel = (controlElement, schemaElement) => {
|
|
@@ -1396,7 +1489,7 @@ const createLabelDescriptionFrom = (withLabel, schema) => {
|
|
|
1396
1489
|
};
|
|
1397
1490
|
const labelDescription = (text, show) => ({
|
|
1398
1491
|
text: text,
|
|
1399
|
-
show: show
|
|
1492
|
+
show: show,
|
|
1400
1493
|
});
|
|
1401
1494
|
|
|
1402
1495
|
const isRequired = (schema, schemaPath, rootSchema) => {
|
|
@@ -1496,7 +1589,13 @@ const mapStateToControlProps = (state, ownProps) => {
|
|
|
1496
1589
|
const schema = resolvedSchema ?? rootSchema;
|
|
1497
1590
|
const t = getTranslator()(state);
|
|
1498
1591
|
const te = getErrorTranslator()(state);
|
|
1499
|
-
const
|
|
1592
|
+
const i18nKeyPrefix = getI18nKeyPrefix(schema, uischema, path);
|
|
1593
|
+
const i18nLabel = t(getI18nKey(schema, uischema, path, 'label'), label, {
|
|
1594
|
+
schema,
|
|
1595
|
+
uischema,
|
|
1596
|
+
path,
|
|
1597
|
+
errors,
|
|
1598
|
+
});
|
|
1500
1599
|
const i18nDescription = t(getI18nKey(schema, uischema, path, 'description'), description, { schema, uischema, path, errors });
|
|
1501
1600
|
const i18nErrorMessage = getCombinedErrorMessage(errors, te, t, schema, uischema, path);
|
|
1502
1601
|
return {
|
|
@@ -1513,33 +1612,34 @@ const mapStateToControlProps = (state, ownProps) => {
|
|
|
1513
1612
|
schema,
|
|
1514
1613
|
config: getConfig(state),
|
|
1515
1614
|
cells: ownProps.cells || state.jsonforms.cells,
|
|
1516
|
-
rootSchema
|
|
1615
|
+
rootSchema,
|
|
1616
|
+
i18nKeyPrefix,
|
|
1517
1617
|
};
|
|
1518
1618
|
};
|
|
1519
1619
|
const mapDispatchToControlProps = (dispatch) => ({
|
|
1520
1620
|
handleChange(path, value) {
|
|
1521
1621
|
dispatch(update(path, () => value));
|
|
1522
|
-
}
|
|
1622
|
+
},
|
|
1523
1623
|
});
|
|
1524
1624
|
const mapStateToEnumControlProps = (state, ownProps) => {
|
|
1525
1625
|
const props = mapStateToControlProps(state, ownProps);
|
|
1526
1626
|
const options = ownProps.options ||
|
|
1527
|
-
props.schema.enum?.map(e => enumToEnumOptionMapper(e, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))) ||
|
|
1627
|
+
props.schema.enum?.map((e) => enumToEnumOptionMapper(e, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))) ||
|
|
1528
1628
|
(props.schema.const && [
|
|
1529
|
-
enumToEnumOptionMapper(props.schema.const, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))
|
|
1629
|
+
enumToEnumOptionMapper(props.schema.const, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)),
|
|
1530
1630
|
]);
|
|
1531
1631
|
return {
|
|
1532
1632
|
...props,
|
|
1533
|
-
options
|
|
1633
|
+
options,
|
|
1534
1634
|
};
|
|
1535
1635
|
};
|
|
1536
1636
|
const mapStateToOneOfEnumControlProps = (state, ownProps) => {
|
|
1537
1637
|
const props = mapStateToControlProps(state, ownProps);
|
|
1538
1638
|
const options = ownProps.options ||
|
|
1539
|
-
props.schema.oneOf?.map(oneOfSubSchema => oneOfToEnumOptionMapper(oneOfSubSchema, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)));
|
|
1639
|
+
props.schema.oneOf?.map((oneOfSubSchema) => oneOfToEnumOptionMapper(oneOfSubSchema, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)));
|
|
1540
1640
|
return {
|
|
1541
1641
|
...props,
|
|
1542
|
-
options
|
|
1642
|
+
options,
|
|
1543
1643
|
};
|
|
1544
1644
|
};
|
|
1545
1645
|
const mapStateToMultiEnumControlProps = (state, ownProps) => {
|
|
@@ -1547,17 +1647,17 @@ const mapStateToMultiEnumControlProps = (state, ownProps) => {
|
|
|
1547
1647
|
const items = props.schema.items;
|
|
1548
1648
|
const options = ownProps.options ||
|
|
1549
1649
|
(items?.oneOf &&
|
|
1550
|
-
items.oneOf.map(oneOfSubSchema => oneOfToEnumOptionMapper(oneOfSubSchema, state.jsonforms.i18n?.translate, getI18nKeyPrefix(props.schema, props.uischema, props.path)))) ||
|
|
1551
|
-
items?.enum?.map(e => enumToEnumOptionMapper(e, state.jsonforms.i18n?.translate, getI18nKeyPrefix(props.schema, props.uischema, props.path)));
|
|
1650
|
+
items.oneOf.map((oneOfSubSchema) => oneOfToEnumOptionMapper(oneOfSubSchema, state.jsonforms.i18n?.translate, getI18nKeyPrefix(props.schema, props.uischema, props.path)))) ||
|
|
1651
|
+
items?.enum?.map((e) => enumToEnumOptionMapper(e, state.jsonforms.i18n?.translate, getI18nKeyPrefix(props.schema, props.uischema, props.path)));
|
|
1552
1652
|
return {
|
|
1553
1653
|
...props,
|
|
1554
|
-
options
|
|
1654
|
+
options,
|
|
1555
1655
|
};
|
|
1556
1656
|
};
|
|
1557
1657
|
const mapStateToMasterListItemProps = (state, ownProps) => {
|
|
1558
1658
|
const { schema, path, index } = ownProps;
|
|
1559
1659
|
const firstPrimitiveProp = schema.properties
|
|
1560
|
-
? find(Object.keys(schema.properties), propName => {
|
|
1660
|
+
? find(Object.keys(schema.properties), (propName) => {
|
|
1561
1661
|
const prop = schema.properties[propName];
|
|
1562
1662
|
return (prop.type === 'string' ||
|
|
1563
1663
|
prop.type === 'number' ||
|
|
@@ -1569,33 +1669,36 @@ const mapStateToMasterListItemProps = (state, ownProps) => {
|
|
|
1569
1669
|
const childLabel = firstPrimitiveProp ? childData[firstPrimitiveProp] : '';
|
|
1570
1670
|
return {
|
|
1571
1671
|
...ownProps,
|
|
1572
|
-
childLabel
|
|
1672
|
+
childLabel,
|
|
1573
1673
|
};
|
|
1574
1674
|
};
|
|
1575
1675
|
const mapStateToControlWithDetailProps = (state, ownProps) => {
|
|
1576
1676
|
const { ...props } = mapStateToControlProps(state, ownProps);
|
|
1577
1677
|
return {
|
|
1578
1678
|
...props,
|
|
1579
|
-
uischemas: state.jsonforms.uischemas
|
|
1679
|
+
uischemas: state.jsonforms.uischemas,
|
|
1580
1680
|
};
|
|
1581
1681
|
};
|
|
1582
1682
|
const mapStateToArrayControlProps = (state, ownProps) => {
|
|
1583
|
-
const { path, schema, uischema, ...props } = mapStateToControlWithDetailProps(state, ownProps);
|
|
1683
|
+
const { path, schema, uischema, i18nKeyPrefix, label, ...props } = mapStateToControlWithDetailProps(state, ownProps);
|
|
1584
1684
|
const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);
|
|
1585
1685
|
const childErrors = getSubErrorsAt(path, resolvedSchema)(state);
|
|
1686
|
+
const t = getTranslator()(state);
|
|
1586
1687
|
return {
|
|
1587
1688
|
...props,
|
|
1689
|
+
label,
|
|
1588
1690
|
path,
|
|
1589
1691
|
uischema,
|
|
1590
1692
|
schema: resolvedSchema,
|
|
1591
1693
|
childErrors,
|
|
1592
1694
|
renderers: ownProps.renderers || getRenderers(state),
|
|
1593
|
-
cells: ownProps.cells || getCells(state)
|
|
1695
|
+
cells: ownProps.cells || getCells(state),
|
|
1696
|
+
translations: getArrayTranslations(t, arrayDefaultTranslations, i18nKeyPrefix, label),
|
|
1594
1697
|
};
|
|
1595
1698
|
};
|
|
1596
1699
|
const mapDispatchToArrayControlProps = (dispatch) => ({
|
|
1597
1700
|
addItem: (path, value) => () => {
|
|
1598
|
-
dispatch(update(path, array => {
|
|
1701
|
+
dispatch(update(path, (array) => {
|
|
1599
1702
|
if (array === undefined || array === null) {
|
|
1600
1703
|
return [value];
|
|
1601
1704
|
}
|
|
@@ -1604,30 +1707,30 @@ const mapDispatchToArrayControlProps = (dispatch) => ({
|
|
|
1604
1707
|
}));
|
|
1605
1708
|
},
|
|
1606
1709
|
removeItems: (path, toDelete) => () => {
|
|
1607
|
-
dispatch(update(path, array => {
|
|
1710
|
+
dispatch(update(path, (array) => {
|
|
1608
1711
|
toDelete
|
|
1609
1712
|
.sort()
|
|
1610
1713
|
.reverse()
|
|
1611
|
-
.forEach(s => array.splice(s, 1));
|
|
1714
|
+
.forEach((s) => array.splice(s, 1));
|
|
1612
1715
|
return array;
|
|
1613
1716
|
}));
|
|
1614
1717
|
},
|
|
1615
1718
|
moveUp: (path, toMove) => () => {
|
|
1616
|
-
dispatch(update(path, array => {
|
|
1719
|
+
dispatch(update(path, (array) => {
|
|
1617
1720
|
moveUp(array, toMove);
|
|
1618
1721
|
return array;
|
|
1619
1722
|
}));
|
|
1620
1723
|
},
|
|
1621
1724
|
moveDown: (path, toMove) => () => {
|
|
1622
|
-
dispatch(update(path, array => {
|
|
1725
|
+
dispatch(update(path, (array) => {
|
|
1623
1726
|
moveDown(array, toMove);
|
|
1624
1727
|
return array;
|
|
1625
1728
|
}));
|
|
1626
|
-
}
|
|
1729
|
+
},
|
|
1627
1730
|
});
|
|
1628
1731
|
const mapDispatchToMultiEnumProps = (dispatch) => ({
|
|
1629
1732
|
addItem: (path, value) => {
|
|
1630
|
-
dispatch(update(path, data => {
|
|
1733
|
+
dispatch(update(path, (data) => {
|
|
1631
1734
|
if (data === undefined || data === null) {
|
|
1632
1735
|
return [value];
|
|
1633
1736
|
}
|
|
@@ -1636,18 +1739,18 @@ const mapDispatchToMultiEnumProps = (dispatch) => ({
|
|
|
1636
1739
|
}));
|
|
1637
1740
|
},
|
|
1638
1741
|
removeItem: (path, toDelete) => {
|
|
1639
|
-
dispatch(update(path, data => {
|
|
1742
|
+
dispatch(update(path, (data) => {
|
|
1640
1743
|
const indexInData = data.indexOf(toDelete);
|
|
1641
1744
|
data.splice(indexInData, 1);
|
|
1642
1745
|
return data;
|
|
1643
1746
|
}));
|
|
1644
|
-
}
|
|
1747
|
+
},
|
|
1645
1748
|
});
|
|
1646
1749
|
const layoutDefaultProps = {
|
|
1647
1750
|
visible: true,
|
|
1648
1751
|
enabled: true,
|
|
1649
1752
|
path: '',
|
|
1650
|
-
direction: 'column'
|
|
1753
|
+
direction: 'column',
|
|
1651
1754
|
};
|
|
1652
1755
|
const getDirection = (uischema) => {
|
|
1653
1756
|
if (uischema.type === 'HorizontalLayout') {
|
|
@@ -1669,7 +1772,9 @@ const mapStateToLayoutProps = (state, ownProps) => {
|
|
|
1669
1772
|
const enabled = isInherentlyEnabled(state, ownProps, uischema, undefined,
|
|
1670
1773
|
rootData, config);
|
|
1671
1774
|
const t = getTranslator()(state);
|
|
1672
|
-
const label = isLabelable(uischema)
|
|
1775
|
+
const label = isLabelable(uischema)
|
|
1776
|
+
? deriveLabelForUISchemaElement(uischema, t)
|
|
1777
|
+
: undefined;
|
|
1673
1778
|
return {
|
|
1674
1779
|
...layoutDefaultProps,
|
|
1675
1780
|
renderers: ownProps.renderers || getRenderers(state),
|
|
@@ -1682,7 +1787,7 @@ const mapStateToLayoutProps = (state, ownProps) => {
|
|
|
1682
1787
|
schema: ownProps.schema,
|
|
1683
1788
|
direction: ownProps.direction ?? getDirection(uischema),
|
|
1684
1789
|
config,
|
|
1685
|
-
label
|
|
1790
|
+
label,
|
|
1686
1791
|
};
|
|
1687
1792
|
};
|
|
1688
1793
|
const mapStateToJsonFormsRendererProps = (state, ownProps) => {
|
|
@@ -1694,12 +1799,12 @@ const mapStateToJsonFormsRendererProps = (state, ownProps) => {
|
|
|
1694
1799
|
uischema: ownProps.uischema || getUiSchema(state),
|
|
1695
1800
|
path: ownProps.path,
|
|
1696
1801
|
enabled: ownProps.enabled,
|
|
1697
|
-
config: getConfig(state)
|
|
1802
|
+
config: getConfig(state),
|
|
1698
1803
|
};
|
|
1699
1804
|
};
|
|
1700
1805
|
const controlDefaultProps = {
|
|
1701
1806
|
...layoutDefaultProps,
|
|
1702
|
-
errors: []
|
|
1807
|
+
errors: [],
|
|
1703
1808
|
};
|
|
1704
1809
|
const mapStateToCombinatorRendererProps = (state, ownProps, keyword) => {
|
|
1705
1810
|
const { data, schema, rootSchema, ...props } = mapStateToControlProps(state, ownProps);
|
|
@@ -1709,12 +1814,12 @@ const mapStateToCombinatorRendererProps = (state, ownProps, keyword) => {
|
|
|
1709
1814
|
'additionalProperties',
|
|
1710
1815
|
'type',
|
|
1711
1816
|
'enum',
|
|
1712
|
-
'const'
|
|
1817
|
+
'const',
|
|
1713
1818
|
];
|
|
1714
1819
|
const dataIsValid = (errors) => {
|
|
1715
1820
|
return (!errors ||
|
|
1716
1821
|
errors.length === 0 ||
|
|
1717
|
-
!errors.find(e => structuralKeywords.indexOf(e.keyword) !== -1));
|
|
1822
|
+
!errors.find((e) => structuralKeywords.indexOf(e.keyword) !== -1));
|
|
1718
1823
|
};
|
|
1719
1824
|
let indexOfFittingSchema;
|
|
1720
1825
|
for (let i = 0; i < schema[keyword]?.length; i++) {
|
|
@@ -1740,7 +1845,7 @@ const mapStateToCombinatorRendererProps = (state, ownProps, keyword) => {
|
|
|
1740
1845
|
rootSchema,
|
|
1741
1846
|
...props,
|
|
1742
1847
|
indexOfFittingSchema,
|
|
1743
|
-
uischemas: getUISchemas(state)
|
|
1848
|
+
uischemas: getUISchemas(state),
|
|
1744
1849
|
};
|
|
1745
1850
|
};
|
|
1746
1851
|
const mapStateToAllOfProps = (state, ownProps) => mapStateToCombinatorRendererProps(state, ownProps, 'allOf');
|
|
@@ -1751,20 +1856,23 @@ const mapStateToOneOfProps = (state, ownProps) => {
|
|
|
1751
1856
|
return mapStateToCombinatorRendererProps(state, ownProps, 'oneOf');
|
|
1752
1857
|
};
|
|
1753
1858
|
const mapStateToArrayLayoutProps = (state, ownProps) => {
|
|
1754
|
-
const { path, schema, uischema, errors, ...props } = mapStateToControlWithDetailProps(state, ownProps);
|
|
1859
|
+
const { path, schema, uischema, errors, i18nKeyPrefix, label, ...props } = mapStateToControlWithDetailProps(state, ownProps);
|
|
1755
1860
|
const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);
|
|
1756
|
-
const
|
|
1861
|
+
const t = getTranslator()(state);
|
|
1862
|
+
const childErrors = getCombinedErrorMessage(getSubErrorsAt(path, resolvedSchema)(state), getErrorTranslator()(state), t, undefined, undefined, undefined);
|
|
1757
1863
|
const allErrors = errors +
|
|
1758
1864
|
(errors.length > 0 && childErrors.length > 0 ? '\n' : '') +
|
|
1759
1865
|
childErrors;
|
|
1760
1866
|
return {
|
|
1761
1867
|
...props,
|
|
1868
|
+
label,
|
|
1762
1869
|
path,
|
|
1763
1870
|
uischema,
|
|
1764
1871
|
schema: resolvedSchema,
|
|
1765
1872
|
data: props.data ? props.data.length : 0,
|
|
1766
1873
|
errors: allErrors,
|
|
1767
|
-
minItems: schema.minItems
|
|
1874
|
+
minItems: schema.minItems,
|
|
1875
|
+
translations: getArrayTranslations(t, arrayDefaultTranslations, i18nKeyPrefix, label),
|
|
1768
1876
|
};
|
|
1769
1877
|
};
|
|
1770
1878
|
const mapStateToLabelProps = (state, props) => {
|
|
@@ -1804,7 +1912,9 @@ const mapStateToCellProps = (state, ownProps) => {
|
|
|
1804
1912
|
else {
|
|
1805
1913
|
enabled = isInherentlyEnabled(state, ownProps, uischema, schema || rootSchema, rootData, config);
|
|
1806
1914
|
}
|
|
1807
|
-
const
|
|
1915
|
+
const t = getTranslator()(state);
|
|
1916
|
+
const te = getErrorTranslator()(state);
|
|
1917
|
+
const errors = getCombinedErrorMessage(getErrorAt(path, schema)(state), te, t, schema, uischema, path);
|
|
1808
1918
|
const isValid = isEmpty(errors);
|
|
1809
1919
|
return {
|
|
1810
1920
|
data: Resolve.data(rootData, path),
|
|
@@ -1819,37 +1929,37 @@ const mapStateToCellProps = (state, ownProps) => {
|
|
|
1819
1929
|
config: getConfig(state),
|
|
1820
1930
|
rootSchema,
|
|
1821
1931
|
renderers,
|
|
1822
|
-
cells
|
|
1932
|
+
cells,
|
|
1823
1933
|
};
|
|
1824
1934
|
};
|
|
1825
1935
|
const mapStateToDispatchCellProps = (state, ownProps) => {
|
|
1826
1936
|
const props = mapStateToCellProps(state, ownProps);
|
|
1827
|
-
const { renderers, cells, ...otherOwnProps } = ownProps;
|
|
1937
|
+
const { renderers: _renderers, cells, ...otherOwnProps } = ownProps;
|
|
1828
1938
|
return {
|
|
1829
1939
|
...props,
|
|
1830
1940
|
...otherOwnProps,
|
|
1831
|
-
cells: cells || state.jsonforms.cells || []
|
|
1941
|
+
cells: cells || state.jsonforms.cells || [],
|
|
1832
1942
|
};
|
|
1833
1943
|
};
|
|
1834
1944
|
const defaultMapStateToEnumCellProps = (state, ownProps) => {
|
|
1835
1945
|
const props = mapStateToCellProps(state, ownProps);
|
|
1836
1946
|
const options = ownProps.options ||
|
|
1837
|
-
props.schema.enum?.map(e => enumToEnumOptionMapper(e, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))) ||
|
|
1947
|
+
props.schema.enum?.map((e) => enumToEnumOptionMapper(e, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))) ||
|
|
1838
1948
|
(props.schema.const && [
|
|
1839
|
-
enumToEnumOptionMapper(props.schema.const, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))
|
|
1949
|
+
enumToEnumOptionMapper(props.schema.const, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)),
|
|
1840
1950
|
]);
|
|
1841
1951
|
return {
|
|
1842
1952
|
...props,
|
|
1843
|
-
options
|
|
1953
|
+
options,
|
|
1844
1954
|
};
|
|
1845
1955
|
};
|
|
1846
1956
|
const mapStateToOneOfEnumCellProps = (state, ownProps) => {
|
|
1847
1957
|
const props = mapStateToCellProps(state, ownProps);
|
|
1848
1958
|
const options = ownProps.options ||
|
|
1849
|
-
props.schema.oneOf?.map(oneOfSubSchema => oneOfToEnumOptionMapper(oneOfSubSchema, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)));
|
|
1959
|
+
props.schema.oneOf?.map((oneOfSubSchema) => oneOfToEnumOptionMapper(oneOfSubSchema, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)));
|
|
1850
1960
|
return {
|
|
1851
1961
|
...props,
|
|
1852
|
-
options
|
|
1962
|
+
options,
|
|
1853
1963
|
};
|
|
1854
1964
|
};
|
|
1855
1965
|
const mapDispatchToCellProps = mapDispatchToControlProps;
|
|
@@ -1857,7 +1967,7 @@ const defaultMapDispatchToControlProps =
|
|
|
1857
1967
|
(dispatch, ownProps) => {
|
|
1858
1968
|
const { handleChange } = mapDispatchToCellProps(dispatch);
|
|
1859
1969
|
return {
|
|
1860
|
-
handleChange: ownProps.handleChange || handleChange
|
|
1970
|
+
handleChange: ownProps.handleChange || handleChange,
|
|
1861
1971
|
};
|
|
1862
1972
|
};
|
|
1863
1973
|
|
|
@@ -1870,11 +1980,13 @@ const createLabel = (subSchema, subSchemaIndex, keyword) => {
|
|
|
1870
1980
|
}
|
|
1871
1981
|
};
|
|
1872
1982
|
const createCombinatorRenderInfos = (combinatorSubSchemas, rootSchema, keyword, control, path, uischemas) => combinatorSubSchemas.map((subSchema, subSchemaIndex) => {
|
|
1873
|
-
const schema = subSchema.$ref
|
|
1983
|
+
const schema = subSchema.$ref
|
|
1984
|
+
? Resolve.schema(rootSchema, subSchema.$ref, rootSchema)
|
|
1985
|
+
: subSchema;
|
|
1874
1986
|
return {
|
|
1875
1987
|
schema,
|
|
1876
1988
|
uischema: findUISchema(uischemas, schema, control.scope, path, undefined, control, rootSchema),
|
|
1877
|
-
label: createLabel(subSchema, subSchemaIndex, keyword)
|
|
1989
|
+
label: createLabel(subSchema, subSchemaIndex, keyword),
|
|
1878
1990
|
};
|
|
1879
1991
|
});
|
|
1880
1992
|
|
|
@@ -1901,7 +2013,7 @@ const clearAllIds = () => usedIds.clear();
|
|
|
1901
2013
|
|
|
1902
2014
|
const getFirstPrimitiveProp = (schema) => {
|
|
1903
2015
|
if (schema.properties) {
|
|
1904
|
-
return find(Object.keys(schema.properties), propName => {
|
|
2016
|
+
return find(Object.keys(schema.properties), (propName) => {
|
|
1905
2017
|
const prop = schema.properties[propName];
|
|
1906
2018
|
return (prop.type === 'string' ||
|
|
1907
2019
|
prop.type === 'number' ||
|
|
@@ -1928,7 +2040,7 @@ const iterateSchema = (uischema, toApply) => {
|
|
|
1928
2040
|
return;
|
|
1929
2041
|
}
|
|
1930
2042
|
if (isLayout(uischema)) {
|
|
1931
|
-
uischema.elements.forEach(child => iterateSchema(child, toApply));
|
|
2043
|
+
uischema.elements.forEach((child) => iterateSchema(child, toApply));
|
|
1932
2044
|
return;
|
|
1933
2045
|
}
|
|
1934
2046
|
toApply(uischema);
|
|
@@ -1939,7 +2051,7 @@ const createAjv = (options) => {
|
|
|
1939
2051
|
allErrors: true,
|
|
1940
2052
|
verbose: true,
|
|
1941
2053
|
strict: false,
|
|
1942
|
-
...options
|
|
2054
|
+
...options,
|
|
1943
2055
|
});
|
|
1944
2056
|
addFormats(ajv);
|
|
1945
2057
|
return ajv;
|
|
@@ -1947,11 +2059,11 @@ const createAjv = (options) => {
|
|
|
1947
2059
|
|
|
1948
2060
|
const createLayout = (layoutType) => ({
|
|
1949
2061
|
type: layoutType,
|
|
1950
|
-
elements: []
|
|
2062
|
+
elements: [],
|
|
1951
2063
|
});
|
|
1952
2064
|
const createControlElement = (ref) => ({
|
|
1953
2065
|
type: 'Control',
|
|
1954
|
-
scope: ref
|
|
2066
|
+
scope: ref,
|
|
1955
2067
|
});
|
|
1956
2068
|
const wrapInLayoutIfNecessary = (uischema, layoutType) => {
|
|
1957
2069
|
if (!isEmpty(uischema) && !isLayout(uischema)) {
|
|
@@ -1970,7 +2082,7 @@ const addLabel = (layout, labelName) => {
|
|
|
1970
2082
|
else {
|
|
1971
2083
|
const label = {
|
|
1972
2084
|
type: 'Label',
|
|
1973
|
-
text: fixedLabel
|
|
2085
|
+
text: fixedLabel,
|
|
1974
2086
|
};
|
|
1975
2087
|
layout.elements.push(label);
|
|
1976
2088
|
}
|
|
@@ -2008,7 +2120,7 @@ const generateUISchema = (jsonSchema, schemaElements, currentRef, schemaName, la
|
|
|
2008
2120
|
}
|
|
2009
2121
|
if (!isEmpty(jsonSchema.properties)) {
|
|
2010
2122
|
const nextRef = currentRef + '/properties';
|
|
2011
|
-
Object.keys(jsonSchema.properties).map(propName => {
|
|
2123
|
+
Object.keys(jsonSchema.properties).map((propName) => {
|
|
2012
2124
|
let value = jsonSchema.properties[propName];
|
|
2013
2125
|
const ref = `${nextRef}/${encode(propName)}`;
|
|
2014
2126
|
if (value.$ref !== undefined) {
|
|
@@ -2025,10 +2137,11 @@ const generateUISchema = (jsonSchema, schemaElements, currentRef, schemaName, la
|
|
|
2025
2137
|
case 'string':
|
|
2026
2138
|
case 'number':
|
|
2027
2139
|
case 'integer':
|
|
2028
|
-
case 'boolean':
|
|
2140
|
+
case 'boolean': {
|
|
2029
2141
|
const controlObject = createControlElement(currentRef);
|
|
2030
2142
|
schemaElements.push(controlObject);
|
|
2031
2143
|
return controlObject;
|
|
2144
|
+
}
|
|
2032
2145
|
default:
|
|
2033
2146
|
throw new Error('Unknown type: ' + JSON.stringify(jsonSchema));
|
|
2034
2147
|
}
|
|
@@ -2038,11 +2151,11 @@ const generateDefaultUISchema = (jsonSchema, layoutType = 'VerticalLayout', pref
|
|
|
2038
2151
|
const Generate = {
|
|
2039
2152
|
jsonSchema: generateJsonSchema,
|
|
2040
2153
|
uiSchema: generateDefaultUISchema,
|
|
2041
|
-
controlElement: createControlElement
|
|
2154
|
+
controlElement: createControlElement,
|
|
2042
2155
|
};
|
|
2043
2156
|
|
|
2044
2157
|
const INIT = 'jsonforms/INIT';
|
|
2045
|
-
const UPDATE_CORE =
|
|
2158
|
+
const UPDATE_CORE = 'jsonforms/UPDATE_CORE';
|
|
2046
2159
|
const SET_AJV = 'jsonforms/SET_AJV';
|
|
2047
2160
|
const UPDATE_DATA = 'jsonforms/UPDATE';
|
|
2048
2161
|
const UPDATE_ERRORS = 'jsonforms/UPDATE_ERRORS';
|
|
@@ -2052,115 +2165,115 @@ const REMOVE_RENDERER = 'jsonforms/REMOVE_RENDERER';
|
|
|
2052
2165
|
const ADD_CELL = 'jsonforms/ADD_CELL';
|
|
2053
2166
|
const REMOVE_CELL = 'jsonforms/REMOVE_CELL';
|
|
2054
2167
|
const SET_CONFIG = 'jsonforms/SET_CONFIG';
|
|
2055
|
-
const ADD_UI_SCHEMA =
|
|
2056
|
-
const REMOVE_UI_SCHEMA =
|
|
2057
|
-
const SET_SCHEMA =
|
|
2058
|
-
const SET_UISCHEMA =
|
|
2168
|
+
const ADD_UI_SCHEMA = 'jsonforms/ADD_UI_SCHEMA';
|
|
2169
|
+
const REMOVE_UI_SCHEMA = 'jsonforms/REMOVE_UI_SCHEMA';
|
|
2170
|
+
const SET_SCHEMA = 'jsonforms/SET_SCHEMA';
|
|
2171
|
+
const SET_UISCHEMA = 'jsonforms/SET_UISCHEMA';
|
|
2059
2172
|
const SET_VALIDATION_MODE = 'jsonforms/SET_VALIDATION_MODE';
|
|
2060
|
-
const SET_LOCALE =
|
|
2173
|
+
const SET_LOCALE = 'jsonforms/SET_LOCALE';
|
|
2061
2174
|
const SET_TRANSLATOR = 'jsonforms/SET_TRANSLATOR';
|
|
2062
2175
|
const UPDATE_I18N = 'jsonforms/UPDATE_I18N';
|
|
2063
|
-
const ADD_DEFAULT_DATA =
|
|
2064
|
-
const REMOVE_DEFAULT_DATA =
|
|
2176
|
+
const ADD_DEFAULT_DATA = 'jsonforms/ADD_DEFAULT_DATA';
|
|
2177
|
+
const REMOVE_DEFAULT_DATA = 'jsonforms/REMOVE_DEFAULT_DATA';
|
|
2065
2178
|
const init = (data, schema = generateJsonSchema(data), uischema, options) => ({
|
|
2066
2179
|
type: INIT,
|
|
2067
2180
|
data,
|
|
2068
2181
|
schema,
|
|
2069
2182
|
uischema: typeof uischema === 'object' ? uischema : generateDefaultUISchema(schema),
|
|
2070
|
-
options
|
|
2183
|
+
options,
|
|
2071
2184
|
});
|
|
2072
2185
|
const updateCore = (data, schema, uischema, options) => ({
|
|
2073
2186
|
type: UPDATE_CORE,
|
|
2074
2187
|
data,
|
|
2075
2188
|
schema,
|
|
2076
2189
|
uischema,
|
|
2077
|
-
options
|
|
2190
|
+
options,
|
|
2078
2191
|
});
|
|
2079
2192
|
const registerDefaultData = (schemaPath, data) => ({
|
|
2080
2193
|
type: ADD_DEFAULT_DATA,
|
|
2081
2194
|
schemaPath,
|
|
2082
|
-
data
|
|
2195
|
+
data,
|
|
2083
2196
|
});
|
|
2084
2197
|
const unregisterDefaultData = (schemaPath) => ({
|
|
2085
2198
|
type: REMOVE_DEFAULT_DATA,
|
|
2086
|
-
schemaPath
|
|
2199
|
+
schemaPath,
|
|
2087
2200
|
});
|
|
2088
2201
|
const setAjv = (ajv) => ({
|
|
2089
2202
|
type: SET_AJV,
|
|
2090
|
-
ajv
|
|
2203
|
+
ajv,
|
|
2091
2204
|
});
|
|
2092
2205
|
const update = (path, updater) => ({
|
|
2093
2206
|
type: UPDATE_DATA,
|
|
2094
2207
|
path,
|
|
2095
|
-
updater
|
|
2208
|
+
updater,
|
|
2096
2209
|
});
|
|
2097
2210
|
const updateErrors = (errors) => ({
|
|
2098
2211
|
type: UPDATE_ERRORS,
|
|
2099
|
-
errors
|
|
2212
|
+
errors,
|
|
2100
2213
|
});
|
|
2101
2214
|
const registerRenderer = (tester, renderer) => ({
|
|
2102
2215
|
type: ADD_RENDERER,
|
|
2103
2216
|
tester,
|
|
2104
|
-
renderer
|
|
2217
|
+
renderer,
|
|
2105
2218
|
});
|
|
2106
2219
|
const registerCell = (tester, cell) => ({
|
|
2107
2220
|
type: ADD_CELL,
|
|
2108
2221
|
tester,
|
|
2109
|
-
cell
|
|
2222
|
+
cell,
|
|
2110
2223
|
});
|
|
2111
2224
|
const unregisterCell = (tester, cell) => ({
|
|
2112
2225
|
type: REMOVE_CELL,
|
|
2113
2226
|
tester,
|
|
2114
|
-
cell
|
|
2227
|
+
cell,
|
|
2115
2228
|
});
|
|
2116
2229
|
const unregisterRenderer = (tester, renderer) => ({
|
|
2117
2230
|
type: REMOVE_RENDERER,
|
|
2118
2231
|
tester,
|
|
2119
|
-
renderer
|
|
2232
|
+
renderer,
|
|
2120
2233
|
});
|
|
2121
2234
|
const setConfig = (config) => ({
|
|
2122
2235
|
type: SET_CONFIG,
|
|
2123
|
-
config
|
|
2236
|
+
config,
|
|
2124
2237
|
});
|
|
2125
2238
|
const setValidationMode = (validationMode) => ({
|
|
2126
2239
|
type: SET_VALIDATION_MODE,
|
|
2127
|
-
validationMode
|
|
2240
|
+
validationMode,
|
|
2128
2241
|
});
|
|
2129
2242
|
const registerUISchema = (tester, uischema) => {
|
|
2130
2243
|
return {
|
|
2131
2244
|
type: ADD_UI_SCHEMA,
|
|
2132
2245
|
tester,
|
|
2133
|
-
uischema
|
|
2246
|
+
uischema,
|
|
2134
2247
|
};
|
|
2135
2248
|
};
|
|
2136
2249
|
const unregisterUISchema = (tester) => {
|
|
2137
2250
|
return {
|
|
2138
2251
|
type: REMOVE_UI_SCHEMA,
|
|
2139
|
-
tester
|
|
2252
|
+
tester,
|
|
2140
2253
|
};
|
|
2141
2254
|
};
|
|
2142
2255
|
const setLocale = (locale) => ({
|
|
2143
2256
|
type: SET_LOCALE,
|
|
2144
|
-
locale
|
|
2257
|
+
locale,
|
|
2145
2258
|
});
|
|
2146
2259
|
const setSchema = (schema) => ({
|
|
2147
2260
|
type: SET_SCHEMA,
|
|
2148
|
-
schema
|
|
2261
|
+
schema,
|
|
2149
2262
|
});
|
|
2150
2263
|
const setTranslator = (translator, errorTranslator) => ({
|
|
2151
2264
|
type: SET_TRANSLATOR,
|
|
2152
2265
|
translator,
|
|
2153
|
-
errorTranslator
|
|
2266
|
+
errorTranslator,
|
|
2154
2267
|
});
|
|
2155
2268
|
const updateI18n = (locale, translator, errorTranslator) => ({
|
|
2156
2269
|
type: UPDATE_I18N,
|
|
2157
2270
|
locale,
|
|
2158
2271
|
translator,
|
|
2159
|
-
errorTranslator
|
|
2272
|
+
errorTranslator,
|
|
2160
2273
|
});
|
|
2161
2274
|
const setUISchema = (uischema) => ({
|
|
2162
2275
|
type: SET_UISCHEMA,
|
|
2163
|
-
uischema
|
|
2276
|
+
uischema,
|
|
2164
2277
|
});
|
|
2165
2278
|
|
|
2166
2279
|
var index = /*#__PURE__*/Object.freeze({
|
|
@@ -2210,8 +2323,8 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
2210
2323
|
|
|
2211
2324
|
const Helpers = {
|
|
2212
2325
|
createLabelDescriptionFrom,
|
|
2213
|
-
convertToValidClassName
|
|
2326
|
+
convertToValidClassName,
|
|
2214
2327
|
};
|
|
2215
2328
|
|
|
2216
|
-
export { ADD_CELL, ADD_DEFAULT_DATA, ADD_RENDERER, ADD_UI_SCHEMA, index as Actions, Draft4, Generate, Helpers, INIT, NOT_APPLICABLE, Paths, REMOVE_CELL, REMOVE_DEFAULT_DATA, REMOVE_RENDERER, REMOVE_UI_SCHEMA, Resolve, RuleEffect, Runtime, SET_AJV, SET_CONFIG, SET_LOCALE, SET_SCHEMA, SET_TRANSLATOR, SET_UISCHEMA, SET_VALIDATION_MODE, index$1 as Test, UPDATE_CORE, UPDATE_DATA, UPDATE_ERRORS, UPDATE_I18N, VALIDATE, and, categorizationHasCategory, cellReducer, clearAllIds, compose, compose as composePaths, composeWithUi, computeLabel, configReducer, controlDefaultProps, convertToValidClassName, coreReducer, createAjv, createCleanLabel, createCombinatorRenderInfos, createControlElement, createDefaultValue, createId, createLabelDescriptionFrom, decode, defaultDataReducer, defaultErrorTranslator, defaultJsonFormsI18nState, defaultMapDispatchToControlProps, defaultMapStateToEnumCellProps, defaultTranslator, deriveLabelForUISchemaElement, deriveTypes, encode, enumToEnumOptionMapper, errorAt, errorsAt, evalEnablement, evalVisibility, extractAjv, extractData, extractDefaultData, extractSchema, extractUiSchema, fetchErrorTranslator, fetchLocale, fetchTranslator, findAllRefs, findMatchingUISchema, findUISchema, formatErrorMessage, formatIs, generateDefaultUISchema, generateJsonSchema, getAjv, getCells, getCombinedErrorMessage, getConfig, getControlPath, getData, getDefaultData, getErrorAt, getErrorTranslator, getFirstPrimitiveProp, getI18nKey, getI18nKeyPrefix, getI18nKeyPrefixBySchema, getLocale, getRenderers, getSchema, getSubErrorsAt, getTranslator, getUISchemas, getUiSchema, hasCategory, hasEnableRule, hasShowRule, hasType, i18nReducer, init, isAllOfControl, isAnyOfControl, isArrayObjectControl, isBooleanControl, isCategorization, isCategory, isControl, isDateControl, isDateTimeControl, isDescriptionHidden, isEnabled, isEnumControl, isGroup, isInherentlyEnabled, isIntegerControl, isInternationalized, isLabelable, isLabeled, isLayout, isMultiLineControl, isNumberControl, isNumberFormatControl, isObjectArray, isObjectArrayControl, isObjectArrayWithNesting, isObjectControl, isOneOfControl, isOneOfEnumControl, isPrimitiveArrayControl, isRangeControl, isScopable, isScoped, isStringControl, isTimeControl, isVisible, iterateSchema, jsonFormsReducerConfig, layoutDefaultProps, mapDispatchToArrayControlProps, mapDispatchToCellProps, mapDispatchToControlProps, mapDispatchToMultiEnumProps, mapStateToAllOfProps, mapStateToAnyOfProps, mapStateToArrayControlProps, mapStateToArrayLayoutProps, mapStateToCellProps, mapStateToCombinatorRendererProps, mapStateToControlProps, mapStateToControlWithDetailProps, mapStateToDispatchCellProps, mapStateToEnumControlProps, mapStateToJsonFormsRendererProps, mapStateToLabelProps, mapStateToLayoutProps, mapStateToMasterListItemProps, mapStateToMultiEnumControlProps, mapStateToOneOfEnumCellProps, mapStateToOneOfEnumControlProps, mapStateToOneOfProps, moveDown, moveUp, not, oneOfToEnumOptionMapper, optionIs, or, rankWith, registerCell, registerDefaultData, registerRenderer, registerUISchema, removeId, rendererReducer, resolveData, resolveSchema, schemaMatches, schemaSubPathMatches, schemaTypeIs, scopeEndIs, scopeEndsWith, setAjv, setConfig, setLocale, setReadonly, setSchema, setTranslator, setUISchema, setValidationMode, showAsRequired, subErrorsAt, toDataPath, toDataPathSegments, transformPathToI18nPrefix, uiTypeIs, uischemaRegistryReducer, unregisterCell, unregisterDefaultData, unregisterRenderer, unregisterUISchema, unsetReadonly, update, updateCore, updateErrors, updateI18n, validate, withIncreasedRank };
|
|
2329
|
+
export { ADD_CELL, ADD_DEFAULT_DATA, ADD_RENDERER, ADD_UI_SCHEMA, index as Actions, ArrayTranslationEnum, Draft4, Generate, Helpers, INIT, NOT_APPLICABLE, Paths, REMOVE_CELL, REMOVE_DEFAULT_DATA, REMOVE_RENDERER, REMOVE_UI_SCHEMA, Resolve, RuleEffect, Runtime, SET_AJV, SET_CONFIG, SET_LOCALE, SET_SCHEMA, SET_TRANSLATOR, SET_UISCHEMA, SET_VALIDATION_MODE, index$1 as Test, UPDATE_CORE, UPDATE_DATA, UPDATE_ERRORS, UPDATE_I18N, VALIDATE, addI18nKeyToPrefix, and, arrayDefaultTranslations, categorizationHasCategory, cellReducer, clearAllIds, compose, compose as composePaths, composeWithUi, computeLabel, configReducer, controlDefaultProps, convertToValidClassName, coreReducer, createAjv, createCleanLabel, createCombinatorRenderInfos, createControlElement, createDefaultValue, createId, createLabelDescriptionFrom, decode, defaultDataReducer, defaultErrorTranslator, defaultJsonFormsI18nState, defaultMapDispatchToControlProps, defaultMapStateToEnumCellProps, defaultTranslator, deriveLabelForUISchemaElement, deriveTypes, encode, enumToEnumOptionMapper, errorAt, errorsAt, evalEnablement, evalVisibility, extractAjv, extractData, extractDefaultData, extractSchema, extractUiSchema, fetchErrorTranslator, fetchLocale, fetchTranslator, findAllRefs, findMatchingUISchema, findUISchema, formatErrorMessage, formatIs, generateDefaultUISchema, generateJsonSchema, getAjv, getArrayTranslations, getCells, getCombinedErrorMessage, getConfig, getControlPath, getData, getDefaultData, getErrorAt, getErrorTranslator, getFirstPrimitiveProp, getI18nKey, getI18nKeyPrefix, getI18nKeyPrefixBySchema, getLocale, getRenderers, getSchema, getSubErrorsAt, getTranslator, getUISchemas, getUiSchema, hasCategory, hasEnableRule, hasShowRule, hasType, i18nReducer, init, isAllOfControl, isAnyOfControl, isArrayObjectControl, isBooleanControl, isCategorization, isCategory, isControl, isDateControl, isDateTimeControl, isDescriptionHidden, isEnabled, isEnumControl, isGroup, isInherentlyEnabled, isIntegerControl, isInternationalized, isLabelable, isLabeled, isLayout, isMultiLineControl, isNumberControl, isNumberFormatControl, isObjectArray, isObjectArrayControl, isObjectArrayWithNesting, isObjectControl, isOneOfControl, isOneOfEnumControl, isPrimitiveArrayControl, isRangeControl, isScopable, isScoped, isStringControl, isTimeControl, isVisible, iterateSchema, jsonFormsReducerConfig, layoutDefaultProps, mapDispatchToArrayControlProps, mapDispatchToCellProps, mapDispatchToControlProps, mapDispatchToMultiEnumProps, mapStateToAllOfProps, mapStateToAnyOfProps, mapStateToArrayControlProps, mapStateToArrayLayoutProps, mapStateToCellProps, mapStateToCombinatorRendererProps, mapStateToControlProps, mapStateToControlWithDetailProps, mapStateToDispatchCellProps, mapStateToEnumControlProps, mapStateToJsonFormsRendererProps, mapStateToLabelProps, mapStateToLayoutProps, mapStateToMasterListItemProps, mapStateToMultiEnumControlProps, mapStateToOneOfEnumCellProps, mapStateToOneOfEnumControlProps, mapStateToOneOfProps, moveDown, moveUp, not, oneOfToEnumOptionMapper, optionIs, or, rankWith, registerCell, registerDefaultData, registerRenderer, registerUISchema, removeId, rendererReducer, resolveData, resolveSchema, schemaMatches, schemaSubPathMatches, schemaTypeIs, scopeEndIs, scopeEndsWith, setAjv, setConfig, setLocale, setReadonly, setSchema, setTranslator, setUISchema, setValidationMode, showAsRequired, subErrorsAt, toDataPath, toDataPathSegments, transformPathToI18nPrefix, uiTypeIs, uischemaRegistryReducer, unregisterCell, unregisterDefaultData, unregisterRenderer, unregisterUISchema, unsetReadonly, update, updateCore, updateErrors, updateI18n, validate, withIncreasedRank };
|
|
2217
2330
|
//# sourceMappingURL=jsonforms-core.esm.js.map
|