@jsonforms/core 3.0.0-alpha.1 → 3.0.0-beta.1
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/docs/assets/js/search.json +1 -1
- package/docs/globals.html +822 -405
- package/docs/index.html +69 -36
- package/docs/interfaces/addcellrendereraction.html +3 -3
- package/docs/interfaces/addrendereraction.html +3 -3
- package/docs/interfaces/adduischemaaction.html +3 -3
- package/docs/interfaces/arraycontrolprops.html +21 -21
- package/docs/interfaces/arraylayoutprops.html +21 -21
- package/docs/interfaces/cellprops.html +14 -14
- package/docs/interfaces/combinatorrendererprops.html +13 -13
- 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 +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/initaction.html +6 -6
- package/docs/interfaces/initactionoptions.html +3 -3
- package/docs/interfaces/jsonformscore.html +7 -7
- package/docs/interfaces/{jsonformslocalestate.html → jsonformsi18nstate.html} +20 -20
- package/docs/interfaces/jsonformsprops.html +9 -9
- package/docs/interfaces/jsonformssubstates.html +11 -1
- package/docs/interfaces/layoutprops.html +10 -10
- 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/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 +17 -17
- package/docs/interfaces/statepropsofarraylayout.html +17 -17
- package/docs/interfaces/statepropsofcell.html +13 -13
- package/docs/interfaces/statepropsofcombinator.html +12 -12
- package/docs/interfaces/statepropsofcontrol.html +15 -15
- package/docs/interfaces/statepropsofcontrolwithdetail.html +16 -16
- 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/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/withclassname.html +1 -1
- package/lib/Helpers.d.ts +5 -5
- package/lib/actions/actions.d.ts +181 -177
- package/lib/actions/index.d.ts +1 -1
- package/lib/configDefault.d.ts +6 -6
- package/lib/generators/Generate.d.ts +6 -6
- package/lib/generators/index.d.ts +3 -3
- package/lib/generators/schema.d.ts +8 -8
- package/lib/generators/uischema.d.ts +12 -12
- 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 -10
- 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 -5
- 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 -9
- package/lib/reducers/reducers.d.ts +29 -36
- package/lib/reducers/renderers.d.ts +10 -10
- package/lib/reducers/selectors.d.ts +15 -15
- package/lib/reducers/uischemas.d.ts +10 -10
- package/lib/store.d.ts +53 -52
- package/lib/testers/index.d.ts +1 -1
- package/lib/testers/testers.d.ts +203 -203
- 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 -10
- package/lib/util/ids.d.ts +3 -3
- package/lib/util/index.d.ts +15 -15
- package/lib/util/label.d.ts +9 -9
- package/lib/util/path.d.ts +25 -25
- package/lib/util/renderer.d.ts +398 -387
- 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 -31
- package/lib/util/validator.d.ts +3 -2
- package/package.json +18 -14
- package/rollup.config.js +44 -0
- package/src/actions/actions.ts +46 -36
- 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 +1 -0
- package/src/reducers/core.ts +70 -48
- package/src/reducers/i18n.ts +41 -35
- package/src/reducers/reducers.ts +10 -29
- package/src/reducers/selectors.ts +1 -1
- package/src/store.ts +4 -4
- package/src/util/cell.ts +26 -6
- package/src/util/renderer.ts +127 -38
- package/src/util/runtime.ts +1 -1
- package/src/util/util.ts +1 -1
- package/src/util/validator.ts +5 -9
- package/stats.html +3279 -0
- package/{lib/reducers/cells.js → test/i18n/i18nUtil.test.ts} +25 -17
- package/test/reducers/core.test.ts +31 -44
- package/test/util/cell.test.ts +2 -2
- package/test/util/renderer.test.ts +488 -35
- package/lib/Helpers.js +0 -32
- package/lib/Helpers.js.map +0 -1
- package/lib/actions/actions.js +0 -149
- package/lib/actions/actions.js.map +0 -1
- package/lib/actions/index.js +0 -29
- package/lib/actions/index.js.map +0 -1
- package/lib/configDefault.js +0 -47
- package/lib/configDefault.js.map +0 -1
- package/lib/generators/Generate.js +0 -34
- package/lib/generators/Generate.js.map +0 -1
- package/lib/generators/index.js +0 -31
- 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 -166
- package/lib/generators/uischema.js.map +0 -1
- package/lib/index.js +0 -37
- 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/index.js +0 -30
- package/lib/models/index.js.map +0 -1
- package/lib/models/jsonSchema.js +0 -27
- package/lib/models/jsonSchema.js.map +0 -1
- package/lib/models/jsonSchema4.js +0 -30
- 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 -55
- package/lib/models/uischema.js.map +0 -1
- 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 -65
- package/lib/reducers/i18n.js.map +0 -1
- package/lib/reducers/index.js +0 -37
- package/lib/reducers/index.js.map +0 -1
- package/lib/reducers/reducers.js +0 -99
- package/lib/reducers/reducers.js.map +0 -1
- package/lib/reducers/renderers.js +0 -41
- package/lib/reducers/renderers.js.map +0 -1
- package/lib/reducers/selectors.js +0 -47
- package/lib/reducers/selectors.js.map +0 -1
- package/lib/reducers/uischemas.js +0 -57
- package/lib/reducers/uischemas.js.map +0 -1
- package/lib/store.js +0 -27
- package/lib/store.js.map +0 -1
- package/lib/testers/index.js +0 -29
- package/lib/testers/index.js.map +0 -1
- package/lib/testers/testers.js +0 -401
- package/lib/testers/testers.js.map +0 -1
- package/lib/util/Formatted.js +0 -27
- package/lib/util/Formatted.js.map +0 -1
- package/lib/util/array.js +0 -43
- 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 -41
- 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 -85
- package/lib/util/path.js.map +0 -1
- package/lib/util/renderer.js +0 -451
- 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 -40
- package/lib/util/schema.js.map +0 -1
- package/lib/util/type.js +0 -27
- 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/util.js +0 -107
- package/lib/util/util.js.map +0 -1
- package/lib/util/validator.js +0 -36
- package/lib/util/validator.js.map +0 -1
- package/webpack.build.js +0 -13
package/lib/reducers/core.js
DELETED
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
The MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2017-2019 EclipseSource Munich
|
|
6
|
-
https://github.com/eclipsesource/jsonforms
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
var tslib_1 = require("tslib");
|
|
28
|
-
var cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
|
|
29
|
-
var set_1 = tslib_1.__importDefault(require("lodash/fp/set"));
|
|
30
|
-
var get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
31
|
-
var filter_1 = tslib_1.__importDefault(require("lodash/filter"));
|
|
32
|
-
var isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
33
|
-
var isFunction_1 = tslib_1.__importDefault(require("lodash/isFunction"));
|
|
34
|
-
var actions_1 = require("../actions");
|
|
35
|
-
var util_1 = require("../util");
|
|
36
|
-
var validate = function (validator, data) {
|
|
37
|
-
var valid = validator(data);
|
|
38
|
-
if (valid) {
|
|
39
|
-
return [];
|
|
40
|
-
}
|
|
41
|
-
return validator.errors;
|
|
42
|
-
};
|
|
43
|
-
exports.sanitizeErrors = function (validator, data) {
|
|
44
|
-
if (validator === alwaysValid) {
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
return validate(validator, data).map(function (error) {
|
|
48
|
-
error.dataPath = error.dataPath.replace(/\//g, '.').substr(1);
|
|
49
|
-
return error;
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
var alwaysValid = function () { return true; };
|
|
53
|
-
var initState = {
|
|
54
|
-
data: {},
|
|
55
|
-
schema: {},
|
|
56
|
-
uischema: undefined,
|
|
57
|
-
errors: [],
|
|
58
|
-
validator: alwaysValid,
|
|
59
|
-
ajv: undefined,
|
|
60
|
-
validationMode: 'ValidateAndShow'
|
|
61
|
-
};
|
|
62
|
-
var reuseAjvForSchema = function (ajv, schema) {
|
|
63
|
-
if (schema.hasOwnProperty('id') || schema.hasOwnProperty('$id')) {
|
|
64
|
-
ajv.removeSchema(schema);
|
|
65
|
-
}
|
|
66
|
-
return ajv;
|
|
67
|
-
};
|
|
68
|
-
var getOrCreateAjv = function (state, action) {
|
|
69
|
-
if (action) {
|
|
70
|
-
if (hasAjvOption(action.options)) {
|
|
71
|
-
// options object with ajv
|
|
72
|
-
return action.options.ajv;
|
|
73
|
-
}
|
|
74
|
-
else if (action.options !== undefined) {
|
|
75
|
-
// it is not an option object => should be ajv itself => check for compile function
|
|
76
|
-
if (isFunction_1.default(action.options.compile)) {
|
|
77
|
-
return action.options;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (state.ajv) {
|
|
82
|
-
return (action === null || action === void 0 ? void 0 : action.schema) ? reuseAjvForSchema(state.ajv, action.schema)
|
|
83
|
-
: state.ajv;
|
|
84
|
-
}
|
|
85
|
-
return util_1.createAjv();
|
|
86
|
-
};
|
|
87
|
-
var hasAjvOption = function (option) {
|
|
88
|
-
if (option) {
|
|
89
|
-
return option.ajv !== undefined;
|
|
90
|
-
}
|
|
91
|
-
return false;
|
|
92
|
-
};
|
|
93
|
-
var getValidationMode = function (state, action) {
|
|
94
|
-
if (action && hasValidationModeOption(action.options)) {
|
|
95
|
-
return action.options.validationMode;
|
|
96
|
-
}
|
|
97
|
-
return state.validationMode;
|
|
98
|
-
};
|
|
99
|
-
var hasValidationModeOption = function (option) {
|
|
100
|
-
if (option) {
|
|
101
|
-
return option.validationMode !== undefined;
|
|
102
|
-
}
|
|
103
|
-
return false;
|
|
104
|
-
};
|
|
105
|
-
// tslint:disable-next-line: cyclomatic-complexity
|
|
106
|
-
exports.coreReducer = function (state, action) {
|
|
107
|
-
if (state === void 0) { state = initState; }
|
|
108
|
-
switch (action.type) {
|
|
109
|
-
case actions_1.INIT: {
|
|
110
|
-
var thisAjv = getOrCreateAjv(state, action);
|
|
111
|
-
var validationMode = getValidationMode(state, action);
|
|
112
|
-
var v = validationMode === 'NoValidation' ? alwaysValid : thisAjv.compile(action.schema);
|
|
113
|
-
var e = exports.sanitizeErrors(v, action.data);
|
|
114
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { data: action.data, schema: action.schema, uischema: action.uischema, errors: e, validator: v, ajv: thisAjv, validationMode: validationMode });
|
|
115
|
-
}
|
|
116
|
-
case actions_1.UPDATE_CORE: {
|
|
117
|
-
var thisAjv = getOrCreateAjv(state, action);
|
|
118
|
-
var validationMode = getValidationMode(state, action);
|
|
119
|
-
var validator = state.validator;
|
|
120
|
-
var errors = state.errors;
|
|
121
|
-
if (state.schema !== action.schema ||
|
|
122
|
-
state.validationMode !== validationMode ||
|
|
123
|
-
state.ajv !== thisAjv) {
|
|
124
|
-
// revalidate only if necessary
|
|
125
|
-
validator =
|
|
126
|
-
validationMode === 'NoValidation'
|
|
127
|
-
? alwaysValid
|
|
128
|
-
: thisAjv.compile(action.schema);
|
|
129
|
-
errors = exports.sanitizeErrors(validator, action.data);
|
|
130
|
-
}
|
|
131
|
-
else if (state.data !== action.data) {
|
|
132
|
-
errors = exports.sanitizeErrors(validator, action.data);
|
|
133
|
-
}
|
|
134
|
-
var stateChanged = state.data !== action.data ||
|
|
135
|
-
state.schema !== action.schema ||
|
|
136
|
-
state.uischema !== action.uischema ||
|
|
137
|
-
state.ajv !== thisAjv ||
|
|
138
|
-
state.errors !== errors ||
|
|
139
|
-
state.validator !== validator ||
|
|
140
|
-
state.validationMode !== validationMode;
|
|
141
|
-
return stateChanged
|
|
142
|
-
? tslib_1.__assign(tslib_1.__assign({}, state), { data: state.data === action.data ? state.data : action.data, schema: state.schema === action.schema ? state.schema : action.schema, uischema: state.uischema === action.uischema ? state.uischema : action.uischema, ajv: thisAjv === state.ajv ? state.ajv : thisAjv, errors: isEqual_1.default(errors, state.errors) ? state.errors : errors, validator: validator === state.validator ? state.validator : validator, validationMode: validationMode === state.validationMode ? state.validationMode : validationMode }) : state;
|
|
143
|
-
}
|
|
144
|
-
case actions_1.SET_AJV: {
|
|
145
|
-
var currentAjv = action.ajv;
|
|
146
|
-
var validator = state.validationMode === 'NoValidation' ? alwaysValid : currentAjv.compile(state.schema);
|
|
147
|
-
var errors = exports.sanitizeErrors(validator, state.data);
|
|
148
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { validator: validator,
|
|
149
|
-
errors: errors });
|
|
150
|
-
}
|
|
151
|
-
case actions_1.SET_SCHEMA: {
|
|
152
|
-
var needsNewValidator = action.schema && state.ajv && state.validationMode !== 'NoValidation';
|
|
153
|
-
var v = needsNewValidator
|
|
154
|
-
? reuseAjvForSchema(state.ajv, action.schema).compile(action.schema)
|
|
155
|
-
: state.validator;
|
|
156
|
-
var errors = exports.sanitizeErrors(v, state.data);
|
|
157
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { validator: v, schema: action.schema, errors: errors });
|
|
158
|
-
}
|
|
159
|
-
case actions_1.SET_UISCHEMA: {
|
|
160
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { uischema: action.uischema });
|
|
161
|
-
}
|
|
162
|
-
case actions_1.UPDATE_DATA: {
|
|
163
|
-
if (action.path === undefined || action.path === null) {
|
|
164
|
-
return state;
|
|
165
|
-
}
|
|
166
|
-
else if (action.path === '') {
|
|
167
|
-
// empty path is ok
|
|
168
|
-
var result = action.updater(cloneDeep_1.default(state.data));
|
|
169
|
-
var errors = exports.sanitizeErrors(state.validator, result);
|
|
170
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { data: result, errors: errors });
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
var oldData = get_1.default(state.data, action.path);
|
|
174
|
-
var newData = action.updater(cloneDeep_1.default(oldData));
|
|
175
|
-
var newState = set_1.default(action.path, newData, state.data === undefined ? {} : state.data);
|
|
176
|
-
var errors = exports.sanitizeErrors(state.validator, newState);
|
|
177
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { data: newState, errors: errors });
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
case actions_1.UPDATE_ERRORS: {
|
|
181
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { errors: action.errors });
|
|
182
|
-
}
|
|
183
|
-
case actions_1.SET_VALIDATION_MODE: {
|
|
184
|
-
if (state.validationMode === action.validationMode) {
|
|
185
|
-
return state;
|
|
186
|
-
}
|
|
187
|
-
if (action.validationMode === 'NoValidation') {
|
|
188
|
-
var errors = exports.sanitizeErrors(alwaysValid, state.data);
|
|
189
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { validator: alwaysValid, errors: errors, validationMode: action.validationMode });
|
|
190
|
-
}
|
|
191
|
-
if (state.validationMode === 'NoValidation') {
|
|
192
|
-
var validator = reuseAjvForSchema(state.ajv, state.schema).compile(state.schema);
|
|
193
|
-
var errors = exports.sanitizeErrors(validator, state.data);
|
|
194
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { validator: validator,
|
|
195
|
-
errors: errors, validationMode: action.validationMode });
|
|
196
|
-
}
|
|
197
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { validationMode: action.validationMode });
|
|
198
|
-
}
|
|
199
|
-
default:
|
|
200
|
-
return state;
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
exports.extractData = function (state) { return get_1.default(state, 'data'); };
|
|
204
|
-
exports.extractSchema = function (state) { return get_1.default(state, 'schema'); };
|
|
205
|
-
exports.extractUiSchema = function (state) { return get_1.default(state, 'uischema'); };
|
|
206
|
-
exports.extractAjv = function (state) { return get_1.default(state, 'ajv'); };
|
|
207
|
-
exports.errorsAt = function (instancePath, schema, matchPath) { return function (errors) {
|
|
208
|
-
// Get data paths of oneOf and anyOf errors to later determine whether an error occurred inside a subschema of oneOf or anyOf.
|
|
209
|
-
var combinatorPaths = filter_1.default(errors, function (error) { return error.keyword === 'oneOf' || error.keyword === 'anyOf'; }).map(function (error) { return error.dataPath; });
|
|
210
|
-
return filter_1.default(errors, function (error) {
|
|
211
|
-
// Filter errors that match any keyword that we don't want to show in the UI
|
|
212
|
-
if (filteredErrorKeywords.indexOf(error.keyword) !== -1) {
|
|
213
|
-
return false;
|
|
214
|
-
}
|
|
215
|
-
var result = matchPath(error.dataPath);
|
|
216
|
-
// In anyOf and oneOf blocks with "primitive" (i.e. string, number etc.) or array subschemas,
|
|
217
|
-
// we want to make sure that errors are only shown for the correct subschema.
|
|
218
|
-
// Therefore, we compare the error's parent schema with the property's schema.
|
|
219
|
-
// In the primitive case the error's data path is the same for all subschemas:
|
|
220
|
-
// It directly points to the property defining the anyOf/oneOf.
|
|
221
|
-
// The same holds true for errors on the array level (e.g. min item amount).
|
|
222
|
-
// In contrast, this comparison must not be done for errors whose parent schema defines an object
|
|
223
|
-
// because the parent schema can never match the property schema (e.g. for 'required' checks).
|
|
224
|
-
var parentSchema = error.parentSchema;
|
|
225
|
-
if (result && !isObjectSchema(parentSchema)
|
|
226
|
-
&& combinatorPaths.findIndex(function (p) { return instancePath.startsWith(p); }) !== -1) {
|
|
227
|
-
result = result && isEqual_1.default(parentSchema, schema);
|
|
228
|
-
}
|
|
229
|
-
return result;
|
|
230
|
-
});
|
|
231
|
-
}; };
|
|
232
|
-
/**
|
|
233
|
-
* @returns true if the schema describes an object.
|
|
234
|
-
*/
|
|
235
|
-
var isObjectSchema = function (schema) {
|
|
236
|
-
return (schema === null || schema === void 0 ? void 0 : schema.type) === 'object' || !!(schema === null || schema === void 0 ? void 0 : schema.properties);
|
|
237
|
-
};
|
|
238
|
-
/**
|
|
239
|
-
* The error-type of an AJV error is defined by its `keyword` property.
|
|
240
|
-
* Certain errors are filtered because they don't fit to any rendered control.
|
|
241
|
-
* All of them have in common that we don't want to show them in the UI
|
|
242
|
-
* because controls will show the actual reason why they don't match their correponding sub schema.
|
|
243
|
-
* - additionalProperties: Indicates that a property is present that is not defined in the schema.
|
|
244
|
-
* Jsonforms only allows to edit defined properties. These errors occur if an oneOf doesn't match.
|
|
245
|
-
* - allOf: Indicates that not all of the allOf definitions match as a whole.
|
|
246
|
-
* - anyOf: Indicates that an anyOf definition itself is not valid because none of its subschemas matches.
|
|
247
|
-
* - oneOf: Indicates that an oneOf definition itself is not valid because not exactly one of its subschemas matches.
|
|
248
|
-
*/
|
|
249
|
-
var filteredErrorKeywords = ['additionalProperties', 'allOf', 'anyOf', 'oneOf'];
|
|
250
|
-
var getErrorsAt = function (instancePath, schema, matchPath) { return function (state) {
|
|
251
|
-
return exports.errorsAt(instancePath, schema, matchPath)(state.validationMode === 'ValidateAndHide' ? [] : state.errors);
|
|
252
|
-
}; };
|
|
253
|
-
exports.errorAt = function (instancePath, schema) {
|
|
254
|
-
return getErrorsAt(instancePath, schema, function (path) { return path === instancePath; });
|
|
255
|
-
};
|
|
256
|
-
exports.subErrorsAt = function (instancePath, schema) {
|
|
257
|
-
return getErrorsAt(instancePath, schema, function (path) { return path.startsWith(instancePath); });
|
|
258
|
-
};
|
|
259
|
-
//# sourceMappingURL=core.js.map
|
package/lib/reducers/core.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/reducers/core.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,uEAAyC;AACzC,8DAAkC;AAClC,2DAA6B;AAC7B,iEAAmC;AACnC,mEAAqC;AACrC,yEAA2C;AAE3C,sCAaoB;AACpB,gCAA6C;AAG7C,IAAM,QAAQ,GAAG,UAAC,SAA2B,EAAE,IAAS;IACtD,IAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,KAAK,EAAE;QACT,OAAO,EAAE,CAAC;KACX;IAED,OAAO,SAAS,CAAC,MAAM,CAAC;AAC1B,CAAC,CAAC;AAEW,QAAA,cAAc,GAAG,UAAC,SAA2B,EAAE,IAAS;IACnE,IAAI,SAAS,KAAK,WAAW,EAAE;QAC7B,OAAO,EAAE,CAAC;KACX;IACD,OAAO,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,UAAA,KAAK;QACxC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAE9D,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAA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,OAAA,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAA7B,CAA6B,CAAC;AAAxE,CAAwE,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
The MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2017-2019 EclipseSource Munich
|
|
6
|
-
https://github.com/eclipsesource/jsonforms
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
var actions_1 = require("../actions");
|
|
28
|
-
exports.defaultDataReducer = function (state, action) {
|
|
29
|
-
if (state === void 0) { state = []; }
|
|
30
|
-
switch (action.type) {
|
|
31
|
-
case actions_1.ADD_DEFAULT_DATA:
|
|
32
|
-
return state.concat([
|
|
33
|
-
{ schemaPath: action.schemaPath, data: action.data }
|
|
34
|
-
]);
|
|
35
|
-
case actions_1.REMOVE_DEFAULT_DATA:
|
|
36
|
-
return state.filter(function (t) { return t.schemaPath !== action.schemaPath; });
|
|
37
|
-
default:
|
|
38
|
-
return state;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
exports.extractDefaultData = function (state) { return state; };
|
|
42
|
-
//# sourceMappingURL=default-data.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-data.js","sourceRoot":"","sources":["../../src/reducers/default-data.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;AAEF,sCAKoB;AAYP,QAAA,kBAAkB,GAA0E,UACvG,KAAU,EACV,MAAM;IADN,sBAAA,EAAA,UAAU;IAGV,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,0BAAgB;YACnB,OAAO,KAAK,CAAC,MAAM,CAAC;gBAClB,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE;aACrD,CAAC,CAAC;QACL,KAAK,6BAAmB;YACtB,OAAO,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,UAAU,EAAlC,CAAkC,CAAC,CAAC;QAC/D;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC,CAAC;AAEW,QAAA,kBAAkB,GAAG,UAChC,KAA0C,IACF,OAAA,KAAK,EAAL,CAAK,CAAC"}
|
package/lib/reducers/i18n.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
The MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2017-2019 EclipseSource Munich
|
|
6
|
-
https://github.com/eclipsesource/jsonforms
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
var tslib_1 = require("tslib");
|
|
28
|
-
var actions_1 = require("../actions");
|
|
29
|
-
var initState = {
|
|
30
|
-
locale: undefined,
|
|
31
|
-
localizedSchemas: new Map(),
|
|
32
|
-
localizedUISchemas: new Map()
|
|
33
|
-
};
|
|
34
|
-
exports.i18nReducer = function (state, action) {
|
|
35
|
-
if (state === void 0) { state = initState; }
|
|
36
|
-
switch (action.type) {
|
|
37
|
-
case actions_1.SET_LOCALIZED_SCHEMAS:
|
|
38
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { localizedSchemas: action.localizedSchemas });
|
|
39
|
-
case actions_1.SET_LOCALIZED_UISCHEMAS:
|
|
40
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { localizedUISchemas: action.localizedUISchemas });
|
|
41
|
-
case actions_1.SET_LOCALE:
|
|
42
|
-
return tslib_1.__assign(tslib_1.__assign({}, state), { locale: action.locale === undefined ? navigator.languages[0] : action.locale });
|
|
43
|
-
default:
|
|
44
|
-
return state;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
exports.fetchLocale = function (state) {
|
|
48
|
-
if (state === undefined) {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
return state.locale;
|
|
52
|
-
};
|
|
53
|
-
exports.findLocalizedSchema = function (locale) { return function (state) {
|
|
54
|
-
if (state === undefined) {
|
|
55
|
-
return undefined;
|
|
56
|
-
}
|
|
57
|
-
return state.localizedSchemas.get(locale);
|
|
58
|
-
}; };
|
|
59
|
-
exports.findLocalizedUISchema = function (locale) { return function (state) {
|
|
60
|
-
if (state === undefined) {
|
|
61
|
-
return undefined;
|
|
62
|
-
}
|
|
63
|
-
return state.localizedUISchemas.get(locale);
|
|
64
|
-
}; };
|
|
65
|
-
//# sourceMappingURL=i18n.js.map
|
package/lib/reducers/i18n.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/reducers/i18n.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,sCAAwF;AAUxF,IAAM,SAAS,GAAyB;IACtC,MAAM,EAAE,SAAS;IACjB,gBAAgB,EAAE,IAAI,GAAG,EAAE;IAC3B,kBAAkB,EAAE,IAAI,GAAG,EAAE;CAC9B,CAAC;AAEW,QAAA,WAAW,GAAsB,UAAC,KAAiB,EAAE,MAAM;IAAzB,sBAAA,EAAA,iBAAiB;IAC9D,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,+BAAqB;YACxB,6CACK,KAAK,KACR,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,IACzC;QACJ,KAAK,iCAAuB;YAC1B,6CACK,KAAK,KACR,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,IAC7C;QACJ,KAAK,oBAAU;YACb,6CACK,KAAK,KACR,MAAM,EACJ,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,IACtE;QACJ;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC,CAAC;AAEW,QAAA,WAAW,GAAG,UAAC,KAA4B;IACtD,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,KAAK,CAAC,MAAM,CAAC;AACtB,CAAC,CAAC;AAEW,QAAA,mBAAmB,GAAG,UAAC,MAAc,IAAK,OAAA,UACrD,KAA4B;IAE5B,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC,EAPsD,CAOtD,CAAC;AAEW,QAAA,qBAAqB,GAAG,UAAC,MAAc,IAAK,OAAA,UACvD,KAA4B;IAE5B,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC,EAPwD,CAOxD,CAAC"}
|
package/lib/reducers/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
The MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2017-2019 EclipseSource Munich
|
|
6
|
-
https://github.com/eclipsesource/jsonforms
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
var tslib_1 = require("tslib");
|
|
28
|
-
tslib_1.__exportStar(require("./cells"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./config"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./core"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./default-data"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./i18n"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./reducers"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./renderers"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("./selectors"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("./uischemas"), exports);
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reducers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,kDAAwB;AACxB,mDAAyB;AACzB,iDAAuB;AACvB,yDAA+B;AAC/B,iDAAuB;AACvB,qDAA2B;AAC3B,sDAA4B;AAC5B,sDAA4B;AAC5B,sDAA4B"}
|
package/lib/reducers/reducers.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
The MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2017-2019 EclipseSource Munich
|
|
6
|
-
https://github.com/eclipsesource/jsonforms
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
var tslib_1 = require("tslib");
|
|
28
|
-
var core_1 = require("./core");
|
|
29
|
-
exports.coreReducer = core_1.coreReducer;
|
|
30
|
-
exports.errorsAt = core_1.errorsAt;
|
|
31
|
-
var default_data_1 = require("./default-data");
|
|
32
|
-
var renderers_1 = require("./renderers");
|
|
33
|
-
exports.rendererReducer = renderers_1.rendererReducer;
|
|
34
|
-
var uischemas_1 = require("./uischemas");
|
|
35
|
-
exports.findMatchingUISchema = uischemas_1.findMatchingUISchema;
|
|
36
|
-
exports.uischemaRegistryReducer = uischemas_1.uischemaRegistryReducer;
|
|
37
|
-
var i18n_1 = require("./i18n");
|
|
38
|
-
exports.i18nReducer = i18n_1.i18nReducer;
|
|
39
|
-
var generators_1 = require("../generators");
|
|
40
|
-
var cells_1 = require("./cells");
|
|
41
|
-
exports.cellReducer = cells_1.cellReducer;
|
|
42
|
-
var config_1 = require("./config");
|
|
43
|
-
exports.configReducer = config_1.configReducer;
|
|
44
|
-
var get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
45
|
-
exports.jsonFormsReducerConfig = {
|
|
46
|
-
core: core_1.coreReducer,
|
|
47
|
-
renderers: renderers_1.rendererReducer,
|
|
48
|
-
cells: cells_1.cellReducer,
|
|
49
|
-
config: config_1.configReducer,
|
|
50
|
-
uischemas: uischemas_1.uischemaRegistryReducer,
|
|
51
|
-
defaultData: default_data_1.defaultDataReducer,
|
|
52
|
-
i18n: i18n_1.i18nReducer
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Finds a registered UI schema to use, if any.
|
|
56
|
-
* @param schema the JSON schema describing the data to be rendered
|
|
57
|
-
* @param schemaPath the according schema path
|
|
58
|
-
* @param path the instance path
|
|
59
|
-
* @param fallbackLayoutType the type of the layout to use
|
|
60
|
-
* @param control may be checked for embedded inline uischema options
|
|
61
|
-
*/
|
|
62
|
-
exports.findUISchema = function (uischemas, schema, schemaPath, path, fallbackLayoutType, control, rootSchema) {
|
|
63
|
-
if (fallbackLayoutType === void 0) { fallbackLayoutType = 'VerticalLayout'; }
|
|
64
|
-
// handle options
|
|
65
|
-
if (control && control.options && control.options.detail) {
|
|
66
|
-
if (typeof control.options.detail === 'string') {
|
|
67
|
-
if (control.options.detail.toUpperCase() === 'GENERATE') {
|
|
68
|
-
// force generation of uischema
|
|
69
|
-
return generators_1.Generate.uiSchema(schema, fallbackLayoutType);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
else if (typeof control.options.detail === 'object') {
|
|
73
|
-
// check if detail is a valid uischema
|
|
74
|
-
if (control.options.detail.type &&
|
|
75
|
-
typeof control.options.detail.type === 'string') {
|
|
76
|
-
return control.options.detail;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
// default
|
|
81
|
-
var uiSchema = uischemas_1.findMatchingUISchema(uischemas)(schema, schemaPath, path);
|
|
82
|
-
if (uiSchema === undefined) {
|
|
83
|
-
return generators_1.Generate.uiSchema(schema, fallbackLayoutType, '#', rootSchema);
|
|
84
|
-
}
|
|
85
|
-
return uiSchema;
|
|
86
|
-
};
|
|
87
|
-
exports.getErrorAt = function (instancePath, schema) { return function (state) {
|
|
88
|
-
return core_1.errorAt(instancePath, schema)(state.jsonforms.core);
|
|
89
|
-
}; };
|
|
90
|
-
exports.getSubErrorsAt = function (instancePath, schema) { return function (state) { return core_1.subErrorsAt(instancePath, schema)(state.jsonforms.core); }; };
|
|
91
|
-
exports.getConfig = function (state) { return state.jsonforms.config; };
|
|
92
|
-
exports.getLocale = function (state) {
|
|
93
|
-
return i18n_1.fetchLocale(get_1.default(state, 'jsonforms.i18n'));
|
|
94
|
-
};
|
|
95
|
-
exports.getLocalizedSchema = function (locale) { return function (state) { return i18n_1.findLocalizedSchema(locale)(get_1.default(state, 'jsonforms.i18n')); }; };
|
|
96
|
-
exports.getLocalizedUISchema = function (locale) { return function (state) {
|
|
97
|
-
return i18n_1.findLocalizedUISchema(locale)(get_1.default(state, 'jsonforms.i18n'));
|
|
98
|
-
}; };
|
|
99
|
-
//# sourceMappingURL=reducers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reducers.js","sourceRoot":"","sources":["../../src/reducers/reducers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAGF,+BAOgB;AA2Bd,sBAjCA,kBAAW,CAiCA;AAoEJ,mBAnGP,eAAQ,CAmGO;AA9FjB,+CAAoD;AACpD,yCAA8C;AAuB5C,0BAvBO,2BAAe,CAuBP;AArBjB,yCAKqB;AAuBnB,+BA3BA,gCAAoB,CA2BA;AADpB,kCAxBA,mCAAuB,CAwBA;AArBzB,+BAKgB;AAad,sBAdA,kBAAW,CAcA;AAXb,4CAAyC;AAGzC,iCAAsC;AAMpC,sBANO,mBAAW,CAMP;AALb,mCAAyC;AAQvC,wBARO,sBAAa,CAQP;AAPf,2DAA6B;AAehB,QAAA,sBAAsB,GAAG;IACpC,IAAI,EAAE,kBAAW;IACjB,SAAS,EAAE,2BAAe;IAC1B,KAAK,EAAE,mBAAW;IAClB,MAAM,EAAE,sBAAa;IACrB,SAAS,EAAE,mCAAuB;IAClC,WAAW,EAAE,iCAAkB;IAC/B,IAAI,EAAE,kBAAW;CAClB,CAAC;AAEF;;;;;;;GAOG;AACU,QAAA,YAAY,GAAG,UAC1B,SAA2C,EAC3C,MAAkB,EAClB,UAAkB,EAClB,IAAY,EACZ,kBAAqC,EACrC,OAAwB,EACxB,UAAuB;IAFvB,mCAAA,EAAA,qCAAqC;IAIrC,iBAAiB;IACjB,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE;QACxD,IAAI,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,QAAQ,EAAE;YAC9C,IAAI,OAAO,CAAC,OAAO,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E9D,QAAA,SAAS,GAAG,UAAC,KAAqB;IAC7C,OAAA,kBAAW,CAAC,aAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;AAAzC,CAAyC,CAAC;AAE/B,QAAA,kBAAkB,GAAG,UAAC,MAAc,IAAK,OAAA,UACpD,KAAqB,IACN,OAAA,0BAAmB,CAAC,MAAM,CAAC,CAAC,aAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,EAAzD,CAAyD,EAFpB,CAEoB,CAAC;AAE9D,QAAA,oBAAoB,GAAG,UAAC,MAAc,IAAK,OAAA,UACtD,KAAqB;IAErB,OAAA,4BAAqB,CAAC,MAAM,CAAC,CAAC,aAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;AAA3D,CAA2D,EAHL,CAGK,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
The MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2017-2019 EclipseSource Munich
|
|
6
|
-
https://github.com/eclipsesource/jsonforms
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
var actions_1 = require("../actions");
|
|
28
|
-
exports.rendererReducer = function (state, action) {
|
|
29
|
-
if (state === void 0) { state = []; }
|
|
30
|
-
switch (action.type) {
|
|
31
|
-
case actions_1.ADD_RENDERER:
|
|
32
|
-
return state.concat([
|
|
33
|
-
{ tester: action.tester, renderer: action.renderer }
|
|
34
|
-
]);
|
|
35
|
-
case actions_1.REMOVE_RENDERER:
|
|
36
|
-
return state.filter(function (t) { return t.tester !== action.tester; });
|
|
37
|
-
default:
|
|
38
|
-
return state;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=renderers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderers.js","sourceRoot":"","sources":["../../src/reducers/renderers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;AAGF,sCAKoB;AAUP,QAAA,eAAe,GAA2E,UACrG,KAAU,EACV,MAAM;IADN,sBAAA,EAAA,UAAU;IAGV,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,sBAAY;YACf,OAAO,KAAK,CAAC,MAAM,CAAC;gBAClB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE;aACrD,CAAC,CAAC;QACL,KAAK,yBAAe;YAClB,OAAO,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAA1B,CAA0B,CAAC,CAAC;QACvD;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
The MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2017-2019 EclipseSource Munich
|
|
6
|
-
https://github.com/eclipsesource/jsonforms
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
var tslib_1 = require("tslib");
|
|
28
|
-
var get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
29
|
-
var core_1 = require("./core");
|
|
30
|
-
var default_data_1 = require("./default-data");
|
|
31
|
-
exports.getData = function (state) {
|
|
32
|
-
return core_1.extractData(get_1.default(state, 'jsonforms.core'));
|
|
33
|
-
};
|
|
34
|
-
exports.getSchema = function (state) {
|
|
35
|
-
return core_1.extractSchema(get_1.default(state, 'jsonforms.core'));
|
|
36
|
-
};
|
|
37
|
-
exports.getUiSchema = function (state) {
|
|
38
|
-
return core_1.extractUiSchema(get_1.default(state, 'jsonforms.core'));
|
|
39
|
-
};
|
|
40
|
-
exports.getAjv = function (state) { return core_1.extractAjv(get_1.default(state, 'jsonforms.core')); };
|
|
41
|
-
exports.getDefaultData = function (state) {
|
|
42
|
-
return default_data_1.extractDefaultData(get_1.default(state, 'jsonforms.defaultData'));
|
|
43
|
-
};
|
|
44
|
-
exports.getRenderers = function (state) { return get_1.default(state, 'jsonforms.renderers'); };
|
|
45
|
-
exports.getCells = function (state) { return get_1.default(state, 'jsonforms.cells'); };
|
|
46
|
-
exports.getUISchemas = function (state) { return get_1.default(state, 'jsonforms.uischemas'); };
|
|
47
|
-
//# sourceMappingURL=selectors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../src/reducers/selectors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,2DAA6B;AAI7B,+BAKgB;AAChB,+CAGwB;AAKX,QAAA,OAAO,GAAG,UAAC,KAAqB;IAC3C,OAAA,kBAAW,CAAC,aAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;AAAzC,CAAyC,CAAC;AAC/B,QAAA,SAAS,GAAG,UAAC,KAAqB;IAC7C,OAAA,oBAAa,CAAC,aAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;AAA3C,CAA2C,CAAC;AACjC,QAAA,WAAW,GAAG,UAAC,KAAqB;IAC/C,OAAA,sBAAe,CAAC,aAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;AAA7C,CAA6C,CAAC;AACnC,QAAA,MAAM,GAAG,UACpB,KAAqB,IACb,OAAA,iBAAU,CAAC,aAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,EAAxC,CAAwC,CAAC;AACtC,QAAA,cAAc,GAAG,UAC5B,KAAqB;IAErB,OAAA,iCAAkB,CAAC,aAAG,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;AAAvD,CAAuD,CAAC;AAC7C,QAAA,YAAY,GAAG,UAC1B,KAAqB,IACgB,OAAA,aAAG,CAAC,KAAK,EAAE,qBAAqB,CAAC,EAAjC,CAAiC,CAAC;AAC5D,QAAA,QAAQ,GAAG,UACtB,KAAqB,IACoB,OAAA,aAAG,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAA7B,CAA6B,CAAC;AAC5D,QAAA,YAAY,GAAG,UAC1B,KAAqB,IACgB,OAAA,aAAG,CAAC,KAAK,EAAE,qBAAqB,CAAC,EAAjC,CAAiC,CAAA"}
|