@jsonforms/core 3.1.0-alpha.1 → 3.1.0-alpha.3
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/actions/actions.d.ts +21 -21
- package/lib/i18n/arrayTranslations.d.ts +24 -0
- package/lib/i18n/i18nUtil.d.ts +3 -0
- package/lib/i18n/index.d.ts +1 -0
- package/lib/jsonforms-core.cjs.js +436 -262
- package/lib/jsonforms-core.cjs.js.map +1 -1
- package/lib/jsonforms-core.esm.js +318 -201
- package/lib/jsonforms-core.esm.js.map +1 -1
- package/lib/util/cell.d.ts +0 -1
- package/lib/util/renderer.d.ts +6 -2
- package/lib/util/schema.d.ts +5 -0
- package/package.json +11 -4
- package/src/Helpers.ts +1 -1
- package/src/actions/actions.ts +52 -55
- package/src/configDefault.ts +1 -1
- package/src/generators/Generate.ts +3 -1
- package/src/generators/schema.ts +29 -25
- package/src/generators/uischema.ts +7 -6
- package/src/i18n/arrayTranslations.ts +54 -0
- package/src/i18n/i18nTypes.ts +10 -6
- package/src/i18n/i18nUtil.ts +64 -14
- package/src/i18n/index.ts +1 -0
- package/src/models/draft4.ts +33 -33
- package/src/models/uischema.ts +17 -6
- package/src/reducers/cells.ts +8 -7
- package/src/reducers/core.ts +119 -75
- package/src/reducers/default-data.ts +7 -7
- package/src/reducers/i18n.ts +21 -9
- package/src/reducers/reducers.ts +20 -30
- package/src/reducers/renderers.ts +7 -7
- package/src/reducers/selectors.ts +4 -5
- package/src/reducers/uischemas.ts +25 -24
- package/src/store.ts +1 -1
- package/src/testers/testers.ts +202 -148
- package/src/util/cell.ts +24 -26
- package/src/util/combinators.ts +5 -3
- package/src/util/label.ts +1 -1
- package/src/util/path.ts +11 -7
- package/src/util/renderer.ts +118 -67
- package/src/util/resolvers.ts +15 -13
- package/src/util/runtime.ts +2 -2
- package/src/util/schema.ts +10 -1
- package/src/util/type.ts +5 -3
- package/src/util/uischema.ts +9 -9
- package/src/util/util.ts +52 -52
- package/src/util/validator.ts +1 -1
|
@@ -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,19 @@ 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 => {
|
|
603
|
-
if (filteredErrorKeywords.indexOf(error.keyword) !== -1
|
|
607
|
+
const combinatorPaths = filter(errors, (error) => error.keyword === 'oneOf' || error.keyword === 'anyOf').map((error) => getControlPath(error));
|
|
608
|
+
return filter(errors, (error) => {
|
|
609
|
+
if (filteredErrorKeywords.indexOf(error.keyword) !== -1 &&
|
|
610
|
+
!isOneOfEnumSchema(error.parentSchema)) {
|
|
604
611
|
return false;
|
|
605
612
|
}
|
|
606
613
|
const controlPath = getControlPath(error);
|
|
607
614
|
let result = matchPath(controlPath);
|
|
608
615
|
const parentSchema = error.parentSchema;
|
|
609
|
-
if (result &&
|
|
610
|
-
|
|
616
|
+
if (result &&
|
|
617
|
+
!isObjectSchema$1(parentSchema) &&
|
|
618
|
+
!isOneOfEnumSchema(parentSchema) &&
|
|
619
|
+
combinatorPaths.findIndex((p) => instancePath.startsWith(p)) !== -1) {
|
|
611
620
|
result = result && isEqual(parentSchema, schema);
|
|
612
621
|
}
|
|
613
622
|
return result;
|
|
@@ -616,23 +625,30 @@ const errorsAt = (instancePath, schema, matchPath) => (errors) => {
|
|
|
616
625
|
const isObjectSchema$1 = (schema) => {
|
|
617
626
|
return schema?.type === 'object' || !!schema?.properties;
|
|
618
627
|
};
|
|
619
|
-
const filteredErrorKeywords = [
|
|
628
|
+
const filteredErrorKeywords = [
|
|
629
|
+
'additionalProperties',
|
|
630
|
+
'allOf',
|
|
631
|
+
'anyOf',
|
|
632
|
+
'oneOf',
|
|
633
|
+
];
|
|
620
634
|
const getErrorsAt = (instancePath, schema, matchPath) => (state) => {
|
|
621
635
|
const errors = state.errors ?? [];
|
|
622
636
|
const additionalErrors = state.additionalErrors ?? [];
|
|
623
|
-
return errorsAt(instancePath, schema, matchPath)(state.validationMode === 'ValidateAndHide'
|
|
637
|
+
return errorsAt(instancePath, schema, matchPath)(state.validationMode === 'ValidateAndHide'
|
|
638
|
+
? additionalErrors
|
|
639
|
+
: [...errors, ...additionalErrors]);
|
|
624
640
|
};
|
|
625
|
-
const errorAt = (instancePath, schema) => getErrorsAt(instancePath, schema, path => path === instancePath);
|
|
626
|
-
const subErrorsAt = (instancePath, schema) => getErrorsAt(instancePath, schema, path => path.startsWith(instancePath + '.'));
|
|
641
|
+
const errorAt = (instancePath, schema) => getErrorsAt(instancePath, schema, (path) => path === instancePath);
|
|
642
|
+
const subErrorsAt = (instancePath, schema) => getErrorsAt(instancePath, schema, (path) => path.startsWith(instancePath + '.'));
|
|
627
643
|
|
|
628
644
|
const defaultDataReducer = (state = [], action) => {
|
|
629
645
|
switch (action.type) {
|
|
630
646
|
case ADD_DEFAULT_DATA:
|
|
631
647
|
return state.concat([
|
|
632
|
-
{ schemaPath: action.schemaPath, data: action.data }
|
|
648
|
+
{ schemaPath: action.schemaPath, data: action.data },
|
|
633
649
|
]);
|
|
634
650
|
case REMOVE_DEFAULT_DATA:
|
|
635
|
-
return state.filter(t => t.schemaPath !== action.schemaPath);
|
|
651
|
+
return state.filter((t) => t.schemaPath !== action.schemaPath);
|
|
636
652
|
default:
|
|
637
653
|
return state;
|
|
638
654
|
}
|
|
@@ -648,7 +664,7 @@ const getI18nKeyPrefixBySchema = (schema, uischema) => {
|
|
|
648
664
|
const transformPathToI18nPrefix = (path) => {
|
|
649
665
|
return (path
|
|
650
666
|
?.split('.')
|
|
651
|
-
.filter(segment => !/^\d+$/.test(segment))
|
|
667
|
+
.filter((segment) => !/^\d+$/.test(segment))
|
|
652
668
|
.join('.') || 'root');
|
|
653
669
|
};
|
|
654
670
|
const getI18nKeyPrefix = (schema, uischema, path) => {
|
|
@@ -658,6 +674,9 @@ const getI18nKeyPrefix = (schema, uischema, path) => {
|
|
|
658
674
|
const getI18nKey = (schema, uischema, path, key) => {
|
|
659
675
|
return `${getI18nKeyPrefix(schema, uischema, path)}.${key}`;
|
|
660
676
|
};
|
|
677
|
+
const addI18nKeyToPrefix = (i18nKeyPrefix, key) => {
|
|
678
|
+
return `${i18nKeyPrefix}.${key}`;
|
|
679
|
+
};
|
|
661
680
|
const defaultTranslator = (_id, defaultMessage) => defaultMessage;
|
|
662
681
|
const defaultErrorTranslator = (error, t, uischema) => {
|
|
663
682
|
const i18nKey = getI18nKey(error.parentSchema, uischema, getControlPath(error), `error.${error.keyword}`);
|
|
@@ -665,7 +684,9 @@ const defaultErrorTranslator = (error, t, uischema) => {
|
|
|
665
684
|
if (specializedKeywordMessage !== undefined) {
|
|
666
685
|
return specializedKeywordMessage;
|
|
667
686
|
}
|
|
668
|
-
const genericKeywordMessage = t(`error.${error.keyword}`, undefined, {
|
|
687
|
+
const genericKeywordMessage = t(`error.${error.keyword}`, undefined, {
|
|
688
|
+
error,
|
|
689
|
+
});
|
|
669
690
|
if (genericKeywordMessage !== undefined) {
|
|
670
691
|
return genericKeywordMessage;
|
|
671
692
|
}
|
|
@@ -673,7 +694,8 @@ const defaultErrorTranslator = (error, t, uischema) => {
|
|
|
673
694
|
if (messageCustomization !== undefined) {
|
|
674
695
|
return messageCustomization;
|
|
675
696
|
}
|
|
676
|
-
if (error.keyword === 'required' &&
|
|
697
|
+
if (error.keyword === 'required' &&
|
|
698
|
+
error.message?.startsWith('must have required property')) {
|
|
677
699
|
return t('is a required property', 'is a required property', { error });
|
|
678
700
|
}
|
|
679
701
|
return error.message;
|
|
@@ -681,30 +703,96 @@ const defaultErrorTranslator = (error, t, uischema) => {
|
|
|
681
703
|
const getCombinedErrorMessage = (errors, et, t, schema, uischema, path) => {
|
|
682
704
|
if (errors.length > 0 && t) {
|
|
683
705
|
const customErrorKey = getI18nKey(schema, uischema, path, 'error.custom');
|
|
684
|
-
const specializedErrorMessage = t(customErrorKey, undefined, {
|
|
706
|
+
const specializedErrorMessage = t(customErrorKey, undefined, {
|
|
707
|
+
schema,
|
|
708
|
+
uischema,
|
|
709
|
+
path,
|
|
710
|
+
errors,
|
|
711
|
+
});
|
|
685
712
|
if (specializedErrorMessage !== undefined) {
|
|
686
713
|
return specializedErrorMessage;
|
|
687
714
|
}
|
|
688
715
|
}
|
|
689
|
-
return formatErrorMessage(errors.map(error => et(error, t, uischema)));
|
|
716
|
+
return formatErrorMessage(errors.map((error) => et(error, t, uischema)));
|
|
690
717
|
};
|
|
691
718
|
const deriveLabelForUISchemaElement = (uischema, t) => {
|
|
692
719
|
if (uischema.label === false) {
|
|
693
720
|
return undefined;
|
|
694
721
|
}
|
|
695
|
-
if ((uischema.label === undefined ||
|
|
722
|
+
if ((uischema.label === undefined ||
|
|
723
|
+
uischema.label === null ||
|
|
724
|
+
uischema.label === true) &&
|
|
725
|
+
!isInternationalized(uischema)) {
|
|
696
726
|
return undefined;
|
|
697
727
|
}
|
|
698
|
-
const stringifiedLabel = typeof uischema.label === 'string'
|
|
728
|
+
const stringifiedLabel = typeof uischema.label === 'string'
|
|
729
|
+
? uischema.label
|
|
730
|
+
: JSON.stringify(uischema.label);
|
|
699
731
|
const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);
|
|
700
|
-
const i18nKey = typeof i18nKeyPrefix === 'string'
|
|
732
|
+
const i18nKey = typeof i18nKeyPrefix === 'string'
|
|
733
|
+
? `${i18nKeyPrefix}.label`
|
|
734
|
+
: stringifiedLabel;
|
|
701
735
|
return t(i18nKey, stringifiedLabel, { uischema: uischema });
|
|
702
736
|
};
|
|
737
|
+
const getArrayTranslations = (t, defaultTranslations, i18nKeyPrefix, label) => {
|
|
738
|
+
const translations = {};
|
|
739
|
+
defaultTranslations.forEach((controlElement) => {
|
|
740
|
+
const key = addI18nKeyToPrefix(i18nKeyPrefix, controlElement.key);
|
|
741
|
+
translations[controlElement.key] = t(key, controlElement.default(label));
|
|
742
|
+
});
|
|
743
|
+
return translations;
|
|
744
|
+
};
|
|
745
|
+
|
|
746
|
+
var ArrayTranslationEnum;
|
|
747
|
+
(function (ArrayTranslationEnum) {
|
|
748
|
+
ArrayTranslationEnum["addTooltip"] = "addTooltip";
|
|
749
|
+
ArrayTranslationEnum["addAriaLabel"] = "addAriaLabel";
|
|
750
|
+
ArrayTranslationEnum["removeTooltip"] = "removeTooltip";
|
|
751
|
+
ArrayTranslationEnum["upAriaLabel"] = "upAriaLabel";
|
|
752
|
+
ArrayTranslationEnum["downAriaLabel"] = "downAriaLabel";
|
|
753
|
+
ArrayTranslationEnum["noSelection"] = "noSelection";
|
|
754
|
+
ArrayTranslationEnum["removeAriaLabel"] = "removeAriaLabel";
|
|
755
|
+
ArrayTranslationEnum["noDataMessage"] = "noDataMessage";
|
|
756
|
+
ArrayTranslationEnum["deleteDialogTitle"] = "deleteDialogTitle";
|
|
757
|
+
ArrayTranslationEnum["deleteDialogMessage"] = "deleteDialogMessage";
|
|
758
|
+
ArrayTranslationEnum["deleteDialogAccept"] = "deleteDialogAccept";
|
|
759
|
+
ArrayTranslationEnum["deleteDialogDecline"] = "deleteDialogDecline";
|
|
760
|
+
ArrayTranslationEnum["up"] = "up";
|
|
761
|
+
ArrayTranslationEnum["down"] = "down";
|
|
762
|
+
})(ArrayTranslationEnum || (ArrayTranslationEnum = {}));
|
|
763
|
+
const arrayDefaultTranslations = [
|
|
764
|
+
{
|
|
765
|
+
key: ArrayTranslationEnum.addTooltip,
|
|
766
|
+
default: (input) => (input ? `Add to ${input}` : 'Add'),
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
key: ArrayTranslationEnum.addAriaLabel,
|
|
770
|
+
default: (input) => (input ? `Add to ${input} button` : 'Add button'),
|
|
771
|
+
},
|
|
772
|
+
{ key: ArrayTranslationEnum.removeTooltip, default: () => 'Delete' },
|
|
773
|
+
{ key: ArrayTranslationEnum.removeAriaLabel, default: () => 'Delete button' },
|
|
774
|
+
{ key: ArrayTranslationEnum.upAriaLabel, default: () => `Move item up` },
|
|
775
|
+
{ key: ArrayTranslationEnum.up, default: () => 'Up' },
|
|
776
|
+
{ key: ArrayTranslationEnum.down, default: () => 'Down' },
|
|
777
|
+
{ key: ArrayTranslationEnum.downAriaLabel, default: () => `Move item down` },
|
|
778
|
+
{ key: ArrayTranslationEnum.noDataMessage, default: () => 'No data' },
|
|
779
|
+
{ key: ArrayTranslationEnum.noSelection, default: () => 'No selection' },
|
|
780
|
+
{
|
|
781
|
+
key: ArrayTranslationEnum.deleteDialogTitle,
|
|
782
|
+
default: () => 'Confirm Deletion',
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
key: ArrayTranslationEnum.deleteDialogMessage,
|
|
786
|
+
default: () => 'Are you sure you want to delete the selected entry?',
|
|
787
|
+
},
|
|
788
|
+
{ key: ArrayTranslationEnum.deleteDialogAccept, default: () => 'Yes' },
|
|
789
|
+
{ key: ArrayTranslationEnum.deleteDialogDecline, default: () => 'No' },
|
|
790
|
+
];
|
|
703
791
|
|
|
704
792
|
const defaultJsonFormsI18nState = {
|
|
705
793
|
locale: 'en',
|
|
706
794
|
translate: defaultTranslator,
|
|
707
|
-
translateError: defaultErrorTranslator
|
|
795
|
+
translateError: defaultErrorTranslator,
|
|
708
796
|
};
|
|
709
797
|
const i18nReducer = (state = defaultJsonFormsI18nState, action) => {
|
|
710
798
|
switch (action.type) {
|
|
@@ -719,7 +807,7 @@ const i18nReducer = (state = defaultJsonFormsI18nState, action) => {
|
|
|
719
807
|
...state,
|
|
720
808
|
locale,
|
|
721
809
|
translate,
|
|
722
|
-
translateError
|
|
810
|
+
translateError,
|
|
723
811
|
};
|
|
724
812
|
}
|
|
725
813
|
return state;
|
|
@@ -728,12 +816,12 @@ const i18nReducer = (state = defaultJsonFormsI18nState, action) => {
|
|
|
728
816
|
return {
|
|
729
817
|
...state,
|
|
730
818
|
translate: action.translator ?? defaultTranslator,
|
|
731
|
-
translateError: action.errorTranslator ?? defaultErrorTranslator
|
|
819
|
+
translateError: action.errorTranslator ?? defaultErrorTranslator,
|
|
732
820
|
};
|
|
733
821
|
case SET_LOCALE:
|
|
734
822
|
return {
|
|
735
823
|
...state,
|
|
736
|
-
locale: action.locale ?? navigator.languages[0]
|
|
824
|
+
locale: action.locale ?? navigator.languages[0],
|
|
737
825
|
};
|
|
738
826
|
default:
|
|
739
827
|
return state;
|
|
@@ -762,10 +850,10 @@ const rendererReducer = (state = [], action) => {
|
|
|
762
850
|
switch (action.type) {
|
|
763
851
|
case ADD_RENDERER:
|
|
764
852
|
return state.concat([
|
|
765
|
-
{ tester: action.tester, renderer: action.renderer }
|
|
853
|
+
{ tester: action.tester, renderer: action.renderer },
|
|
766
854
|
]);
|
|
767
855
|
case REMOVE_RENDERER:
|
|
768
|
-
return state.filter(t => t.tester !== action.tester);
|
|
856
|
+
return state.filter((t) => t.tester !== action.tester);
|
|
769
857
|
default:
|
|
770
858
|
return state;
|
|
771
859
|
}
|
|
@@ -808,8 +896,8 @@ const schemaSubPathMatches = (subPath, predicate) => (uischema, schema, context)
|
|
|
808
896
|
}
|
|
809
897
|
return predicate(currentDataSchema, context?.rootSchema);
|
|
810
898
|
};
|
|
811
|
-
const schemaTypeIs = (expectedType) => schemaMatches(schema => !isEmpty(schema) && hasType(schema, expectedType));
|
|
812
|
-
const formatIs = (expectedFormat) => schemaMatches(schema => !isEmpty(schema) &&
|
|
899
|
+
const schemaTypeIs = (expectedType) => schemaMatches((schema) => !isEmpty(schema) && hasType(schema, expectedType));
|
|
900
|
+
const formatIs = (expectedFormat) => schemaMatches((schema) => !isEmpty(schema) &&
|
|
813
901
|
schema.format === expectedFormat &&
|
|
814
902
|
hasType(schema, 'string'));
|
|
815
903
|
const uiTypeIs = (expected) => (uischema) => !isEmpty(uischema) && uischema.type === expected;
|
|
@@ -850,12 +938,11 @@ const withIncreasedRank = (by, rankedTester) => (uischema, schema, context) => {
|
|
|
850
938
|
};
|
|
851
939
|
const isBooleanControl = and(uiTypeIs('Control'), schemaTypeIs('boolean'));
|
|
852
940
|
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
|
|
858
|
-
schema.oneOf.every(s => s.const !== undefined)));
|
|
941
|
+
const isAllOfControl = and(uiTypeIs('Control'), schemaMatches((schema) => schema.hasOwnProperty('allOf')));
|
|
942
|
+
const isAnyOfControl = and(uiTypeIs('Control'), schemaMatches((schema) => schema.hasOwnProperty('anyOf')));
|
|
943
|
+
const isOneOfControl = and(uiTypeIs('Control'), schemaMatches((schema) => schema.hasOwnProperty('oneOf')));
|
|
944
|
+
const isEnumControl = and(uiTypeIs('Control'), or(schemaMatches((schema) => schema.hasOwnProperty('enum')), schemaMatches((schema) => schema.hasOwnProperty('const'))));
|
|
945
|
+
const isOneOfEnumControl = and(uiTypeIs('Control'), schemaMatches((schema) => isOneOfEnumSchema(schema)));
|
|
859
946
|
const isIntegerControl = and(uiTypeIs('Control'), schemaTypeIs('integer'));
|
|
860
947
|
const isNumberControl = and(uiTypeIs('Control'), schemaTypeIs('number'));
|
|
861
948
|
const isStringControl = and(uiTypeIs('Control'), schemaTypeIs('string'));
|
|
@@ -863,9 +950,12 @@ const isMultiLineControl = and(uiTypeIs('Control'), optionIs('multi', true));
|
|
|
863
950
|
const isDateControl = and(uiTypeIs('Control'), or(formatIs('date'), optionIs('format', 'date')));
|
|
864
951
|
const isTimeControl = and(uiTypeIs('Control'), or(formatIs('time'), optionIs('format', 'time')));
|
|
865
952
|
const isDateTimeControl = and(uiTypeIs('Control'), or(formatIs('date-time'), optionIs('format', 'date-time')));
|
|
866
|
-
const isObjectArray = and(schemaMatches((schema, rootSchema) => hasType(schema, 'array') &&
|
|
953
|
+
const isObjectArray = and(schemaMatches((schema, rootSchema) => hasType(schema, 'array') &&
|
|
954
|
+
!Array.isArray(resolveSchema(schema, 'items', rootSchema))
|
|
867
955
|
), schemaSubPathMatches('items', (schema, rootSchema) => {
|
|
868
|
-
const resolvedSchema = schema.$ref
|
|
956
|
+
const resolvedSchema = schema.$ref
|
|
957
|
+
? resolveSchema(rootSchema, schema.$ref, rootSchema)
|
|
958
|
+
: schema;
|
|
869
959
|
return hasType(resolvedSchema, 'object');
|
|
870
960
|
}));
|
|
871
961
|
const isObjectArrayControl = and(uiTypeIs('Control'), isObjectArray);
|
|
@@ -898,14 +988,17 @@ const isObjectArrayWithNesting = (uischema, schema, context) => {
|
|
|
898
988
|
const resolvedSchema = resolveSchema(schema, schemaPath, context?.rootSchema ?? schema);
|
|
899
989
|
let objectDepth = 0;
|
|
900
990
|
if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {
|
|
901
|
-
if (traverse(resolvedSchema.items, val => {
|
|
991
|
+
if (traverse(resolvedSchema.items, (val) => {
|
|
902
992
|
if (val === schema) {
|
|
903
993
|
return false;
|
|
904
994
|
}
|
|
905
995
|
if (val.$ref !== undefined) {
|
|
906
996
|
return false;
|
|
907
997
|
}
|
|
908
|
-
if (val.anyOf || val.
|
|
998
|
+
if (val.anyOf || val.allOf) {
|
|
999
|
+
return true;
|
|
1000
|
+
}
|
|
1001
|
+
if (val.oneOf && !isOneOfEnumSchema(val)) {
|
|
909
1002
|
return true;
|
|
910
1003
|
}
|
|
911
1004
|
if (hasType(val, 'object')) {
|
|
@@ -937,12 +1030,14 @@ const isArrayObjectControl = isObjectArrayControl;
|
|
|
937
1030
|
const isPrimitiveArrayControl = and(uiTypeIs('Control'), schemaMatches((schema, rootSchema) => deriveTypes(schema).length !== 0 &&
|
|
938
1031
|
!Array.isArray(resolveSchema(schema, 'items', rootSchema))
|
|
939
1032
|
), schemaSubPathMatches('items', (schema, rootSchema) => {
|
|
940
|
-
const resolvedSchema = schema.$ref
|
|
1033
|
+
const resolvedSchema = schema.$ref
|
|
1034
|
+
? resolveSchema(rootSchema, schema.$ref, rootSchema)
|
|
1035
|
+
: schema;
|
|
941
1036
|
const types = deriveTypes(resolvedSchema);
|
|
942
1037
|
return (types.length === 1 &&
|
|
943
1038
|
includes(['integer', 'number', 'boolean', 'string'], types[0]));
|
|
944
1039
|
}));
|
|
945
|
-
const isRangeControl = and(uiTypeIs('Control'), or(schemaTypeIs('number'), schemaTypeIs('integer')), schemaMatches(schema => schema.hasOwnProperty('maximum') &&
|
|
1040
|
+
const isRangeControl = and(uiTypeIs('Control'), or(schemaTypeIs('number'), schemaTypeIs('integer')), schemaMatches((schema) => schema.hasOwnProperty('maximum') &&
|
|
946
1041
|
schema.hasOwnProperty('minimum') &&
|
|
947
1042
|
schema.hasOwnProperty('default')), optionIs('slider', true));
|
|
948
1043
|
const isNumberFormatControl = and(uiTypeIs('Control'), schemaTypeIs('integer'), optionIs('format', true));
|
|
@@ -953,7 +1048,7 @@ const hasCategory = (categorization) => {
|
|
|
953
1048
|
return false;
|
|
954
1049
|
}
|
|
955
1050
|
return categorization.elements
|
|
956
|
-
.map(elem => isCategorization(elem) ? hasCategory(elem) : isCategory(elem))
|
|
1051
|
+
.map((elem) => isCategorization(elem) ? hasCategory(elem) : isCategory(elem))
|
|
957
1052
|
.reduce((prev, curr) => prev && curr, true);
|
|
958
1053
|
};
|
|
959
1054
|
const categorizationHasCategory = (uischema) => hasCategory(uischema);
|
|
@@ -1009,16 +1104,17 @@ const uischemaRegistryReducer = (state = [], action) => {
|
|
|
1009
1104
|
return state
|
|
1010
1105
|
.slice()
|
|
1011
1106
|
.concat({ tester: action.tester, uischema: action.uischema });
|
|
1012
|
-
case REMOVE_UI_SCHEMA:
|
|
1107
|
+
case REMOVE_UI_SCHEMA: {
|
|
1013
1108
|
const copy = state.slice();
|
|
1014
|
-
remove(copy, entry => entry.tester === action.tester);
|
|
1109
|
+
remove(copy, (entry) => entry.tester === action.tester);
|
|
1015
1110
|
return copy;
|
|
1111
|
+
}
|
|
1016
1112
|
default:
|
|
1017
1113
|
return state;
|
|
1018
1114
|
}
|
|
1019
1115
|
};
|
|
1020
1116
|
const findMatchingUISchema = (state) => (jsonSchema, schemaPath, path) => {
|
|
1021
|
-
const match = maxBy(state, entry => entry.tester(jsonSchema, schemaPath, path));
|
|
1117
|
+
const match = maxBy(state, (entry) => entry.tester(jsonSchema, schemaPath, path));
|
|
1022
1118
|
if (match !== undefined &&
|
|
1023
1119
|
match.tester(jsonSchema, schemaPath, path) !== NOT_APPLICABLE) {
|
|
1024
1120
|
return match.uischema;
|
|
@@ -1039,7 +1135,7 @@ const findUISchema = (uischemas, schema, schemaPath, path, fallback = 'VerticalL
|
|
|
1039
1135
|
if (control && control.options && control.options.detail) {
|
|
1040
1136
|
if (typeof control.options.detail === 'string') {
|
|
1041
1137
|
if (control.options.detail.toUpperCase() === 'GENERATE') {
|
|
1042
|
-
if (typeof fallback ===
|
|
1138
|
+
if (typeof fallback === 'function') {
|
|
1043
1139
|
return fallback();
|
|
1044
1140
|
}
|
|
1045
1141
|
return Generate.uiSchema(schema, fallback);
|
|
@@ -1102,7 +1198,7 @@ const toDataPathSegments = (schemaPath) => {
|
|
|
1102
1198
|
const decodedSegments = segments.map(decode);
|
|
1103
1199
|
const startFromRoot = decodedSegments[0] === '#' || decodedSegments[0] === '';
|
|
1104
1200
|
const startIndex = startFromRoot ? 2 : 1;
|
|
1105
|
-
return range(startIndex, decodedSegments.length, 2).map(idx => decodedSegments[idx]);
|
|
1201
|
+
return range(startIndex, decodedSegments.length, 2).map((idx) => decodedSegments[idx]);
|
|
1106
1202
|
};
|
|
1107
1203
|
const toDataPath = (schemaPath) => {
|
|
1108
1204
|
return toDataPathSegments(schemaPath).join('.');
|
|
@@ -1131,9 +1227,7 @@ const resolveData = (instance, dataPath) => {
|
|
|
1131
1227
|
return instance;
|
|
1132
1228
|
}
|
|
1133
1229
|
const dataPathSegments = dataPath.split('.');
|
|
1134
|
-
return dataPathSegments
|
|
1135
|
-
.map(segment => decodeURIComponent(segment))
|
|
1136
|
-
.reduce((curInstance, decodedSegment) => {
|
|
1230
|
+
return dataPathSegments.reduce((curInstance, decodedSegment) => {
|
|
1137
1231
|
if (!curInstance || !curInstance.hasOwnProperty(decodedSegment)) {
|
|
1138
1232
|
return undefined;
|
|
1139
1233
|
}
|
|
@@ -1142,13 +1236,13 @@ const resolveData = (instance, dataPath) => {
|
|
|
1142
1236
|
};
|
|
1143
1237
|
const findAllRefs = (schema, result = {}, resolveTuples = false) => {
|
|
1144
1238
|
if (isObjectSchema(schema)) {
|
|
1145
|
-
Object.keys(schema.properties).forEach(key => findAllRefs(schema.properties[key], result));
|
|
1239
|
+
Object.keys(schema.properties).forEach((key) => findAllRefs(schema.properties[key], result));
|
|
1146
1240
|
}
|
|
1147
1241
|
if (isArraySchema(schema)) {
|
|
1148
1242
|
if (Array.isArray(schema.items)) {
|
|
1149
1243
|
if (resolveTuples) {
|
|
1150
1244
|
const items = schema.items;
|
|
1151
|
-
items.forEach(child => findAllRefs(child, result));
|
|
1245
|
+
items.forEach((child) => findAllRefs(child, result));
|
|
1152
1246
|
}
|
|
1153
1247
|
}
|
|
1154
1248
|
else {
|
|
@@ -1157,7 +1251,7 @@ const findAllRefs = (schema, result = {}, resolveTuples = false) => {
|
|
|
1157
1251
|
}
|
|
1158
1252
|
if (Array.isArray(schema.anyOf)) {
|
|
1159
1253
|
const anyOf = schema.anyOf;
|
|
1160
|
-
anyOf.forEach(child => findAllRefs(child, result));
|
|
1254
|
+
anyOf.forEach((child) => findAllRefs(child, result));
|
|
1161
1255
|
}
|
|
1162
1256
|
if (schema.$ref !== undefined) {
|
|
1163
1257
|
result[schema.$ref] = schema;
|
|
@@ -1347,12 +1441,12 @@ const deriveTypes = (jsonSchema) => {
|
|
|
1347
1441
|
};
|
|
1348
1442
|
const Resolve = {
|
|
1349
1443
|
schema: resolveSchema,
|
|
1350
|
-
data: resolveData
|
|
1444
|
+
data: resolveData,
|
|
1351
1445
|
};
|
|
1352
1446
|
const fromScoped = (scopable) => toDataPathSegments(scopable.scope).join('.');
|
|
1353
1447
|
const Paths = {
|
|
1354
1448
|
compose: compose,
|
|
1355
|
-
fromScoped
|
|
1449
|
+
fromScoped,
|
|
1356
1450
|
};
|
|
1357
1451
|
const Runtime = {
|
|
1358
1452
|
isEnabled(uischema, data, ajv) {
|
|
@@ -1360,7 +1454,7 @@ const Runtime = {
|
|
|
1360
1454
|
},
|
|
1361
1455
|
isVisible(uischema, data, ajv) {
|
|
1362
1456
|
return isVisible(uischema, data, undefined, ajv);
|
|
1363
|
-
}
|
|
1457
|
+
},
|
|
1364
1458
|
};
|
|
1365
1459
|
|
|
1366
1460
|
const deriveLabel = (controlElement, schemaElement) => {
|
|
@@ -1396,7 +1490,7 @@ const createLabelDescriptionFrom = (withLabel, schema) => {
|
|
|
1396
1490
|
};
|
|
1397
1491
|
const labelDescription = (text, show) => ({
|
|
1398
1492
|
text: text,
|
|
1399
|
-
show: show
|
|
1493
|
+
show: show,
|
|
1400
1494
|
});
|
|
1401
1495
|
|
|
1402
1496
|
const isRequired = (schema, schemaPath, rootSchema) => {
|
|
@@ -1496,7 +1590,13 @@ const mapStateToControlProps = (state, ownProps) => {
|
|
|
1496
1590
|
const schema = resolvedSchema ?? rootSchema;
|
|
1497
1591
|
const t = getTranslator()(state);
|
|
1498
1592
|
const te = getErrorTranslator()(state);
|
|
1499
|
-
const
|
|
1593
|
+
const i18nKeyPrefix = getI18nKeyPrefix(schema, uischema, path);
|
|
1594
|
+
const i18nLabel = t(getI18nKey(schema, uischema, path, 'label'), label, {
|
|
1595
|
+
schema,
|
|
1596
|
+
uischema,
|
|
1597
|
+
path,
|
|
1598
|
+
errors,
|
|
1599
|
+
});
|
|
1500
1600
|
const i18nDescription = t(getI18nKey(schema, uischema, path, 'description'), description, { schema, uischema, path, errors });
|
|
1501
1601
|
const i18nErrorMessage = getCombinedErrorMessage(errors, te, t, schema, uischema, path);
|
|
1502
1602
|
return {
|
|
@@ -1513,33 +1613,34 @@ const mapStateToControlProps = (state, ownProps) => {
|
|
|
1513
1613
|
schema,
|
|
1514
1614
|
config: getConfig(state),
|
|
1515
1615
|
cells: ownProps.cells || state.jsonforms.cells,
|
|
1516
|
-
rootSchema
|
|
1616
|
+
rootSchema,
|
|
1617
|
+
i18nKeyPrefix,
|
|
1517
1618
|
};
|
|
1518
1619
|
};
|
|
1519
1620
|
const mapDispatchToControlProps = (dispatch) => ({
|
|
1520
1621
|
handleChange(path, value) {
|
|
1521
1622
|
dispatch(update(path, () => value));
|
|
1522
|
-
}
|
|
1623
|
+
},
|
|
1523
1624
|
});
|
|
1524
1625
|
const mapStateToEnumControlProps = (state, ownProps) => {
|
|
1525
1626
|
const props = mapStateToControlProps(state, ownProps);
|
|
1526
1627
|
const options = ownProps.options ||
|
|
1527
|
-
props.schema.enum?.map(e => enumToEnumOptionMapper(e, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))) ||
|
|
1628
|
+
props.schema.enum?.map((e) => enumToEnumOptionMapper(e, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))) ||
|
|
1528
1629
|
(props.schema.const && [
|
|
1529
|
-
enumToEnumOptionMapper(props.schema.const, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))
|
|
1630
|
+
enumToEnumOptionMapper(props.schema.const, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)),
|
|
1530
1631
|
]);
|
|
1531
1632
|
return {
|
|
1532
1633
|
...props,
|
|
1533
|
-
options
|
|
1634
|
+
options,
|
|
1534
1635
|
};
|
|
1535
1636
|
};
|
|
1536
1637
|
const mapStateToOneOfEnumControlProps = (state, ownProps) => {
|
|
1537
1638
|
const props = mapStateToControlProps(state, ownProps);
|
|
1538
1639
|
const options = ownProps.options ||
|
|
1539
|
-
props.schema.oneOf?.map(oneOfSubSchema => oneOfToEnumOptionMapper(oneOfSubSchema, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)));
|
|
1640
|
+
props.schema.oneOf?.map((oneOfSubSchema) => oneOfToEnumOptionMapper(oneOfSubSchema, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)));
|
|
1540
1641
|
return {
|
|
1541
1642
|
...props,
|
|
1542
|
-
options
|
|
1643
|
+
options,
|
|
1543
1644
|
};
|
|
1544
1645
|
};
|
|
1545
1646
|
const mapStateToMultiEnumControlProps = (state, ownProps) => {
|
|
@@ -1547,17 +1648,17 @@ const mapStateToMultiEnumControlProps = (state, ownProps) => {
|
|
|
1547
1648
|
const items = props.schema.items;
|
|
1548
1649
|
const options = ownProps.options ||
|
|
1549
1650
|
(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)));
|
|
1651
|
+
items.oneOf.map((oneOfSubSchema) => oneOfToEnumOptionMapper(oneOfSubSchema, state.jsonforms.i18n?.translate, getI18nKeyPrefix(props.schema, props.uischema, props.path)))) ||
|
|
1652
|
+
items?.enum?.map((e) => enumToEnumOptionMapper(e, state.jsonforms.i18n?.translate, getI18nKeyPrefix(props.schema, props.uischema, props.path)));
|
|
1552
1653
|
return {
|
|
1553
1654
|
...props,
|
|
1554
|
-
options
|
|
1655
|
+
options,
|
|
1555
1656
|
};
|
|
1556
1657
|
};
|
|
1557
1658
|
const mapStateToMasterListItemProps = (state, ownProps) => {
|
|
1558
1659
|
const { schema, path, index } = ownProps;
|
|
1559
1660
|
const firstPrimitiveProp = schema.properties
|
|
1560
|
-
? find(Object.keys(schema.properties), propName => {
|
|
1661
|
+
? find(Object.keys(schema.properties), (propName) => {
|
|
1561
1662
|
const prop = schema.properties[propName];
|
|
1562
1663
|
return (prop.type === 'string' ||
|
|
1563
1664
|
prop.type === 'number' ||
|
|
@@ -1569,33 +1670,36 @@ const mapStateToMasterListItemProps = (state, ownProps) => {
|
|
|
1569
1670
|
const childLabel = firstPrimitiveProp ? childData[firstPrimitiveProp] : '';
|
|
1570
1671
|
return {
|
|
1571
1672
|
...ownProps,
|
|
1572
|
-
childLabel
|
|
1673
|
+
childLabel,
|
|
1573
1674
|
};
|
|
1574
1675
|
};
|
|
1575
1676
|
const mapStateToControlWithDetailProps = (state, ownProps) => {
|
|
1576
1677
|
const { ...props } = mapStateToControlProps(state, ownProps);
|
|
1577
1678
|
return {
|
|
1578
1679
|
...props,
|
|
1579
|
-
uischemas: state.jsonforms.uischemas
|
|
1680
|
+
uischemas: state.jsonforms.uischemas,
|
|
1580
1681
|
};
|
|
1581
1682
|
};
|
|
1582
1683
|
const mapStateToArrayControlProps = (state, ownProps) => {
|
|
1583
|
-
const { path, schema, uischema, ...props } = mapStateToControlWithDetailProps(state, ownProps);
|
|
1684
|
+
const { path, schema, uischema, i18nKeyPrefix, label, ...props } = mapStateToControlWithDetailProps(state, ownProps);
|
|
1584
1685
|
const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);
|
|
1585
1686
|
const childErrors = getSubErrorsAt(path, resolvedSchema)(state);
|
|
1687
|
+
const t = getTranslator()(state);
|
|
1586
1688
|
return {
|
|
1587
1689
|
...props,
|
|
1690
|
+
label,
|
|
1588
1691
|
path,
|
|
1589
1692
|
uischema,
|
|
1590
1693
|
schema: resolvedSchema,
|
|
1591
1694
|
childErrors,
|
|
1592
1695
|
renderers: ownProps.renderers || getRenderers(state),
|
|
1593
|
-
cells: ownProps.cells || getCells(state)
|
|
1696
|
+
cells: ownProps.cells || getCells(state),
|
|
1697
|
+
translations: getArrayTranslations(t, arrayDefaultTranslations, i18nKeyPrefix, label),
|
|
1594
1698
|
};
|
|
1595
1699
|
};
|
|
1596
1700
|
const mapDispatchToArrayControlProps = (dispatch) => ({
|
|
1597
1701
|
addItem: (path, value) => () => {
|
|
1598
|
-
dispatch(update(path, array => {
|
|
1702
|
+
dispatch(update(path, (array) => {
|
|
1599
1703
|
if (array === undefined || array === null) {
|
|
1600
1704
|
return [value];
|
|
1601
1705
|
}
|
|
@@ -1604,30 +1708,30 @@ const mapDispatchToArrayControlProps = (dispatch) => ({
|
|
|
1604
1708
|
}));
|
|
1605
1709
|
},
|
|
1606
1710
|
removeItems: (path, toDelete) => () => {
|
|
1607
|
-
dispatch(update(path, array => {
|
|
1711
|
+
dispatch(update(path, (array) => {
|
|
1608
1712
|
toDelete
|
|
1609
1713
|
.sort()
|
|
1610
1714
|
.reverse()
|
|
1611
|
-
.forEach(s => array.splice(s, 1));
|
|
1715
|
+
.forEach((s) => array.splice(s, 1));
|
|
1612
1716
|
return array;
|
|
1613
1717
|
}));
|
|
1614
1718
|
},
|
|
1615
1719
|
moveUp: (path, toMove) => () => {
|
|
1616
|
-
dispatch(update(path, array => {
|
|
1720
|
+
dispatch(update(path, (array) => {
|
|
1617
1721
|
moveUp(array, toMove);
|
|
1618
1722
|
return array;
|
|
1619
1723
|
}));
|
|
1620
1724
|
},
|
|
1621
1725
|
moveDown: (path, toMove) => () => {
|
|
1622
|
-
dispatch(update(path, array => {
|
|
1726
|
+
dispatch(update(path, (array) => {
|
|
1623
1727
|
moveDown(array, toMove);
|
|
1624
1728
|
return array;
|
|
1625
1729
|
}));
|
|
1626
|
-
}
|
|
1730
|
+
},
|
|
1627
1731
|
});
|
|
1628
1732
|
const mapDispatchToMultiEnumProps = (dispatch) => ({
|
|
1629
1733
|
addItem: (path, value) => {
|
|
1630
|
-
dispatch(update(path, data => {
|
|
1734
|
+
dispatch(update(path, (data) => {
|
|
1631
1735
|
if (data === undefined || data === null) {
|
|
1632
1736
|
return [value];
|
|
1633
1737
|
}
|
|
@@ -1636,18 +1740,18 @@ const mapDispatchToMultiEnumProps = (dispatch) => ({
|
|
|
1636
1740
|
}));
|
|
1637
1741
|
},
|
|
1638
1742
|
removeItem: (path, toDelete) => {
|
|
1639
|
-
dispatch(update(path, data => {
|
|
1743
|
+
dispatch(update(path, (data) => {
|
|
1640
1744
|
const indexInData = data.indexOf(toDelete);
|
|
1641
1745
|
data.splice(indexInData, 1);
|
|
1642
1746
|
return data;
|
|
1643
1747
|
}));
|
|
1644
|
-
}
|
|
1748
|
+
},
|
|
1645
1749
|
});
|
|
1646
1750
|
const layoutDefaultProps = {
|
|
1647
1751
|
visible: true,
|
|
1648
1752
|
enabled: true,
|
|
1649
1753
|
path: '',
|
|
1650
|
-
direction: 'column'
|
|
1754
|
+
direction: 'column',
|
|
1651
1755
|
};
|
|
1652
1756
|
const getDirection = (uischema) => {
|
|
1653
1757
|
if (uischema.type === 'HorizontalLayout') {
|
|
@@ -1669,7 +1773,9 @@ const mapStateToLayoutProps = (state, ownProps) => {
|
|
|
1669
1773
|
const enabled = isInherentlyEnabled(state, ownProps, uischema, undefined,
|
|
1670
1774
|
rootData, config);
|
|
1671
1775
|
const t = getTranslator()(state);
|
|
1672
|
-
const label = isLabelable(uischema)
|
|
1776
|
+
const label = isLabelable(uischema)
|
|
1777
|
+
? deriveLabelForUISchemaElement(uischema, t)
|
|
1778
|
+
: undefined;
|
|
1673
1779
|
return {
|
|
1674
1780
|
...layoutDefaultProps,
|
|
1675
1781
|
renderers: ownProps.renderers || getRenderers(state),
|
|
@@ -1682,7 +1788,7 @@ const mapStateToLayoutProps = (state, ownProps) => {
|
|
|
1682
1788
|
schema: ownProps.schema,
|
|
1683
1789
|
direction: ownProps.direction ?? getDirection(uischema),
|
|
1684
1790
|
config,
|
|
1685
|
-
label
|
|
1791
|
+
label,
|
|
1686
1792
|
};
|
|
1687
1793
|
};
|
|
1688
1794
|
const mapStateToJsonFormsRendererProps = (state, ownProps) => {
|
|
@@ -1694,12 +1800,12 @@ const mapStateToJsonFormsRendererProps = (state, ownProps) => {
|
|
|
1694
1800
|
uischema: ownProps.uischema || getUiSchema(state),
|
|
1695
1801
|
path: ownProps.path,
|
|
1696
1802
|
enabled: ownProps.enabled,
|
|
1697
|
-
config: getConfig(state)
|
|
1803
|
+
config: getConfig(state),
|
|
1698
1804
|
};
|
|
1699
1805
|
};
|
|
1700
1806
|
const controlDefaultProps = {
|
|
1701
1807
|
...layoutDefaultProps,
|
|
1702
|
-
errors: []
|
|
1808
|
+
errors: [],
|
|
1703
1809
|
};
|
|
1704
1810
|
const mapStateToCombinatorRendererProps = (state, ownProps, keyword) => {
|
|
1705
1811
|
const { data, schema, rootSchema, ...props } = mapStateToControlProps(state, ownProps);
|
|
@@ -1709,12 +1815,12 @@ const mapStateToCombinatorRendererProps = (state, ownProps, keyword) => {
|
|
|
1709
1815
|
'additionalProperties',
|
|
1710
1816
|
'type',
|
|
1711
1817
|
'enum',
|
|
1712
|
-
'const'
|
|
1818
|
+
'const',
|
|
1713
1819
|
];
|
|
1714
1820
|
const dataIsValid = (errors) => {
|
|
1715
1821
|
return (!errors ||
|
|
1716
1822
|
errors.length === 0 ||
|
|
1717
|
-
!errors.find(e => structuralKeywords.indexOf(e.keyword) !== -1));
|
|
1823
|
+
!errors.find((e) => structuralKeywords.indexOf(e.keyword) !== -1));
|
|
1718
1824
|
};
|
|
1719
1825
|
let indexOfFittingSchema;
|
|
1720
1826
|
for (let i = 0; i < schema[keyword]?.length; i++) {
|
|
@@ -1740,7 +1846,7 @@ const mapStateToCombinatorRendererProps = (state, ownProps, keyword) => {
|
|
|
1740
1846
|
rootSchema,
|
|
1741
1847
|
...props,
|
|
1742
1848
|
indexOfFittingSchema,
|
|
1743
|
-
uischemas: getUISchemas(state)
|
|
1849
|
+
uischemas: getUISchemas(state),
|
|
1744
1850
|
};
|
|
1745
1851
|
};
|
|
1746
1852
|
const mapStateToAllOfProps = (state, ownProps) => mapStateToCombinatorRendererProps(state, ownProps, 'allOf');
|
|
@@ -1751,20 +1857,23 @@ const mapStateToOneOfProps = (state, ownProps) => {
|
|
|
1751
1857
|
return mapStateToCombinatorRendererProps(state, ownProps, 'oneOf');
|
|
1752
1858
|
};
|
|
1753
1859
|
const mapStateToArrayLayoutProps = (state, ownProps) => {
|
|
1754
|
-
const { path, schema, uischema, errors, ...props } = mapStateToControlWithDetailProps(state, ownProps);
|
|
1860
|
+
const { path, schema, uischema, errors, i18nKeyPrefix, label, ...props } = mapStateToControlWithDetailProps(state, ownProps);
|
|
1755
1861
|
const resolvedSchema = Resolve.schema(schema, 'items', props.rootSchema);
|
|
1756
|
-
const
|
|
1862
|
+
const t = getTranslator()(state);
|
|
1863
|
+
const childErrors = getCombinedErrorMessage(getSubErrorsAt(path, resolvedSchema)(state), getErrorTranslator()(state), t, undefined, undefined, undefined);
|
|
1757
1864
|
const allErrors = errors +
|
|
1758
1865
|
(errors.length > 0 && childErrors.length > 0 ? '\n' : '') +
|
|
1759
1866
|
childErrors;
|
|
1760
1867
|
return {
|
|
1761
1868
|
...props,
|
|
1869
|
+
label,
|
|
1762
1870
|
path,
|
|
1763
1871
|
uischema,
|
|
1764
1872
|
schema: resolvedSchema,
|
|
1765
1873
|
data: props.data ? props.data.length : 0,
|
|
1766
1874
|
errors: allErrors,
|
|
1767
|
-
minItems: schema.minItems
|
|
1875
|
+
minItems: schema.minItems,
|
|
1876
|
+
translations: getArrayTranslations(t, arrayDefaultTranslations, i18nKeyPrefix, label),
|
|
1768
1877
|
};
|
|
1769
1878
|
};
|
|
1770
1879
|
const mapStateToLabelProps = (state, props) => {
|
|
@@ -1804,7 +1913,9 @@ const mapStateToCellProps = (state, ownProps) => {
|
|
|
1804
1913
|
else {
|
|
1805
1914
|
enabled = isInherentlyEnabled(state, ownProps, uischema, schema || rootSchema, rootData, config);
|
|
1806
1915
|
}
|
|
1807
|
-
const
|
|
1916
|
+
const t = getTranslator()(state);
|
|
1917
|
+
const te = getErrorTranslator()(state);
|
|
1918
|
+
const errors = getCombinedErrorMessage(getErrorAt(path, schema)(state), te, t, schema, uischema, path);
|
|
1808
1919
|
const isValid = isEmpty(errors);
|
|
1809
1920
|
return {
|
|
1810
1921
|
data: Resolve.data(rootData, path),
|
|
@@ -1819,37 +1930,37 @@ const mapStateToCellProps = (state, ownProps) => {
|
|
|
1819
1930
|
config: getConfig(state),
|
|
1820
1931
|
rootSchema,
|
|
1821
1932
|
renderers,
|
|
1822
|
-
cells
|
|
1933
|
+
cells,
|
|
1823
1934
|
};
|
|
1824
1935
|
};
|
|
1825
1936
|
const mapStateToDispatchCellProps = (state, ownProps) => {
|
|
1826
1937
|
const props = mapStateToCellProps(state, ownProps);
|
|
1827
|
-
const { renderers, cells, ...otherOwnProps } = ownProps;
|
|
1938
|
+
const { renderers: _renderers, cells, ...otherOwnProps } = ownProps;
|
|
1828
1939
|
return {
|
|
1829
1940
|
...props,
|
|
1830
1941
|
...otherOwnProps,
|
|
1831
|
-
cells: cells || state.jsonforms.cells || []
|
|
1942
|
+
cells: cells || state.jsonforms.cells || [],
|
|
1832
1943
|
};
|
|
1833
1944
|
};
|
|
1834
1945
|
const defaultMapStateToEnumCellProps = (state, ownProps) => {
|
|
1835
1946
|
const props = mapStateToCellProps(state, ownProps);
|
|
1836
1947
|
const options = ownProps.options ||
|
|
1837
|
-
props.schema.enum?.map(e => enumToEnumOptionMapper(e, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))) ||
|
|
1948
|
+
props.schema.enum?.map((e) => enumToEnumOptionMapper(e, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))) ||
|
|
1838
1949
|
(props.schema.const && [
|
|
1839
|
-
enumToEnumOptionMapper(props.schema.const, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path))
|
|
1950
|
+
enumToEnumOptionMapper(props.schema.const, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)),
|
|
1840
1951
|
]);
|
|
1841
1952
|
return {
|
|
1842
1953
|
...props,
|
|
1843
|
-
options
|
|
1954
|
+
options,
|
|
1844
1955
|
};
|
|
1845
1956
|
};
|
|
1846
1957
|
const mapStateToOneOfEnumCellProps = (state, ownProps) => {
|
|
1847
1958
|
const props = mapStateToCellProps(state, ownProps);
|
|
1848
1959
|
const options = ownProps.options ||
|
|
1849
|
-
props.schema.oneOf?.map(oneOfSubSchema => oneOfToEnumOptionMapper(oneOfSubSchema, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)));
|
|
1960
|
+
props.schema.oneOf?.map((oneOfSubSchema) => oneOfToEnumOptionMapper(oneOfSubSchema, getTranslator()(state), getI18nKeyPrefix(props.schema, props.uischema, props.path)));
|
|
1850
1961
|
return {
|
|
1851
1962
|
...props,
|
|
1852
|
-
options
|
|
1963
|
+
options,
|
|
1853
1964
|
};
|
|
1854
1965
|
};
|
|
1855
1966
|
const mapDispatchToCellProps = mapDispatchToControlProps;
|
|
@@ -1857,7 +1968,7 @@ const defaultMapDispatchToControlProps =
|
|
|
1857
1968
|
(dispatch, ownProps) => {
|
|
1858
1969
|
const { handleChange } = mapDispatchToCellProps(dispatch);
|
|
1859
1970
|
return {
|
|
1860
|
-
handleChange: ownProps.handleChange || handleChange
|
|
1971
|
+
handleChange: ownProps.handleChange || handleChange,
|
|
1861
1972
|
};
|
|
1862
1973
|
};
|
|
1863
1974
|
|
|
@@ -1870,11 +1981,13 @@ const createLabel = (subSchema, subSchemaIndex, keyword) => {
|
|
|
1870
1981
|
}
|
|
1871
1982
|
};
|
|
1872
1983
|
const createCombinatorRenderInfos = (combinatorSubSchemas, rootSchema, keyword, control, path, uischemas) => combinatorSubSchemas.map((subSchema, subSchemaIndex) => {
|
|
1873
|
-
const schema = subSchema.$ref
|
|
1984
|
+
const schema = subSchema.$ref
|
|
1985
|
+
? Resolve.schema(rootSchema, subSchema.$ref, rootSchema)
|
|
1986
|
+
: subSchema;
|
|
1874
1987
|
return {
|
|
1875
1988
|
schema,
|
|
1876
1989
|
uischema: findUISchema(uischemas, schema, control.scope, path, undefined, control, rootSchema),
|
|
1877
|
-
label: createLabel(subSchema, subSchemaIndex, keyword)
|
|
1990
|
+
label: createLabel(subSchema, subSchemaIndex, keyword),
|
|
1878
1991
|
};
|
|
1879
1992
|
});
|
|
1880
1993
|
|
|
@@ -1901,7 +2014,7 @@ const clearAllIds = () => usedIds.clear();
|
|
|
1901
2014
|
|
|
1902
2015
|
const getFirstPrimitiveProp = (schema) => {
|
|
1903
2016
|
if (schema.properties) {
|
|
1904
|
-
return find(Object.keys(schema.properties), propName => {
|
|
2017
|
+
return find(Object.keys(schema.properties), (propName) => {
|
|
1905
2018
|
const prop = schema.properties[propName];
|
|
1906
2019
|
return (prop.type === 'string' ||
|
|
1907
2020
|
prop.type === 'number' ||
|
|
@@ -1910,6 +2023,9 @@ const getFirstPrimitiveProp = (schema) => {
|
|
|
1910
2023
|
}
|
|
1911
2024
|
return undefined;
|
|
1912
2025
|
};
|
|
2026
|
+
const isOneOfEnumSchema = (schema) => schema?.hasOwnProperty('oneOf') &&
|
|
2027
|
+
schema?.oneOf &&
|
|
2028
|
+
schema.oneOf.every((s) => s.const !== undefined);
|
|
1913
2029
|
|
|
1914
2030
|
const setReadonlyPropertyValue = (value) => (child) => {
|
|
1915
2031
|
if (!child.options) {
|
|
@@ -1928,7 +2044,7 @@ const iterateSchema = (uischema, toApply) => {
|
|
|
1928
2044
|
return;
|
|
1929
2045
|
}
|
|
1930
2046
|
if (isLayout(uischema)) {
|
|
1931
|
-
uischema.elements.forEach(child => iterateSchema(child, toApply));
|
|
2047
|
+
uischema.elements.forEach((child) => iterateSchema(child, toApply));
|
|
1932
2048
|
return;
|
|
1933
2049
|
}
|
|
1934
2050
|
toApply(uischema);
|
|
@@ -1939,7 +2055,7 @@ const createAjv = (options) => {
|
|
|
1939
2055
|
allErrors: true,
|
|
1940
2056
|
verbose: true,
|
|
1941
2057
|
strict: false,
|
|
1942
|
-
...options
|
|
2058
|
+
...options,
|
|
1943
2059
|
});
|
|
1944
2060
|
addFormats(ajv);
|
|
1945
2061
|
return ajv;
|
|
@@ -1947,11 +2063,11 @@ const createAjv = (options) => {
|
|
|
1947
2063
|
|
|
1948
2064
|
const createLayout = (layoutType) => ({
|
|
1949
2065
|
type: layoutType,
|
|
1950
|
-
elements: []
|
|
2066
|
+
elements: [],
|
|
1951
2067
|
});
|
|
1952
2068
|
const createControlElement = (ref) => ({
|
|
1953
2069
|
type: 'Control',
|
|
1954
|
-
scope: ref
|
|
2070
|
+
scope: ref,
|
|
1955
2071
|
});
|
|
1956
2072
|
const wrapInLayoutIfNecessary = (uischema, layoutType) => {
|
|
1957
2073
|
if (!isEmpty(uischema) && !isLayout(uischema)) {
|
|
@@ -1970,7 +2086,7 @@ const addLabel = (layout, labelName) => {
|
|
|
1970
2086
|
else {
|
|
1971
2087
|
const label = {
|
|
1972
2088
|
type: 'Label',
|
|
1973
|
-
text: fixedLabel
|
|
2089
|
+
text: fixedLabel,
|
|
1974
2090
|
};
|
|
1975
2091
|
layout.elements.push(label);
|
|
1976
2092
|
}
|
|
@@ -2008,7 +2124,7 @@ const generateUISchema = (jsonSchema, schemaElements, currentRef, schemaName, la
|
|
|
2008
2124
|
}
|
|
2009
2125
|
if (!isEmpty(jsonSchema.properties)) {
|
|
2010
2126
|
const nextRef = currentRef + '/properties';
|
|
2011
|
-
Object.keys(jsonSchema.properties).map(propName => {
|
|
2127
|
+
Object.keys(jsonSchema.properties).map((propName) => {
|
|
2012
2128
|
let value = jsonSchema.properties[propName];
|
|
2013
2129
|
const ref = `${nextRef}/${encode(propName)}`;
|
|
2014
2130
|
if (value.$ref !== undefined) {
|
|
@@ -2025,10 +2141,11 @@ const generateUISchema = (jsonSchema, schemaElements, currentRef, schemaName, la
|
|
|
2025
2141
|
case 'string':
|
|
2026
2142
|
case 'number':
|
|
2027
2143
|
case 'integer':
|
|
2028
|
-
case 'boolean':
|
|
2144
|
+
case 'boolean': {
|
|
2029
2145
|
const controlObject = createControlElement(currentRef);
|
|
2030
2146
|
schemaElements.push(controlObject);
|
|
2031
2147
|
return controlObject;
|
|
2148
|
+
}
|
|
2032
2149
|
default:
|
|
2033
2150
|
throw new Error('Unknown type: ' + JSON.stringify(jsonSchema));
|
|
2034
2151
|
}
|
|
@@ -2038,11 +2155,11 @@ const generateDefaultUISchema = (jsonSchema, layoutType = 'VerticalLayout', pref
|
|
|
2038
2155
|
const Generate = {
|
|
2039
2156
|
jsonSchema: generateJsonSchema,
|
|
2040
2157
|
uiSchema: generateDefaultUISchema,
|
|
2041
|
-
controlElement: createControlElement
|
|
2158
|
+
controlElement: createControlElement,
|
|
2042
2159
|
};
|
|
2043
2160
|
|
|
2044
2161
|
const INIT = 'jsonforms/INIT';
|
|
2045
|
-
const UPDATE_CORE =
|
|
2162
|
+
const UPDATE_CORE = 'jsonforms/UPDATE_CORE';
|
|
2046
2163
|
const SET_AJV = 'jsonforms/SET_AJV';
|
|
2047
2164
|
const UPDATE_DATA = 'jsonforms/UPDATE';
|
|
2048
2165
|
const UPDATE_ERRORS = 'jsonforms/UPDATE_ERRORS';
|
|
@@ -2052,115 +2169,115 @@ const REMOVE_RENDERER = 'jsonforms/REMOVE_RENDERER';
|
|
|
2052
2169
|
const ADD_CELL = 'jsonforms/ADD_CELL';
|
|
2053
2170
|
const REMOVE_CELL = 'jsonforms/REMOVE_CELL';
|
|
2054
2171
|
const SET_CONFIG = 'jsonforms/SET_CONFIG';
|
|
2055
|
-
const ADD_UI_SCHEMA =
|
|
2056
|
-
const REMOVE_UI_SCHEMA =
|
|
2057
|
-
const SET_SCHEMA =
|
|
2058
|
-
const SET_UISCHEMA =
|
|
2172
|
+
const ADD_UI_SCHEMA = 'jsonforms/ADD_UI_SCHEMA';
|
|
2173
|
+
const REMOVE_UI_SCHEMA = 'jsonforms/REMOVE_UI_SCHEMA';
|
|
2174
|
+
const SET_SCHEMA = 'jsonforms/SET_SCHEMA';
|
|
2175
|
+
const SET_UISCHEMA = 'jsonforms/SET_UISCHEMA';
|
|
2059
2176
|
const SET_VALIDATION_MODE = 'jsonforms/SET_VALIDATION_MODE';
|
|
2060
|
-
const SET_LOCALE =
|
|
2177
|
+
const SET_LOCALE = 'jsonforms/SET_LOCALE';
|
|
2061
2178
|
const SET_TRANSLATOR = 'jsonforms/SET_TRANSLATOR';
|
|
2062
2179
|
const UPDATE_I18N = 'jsonforms/UPDATE_I18N';
|
|
2063
|
-
const ADD_DEFAULT_DATA =
|
|
2064
|
-
const REMOVE_DEFAULT_DATA =
|
|
2180
|
+
const ADD_DEFAULT_DATA = 'jsonforms/ADD_DEFAULT_DATA';
|
|
2181
|
+
const REMOVE_DEFAULT_DATA = 'jsonforms/REMOVE_DEFAULT_DATA';
|
|
2065
2182
|
const init = (data, schema = generateJsonSchema(data), uischema, options) => ({
|
|
2066
2183
|
type: INIT,
|
|
2067
2184
|
data,
|
|
2068
2185
|
schema,
|
|
2069
2186
|
uischema: typeof uischema === 'object' ? uischema : generateDefaultUISchema(schema),
|
|
2070
|
-
options
|
|
2187
|
+
options,
|
|
2071
2188
|
});
|
|
2072
2189
|
const updateCore = (data, schema, uischema, options) => ({
|
|
2073
2190
|
type: UPDATE_CORE,
|
|
2074
2191
|
data,
|
|
2075
2192
|
schema,
|
|
2076
2193
|
uischema,
|
|
2077
|
-
options
|
|
2194
|
+
options,
|
|
2078
2195
|
});
|
|
2079
2196
|
const registerDefaultData = (schemaPath, data) => ({
|
|
2080
2197
|
type: ADD_DEFAULT_DATA,
|
|
2081
2198
|
schemaPath,
|
|
2082
|
-
data
|
|
2199
|
+
data,
|
|
2083
2200
|
});
|
|
2084
2201
|
const unregisterDefaultData = (schemaPath) => ({
|
|
2085
2202
|
type: REMOVE_DEFAULT_DATA,
|
|
2086
|
-
schemaPath
|
|
2203
|
+
schemaPath,
|
|
2087
2204
|
});
|
|
2088
2205
|
const setAjv = (ajv) => ({
|
|
2089
2206
|
type: SET_AJV,
|
|
2090
|
-
ajv
|
|
2207
|
+
ajv,
|
|
2091
2208
|
});
|
|
2092
2209
|
const update = (path, updater) => ({
|
|
2093
2210
|
type: UPDATE_DATA,
|
|
2094
2211
|
path,
|
|
2095
|
-
updater
|
|
2212
|
+
updater,
|
|
2096
2213
|
});
|
|
2097
2214
|
const updateErrors = (errors) => ({
|
|
2098
2215
|
type: UPDATE_ERRORS,
|
|
2099
|
-
errors
|
|
2216
|
+
errors,
|
|
2100
2217
|
});
|
|
2101
2218
|
const registerRenderer = (tester, renderer) => ({
|
|
2102
2219
|
type: ADD_RENDERER,
|
|
2103
2220
|
tester,
|
|
2104
|
-
renderer
|
|
2221
|
+
renderer,
|
|
2105
2222
|
});
|
|
2106
2223
|
const registerCell = (tester, cell) => ({
|
|
2107
2224
|
type: ADD_CELL,
|
|
2108
2225
|
tester,
|
|
2109
|
-
cell
|
|
2226
|
+
cell,
|
|
2110
2227
|
});
|
|
2111
2228
|
const unregisterCell = (tester, cell) => ({
|
|
2112
2229
|
type: REMOVE_CELL,
|
|
2113
2230
|
tester,
|
|
2114
|
-
cell
|
|
2231
|
+
cell,
|
|
2115
2232
|
});
|
|
2116
2233
|
const unregisterRenderer = (tester, renderer) => ({
|
|
2117
2234
|
type: REMOVE_RENDERER,
|
|
2118
2235
|
tester,
|
|
2119
|
-
renderer
|
|
2236
|
+
renderer,
|
|
2120
2237
|
});
|
|
2121
2238
|
const setConfig = (config) => ({
|
|
2122
2239
|
type: SET_CONFIG,
|
|
2123
|
-
config
|
|
2240
|
+
config,
|
|
2124
2241
|
});
|
|
2125
2242
|
const setValidationMode = (validationMode) => ({
|
|
2126
2243
|
type: SET_VALIDATION_MODE,
|
|
2127
|
-
validationMode
|
|
2244
|
+
validationMode,
|
|
2128
2245
|
});
|
|
2129
2246
|
const registerUISchema = (tester, uischema) => {
|
|
2130
2247
|
return {
|
|
2131
2248
|
type: ADD_UI_SCHEMA,
|
|
2132
2249
|
tester,
|
|
2133
|
-
uischema
|
|
2250
|
+
uischema,
|
|
2134
2251
|
};
|
|
2135
2252
|
};
|
|
2136
2253
|
const unregisterUISchema = (tester) => {
|
|
2137
2254
|
return {
|
|
2138
2255
|
type: REMOVE_UI_SCHEMA,
|
|
2139
|
-
tester
|
|
2256
|
+
tester,
|
|
2140
2257
|
};
|
|
2141
2258
|
};
|
|
2142
2259
|
const setLocale = (locale) => ({
|
|
2143
2260
|
type: SET_LOCALE,
|
|
2144
|
-
locale
|
|
2261
|
+
locale,
|
|
2145
2262
|
});
|
|
2146
2263
|
const setSchema = (schema) => ({
|
|
2147
2264
|
type: SET_SCHEMA,
|
|
2148
|
-
schema
|
|
2265
|
+
schema,
|
|
2149
2266
|
});
|
|
2150
2267
|
const setTranslator = (translator, errorTranslator) => ({
|
|
2151
2268
|
type: SET_TRANSLATOR,
|
|
2152
2269
|
translator,
|
|
2153
|
-
errorTranslator
|
|
2270
|
+
errorTranslator,
|
|
2154
2271
|
});
|
|
2155
2272
|
const updateI18n = (locale, translator, errorTranslator) => ({
|
|
2156
2273
|
type: UPDATE_I18N,
|
|
2157
2274
|
locale,
|
|
2158
2275
|
translator,
|
|
2159
|
-
errorTranslator
|
|
2276
|
+
errorTranslator,
|
|
2160
2277
|
});
|
|
2161
2278
|
const setUISchema = (uischema) => ({
|
|
2162
2279
|
type: SET_UISCHEMA,
|
|
2163
|
-
uischema
|
|
2280
|
+
uischema,
|
|
2164
2281
|
});
|
|
2165
2282
|
|
|
2166
2283
|
var index = /*#__PURE__*/Object.freeze({
|
|
@@ -2210,8 +2327,8 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
2210
2327
|
|
|
2211
2328
|
const Helpers = {
|
|
2212
2329
|
createLabelDescriptionFrom,
|
|
2213
|
-
convertToValidClassName
|
|
2330
|
+
convertToValidClassName,
|
|
2214
2331
|
};
|
|
2215
2332
|
|
|
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 };
|
|
2333
|
+
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, isOneOfEnumSchema, 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
2334
|
//# sourceMappingURL=jsonforms-core.esm.js.map
|