@jsonforms/core 3.0.0-alpha.0 → 3.0.0-beta.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 +1 -1
- package/docs/assets/js/search.json +1 -1
- package/docs/enums/ruleeffect.html +4 -4
- package/docs/globals.html +1095 -703
- package/docs/index.html +70 -43
- package/docs/interfaces/addcellrendereraction.html +3 -3
- package/docs/interfaces/addrendereraction.html +3 -3
- package/docs/interfaces/adduischemaaction.html +3 -3
- package/docs/interfaces/andcondition.html +2 -2
- package/docs/interfaces/arraycontrolprops.html +22 -22
- package/docs/interfaces/arraylayoutprops.html +22 -22
- package/docs/interfaces/categorization.html +5 -5
- package/docs/interfaces/category.html +5 -5
- package/docs/interfaces/cellprops.html +14 -14
- package/docs/interfaces/combinatorrendererprops.html +13 -13
- package/docs/interfaces/combinatorsubschemarenderinfo.html +3 -3
- package/docs/interfaces/composablecondition.html +2 -2
- package/docs/interfaces/condition.html +1 -1
- package/docs/interfaces/controlelement.html +5 -5
- package/docs/interfaces/controlprops.html +17 -17
- package/docs/interfaces/controlstate.html +2 -2
- package/docs/interfaces/controlwithdetailprops.html +18 -18
- package/docs/interfaces/dispatchcellprops.html +13 -13
- package/docs/interfaces/dispatchcellstateprops.html +13 -13
- 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 +15 -15
- package/docs/interfaces/enumoption.html +2 -2
- package/docs/interfaces/formatted.html +2 -2
- package/docs/interfaces/grouplayout.html +5 -5
- package/docs/interfaces/horizontallayout.html +4 -4
- package/docs/interfaces/initaction.html +6 -6
- package/docs/interfaces/initactionoptions.html +3 -3
- package/docs/interfaces/jsonformscellrendererregistryentry.html +2 -2
- package/docs/interfaces/jsonformscore.html +7 -7
- package/docs/interfaces/jsonformsdefaultdataregistryentry.html +2 -2
- package/docs/interfaces/jsonformsextendedstate.html +1 -1
- package/docs/interfaces/{jsonformslocalestate.html → jsonformsi18nstate.html} +20 -20
- package/docs/interfaces/jsonformsprops.html +9 -9
- package/docs/interfaces/jsonformsrendererregistryentry.html +2 -2
- package/docs/interfaces/jsonformsstate.html +1 -1
- package/docs/interfaces/jsonformsstore.html +5 -5
- package/docs/interfaces/jsonformssubstates.html +18 -8
- package/docs/interfaces/jsonformsuischemaregistryentry.html +2 -2
- package/docs/interfaces/labeldescription.html +2 -2
- package/docs/interfaces/labelelement.html +4 -4
- package/docs/interfaces/layout.html +4 -4
- package/docs/interfaces/layoutprops.html +10 -10
- package/docs/interfaces/leafcondition.html +3 -3
- package/docs/interfaces/orcondition.html +2 -2
- package/docs/interfaces/ownpropsofcell.html +10 -10
- package/docs/interfaces/ownpropsofcontrol.html +9 -9
- package/docs/interfaces/ownpropsofenum.html +1 -1
- package/docs/interfaces/ownpropsofenumcell.html +11 -11
- package/docs/interfaces/ownpropsofjsonformsrenderer.html +8 -8
- package/docs/interfaces/ownpropsoflayout.html +9 -9
- package/docs/interfaces/ownpropsofmasterlistitem.html +6 -6
- package/docs/interfaces/ownpropsofrenderer.html +8 -8
- package/docs/interfaces/registerdefaultdataaction.html +3 -3
- package/docs/interfaces/removecellrendereraction.html +3 -3
- package/docs/interfaces/removerendereraction.html +3 -3
- package/docs/interfaces/removeuischemaaction.html +2 -2
- package/docs/interfaces/rendererprops.html +9 -9
- package/docs/interfaces/rule.html +2 -2
- package/docs/interfaces/schemabasedcondition.html +3 -3
- package/docs/interfaces/scopable.html +1 -1
- package/docs/interfaces/setajvaction.html +3 -3
- package/docs/interfaces/setconfigaction.html +2 -2
- package/docs/interfaces/setlocaleaction.html +3 -3
- package/docs/interfaces/setschemaaction.html +2 -2
- package/docs/interfaces/{setlocalizedschemasaction.html → settranslatoraction.html} +29 -15
- package/docs/interfaces/setuischemaaction.html +2 -2
- package/docs/interfaces/setvalidationmodeaction.html +2 -2
- package/docs/interfaces/statepropsofarraycontrol.html +18 -18
- package/docs/interfaces/statepropsofarraylayout.html +18 -18
- package/docs/interfaces/statepropsofcell.html +13 -13
- package/docs/interfaces/statepropsofcombinator.html +12 -12
- package/docs/interfaces/statepropsofcontrol.html +16 -16
- package/docs/interfaces/statepropsofcontrolwithdetail.html +17 -17
- package/docs/interfaces/statepropsofenumcell.html +14 -14
- package/docs/interfaces/statepropsofjsonformsrenderer.html +9 -9
- package/docs/interfaces/statepropsoflayout.html +10 -10
- package/docs/interfaces/statepropsofmasteritem.html +7 -7
- package/docs/interfaces/statepropsofrenderer.html +9 -9
- package/docs/interfaces/statepropsofscopedrenderer.html +12 -12
- package/docs/interfaces/uischemaelement.html +3 -3
- package/docs/interfaces/unregisterdefaultdataaction.html +2 -2
- package/docs/interfaces/updateaction.html +3 -3
- package/docs/interfaces/updatecoreaction.html +6 -6
- package/docs/interfaces/updateerrorsaction.html +2 -2
- package/docs/interfaces/{setlocalizeduischemasaction.html → updatei18naction.html} +43 -15
- package/docs/interfaces/verticallayout.html +4 -4
- package/docs/interfaces/withclassname.html +1 -1
- package/lib/Helpers.d.ts +5 -0
- package/lib/actions/actions.d.ts +181 -0
- package/lib/actions/index.d.ts +1 -178
- package/lib/configDefault.d.ts +6 -6
- package/lib/generators/Generate.d.ts +6 -0
- package/lib/generators/index.d.ts +3 -10
- package/lib/generators/schema.d.ts +8 -8
- package/lib/generators/uischema.d.ts +12 -13
- package/lib/i18n/i18nTypes.d.ts +15 -0
- package/lib/i18n/i18nUtil.d.ts +18 -0
- package/lib/i18n/index.d.ts +2 -0
- package/lib/index.d.ts +11 -23
- package/lib/jsonforms-core.cjs.js +2445 -0
- package/lib/jsonforms-core.cjs.js.map +1 -0
- package/lib/jsonforms-core.esm.js +2164 -0
- package/lib/jsonforms-core.esm.js.map +1 -0
- package/lib/models/draft4.d.ts +198 -198
- package/lib/models/index.d.ts +5 -0
- package/lib/models/jsonSchema.d.ts +3 -3
- package/lib/models/jsonSchema4.d.ts +110 -110
- package/lib/models/jsonSchema7.d.ts +119 -119
- package/lib/models/uischema.d.ts +201 -201
- package/lib/reducers/cells.d.ts +11 -11
- package/lib/reducers/config.d.ts +3 -3
- package/lib/reducers/core.d.ts +24 -23
- package/lib/reducers/default-data.d.ts +10 -10
- package/lib/reducers/i18n.d.ts +8 -11
- package/lib/reducers/index.d.ts +9 -47
- package/lib/reducers/reducers.d.ts +29 -0
- package/lib/reducers/renderers.d.ts +10 -10
- package/lib/reducers/selectors.d.ts +15 -0
- package/lib/reducers/uischemas.d.ts +10 -10
- package/lib/store.d.ts +53 -56
- package/lib/testers/index.d.ts +1 -204
- package/lib/testers/testers.d.ts +203 -0
- package/lib/util/Formatted.d.ts +19 -19
- package/lib/util/array.d.ts +3 -3
- package/lib/util/cell.d.ts +79 -79
- package/lib/util/combinators.d.ts +10 -11
- package/lib/util/ids.d.ts +3 -3
- package/lib/util/index.d.ts +15 -49
- package/lib/util/label.d.ts +9 -10
- package/lib/util/path.d.ts +25 -24
- package/lib/util/renderer.d.ts +398 -395
- package/lib/util/resolvers.d.ts +25 -25
- package/lib/util/runtime.d.ts +18 -19
- package/lib/util/schema.d.ts +1 -1
- package/lib/util/type.d.ts +174 -174
- package/lib/util/uischema.d.ts +5 -5
- package/lib/util/util.d.ts +31 -0
- package/lib/util/validator.d.ts +3 -2
- package/package.json +18 -14
- package/rollup.config.js +44 -0
- package/{lib/models/jsonSchema4.js → src/Helpers.ts} +16 -8
- package/src/actions/actions.ts +345 -0
- package/src/actions/index.ts +1 -310
- package/src/configDefault.ts +1 -0
- package/{lib/util/validator.js → src/generators/Generate.ts} +18 -11
- package/src/generators/index.ts +3 -21
- package/src/generators/schema.ts +1 -1
- package/src/generators/uischema.ts +4 -4
- package/src/i18n/i18nTypes.ts +17 -0
- package/src/i18n/i18nUtil.ts +105 -0
- package/src/i18n/index.ts +2 -0
- package/src/index.ts +7 -31
- package/src/models/draft4.ts +1 -0
- package/{lib/util/type.js → src/models/index.ts} +10 -7
- package/src/models/jsonSchema.ts +1 -0
- package/src/models/uischema.ts +1 -0
- package/src/reducers/cells.ts +2 -1
- package/src/reducers/config.ts +2 -1
- package/src/reducers/core.ts +74 -52
- package/src/reducers/default-data.ts +2 -1
- package/src/reducers/i18n.ts +42 -35
- package/src/reducers/index.ts +9 -154
- package/src/reducers/reducers.ts +128 -0
- package/src/reducers/renderers.ts +2 -1
- package/src/reducers/selectors.ts +65 -0
- package/src/reducers/uischemas.ts +4 -2
- package/src/store.ts +11 -8
- package/src/testers/index.ts +1 -516
- package/src/testers/testers.ts +547 -0
- package/src/util/Formatted.ts +1 -0
- package/src/util/array.ts +25 -0
- package/src/util/cell.ts +45 -10
- package/src/util/combinators.ts +2 -4
- package/src/util/ids.ts +1 -0
- package/src/util/index.ts +11 -123
- package/src/util/label.ts +2 -2
- package/src/util/path.ts +4 -1
- package/src/util/renderer.ts +139 -66
- package/src/util/resolvers.ts +2 -1
- package/src/util/runtime.ts +3 -2
- package/src/util/schema.ts +26 -1
- package/src/util/uischema.ts +2 -1
- package/src/util/util.ts +127 -0
- package/src/util/validator.ts +5 -8
- package/stats.html +3279 -0
- package/{lib/configDefault.js → test/i18n/i18nUtil.test.ts} +25 -24
- package/test/reducers/core.test.ts +31 -44
- package/test/util/cell.test.ts +2 -2
- package/test/util/renderer.test.ts +543 -31
- package/docs/interfaces/labels.html +0 -157
- package/lib/actions/index.js +0 -125
- package/lib/actions/index.js.map +0 -1
- package/lib/configDefault.js.map +0 -1
- package/lib/generators/index.js +0 -12
- package/lib/generators/index.js.map +0 -1
- package/lib/generators/schema.js +0 -152
- package/lib/generators/schema.js.map +0 -1
- package/lib/generators/uischema.js +0 -167
- package/lib/generators/uischema.js.map +0 -1
- package/lib/index.js +0 -45
- package/lib/index.js.map +0 -1
- package/lib/jsonforms-core.js +0 -19
- package/lib/jsonforms-core.js.map +0 -1
- package/lib/models/draft4.js +0 -173
- package/lib/models/draft4.js.map +0 -1
- package/lib/models/jsonSchema.js +0 -3
- package/lib/models/jsonSchema.js.map +0 -1
- package/lib/models/jsonSchema4.js.map +0 -1
- package/lib/models/jsonSchema7.js +0 -30
- package/lib/models/jsonSchema7.js.map +0 -1
- package/lib/models/uischema.js +0 -31
- package/lib/models/uischema.js.map +0 -1
- package/lib/reducers/cells.js +0 -16
- package/lib/reducers/cells.js.map +0 -1
- package/lib/reducers/config.js +0 -44
- package/lib/reducers/config.js.map +0 -1
- package/lib/reducers/core.js +0 -259
- package/lib/reducers/core.js.map +0 -1
- package/lib/reducers/default-data.js +0 -42
- package/lib/reducers/default-data.js.map +0 -1
- package/lib/reducers/i18n.js +0 -66
- package/lib/reducers/i18n.js.map +0 -1
- package/lib/reducers/index.js +0 -92
- package/lib/reducers/index.js.map +0 -1
- package/lib/reducers/renderers.js +0 -17
- package/lib/reducers/renderers.js.map +0 -1
- package/lib/reducers/uischemas.js +0 -57
- package/lib/reducers/uischemas.js.map +0 -1
- package/lib/store.js +0 -3
- package/lib/store.js.map +0 -1
- package/lib/testers/index.js +0 -402
- package/lib/testers/index.js.map +0 -1
- package/lib/util/Formatted.js +0 -3
- package/lib/util/Formatted.js.map +0 -1
- package/lib/util/array.js +0 -19
- package/lib/util/array.js.map +0 -1
- package/lib/util/cell.js +0 -133
- package/lib/util/cell.js.map +0 -1
- package/lib/util/combinators.js +0 -56
- package/lib/util/combinators.js.map +0 -1
- package/lib/util/ids.js +0 -50
- package/lib/util/ids.js.map +0 -1
- package/lib/util/index.js +0 -132
- package/lib/util/index.js.map +0 -1
- package/lib/util/label.js +0 -70
- package/lib/util/label.js.map +0 -1
- package/lib/util/path.js +0 -84
- package/lib/util/path.js.map +0 -1
- package/lib/util/renderer.js +0 -447
- package/lib/util/renderer.js.map +0 -1
- package/lib/util/resolvers.js +0 -165
- package/lib/util/resolvers.js.map +0 -1
- package/lib/util/runtime.js +0 -159
- package/lib/util/runtime.js.map +0 -1
- package/lib/util/schema.js +0 -16
- package/lib/util/schema.js.map +0 -1
- package/lib/util/type.js.map +0 -1
- package/lib/util/uischema.js +0 -52
- package/lib/util/uischema.js.map +0 -1
- package/lib/util/validator.js.map +0 -1
- package/webpack.build.js +0 -13
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
<div class="tsd-signature tsd-kind-icon">class<wbr>Name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
94
94
|
<aside class="tsd-sources">
|
|
95
95
|
<ul>
|
|
96
|
-
<li>Defined in packages/core/src/util/renderer.ts:
|
|
96
|
+
<li>Defined in packages/core/src/util/renderer.ts:170</li>
|
|
97
97
|
</ul>
|
|
98
98
|
</aside>
|
|
99
99
|
</section>
|
package/lib/Helpers.d.ts
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import AJV, { ErrorObject } from 'ajv';
|
|
2
|
+
import { JsonSchema, UISchemaElement } from '../models';
|
|
3
|
+
import { RankedTester } from '../testers';
|
|
4
|
+
import { UISchemaTester, ValidationMode } from '../reducers';
|
|
5
|
+
import { ErrorTranslator, Translator } from '../i18n';
|
|
6
|
+
export declare const INIT: 'jsonforms/INIT';
|
|
7
|
+
export declare const UPDATE_CORE: 'jsonforms/UPDATE_CORE';
|
|
8
|
+
export declare const SET_AJV: 'jsonforms/SET_AJV';
|
|
9
|
+
export declare const UPDATE_DATA: 'jsonforms/UPDATE';
|
|
10
|
+
export declare const UPDATE_ERRORS: 'jsonforms/UPDATE_ERRORS';
|
|
11
|
+
export declare const VALIDATE: 'jsonforms/VALIDATE';
|
|
12
|
+
export declare const ADD_RENDERER: 'jsonforms/ADD_RENDERER';
|
|
13
|
+
export declare const REMOVE_RENDERER: 'jsonforms/REMOVE_RENDERER';
|
|
14
|
+
export declare const ADD_CELL: 'jsonforms/ADD_CELL';
|
|
15
|
+
export declare const REMOVE_CELL: 'jsonforms/REMOVE_CELL';
|
|
16
|
+
export declare const SET_CONFIG: 'jsonforms/SET_CONFIG';
|
|
17
|
+
export declare const ADD_UI_SCHEMA: 'jsonforms/ADD_UI_SCHEMA';
|
|
18
|
+
export declare const REMOVE_UI_SCHEMA: 'jsonforms/REMOVE_UI_SCHEMA';
|
|
19
|
+
export declare const SET_SCHEMA: 'jsonforms/SET_SCHEMA';
|
|
20
|
+
export declare const SET_UISCHEMA: 'jsonforms/SET_UISCHEMA';
|
|
21
|
+
export declare const SET_VALIDATION_MODE: 'jsonforms/SET_VALIDATION_MODE';
|
|
22
|
+
export declare const SET_LOCALE: 'jsonforms/SET_LOCALE';
|
|
23
|
+
export declare const SET_TRANSLATOR: 'jsonforms/SET_TRANSLATOR';
|
|
24
|
+
export declare const UPDATE_I18N: 'jsonforms/UPDATE_I18N';
|
|
25
|
+
export declare const ADD_DEFAULT_DATA: 'jsonforms/ADD_DEFAULT_DATA';
|
|
26
|
+
export declare const REMOVE_DEFAULT_DATA: 'jsonforms/REMOVE_DEFAULT_DATA';
|
|
27
|
+
export declare type CoreActions = InitAction | UpdateCoreAction | UpdateAction | UpdateErrorsAction | SetAjvAction | SetSchemaAction | SetUISchemaAction | SetValidationModeAction;
|
|
28
|
+
export interface UpdateAction {
|
|
29
|
+
type: 'jsonforms/UPDATE';
|
|
30
|
+
path: string;
|
|
31
|
+
updater(existingData?: any): any;
|
|
32
|
+
}
|
|
33
|
+
export interface UpdateErrorsAction {
|
|
34
|
+
type: 'jsonforms/UPDATE_ERRORS';
|
|
35
|
+
errors: ErrorObject[];
|
|
36
|
+
}
|
|
37
|
+
export interface InitAction {
|
|
38
|
+
type: 'jsonforms/INIT';
|
|
39
|
+
data: any;
|
|
40
|
+
schema: JsonSchema;
|
|
41
|
+
uischema: UISchemaElement;
|
|
42
|
+
options?: InitActionOptions | AJV;
|
|
43
|
+
}
|
|
44
|
+
export interface UpdateCoreAction {
|
|
45
|
+
type: 'jsonforms/UPDATE_CORE';
|
|
46
|
+
data?: any;
|
|
47
|
+
schema?: JsonSchema;
|
|
48
|
+
uischema?: UISchemaElement;
|
|
49
|
+
options?: InitActionOptions | AJV;
|
|
50
|
+
}
|
|
51
|
+
export interface InitActionOptions {
|
|
52
|
+
ajv?: AJV;
|
|
53
|
+
validationMode?: ValidationMode;
|
|
54
|
+
}
|
|
55
|
+
export interface SetValidationModeAction {
|
|
56
|
+
type: 'jsonforms/SET_VALIDATION_MODE';
|
|
57
|
+
validationMode: ValidationMode;
|
|
58
|
+
}
|
|
59
|
+
export declare const init: (data: any, schema?: JsonSchema, uischema?: UISchemaElement, options?: InitActionOptions | AJV) => {
|
|
60
|
+
type: "jsonforms/INIT";
|
|
61
|
+
data: any;
|
|
62
|
+
schema: JsonSchema;
|
|
63
|
+
uischema: UISchemaElement;
|
|
64
|
+
options: InitActionOptions | AJV;
|
|
65
|
+
};
|
|
66
|
+
export declare const updateCore: (data: any, schema: JsonSchema, uischema?: UISchemaElement, options?: AJV | InitActionOptions) => UpdateCoreAction;
|
|
67
|
+
export interface RegisterDefaultDataAction {
|
|
68
|
+
type: 'jsonforms/ADD_DEFAULT_DATA';
|
|
69
|
+
schemaPath: string;
|
|
70
|
+
data: any;
|
|
71
|
+
}
|
|
72
|
+
export declare const registerDefaultData: (schemaPath: string, data: any) => {
|
|
73
|
+
type: "jsonforms/ADD_DEFAULT_DATA";
|
|
74
|
+
schemaPath: string;
|
|
75
|
+
data: any;
|
|
76
|
+
};
|
|
77
|
+
export interface UnregisterDefaultDataAction {
|
|
78
|
+
type: 'jsonforms/REMOVE_DEFAULT_DATA';
|
|
79
|
+
schemaPath: string;
|
|
80
|
+
}
|
|
81
|
+
export declare const unregisterDefaultData: (schemaPath: string) => {
|
|
82
|
+
type: "jsonforms/REMOVE_DEFAULT_DATA";
|
|
83
|
+
schemaPath: string;
|
|
84
|
+
};
|
|
85
|
+
export interface SetAjvAction {
|
|
86
|
+
type: 'jsonforms/SET_AJV';
|
|
87
|
+
ajv: AJV;
|
|
88
|
+
}
|
|
89
|
+
export declare const setAjv: (ajv: AJV) => {
|
|
90
|
+
type: "jsonforms/SET_AJV";
|
|
91
|
+
ajv: AJV;
|
|
92
|
+
};
|
|
93
|
+
export declare const update: (path: string, updater: (existingData: any) => any) => UpdateAction;
|
|
94
|
+
export declare const updateErrors: (errors: ErrorObject[]) => UpdateErrorsAction;
|
|
95
|
+
export interface AddRendererAction {
|
|
96
|
+
type: 'jsonforms/ADD_RENDERER';
|
|
97
|
+
tester: RankedTester;
|
|
98
|
+
renderer: any;
|
|
99
|
+
}
|
|
100
|
+
export declare const registerRenderer: (tester: RankedTester, renderer: any) => {
|
|
101
|
+
type: "jsonforms/ADD_RENDERER";
|
|
102
|
+
tester: RankedTester;
|
|
103
|
+
renderer: any;
|
|
104
|
+
};
|
|
105
|
+
export interface AddCellRendererAction {
|
|
106
|
+
type: 'jsonforms/ADD_CELL';
|
|
107
|
+
tester: RankedTester;
|
|
108
|
+
cell: any;
|
|
109
|
+
}
|
|
110
|
+
export declare const registerCell: (tester: RankedTester, cell: any) => {
|
|
111
|
+
type: "jsonforms/ADD_CELL";
|
|
112
|
+
tester: RankedTester;
|
|
113
|
+
cell: any;
|
|
114
|
+
};
|
|
115
|
+
export interface RemoveCellRendererAction {
|
|
116
|
+
type: 'jsonforms/REMOVE_CELL';
|
|
117
|
+
tester: RankedTester;
|
|
118
|
+
cell: any;
|
|
119
|
+
}
|
|
120
|
+
export declare const unregisterCell: (tester: RankedTester, cell: any) => {
|
|
121
|
+
type: "jsonforms/REMOVE_CELL";
|
|
122
|
+
tester: RankedTester;
|
|
123
|
+
cell: any;
|
|
124
|
+
};
|
|
125
|
+
export interface RemoveRendererAction {
|
|
126
|
+
type: 'jsonforms/REMOVE_RENDERER';
|
|
127
|
+
tester: RankedTester;
|
|
128
|
+
renderer: any;
|
|
129
|
+
}
|
|
130
|
+
export declare const unregisterRenderer: (tester: RankedTester, renderer: any) => {
|
|
131
|
+
type: "jsonforms/REMOVE_RENDERER";
|
|
132
|
+
tester: RankedTester;
|
|
133
|
+
renderer: any;
|
|
134
|
+
};
|
|
135
|
+
export interface SetConfigAction {
|
|
136
|
+
type: 'jsonforms/SET_CONFIG';
|
|
137
|
+
config: any;
|
|
138
|
+
}
|
|
139
|
+
export declare const setConfig: (config: any) => SetConfigAction;
|
|
140
|
+
export declare const setValidationMode: (validationMode: ValidationMode) => SetValidationModeAction;
|
|
141
|
+
export declare type UISchemaActions = AddUISchemaAction | RemoveUISchemaAction;
|
|
142
|
+
export interface AddUISchemaAction {
|
|
143
|
+
type: 'jsonforms/ADD_UI_SCHEMA';
|
|
144
|
+
tester: UISchemaTester;
|
|
145
|
+
uischema: UISchemaElement;
|
|
146
|
+
}
|
|
147
|
+
export declare const registerUISchema: (tester: UISchemaTester, uischema: UISchemaElement) => AddUISchemaAction;
|
|
148
|
+
export interface RemoveUISchemaAction {
|
|
149
|
+
type: 'jsonforms/REMOVE_UI_SCHEMA';
|
|
150
|
+
tester: UISchemaTester;
|
|
151
|
+
}
|
|
152
|
+
export declare const unregisterUISchema: (tester: UISchemaTester) => RemoveUISchemaAction;
|
|
153
|
+
export declare type I18nActions = SetLocaleAction | SetTranslatorAction | UpdateI18nAction;
|
|
154
|
+
export interface SetLocaleAction {
|
|
155
|
+
type: 'jsonforms/SET_LOCALE';
|
|
156
|
+
locale: string | undefined;
|
|
157
|
+
}
|
|
158
|
+
export declare const setLocale: (locale: string | undefined) => SetLocaleAction;
|
|
159
|
+
export interface SetSchemaAction {
|
|
160
|
+
type: 'jsonforms/SET_SCHEMA';
|
|
161
|
+
schema: JsonSchema;
|
|
162
|
+
}
|
|
163
|
+
export declare const setSchema: (schema: JsonSchema) => SetSchemaAction;
|
|
164
|
+
export interface SetTranslatorAction {
|
|
165
|
+
type: 'jsonforms/SET_TRANSLATOR';
|
|
166
|
+
translator?: Translator;
|
|
167
|
+
errorTranslator?: ErrorTranslator;
|
|
168
|
+
}
|
|
169
|
+
export declare const setTranslator: (translator?: Translator, errorTranslator?: ErrorTranslator) => SetTranslatorAction;
|
|
170
|
+
export interface UpdateI18nAction {
|
|
171
|
+
type: 'jsonforms/UPDATE_I18N';
|
|
172
|
+
locale: string | undefined;
|
|
173
|
+
translator: Translator | undefined;
|
|
174
|
+
errorTranslator: ErrorTranslator | undefined;
|
|
175
|
+
}
|
|
176
|
+
export declare const updateI18n: (locale: string | undefined, translator: Translator | undefined, errorTranslator: ErrorTranslator | undefined) => UpdateI18nAction;
|
|
177
|
+
export interface SetUISchemaAction {
|
|
178
|
+
type: 'jsonforms/SET_UISCHEMA';
|
|
179
|
+
uischema: UISchemaElement;
|
|
180
|
+
}
|
|
181
|
+
export declare const setUISchema: (uischema: UISchemaElement) => SetUISchemaAction;
|
package/lib/actions/index.d.ts
CHANGED
|
@@ -1,178 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { JsonSchema, UISchemaElement } from '../';
|
|
3
|
-
import { RankedTester } from '../testers';
|
|
4
|
-
import { UISchemaTester } from '../reducers/uischemas';
|
|
5
|
-
import { ValidationMode } from '../reducers/core';
|
|
6
|
-
export declare const INIT: 'jsonforms/INIT';
|
|
7
|
-
export declare const UPDATE_CORE: 'jsonforms/UPDATE_CORE';
|
|
8
|
-
export declare const SET_AJV: 'jsonforms/SET_AJV';
|
|
9
|
-
export declare const UPDATE_DATA: 'jsonforms/UPDATE';
|
|
10
|
-
export declare const UPDATE_ERRORS: 'jsonforms/UPDATE_ERRORS';
|
|
11
|
-
export declare const VALIDATE: 'jsonforms/VALIDATE';
|
|
12
|
-
export declare const ADD_RENDERER: 'jsonforms/ADD_RENDERER';
|
|
13
|
-
export declare const REMOVE_RENDERER: 'jsonforms/REMOVE_RENDERER';
|
|
14
|
-
export declare const ADD_CELL: 'jsonforms/ADD_CELL';
|
|
15
|
-
export declare const REMOVE_CELL: 'jsonforms/REMOVE_CELL';
|
|
16
|
-
export declare const SET_CONFIG: 'jsonforms/SET_CONFIG';
|
|
17
|
-
export declare const ADD_UI_SCHEMA: 'jsonforms/ADD_UI_SCHEMA';
|
|
18
|
-
export declare const REMOVE_UI_SCHEMA: 'jsonforms/REMOVE_UI_SCHEMA';
|
|
19
|
-
export declare const SET_SCHEMA: 'jsonforms/SET_SCHEMA';
|
|
20
|
-
export declare const SET_UISCHEMA: 'jsonforms/SET_UISCHEMA';
|
|
21
|
-
export declare const SET_VALIDATION_MODE: 'jsonforms/SET_VALIDATION_MODE';
|
|
22
|
-
export declare const SET_LOCALE: 'jsonforms/SET_LOCALE';
|
|
23
|
-
export declare const SET_LOCALIZED_SCHEMAS: 'jsonforms/SET_LOCALIZED_SCHEMAS';
|
|
24
|
-
export declare const SET_LOCALIZED_UISCHEMAS: 'jsonforms/SET_LOCALIZED_UISCHEMAS';
|
|
25
|
-
export declare const ADD_DEFAULT_DATA: 'jsonforms/ADD_DEFAULT_DATA';
|
|
26
|
-
export declare const REMOVE_DEFAULT_DATA: 'jsonforms/REMOVE_DEFAULT_DATA';
|
|
27
|
-
export declare type CoreActions = InitAction | UpdateCoreAction | UpdateAction | UpdateErrorsAction | SetAjvAction | SetSchemaAction | SetUISchemaAction | SetValidationModeAction;
|
|
28
|
-
export interface UpdateAction {
|
|
29
|
-
type: 'jsonforms/UPDATE';
|
|
30
|
-
path: string;
|
|
31
|
-
updater(existingData?: any): any;
|
|
32
|
-
}
|
|
33
|
-
export interface UpdateErrorsAction {
|
|
34
|
-
type: 'jsonforms/UPDATE_ERRORS';
|
|
35
|
-
errors: ErrorObject[];
|
|
36
|
-
}
|
|
37
|
-
export interface InitAction {
|
|
38
|
-
type: 'jsonforms/INIT';
|
|
39
|
-
data: any;
|
|
40
|
-
schema: JsonSchema;
|
|
41
|
-
uischema: UISchemaElement;
|
|
42
|
-
options?: InitActionOptions | AJV.Ajv;
|
|
43
|
-
}
|
|
44
|
-
export interface UpdateCoreAction {
|
|
45
|
-
type: 'jsonforms/UPDATE_CORE';
|
|
46
|
-
data?: any;
|
|
47
|
-
schema?: JsonSchema;
|
|
48
|
-
uischema?: UISchemaElement;
|
|
49
|
-
options?: InitActionOptions | AJV.Ajv;
|
|
50
|
-
}
|
|
51
|
-
export interface InitActionOptions {
|
|
52
|
-
ajv?: AJV.Ajv;
|
|
53
|
-
validationMode?: ValidationMode;
|
|
54
|
-
}
|
|
55
|
-
export interface SetValidationModeAction {
|
|
56
|
-
type: 'jsonforms/SET_VALIDATION_MODE';
|
|
57
|
-
validationMode: ValidationMode;
|
|
58
|
-
}
|
|
59
|
-
export declare const init: (data: any, schema?: JsonSchema, uischema?: UISchemaElement, options?: AJV.Ajv | InitActionOptions) => {
|
|
60
|
-
type: "jsonforms/INIT";
|
|
61
|
-
data: any;
|
|
62
|
-
schema: JsonSchema;
|
|
63
|
-
uischema: UISchemaElement;
|
|
64
|
-
options: AJV.Ajv | InitActionOptions;
|
|
65
|
-
};
|
|
66
|
-
export declare const updateCore: (data: any, schema: JsonSchema, uischema?: UISchemaElement, options?: AJV.Ajv | InitActionOptions) => UpdateCoreAction;
|
|
67
|
-
export interface RegisterDefaultDataAction {
|
|
68
|
-
type: 'jsonforms/ADD_DEFAULT_DATA';
|
|
69
|
-
schemaPath: string;
|
|
70
|
-
data: any;
|
|
71
|
-
}
|
|
72
|
-
export declare const registerDefaultData: (schemaPath: string, data: any) => {
|
|
73
|
-
type: "jsonforms/ADD_DEFAULT_DATA";
|
|
74
|
-
schemaPath: string;
|
|
75
|
-
data: any;
|
|
76
|
-
};
|
|
77
|
-
export interface UnregisterDefaultDataAction {
|
|
78
|
-
type: 'jsonforms/REMOVE_DEFAULT_DATA';
|
|
79
|
-
schemaPath: string;
|
|
80
|
-
}
|
|
81
|
-
export declare const unregisterDefaultData: (schemaPath: string) => {
|
|
82
|
-
type: "jsonforms/REMOVE_DEFAULT_DATA";
|
|
83
|
-
schemaPath: string;
|
|
84
|
-
};
|
|
85
|
-
export interface SetAjvAction {
|
|
86
|
-
type: 'jsonforms/SET_AJV';
|
|
87
|
-
ajv: AJV.Ajv;
|
|
88
|
-
}
|
|
89
|
-
export declare const setAjv: (ajv: AJV.Ajv) => {
|
|
90
|
-
type: "jsonforms/SET_AJV";
|
|
91
|
-
ajv: AJV.Ajv;
|
|
92
|
-
};
|
|
93
|
-
export declare const update: (path: string, updater: (existingData: any) => any) => UpdateAction;
|
|
94
|
-
export declare const updateErrors: (errors: AJV.ErrorObject[]) => UpdateErrorsAction;
|
|
95
|
-
export interface AddRendererAction {
|
|
96
|
-
type: 'jsonforms/ADD_RENDERER';
|
|
97
|
-
tester: RankedTester;
|
|
98
|
-
renderer: any;
|
|
99
|
-
}
|
|
100
|
-
export declare const registerRenderer: (tester: RankedTester, renderer: any) => {
|
|
101
|
-
type: "jsonforms/ADD_RENDERER";
|
|
102
|
-
tester: RankedTester;
|
|
103
|
-
renderer: any;
|
|
104
|
-
};
|
|
105
|
-
export interface AddCellRendererAction {
|
|
106
|
-
type: 'jsonforms/ADD_CELL';
|
|
107
|
-
tester: RankedTester;
|
|
108
|
-
cell: any;
|
|
109
|
-
}
|
|
110
|
-
export declare const registerCell: (tester: RankedTester, cell: any) => {
|
|
111
|
-
type: "jsonforms/ADD_CELL";
|
|
112
|
-
tester: RankedTester;
|
|
113
|
-
cell: any;
|
|
114
|
-
};
|
|
115
|
-
export interface RemoveCellRendererAction {
|
|
116
|
-
type: 'jsonforms/REMOVE_CELL';
|
|
117
|
-
tester: RankedTester;
|
|
118
|
-
cell: any;
|
|
119
|
-
}
|
|
120
|
-
export declare const unregisterCell: (tester: RankedTester, cell: any) => {
|
|
121
|
-
type: "jsonforms/REMOVE_CELL";
|
|
122
|
-
tester: RankedTester;
|
|
123
|
-
cell: any;
|
|
124
|
-
};
|
|
125
|
-
export interface RemoveRendererAction {
|
|
126
|
-
type: 'jsonforms/REMOVE_RENDERER';
|
|
127
|
-
tester: RankedTester;
|
|
128
|
-
renderer: any;
|
|
129
|
-
}
|
|
130
|
-
export declare const unregisterRenderer: (tester: RankedTester, renderer: any) => {
|
|
131
|
-
type: "jsonforms/REMOVE_RENDERER";
|
|
132
|
-
tester: RankedTester;
|
|
133
|
-
renderer: any;
|
|
134
|
-
};
|
|
135
|
-
export interface SetConfigAction {
|
|
136
|
-
type: 'jsonforms/SET_CONFIG';
|
|
137
|
-
config: any;
|
|
138
|
-
}
|
|
139
|
-
export declare const setConfig: (config: any) => SetConfigAction;
|
|
140
|
-
export declare const setValidationMode: (validationMode: ValidationMode) => SetValidationModeAction;
|
|
141
|
-
export declare type UISchemaActions = AddUISchemaAction | RemoveUISchemaAction;
|
|
142
|
-
export interface AddUISchemaAction {
|
|
143
|
-
type: 'jsonforms/ADD_UI_SCHEMA';
|
|
144
|
-
tester: UISchemaTester;
|
|
145
|
-
uischema: UISchemaElement;
|
|
146
|
-
}
|
|
147
|
-
export declare const registerUISchema: (tester: UISchemaTester, uischema: UISchemaElement) => AddUISchemaAction;
|
|
148
|
-
export interface RemoveUISchemaAction {
|
|
149
|
-
type: 'jsonforms/REMOVE_UI_SCHEMA';
|
|
150
|
-
tester: UISchemaTester;
|
|
151
|
-
}
|
|
152
|
-
export declare const unregisterUISchema: (tester: UISchemaTester) => RemoveUISchemaAction;
|
|
153
|
-
export declare type LocaleActions = SetLocaleAction | SetLocalizedSchemasAction | SetLocalizedUISchemasAction;
|
|
154
|
-
export interface SetLocaleAction {
|
|
155
|
-
type: 'jsonforms/SET_LOCALE';
|
|
156
|
-
locale: string;
|
|
157
|
-
}
|
|
158
|
-
export declare const setLocale: (locale: string) => SetLocaleAction;
|
|
159
|
-
export interface SetLocalizedSchemasAction {
|
|
160
|
-
type: 'jsonforms/SET_LOCALIZED_SCHEMAS';
|
|
161
|
-
localizedSchemas: Map<string, JsonSchema>;
|
|
162
|
-
}
|
|
163
|
-
export declare const setLocalizedSchemas: (localizedSchemas: Map<string, JsonSchema>) => SetLocalizedSchemasAction;
|
|
164
|
-
export interface SetSchemaAction {
|
|
165
|
-
type: 'jsonforms/SET_SCHEMA';
|
|
166
|
-
schema: JsonSchema;
|
|
167
|
-
}
|
|
168
|
-
export declare const setSchema: (schema: JsonSchema) => SetSchemaAction;
|
|
169
|
-
export interface SetLocalizedUISchemasAction {
|
|
170
|
-
type: 'jsonforms/SET_LOCALIZED_UISCHEMAS';
|
|
171
|
-
localizedUISchemas: Map<string, UISchemaElement>;
|
|
172
|
-
}
|
|
173
|
-
export declare const setLocalizedUISchemas: (localizedUISchemas: Map<string, UISchemaElement>) => SetLocalizedUISchemasAction;
|
|
174
|
-
export interface SetUISchemaAction {
|
|
175
|
-
type: 'jsonforms/SET_UISCHEMA';
|
|
176
|
-
uischema: UISchemaElement;
|
|
177
|
-
}
|
|
178
|
-
export declare const setUISchema: (uischema: UISchemaElement) => SetUISchemaAction;
|
|
1
|
+
export * from './actions';
|
package/lib/configDefault.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const configDefault: {
|
|
2
|
-
restrict: boolean;
|
|
3
|
-
trim: boolean;
|
|
4
|
-
showUnfocusedDescription: boolean;
|
|
5
|
-
hideRequiredAsterisk: boolean;
|
|
6
|
-
};
|
|
1
|
+
export declare const configDefault: {
|
|
2
|
+
restrict: boolean;
|
|
3
|
+
trim: boolean;
|
|
4
|
+
showUnfocusedDescription: boolean;
|
|
5
|
+
hideRequiredAsterisk: boolean;
|
|
6
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ControlElement, JsonSchema, UISchemaElement } from '../';
|
|
2
|
+
export declare const Generate: {
|
|
3
|
+
jsonSchema(instance: Object, options?: any): JsonSchema;
|
|
4
|
+
uiSchema(jsonSchema: JsonSchema, layoutType?: string, prefix?: string, rootSchema?: JsonSchema): UISchemaElement;
|
|
5
|
+
controlElement(ref: string): ControlElement;
|
|
6
|
+
};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const Generate: {
|
|
5
|
-
jsonSchema(instance: Object, options?: any): JsonSchema;
|
|
6
|
-
uiSchema(jsonSchema: JsonSchema, layoutType?: string, prefix?: string, rootSchema?: JsonSchema): UISchemaElement;
|
|
7
|
-
controlElement(ref: string): ControlElement;
|
|
8
|
-
};
|
|
9
|
-
export { generateJsonSchema };
|
|
10
|
-
export { generateDefaultUISchema };
|
|
1
|
+
export * from './Generate';
|
|
2
|
+
export * from './schema';
|
|
3
|
+
export * from './uischema';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { JsonSchema4 } from '../models
|
|
2
|
-
/**
|
|
3
|
-
* Generate a JSON schema based on the given data and any additional options.
|
|
4
|
-
* @param {Object} instance the data to create a JSON schema for
|
|
5
|
-
* @param {any} options any additional options that may alter the generated JSON schema
|
|
6
|
-
* @returns {JsonSchema} the generated schema
|
|
7
|
-
*/
|
|
8
|
-
export declare const generateJsonSchema: (instance: Object, options?: any) => JsonSchema4;
|
|
1
|
+
import { JsonSchema4 } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* Generate a JSON schema based on the given data and any additional options.
|
|
4
|
+
* @param {Object} instance the data to create a JSON schema for
|
|
5
|
+
* @param {any} options any additional options that may alter the generated JSON schema
|
|
6
|
+
* @returns {JsonSchema} the generated schema
|
|
7
|
+
*/
|
|
8
|
+
export declare const generateJsonSchema: (instance: Object, options?: any) => JsonSchema4;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { JsonSchema } from '../models
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
* @param {
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare const generateDefaultUISchema: (jsonSchema: JsonSchema, layoutType?: string, prefix?: string, rootSchema?: JsonSchema) => UISchemaElement;
|
|
1
|
+
import { ControlElement, JsonSchema, UISchemaElement } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a IControlObject with the given label referencing the given ref
|
|
4
|
+
*/
|
|
5
|
+
export declare const createControlElement: (ref: string) => ControlElement;
|
|
6
|
+
/**
|
|
7
|
+
* Generate a default UI schema.
|
|
8
|
+
* @param {JsonSchema} jsonSchema the JSON schema to generated a UI schema for
|
|
9
|
+
* @param {string} layoutType the desired layout type for the root layout
|
|
10
|
+
* of the generated UI schema
|
|
11
|
+
*/
|
|
12
|
+
export declare const generateDefaultUISchema: (jsonSchema: JsonSchema, layoutType?: string, prefix?: string, rootSchema?: JsonSchema) => UISchemaElement;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ErrorObject } from 'ajv';
|
|
2
|
+
import { JsonSchema, UISchemaElement } from '../models';
|
|
3
|
+
export declare type Translator = {
|
|
4
|
+
(id: string, defaultMessage: string, values?: any): string;
|
|
5
|
+
(id: string, defaultMessage: undefined, values?: any): string | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare type ErrorTranslator = (error: ErrorObject, translate: Translator, uischema?: UISchemaElement) => string;
|
|
8
|
+
export interface JsonFormsI18nState {
|
|
9
|
+
locale?: string;
|
|
10
|
+
translate?: Translator;
|
|
11
|
+
translateError?: ErrorTranslator;
|
|
12
|
+
}
|
|
13
|
+
export declare type i18nJsonSchema = JsonSchema & {
|
|
14
|
+
i18n?: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ErrorObject } from 'ajv';
|
|
2
|
+
import { UISchemaElement } from '../models';
|
|
3
|
+
import { i18nJsonSchema, ErrorTranslator, Translator } from './i18nTypes';
|
|
4
|
+
export declare const getI18nKeyPrefixBySchema: (schema: i18nJsonSchema | undefined, uischema: UISchemaElement | undefined) => string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Transforms a given path to a prefix which can be used for i18n keys.
|
|
7
|
+
* Returns 'root' for empty paths and removes array indices
|
|
8
|
+
*/
|
|
9
|
+
export declare const transformPathToI18nPrefix: (path: string) => string;
|
|
10
|
+
export declare const getI18nKeyPrefix: (schema: i18nJsonSchema | undefined, uischema: UISchemaElement | undefined, path: string | undefined) => string | undefined;
|
|
11
|
+
export declare const getI18nKey: (schema: i18nJsonSchema | undefined, uischema: UISchemaElement | undefined, path: string | undefined, key: string) => string | undefined;
|
|
12
|
+
export declare const defaultTranslator: Translator;
|
|
13
|
+
export declare const defaultErrorTranslator: ErrorTranslator;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the determined error message for the given errors.
|
|
16
|
+
* All errors must correspond to the given schema, uischema or path.
|
|
17
|
+
*/
|
|
18
|
+
export declare const getCombinedErrorMessage: (errors: ErrorObject[], et: ErrorTranslator, t: Translator, schema?: i18nJsonSchema, uischema?: UISchemaElement, path?: string) => string;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
import * as Test from './testers';
|
|
13
|
-
export * from './testers';
|
|
14
|
-
export { Test };
|
|
15
|
-
import { ControlElement, LabelDescription } from './models/uischema';
|
|
16
|
-
import { JsonSchema } from './models/jsonSchema';
|
|
17
|
-
declare const Helpers: {
|
|
18
|
-
createLabelDescriptionFrom(withLabel: ControlElement, schema: JsonSchema): LabelDescription;
|
|
19
|
-
convertToValidClassName(s: string): string;
|
|
20
|
-
};
|
|
21
|
-
export { Helpers };
|
|
22
|
-
export * from './util';
|
|
23
|
-
export * from './store';
|
|
1
|
+
export * from './actions';
|
|
2
|
+
export * as Actions from './actions';
|
|
3
|
+
export * from './generators';
|
|
4
|
+
export * from './models';
|
|
5
|
+
export * from './reducers';
|
|
6
|
+
export * from './testers';
|
|
7
|
+
export * as Test from './testers';
|
|
8
|
+
export * from './util';
|
|
9
|
+
export * from './Helpers';
|
|
10
|
+
export * from './store';
|
|
11
|
+
export * from './i18n';
|