@jsonforms/core 3.0.0-alpha.3 → 3.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/globals.html +37 -37
- package/docs/interfaces/arraycontrolprops.html +21 -21
- package/docs/interfaces/arraylayoutprops.html +21 -21
- package/docs/interfaces/cellprops.html +12 -12
- 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 +10 -10
- package/docs/interfaces/dispatchcellstateprops.html +10 -10
- 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 +13 -13
- package/docs/interfaces/enumoption.html +2 -2
- package/docs/interfaces/jsonformsprops.html +9 -9
- package/docs/interfaces/layoutprops.html +10 -10
- package/docs/interfaces/ownpropsofcell.html +9 -9
- package/docs/interfaces/ownpropsofcontrol.html +9 -9
- package/docs/interfaces/ownpropsofenum.html +1 -1
- package/docs/interfaces/ownpropsofenumcell.html +10 -10
- 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/rendererprops.html +9 -9
- package/docs/interfaces/statepropsofarraycontrol.html +17 -17
- package/docs/interfaces/statepropsofarraylayout.html +17 -17
- package/docs/interfaces/statepropsofcell.html +11 -11
- 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 +12 -12
- 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/withclassname.html +1 -1
- package/lib/Helpers.d.ts +5 -5
- package/lib/actions/actions.d.ts +181 -181
- 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 -15
- package/lib/i18n/i18nUtil.d.ts +18 -18
- package/lib/i18n/index.d.ts +2 -2
- package/lib/index.d.ts +11 -11
- 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 -24
- package/lib/reducers/default-data.d.ts +10 -10
- package/lib/reducers/i18n.d.ts +8 -8
- package/lib/reducers/index.d.ts +9 -9
- package/lib/reducers/reducers.d.ts +29 -29
- 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 -53
- 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 -397
- package/lib/util/resolvers.d.ts +25 -25
- package/lib/util/runtime.d.ts +18 -18
- 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 -3
- package/package.json +16 -13
- package/rollup.config.js +44 -0
- package/src/reducers/reducers.ts +2 -2
- package/src/util/cell.ts +4 -4
- package/src/util/renderer.ts +9 -8
- package/stats.html +3279 -0
- package/lib/Helpers.js +0 -33
- package/lib/Helpers.js.map +0 -1
- package/lib/actions/actions.js +0 -173
- 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 -48
- package/lib/configDefault.js.map +0 -1
- package/lib/generators/Generate.js +0 -35
- 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 -154
- package/lib/generators/schema.js.map +0 -1
- package/lib/generators/uischema.js +0 -169
- package/lib/generators/uischema.js.map +0 -1
- package/lib/i18n/i18nTypes.js +0 -3
- package/lib/i18n/i18nTypes.js.map +0 -1
- package/lib/i18n/i18nUtil.js +0 -71
- package/lib/i18n/i18nUtil.js.map +0 -1
- package/lib/i18n/index.js +0 -6
- package/lib/i18n/index.js.map +0 -1
- package/lib/index.js +0 -40
- package/lib/index.js.map +0 -1
- package/lib/jsonforms-core.js +0 -25
- package/lib/jsonforms-core.js.map +0 -1
- package/lib/models/draft4.js +0 -174
- package/lib/models/draft4.js.map +0 -1
- package/lib/models/index.js +0 -33
- 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 -58
- package/lib/models/uischema.js.map +0 -1
- package/lib/reducers/cells.js +0 -42
- package/lib/reducers/cells.js.map +0 -1
- package/lib/reducers/config.js +0 -46
- package/lib/reducers/config.js.map +0 -1
- package/lib/reducers/core.js +0 -294
- package/lib/reducers/core.js.map +0 -1
- package/lib/reducers/default-data.js +0 -45
- package/lib/reducers/default-data.js.map +0 -1
- package/lib/reducers/i18n.js +0 -83
- 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 -98
- package/lib/reducers/reducers.js.map +0 -1
- package/lib/reducers/renderers.js +0 -43
- package/lib/reducers/renderers.js.map +0 -1
- package/lib/reducers/selectors.js +0 -56
- package/lib/reducers/selectors.js.map +0 -1
- package/lib/reducers/uischemas.js +0 -60
- 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 -421
- 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 -44
- package/lib/util/array.js.map +0 -1
- package/lib/util/cell.js +0 -148
- package/lib/util/cell.js.map +0 -1
- package/lib/util/combinators.js +0 -59
- package/lib/util/combinators.js.map +0 -1
- package/lib/util/ids.js +0 -54
- package/lib/util/ids.js.map +0 -1
- package/lib/util/index.js +0 -43
- package/lib/util/index.js.map +0 -1
- package/lib/util/label.js +0 -73
- package/lib/util/label.js.map +0 -1
- package/lib/util/path.js +0 -90
- package/lib/util/path.js.map +0 -1
- package/lib/util/renderer.js +0 -530
- package/lib/util/renderer.js.map +0 -1
- package/lib/util/resolvers.js +0 -169
- package/lib/util/resolvers.js.map +0 -1
- package/lib/util/runtime.js +0 -167
- package/lib/util/runtime.js.map +0 -1
- package/lib/util/schema.js +0 -42
- 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 -56
- package/lib/util/uischema.js.map +0 -1
- package/lib/util/util.js +0 -112
- package/lib/util/util.js.map +0 -1
- package/lib/util/validator.js +0 -37
- package/lib/util/validator.js.map +0 -1
- package/webpack.build.js +0 -13
package/lib/util/array.js
DELETED
|
@@ -1,44 +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
|
-
exports.moveDown = exports.moveUp = void 0;
|
|
28
|
-
var move = function (array, index, delta) {
|
|
29
|
-
var newIndex = index + delta;
|
|
30
|
-
if (newIndex < 0 || newIndex >= array.length) {
|
|
31
|
-
return;
|
|
32
|
-
} // Already at the top or bottom.
|
|
33
|
-
var indexes = [index, newIndex].sort(function (a, b) { return a - b; }); // Sort the indixes
|
|
34
|
-
array.splice(indexes[0], 2, array[indexes[1]], array[indexes[0]]);
|
|
35
|
-
};
|
|
36
|
-
var moveUp = function (array, toMove) {
|
|
37
|
-
move(array, toMove, -1);
|
|
38
|
-
};
|
|
39
|
-
exports.moveUp = moveUp;
|
|
40
|
-
var moveDown = function (array, toMove) {
|
|
41
|
-
move(array, toMove, 1);
|
|
42
|
-
};
|
|
43
|
-
exports.moveDown = moveDown;
|
|
44
|
-
//# sourceMappingURL=array.js.map
|
package/lib/util/array.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../src/util/array.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,IAAM,IAAI,GAAG,UAAC,KAAY,EAAE,KAAa,EAAE,KAAa;IACtD,IAAM,QAAQ,GAAW,KAAK,GAAG,KAAK,CAAC;IACvC,IAAI,QAAQ,GAAG,CAAC,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,EAAE;QAC5C,OAAO;KACR,CAAC,gCAAgC;IAClC,IAAM,OAAO,GAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,GAAG,CAAC,EAAL,CAAK,CAAC,CAAC,CAAC,mBAAmB;IACtF,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF,IAAM,MAAM,GAAG,UAAC,KAAY,EAAE,MAAc;IAC1C,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC,CAAC;AAMO,wBAAM;AAJf,IAAM,QAAQ,GAAG,UAAC,KAAY,EAAE,MAAc;IAC5C,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;AACzB,CAAC,CAAC;AAEe,4BAAQ"}
|
package/lib/util/cell.js
DELETED
|
@@ -1,148 +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
|
-
exports.defaultMapDispatchToControlProps = exports.mapDispatchToCellProps = exports.mapStateToOneOfEnumCellProps = exports.defaultMapStateToEnumCellProps = exports.mapStateToDispatchCellProps = exports.mapStateToCellProps = void 0;
|
|
28
|
-
var tslib_1 = require("tslib");
|
|
29
|
-
var isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
30
|
-
var union_1 = tslib_1.__importDefault(require("lodash/union"));
|
|
31
|
-
var reducers_1 = require("../reducers");
|
|
32
|
-
var util_1 = require("./util");
|
|
33
|
-
var runtime_1 = require("./runtime");
|
|
34
|
-
var renderer_1 = require("./renderer");
|
|
35
|
-
var i18n_1 = require("../i18n");
|
|
36
|
-
/**
|
|
37
|
-
* Map state to cell props.
|
|
38
|
-
*
|
|
39
|
-
* @param state JSONForms state tree
|
|
40
|
-
* @param ownProps any own props
|
|
41
|
-
* @returns {StatePropsOfCell} state props of a cell
|
|
42
|
-
*/
|
|
43
|
-
var mapStateToCellProps = function (state, ownProps) {
|
|
44
|
-
var id = ownProps.id, schema = ownProps.schema, path = ownProps.path, uischema = ownProps.uischema, renderers = ownProps.renderers, cells = ownProps.cells;
|
|
45
|
-
var rootData = reducers_1.getData(state);
|
|
46
|
-
var visible = ownProps.visible !== undefined
|
|
47
|
-
? ownProps.visible
|
|
48
|
-
: runtime_1.isVisible(uischema, rootData, undefined, reducers_1.getAjv(state));
|
|
49
|
-
var rootSchema = reducers_1.getSchema(state);
|
|
50
|
-
var config = reducers_1.getConfig(state);
|
|
51
|
-
/* When determining the enabled state of cells we take a shortcut: At the
|
|
52
|
-
* moment it's only possible to configure enablement and disablement at the
|
|
53
|
-
* control level. Therefore the renderer using the cell, for example a
|
|
54
|
-
* table renderer, determines whether a cell is enabled and should hand
|
|
55
|
-
* over the prop themselves. If that prop was given, we prefer it over
|
|
56
|
-
* anything else to save evaluation effort (except for the global readonly
|
|
57
|
-
* flag). For example it would be quite expensive to evaluate the same ui schema
|
|
58
|
-
* rule again and again for each cell of a table. */
|
|
59
|
-
var enabled;
|
|
60
|
-
if (state.jsonforms.readonly === true) {
|
|
61
|
-
enabled = false;
|
|
62
|
-
}
|
|
63
|
-
else if (typeof ownProps.enabled === 'boolean') {
|
|
64
|
-
enabled = ownProps.enabled;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
enabled = runtime_1.isInherentlyEnabled(state, ownProps, uischema, schema || rootSchema, rootData, config);
|
|
68
|
-
}
|
|
69
|
-
var errors = util_1.formatErrorMessage(union_1.default(reducers_1.getErrorAt(path, schema)(state).map(function (error) { return error.message; })));
|
|
70
|
-
var isValid = isEmpty_1.default(errors);
|
|
71
|
-
return {
|
|
72
|
-
data: util_1.Resolve.data(rootData, path),
|
|
73
|
-
visible: visible,
|
|
74
|
-
enabled: enabled,
|
|
75
|
-
id: id,
|
|
76
|
-
path: path,
|
|
77
|
-
errors: errors,
|
|
78
|
-
isValid: isValid,
|
|
79
|
-
schema: schema,
|
|
80
|
-
uischema: uischema,
|
|
81
|
-
config: reducers_1.getConfig(state),
|
|
82
|
-
rootSchema: rootSchema,
|
|
83
|
-
renderers: renderers,
|
|
84
|
-
cells: cells
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
exports.mapStateToCellProps = mapStateToCellProps;
|
|
88
|
-
var mapStateToDispatchCellProps = function (state, ownProps) {
|
|
89
|
-
var props = exports.mapStateToCellProps(state, ownProps);
|
|
90
|
-
var renderers = ownProps.renderers, cells = ownProps.cells, otherOwnProps = tslib_1.__rest(ownProps, ["renderers", "cells"]);
|
|
91
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, props), otherOwnProps), { cells: cells || state.jsonforms.cells || [] });
|
|
92
|
-
};
|
|
93
|
-
exports.mapStateToDispatchCellProps = mapStateToDispatchCellProps;
|
|
94
|
-
/**
|
|
95
|
-
* Default mapStateToCellProps for enum cell. Options is used for populating dropdown list
|
|
96
|
-
* @param state
|
|
97
|
-
* @param ownProps
|
|
98
|
-
* @returns {StatePropsOfEnumCell}
|
|
99
|
-
*/
|
|
100
|
-
var defaultMapStateToEnumCellProps = function (state, ownProps) {
|
|
101
|
-
var _a;
|
|
102
|
-
var props = exports.mapStateToCellProps(state, ownProps);
|
|
103
|
-
var options = ownProps.options ||
|
|
104
|
-
((_a = props.schema.enum) === null || _a === void 0 ? void 0 : _a.map(function (e) {
|
|
105
|
-
return renderer_1.enumToEnumOptionMapper(e, reducers_1.getTranslator()(state), i18n_1.getI18nKeyPrefix(props.schema, props.uischema, props.path));
|
|
106
|
-
})) ||
|
|
107
|
-
(props.schema.const && [
|
|
108
|
-
renderer_1.enumToEnumOptionMapper(props.schema.const, reducers_1.getTranslator()(state), i18n_1.getI18nKeyPrefix(props.schema, props.uischema, props.path))
|
|
109
|
-
]);
|
|
110
|
-
return tslib_1.__assign(tslib_1.__assign({}, props), { options: options });
|
|
111
|
-
};
|
|
112
|
-
exports.defaultMapStateToEnumCellProps = defaultMapStateToEnumCellProps;
|
|
113
|
-
/**
|
|
114
|
-
* mapStateToOneOfEnumCellProps for one of enum cell. Options is used for populating dropdown list from oneOf
|
|
115
|
-
* @param state
|
|
116
|
-
* @param ownProps
|
|
117
|
-
* @returns {StatePropsOfEnumCell}
|
|
118
|
-
*/
|
|
119
|
-
var mapStateToOneOfEnumCellProps = function (state, ownProps) {
|
|
120
|
-
var _a;
|
|
121
|
-
var props = exports.mapStateToCellProps(state, ownProps);
|
|
122
|
-
var options = ownProps.options ||
|
|
123
|
-
((_a = props.schema.oneOf) === null || _a === void 0 ? void 0 : _a.map(function (oneOfSubSchema) {
|
|
124
|
-
return renderer_1.oneOfToEnumOptionMapper(oneOfSubSchema, reducers_1.getTranslator()(state), i18n_1.getI18nKeyPrefix(props.schema, props.uischema, props.path));
|
|
125
|
-
}));
|
|
126
|
-
return tslib_1.__assign(tslib_1.__assign({}, props), { options: options });
|
|
127
|
-
};
|
|
128
|
-
exports.mapStateToOneOfEnumCellProps = mapStateToOneOfEnumCellProps;
|
|
129
|
-
/**
|
|
130
|
-
* Synonym for mapDispatchToControlProps.
|
|
131
|
-
*
|
|
132
|
-
* @type {(dispatch) => {handleChange(path, value): void}}
|
|
133
|
-
*/
|
|
134
|
-
exports.mapDispatchToCellProps = renderer_1.mapDispatchToControlProps;
|
|
135
|
-
/**
|
|
136
|
-
* Default dispatch to control props which can be customized to set handleChange action
|
|
137
|
-
*
|
|
138
|
-
*/
|
|
139
|
-
var defaultMapDispatchToControlProps =
|
|
140
|
-
// TODO: ownProps types
|
|
141
|
-
function (dispatch, ownProps) {
|
|
142
|
-
var handleChange = exports.mapDispatchToCellProps(dispatch).handleChange;
|
|
143
|
-
return {
|
|
144
|
-
handleChange: ownProps.handleChange || handleChange
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
exports.defaultMapDispatchToControlProps = defaultMapDispatchToControlProps;
|
|
148
|
-
//# sourceMappingURL=cell.js.map
|
package/lib/util/cell.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cell.js","sourceRoot":"","sources":["../../src/util/cell.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;;AAEF,mEAAqC;AACrC,+DAAiC;AACjC,wCAQqB;AAErB,+BAGgB;AAChB,qCAGmB;AACnB,uCASoB;AAGpB,gCAA2C;AAgD3C;;;;;;GAMG;AACI,IAAM,mBAAmB,GAAG,UACjC,KAAqB,EACrB,QAAwB;IAEhB,IAAA,EAAE,GAA+C,QAAQ,GAAv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
-
/*
|
|
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.createCombinatorRenderInfos = exports.resolveSubSchemas = void 0;
|
|
28
|
-
var tslib_1 = require("tslib");
|
|
29
|
-
var resolvers_1 = require("./resolvers");
|
|
30
|
-
var reducers_1 = require("../reducers");
|
|
31
|
-
var createLabel = function (subSchema, subSchemaIndex, keyword) {
|
|
32
|
-
if (subSchema.title) {
|
|
33
|
-
return subSchema.title;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return keyword + '-' + subSchemaIndex;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
var resolveSubSchemas = function (schema, rootSchema, keyword) {
|
|
40
|
-
var _a;
|
|
41
|
-
// resolve any $refs, otherwise the generated UI schema can't match the schema???
|
|
42
|
-
var schemas = schema[keyword];
|
|
43
|
-
if (schemas.findIndex(function (e) { return e.$ref !== undefined; }) !== -1) {
|
|
44
|
-
return tslib_1.__assign(tslib_1.__assign({}, schema), (_a = {}, _a[keyword] = schema[keyword].map(function (e) {
|
|
45
|
-
return e.$ref ? resolvers_1.resolveSchema(rootSchema, e.$ref) : e;
|
|
46
|
-
}), _a));
|
|
47
|
-
}
|
|
48
|
-
return schema;
|
|
49
|
-
};
|
|
50
|
-
exports.resolveSubSchemas = resolveSubSchemas;
|
|
51
|
-
var createCombinatorRenderInfos = function (combinatorSubSchemas, rootSchema, keyword, control, path, uischemas) {
|
|
52
|
-
return combinatorSubSchemas.map(function (subSchema, subSchemaIndex) { return ({
|
|
53
|
-
schema: subSchema,
|
|
54
|
-
uischema: reducers_1.findUISchema(uischemas, subSchema, control.scope, path, undefined, control, rootSchema),
|
|
55
|
-
label: createLabel(subSchema, subSchemaIndex, keyword)
|
|
56
|
-
}); });
|
|
57
|
-
};
|
|
58
|
-
exports.createCombinatorRenderInfos = createCombinatorRenderInfos;
|
|
59
|
-
//# sourceMappingURL=combinators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combinators.js","sourceRoot":"","sources":["../../src/util/combinators.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;;AAGF,yCAA4C;AAC5C,wCAA2E;AAU3E,IAAM,WAAW,GAAG,UAClB,SAAqB,EACrB,cAAsB,EACtB,OAA0B;IAE1B,IAAI,SAAS,CAAC,KAAK,EAAE;QACnB,OAAO,SAAS,CAAC,KAAK,CAAC;KACxB;SAAM;QACL,OAAO,OAAO,GAAG,G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
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.clearAllIds = exports.removeId = exports.createId = void 0;
|
|
28
|
-
var usedIds = new Set();
|
|
29
|
-
var makeId = function (idBase, iteration) {
|
|
30
|
-
return iteration <= 1 ? idBase : idBase + iteration.toString();
|
|
31
|
-
};
|
|
32
|
-
var isUniqueId = function (idBase, iteration) {
|
|
33
|
-
var newID = makeId(idBase, iteration);
|
|
34
|
-
return !usedIds.has(newID);
|
|
35
|
-
};
|
|
36
|
-
var createId = function (proposedId) {
|
|
37
|
-
if (proposedId === undefined) {
|
|
38
|
-
// failsafe to avoid endless loops in error cases
|
|
39
|
-
proposedId = 'undefined';
|
|
40
|
-
}
|
|
41
|
-
var tries = 0;
|
|
42
|
-
while (!isUniqueId(proposedId, tries)) {
|
|
43
|
-
tries++;
|
|
44
|
-
}
|
|
45
|
-
var newID = makeId(proposedId, tries);
|
|
46
|
-
usedIds.add(newID);
|
|
47
|
-
return newID;
|
|
48
|
-
};
|
|
49
|
-
exports.createId = createId;
|
|
50
|
-
var removeId = function (id) { return usedIds.delete(id); };
|
|
51
|
-
exports.removeId = removeId;
|
|
52
|
-
var clearAllIds = function () { return usedIds.clear(); };
|
|
53
|
-
exports.clearAllIds = clearAllIds;
|
|
54
|
-
//# sourceMappingURL=ids.js.map
|
package/lib/util/ids.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/util/ids.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,IAAM,OAAO,GAAgB,IAAI,GAAG,EAAU,CAAC;AAE/C,IAAM,MAAM,GAAG,UAAC,MAAc,EAAE,SAAiB;IAC/C,OAAA,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE;AAAvD,CAAuD,CAAC;AAE1D,IAAM,UAAU,GAAG,UAAC,MAAc,EAAE,SAAiB;IACnD,IAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACxC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEK,IAAM,QAAQ,GAAG,UAAC,UAAkB;IACzC,IAAI,UAAU,KAAK,SAAS,EAAE;QAC5B,iDAAiD;QACjD,UAAU,GAAG,WAAW,CAAC;KAC1B;IACD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE;QACrC,KAAK,EAAE,CAAC;KACT;IACD,IAAM,KAAK,GAAG,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAZW,QAAA,QAAQ,YAYnB;AAEK,IAAM,QAAQ,GAAG,UAAC,EAAU,IAAK,OAAA,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,EAAlB,CAAkB,CAAC;AAA9C,QAAA,QAAQ,YAAsC;AAEpD,IAAM,WAAW,GAAG,cAAM,OAAA,OAAO,CAAC,KAAK,EAAE,EAAf,CAAe,CAAC;AAApC,QAAA,WAAW,eAAyB"}
|
package/lib/util/index.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
The MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2017-2019 EclipseSource Munich
|
|
6
|
-
https://github.com/eclipsesource/jsonforms
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
var tslib_1 = require("tslib");
|
|
28
|
-
tslib_1.__exportStar(require("./array"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./cell"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./combinators"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./Formatted"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./ids"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./label"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./path"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("./renderer"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("./resolvers"), exports);
|
|
37
|
-
tslib_1.__exportStar(require("./runtime"), exports);
|
|
38
|
-
tslib_1.__exportStar(require("./schema"), exports);
|
|
39
|
-
tslib_1.__exportStar(require("./type"), exports);
|
|
40
|
-
tslib_1.__exportStar(require("./uischema"), exports);
|
|
41
|
-
tslib_1.__exportStar(require("./util"), exports);
|
|
42
|
-
tslib_1.__exportStar(require("./validator"), exports);
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
package/lib/util/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,kDAAwB;AACxB,iDAAuB;AACvB,wDAA8B;AAC9B,sDAA4B;AAC5B,gDAAsB;AACtB,kDAAwB;AACxB,iDAAuB;AACvB,qDAA2B;AAC3B,sDAA4B;AAC5B,oDAA0B;AAC1B,mDAAyB;AACzB,iDAAuB;AACvB,qDAA2B;AAC3B,iDAAuB;AACvB,sDAA4B"}
|
package/lib/util/label.js
DELETED
|
@@ -1,73 +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
|
-
exports.createLabelDescriptionFrom = exports.createCleanLabel = void 0;
|
|
28
|
-
var tslib_1 = require("tslib");
|
|
29
|
-
var startCase_1 = tslib_1.__importDefault(require("lodash/startCase"));
|
|
30
|
-
var deriveLabel = function (controlElement, schemaElement) {
|
|
31
|
-
if (schemaElement && typeof schemaElement.title === 'string') {
|
|
32
|
-
return schemaElement.title;
|
|
33
|
-
}
|
|
34
|
-
if (typeof controlElement.scope === 'string') {
|
|
35
|
-
var ref = controlElement.scope;
|
|
36
|
-
var label = ref.substr(ref.lastIndexOf('/') + 1);
|
|
37
|
-
return startCase_1.default(label);
|
|
38
|
-
}
|
|
39
|
-
return '';
|
|
40
|
-
};
|
|
41
|
-
var createCleanLabel = function (label) {
|
|
42
|
-
return startCase_1.default(label.replace('_', ' '));
|
|
43
|
-
};
|
|
44
|
-
exports.createCleanLabel = createCleanLabel;
|
|
45
|
-
/**
|
|
46
|
-
* Return a label object based on the given control and schema element.
|
|
47
|
-
* @param {ControlElement} withLabel the UI schema to obtain a label object for
|
|
48
|
-
* @param {JsonSchema} schema optional: the corresponding schema element
|
|
49
|
-
* @returns {LabelDescription}
|
|
50
|
-
*/
|
|
51
|
-
var createLabelDescriptionFrom = function (withLabel, schema) {
|
|
52
|
-
var labelProperty = withLabel.label;
|
|
53
|
-
if (typeof labelProperty === 'boolean') {
|
|
54
|
-
return labelDescription(deriveLabel(withLabel, schema), labelProperty);
|
|
55
|
-
}
|
|
56
|
-
if (typeof labelProperty === 'string') {
|
|
57
|
-
return labelDescription(labelProperty, true);
|
|
58
|
-
}
|
|
59
|
-
if (typeof labelProperty === 'object') {
|
|
60
|
-
var label = typeof labelProperty.text === 'string'
|
|
61
|
-
? labelProperty.text
|
|
62
|
-
: deriveLabel(withLabel, schema);
|
|
63
|
-
var show = typeof labelProperty.show === 'boolean' ? labelProperty.show : true;
|
|
64
|
-
return labelDescription(label, show);
|
|
65
|
-
}
|
|
66
|
-
return labelDescription(deriveLabel(withLabel, schema), true);
|
|
67
|
-
};
|
|
68
|
-
exports.createLabelDescriptionFrom = createLabelDescriptionFrom;
|
|
69
|
-
var labelDescription = function (text, show) { return ({
|
|
70
|
-
text: text,
|
|
71
|
-
show: show
|
|
72
|
-
}); };
|
|
73
|
-
//# sourceMappingURL=label.js.map
|
package/lib/util/label.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../src/util/label.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;;AAEF,uEAAyC;AAIzC,IAAM,WAAW,GAAG,UAClB,cAA8B,EAC9B,aAA0B;IAE1B,IAAI,aAAa,IAAI,OAAO,aAAa,CAAC,KAAK,KAAK,QAAQ,EAAE;QAC5D,OAAO,aAAa,CAAC,KAAK,CAAC;KAC5B;IACD,IAAI,OAAO,cAAc,CAAC,KAAK,KAAK,QAAQ,EAAE;QAC5C,IAAM,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC;QACjC,IAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAEnD,OAAO,mBAAS,CAAC,KAAK,CAAC,CAAC;KACzB;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEK,IAAM,gBAAgB,GAAG,UAAC,KAAa;IAC5C,OAAO,mBAAS,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AAEF;;;;;GAKG;AACI,IAAM,0BAA0B,GAAG,UACxC,SAAyB,EACzB,MAAmB;IAEnB,IAAM,aAAa,GAAG,SAAS,CAAC,KAAK,CAAC;IACtC,IAAI,OAAO,aAAa,KAAK,SAAS,EAAE;QACtC,OAAO,gBAAgB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC;KACxE;IACD,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QACrC,OAAO,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;KAC9C;IACD,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QACrC,IAAM,KAAK,GACT,OAAO,aAAa,CAAC,IAAI,KAAK,QAAQ;YACpC,CAAC,CAAC,aAAa,CAAC,IAAI;YACpB,CAAC,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACrC,IAAM,IAAI,GACR,OAAO,aAAa,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QACtE,OAAO,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;KACtC;IACD,OAAO,gBAAgB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC,CAAC;AArBW,QAAA,0BAA0B,8BAqBrC;AAEF,IAAM,gBAAgB,GAAG,UAAC,IAAY,EAAE,IAAa,IAAuB,OAAA,CAAC;IAC3E,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;CACX,CAAC,EAH0E,CAG1E,CAAC"}
|
package/lib/util/path.js
DELETED
|
@@ -1,90 +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
|
-
exports.composeWithUi = exports.toDataPath = exports.toDataPathSegments = exports.composePaths = exports.compose = void 0;
|
|
28
|
-
var tslib_1 = require("tslib");
|
|
29
|
-
var isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
30
|
-
var range_1 = tslib_1.__importDefault(require("lodash/range"));
|
|
31
|
-
var compose = function (path1, path2) {
|
|
32
|
-
var p1 = path1;
|
|
33
|
-
if (!isEmpty_1.default(path1) && !isEmpty_1.default(path2) && !path2.startsWith('[')) {
|
|
34
|
-
p1 = path1 + '.';
|
|
35
|
-
}
|
|
36
|
-
if (isEmpty_1.default(p1)) {
|
|
37
|
-
return path2;
|
|
38
|
-
}
|
|
39
|
-
else if (isEmpty_1.default(path2)) {
|
|
40
|
-
return p1;
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
return "" + p1 + path2;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
exports.compose = compose;
|
|
47
|
-
exports.composePaths = exports.compose;
|
|
48
|
-
/**
|
|
49
|
-
* Convert a schema path (i.e. JSON pointer) to an array by splitting
|
|
50
|
-
* at the '/' character and removing all schema-specific keywords.
|
|
51
|
-
*
|
|
52
|
-
* The returned value can be used to de-reference a root object by folding over it
|
|
53
|
-
* and de-referencing the single segments to obtain a new object.
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* @param {string} schemaPath the schema path to be converted
|
|
57
|
-
* @returns {string[]} an array containing only non-schema-specific segments
|
|
58
|
-
*/
|
|
59
|
-
var toDataPathSegments = function (schemaPath) {
|
|
60
|
-
var s = schemaPath
|
|
61
|
-
.replace(/anyOf\/[\d]\//g, '')
|
|
62
|
-
.replace(/allOf\/[\d]\//g, '')
|
|
63
|
-
.replace(/oneOf\/[\d]\//g, '');
|
|
64
|
-
var segments = s.split('/');
|
|
65
|
-
var startFromRoot = segments[0] === '#' || segments[0] === '';
|
|
66
|
-
var startIndex = startFromRoot ? 2 : 1;
|
|
67
|
-
return range_1.default(startIndex, segments.length, 2).map(function (idx) { return segments[idx]; });
|
|
68
|
-
};
|
|
69
|
-
exports.toDataPathSegments = toDataPathSegments;
|
|
70
|
-
/**
|
|
71
|
-
* Remove all schema-specific keywords (e.g. 'properties') from a given path.
|
|
72
|
-
* @example
|
|
73
|
-
* toDataPath('#/properties/foo/properties/bar') === '#/foo/bar')
|
|
74
|
-
*
|
|
75
|
-
* @param {string} schemaPath the schema path to be converted
|
|
76
|
-
* @returns {string} the path without schema-specific keywords
|
|
77
|
-
*/
|
|
78
|
-
var toDataPath = function (schemaPath) {
|
|
79
|
-
return exports.toDataPathSegments(schemaPath).join('.');
|
|
80
|
-
};
|
|
81
|
-
exports.toDataPath = toDataPath;
|
|
82
|
-
var composeWithUi = function (scopableUi, path) {
|
|
83
|
-
var segments = exports.toDataPathSegments(scopableUi.scope);
|
|
84
|
-
if (isEmpty_1.default(segments) && path === undefined) {
|
|
85
|
-
return '';
|
|
86
|
-
}
|
|
87
|
-
return isEmpty_1.default(segments) ? path : exports.compose(path, segments.join('.'));
|
|
88
|
-
};
|
|
89
|
-
exports.composeWithUi = composeWithUi;
|
|
90
|
-
//# sourceMappingURL=path.js.map
|
package/lib/util/path.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/util/path.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;;AAEF,mEAAqC;AACrC,+DAAiC;AAG1B,IAAM,OAAO,GAAG,UAAC,KAAa,EAAE,KAAa;IAClD,IAAI,EAAE,GAAG,KAAK,CAAC;IACf,IAAI,CAAC,iBAAO,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAChE,EAAE,GAAG,KAAK,GAAG,GAAG,CAAC;KAClB;IAED,IAAI,iBAAO,CAAC,EAAE,CAAC,EAAE;QACf,OAAO,KAAK,CAAC;KACd;SAAM,IAAI,iBAAO,CAAC,KAAK,CAAC,EAAE;QACzB,OAAO,EAAE,CAAC;KACX;SAAM;QACL,OAAO,KAAG,EAAE,GAAG,KAAO,CAAC;KACxB;AACH,CAAC,CAAC;AAbW,QAAA,OAAO,WAalB;AAEkB,uBAfP,eAAO,CAeY;AAEhC;;;;;;;;;;GAUG;AACI,IAAM,kBAAkB,GAAG,UAAC,UAAkB;IACnD,IAAM,CAAC,GAAG,UAAU;SACjB,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;SAC7B,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;SAC7B,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;IACjC,IAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE9B,IAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IAChE,IAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,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