@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/util/runtime.js
DELETED
|
@@ -1,159 +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 has_1 = tslib_1.__importDefault(require("lodash/has"));
|
|
29
|
-
var models_1 = require("../models");
|
|
30
|
-
var resolvers_1 = require("./resolvers");
|
|
31
|
-
var path_1 = require("./path");
|
|
32
|
-
var reducers_1 = require("../reducers");
|
|
33
|
-
var isOrCondition = function (condition) {
|
|
34
|
-
return condition.type === 'OR';
|
|
35
|
-
};
|
|
36
|
-
var isAndCondition = function (condition) {
|
|
37
|
-
return condition.type === 'AND';
|
|
38
|
-
};
|
|
39
|
-
var isLeafCondition = function (condition) {
|
|
40
|
-
return condition.type === 'LEAF';
|
|
41
|
-
};
|
|
42
|
-
var isSchemaCondition = function (condition) { return has_1.default(condition, 'schema'); };
|
|
43
|
-
var getConditionScope = function (condition, path) {
|
|
44
|
-
return path_1.composeWithUi(condition, path);
|
|
45
|
-
};
|
|
46
|
-
var evaluateCondition = function (data, condition, path, ajv) {
|
|
47
|
-
if (isAndCondition(condition)) {
|
|
48
|
-
return condition.conditions.reduce(function (acc, cur) { return acc && evaluateCondition(data, cur, path, ajv); }, true);
|
|
49
|
-
}
|
|
50
|
-
else if (isOrCondition(condition)) {
|
|
51
|
-
return condition.conditions.reduce(function (acc, cur) { return acc || evaluateCondition(data, cur, path, ajv); }, false);
|
|
52
|
-
}
|
|
53
|
-
else if (isLeafCondition(condition)) {
|
|
54
|
-
var value = resolvers_1.resolveData(data, getConditionScope(condition, path));
|
|
55
|
-
return value === condition.expectedValue;
|
|
56
|
-
}
|
|
57
|
-
else if (isSchemaCondition(condition)) {
|
|
58
|
-
var value = resolvers_1.resolveData(data, getConditionScope(condition, path));
|
|
59
|
-
return ajv.validate(condition.schema, value);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
// unknown condition
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var isRuleFulfilled = function (uischema, data, path, ajv) {
|
|
67
|
-
var condition = uischema.rule.condition;
|
|
68
|
-
return evaluateCondition(data, condition, path, ajv);
|
|
69
|
-
};
|
|
70
|
-
exports.evalVisibility = function (uischema, data, path, ajv) {
|
|
71
|
-
if (path === void 0) { path = undefined; }
|
|
72
|
-
var fulfilled = isRuleFulfilled(uischema, data, path, ajv);
|
|
73
|
-
switch (uischema.rule.effect) {
|
|
74
|
-
case models_1.RuleEffect.HIDE:
|
|
75
|
-
return !fulfilled;
|
|
76
|
-
case models_1.RuleEffect.SHOW:
|
|
77
|
-
return fulfilled;
|
|
78
|
-
// visible by default
|
|
79
|
-
default:
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
exports.evalEnablement = function (uischema, data, path, ajv) {
|
|
84
|
-
if (path === void 0) { path = undefined; }
|
|
85
|
-
var fulfilled = isRuleFulfilled(uischema, data, path, ajv);
|
|
86
|
-
switch (uischema.rule.effect) {
|
|
87
|
-
case models_1.RuleEffect.DISABLE:
|
|
88
|
-
return !fulfilled;
|
|
89
|
-
case models_1.RuleEffect.ENABLE:
|
|
90
|
-
return fulfilled;
|
|
91
|
-
// enabled by default
|
|
92
|
-
default:
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
exports.hasShowRule = function (uischema) {
|
|
97
|
-
if (uischema.rule &&
|
|
98
|
-
(uischema.rule.effect === models_1.RuleEffect.SHOW ||
|
|
99
|
-
uischema.rule.effect === models_1.RuleEffect.HIDE)) {
|
|
100
|
-
return true;
|
|
101
|
-
}
|
|
102
|
-
return false;
|
|
103
|
-
};
|
|
104
|
-
exports.hasEnableRule = function (uischema) {
|
|
105
|
-
if (uischema.rule &&
|
|
106
|
-
(uischema.rule.effect === models_1.RuleEffect.ENABLE ||
|
|
107
|
-
uischema.rule.effect === models_1.RuleEffect.DISABLE)) {
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
return false;
|
|
111
|
-
};
|
|
112
|
-
exports.isVisible = function (uischema, data, path, ajv) {
|
|
113
|
-
if (path === void 0) { path = undefined; }
|
|
114
|
-
if (uischema.rule) {
|
|
115
|
-
return exports.evalVisibility(uischema, data, path, ajv);
|
|
116
|
-
}
|
|
117
|
-
return true;
|
|
118
|
-
};
|
|
119
|
-
exports.isEnabled = function (uischema, data, path, ajv) {
|
|
120
|
-
if (path === void 0) { path = undefined; }
|
|
121
|
-
if (uischema.rule) {
|
|
122
|
-
return exports.evalEnablement(uischema, data, path, ajv);
|
|
123
|
-
}
|
|
124
|
-
return true;
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* Indicates whether the given `uischema` element shall be enabled or disabled.
|
|
128
|
-
* Checks the global readonly flag, uischema rule, uischema options (including the config),
|
|
129
|
-
* the schema and the enablement indicator of the parent.
|
|
130
|
-
*/
|
|
131
|
-
exports.isInherentlyEnabled = function (state, ownProps, uischema, schema, rootData, config) {
|
|
132
|
-
var _a, _b, _c;
|
|
133
|
-
if ((_a = state === null || state === void 0 ? void 0 : state.jsonforms) === null || _a === void 0 ? void 0 : _a.readonly) {
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
if (uischema && exports.hasEnableRule(uischema)) {
|
|
137
|
-
return exports.isEnabled(uischema, rootData, ownProps === null || ownProps === void 0 ? void 0 : ownProps.path, reducers_1.getAjv(state));
|
|
138
|
-
}
|
|
139
|
-
if (typeof ((_b = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _b === void 0 ? void 0 : _b.readonly) === 'boolean') {
|
|
140
|
-
return !uischema.options.readonly;
|
|
141
|
-
}
|
|
142
|
-
if (typeof ((_c = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _c === void 0 ? void 0 : _c.readOnly) === 'boolean') {
|
|
143
|
-
return !uischema.options.readOnly;
|
|
144
|
-
}
|
|
145
|
-
if (typeof (config === null || config === void 0 ? void 0 : config.readonly) === 'boolean') {
|
|
146
|
-
return !config.readonly;
|
|
147
|
-
}
|
|
148
|
-
if (typeof (config === null || config === void 0 ? void 0 : config.readOnly) === 'boolean') {
|
|
149
|
-
return !config.readOnly;
|
|
150
|
-
}
|
|
151
|
-
if ((schema === null || schema === void 0 ? void 0 : schema.readOnly) === true) {
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
if (typeof (ownProps === null || ownProps === void 0 ? void 0 : ownProps.enabled) === 'boolean') {
|
|
155
|
-
return ownProps.enabled;
|
|
156
|
-
}
|
|
157
|
-
return true;
|
|
158
|
-
};
|
|
159
|
-
//# sourceMappingURL=runtime.js.map
|
package/lib/util/runtime.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/util/runtime.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,2DAA6B;AAC7B,oCASmB;AACnB,yCAA0C;AAC1C,+BAAuC;AAEvC,wCAAqC;AAIrC,IAAM,aAAa,GAAG,UAAC,SAAoB;IACzC,OAAA,SAAS,CAAC,IAAI,KAAK,IAAI;AAAvB,CAAuB,CAAC;AAE1B,IAAM,cAAc,GAAG,UAAC,SAAoB;IAC1C,OAAA,SAAS,CAAC,IAAI,KAAK,KAAK;AAAxB,CAAwB,CAAC;AAE3B,IAAM,eAAe,GAAG,UAAC,SAAoB;IAC3C,OAAA,SAAS,CAAC,IAAI,KAAK,MAAM;AAAzB,CAAyB,CAAC;AAE5B,IAAM,iBAAiB,GAAG,UACxB,SAAoB,IACkB,OAAA,aAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAxB,CAAwB,CAAC;AAEjE,IAAM,iBAAiB,GAAG,UAAC,SAAmB,EAAE,IAAY;IAC1D,OAAO,oBAAa,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,IAAM,iBAAiB,GAAG,UACxB,IAAS,EACT,SAAoB,EACpB,IAAY,EACZ,GAAQ;IAER,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC7B,OAAO,SAAS,CAAC,UAAU,CAA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Q,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,0CAAE,QAAQ,CAAA,KAAK,SAAS,EAAE;QACpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;KACnC;IACD,IAAI,QAAO,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAA,KAAK,SAAS,EAAE;QACzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;KACzB;IACD,IAAI,QAAO,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAA,KAAK,SAAS,EAAE;QACzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;KACzB;IACD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,MAAK,IAAI,EAAE;QAC7B,OAAO,KAAK,CAAC;KACd;IACD,IAAI,QAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,CAAA,KAAK,SAAS,EAAE;QAC1C,OAAO,QAAQ,CAAC,OAAO,CAAC;KACzB;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
package/lib/util/schema.js
DELETED
|
@@ -1,40 +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 find_1 = tslib_1.__importDefault(require("lodash/find"));
|
|
29
|
-
exports.getFirstPrimitiveProp = function (schema) {
|
|
30
|
-
if (schema.properties) {
|
|
31
|
-
return find_1.default(Object.keys(schema.properties), function (propName) {
|
|
32
|
-
var prop = schema.properties[propName];
|
|
33
|
-
return (prop.type === 'string' ||
|
|
34
|
-
prop.type === 'number' ||
|
|
35
|
-
prop.type === 'integer');
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return undefined;
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=schema.js.map
|
package/lib/util/schema.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/util/schema.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,6DAA+B;AAElB,QAAA,qBAAqB,GAAG,UAAC,MAAW;IAC/C,IAAI,MAAM,CAAC,UAAU,EAAE;QACrB,OAAO,cAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,UAAA,QAAQ;YAClD,IAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YACzC,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,QAAQ;gBACtB,IAAI,CAAC,IAAI,KAAK,QAAQ;gBACtB,IAAI,CAAC,IAAI,KAAK,SAAS,CACxB,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
|
package/lib/util/type.js
DELETED
|
@@ -1,27 +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
|
-
//# sourceMappingURL=type.js.map
|
package/lib/util/type.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/util/type.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE"}
|
package/lib/util/uischema.js
DELETED
|
@@ -1,52 +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 isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
29
|
-
var models_1 = require("../models");
|
|
30
|
-
var setReadonlyPropertyValue = function (value) { return function (child) {
|
|
31
|
-
if (!child.options) {
|
|
32
|
-
child.options = {};
|
|
33
|
-
}
|
|
34
|
-
child.options.readonly = value;
|
|
35
|
-
}; };
|
|
36
|
-
exports.setReadonly = function (uischema) {
|
|
37
|
-
exports.iterateSchema(uischema, setReadonlyPropertyValue(true));
|
|
38
|
-
};
|
|
39
|
-
exports.unsetReadonly = function (uischema) {
|
|
40
|
-
exports.iterateSchema(uischema, setReadonlyPropertyValue(false));
|
|
41
|
-
};
|
|
42
|
-
exports.iterateSchema = function (uischema, toApply) {
|
|
43
|
-
if (isEmpty_1.default(uischema)) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (models_1.isLayout(uischema)) {
|
|
47
|
-
uischema.elements.forEach(function (child) { return exports.iterateSchema(child, toApply); });
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
toApply(uischema);
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=uischema.js.map
|
package/lib/util/uischema.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uischema.js","sourceRoot":"","sources":["../../src/util/uischema.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,mEAAqC;AACrC,oCAAsD;AAItD,IAAM,wBAAwB,GAAG,UAAC,KAAc,IAAsB,OAAA,UACpE,KAAsB;IAEtB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;QAClB,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;KACpB;IACD,KAAK,CAAC,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC;AACjC,CAAC,EAPqE,CAOrE,CAAC;AACW,QAAA,WAAW,GAAG,UAAC,QAAyB;IACnD,qBAAa,CAAC,QAAQ,EAAE,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1D,CAAC,CAAC;AACW,QAAA,aAAa,GAAG,UAAC,QAAyB;IACrD,qBAAa,CAAC,QAAQ,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3D,CAAC,CAAC;AACW,QAAA,aAAa,GAAG,UAC3B,QAAyB,EACzB,OAAwB;IAExB,IAAI,iBAAO,CAAC,QAAQ,CAAC,EAAE;QACrB,OAAO;KACR;IACD,IAAI,iBAAQ,CAAC,QAAQ,CAAC,EAAE;QACtB,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,KAAK,IAAI,OAAA,qBAAa,CAAC,KAAK,EAAE,OAAO,CAAC,EAA7B,CAA6B,CAAC,CAAC;QAClE,OAAO;KACR;IACD,OAAO,CAAC,QAAQ,CAAC,CAAC;AACpB,CAAC,CAAC"}
|
package/lib/util/util.js
DELETED
|
@@ -1,107 +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 isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
29
|
-
var isArray_1 = tslib_1.__importDefault(require("lodash/isArray"));
|
|
30
|
-
var includes_1 = tslib_1.__importDefault(require("lodash/includes"));
|
|
31
|
-
var find_1 = tslib_1.__importDefault(require("lodash/find"));
|
|
32
|
-
var resolvers_1 = require("./resolvers");
|
|
33
|
-
var path_1 = require("./path");
|
|
34
|
-
var runtime_1 = require("./runtime");
|
|
35
|
-
/**
|
|
36
|
-
* Escape the given string such that it can be used as a class name,
|
|
37
|
-
* i.e. hashes and slashes will be replaced.
|
|
38
|
-
*
|
|
39
|
-
* @param {string} s the string that should be converted to a valid class name
|
|
40
|
-
* @returns {string} the escaped string
|
|
41
|
-
*/
|
|
42
|
-
exports.convertToValidClassName = function (s) {
|
|
43
|
-
return s.replace('#', 'root').replace(new RegExp('/', 'g'), '_');
|
|
44
|
-
};
|
|
45
|
-
exports.formatErrorMessage = function (errors) {
|
|
46
|
-
if (errors === undefined || errors === null) {
|
|
47
|
-
return '';
|
|
48
|
-
}
|
|
49
|
-
return errors.join('\n');
|
|
50
|
-
};
|
|
51
|
-
exports.hasType = function (jsonSchema, expected) {
|
|
52
|
-
return includes_1.default(exports.deriveTypes(jsonSchema), expected);
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Derives the type of the jsonSchema element
|
|
56
|
-
*/
|
|
57
|
-
exports.deriveTypes = function (jsonSchema) {
|
|
58
|
-
if (isEmpty_1.default(jsonSchema)) {
|
|
59
|
-
return [];
|
|
60
|
-
}
|
|
61
|
-
if (!isEmpty_1.default(jsonSchema.type) && typeof jsonSchema.type === 'string') {
|
|
62
|
-
return [jsonSchema.type];
|
|
63
|
-
}
|
|
64
|
-
if (isArray_1.default(jsonSchema.type)) {
|
|
65
|
-
return jsonSchema.type;
|
|
66
|
-
}
|
|
67
|
-
if (!isEmpty_1.default(jsonSchema.properties) ||
|
|
68
|
-
!isEmpty_1.default(jsonSchema.additionalProperties)) {
|
|
69
|
-
return ['object'];
|
|
70
|
-
}
|
|
71
|
-
if (!isEmpty_1.default(jsonSchema.items)) {
|
|
72
|
-
return ['array'];
|
|
73
|
-
}
|
|
74
|
-
if (!isEmpty_1.default(jsonSchema.allOf)) {
|
|
75
|
-
var allOfType = find_1.default(jsonSchema.allOf, function (schema) { return exports.deriveTypes(schema).length !== 0; });
|
|
76
|
-
if (allOfType) {
|
|
77
|
-
return exports.deriveTypes(allOfType);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
// ignore all remaining cases
|
|
81
|
-
return [];
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Convenience wrapper around resolveData and resolveSchema.
|
|
85
|
-
*/
|
|
86
|
-
exports.Resolve = {
|
|
87
|
-
schema: resolvers_1.resolveSchema,
|
|
88
|
-
data: resolvers_1.resolveData
|
|
89
|
-
};
|
|
90
|
-
// Paths --
|
|
91
|
-
var fromScopable = function (scopable) {
|
|
92
|
-
return path_1.toDataPathSegments(scopable.scope).join('.');
|
|
93
|
-
};
|
|
94
|
-
exports.Paths = {
|
|
95
|
-
compose: path_1.composePaths,
|
|
96
|
-
fromScopable: fromScopable
|
|
97
|
-
};
|
|
98
|
-
// Runtime --
|
|
99
|
-
exports.Runtime = {
|
|
100
|
-
isEnabled: function (uischema, data, ajv) {
|
|
101
|
-
return runtime_1.isEnabled(uischema, data, undefined, ajv);
|
|
102
|
-
},
|
|
103
|
-
isVisible: function (uischema, data, ajv) {
|
|
104
|
-
return runtime_1.isVisible(uischema, data, undefined, ajv);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
//# sourceMappingURL=util.js.map
|
package/lib/util/util.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,mEAAqC;AACrC,mEAAqC;AACrC,qEAAuC;AACvC,6DAA+B;AAE/B,yCAAyD;AACzD,+BAA0D;AAC1D,qCAAiD;AAGjD;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,UAAC,CAAS;IACjD,OAAA,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC;AAAzD,CAAyD,CAAC;AAE7C,QAAA,kBAAkB,GAAG,UAAC,MAAgB;IAClD,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI,EAAE;QAC3C,OAAO,EAAE,CAAC;KACX;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEW,QAAA,OAAO,GAAG,UAAC,UAAsB,EAAE,QAAgB;IAC/D,OAAO,kBAAQ,CAAC,mBAAW,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF;;EAEE;AACW,QAAA,WAAW,GAAG,UAAC,UAAsB;IACjD,IAAI,iBAAO,CAAC,UAAU,CAAC,EAA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AEF,aAAa;AACA,QAAA,OAAO,GAAG;IACtB,SAAS,EAAT,UAAU,QAAyB,EAAE,IAAS,EAAE,GAAQ;QACtD,OAAO,mBAAS,CAAC,QAAQ,EAAE,IAAI,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC;IACD,SAAS,EAAT,UAAU,QAAyB,EAAE,IAAS,EAAE,GAAQ;QACtD,OAAO,mBAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;CACD,CAAC"}
|
package/lib/util/validator.js
DELETED
|
@@ -1,36 +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 ajv_1 = tslib_1.__importDefault(require("ajv"));
|
|
29
|
-
var models_1 = require("../models");
|
|
30
|
-
exports.createAjv = function (options) {
|
|
31
|
-
var ajv = new ajv_1.default(tslib_1.__assign({ schemaId: 'auto', allErrors: true, jsonPointers: true, errorDataPath: 'property', verbose: true }, options));
|
|
32
|
-
ajv.addFormat('time', '^([0-1][0-9]|2[0-3]):[0-5][0-9]$');
|
|
33
|
-
ajv.addMetaSchema(models_1.Draft4);
|
|
34
|
-
return ajv;
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/util/validator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,oDAAsB;AAEtB,oCAAmC;AAEtB,QAAA,SAAS,GAAG,UAAC,OAAiB;IACzC,IAAM,GAAG,GAAG,IAAI,aAAG,oBACjB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,EACf,YAAY,EAAE,IAAI,EAClB,aAAa,EAAE,UAAU,EACzB,OAAO,EAAE,IAAI,IACV,OAAO,EACV,CAAC;IACH,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAC;IAC1D,GAAG,CAAC,aAAa,CAAC,eAAM,CAAC,CAAC;IAC1B,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
package/webpack.build.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const merge = require('webpack-merge');
|
|
2
|
-
const baseConfig = require('../../webpack/webpack.build.base.js');
|
|
3
|
-
|
|
4
|
-
module.exports = merge(baseConfig, {
|
|
5
|
-
output: {
|
|
6
|
-
filename: "jsonforms-core.js",
|
|
7
|
-
library: "JSONFormsCore"
|
|
8
|
-
},
|
|
9
|
-
externals: {
|
|
10
|
-
"redux": "Redux"
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
});
|