@jsonforms/core 3.0.0-beta.3 → 3.0.0-rc.0
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 +11 -0
- package/docs/assets/js/search.json +1 -1
- package/docs/enums/ruleeffect.html +4 -4
- package/docs/globals.html +371 -115
- package/docs/index.html +59 -4
- package/docs/interfaces/andcondition.html +2 -2
- package/docs/interfaces/arraycontrolprops.html +21 -21
- package/docs/interfaces/arraylayoutprops.html +21 -21
- package/docs/interfaces/categorization.html +24 -16
- package/docs/interfaces/category.html +24 -16
- package/docs/interfaces/cellprops.html +12 -12
- package/docs/interfaces/combinatorrendererprops.html +18 -18
- package/docs/interfaces/composablecondition.html +2 -2
- package/docs/interfaces/condition.html +1 -1
- package/docs/interfaces/controlelement.html +38 -15
- package/docs/interfaces/controlprops.html +16 -16
- package/docs/interfaces/controlstate.html +2 -2
- package/docs/interfaces/controlwithdetailprops.html +17 -17
- package/docs/interfaces/dispatchcellprops.html +10 -10
- package/docs/interfaces/dispatchcellstateprops.html +10 -10
- package/docs/interfaces/dispatchpropsofarraycontrol.html +4 -4
- package/docs/interfaces/dispatchpropsofcontrol.html +1 -1
- package/docs/interfaces/dispatchpropsofmultienumcontrol.html +2 -2
- package/docs/interfaces/enumcellprops.html +13 -13
- package/docs/interfaces/enumoption.html +2 -2
- package/docs/interfaces/grouplayout.html +24 -12
- package/docs/interfaces/horizontallayout.html +4 -4
- package/docs/interfaces/internationalizable.html +161 -0
- package/docs/interfaces/jsonformsprops.html +24 -9
- package/docs/interfaces/labelable.html +184 -0
- package/docs/interfaces/labeldescription.html +2 -2
- package/docs/interfaces/labeled.html +182 -0
- package/docs/interfaces/labelelement.html +22 -4
- package/docs/interfaces/labelprops.html +339 -0
- package/docs/interfaces/layout.html +4 -4
- package/docs/interfaces/layoutprops.html +25 -10
- package/docs/interfaces/leafcondition.html +9 -8
- package/docs/interfaces/orcondition.html +2 -2
- package/docs/interfaces/ownpropsofcell.html +9 -9
- package/docs/interfaces/ownpropsofcontrol.html +9 -9
- package/docs/interfaces/ownpropsofenum.html +1 -1
- package/docs/interfaces/ownpropsofenumcell.html +10 -10
- package/docs/interfaces/ownpropsofjsonformsrenderer.html +8 -8
- package/docs/interfaces/ownpropsoflabel.html +286 -0
- package/docs/interfaces/ownpropsoflayout.html +9 -9
- package/docs/interfaces/ownpropsofmasterlistitem.html +6 -6
- package/docs/interfaces/ownpropsofrenderer.html +11 -8
- package/docs/interfaces/rendererprops.html +9 -9
- package/docs/interfaces/rule.html +2 -2
- package/docs/interfaces/schemabasedcondition.html +9 -8
- package/docs/interfaces/scopable.html +3 -9
- package/docs/interfaces/scoped.html +183 -0
- package/docs/interfaces/statepropsofarraycontrol.html +17 -17
- package/docs/interfaces/statepropsofarraylayout.html +17 -17
- package/docs/interfaces/statepropsofcell.html +11 -11
- package/docs/interfaces/statepropsofcombinator.html +17 -17
- package/docs/interfaces/statepropsofcontrol.html +15 -15
- package/docs/interfaces/statepropsofcontrolwithdetail.html +16 -16
- package/docs/interfaces/statepropsofenumcell.html +12 -12
- package/docs/interfaces/statepropsofjsonformsrenderer.html +23 -9
- package/docs/interfaces/statepropsoflabel.html +343 -0
- package/docs/interfaces/statepropsoflayout.html +24 -10
- package/docs/interfaces/statepropsofmasteritem.html +7 -7
- package/docs/interfaces/statepropsofrenderer.html +12 -9
- package/docs/interfaces/statepropsofscopedrenderer.html +12 -12
- package/docs/interfaces/testercontext.html +184 -0
- package/docs/interfaces/uischemaelement.html +3 -3
- package/docs/interfaces/verticallayout.html +4 -4
- package/docs/interfaces/withclassname.html +1 -1
- package/lib/i18n/i18nUtil.d.ts +9 -4
- package/lib/jsonforms-core.cjs.js +103 -50
- package/lib/jsonforms-core.cjs.js.map +1 -1
- package/lib/jsonforms-core.esm.js +85 -50
- package/lib/jsonforms-core.esm.js.map +1 -1
- package/lib/models/uischema.d.ts +41 -24
- package/lib/reducers/i18n.d.ts +1 -1
- package/lib/testers/testers.d.ts +15 -6
- package/lib/util/renderer.d.ts +18 -1
- package/lib/util/runtime.d.ts +1 -2
- package/lib/util/util.d.ts +6 -6
- package/package.json +2 -2
- package/src/i18n/i18nUtil.ts +28 -8
- package/src/models/uischema.ts +60 -24
- package/src/reducers/i18n.ts +1 -1
- package/src/testers/testers.ts +43 -36
- package/src/util/path.ts +9 -5
- package/src/util/renderer.ts +52 -25
- package/src/util/runtime.ts +1 -1
- package/src/util/util.ts +8 -8
- package/stats.html +1 -1
- package/test/i18n/i18nUtil.test.ts +41 -1
- package/test/testers.test.ts +40 -23
- package/test/util/renderer.test.ts +106 -8
package/src/testers/testers.ts
CHANGED
|
@@ -49,7 +49,7 @@ export const NOT_APPLICABLE = -1;
|
|
|
49
49
|
* A tester is a function that receives an UI schema and a JSON schema and returns a boolean.
|
|
50
50
|
* The rootSchema is handed over as context. Can be used to resolve references.
|
|
51
51
|
*/
|
|
52
|
-
export type Tester = (uischema: UISchemaElement, schema: JsonSchema,
|
|
52
|
+
export type Tester = (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => boolean;
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* A ranked tester associates a tester with a number.
|
|
@@ -57,9 +57,19 @@ export type Tester = (uischema: UISchemaElement, schema: JsonSchema, rootSchema:
|
|
|
57
57
|
export type RankedTester = (
|
|
58
58
|
uischema: UISchemaElement,
|
|
59
59
|
schema: JsonSchema,
|
|
60
|
-
|
|
60
|
+
context: TesterContext
|
|
61
61
|
) => number;
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Additional context given to a tester in addition to UISchema and JsonSchema.
|
|
65
|
+
*/
|
|
66
|
+
export interface TesterContext {
|
|
67
|
+
/** The root JsonSchema of the form. Can be used to resolve references. */
|
|
68
|
+
rootSchema: JsonSchema;
|
|
69
|
+
/** The form wide configuration object given to JsonForms. */
|
|
70
|
+
config: any;
|
|
71
|
+
}
|
|
72
|
+
|
|
63
73
|
export const isControl = (uischema: any): uischema is ControlElement =>
|
|
64
74
|
!isEmpty(uischema) && uischema.scope !== undefined;
|
|
65
75
|
|
|
@@ -75,7 +85,7 @@ export const isControl = (uischema: any): uischema is ControlElement =>
|
|
|
75
85
|
*/
|
|
76
86
|
export const schemaMatches = (
|
|
77
87
|
predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean
|
|
78
|
-
): Tester => (uischema: UISchemaElement, schema: JsonSchema,
|
|
88
|
+
): Tester => (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext): boolean => {
|
|
79
89
|
if (isEmpty(uischema) || !isControl(uischema)) {
|
|
80
90
|
return false;
|
|
81
91
|
}
|
|
@@ -88,26 +98,26 @@ export const schemaMatches = (
|
|
|
88
98
|
}
|
|
89
99
|
let currentDataSchema = schema;
|
|
90
100
|
if (hasType(schema, 'object')) {
|
|
91
|
-
currentDataSchema = resolveSchema(schema, schemaPath, rootSchema);
|
|
101
|
+
currentDataSchema = resolveSchema(schema, schemaPath, context?.rootSchema);
|
|
92
102
|
}
|
|
93
103
|
if (currentDataSchema === undefined) {
|
|
94
104
|
return false;
|
|
95
105
|
}
|
|
96
106
|
|
|
97
|
-
return predicate(currentDataSchema, rootSchema);
|
|
107
|
+
return predicate(currentDataSchema, context?.rootSchema);
|
|
98
108
|
};
|
|
99
109
|
|
|
100
110
|
export const schemaSubPathMatches = (
|
|
101
111
|
subPath: string,
|
|
102
112
|
predicate: (schema: JsonSchema, rootSchema: JsonSchema) => boolean
|
|
103
|
-
): Tester => (uischema: UISchemaElement, schema: JsonSchema,
|
|
113
|
+
): Tester => (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext): boolean => {
|
|
104
114
|
if (isEmpty(uischema) || !isControl(uischema)) {
|
|
105
115
|
return false;
|
|
106
116
|
}
|
|
107
117
|
const schemaPath = uischema.scope;
|
|
108
118
|
let currentDataSchema: JsonSchema = schema;
|
|
109
119
|
if (hasType(schema, 'object')) {
|
|
110
|
-
currentDataSchema = resolveSchema(schema, schemaPath, rootSchema);
|
|
120
|
+
currentDataSchema = resolveSchema(schema, schemaPath, context?.rootSchema);
|
|
111
121
|
}
|
|
112
122
|
currentDataSchema = get(currentDataSchema, subPath);
|
|
113
123
|
|
|
@@ -115,7 +125,7 @@ export const schemaSubPathMatches = (
|
|
|
115
125
|
return false;
|
|
116
126
|
}
|
|
117
127
|
|
|
118
|
-
return predicate(currentDataSchema, rootSchema);
|
|
128
|
+
return predicate(currentDataSchema, context?.rootSchema);
|
|
119
129
|
};
|
|
120
130
|
|
|
121
131
|
/**
|
|
@@ -144,7 +154,7 @@ export const formatIs = (expectedFormat: string): Tester =>
|
|
|
144
154
|
schema =>
|
|
145
155
|
!isEmpty(schema) &&
|
|
146
156
|
schema.format === expectedFormat &&
|
|
147
|
-
schema
|
|
157
|
+
hasType(schema, 'string')
|
|
148
158
|
);
|
|
149
159
|
|
|
150
160
|
/**
|
|
@@ -218,8 +228,8 @@ export const scopeEndIs = (expected: string): Tester => (
|
|
|
218
228
|
export const and = (...testers: Tester[]): Tester => (
|
|
219
229
|
uischema: UISchemaElement,
|
|
220
230
|
schema: JsonSchema,
|
|
221
|
-
|
|
222
|
-
) => testers.reduce((acc, tester) => acc && tester(uischema, schema,
|
|
231
|
+
context: TesterContext
|
|
232
|
+
) => testers.reduce((acc, tester) => acc && tester(uischema, schema, context), true);
|
|
223
233
|
|
|
224
234
|
/**
|
|
225
235
|
* A tester that allow composing other testers by || them.
|
|
@@ -229,8 +239,8 @@ export const and = (...testers: Tester[]): Tester => (
|
|
|
229
239
|
export const or = (...testers: Tester[]): Tester => (
|
|
230
240
|
uischema: UISchemaElement,
|
|
231
241
|
schema: JsonSchema,
|
|
232
|
-
|
|
233
|
-
) => testers.reduce((acc, tester) => acc || tester(uischema, schema,
|
|
242
|
+
context: TesterContext
|
|
243
|
+
) => testers.reduce((acc, tester) => acc || tester(uischema, schema, context), false);
|
|
234
244
|
/**
|
|
235
245
|
* Create a ranked tester that will associate a number with a given tester, if the
|
|
236
246
|
* latter returns true.
|
|
@@ -241,9 +251,9 @@ export const or = (...testers: Tester[]): Tester => (
|
|
|
241
251
|
export const rankWith = (rank: number, tester: Tester) => (
|
|
242
252
|
uischema: UISchemaElement,
|
|
243
253
|
schema: JsonSchema,
|
|
244
|
-
|
|
254
|
+
context: TesterContext
|
|
245
255
|
): number => {
|
|
246
|
-
if (tester(uischema, schema,
|
|
256
|
+
if (tester(uischema, schema, context)) {
|
|
247
257
|
return rank;
|
|
248
258
|
}
|
|
249
259
|
|
|
@@ -253,9 +263,9 @@ export const rankWith = (rank: number, tester: Tester) => (
|
|
|
253
263
|
export const withIncreasedRank = (by: number, rankedTester: RankedTester) => (
|
|
254
264
|
uischema: UISchemaElement,
|
|
255
265
|
schema: JsonSchema,
|
|
256
|
-
|
|
266
|
+
context: TesterContext
|
|
257
267
|
): number => {
|
|
258
|
-
const rank = rankedTester(uischema, schema,
|
|
268
|
+
const rank = rankedTester(uischema, schema, context);
|
|
259
269
|
if (rank === NOT_APPLICABLE) {
|
|
260
270
|
return NOT_APPLICABLE;
|
|
261
271
|
}
|
|
@@ -438,17 +448,14 @@ const traverse = (
|
|
|
438
448
|
export const isObjectArrayWithNesting = (
|
|
439
449
|
uischema: UISchemaElement,
|
|
440
450
|
schema: JsonSchema,
|
|
441
|
-
|
|
451
|
+
context: TesterContext
|
|
442
452
|
): boolean => {
|
|
443
|
-
if (!uiTypeIs('Control')(uischema, schema,
|
|
453
|
+
if (!uiTypeIs('Control')(uischema, schema, context)) {
|
|
444
454
|
return false;
|
|
445
455
|
}
|
|
446
456
|
const schemaPath = (uischema as ControlElement).scope;
|
|
447
|
-
const resolvedSchema = resolveSchema(schema, schemaPath, rootSchema ?? schema);
|
|
448
|
-
|
|
449
|
-
object: 2,
|
|
450
|
-
array: 1
|
|
451
|
-
};
|
|
457
|
+
const resolvedSchema = resolveSchema(schema, schemaPath, context?.rootSchema ?? schema);
|
|
458
|
+
let objectDepth = 0;
|
|
452
459
|
if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {
|
|
453
460
|
// check if nested arrays
|
|
454
461
|
if (
|
|
@@ -459,17 +466,17 @@ export const isObjectArrayWithNesting = (
|
|
|
459
466
|
if (val.$ref !== undefined) {
|
|
460
467
|
return false;
|
|
461
468
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
469
|
+
if (hasType(val, 'object')) {
|
|
470
|
+
objectDepth++;
|
|
471
|
+
if (objectDepth === 2) {
|
|
472
|
+
return true;
|
|
473
|
+
}
|
|
465
474
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
return false;
|
|
475
|
+
if (hasType(val, 'array')) {
|
|
476
|
+
return true;
|
|
469
477
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}, rootSchema)
|
|
478
|
+
return false;
|
|
479
|
+
}, context?.rootSchema)
|
|
473
480
|
) {
|
|
474
481
|
return true;
|
|
475
482
|
}
|
|
@@ -535,7 +542,7 @@ export const isRangeControl = and(
|
|
|
535
542
|
|
|
536
543
|
/**
|
|
537
544
|
* Tests whether the given UI schema is of type Control, if the schema
|
|
538
|
-
* is of type
|
|
545
|
+
* is of type integer and has option format
|
|
539
546
|
* @type {Tester}
|
|
540
547
|
*/
|
|
541
548
|
export const isNumberFormatControl = and(
|
|
@@ -569,6 +576,6 @@ export const categorizationHasCategory = (uischema: UISchemaElement) =>
|
|
|
569
576
|
export const not = (tester: Tester): Tester => (
|
|
570
577
|
uischema: UISchemaElement,
|
|
571
578
|
schema: JsonSchema,
|
|
572
|
-
|
|
579
|
+
context: TesterContext
|
|
573
580
|
|
|
574
|
-
) => !tester(uischema, schema,
|
|
581
|
+
) => !tester(uischema, schema, context);
|
package/src/util/path.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
import isEmpty from 'lodash/isEmpty';
|
|
27
27
|
import range from 'lodash/range';
|
|
28
|
-
import { Scopable } from '../models';
|
|
28
|
+
import { isScoped, Scopable } from '../models';
|
|
29
29
|
|
|
30
30
|
export const compose = (path1: string, path2: string) => {
|
|
31
31
|
let p1 = path1;
|
|
@@ -81,13 +81,17 @@ export const toDataPath = (schemaPath: string): string => {
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
export const composeWithUi = (scopableUi: Scopable, path: string): string => {
|
|
84
|
+
if (!isScoped(scopableUi)) {
|
|
85
|
+
return path ?? '';
|
|
86
|
+
}
|
|
87
|
+
|
|
84
88
|
const segments = toDataPathSegments(scopableUi.scope);
|
|
85
89
|
|
|
86
|
-
if (isEmpty(segments)
|
|
87
|
-
return '';
|
|
90
|
+
if (isEmpty(segments)) {
|
|
91
|
+
return path ?? '';
|
|
88
92
|
}
|
|
89
93
|
|
|
90
|
-
return
|
|
94
|
+
return compose(path, segments.join('.'));
|
|
91
95
|
};
|
|
92
96
|
|
|
93
97
|
/**
|
|
@@ -99,4 +103,4 @@ export const encode = (segment: string) => segment?.replace(/~/g, '~0').replace(
|
|
|
99
103
|
/**
|
|
100
104
|
* Decodes a given JSON Pointer segment to its "normal" representation
|
|
101
105
|
*/
|
|
102
|
-
export const decode = (pointerSegment: string) => pointerSegment?.replace(/~1/g, '/').replace(/~0/, '~');
|
|
106
|
+
export const decode = (pointerSegment: string) => pointerSegment?.replace(/~1/g, '/').replace(/~0/, '~');
|
package/src/util/renderer.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import get from 'lodash/get';
|
|
27
|
-
import { ControlElement, JsonSchema, UISchemaElement } from '../models';
|
|
27
|
+
import { ControlElement, isLabelable, JsonSchema, LabelElement, UISchemaElement } from '../models';
|
|
28
28
|
import find from 'lodash/find';
|
|
29
29
|
import {
|
|
30
30
|
getUISchemas,
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
JsonFormsRendererRegistryEntry,
|
|
33
33
|
} from '../reducers';
|
|
34
34
|
import {
|
|
35
|
-
findUISchema,
|
|
36
35
|
getAjv,
|
|
37
36
|
getCells,
|
|
38
37
|
getConfig,
|
|
@@ -57,7 +56,7 @@ import { composePaths, composeWithUi } from './path';
|
|
|
57
56
|
import { CoreActions, update } from '../actions';
|
|
58
57
|
import { ErrorObject } from 'ajv';
|
|
59
58
|
import { JsonFormsState } from '../store';
|
|
60
|
-
import { getCombinedErrorMessage, getI18nKey, getI18nKeyPrefix, Translator } from '../i18n';
|
|
59
|
+
import { deriveLabelForUISchemaElement, getCombinedErrorMessage, getI18nKey, getI18nKeyPrefix, getI18nKeyPrefixBySchema, Translator } from '../i18n';
|
|
61
60
|
|
|
62
61
|
const isRequired = (
|
|
63
62
|
schema: JsonSchema,
|
|
@@ -255,6 +254,10 @@ export interface OwnPropsOfControl extends OwnPropsOfRenderer {
|
|
|
255
254
|
uischema?: ControlElement;
|
|
256
255
|
}
|
|
257
256
|
|
|
257
|
+
export interface OwnPropsOfLabel extends OwnPropsOfRenderer {
|
|
258
|
+
uischema?: LabelElement;
|
|
259
|
+
}
|
|
260
|
+
|
|
258
261
|
export interface OwnPropsOfEnum {
|
|
259
262
|
options?: EnumOption[];
|
|
260
263
|
}
|
|
@@ -398,6 +401,7 @@ export interface StatePropsOfLayout extends StatePropsOfRenderer {
|
|
|
398
401
|
* Direction for the layout to flow
|
|
399
402
|
*/
|
|
400
403
|
direction: 'row' | 'column';
|
|
404
|
+
label?: string;
|
|
401
405
|
}
|
|
402
406
|
|
|
403
407
|
export interface LayoutProps extends StatePropsOfLayout {}
|
|
@@ -857,6 +861,10 @@ export const mapStateToLayoutProps = (
|
|
|
857
861
|
config
|
|
858
862
|
);
|
|
859
863
|
|
|
864
|
+
// some layouts have labels which might need to be translated
|
|
865
|
+
const t = getTranslator()(state);
|
|
866
|
+
const label = isLabelable(uischema) ? deriveLabelForUISchemaElement(uischema, t) : undefined;
|
|
867
|
+
|
|
860
868
|
return {
|
|
861
869
|
...layoutDefaultProps,
|
|
862
870
|
renderers: ownProps.renderers || getRenderers(state),
|
|
@@ -868,7 +876,8 @@ export const mapStateToLayoutProps = (
|
|
|
868
876
|
uischema: ownProps.uischema,
|
|
869
877
|
schema: ownProps.schema,
|
|
870
878
|
direction: ownProps.direction ?? getDirection(uischema),
|
|
871
|
-
config
|
|
879
|
+
config,
|
|
880
|
+
label
|
|
872
881
|
};
|
|
873
882
|
};
|
|
874
883
|
|
|
@@ -879,6 +888,7 @@ export interface OwnPropsOfJsonFormsRenderer extends OwnPropsOfRenderer {}
|
|
|
879
888
|
export interface StatePropsOfJsonFormsRenderer
|
|
880
889
|
extends OwnPropsOfJsonFormsRenderer {
|
|
881
890
|
rootSchema: JsonSchema;
|
|
891
|
+
config: any;
|
|
882
892
|
}
|
|
883
893
|
|
|
884
894
|
export interface JsonFormsProps extends StatePropsOfJsonFormsRenderer {}
|
|
@@ -887,30 +897,15 @@ export const mapStateToJsonFormsRendererProps = (
|
|
|
887
897
|
state: JsonFormsState,
|
|
888
898
|
ownProps: OwnPropsOfJsonFormsRenderer
|
|
889
899
|
): StatePropsOfJsonFormsRenderer => {
|
|
890
|
-
let uischema = ownProps.uischema;
|
|
891
|
-
if (uischema === undefined) {
|
|
892
|
-
if (ownProps.schema) {
|
|
893
|
-
uischema = findUISchema(
|
|
894
|
-
state.jsonforms.uischemas,
|
|
895
|
-
ownProps.schema,
|
|
896
|
-
undefined,
|
|
897
|
-
ownProps.path,
|
|
898
|
-
undefined,
|
|
899
|
-
undefined,
|
|
900
|
-
state.jsonforms.core.schema
|
|
901
|
-
);
|
|
902
|
-
} else {
|
|
903
|
-
uischema = getUiSchema(state);
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
|
|
907
900
|
return {
|
|
908
|
-
renderers: ownProps.renderers || get(state.jsonforms, 'renderers')
|
|
909
|
-
cells: ownProps.cells || get(state.jsonforms, 'cells')
|
|
901
|
+
renderers: ownProps.renderers || get(state.jsonforms, 'renderers'),
|
|
902
|
+
cells: ownProps.cells || get(state.jsonforms, 'cells'),
|
|
910
903
|
schema: ownProps.schema || getSchema(state),
|
|
911
904
|
rootSchema: getSchema(state),
|
|
912
|
-
uischema: uischema,
|
|
913
|
-
path: ownProps.path
|
|
905
|
+
uischema: ownProps.uischema || getUiSchema(state),
|
|
906
|
+
path: ownProps.path,
|
|
907
|
+
enabled: ownProps.enabled,
|
|
908
|
+
config: getConfig(state)
|
|
914
909
|
};
|
|
915
910
|
};
|
|
916
911
|
|
|
@@ -1064,3 +1059,35 @@ export const mapStateToArrayLayoutProps = (
|
|
|
1064
1059
|
export interface ArrayLayoutProps
|
|
1065
1060
|
extends StatePropsOfArrayLayout,
|
|
1066
1061
|
DispatchPropsOfArrayControl {}
|
|
1062
|
+
|
|
1063
|
+
export interface StatePropsOfLabel extends StatePropsOfRenderer {
|
|
1064
|
+
text?: string;
|
|
1065
|
+
}
|
|
1066
|
+
export interface LabelProps extends StatePropsOfLabel{
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
export const mapStateToLabelProps = (
|
|
1070
|
+
state: JsonFormsState,
|
|
1071
|
+
props: OwnPropsOfLabel
|
|
1072
|
+
) => {
|
|
1073
|
+
const { uischema } = props;
|
|
1074
|
+
|
|
1075
|
+
const visible: boolean =
|
|
1076
|
+
props.visible === undefined || hasShowRule(uischema)
|
|
1077
|
+
? isVisible(props.uischema, getData(state), props.path, getAjv(state))
|
|
1078
|
+
: props.visible;
|
|
1079
|
+
|
|
1080
|
+
const text = uischema.text;
|
|
1081
|
+
const t = getTranslator()(state);
|
|
1082
|
+
const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);
|
|
1083
|
+
const i18nKey = i18nKeyPrefix ? `${i18nKeyPrefix}.text` : text ?? '';
|
|
1084
|
+
const i18nText = t(i18nKey, text, { uischema });
|
|
1085
|
+
|
|
1086
|
+
return {
|
|
1087
|
+
text: i18nText,
|
|
1088
|
+
visible,
|
|
1089
|
+
config: getConfig(state),
|
|
1090
|
+
renderers: props.renderers || getRenderers(state),
|
|
1091
|
+
cells: props.cells || getCells(state),
|
|
1092
|
+
}
|
|
1093
|
+
}
|
package/src/util/runtime.ts
CHANGED
|
@@ -27,6 +27,7 @@ import has from 'lodash/has';
|
|
|
27
27
|
import {
|
|
28
28
|
AndCondition,
|
|
29
29
|
Condition,
|
|
30
|
+
JsonSchema,
|
|
30
31
|
LeafCondition,
|
|
31
32
|
OrCondition,
|
|
32
33
|
RuleEffect,
|
|
@@ -39,7 +40,6 @@ import { composeWithUi } from './path';
|
|
|
39
40
|
import Ajv from 'ajv';
|
|
40
41
|
import { getAjv } from '../reducers';
|
|
41
42
|
import { JsonFormsState } from '../store';
|
|
42
|
-
import { JsonSchema } from '../models/jsonSchema';
|
|
43
43
|
|
|
44
44
|
const isOrCondition = (condition: Condition): condition is OrCondition =>
|
|
45
45
|
condition.type === 'OR';
|
package/src/util/util.ts
CHANGED
|
@@ -27,7 +27,7 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
27
27
|
import isArray from 'lodash/isArray';
|
|
28
28
|
import includes from 'lodash/includes';
|
|
29
29
|
import find from 'lodash/find';
|
|
30
|
-
import { JsonSchema,
|
|
30
|
+
import { JsonSchema, Scoped, UISchemaElement } from '..';
|
|
31
31
|
import { resolveData, resolveSchema } from './resolvers';
|
|
32
32
|
import { composePaths, toDataPathSegments } from './path';
|
|
33
33
|
import { isEnabled, isVisible } from './runtime';
|
|
@@ -56,8 +56,8 @@ export const hasType = (jsonSchema: JsonSchema, expected: string): boolean => {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* Derives the type of the jsonSchema element
|
|
60
|
-
*/
|
|
59
|
+
* Derives the type of the jsonSchema element
|
|
60
|
+
*/
|
|
61
61
|
export const deriveTypes = (jsonSchema: JsonSchema): string[] => {
|
|
62
62
|
if (isEmpty(jsonSchema)) {
|
|
63
63
|
return [];
|
|
@@ -93,8 +93,8 @@ export const deriveTypes = (jsonSchema: JsonSchema): string[] => {
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
|
-
* Convenience wrapper around resolveData and resolveSchema.
|
|
97
|
-
*/
|
|
96
|
+
* Convenience wrapper around resolveData and resolveSchema.
|
|
97
|
+
*/
|
|
98
98
|
export const Resolve: {
|
|
99
99
|
schema(
|
|
100
100
|
schema: JsonSchema,
|
|
@@ -108,18 +108,18 @@ export const Resolve: {
|
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
// Paths --
|
|
111
|
-
const
|
|
111
|
+
const fromScoped = (scopable: Scoped): string =>
|
|
112
112
|
toDataPathSegments(scopable.scope).join('.');
|
|
113
113
|
|
|
114
114
|
export const Paths = {
|
|
115
115
|
compose: composePaths,
|
|
116
|
-
|
|
116
|
+
fromScoped
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
// Runtime --
|
|
120
120
|
export const Runtime = {
|
|
121
121
|
isEnabled(uischema: UISchemaElement, data: any, ajv: Ajv): boolean {
|
|
122
|
-
return isEnabled(uischema, data,undefined, ajv);
|
|
122
|
+
return isEnabled(uischema, data, undefined, ajv);
|
|
123
123
|
},
|
|
124
124
|
isVisible(uischema: UISchemaElement, data: any, ajv: Ajv): boolean {
|
|
125
125
|
return isVisible(uischema, data, undefined, ajv);
|
package/stats.html
CHANGED
|
@@ -3259,7 +3259,7 @@ var drawChart = (function (exports) {
|
|
|
3259
3259
|
</script>
|
|
3260
3260
|
<script>
|
|
3261
3261
|
/*<!--*/
|
|
3262
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"jsonforms-core.esm.js","children":[{"name":"src","children":[{"name":"generators","children":[{"uid":"40e6-1","name":"schema.ts"},{"uid":"40e6-59","name":"uischema.ts"},{"uid":"40e6-61","name":"Generate.ts"}]},{"name":"models","children":[{"uid":"40e6-3","name":"draft4.ts"},{"uid":"40e6-5","name":"uischema.ts"}]},{"name":"util","children":[{"uid":"40e6-7","name":"array.ts"},{"uid":"40e6-35","name":"path.ts"},{"uid":"40e6-37","name":"resolvers.ts"},{"uid":"40e6-39","name":"runtime.ts"},{"uid":"40e6-41","name":"util.ts"},{"uid":"40e6-43","name":"label.ts"},{"uid":"40e6-45","name":"renderer.ts"},{"uid":"40e6-47","name":"cell.ts"},{"uid":"40e6-49","name":"combinators.ts"},{"uid":"40e6-51","name":"ids.ts"},{"uid":"40e6-53","name":"schema.ts"},{"uid":"40e6-55","name":"uischema.ts"},{"uid":"40e6-57","name":"validator.ts"}]},{"name":"reducers","children":[{"uid":"40e6-9","name":"cells.ts"},{"uid":"40e6-13","name":"config.ts"},{"uid":"40e6-15","name":"core.ts"},{"uid":"40e6-17","name":"default-data.ts"},{"uid":"40e6-21","name":"i18n.ts"},{"uid":"40e6-23","name":"renderers.ts"},{"uid":"40e6-29","name":"uischemas.ts"},{"uid":"40e6-31","name":"reducers.ts"},{"uid":"40e6-33","name":"selectors.ts"}]},{"uid":"40e6-11","name":"configDefault.ts"},{"name":"i18n/i18nUtil.ts","uid":"40e6-19"},{"name":"testers","children":[{"uid":"40e6-25","name":"testers.ts"},{"uid":"40e6-27","name":"index.ts"}]},{"name":"actions","children":[{"uid":"40e6-63","name":"actions.ts"},{"uid":"40e6-65","name":"index.ts"}]},{"uid":"40e6-67","name":"Helpers.ts"},{"uid":"40e6-69","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"40e6-1":{"renderedLength":3843,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-0"},"40e6-3":{"renderedLength":4050,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-2"},"40e6-5":{"renderedLength":336,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-4"},"40e6-7":{"renderedLength":421,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-6"},"40e6-9":{"renderedLength":294,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-8"},"40e6-11":{"renderedLength":133,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-10"},"40e6-13":{"renderedLength":322,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-12"},"40e6-15":{"renderedLength":10156,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-14"},"40e6-17":{"renderedLength":434,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-16"},"40e6-19":{"renderedLength":2025,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-18"},"40e6-21":{"renderedLength":1754,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-20"},"40e6-23":{"renderedLength":370,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-22"},"40e6-25":{"renderedLength":8507,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-24"},"40e6-27":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-26"},"40e6-29":{"renderedLength":783,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-28"},"40e6-31":{"renderedLength":1846,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-30"},"40e6-33":{"renderedLength":573,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-32"},"40e6-35":{"renderedLength":1308,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-34"},"40e6-37":{"renderedLength":3040,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-36"},"40e6-39":{"renderedLength":3621,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-38"},"40e6-41":{"renderedLength":1502,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-40"},"40e6-43":{"renderedLength":1289,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-42"},"40e6-45":{"renderedLength":13284,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-44"},"40e6-47":{"renderedLength":2622,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-46"},"40e6-49":{"renderedLength":671,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-48"},"40e6-51":{"renderedLength":621,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-50"},"40e6-53":{"renderedLength":365,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-52"},"40e6-55":{"renderedLength":609,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-54"},"40e6-57":{"renderedLength":196,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-56"},"40e6-59":{"renderedLength":3310,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-58"},"40e6-61":{"renderedLength":137,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-60"},"40e6-63":{"renderedLength":3051,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-62"},"40e6-65":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-64"},"40e6-67":{"renderedLength":80,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-66"},"40e6-69":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"40e6-68"}},"nodeMetas":{"40e6-0":{"id":"/src/generators/schema.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-1"},"imported":[],"importedBy":[{"uid":"40e6-70"},{"uid":"40e6-60"}]},"40e6-2":{"id":"/src/models/draft4.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-3"},"imported":[],"importedBy":[{"uid":"40e6-71"}]},"40e6-4":{"id":"/src/models/uischema.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-5"},"imported":[],"importedBy":[{"uid":"40e6-71"}]},"40e6-6":{"id":"/src/util/array.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-7"},"imported":[],"importedBy":[{"uid":"40e6-73"},{"uid":"40e6-44"}]},"40e6-8":{"id":"/src/reducers/cells.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-9"},"imported":[{"uid":"40e6-64"}],"importedBy":[{"uid":"40e6-72"},{"uid":"40e6-30"}]},"40e6-10":{"id":"/src/configDefault.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-11"},"imported":[],"importedBy":[{"uid":"40e6-12"}]},"40e6-12":{"id":"/src/reducers/config.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-13"},"imported":[{"uid":"40e6-85"},{"uid":"40e6-64"},{"uid":"40e6-10"}],"importedBy":[{"uid":"40e6-72"},{"uid":"40e6-30"}]},"40e6-14":{"id":"/src/reducers/core.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-15"},"imported":[{"uid":"40e6-86"},{"uid":"40e6-87"},{"uid":"40e6-88"},{"uid":"40e6-89"},{"uid":"40e6-90"},{"uid":"40e6-91"},{"uid":"40e6-64"},{"uid":"40e6-73"}],"importedBy":[{"uid":"40e6-72"},{"uid":"40e6-30"},{"uid":"40e6-32"}]},"40e6-16":{"id":"/src/reducers/default-data.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-17"},"imported":[{"uid":"40e6-64"}],"importedBy":[{"uid":"40e6-72"},{"uid":"40e6-30"},{"uid":"40e6-32"}]},"40e6-18":{"id":"/src/i18n/i18nUtil.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-19"},"imported":[{"uid":"40e6-72"},{"uid":"40e6-73"}],"importedBy":[{"uid":"40e6-75"}]},"40e6-20":{"id":"/src/reducers/i18n.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-21"},"imported":[{"uid":"40e6-75"},{"uid":"40e6-64"}],"importedBy":[{"uid":"40e6-72"},{"uid":"40e6-30"}]},"40e6-22":{"id":"/src/reducers/renderers.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-23"},"imported":[{"uid":"40e6-64"}],"importedBy":[{"uid":"40e6-72"},{"uid":"40e6-30"}]},"40e6-24":{"id":"/src/testers/testers.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-25"},"imported":[{"uid":"40e6-82"},{"uid":"40e6-88"},{"uid":"40e6-94"},{"uid":"40e6-95"},{"uid":"40e6-96"},{"uid":"40e6-97"},{"uid":"40e6-98"},{"uid":"40e6-99"},{"uid":"40e6-73"}],"importedBy":[{"uid":"40e6-26"}]},"40e6-26":{"id":"/src/testers/index.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-27"},"imported":[{"uid":"40e6-24"}],"importedBy":[{"uid":"40e6-68"},{"uid":"40e6-28"}]},"40e6-28":{"id":"/src/reducers/uischemas.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-29"},"imported":[{"uid":"40e6-92"},{"uid":"40e6-93"},{"uid":"40e6-64"},{"uid":"40e6-26"}],"importedBy":[{"uid":"40e6-72"},{"uid":"40e6-30"}]},"40e6-30":{"id":"/src/reducers/reducers.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-31"},"imported":[{"uid":"40e6-14"},{"uid":"40e6-16"},{"uid":"40e6-22"},{"uid":"40e6-28"},{"uid":"40e6-20"},{"uid":"40e6-70"},{"uid":"40e6-8"},{"uid":"40e6-12"},{"uid":"40e6-88"},{"uid":"40e6-72"}],"importedBy":[{"uid":"40e6-72"}]},"40e6-32":{"id":"/src/reducers/selectors.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-33"},"imported":[{"uid":"40e6-88"},{"uid":"40e6-14"},{"uid":"40e6-16"}],"importedBy":[{"uid":"40e6-72"}]},"40e6-34":{"id":"/src/util/path.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-35"},"imported":[{"uid":"40e6-82"},{"uid":"40e6-101"}],"importedBy":[{"uid":"40e6-73"},{"uid":"40e6-42"},{"uid":"40e6-44"},{"uid":"40e6-36"},{"uid":"40e6-38"},{"uid":"40e6-40"}]},"40e6-36":{"id":"/src/util/resolvers.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-37"},"imported":[{"uid":"40e6-82"},{"uid":"40e6-88"},{"uid":"40e6-34"}],"importedBy":[{"uid":"40e6-73"},{"uid":"40e6-38"},{"uid":"40e6-40"}]},"40e6-38":{"id":"/src/util/runtime.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-39"},"imported":[{"uid":"40e6-103"},{"uid":"40e6-71"},{"uid":"40e6-36"},{"uid":"40e6-34"},{"uid":"40e6-72"}],"importedBy":[{"uid":"40e6-73"},{"uid":"40e6-46"},{"uid":"40e6-44"},{"uid":"40e6-40"}]},"40e6-40":{"id":"/src/util/util.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-41"},"imported":[{"uid":"40e6-82"},{"uid":"40e6-96"},{"uid":"40e6-99"},{"uid":"40e6-102"},{"uid":"40e6-36"},{"uid":"40e6-34"},{"uid":"40e6-38"}],"importedBy":[{"uid":"40e6-73"},{"uid":"40e6-46"},{"uid":"40e6-48"},{"uid":"40e6-44"}]},"40e6-42":{"id":"/src/util/label.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-43"},"imported":[{"uid":"40e6-83"},{"uid":"40e6-34"}],"importedBy":[{"uid":"40e6-73"},{"uid":"40e6-44"}]},"40e6-44":{"id":"/src/util/renderer.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-45"},"imported":[{"uid":"40e6-88"},{"uid":"40e6-102"},{"uid":"40e6-72"},{"uid":"40e6-38"},{"uid":"40e6-42"},{"uid":"40e6-6"},{"uid":"40e6-40"},{"uid":"40e6-34"},{"uid":"40e6-64"},{"uid":"40e6-75"}],"importedBy":[{"uid":"40e6-73"},{"uid":"40e6-46"}]},"40e6-46":{"id":"/src/util/cell.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-47"},"imported":[{"uid":"40e6-82"},{"uid":"40e6-100"},{"uid":"40e6-72"},{"uid":"40e6-40"},{"uid":"40e6-38"},{"uid":"40e6-44"},{"uid":"40e6-75"}],"importedBy":[{"uid":"40e6-73"}]},"40e6-48":{"id":"/src/util/combinators.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-49"},"imported":[{"uid":"40e6-72"},{"uid":"40e6-40"}],"importedBy":[{"uid":"40e6-73"}]},"40e6-50":{"id":"/src/util/ids.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-51"},"imported":[],"importedBy":[{"uid":"40e6-73"}]},"40e6-52":{"id":"/src/util/schema.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-53"},"imported":[{"uid":"40e6-102"}],"importedBy":[{"uid":"40e6-73"}]},"40e6-54":{"id":"/src/util/uischema.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-55"},"imported":[{"uid":"40e6-82"},{"uid":"40e6-71"}],"importedBy":[{"uid":"40e6-73"}]},"40e6-56":{"id":"/src/util/validator.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-57"},"imported":[{"uid":"40e6-104"},{"uid":"40e6-105"}],"importedBy":[{"uid":"40e6-73"}]},"40e6-58":{"id":"/src/generators/uischema.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-59"},"imported":[{"uid":"40e6-82"},{"uid":"40e6-83"},{"uid":"40e6-84"},{"uid":"40e6-71"},{"uid":"40e6-73"}],"importedBy":[{"uid":"40e6-70"},{"uid":"40e6-60"}]},"40e6-60":{"id":"/src/generators/Generate.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-61"},"imported":[{"uid":"40e6-0"},{"uid":"40e6-58"}],"importedBy":[{"uid":"40e6-70"}]},"40e6-62":{"id":"/src/actions/actions.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-63"},"imported":[{"uid":"40e6-70"}],"importedBy":[{"uid":"40e6-64"}]},"40e6-64":{"id":"/src/actions/index.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-65"},"imported":[{"uid":"40e6-62"}],"importedBy":[{"uid":"40e6-68"},{"uid":"40e6-8"},{"uid":"40e6-12"},{"uid":"40e6-14"},{"uid":"40e6-16"},{"uid":"40e6-20"},{"uid":"40e6-22"},{"uid":"40e6-28"},{"uid":"40e6-44"}]},"40e6-66":{"id":"/src/Helpers.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-67"},"imported":[{"uid":"40e6-73"}],"importedBy":[{"uid":"40e6-68"}]},"40e6-68":{"id":"/src/index.ts","moduleParts":{"jsonforms-core.esm.js":"40e6-69"},"imported":[{"uid":"40e6-64"},{"uid":"40e6-70"},{"uid":"40e6-71"},{"uid":"40e6-72"},{"uid":"40e6-26"},{"uid":"40e6-73"},{"uid":"40e6-66"},{"uid":"40e6-74"},{"uid":"40e6-75"}],"importedBy":[],"isEntry":true},"40e6-70":{"id":"/src/generators/index.ts","moduleParts":{},"imported":[{"uid":"40e6-60"},{"uid":"40e6-0"},{"uid":"40e6-58"}],"importedBy":[{"uid":"40e6-68"},{"uid":"40e6-62"},{"uid":"40e6-30"}]},"40e6-71":{"id":"/src/models/index.ts","moduleParts":{},"imported":[{"uid":"40e6-2"},{"uid":"40e6-76"},{"uid":"40e6-77"},{"uid":"40e6-78"},{"uid":"40e6-4"}],"importedBy":[{"uid":"40e6-68"},{"uid":"40e6-58"},{"uid":"40e6-38"},{"uid":"40e6-54"}]},"40e6-72":{"id":"/src/reducers/index.ts","moduleParts":{},"imported":[{"uid":"40e6-8"},{"uid":"40e6-12"},{"uid":"40e6-14"},{"uid":"40e6-16"},{"uid":"40e6-20"},{"uid":"40e6-30"},{"uid":"40e6-22"},{"uid":"40e6-32"},{"uid":"40e6-28"}],"importedBy":[{"uid":"40e6-68"},{"uid":"40e6-30"},{"uid":"40e6-46"},{"uid":"40e6-48"},{"uid":"40e6-44"},{"uid":"40e6-38"},{"uid":"40e6-18"}]},"40e6-73":{"id":"/src/util/index.ts","moduleParts":{},"imported":[{"uid":"40e6-6"},{"uid":"40e6-46"},{"uid":"40e6-48"},{"uid":"40e6-79"},{"uid":"40e6-50"},{"uid":"40e6-42"},{"uid":"40e6-34"},{"uid":"40e6-44"},{"uid":"40e6-36"},{"uid":"40e6-38"},{"uid":"40e6-52"},{"uid":"40e6-80"},{"uid":"40e6-54"},{"uid":"40e6-40"},{"uid":"40e6-56"}],"importedBy":[{"uid":"40e6-68"},{"uid":"40e6-66"},{"uid":"40e6-58"},{"uid":"40e6-14"},{"uid":"40e6-24"},{"uid":"40e6-18"}]},"40e6-74":{"id":"/src/store.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-68"}]},"40e6-75":{"id":"/src/i18n/index.ts","moduleParts":{},"imported":[{"uid":"40e6-81"},{"uid":"40e6-18"}],"importedBy":[{"uid":"40e6-68"},{"uid":"40e6-20"},{"uid":"40e6-46"},{"uid":"40e6-44"}]},"40e6-76":{"id":"/src/models/jsonSchema.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-71"}]},"40e6-77":{"id":"/src/models/jsonSchema4.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-71"}]},"40e6-78":{"id":"/src/models/jsonSchema7.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-71"}]},"40e6-79":{"id":"/src/util/Formatted.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-73"}]},"40e6-80":{"id":"/src/util/type.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-73"}]},"40e6-81":{"id":"/src/i18n/i18nTypes.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-75"}]},"40e6-82":{"id":"lodash/isEmpty","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-58"},{"uid":"40e6-24"},{"uid":"40e6-46"},{"uid":"40e6-34"},{"uid":"40e6-36"},{"uid":"40e6-54"},{"uid":"40e6-40"}],"isExternal":true},"40e6-83":{"id":"lodash/startCase","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-58"},{"uid":"40e6-42"}],"isExternal":true},"40e6-84":{"id":"lodash/keys","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-58"}],"isExternal":true},"40e6-85":{"id":"lodash/merge","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-12"}],"isExternal":true},"40e6-86":{"id":"lodash/cloneDeep","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-14"}],"isExternal":true},"40e6-87":{"id":"lodash/fp/set","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-14"}],"isExternal":true},"40e6-88":{"id":"lodash/get","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-14"},{"uid":"40e6-30"},{"uid":"40e6-32"},{"uid":"40e6-24"},{"uid":"40e6-44"},{"uid":"40e6-36"}],"isExternal":true},"40e6-89":{"id":"lodash/filter","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-14"}],"isExternal":true},"40e6-90":{"id":"lodash/isEqual","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-14"}],"isExternal":true},"40e6-91":{"id":"lodash/isFunction","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-14"}],"isExternal":true},"40e6-92":{"id":"lodash/maxBy","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-28"}],"isExternal":true},"40e6-93":{"id":"lodash/remove","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-28"}],"isExternal":true},"40e6-94":{"id":"lodash/endsWith","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-24"}],"isExternal":true},"40e6-95":{"id":"lodash/last","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-24"}],"isExternal":true},"40e6-96":{"id":"lodash/isArray","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-24"},{"uid":"40e6-40"}],"isExternal":true},"40e6-97":{"id":"lodash/reduce","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-24"}],"isExternal":true},"40e6-98":{"id":"lodash/toPairs","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-24"}],"isExternal":true},"40e6-99":{"id":"lodash/includes","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-24"},{"uid":"40e6-40"}],"isExternal":true},"40e6-100":{"id":"lodash/union","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-46"}],"isExternal":true},"40e6-101":{"id":"lodash/range","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-34"}],"isExternal":true},"40e6-102":{"id":"lodash/find","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-44"},{"uid":"40e6-52"},{"uid":"40e6-40"}],"isExternal":true},"40e6-103":{"id":"lodash/has","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-38"}],"isExternal":true},"40e6-104":{"id":"ajv","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-56"}],"isExternal":true},"40e6-105":{"id":"ajv-formats","moduleParts":{},"imported":[],"importedBy":[{"uid":"40e6-56"}],"isExternal":true}},"env":{"rollup":"2.61.1"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
3262
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"jsonforms-core.esm.js","children":[{"name":"src","children":[{"name":"generators","children":[{"uid":"79f9-1","name":"schema.ts"},{"uid":"79f9-59","name":"uischema.ts"},{"uid":"79f9-61","name":"Generate.ts"}]},{"name":"models","children":[{"uid":"79f9-3","name":"draft4.ts"},{"uid":"79f9-5","name":"uischema.ts"}]},{"name":"util","children":[{"uid":"79f9-7","name":"array.ts"},{"uid":"79f9-35","name":"path.ts"},{"uid":"79f9-37","name":"resolvers.ts"},{"uid":"79f9-39","name":"runtime.ts"},{"uid":"79f9-41","name":"util.ts"},{"uid":"79f9-43","name":"label.ts"},{"uid":"79f9-45","name":"renderer.ts"},{"uid":"79f9-47","name":"cell.ts"},{"uid":"79f9-49","name":"combinators.ts"},{"uid":"79f9-51","name":"ids.ts"},{"uid":"79f9-53","name":"schema.ts"},{"uid":"79f9-55","name":"uischema.ts"},{"uid":"79f9-57","name":"validator.ts"}]},{"name":"reducers","children":[{"uid":"79f9-9","name":"cells.ts"},{"uid":"79f9-13","name":"config.ts"},{"uid":"79f9-15","name":"core.ts"},{"uid":"79f9-17","name":"default-data.ts"},{"uid":"79f9-21","name":"i18n.ts"},{"uid":"79f9-23","name":"renderers.ts"},{"uid":"79f9-29","name":"uischemas.ts"},{"uid":"79f9-31","name":"reducers.ts"},{"uid":"79f9-33","name":"selectors.ts"}]},{"uid":"79f9-11","name":"configDefault.ts"},{"name":"i18n/i18nUtil.ts","uid":"79f9-19"},{"name":"testers","children":[{"uid":"79f9-25","name":"testers.ts"},{"uid":"79f9-27","name":"index.ts"}]},{"name":"actions","children":[{"uid":"79f9-63","name":"actions.ts"},{"uid":"79f9-65","name":"index.ts"}]},{"uid":"79f9-67","name":"Helpers.ts"},{"uid":"79f9-69","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"79f9-1":{"renderedLength":3843,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-0"},"79f9-3":{"renderedLength":4050,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-2"},"79f9-5":{"renderedLength":756,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-4"},"79f9-7":{"renderedLength":421,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-6"},"79f9-9":{"renderedLength":294,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-8"},"79f9-11":{"renderedLength":133,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-10"},"79f9-13":{"renderedLength":322,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-12"},"79f9-15":{"renderedLength":10156,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-14"},"79f9-17":{"renderedLength":434,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-16"},"79f9-19":{"renderedLength":2719,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-18"},"79f9-21":{"renderedLength":1754,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-20"},"79f9-23":{"renderedLength":370,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-22"},"79f9-25":{"renderedLength":8403,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-24"},"79f9-27":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-26"},"79f9-29":{"renderedLength":783,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-28"},"79f9-31":{"renderedLength":1846,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-30"},"79f9-33":{"renderedLength":573,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-32"},"79f9-35":{"renderedLength":1333,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-34"},"79f9-37":{"renderedLength":3040,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-36"},"79f9-39":{"renderedLength":3621,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-38"},"79f9-41":{"renderedLength":1498,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-40"},"79f9-43":{"renderedLength":1289,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-42"},"79f9-45":{"renderedLength":13910,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-44"},"79f9-47":{"renderedLength":2622,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-46"},"79f9-49":{"renderedLength":671,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-48"},"79f9-51":{"renderedLength":621,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-50"},"79f9-53":{"renderedLength":365,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-52"},"79f9-55":{"renderedLength":609,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-54"},"79f9-57":{"renderedLength":196,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-56"},"79f9-59":{"renderedLength":3310,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-58"},"79f9-61":{"renderedLength":137,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-60"},"79f9-63":{"renderedLength":3051,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-62"},"79f9-65":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-64"},"79f9-67":{"renderedLength":80,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-66"},"79f9-69":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"79f9-68"}},"nodeMetas":{"79f9-0":{"id":"/src/generators/schema.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-1"},"imported":[],"importedBy":[{"uid":"79f9-70"},{"uid":"79f9-60"}]},"79f9-2":{"id":"/src/models/draft4.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-3"},"imported":[],"importedBy":[{"uid":"79f9-71"}]},"79f9-4":{"id":"/src/models/uischema.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-5"},"imported":[],"importedBy":[{"uid":"79f9-71"}]},"79f9-6":{"id":"/src/util/array.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-7"},"imported":[],"importedBy":[{"uid":"79f9-73"},{"uid":"79f9-44"}]},"79f9-8":{"id":"/src/reducers/cells.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-9"},"imported":[{"uid":"79f9-64"}],"importedBy":[{"uid":"79f9-72"},{"uid":"79f9-30"}]},"79f9-10":{"id":"/src/configDefault.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-11"},"imported":[],"importedBy":[{"uid":"79f9-12"}]},"79f9-12":{"id":"/src/reducers/config.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-13"},"imported":[{"uid":"79f9-85"},{"uid":"79f9-64"},{"uid":"79f9-10"}],"importedBy":[{"uid":"79f9-72"},{"uid":"79f9-30"}]},"79f9-14":{"id":"/src/reducers/core.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-15"},"imported":[{"uid":"79f9-86"},{"uid":"79f9-87"},{"uid":"79f9-88"},{"uid":"79f9-89"},{"uid":"79f9-90"},{"uid":"79f9-91"},{"uid":"79f9-64"},{"uid":"79f9-73"}],"importedBy":[{"uid":"79f9-72"},{"uid":"79f9-30"},{"uid":"79f9-32"}]},"79f9-16":{"id":"/src/reducers/default-data.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-17"},"imported":[{"uid":"79f9-64"}],"importedBy":[{"uid":"79f9-72"},{"uid":"79f9-30"},{"uid":"79f9-32"}]},"79f9-18":{"id":"/src/i18n/i18nUtil.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-19"},"imported":[{"uid":"79f9-71"},{"uid":"79f9-72"},{"uid":"79f9-73"}],"importedBy":[{"uid":"79f9-75"}]},"79f9-20":{"id":"/src/reducers/i18n.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-21"},"imported":[{"uid":"79f9-75"},{"uid":"79f9-64"}],"importedBy":[{"uid":"79f9-72"},{"uid":"79f9-30"}]},"79f9-22":{"id":"/src/reducers/renderers.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-23"},"imported":[{"uid":"79f9-64"}],"importedBy":[{"uid":"79f9-72"},{"uid":"79f9-30"}]},"79f9-24":{"id":"/src/testers/testers.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-25"},"imported":[{"uid":"79f9-82"},{"uid":"79f9-88"},{"uid":"79f9-94"},{"uid":"79f9-95"},{"uid":"79f9-96"},{"uid":"79f9-97"},{"uid":"79f9-98"},{"uid":"79f9-99"},{"uid":"79f9-73"}],"importedBy":[{"uid":"79f9-26"}]},"79f9-26":{"id":"/src/testers/index.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-27"},"imported":[{"uid":"79f9-24"}],"importedBy":[{"uid":"79f9-68"},{"uid":"79f9-28"}]},"79f9-28":{"id":"/src/reducers/uischemas.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-29"},"imported":[{"uid":"79f9-92"},{"uid":"79f9-93"},{"uid":"79f9-64"},{"uid":"79f9-26"}],"importedBy":[{"uid":"79f9-72"},{"uid":"79f9-30"}]},"79f9-30":{"id":"/src/reducers/reducers.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-31"},"imported":[{"uid":"79f9-14"},{"uid":"79f9-16"},{"uid":"79f9-22"},{"uid":"79f9-28"},{"uid":"79f9-20"},{"uid":"79f9-70"},{"uid":"79f9-8"},{"uid":"79f9-12"},{"uid":"79f9-88"},{"uid":"79f9-72"}],"importedBy":[{"uid":"79f9-72"}]},"79f9-32":{"id":"/src/reducers/selectors.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-33"},"imported":[{"uid":"79f9-88"},{"uid":"79f9-14"},{"uid":"79f9-16"}],"importedBy":[{"uid":"79f9-72"}]},"79f9-34":{"id":"/src/util/path.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-35"},"imported":[{"uid":"79f9-82"},{"uid":"79f9-101"},{"uid":"79f9-71"}],"importedBy":[{"uid":"79f9-73"},{"uid":"79f9-42"},{"uid":"79f9-44"},{"uid":"79f9-36"},{"uid":"79f9-38"},{"uid":"79f9-40"}]},"79f9-36":{"id":"/src/util/resolvers.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-37"},"imported":[{"uid":"79f9-82"},{"uid":"79f9-88"},{"uid":"79f9-34"}],"importedBy":[{"uid":"79f9-73"},{"uid":"79f9-38"},{"uid":"79f9-40"}]},"79f9-38":{"id":"/src/util/runtime.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-39"},"imported":[{"uid":"79f9-103"},{"uid":"79f9-71"},{"uid":"79f9-36"},{"uid":"79f9-34"},{"uid":"79f9-72"}],"importedBy":[{"uid":"79f9-73"},{"uid":"79f9-46"},{"uid":"79f9-44"},{"uid":"79f9-40"}]},"79f9-40":{"id":"/src/util/util.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-41"},"imported":[{"uid":"79f9-82"},{"uid":"79f9-96"},{"uid":"79f9-99"},{"uid":"79f9-102"},{"uid":"79f9-36"},{"uid":"79f9-34"},{"uid":"79f9-38"}],"importedBy":[{"uid":"79f9-73"},{"uid":"79f9-46"},{"uid":"79f9-48"},{"uid":"79f9-44"}]},"79f9-42":{"id":"/src/util/label.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-43"},"imported":[{"uid":"79f9-83"},{"uid":"79f9-34"}],"importedBy":[{"uid":"79f9-73"},{"uid":"79f9-44"}]},"79f9-44":{"id":"/src/util/renderer.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-45"},"imported":[{"uid":"79f9-88"},{"uid":"79f9-71"},{"uid":"79f9-102"},{"uid":"79f9-72"},{"uid":"79f9-38"},{"uid":"79f9-42"},{"uid":"79f9-6"},{"uid":"79f9-40"},{"uid":"79f9-34"},{"uid":"79f9-64"},{"uid":"79f9-75"}],"importedBy":[{"uid":"79f9-73"},{"uid":"79f9-46"}]},"79f9-46":{"id":"/src/util/cell.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-47"},"imported":[{"uid":"79f9-82"},{"uid":"79f9-100"},{"uid":"79f9-72"},{"uid":"79f9-40"},{"uid":"79f9-38"},{"uid":"79f9-44"},{"uid":"79f9-75"}],"importedBy":[{"uid":"79f9-73"}]},"79f9-48":{"id":"/src/util/combinators.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-49"},"imported":[{"uid":"79f9-72"},{"uid":"79f9-40"}],"importedBy":[{"uid":"79f9-73"}]},"79f9-50":{"id":"/src/util/ids.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-51"},"imported":[],"importedBy":[{"uid":"79f9-73"}]},"79f9-52":{"id":"/src/util/schema.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-53"},"imported":[{"uid":"79f9-102"}],"importedBy":[{"uid":"79f9-73"}]},"79f9-54":{"id":"/src/util/uischema.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-55"},"imported":[{"uid":"79f9-82"},{"uid":"79f9-71"}],"importedBy":[{"uid":"79f9-73"}]},"79f9-56":{"id":"/src/util/validator.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-57"},"imported":[{"uid":"79f9-104"},{"uid":"79f9-105"}],"importedBy":[{"uid":"79f9-73"}]},"79f9-58":{"id":"/src/generators/uischema.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-59"},"imported":[{"uid":"79f9-82"},{"uid":"79f9-83"},{"uid":"79f9-84"},{"uid":"79f9-71"},{"uid":"79f9-73"}],"importedBy":[{"uid":"79f9-70"},{"uid":"79f9-60"}]},"79f9-60":{"id":"/src/generators/Generate.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-61"},"imported":[{"uid":"79f9-0"},{"uid":"79f9-58"}],"importedBy":[{"uid":"79f9-70"}]},"79f9-62":{"id":"/src/actions/actions.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-63"},"imported":[{"uid":"79f9-70"}],"importedBy":[{"uid":"79f9-64"}]},"79f9-64":{"id":"/src/actions/index.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-65"},"imported":[{"uid":"79f9-62"}],"importedBy":[{"uid":"79f9-68"},{"uid":"79f9-8"},{"uid":"79f9-12"},{"uid":"79f9-14"},{"uid":"79f9-16"},{"uid":"79f9-20"},{"uid":"79f9-22"},{"uid":"79f9-28"},{"uid":"79f9-44"}]},"79f9-66":{"id":"/src/Helpers.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-67"},"imported":[{"uid":"79f9-73"}],"importedBy":[{"uid":"79f9-68"}]},"79f9-68":{"id":"/src/index.ts","moduleParts":{"jsonforms-core.esm.js":"79f9-69"},"imported":[{"uid":"79f9-64"},{"uid":"79f9-70"},{"uid":"79f9-71"},{"uid":"79f9-72"},{"uid":"79f9-26"},{"uid":"79f9-73"},{"uid":"79f9-66"},{"uid":"79f9-74"},{"uid":"79f9-75"}],"importedBy":[],"isEntry":true},"79f9-70":{"id":"/src/generators/index.ts","moduleParts":{},"imported":[{"uid":"79f9-60"},{"uid":"79f9-0"},{"uid":"79f9-58"}],"importedBy":[{"uid":"79f9-68"},{"uid":"79f9-62"},{"uid":"79f9-30"}]},"79f9-71":{"id":"/src/models/index.ts","moduleParts":{},"imported":[{"uid":"79f9-2"},{"uid":"79f9-76"},{"uid":"79f9-77"},{"uid":"79f9-78"},{"uid":"79f9-4"}],"importedBy":[{"uid":"79f9-68"},{"uid":"79f9-58"},{"uid":"79f9-34"},{"uid":"79f9-44"},{"uid":"79f9-38"},{"uid":"79f9-54"},{"uid":"79f9-18"}]},"79f9-72":{"id":"/src/reducers/index.ts","moduleParts":{},"imported":[{"uid":"79f9-8"},{"uid":"79f9-12"},{"uid":"79f9-14"},{"uid":"79f9-16"},{"uid":"79f9-20"},{"uid":"79f9-30"},{"uid":"79f9-22"},{"uid":"79f9-32"},{"uid":"79f9-28"}],"importedBy":[{"uid":"79f9-68"},{"uid":"79f9-30"},{"uid":"79f9-46"},{"uid":"79f9-48"},{"uid":"79f9-44"},{"uid":"79f9-38"},{"uid":"79f9-18"}]},"79f9-73":{"id":"/src/util/index.ts","moduleParts":{},"imported":[{"uid":"79f9-6"},{"uid":"79f9-46"},{"uid":"79f9-48"},{"uid":"79f9-79"},{"uid":"79f9-50"},{"uid":"79f9-42"},{"uid":"79f9-34"},{"uid":"79f9-44"},{"uid":"79f9-36"},{"uid":"79f9-38"},{"uid":"79f9-52"},{"uid":"79f9-80"},{"uid":"79f9-54"},{"uid":"79f9-40"},{"uid":"79f9-56"}],"importedBy":[{"uid":"79f9-68"},{"uid":"79f9-66"},{"uid":"79f9-58"},{"uid":"79f9-14"},{"uid":"79f9-24"},{"uid":"79f9-18"}]},"79f9-74":{"id":"/src/store.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-68"}]},"79f9-75":{"id":"/src/i18n/index.ts","moduleParts":{},"imported":[{"uid":"79f9-81"},{"uid":"79f9-18"}],"importedBy":[{"uid":"79f9-68"},{"uid":"79f9-20"},{"uid":"79f9-46"},{"uid":"79f9-44"}]},"79f9-76":{"id":"/src/models/jsonSchema.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-71"}]},"79f9-77":{"id":"/src/models/jsonSchema4.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-71"}]},"79f9-78":{"id":"/src/models/jsonSchema7.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-71"}]},"79f9-79":{"id":"/src/util/Formatted.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-73"}]},"79f9-80":{"id":"/src/util/type.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-73"}]},"79f9-81":{"id":"/src/i18n/i18nTypes.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-75"}]},"79f9-82":{"id":"lodash/isEmpty","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-58"},{"uid":"79f9-24"},{"uid":"79f9-46"},{"uid":"79f9-34"},{"uid":"79f9-36"},{"uid":"79f9-54"},{"uid":"79f9-40"}],"isExternal":true},"79f9-83":{"id":"lodash/startCase","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-58"},{"uid":"79f9-42"}],"isExternal":true},"79f9-84":{"id":"lodash/keys","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-58"}],"isExternal":true},"79f9-85":{"id":"lodash/merge","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-12"}],"isExternal":true},"79f9-86":{"id":"lodash/cloneDeep","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-14"}],"isExternal":true},"79f9-87":{"id":"lodash/fp/set","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-14"}],"isExternal":true},"79f9-88":{"id":"lodash/get","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-14"},{"uid":"79f9-30"},{"uid":"79f9-32"},{"uid":"79f9-24"},{"uid":"79f9-44"},{"uid":"79f9-36"}],"isExternal":true},"79f9-89":{"id":"lodash/filter","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-14"}],"isExternal":true},"79f9-90":{"id":"lodash/isEqual","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-14"}],"isExternal":true},"79f9-91":{"id":"lodash/isFunction","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-14"}],"isExternal":true},"79f9-92":{"id":"lodash/maxBy","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-28"}],"isExternal":true},"79f9-93":{"id":"lodash/remove","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-28"}],"isExternal":true},"79f9-94":{"id":"lodash/endsWith","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-24"}],"isExternal":true},"79f9-95":{"id":"lodash/last","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-24"}],"isExternal":true},"79f9-96":{"id":"lodash/isArray","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-24"},{"uid":"79f9-40"}],"isExternal":true},"79f9-97":{"id":"lodash/reduce","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-24"}],"isExternal":true},"79f9-98":{"id":"lodash/toPairs","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-24"}],"isExternal":true},"79f9-99":{"id":"lodash/includes","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-24"},{"uid":"79f9-40"}],"isExternal":true},"79f9-100":{"id":"lodash/union","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-46"}],"isExternal":true},"79f9-101":{"id":"lodash/range","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-34"}],"isExternal":true},"79f9-102":{"id":"lodash/find","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-44"},{"uid":"79f9-52"},{"uid":"79f9-40"}],"isExternal":true},"79f9-103":{"id":"lodash/has","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-38"}],"isExternal":true},"79f9-104":{"id":"ajv","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-56"}],"isExternal":true},"79f9-105":{"id":"ajv-formats","moduleParts":{},"imported":[],"importedBy":[{"uid":"79f9-56"}],"isExternal":true}},"env":{"rollup":"2.61.1"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
3263
3263
|
|
|
3264
3264
|
const run = () => {
|
|
3265
3265
|
const width = window.innerWidth;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import test from 'ava';
|
|
26
26
|
|
|
27
|
-
import { transformPathToI18nPrefix } from '../../src';
|
|
27
|
+
import { ControlElement, getI18nKeyPrefixBySchema, i18nJsonSchema, transformPathToI18nPrefix } from '../../src';
|
|
28
28
|
|
|
29
29
|
test('transformPathToI18nPrefix returns root when empty', t => {
|
|
30
30
|
t.is(transformPathToI18nPrefix(''), 'root');
|
|
@@ -46,3 +46,43 @@ test('transformPathToI18nPrefix removes array indices', t => {
|
|
|
46
46
|
t.is(transformPathToI18nPrefix('foo1.23.b2ar3.1.5.foo'), 'foo1.b2ar3.foo');
|
|
47
47
|
t.is(transformPathToI18nPrefix('3'), 'root');
|
|
48
48
|
});
|
|
49
|
+
|
|
50
|
+
test('getI18nKeyPrefixBySchema gets key from uischema over schema', t => {
|
|
51
|
+
const control: ControlElement = {
|
|
52
|
+
type: 'Control',
|
|
53
|
+
scope: '#/properties/foo',
|
|
54
|
+
i18n: 'controlFoo'
|
|
55
|
+
};
|
|
56
|
+
const schema: i18nJsonSchema = {
|
|
57
|
+
type: 'string',
|
|
58
|
+
i18n: 'schemaFoo'
|
|
59
|
+
}
|
|
60
|
+
t.is(getI18nKeyPrefixBySchema(schema, control), 'controlFoo');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test('getI18nKeyPrefixBySchema gets schema key for missing uischema key', t => {
|
|
64
|
+
const control: ControlElement = {
|
|
65
|
+
type: 'Control',
|
|
66
|
+
scope: '#/properties/foo',
|
|
67
|
+
};
|
|
68
|
+
const schema: i18nJsonSchema = {
|
|
69
|
+
type: 'string',
|
|
70
|
+
i18n: 'schemaFoo'
|
|
71
|
+
}
|
|
72
|
+
t.is(getI18nKeyPrefixBySchema(schema, control), 'schemaFoo');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('getI18nKeyPrefixBySchema returns undefined for missing uischema and schema keys', t => {
|
|
76
|
+
const control: ControlElement = {
|
|
77
|
+
type: 'Control',
|
|
78
|
+
scope: '#/properties/foo',
|
|
79
|
+
};
|
|
80
|
+
const schema: i18nJsonSchema = {
|
|
81
|
+
type: 'string',
|
|
82
|
+
}
|
|
83
|
+
t.is(getI18nKeyPrefixBySchema(schema, control), undefined);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test('getI18nKeyPrefixBySchema returns undefined for undefined parameters', t => {
|
|
87
|
+
t.is(getI18nKeyPrefixBySchema(undefined, undefined), undefined);
|
|
88
|
+
});
|