@jsonforms/core 2.5.2-alpha.0 → 3.0.0-alpha.2
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 +1061 -1120
- package/docs/index.html +64 -91
- 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 -17
- package/docs/interfaces/jsonformscellrendererregistryentry.html +2 -2
- package/docs/interfaces/jsonformscore.html +7 -21
- 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 -24
- 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/{setlocalizeduischemasaction.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 -23
- 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/{setlocalizedschemasaction.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/Helpers.js +33 -0
- package/lib/Helpers.js.map +1 -0
- package/lib/actions/actions.d.ts +181 -0
- package/lib/actions/actions.js +173 -0
- package/lib/actions/actions.js.map +1 -0
- package/lib/actions/index.d.ts +1 -180
- package/lib/actions/index.js +26 -122
- package/lib/actions/index.js.map +1 -1
- package/lib/configDefault.js +2 -1
- package/lib/configDefault.js.map +1 -1
- package/lib/generators/Generate.d.ts +6 -0
- package/lib/generators/Generate.js +35 -0
- package/lib/generators/Generate.js.map +1 -0
- package/lib/generators/index.d.ts +3 -10
- package/lib/generators/index.js +28 -9
- package/lib/generators/index.js.map +1 -1
- package/lib/generators/schema.d.ts +1 -1
- package/lib/generators/schema.js +3 -1
- package/lib/generators/schema.js.map +1 -1
- package/lib/generators/uischema.d.ts +1 -2
- package/lib/generators/uischema.js +12 -10
- package/lib/generators/uischema.js.map +1 -1
- package/lib/i18n/i18nTypes.d.ts +15 -0
- package/lib/i18n/i18nTypes.js +3 -0
- package/lib/i18n/i18nTypes.js.map +1 -0
- package/lib/i18n/i18nUtil.d.ts +11 -0
- package/lib/i18n/i18nUtil.js +58 -0
- package/lib/i18n/i18nUtil.js.map +1 -0
- package/lib/i18n/index.d.ts +2 -0
- package/lib/i18n/index.js +6 -0
- package/lib/i18n/index.js.map +1 -0
- package/lib/index.d.ts +6 -18
- package/lib/index.js +10 -15
- package/lib/index.js.map +1 -1
- package/lib/jsonforms-core.js +9 -12
- package/lib/jsonforms-core.js.map +1 -1
- package/lib/models/draft4.js +2 -1
- package/lib/models/draft4.js.map +1 -1
- package/lib/models/index.d.ts +5 -0
- package/lib/models/index.js +33 -0
- package/lib/models/index.js.map +1 -0
- package/lib/models/jsonSchema.js +24 -0
- package/lib/models/jsonSchema.js.map +1 -1
- package/lib/models/uischema.js +29 -2
- package/lib/models/uischema.js.map +1 -1
- package/lib/reducers/cells.d.ts +1 -1
- package/lib/reducers/cells.js +27 -1
- package/lib/reducers/cells.js.map +1 -1
- package/lib/reducers/config.d.ts +1 -1
- package/lib/reducers/config.js +5 -3
- package/lib/reducers/config.js.map +1 -1
- package/lib/reducers/core.d.ts +5 -7
- package/lib/reducers/core.js +78 -63
- package/lib/reducers/core.js.map +1 -1
- package/lib/reducers/default-data.d.ts +1 -1
- package/lib/reducers/default-data.js +6 -3
- package/lib/reducers/default-data.js.map +1 -1
- package/lib/reducers/i18n.d.ts +8 -11
- package/lib/reducers/i18n.js +40 -23
- package/lib/reducers/i18n.js.map +1 -1
- package/lib/reducers/index.d.ts +9 -49
- package/lib/reducers/index.js +33 -91
- package/lib/reducers/index.js.map +1 -1
- package/lib/reducers/reducers.d.ts +37 -0
- package/lib/reducers/reducers.js +107 -0
- package/lib/reducers/reducers.js.map +1 -0
- package/lib/reducers/renderers.d.ts +1 -1
- package/lib/reducers/renderers.js +27 -1
- package/lib/reducers/renderers.js.map +1 -1
- package/lib/reducers/selectors.d.ts +15 -0
- package/lib/reducers/selectors.js +56 -0
- package/lib/reducers/selectors.js.map +1 -0
- package/lib/reducers/uischemas.d.ts +2 -2
- package/lib/reducers/uischemas.js +9 -6
- package/lib/reducers/uischemas.js.map +1 -1
- package/lib/store.d.ts +5 -8
- package/lib/store.js +24 -0
- package/lib/store.js.map +1 -1
- package/lib/testers/index.d.ts +1 -204
- package/lib/testers/index.js +3 -376
- package/lib/testers/index.js.map +1 -1
- package/lib/testers/testers.d.ts +203 -0
- package/lib/testers/testers.js +421 -0
- package/lib/testers/testers.js.map +1 -0
- package/lib/util/Formatted.js +24 -0
- package/lib/util/Formatted.js.map +1 -1
- package/lib/util/array.js +25 -0
- package/lib/util/array.js.map +1 -1
- package/lib/util/cell.d.ts +11 -4
- package/lib/util/cell.js +61 -17
- package/lib/util/cell.js.map +1 -1
- package/lib/util/combinators.d.ts +2 -3
- package/lib/util/combinators.js +5 -2
- package/lib/util/combinators.js.map +1 -1
- package/lib/util/ids.js +8 -4
- package/lib/util/ids.js.map +1 -1
- package/lib/util/index.d.ts +11 -45
- package/lib/util/index.js +14 -104
- package/lib/util/index.js.map +1 -1
- package/lib/util/label.d.ts +1 -2
- package/lib/util/label.js +7 -4
- package/lib/util/label.js.map +1 -1
- package/lib/util/path.d.ts +2 -1
- package/lib/util/path.js +12 -6
- package/lib/util/path.js.map +1 -1
- package/lib/util/renderer.d.ts +17 -17
- package/lib/util/renderer.js +163 -76
- package/lib/util/renderer.js.map +1 -1
- package/lib/util/resolvers.d.ts +1 -14
- package/lib/util/resolvers.js +9 -215
- package/lib/util/resolvers.js.map +1 -1
- package/lib/util/runtime.d.ts +12 -2
- package/lib/util/runtime.js +59 -17
- package/lib/util/runtime.js.map +1 -1
- package/lib/util/schema.js +27 -1
- package/lib/util/schema.js.map +1 -1
- package/lib/util/uischema.d.ts +1 -1
- package/lib/util/uischema.js +11 -7
- package/lib/util/uischema.js.map +1 -1
- package/lib/util/util.d.ts +31 -0
- package/lib/util/util.js +112 -0
- package/lib/util/util.js.map +1 -0
- package/lib/util/validator.d.ts +3 -2
- package/lib/util/validator.js +6 -5
- package/lib/util/validator.js.map +1 -1
- package/package.json +7 -9
- package/src/Helpers.ts +38 -0
- package/src/actions/actions.ts +345 -0
- package/src/actions/index.ts +1 -312
- package/src/configDefault.ts +1 -0
- package/src/generators/Generate.ts +43 -0
- 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 +76 -0
- package/src/i18n/index.ts +2 -0
- package/src/index.ts +7 -31
- package/src/models/draft4.ts +1 -0
- package/src/models/index.ts +30 -0
- 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 -81
- package/src/reducers/default-data.ts +2 -1
- package/src/reducers/i18n.ts +42 -35
- package/src/reducers/index.ts +9 -158
- package/src/reducers/reducers.ts +148 -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 +91 -19
- package/src/util/combinators.ts +2 -4
- package/src/util/ids.ts +1 -0
- package/src/util/index.ts +11 -126
- package/src/util/label.ts +2 -2
- package/src/util/path.ts +4 -1
- package/src/util/renderer.ts +168 -85
- package/src/util/resolvers.ts +2 -261
- package/src/util/runtime.ts +46 -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/test/reducers/core.test.ts +31 -223
- package/test/util/cell.test.ts +33 -2
- package/test/util/renderer.test.ts +483 -3
- package/test/util/resolvers.test.ts +1 -59
- package/test/util/runtime.test.ts +264 -4
- package/docs/interfaces/labels.html +0 -157
- package/docs/interfaces/schemaref.html +0 -160
- package/docs/interfaces/schemarefs.html +0 -138
package/lib/testers/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
2
|
/*
|
|
5
3
|
The MIT License
|
|
6
4
|
|
|
@@ -25,378 +23,7 @@ var tslib_1 = require("tslib");
|
|
|
25
23
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
24
|
THE SOFTWARE.
|
|
27
25
|
*/
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
var last_1 = tslib_1.__importDefault(require("lodash/last"));
|
|
32
|
-
var isArray_1 = tslib_1.__importDefault(require("lodash/isArray"));
|
|
33
|
-
var reduce_1 = tslib_1.__importDefault(require("lodash/reduce"));
|
|
34
|
-
var toPairs_1 = tslib_1.__importDefault(require("lodash/toPairs"));
|
|
35
|
-
var includes_1 = tslib_1.__importDefault(require("lodash/includes"));
|
|
36
|
-
var resolvers_1 = require("../util/resolvers");
|
|
37
|
-
var util_1 = require("../util");
|
|
38
|
-
/**
|
|
39
|
-
* Constant that indicates that a tester is not capable of handling
|
|
40
|
-
* a combination of schema/data.
|
|
41
|
-
* @type {number}
|
|
42
|
-
*/
|
|
43
|
-
exports.NOT_APPLICABLE = -1;
|
|
44
|
-
exports.isControl = function (uischema) {
|
|
45
|
-
return !isEmpty_1.default(uischema) && uischema.scope !== undefined;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Only applicable for Controls.
|
|
49
|
-
*
|
|
50
|
-
* This function checks whether the given UI schema is of type Control
|
|
51
|
-
* and if so, resolves the sub-schema referenced by the control and applies
|
|
52
|
-
* the given predicate
|
|
53
|
-
*
|
|
54
|
-
* @param {(JsonSchema) => boolean} predicate the predicate that should be
|
|
55
|
-
* applied to the resolved sub-schema
|
|
56
|
-
*/
|
|
57
|
-
exports.schemaMatches = function (predicate) { return function (uischema, schema) {
|
|
58
|
-
if (isEmpty_1.default(uischema) || !exports.isControl(uischema)) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
if (isEmpty_1.default(schema)) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
var schemaPath = uischema.scope;
|
|
65
|
-
if (isEmpty_1.default(schemaPath)) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
var currentDataSchema = schema;
|
|
69
|
-
if (util_1.hasType(schema, 'object')) {
|
|
70
|
-
currentDataSchema = resolvers_1.resolveSchema(schema, schemaPath);
|
|
71
|
-
}
|
|
72
|
-
if (currentDataSchema === undefined) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
return predicate(currentDataSchema);
|
|
76
|
-
}; };
|
|
77
|
-
exports.schemaSubPathMatches = function (subPath, predicate) { return function (uischema, schema) {
|
|
78
|
-
if (isEmpty_1.default(uischema) || !exports.isControl(uischema)) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
var schemaPath = uischema.scope;
|
|
82
|
-
var currentDataSchema = schema;
|
|
83
|
-
if (util_1.hasType(schema, 'object')) {
|
|
84
|
-
currentDataSchema = resolvers_1.resolveSchema(schema, schemaPath);
|
|
85
|
-
}
|
|
86
|
-
currentDataSchema = get_1.default(currentDataSchema, subPath);
|
|
87
|
-
if (currentDataSchema === undefined) {
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
return predicate(currentDataSchema);
|
|
91
|
-
}; };
|
|
92
|
-
/**
|
|
93
|
-
* Only applicable for Controls.
|
|
94
|
-
*
|
|
95
|
-
* This function checks whether the given UI schema is of type Control
|
|
96
|
-
* and if so, resolves the sub-schema referenced by the control and checks
|
|
97
|
-
* whether the type of the sub-schema matches the expected one.
|
|
98
|
-
*
|
|
99
|
-
* @param {string} expectedType the expected type of the resolved sub-schema
|
|
100
|
-
*/
|
|
101
|
-
exports.schemaTypeIs = function (expectedType) {
|
|
102
|
-
return exports.schemaMatches(function (schema) { return !isEmpty_1.default(schema) && util_1.hasType(schema, expectedType); });
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Only applicable for Controls.
|
|
106
|
-
*
|
|
107
|
-
* This function checks whether the given UI schema is of type Control
|
|
108
|
-
* and if so, resolves the sub-schema referenced by the control and checks
|
|
109
|
-
* whether the format of the sub-schema matches the expected one.
|
|
110
|
-
*
|
|
111
|
-
* @param {string} expectedFormat the expected format of the resolved sub-schema
|
|
112
|
-
*/
|
|
113
|
-
exports.formatIs = function (expectedFormat) {
|
|
114
|
-
return exports.schemaMatches(function (schema) {
|
|
115
|
-
return !isEmpty_1.default(schema) &&
|
|
116
|
-
schema.format === expectedFormat &&
|
|
117
|
-
schema.type === 'string';
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Checks whether the given UI schema has the expected type.
|
|
122
|
-
*
|
|
123
|
-
* @param {string} expected the expected UI schema type
|
|
124
|
-
*/
|
|
125
|
-
exports.uiTypeIs = function (expected) { return function (uischema) { return !isEmpty_1.default(uischema) && uischema.type === expected; }; };
|
|
126
|
-
/**
|
|
127
|
-
* Checks whether the given UI schema has an option with the given
|
|
128
|
-
* name and whether it has the expected value. If no options property
|
|
129
|
-
* is set, returns false.
|
|
130
|
-
*
|
|
131
|
-
* @param {string} optionName the name of the option to check
|
|
132
|
-
* @param {any} optionValue the expected value of the option
|
|
133
|
-
*/
|
|
134
|
-
exports.optionIs = function (optionName, optionValue) { return function (uischema) {
|
|
135
|
-
if (isEmpty_1.default(uischema)) {
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
var options = uischema.options;
|
|
139
|
-
return !isEmpty_1.default(options) && options[optionName] === optionValue;
|
|
140
|
-
}; };
|
|
141
|
-
/**
|
|
142
|
-
* Only applicable for Controls.
|
|
143
|
-
*
|
|
144
|
-
* Checks whether the scope of a control ends with the expected string.
|
|
145
|
-
*
|
|
146
|
-
* @param {string} expected the expected ending of the reference
|
|
147
|
-
*/
|
|
148
|
-
exports.scopeEndsWith = function (expected) { return function (uischema) {
|
|
149
|
-
if (isEmpty_1.default(expected) || !exports.isControl(uischema)) {
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
return endsWith_1.default(uischema.scope, expected);
|
|
153
|
-
}; };
|
|
154
|
-
/**
|
|
155
|
-
* Only applicable for Controls.
|
|
156
|
-
*
|
|
157
|
-
* Checks whether the last segment of the scope matches the expected string.
|
|
158
|
-
*
|
|
159
|
-
* @param {string} expected the expected ending of the reference
|
|
160
|
-
*/
|
|
161
|
-
exports.scopeEndIs = function (expected) { return function (uischema) {
|
|
162
|
-
if (isEmpty_1.default(expected) || !exports.isControl(uischema)) {
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
var schemaPath = uischema.scope;
|
|
166
|
-
return !isEmpty_1.default(schemaPath) && last_1.default(schemaPath.split('/')) === expected;
|
|
167
|
-
}; };
|
|
168
|
-
/**
|
|
169
|
-
* A tester that allow composing other testers by && them.
|
|
170
|
-
*
|
|
171
|
-
* @param {Array<Tester>} testers the testers to be composed
|
|
172
|
-
*/
|
|
173
|
-
exports.and = function () {
|
|
174
|
-
var testers = [];
|
|
175
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
176
|
-
testers[_i] = arguments[_i];
|
|
177
|
-
}
|
|
178
|
-
return function (uischema, schema) { return testers.reduce(function (acc, tester) { return acc && tester(uischema, schema); }, true); };
|
|
179
|
-
};
|
|
180
|
-
/**
|
|
181
|
-
* A tester that allow composing other testers by || them.
|
|
182
|
-
*
|
|
183
|
-
* @param {Array<Tester>} testers the testers to be composed
|
|
184
|
-
*/
|
|
185
|
-
exports.or = function () {
|
|
186
|
-
var testers = [];
|
|
187
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
188
|
-
testers[_i] = arguments[_i];
|
|
189
|
-
}
|
|
190
|
-
return function (uischema, schema) { return testers.reduce(function (acc, tester) { return acc || tester(uischema, schema); }, false); };
|
|
191
|
-
};
|
|
192
|
-
/**
|
|
193
|
-
* Create a ranked tester that will associate a number with a given tester, if the
|
|
194
|
-
* latter returns true.
|
|
195
|
-
*
|
|
196
|
-
* @param {number} rank the rank to be returned in case the tester returns true
|
|
197
|
-
* @param {Tester} tester a tester
|
|
198
|
-
*/
|
|
199
|
-
exports.rankWith = function (rank, tester) { return function (uischema, schema) {
|
|
200
|
-
if (tester(uischema, schema)) {
|
|
201
|
-
return rank;
|
|
202
|
-
}
|
|
203
|
-
return exports.NOT_APPLICABLE;
|
|
204
|
-
}; };
|
|
205
|
-
exports.withIncreasedRank = function (by, rankedTester) { return function (uischema, schema) {
|
|
206
|
-
var rank = rankedTester(uischema, schema);
|
|
207
|
-
if (rank === exports.NOT_APPLICABLE) {
|
|
208
|
-
return exports.NOT_APPLICABLE;
|
|
209
|
-
}
|
|
210
|
-
return rank + by;
|
|
211
|
-
}; };
|
|
212
|
-
/**
|
|
213
|
-
* Default tester for boolean.
|
|
214
|
-
* @type {RankedTester}
|
|
215
|
-
*/
|
|
216
|
-
exports.isBooleanControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('boolean'));
|
|
217
|
-
// TODO: rather check for properties property
|
|
218
|
-
exports.isObjectControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('object'));
|
|
219
|
-
exports.isAllOfControl = exports.and(exports.uiTypeIs('Control'), exports.schemaMatches(function (schema) { return schema.hasOwnProperty('allOf'); }));
|
|
220
|
-
exports.isAnyOfControl = exports.and(exports.uiTypeIs('Control'), exports.schemaMatches(function (schema) { return schema.hasOwnProperty('anyOf'); }));
|
|
221
|
-
exports.isOneOfControl = exports.and(exports.uiTypeIs('Control'), exports.schemaMatches(function (schema) { return schema.hasOwnProperty('oneOf'); }));
|
|
222
|
-
/**
|
|
223
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
224
|
-
* has a 'date' format.
|
|
225
|
-
* @type {Tester}
|
|
226
|
-
*/
|
|
227
|
-
exports.isDateControl = exports.and(exports.uiTypeIs('Control'), exports.formatIs('date'));
|
|
228
|
-
/**
|
|
229
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
230
|
-
* has an enum.
|
|
231
|
-
* @type {Tester}
|
|
232
|
-
*/
|
|
233
|
-
exports.isEnumControl = exports.and(exports.uiTypeIs('Control'), exports.or(exports.schemaMatches(function (schema) { return schema.hasOwnProperty('enum'); }), exports.schemaMatches(function (schema) { return schema.hasOwnProperty('const'); })));
|
|
234
|
-
/**
|
|
235
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
236
|
-
* has an enum based on oneOf.
|
|
237
|
-
* @type {Tester}
|
|
238
|
-
*/
|
|
239
|
-
exports.isOneOfEnumControl = exports.and(exports.uiTypeIs('Control'), exports.schemaMatches(function (schema) {
|
|
240
|
-
return schema.hasOwnProperty('oneOf') &&
|
|
241
|
-
schema.oneOf.every(function (s) { return s.const !== undefined; });
|
|
242
|
-
}));
|
|
243
|
-
/**
|
|
244
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
245
|
-
* is of type integer
|
|
246
|
-
* @type {Tester}
|
|
247
|
-
*/
|
|
248
|
-
exports.isIntegerControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('integer'));
|
|
249
|
-
/**
|
|
250
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
251
|
-
* is of type number
|
|
252
|
-
* @type {Tester}
|
|
253
|
-
*/
|
|
254
|
-
exports.isNumberControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('number'));
|
|
255
|
-
/**
|
|
256
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
257
|
-
* is of type string
|
|
258
|
-
* @type {Tester}
|
|
259
|
-
*/
|
|
260
|
-
exports.isStringControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('string'));
|
|
261
|
-
/**
|
|
262
|
-
* Tests whether the given UI schema is of type Control and if is has
|
|
263
|
-
* a 'multi' option.
|
|
264
|
-
* @type {Tester}
|
|
265
|
-
*/
|
|
266
|
-
exports.isMultiLineControl = exports.and(exports.uiTypeIs('Control'), exports.optionIs('multi', true));
|
|
267
|
-
/**
|
|
268
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
269
|
-
* has a 'time' format.
|
|
270
|
-
* @type {Tester}
|
|
271
|
-
*/
|
|
272
|
-
exports.isTimeControl = exports.and(exports.uiTypeIs('Control'), exports.formatIs('time'));
|
|
273
|
-
/**
|
|
274
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
275
|
-
* has a 'date-time' format.
|
|
276
|
-
* @type {Tester}
|
|
277
|
-
*/
|
|
278
|
-
exports.isDateTimeControl = exports.and(exports.uiTypeIs('Control'), exports.formatIs('date-time'));
|
|
279
|
-
/**
|
|
280
|
-
* Tests whether the given schema is an array of objects.
|
|
281
|
-
* @type {Tester}
|
|
282
|
-
*/
|
|
283
|
-
exports.isObjectArray = exports.and(exports.schemaMatches(function (schema) { return util_1.hasType(schema, 'array') && !Array.isArray(schema.items); } // we don't care about tuples
|
|
284
|
-
), exports.schemaSubPathMatches('items', function (schema) { return util_1.hasType(schema, 'object'); }));
|
|
285
|
-
/**
|
|
286
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
287
|
-
* is an array of objects.
|
|
288
|
-
* @type {Tester}
|
|
289
|
-
*/
|
|
290
|
-
exports.isObjectArrayControl = exports.and(exports.uiTypeIs('Control'), exports.isObjectArray);
|
|
291
|
-
var traverse = function (any, pred) {
|
|
292
|
-
if (isArray_1.default(any)) {
|
|
293
|
-
return reduce_1.default(any, function (acc, el) { return acc || traverse(el, pred); }, false);
|
|
294
|
-
}
|
|
295
|
-
if (pred(any)) {
|
|
296
|
-
return true;
|
|
297
|
-
}
|
|
298
|
-
if (any.items) {
|
|
299
|
-
return traverse(any.items, pred);
|
|
300
|
-
}
|
|
301
|
-
if (any.properties) {
|
|
302
|
-
return reduce_1.default(toPairs_1.default(any.properties), function (acc, _a) {
|
|
303
|
-
var _key = _a[0], val = _a[1];
|
|
304
|
-
return acc || traverse(val, pred);
|
|
305
|
-
}, false);
|
|
306
|
-
}
|
|
307
|
-
return false;
|
|
308
|
-
};
|
|
309
|
-
exports.isObjectArrayWithNesting = function (uischema, schema) {
|
|
310
|
-
if (!exports.uiTypeIs('Control')(uischema, schema)) {
|
|
311
|
-
return false;
|
|
312
|
-
}
|
|
313
|
-
var schemaPath = uischema.scope;
|
|
314
|
-
var resolvedSchema = resolvers_1.resolveSchema(schema, schemaPath);
|
|
315
|
-
var wantedNestingByType = {
|
|
316
|
-
object: 2,
|
|
317
|
-
array: 1
|
|
318
|
-
};
|
|
319
|
-
if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {
|
|
320
|
-
// check if nested arrays
|
|
321
|
-
if (traverse(resolvedSchema.items, function (val) {
|
|
322
|
-
if (val === schema) {
|
|
323
|
-
return false;
|
|
324
|
-
}
|
|
325
|
-
// we don't support multiple types
|
|
326
|
-
if (typeof val.type !== 'string') {
|
|
327
|
-
return true;
|
|
328
|
-
}
|
|
329
|
-
var typeCount = wantedNestingByType[val.type];
|
|
330
|
-
if (typeCount === undefined) {
|
|
331
|
-
return false;
|
|
332
|
-
}
|
|
333
|
-
wantedNestingByType[val.type] = typeCount - 1;
|
|
334
|
-
return wantedNestingByType[val.type] === 0;
|
|
335
|
-
})) {
|
|
336
|
-
return true;
|
|
337
|
-
}
|
|
338
|
-
// check if uischema options detail is set
|
|
339
|
-
if (uischema.options && uischema.options.detail) {
|
|
340
|
-
if (typeof uischema.options.detail === 'string') {
|
|
341
|
-
return uischema.options.detail.toUpperCase() !== 'DEFAULT';
|
|
342
|
-
}
|
|
343
|
-
else if (typeof uischema.options.detail === 'object' &&
|
|
344
|
-
uischema.options.detail.type) {
|
|
345
|
-
return true;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
return false;
|
|
350
|
-
};
|
|
351
|
-
/**
|
|
352
|
-
* Synonym for isObjectArrayControl
|
|
353
|
-
*/
|
|
354
|
-
exports.isArrayObjectControl = exports.isObjectArrayControl;
|
|
355
|
-
/**
|
|
356
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
357
|
-
* is an array of a primitive type.
|
|
358
|
-
* @type {Tester}
|
|
359
|
-
*/
|
|
360
|
-
exports.isPrimitiveArrayControl = exports.and(exports.uiTypeIs('Control'), exports.schemaMatches(function (schema) { return util_1.deriveTypes(schema).length !== 0 && !Array.isArray(schema.items); } // we don't care about tuples
|
|
361
|
-
), exports.schemaSubPathMatches('items', function (schema) {
|
|
362
|
-
var types = util_1.deriveTypes(schema);
|
|
363
|
-
return (types.length === 1 &&
|
|
364
|
-
includes_1.default(['integer', 'number', 'boolean', 'string'], types[0]));
|
|
365
|
-
}));
|
|
366
|
-
/**
|
|
367
|
-
* Tests whether a given UI schema is of type Control,
|
|
368
|
-
* if the schema is of type number or integer and
|
|
369
|
-
* whether the schema defines a numerical range with a default value.
|
|
370
|
-
* @type {Tester}
|
|
371
|
-
*/
|
|
372
|
-
exports.isRangeControl = exports.and(exports.uiTypeIs('Control'), exports.or(exports.schemaTypeIs('number'), exports.schemaTypeIs('integer')), exports.schemaMatches(function (schema) {
|
|
373
|
-
return schema.hasOwnProperty('maximum') &&
|
|
374
|
-
schema.hasOwnProperty('minimum') &&
|
|
375
|
-
schema.hasOwnProperty('default');
|
|
376
|
-
}), exports.optionIs('slider', true));
|
|
377
|
-
/**
|
|
378
|
-
* Tests whether the given UI schema is of type Control, if the schema
|
|
379
|
-
* is of type string and has option format
|
|
380
|
-
* @type {Tester}
|
|
381
|
-
*/
|
|
382
|
-
exports.isNumberFormatControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('integer'), exports.optionIs('format', true));
|
|
383
|
-
exports.isCategorization = function (category) { return category.type === 'Categorization'; };
|
|
384
|
-
exports.isCategory = function (uischema) {
|
|
385
|
-
return uischema.type === 'Category';
|
|
386
|
-
};
|
|
387
|
-
exports.hasCategory = function (categorization) {
|
|
388
|
-
if (isEmpty_1.default(categorization.elements)) {
|
|
389
|
-
return false;
|
|
390
|
-
}
|
|
391
|
-
// all children of the categorization have to be categories
|
|
392
|
-
return categorization.elements
|
|
393
|
-
.map(function (elem) {
|
|
394
|
-
return exports.isCategorization(elem) ? exports.hasCategory(elem) : exports.isCategory(elem);
|
|
395
|
-
})
|
|
396
|
-
.reduce(function (prev, curr) { return prev && curr; }, true);
|
|
397
|
-
};
|
|
398
|
-
exports.categorizationHasCategory = function (uischema) {
|
|
399
|
-
return exports.hasCategory(uischema);
|
|
400
|
-
};
|
|
401
|
-
exports.not = function (tester) { return function (uischema, schema) { return !tester(uischema, schema); }; };
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
var tslib_1 = require("tslib");
|
|
28
|
+
tslib_1.__exportStar(require("./testers"), exports);
|
|
402
29
|
//# sourceMappingURL=index.js.map
|
package/lib/testers/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,oDAA0B"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { Categorization, ControlElement, JsonSchema, UISchemaElement } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* Constant that indicates that a tester is not capable of handling
|
|
4
|
+
* a combination of schema/data.
|
|
5
|
+
* @type {number}
|
|
6
|
+
*/
|
|
7
|
+
export declare const NOT_APPLICABLE = -1;
|
|
8
|
+
/**
|
|
9
|
+
* A tester is a function that receives an UI schema and a JSON schema and returns a boolean.
|
|
10
|
+
*/
|
|
11
|
+
export declare type Tester = (uischema: UISchemaElement, schema: JsonSchema) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* A ranked tester associates a tester with a number.
|
|
14
|
+
*/
|
|
15
|
+
export declare type RankedTester = (uischema: UISchemaElement, schema: JsonSchema) => number;
|
|
16
|
+
export declare const isControl: (uischema: any) => uischema is ControlElement;
|
|
17
|
+
/**
|
|
18
|
+
* Only applicable for Controls.
|
|
19
|
+
*
|
|
20
|
+
* This function checks whether the given UI schema is of type Control
|
|
21
|
+
* and if so, resolves the sub-schema referenced by the control and applies
|
|
22
|
+
* the given predicate
|
|
23
|
+
*
|
|
24
|
+
* @param {(JsonSchema) => boolean} predicate the predicate that should be
|
|
25
|
+
* applied to the resolved sub-schema
|
|
26
|
+
*/
|
|
27
|
+
export declare const schemaMatches: (predicate: (schema: JsonSchema) => boolean) => Tester;
|
|
28
|
+
export declare const schemaSubPathMatches: (subPath: string, predicate: (schema: JsonSchema) => boolean) => Tester;
|
|
29
|
+
/**
|
|
30
|
+
* Only applicable for Controls.
|
|
31
|
+
*
|
|
32
|
+
* This function checks whether the given UI schema is of type Control
|
|
33
|
+
* and if so, resolves the sub-schema referenced by the control and checks
|
|
34
|
+
* whether the type of the sub-schema matches the expected one.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} expectedType the expected type of the resolved sub-schema
|
|
37
|
+
*/
|
|
38
|
+
export declare const schemaTypeIs: (expectedType: string) => Tester;
|
|
39
|
+
/**
|
|
40
|
+
* Only applicable for Controls.
|
|
41
|
+
*
|
|
42
|
+
* This function checks whether the given UI schema is of type Control
|
|
43
|
+
* and if so, resolves the sub-schema referenced by the control and checks
|
|
44
|
+
* whether the format of the sub-schema matches the expected one.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} expectedFormat the expected format of the resolved sub-schema
|
|
47
|
+
*/
|
|
48
|
+
export declare const formatIs: (expectedFormat: string) => Tester;
|
|
49
|
+
/**
|
|
50
|
+
* Checks whether the given UI schema has the expected type.
|
|
51
|
+
*
|
|
52
|
+
* @param {string} expected the expected UI schema type
|
|
53
|
+
*/
|
|
54
|
+
export declare const uiTypeIs: (expected: string) => Tester;
|
|
55
|
+
/**
|
|
56
|
+
* Checks whether the given UI schema has an option with the given
|
|
57
|
+
* name and whether it has the expected value. If no options property
|
|
58
|
+
* is set, returns false.
|
|
59
|
+
*
|
|
60
|
+
* @param {string} optionName the name of the option to check
|
|
61
|
+
* @param {any} optionValue the expected value of the option
|
|
62
|
+
*/
|
|
63
|
+
export declare const optionIs: (optionName: string, optionValue: any) => Tester;
|
|
64
|
+
/**
|
|
65
|
+
* Only applicable for Controls.
|
|
66
|
+
*
|
|
67
|
+
* Checks whether the scope of a control ends with the expected string.
|
|
68
|
+
*
|
|
69
|
+
* @param {string} expected the expected ending of the reference
|
|
70
|
+
*/
|
|
71
|
+
export declare const scopeEndsWith: (expected: string) => Tester;
|
|
72
|
+
/**
|
|
73
|
+
* Only applicable for Controls.
|
|
74
|
+
*
|
|
75
|
+
* Checks whether the last segment of the scope matches the expected string.
|
|
76
|
+
*
|
|
77
|
+
* @param {string} expected the expected ending of the reference
|
|
78
|
+
*/
|
|
79
|
+
export declare const scopeEndIs: (expected: string) => Tester;
|
|
80
|
+
/**
|
|
81
|
+
* A tester that allow composing other testers by && them.
|
|
82
|
+
*
|
|
83
|
+
* @param {Array<Tester>} testers the testers to be composed
|
|
84
|
+
*/
|
|
85
|
+
export declare const and: (...testers: Tester[]) => Tester;
|
|
86
|
+
/**
|
|
87
|
+
* A tester that allow composing other testers by || them.
|
|
88
|
+
*
|
|
89
|
+
* @param {Array<Tester>} testers the testers to be composed
|
|
90
|
+
*/
|
|
91
|
+
export declare const or: (...testers: Tester[]) => Tester;
|
|
92
|
+
/**
|
|
93
|
+
* Create a ranked tester that will associate a number with a given tester, if the
|
|
94
|
+
* latter returns true.
|
|
95
|
+
*
|
|
96
|
+
* @param {number} rank the rank to be returned in case the tester returns true
|
|
97
|
+
* @param {Tester} tester a tester
|
|
98
|
+
*/
|
|
99
|
+
export declare const rankWith: (rank: number, tester: Tester) => (uischema: UISchemaElement, schema: JsonSchema) => number;
|
|
100
|
+
export declare const withIncreasedRank: (by: number, rankedTester: RankedTester) => (uischema: UISchemaElement, schema: JsonSchema) => number;
|
|
101
|
+
/**
|
|
102
|
+
* Default tester for boolean.
|
|
103
|
+
* @type {RankedTester}
|
|
104
|
+
*/
|
|
105
|
+
export declare const isBooleanControl: Tester;
|
|
106
|
+
export declare const isObjectControl: Tester;
|
|
107
|
+
export declare const isAllOfControl: Tester;
|
|
108
|
+
export declare const isAnyOfControl: Tester;
|
|
109
|
+
export declare const isOneOfControl: Tester;
|
|
110
|
+
/**
|
|
111
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
112
|
+
* has an enum.
|
|
113
|
+
* @type {Tester}
|
|
114
|
+
*/
|
|
115
|
+
export declare const isEnumControl: Tester;
|
|
116
|
+
/**
|
|
117
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
118
|
+
* has an enum based on oneOf.
|
|
119
|
+
* @type {Tester}
|
|
120
|
+
*/
|
|
121
|
+
export declare const isOneOfEnumControl: Tester;
|
|
122
|
+
/**
|
|
123
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
124
|
+
* is of type integer
|
|
125
|
+
* @type {Tester}
|
|
126
|
+
*/
|
|
127
|
+
export declare const isIntegerControl: Tester;
|
|
128
|
+
/**
|
|
129
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
130
|
+
* is of type number
|
|
131
|
+
* @type {Tester}
|
|
132
|
+
*/
|
|
133
|
+
export declare const isNumberControl: Tester;
|
|
134
|
+
/**
|
|
135
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
136
|
+
* is of type string
|
|
137
|
+
* @type {Tester}
|
|
138
|
+
*/
|
|
139
|
+
export declare const isStringControl: Tester;
|
|
140
|
+
/**
|
|
141
|
+
* Tests whether the given UI schema is of type Control and if is has
|
|
142
|
+
* a 'multi' option.
|
|
143
|
+
* @type {Tester}
|
|
144
|
+
*/
|
|
145
|
+
export declare const isMultiLineControl: Tester;
|
|
146
|
+
/**
|
|
147
|
+
* Tests whether the given UI schema is of type Control and whether the schema
|
|
148
|
+
* or uischema options has a 'date' format.
|
|
149
|
+
* @type {Tester}
|
|
150
|
+
*/
|
|
151
|
+
export declare const isDateControl: Tester;
|
|
152
|
+
/**
|
|
153
|
+
* Tests whether the given UI schema is of type Control and whether the schema
|
|
154
|
+
* or the uischema options has a 'time' format.
|
|
155
|
+
* @type {Tester}
|
|
156
|
+
*/
|
|
157
|
+
export declare const isTimeControl: Tester;
|
|
158
|
+
/**
|
|
159
|
+
* Tests whether the given UI schema is of type Control and whether the schema
|
|
160
|
+
* or the uischema options has a 'date-time' format.
|
|
161
|
+
* @type {Tester}
|
|
162
|
+
*/
|
|
163
|
+
export declare const isDateTimeControl: Tester;
|
|
164
|
+
/**
|
|
165
|
+
* Tests whether the given schema is an array of objects.
|
|
166
|
+
* @type {Tester}
|
|
167
|
+
*/
|
|
168
|
+
export declare const isObjectArray: Tester;
|
|
169
|
+
/**
|
|
170
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
171
|
+
* is an array of objects.
|
|
172
|
+
* @type {Tester}
|
|
173
|
+
*/
|
|
174
|
+
export declare const isObjectArrayControl: Tester;
|
|
175
|
+
export declare const isObjectArrayWithNesting: (uischema: UISchemaElement, schema: JsonSchema) => boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Synonym for isObjectArrayControl
|
|
178
|
+
*/
|
|
179
|
+
export declare const isArrayObjectControl: Tester;
|
|
180
|
+
/**
|
|
181
|
+
* Tests whether the given UI schema is of type Control and if the schema
|
|
182
|
+
* is an array of a primitive type.
|
|
183
|
+
* @type {Tester}
|
|
184
|
+
*/
|
|
185
|
+
export declare const isPrimitiveArrayControl: Tester;
|
|
186
|
+
/**
|
|
187
|
+
* Tests whether a given UI schema is of type Control,
|
|
188
|
+
* if the schema is of type number or integer and
|
|
189
|
+
* whether the schema defines a numerical range with a default value.
|
|
190
|
+
* @type {Tester}
|
|
191
|
+
*/
|
|
192
|
+
export declare const isRangeControl: Tester;
|
|
193
|
+
/**
|
|
194
|
+
* Tests whether the given UI schema is of type Control, if the schema
|
|
195
|
+
* is of type string and has option format
|
|
196
|
+
* @type {Tester}
|
|
197
|
+
*/
|
|
198
|
+
export declare const isNumberFormatControl: Tester;
|
|
199
|
+
export declare const isCategorization: (category: UISchemaElement) => category is Categorization;
|
|
200
|
+
export declare const isCategory: (uischema: UISchemaElement) => boolean;
|
|
201
|
+
export declare const hasCategory: (categorization: Categorization) => boolean;
|
|
202
|
+
export declare const categorizationHasCategory: (uischema: UISchemaElement) => boolean;
|
|
203
|
+
export declare const not: (tester: Tester) => Tester;
|