@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
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
exports.getUISchemas = exports.getCells = exports.getRenderers = exports.getDefaultData = exports.getAjv = exports.getUiSchema = exports.getSchema = exports.getData = void 0;
|
|
28
|
+
var tslib_1 = require("tslib");
|
|
29
|
+
var get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
30
|
+
var core_1 = require("./core");
|
|
31
|
+
var default_data_1 = require("./default-data");
|
|
32
|
+
var getData = function (state) {
|
|
33
|
+
return core_1.extractData(get_1.default(state, 'jsonforms.core'));
|
|
34
|
+
};
|
|
35
|
+
exports.getData = getData;
|
|
36
|
+
var getSchema = function (state) {
|
|
37
|
+
return core_1.extractSchema(get_1.default(state, 'jsonforms.core'));
|
|
38
|
+
};
|
|
39
|
+
exports.getSchema = getSchema;
|
|
40
|
+
var getUiSchema = function (state) {
|
|
41
|
+
return core_1.extractUiSchema(get_1.default(state, 'jsonforms.core'));
|
|
42
|
+
};
|
|
43
|
+
exports.getUiSchema = getUiSchema;
|
|
44
|
+
var getAjv = function (state) { return core_1.extractAjv(get_1.default(state, 'jsonforms.core')); };
|
|
45
|
+
exports.getAjv = getAjv;
|
|
46
|
+
var getDefaultData = function (state) {
|
|
47
|
+
return default_data_1.extractDefaultData(get_1.default(state, 'jsonforms.defaultData'));
|
|
48
|
+
};
|
|
49
|
+
exports.getDefaultData = getDefaultData;
|
|
50
|
+
var getRenderers = function (state) { return get_1.default(state, 'jsonforms.renderers'); };
|
|
51
|
+
exports.getRenderers = getRenderers;
|
|
52
|
+
var getCells = function (state) { return get_1.default(state, 'jsonforms.cells'); };
|
|
53
|
+
exports.getCells = getCells;
|
|
54
|
+
var getUISchemas = function (state) { return get_1.default(state, 'jsonforms.uischemas'); };
|
|
55
|
+
exports.getUISchemas = getUISchemas;
|
|
56
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../src/reducers/selectors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;;AAEF,2DAA6B;AAI7B,+BAKgB;AAChB,+CAGwB;AAKjB,IAAM,OAAO,GAAG,UAAC,KAAqB;IAC3C,OAAA,kBAAW,CAAC,aAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;AAAzC,CAAyC,CAAC;AAD/B,QAAA,OAAO,WACwB;AACrC,IAAM,SAAS,GAAG,UAAC,KAAqB;IAC7C,OAAA,oBAAa,CAAC,aAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;AAA3C,CAA2C,CAAC;AADjC,QAAA,SAAS,aACwB;AACvC,IAAM,WAAW,GAAG,UAAC,KAAqB;IAC/C,OAAA,sBAAe,CAAC,aAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;AAA7C,CAA6C,CAAC;AADnC,QAAA,WAAW,eACwB;AACzC,IAAM,MAAM,GAAG,UACpB,KAAqB,IACb,OAAA,iBAAU,CAAC,aAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,EAAxC,CAAwC,CAAC;AAFtC,QAAA,MAAM,UAEgC;AAC5C,IAAM,cAAc,GAAG,UAC5B,KAAqB;IAErB,OAAA,iCAAkB,CAAC,aAAG,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;AAAvD,CAAuD,CAAC;AAH7C,QAAA,cAAc,kBAG+B;AACnD,IAAM,YAAY,GAAG,UAC1B,KAAqB,IACgB,OAAA,aAAG,CAAC,KAAK,EAAE,qBAAqB,CAAC,EAAjC,CAAiC,CAAC;AAF5D,QAAA,YAAY,gBAEgD;AAClE,IAAM,QAAQ,GAAG,UACtB,KAAqB,IACoB,OAAA,aAAG,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAA7B,CAA6B,CAAC;AAF5D,QAAA,QAAQ,YAEoD;AAClE,IAAM,YAAY,GAAG,UAC1B,KAAqB,IACgB,OAAA,aAAG,CAAC,KAAK,EAAE,qBAAqB,CAAC,EAAjC,CAAiC,CAAA;AAF3D,QAAA,YAAY,gBAE+C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UISchemaActions } from '../actions';
|
|
2
|
-
import { JsonSchema, UISchemaElement } from '
|
|
3
|
-
import { Reducer } from '../util
|
|
2
|
+
import { JsonSchema, UISchemaElement } from '../models';
|
|
3
|
+
import { Reducer } from '../util';
|
|
4
4
|
export declare type UISchemaTester = (schema: JsonSchema, schemaPath: string, path: string) => number;
|
|
5
5
|
export interface JsonFormsUISchemaRegistryEntry {
|
|
6
6
|
tester: UISchemaTester;
|
|
@@ -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,11 +23,14 @@ 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
|
*/
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.findMatchingUISchema = exports.uischemaRegistryReducer = void 0;
|
|
28
|
+
var tslib_1 = require("tslib");
|
|
28
29
|
var maxBy_1 = tslib_1.__importDefault(require("lodash/maxBy"));
|
|
29
30
|
var remove_1 = tslib_1.__importDefault(require("lodash/remove"));
|
|
30
31
|
var actions_1 = require("../actions");
|
|
31
|
-
var
|
|
32
|
-
|
|
32
|
+
var testers_1 = require("../testers");
|
|
33
|
+
var uischemaRegistryReducer = function (state, action) {
|
|
33
34
|
if (state === void 0) { state = []; }
|
|
34
35
|
switch (action.type) {
|
|
35
36
|
case actions_1.ADD_UI_SCHEMA:
|
|
@@ -44,14 +45,16 @@ exports.uischemaRegistryReducer = function (state, action) {
|
|
|
44
45
|
return state;
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
|
-
exports.
|
|
48
|
+
exports.uischemaRegistryReducer = uischemaRegistryReducer;
|
|
49
|
+
var findMatchingUISchema = function (state) { return function (jsonSchema, schemaPath, path) {
|
|
48
50
|
var match = maxBy_1.default(state, function (entry) {
|
|
49
51
|
return entry.tester(jsonSchema, schemaPath, path);
|
|
50
52
|
});
|
|
51
53
|
if (match !== undefined &&
|
|
52
|
-
match.tester(jsonSchema, schemaPath, path) !==
|
|
54
|
+
match.tester(jsonSchema, schemaPath, path) !== testers_1.NOT_APPLICABLE) {
|
|
53
55
|
return match.uischema;
|
|
54
56
|
}
|
|
55
57
|
return undefined;
|
|
56
58
|
}; };
|
|
59
|
+
exports.findMatchingUISchema = findMatchingUISchema;
|
|
57
60
|
//# sourceMappingURL=uischemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uischemas.js","sourceRoot":"","sources":["../../src/reducers/uischemas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uischemas.js","sourceRoot":"","sources":["../../src/reducers/uischemas.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;;AAEF,+DAAiC;AACjC,iEAAmC;AACnC,sCAA8E;AAC9E,sCAA4C;AAerC,IAAM,uBAAuB,GAA+D,UACjG,KAAU,EACV,MAAM;IADN,sBAAA,EAAA,UAAU;IAGV,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,uBAAa;YAChB,OAAO,KAAK;iBACT,KAAK,EAAE;iBACP,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClE,KAAK,0BAAgB;YACnB,IAAM,IAAI,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3B,gBAAM,CAAC,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAA9B,CAA8B,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC;QACd;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC,CAAC;AAhBW,QAAA,uBAAuB,2BAgBlC;AAEK,IAAM,oBAAoB,GAAG,UAClC,KAAuC,IACpC,OAAA,UACH,UAAsB,EACtB,UAAkB,EAClB,IAAY;IAEZ,IAAM,KAAK,GAAG,eAAK,CAAC,KAAK,EAAE,UAAA,KAAK;QAC9B,OAAA,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC;IAA1C,CAA0C,CAC3C,CAAC;IACF,IACE,KAAK,KAAK,SAAS;QACnB,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,wBAAc,EAC7D;QACA,OAAO,KAAK,CAAC,QAAQ,CAAC;KACvB;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,EAfI,CAeJ,CAAC;AAjBW,QAAA,oBAAoB,wBAiB/B"}
|
package/lib/store.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Store } from './util';
|
|
2
|
-
import { JsonFormsCore } from './reducers
|
|
3
|
-
import {
|
|
4
|
-
import { JsonFormsRendererRegistryEntry } from './reducers/renderers';
|
|
5
|
-
import { JsonFormsLocaleState } from './reducers/i18n';
|
|
6
|
-
import { JsonFormsUISchemaRegistryEntry } from './reducers/uischemas';
|
|
2
|
+
import { JsonFormsCore, JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry, JsonFormsUISchemaRegistryEntry } from './reducers';
|
|
3
|
+
import { JsonFormsI18nState } from './i18n';
|
|
7
4
|
/**
|
|
8
5
|
* JSONForms store.
|
|
9
6
|
*/
|
|
@@ -36,11 +33,11 @@ export interface JsonFormsSubStates {
|
|
|
36
33
|
*/
|
|
37
34
|
cells?: JsonFormsCellRendererRegistryEntry[];
|
|
38
35
|
/**
|
|
39
|
-
*
|
|
36
|
+
* I18n settings.
|
|
40
37
|
*/
|
|
41
|
-
i18n?:
|
|
38
|
+
i18n?: JsonFormsI18nState;
|
|
42
39
|
/**
|
|
43
|
-
*
|
|
40
|
+
* The UI schema registry used in detail renderers.
|
|
44
41
|
*/
|
|
45
42
|
uischemas?: JsonFormsUISchemaRegistryEntry[];
|
|
46
43
|
/**
|
package/lib/store.js
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
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
|
+
*/
|
|
2
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
27
|
//# sourceMappingURL=store.js.map
|
package/lib/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE"}
|
package/lib/testers/index.d.ts
CHANGED
|
@@ -1,204 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Categorization, ControlElement, UISchemaElement } from '../models/uischema';
|
|
3
|
-
/**
|
|
4
|
-
* Constant that indicates that a tester is not capable of handling
|
|
5
|
-
* a combination of schema/data.
|
|
6
|
-
* @type {number}
|
|
7
|
-
*/
|
|
8
|
-
export declare const NOT_APPLICABLE = -1;
|
|
9
|
-
/**
|
|
10
|
-
* A tester is a function that receives an UI schema and a JSON schema and returns a boolean.
|
|
11
|
-
*/
|
|
12
|
-
export declare type Tester = (uischema: UISchemaElement, schema: JsonSchema) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* A ranked tester associates a tester with a number.
|
|
15
|
-
*/
|
|
16
|
-
export declare type RankedTester = (uischema: UISchemaElement, schema: JsonSchema) => number;
|
|
17
|
-
export declare const isControl: (uischema: any) => uischema is ControlElement;
|
|
18
|
-
/**
|
|
19
|
-
* Only applicable for Controls.
|
|
20
|
-
*
|
|
21
|
-
* This function checks whether the given UI schema is of type Control
|
|
22
|
-
* and if so, resolves the sub-schema referenced by the control and applies
|
|
23
|
-
* the given predicate
|
|
24
|
-
*
|
|
25
|
-
* @param {(JsonSchema) => boolean} predicate the predicate that should be
|
|
26
|
-
* applied to the resolved sub-schema
|
|
27
|
-
*/
|
|
28
|
-
export declare const schemaMatches: (predicate: (schema: JsonSchema) => boolean) => Tester;
|
|
29
|
-
export declare const schemaSubPathMatches: (subPath: string, predicate: (schema: JsonSchema) => boolean) => Tester;
|
|
30
|
-
/**
|
|
31
|
-
* Only applicable for Controls.
|
|
32
|
-
*
|
|
33
|
-
* This function checks whether the given UI schema is of type Control
|
|
34
|
-
* and if so, resolves the sub-schema referenced by the control and checks
|
|
35
|
-
* whether the type of the sub-schema matches the expected one.
|
|
36
|
-
*
|
|
37
|
-
* @param {string} expectedType the expected type of the resolved sub-schema
|
|
38
|
-
*/
|
|
39
|
-
export declare const schemaTypeIs: (expectedType: string) => Tester;
|
|
40
|
-
/**
|
|
41
|
-
* Only applicable for Controls.
|
|
42
|
-
*
|
|
43
|
-
* This function checks whether the given UI schema is of type Control
|
|
44
|
-
* and if so, resolves the sub-schema referenced by the control and checks
|
|
45
|
-
* whether the format of the sub-schema matches the expected one.
|
|
46
|
-
*
|
|
47
|
-
* @param {string} expectedFormat the expected format of the resolved sub-schema
|
|
48
|
-
*/
|
|
49
|
-
export declare const formatIs: (expectedFormat: string) => Tester;
|
|
50
|
-
/**
|
|
51
|
-
* Checks whether the given UI schema has the expected type.
|
|
52
|
-
*
|
|
53
|
-
* @param {string} expected the expected UI schema type
|
|
54
|
-
*/
|
|
55
|
-
export declare const uiTypeIs: (expected: string) => Tester;
|
|
56
|
-
/**
|
|
57
|
-
* Checks whether the given UI schema has an option with the given
|
|
58
|
-
* name and whether it has the expected value. If no options property
|
|
59
|
-
* is set, returns false.
|
|
60
|
-
*
|
|
61
|
-
* @param {string} optionName the name of the option to check
|
|
62
|
-
* @param {any} optionValue the expected value of the option
|
|
63
|
-
*/
|
|
64
|
-
export declare const optionIs: (optionName: string, optionValue: any) => Tester;
|
|
65
|
-
/**
|
|
66
|
-
* Only applicable for Controls.
|
|
67
|
-
*
|
|
68
|
-
* Checks whether the scope of a control ends with the expected string.
|
|
69
|
-
*
|
|
70
|
-
* @param {string} expected the expected ending of the reference
|
|
71
|
-
*/
|
|
72
|
-
export declare const scopeEndsWith: (expected: string) => Tester;
|
|
73
|
-
/**
|
|
74
|
-
* Only applicable for Controls.
|
|
75
|
-
*
|
|
76
|
-
* Checks whether the last segment of the scope matches the expected string.
|
|
77
|
-
*
|
|
78
|
-
* @param {string} expected the expected ending of the reference
|
|
79
|
-
*/
|
|
80
|
-
export declare const scopeEndIs: (expected: string) => Tester;
|
|
81
|
-
/**
|
|
82
|
-
* A tester that allow composing other testers by && them.
|
|
83
|
-
*
|
|
84
|
-
* @param {Array<Tester>} testers the testers to be composed
|
|
85
|
-
*/
|
|
86
|
-
export declare const and: (...testers: Tester[]) => Tester;
|
|
87
|
-
/**
|
|
88
|
-
* A tester that allow composing other testers by || them.
|
|
89
|
-
*
|
|
90
|
-
* @param {Array<Tester>} testers the testers to be composed
|
|
91
|
-
*/
|
|
92
|
-
export declare const or: (...testers: Tester[]) => Tester;
|
|
93
|
-
/**
|
|
94
|
-
* Create a ranked tester that will associate a number with a given tester, if the
|
|
95
|
-
* latter returns true.
|
|
96
|
-
*
|
|
97
|
-
* @param {number} rank the rank to be returned in case the tester returns true
|
|
98
|
-
* @param {Tester} tester a tester
|
|
99
|
-
*/
|
|
100
|
-
export declare const rankWith: (rank: number, tester: Tester) => (uischema: UISchemaElement, schema: JsonSchema) => number;
|
|
101
|
-
export declare const withIncreasedRank: (by: number, rankedTester: RankedTester) => (uischema: UISchemaElement, schema: JsonSchema) => number;
|
|
102
|
-
/**
|
|
103
|
-
* Default tester for boolean.
|
|
104
|
-
* @type {RankedTester}
|
|
105
|
-
*/
|
|
106
|
-
export declare const isBooleanControl: Tester;
|
|
107
|
-
export declare const isObjectControl: Tester;
|
|
108
|
-
export declare const isAllOfControl: Tester;
|
|
109
|
-
export declare const isAnyOfControl: Tester;
|
|
110
|
-
export declare const isOneOfControl: Tester;
|
|
111
|
-
/**
|
|
112
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
113
|
-
* has a 'date' format.
|
|
114
|
-
* @type {Tester}
|
|
115
|
-
*/
|
|
116
|
-
export declare const isDateControl: Tester;
|
|
117
|
-
/**
|
|
118
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
119
|
-
* has an enum.
|
|
120
|
-
* @type {Tester}
|
|
121
|
-
*/
|
|
122
|
-
export declare const isEnumControl: Tester;
|
|
123
|
-
/**
|
|
124
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
125
|
-
* has an enum based on oneOf.
|
|
126
|
-
* @type {Tester}
|
|
127
|
-
*/
|
|
128
|
-
export declare const isOneOfEnumControl: Tester;
|
|
129
|
-
/**
|
|
130
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
131
|
-
* is of type integer
|
|
132
|
-
* @type {Tester}
|
|
133
|
-
*/
|
|
134
|
-
export declare const isIntegerControl: Tester;
|
|
135
|
-
/**
|
|
136
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
137
|
-
* is of type number
|
|
138
|
-
* @type {Tester}
|
|
139
|
-
*/
|
|
140
|
-
export declare const isNumberControl: Tester;
|
|
141
|
-
/**
|
|
142
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
143
|
-
* is of type string
|
|
144
|
-
* @type {Tester}
|
|
145
|
-
*/
|
|
146
|
-
export declare const isStringControl: Tester;
|
|
147
|
-
/**
|
|
148
|
-
* Tests whether the given UI schema is of type Control and if is has
|
|
149
|
-
* a 'multi' option.
|
|
150
|
-
* @type {Tester}
|
|
151
|
-
*/
|
|
152
|
-
export declare const isMultiLineControl: Tester;
|
|
153
|
-
/**
|
|
154
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
155
|
-
* has a 'time' format.
|
|
156
|
-
* @type {Tester}
|
|
157
|
-
*/
|
|
158
|
-
export declare const isTimeControl: Tester;
|
|
159
|
-
/**
|
|
160
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
161
|
-
* has a 'date-time' format.
|
|
162
|
-
* @type {Tester}
|
|
163
|
-
*/
|
|
164
|
-
export declare const isDateTimeControl: Tester;
|
|
165
|
-
/**
|
|
166
|
-
* Tests whether the given schema is an array of objects.
|
|
167
|
-
* @type {Tester}
|
|
168
|
-
*/
|
|
169
|
-
export declare const isObjectArray: Tester;
|
|
170
|
-
/**
|
|
171
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
172
|
-
* is an array of objects.
|
|
173
|
-
* @type {Tester}
|
|
174
|
-
*/
|
|
175
|
-
export declare const isObjectArrayControl: Tester;
|
|
176
|
-
export declare const isObjectArrayWithNesting: (uischema: UISchemaElement, schema: JsonSchema) => boolean;
|
|
177
|
-
/**
|
|
178
|
-
* Synonym for isObjectArrayControl
|
|
179
|
-
*/
|
|
180
|
-
export declare const isArrayObjectControl: Tester;
|
|
181
|
-
/**
|
|
182
|
-
* Tests whether the given UI schema is of type Control and if the schema
|
|
183
|
-
* is an array of a primitive type.
|
|
184
|
-
* @type {Tester}
|
|
185
|
-
*/
|
|
186
|
-
export declare const isPrimitiveArrayControl: Tester;
|
|
187
|
-
/**
|
|
188
|
-
* Tests whether a given UI schema is of type Control,
|
|
189
|
-
* if the schema is of type number or integer and
|
|
190
|
-
* whether the schema defines a numerical range with a default value.
|
|
191
|
-
* @type {Tester}
|
|
192
|
-
*/
|
|
193
|
-
export declare const isRangeControl: Tester;
|
|
194
|
-
/**
|
|
195
|
-
* Tests whether the given UI schema is of type Control, if the schema
|
|
196
|
-
* is of type string and has option format
|
|
197
|
-
* @type {Tester}
|
|
198
|
-
*/
|
|
199
|
-
export declare const isNumberFormatControl: Tester;
|
|
200
|
-
export declare const isCategorization: (category: UISchemaElement) => category is Categorization;
|
|
201
|
-
export declare const isCategory: (uischema: UISchemaElement) => boolean;
|
|
202
|
-
export declare const hasCategory: (categorization: Categorization) => boolean;
|
|
203
|
-
export declare const categorizationHasCategory: (uischema: UISchemaElement) => boolean;
|
|
204
|
-
export declare const not: (tester: Tester) => Tester;
|
|
1
|
+
export * from './testers';
|