@jsonforms/core 3.0.0-alpha.1 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/docs/assets/js/search.json +1 -1
  2. package/docs/globals.html +822 -405
  3. package/docs/index.html +69 -36
  4. package/docs/interfaces/addcellrendereraction.html +3 -3
  5. package/docs/interfaces/addrendereraction.html +3 -3
  6. package/docs/interfaces/adduischemaaction.html +3 -3
  7. package/docs/interfaces/arraycontrolprops.html +21 -21
  8. package/docs/interfaces/arraylayoutprops.html +21 -21
  9. package/docs/interfaces/cellprops.html +14 -14
  10. package/docs/interfaces/combinatorrendererprops.html +13 -13
  11. package/docs/interfaces/controlprops.html +16 -16
  12. package/docs/interfaces/controlstate.html +2 -2
  13. package/docs/interfaces/controlwithdetailprops.html +17 -17
  14. package/docs/interfaces/dispatchcellprops.html +13 -13
  15. package/docs/interfaces/dispatchcellstateprops.html +13 -13
  16. package/docs/interfaces/dispatchpropsofarraycontrol.html +4 -4
  17. package/docs/interfaces/dispatchpropsofcontrol.html +1 -1
  18. package/docs/interfaces/dispatchpropsofmultienumcontrol.html +2 -2
  19. package/docs/interfaces/enumcellprops.html +15 -15
  20. package/docs/interfaces/enumoption.html +2 -2
  21. package/docs/interfaces/initaction.html +6 -6
  22. package/docs/interfaces/initactionoptions.html +3 -3
  23. package/docs/interfaces/jsonformscore.html +7 -7
  24. package/docs/interfaces/{jsonformslocalestate.html → jsonformsi18nstate.html} +20 -20
  25. package/docs/interfaces/jsonformsprops.html +9 -9
  26. package/docs/interfaces/jsonformssubstates.html +11 -1
  27. package/docs/interfaces/layoutprops.html +10 -10
  28. package/docs/interfaces/ownpropsofcell.html +10 -10
  29. package/docs/interfaces/ownpropsofcontrol.html +9 -9
  30. package/docs/interfaces/ownpropsofenum.html +1 -1
  31. package/docs/interfaces/ownpropsofenumcell.html +11 -11
  32. package/docs/interfaces/ownpropsofjsonformsrenderer.html +8 -8
  33. package/docs/interfaces/ownpropsoflayout.html +9 -9
  34. package/docs/interfaces/ownpropsofmasterlistitem.html +6 -6
  35. package/docs/interfaces/ownpropsofrenderer.html +8 -8
  36. package/docs/interfaces/registerdefaultdataaction.html +3 -3
  37. package/docs/interfaces/removecellrendereraction.html +3 -3
  38. package/docs/interfaces/removerendereraction.html +3 -3
  39. package/docs/interfaces/removeuischemaaction.html +2 -2
  40. package/docs/interfaces/rendererprops.html +9 -9
  41. package/docs/interfaces/setajvaction.html +3 -3
  42. package/docs/interfaces/setconfigaction.html +2 -2
  43. package/docs/interfaces/setlocaleaction.html +3 -3
  44. package/docs/interfaces/setschemaaction.html +2 -2
  45. package/docs/interfaces/{setlocalizedschemasaction.html → settranslatoraction.html} +29 -15
  46. package/docs/interfaces/setuischemaaction.html +2 -2
  47. package/docs/interfaces/setvalidationmodeaction.html +2 -2
  48. package/docs/interfaces/statepropsofarraycontrol.html +17 -17
  49. package/docs/interfaces/statepropsofarraylayout.html +17 -17
  50. package/docs/interfaces/statepropsofcell.html +13 -13
  51. package/docs/interfaces/statepropsofcombinator.html +12 -12
  52. package/docs/interfaces/statepropsofcontrol.html +15 -15
  53. package/docs/interfaces/statepropsofcontrolwithdetail.html +16 -16
  54. package/docs/interfaces/statepropsofenumcell.html +14 -14
  55. package/docs/interfaces/statepropsofjsonformsrenderer.html +9 -9
  56. package/docs/interfaces/statepropsoflayout.html +10 -10
  57. package/docs/interfaces/statepropsofmasteritem.html +7 -7
  58. package/docs/interfaces/statepropsofrenderer.html +9 -9
  59. package/docs/interfaces/statepropsofscopedrenderer.html +12 -12
  60. package/docs/interfaces/unregisterdefaultdataaction.html +2 -2
  61. package/docs/interfaces/updateaction.html +3 -3
  62. package/docs/interfaces/updatecoreaction.html +6 -6
  63. package/docs/interfaces/updateerrorsaction.html +2 -2
  64. package/docs/interfaces/{setlocalizeduischemasaction.html → updatei18naction.html} +43 -15
  65. package/docs/interfaces/withclassname.html +1 -1
  66. package/lib/Helpers.d.ts +5 -5
  67. package/lib/actions/actions.d.ts +181 -177
  68. package/lib/actions/index.d.ts +1 -1
  69. package/lib/configDefault.d.ts +6 -6
  70. package/lib/generators/Generate.d.ts +6 -6
  71. package/lib/generators/index.d.ts +3 -3
  72. package/lib/generators/schema.d.ts +8 -8
  73. package/lib/generators/uischema.d.ts +12 -12
  74. package/lib/i18n/i18nTypes.d.ts +15 -0
  75. package/lib/i18n/i18nUtil.d.ts +18 -0
  76. package/lib/i18n/index.d.ts +2 -0
  77. package/lib/index.d.ts +11 -10
  78. package/lib/jsonforms-core.cjs.js +2445 -0
  79. package/lib/jsonforms-core.cjs.js.map +1 -0
  80. package/lib/jsonforms-core.esm.js +2164 -0
  81. package/lib/jsonforms-core.esm.js.map +1 -0
  82. package/lib/models/draft4.d.ts +198 -198
  83. package/lib/models/index.d.ts +5 -5
  84. package/lib/models/jsonSchema.d.ts +3 -3
  85. package/lib/models/jsonSchema4.d.ts +110 -110
  86. package/lib/models/jsonSchema7.d.ts +119 -119
  87. package/lib/models/uischema.d.ts +201 -201
  88. package/lib/reducers/cells.d.ts +11 -11
  89. package/lib/reducers/config.d.ts +3 -3
  90. package/lib/reducers/core.d.ts +24 -23
  91. package/lib/reducers/default-data.d.ts +10 -10
  92. package/lib/reducers/i18n.d.ts +8 -11
  93. package/lib/reducers/index.d.ts +9 -9
  94. package/lib/reducers/reducers.d.ts +29 -36
  95. package/lib/reducers/renderers.d.ts +10 -10
  96. package/lib/reducers/selectors.d.ts +15 -15
  97. package/lib/reducers/uischemas.d.ts +10 -10
  98. package/lib/store.d.ts +53 -52
  99. package/lib/testers/index.d.ts +1 -1
  100. package/lib/testers/testers.d.ts +203 -203
  101. package/lib/util/Formatted.d.ts +19 -19
  102. package/lib/util/array.d.ts +3 -3
  103. package/lib/util/cell.d.ts +79 -79
  104. package/lib/util/combinators.d.ts +10 -10
  105. package/lib/util/ids.d.ts +3 -3
  106. package/lib/util/index.d.ts +15 -15
  107. package/lib/util/label.d.ts +9 -9
  108. package/lib/util/path.d.ts +25 -25
  109. package/lib/util/renderer.d.ts +398 -387
  110. package/lib/util/resolvers.d.ts +25 -25
  111. package/lib/util/runtime.d.ts +18 -19
  112. package/lib/util/schema.d.ts +1 -1
  113. package/lib/util/type.d.ts +174 -174
  114. package/lib/util/uischema.d.ts +5 -5
  115. package/lib/util/util.d.ts +31 -31
  116. package/lib/util/validator.d.ts +3 -2
  117. package/package.json +18 -14
  118. package/rollup.config.js +44 -0
  119. package/src/actions/actions.ts +46 -36
  120. package/src/i18n/i18nTypes.ts +17 -0
  121. package/src/i18n/i18nUtil.ts +105 -0
  122. package/src/i18n/index.ts +2 -0
  123. package/src/index.ts +1 -0
  124. package/src/reducers/core.ts +70 -48
  125. package/src/reducers/i18n.ts +41 -35
  126. package/src/reducers/reducers.ts +10 -29
  127. package/src/reducers/selectors.ts +1 -1
  128. package/src/store.ts +4 -4
  129. package/src/util/cell.ts +26 -6
  130. package/src/util/renderer.ts +127 -38
  131. package/src/util/runtime.ts +1 -1
  132. package/src/util/util.ts +1 -1
  133. package/src/util/validator.ts +5 -9
  134. package/stats.html +3279 -0
  135. package/{lib/reducers/cells.js → test/i18n/i18nUtil.test.ts} +25 -17
  136. package/test/reducers/core.test.ts +31 -44
  137. package/test/util/cell.test.ts +2 -2
  138. package/test/util/renderer.test.ts +488 -35
  139. package/lib/Helpers.js +0 -32
  140. package/lib/Helpers.js.map +0 -1
  141. package/lib/actions/actions.js +0 -149
  142. package/lib/actions/actions.js.map +0 -1
  143. package/lib/actions/index.js +0 -29
  144. package/lib/actions/index.js.map +0 -1
  145. package/lib/configDefault.js +0 -47
  146. package/lib/configDefault.js.map +0 -1
  147. package/lib/generators/Generate.js +0 -34
  148. package/lib/generators/Generate.js.map +0 -1
  149. package/lib/generators/index.js +0 -31
  150. package/lib/generators/index.js.map +0 -1
  151. package/lib/generators/schema.js +0 -152
  152. package/lib/generators/schema.js.map +0 -1
  153. package/lib/generators/uischema.js +0 -166
  154. package/lib/generators/uischema.js.map +0 -1
  155. package/lib/index.js +0 -37
  156. package/lib/index.js.map +0 -1
  157. package/lib/jsonforms-core.js +0 -19
  158. package/lib/jsonforms-core.js.map +0 -1
  159. package/lib/models/draft4.js +0 -173
  160. package/lib/models/draft4.js.map +0 -1
  161. package/lib/models/index.js +0 -30
  162. package/lib/models/index.js.map +0 -1
  163. package/lib/models/jsonSchema.js +0 -27
  164. package/lib/models/jsonSchema.js.map +0 -1
  165. package/lib/models/jsonSchema4.js +0 -30
  166. package/lib/models/jsonSchema4.js.map +0 -1
  167. package/lib/models/jsonSchema7.js +0 -30
  168. package/lib/models/jsonSchema7.js.map +0 -1
  169. package/lib/models/uischema.js +0 -55
  170. package/lib/models/uischema.js.map +0 -1
  171. package/lib/reducers/cells.js.map +0 -1
  172. package/lib/reducers/config.js +0 -44
  173. package/lib/reducers/config.js.map +0 -1
  174. package/lib/reducers/core.js +0 -259
  175. package/lib/reducers/core.js.map +0 -1
  176. package/lib/reducers/default-data.js +0 -42
  177. package/lib/reducers/default-data.js.map +0 -1
  178. package/lib/reducers/i18n.js +0 -65
  179. package/lib/reducers/i18n.js.map +0 -1
  180. package/lib/reducers/index.js +0 -37
  181. package/lib/reducers/index.js.map +0 -1
  182. package/lib/reducers/reducers.js +0 -99
  183. package/lib/reducers/reducers.js.map +0 -1
  184. package/lib/reducers/renderers.js +0 -41
  185. package/lib/reducers/renderers.js.map +0 -1
  186. package/lib/reducers/selectors.js +0 -47
  187. package/lib/reducers/selectors.js.map +0 -1
  188. package/lib/reducers/uischemas.js +0 -57
  189. package/lib/reducers/uischemas.js.map +0 -1
  190. package/lib/store.js +0 -27
  191. package/lib/store.js.map +0 -1
  192. package/lib/testers/index.js +0 -29
  193. package/lib/testers/index.js.map +0 -1
  194. package/lib/testers/testers.js +0 -401
  195. package/lib/testers/testers.js.map +0 -1
  196. package/lib/util/Formatted.js +0 -27
  197. package/lib/util/Formatted.js.map +0 -1
  198. package/lib/util/array.js +0 -43
  199. package/lib/util/array.js.map +0 -1
  200. package/lib/util/cell.js +0 -133
  201. package/lib/util/cell.js.map +0 -1
  202. package/lib/util/combinators.js +0 -56
  203. package/lib/util/combinators.js.map +0 -1
  204. package/lib/util/ids.js +0 -50
  205. package/lib/util/ids.js.map +0 -1
  206. package/lib/util/index.js +0 -41
  207. package/lib/util/index.js.map +0 -1
  208. package/lib/util/label.js +0 -70
  209. package/lib/util/label.js.map +0 -1
  210. package/lib/util/path.js +0 -85
  211. package/lib/util/path.js.map +0 -1
  212. package/lib/util/renderer.js +0 -451
  213. package/lib/util/renderer.js.map +0 -1
  214. package/lib/util/resolvers.js +0 -165
  215. package/lib/util/resolvers.js.map +0 -1
  216. package/lib/util/runtime.js +0 -159
  217. package/lib/util/runtime.js.map +0 -1
  218. package/lib/util/schema.js +0 -40
  219. package/lib/util/schema.js.map +0 -1
  220. package/lib/util/type.js +0 -27
  221. package/lib/util/type.js.map +0 -1
  222. package/lib/util/uischema.js +0 -52
  223. package/lib/util/uischema.js.map +0 -1
  224. package/lib/util/util.js +0 -107
  225. package/lib/util/util.js.map +0 -1
  226. package/lib/util/validator.js +0 -36
  227. package/lib/util/validator.js.map +0 -1
  228. package/webpack.build.js +0 -13
@@ -1,57 +0,0 @@
1
- "use strict";
2
- /*
3
- The MIT License
4
-
5
- Copyright (c) 2017-2019 EclipseSource Munich
6
- https://github.com/eclipsesource/jsonforms
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy
9
- of this software and associated documentation files (the "Software"), to deal
10
- in the Software without restriction, including without limitation the rights
11
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- copies of the Software, and to permit persons to whom the Software is
13
- furnished to do so, subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in
16
- all copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- THE SOFTWARE.
25
- */
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- var tslib_1 = require("tslib");
28
- var maxBy_1 = tslib_1.__importDefault(require("lodash/maxBy"));
29
- var remove_1 = tslib_1.__importDefault(require("lodash/remove"));
30
- var actions_1 = require("../actions");
31
- var testers_1 = require("../testers");
32
- exports.uischemaRegistryReducer = function (state, action) {
33
- if (state === void 0) { state = []; }
34
- switch (action.type) {
35
- case actions_1.ADD_UI_SCHEMA:
36
- return state
37
- .slice()
38
- .concat({ tester: action.tester, uischema: action.uischema });
39
- case actions_1.REMOVE_UI_SCHEMA:
40
- var copy = state.slice();
41
- remove_1.default(copy, function (entry) { return entry.tester === action.tester; });
42
- return copy;
43
- default:
44
- return state;
45
- }
46
- };
47
- exports.findMatchingUISchema = function (state) { return function (jsonSchema, schemaPath, path) {
48
- var match = maxBy_1.default(state, function (entry) {
49
- return entry.tester(jsonSchema, schemaPath, path);
50
- });
51
- if (match !== undefined &&
52
- match.tester(jsonSchema, schemaPath, path) !== testers_1.NOT_APPLICABLE) {
53
- return match.uischema;
54
- }
55
- return undefined;
56
- }; };
57
- //# sourceMappingURL=uischemas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uischemas.js","sourceRoot":"","sources":["../../src/reducers/uischemas.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,+DAAiC;AACjC,iEAAmC;AACnC,sCAA8E;AAC9E,sCAA4C;AAe/B,QAAA,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;AAEW,QAAA,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"}
package/lib/store.js DELETED
@@ -1,27 +0,0 @@
1
- "use strict";
2
- /*
3
- The MIT License
4
-
5
- Copyright (c) 2017-2019 EclipseSource Munich
6
- https://github.com/eclipsesource/jsonforms
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy
9
- of this software and associated documentation files (the "Software"), to deal
10
- in the Software without restriction, including without limitation the rights
11
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- copies of the Software, and to permit persons to whom the Software is
13
- furnished to do so, subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in
16
- all copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- THE SOFTWARE.
25
- */
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- //# sourceMappingURL=store.js.map
package/lib/store.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE"}
@@ -1,29 +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("./testers"), exports);
29
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,oDAA0B"}
@@ -1,401 +0,0 @@
1
- "use strict";
2
- /*
3
- The MIT License
4
-
5
- Copyright (c) 2017-2019 EclipseSource Munich
6
- https://github.com/eclipsesource/jsonforms
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy
9
- of this software and associated documentation files (the "Software"), to deal
10
- in the Software without restriction, including without limitation the rights
11
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- copies of the Software, and to permit persons to whom the Software is
13
- furnished to do so, subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in
16
- all copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- THE SOFTWARE.
25
- */
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- var tslib_1 = require("tslib");
28
- var isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
29
- var get_1 = tslib_1.__importDefault(require("lodash/get"));
30
- var endsWith_1 = tslib_1.__importDefault(require("lodash/endsWith"));
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 util_1 = require("../util");
37
- /**
38
- * Constant that indicates that a tester is not capable of handling
39
- * a combination of schema/data.
40
- * @type {number}
41
- */
42
- exports.NOT_APPLICABLE = -1;
43
- exports.isControl = function (uischema) {
44
- return !isEmpty_1.default(uischema) && uischema.scope !== undefined;
45
- };
46
- /**
47
- * Only applicable for Controls.
48
- *
49
- * This function checks whether the given UI schema is of type Control
50
- * and if so, resolves the sub-schema referenced by the control and applies
51
- * the given predicate
52
- *
53
- * @param {(JsonSchema) => boolean} predicate the predicate that should be
54
- * applied to the resolved sub-schema
55
- */
56
- exports.schemaMatches = function (predicate) { return function (uischema, schema) {
57
- if (isEmpty_1.default(uischema) || !exports.isControl(uischema)) {
58
- return false;
59
- }
60
- if (isEmpty_1.default(schema)) {
61
- return false;
62
- }
63
- var schemaPath = uischema.scope;
64
- if (isEmpty_1.default(schemaPath)) {
65
- return false;
66
- }
67
- var currentDataSchema = schema;
68
- if (util_1.hasType(schema, 'object')) {
69
- currentDataSchema = util_1.resolveSchema(schema, schemaPath);
70
- }
71
- if (currentDataSchema === undefined) {
72
- return false;
73
- }
74
- return predicate(currentDataSchema);
75
- }; };
76
- exports.schemaSubPathMatches = function (subPath, predicate) { return function (uischema, schema) {
77
- if (isEmpty_1.default(uischema) || !exports.isControl(uischema)) {
78
- return false;
79
- }
80
- var schemaPath = uischema.scope;
81
- var currentDataSchema = schema;
82
- if (util_1.hasType(schema, 'object')) {
83
- currentDataSchema = util_1.resolveSchema(schema, schemaPath);
84
- }
85
- currentDataSchema = get_1.default(currentDataSchema, subPath);
86
- if (currentDataSchema === undefined) {
87
- return false;
88
- }
89
- return predicate(currentDataSchema);
90
- }; };
91
- /**
92
- * Only applicable for Controls.
93
- *
94
- * This function checks whether the given UI schema is of type Control
95
- * and if so, resolves the sub-schema referenced by the control and checks
96
- * whether the type of the sub-schema matches the expected one.
97
- *
98
- * @param {string} expectedType the expected type of the resolved sub-schema
99
- */
100
- exports.schemaTypeIs = function (expectedType) {
101
- return exports.schemaMatches(function (schema) { return !isEmpty_1.default(schema) && util_1.hasType(schema, expectedType); });
102
- };
103
- /**
104
- * Only applicable for Controls.
105
- *
106
- * This function checks whether the given UI schema is of type Control
107
- * and if so, resolves the sub-schema referenced by the control and checks
108
- * whether the format of the sub-schema matches the expected one.
109
- *
110
- * @param {string} expectedFormat the expected format of the resolved sub-schema
111
- */
112
- exports.formatIs = function (expectedFormat) {
113
- return exports.schemaMatches(function (schema) {
114
- return !isEmpty_1.default(schema) &&
115
- schema.format === expectedFormat &&
116
- schema.type === 'string';
117
- });
118
- };
119
- /**
120
- * Checks whether the given UI schema has the expected type.
121
- *
122
- * @param {string} expected the expected UI schema type
123
- */
124
- exports.uiTypeIs = function (expected) { return function (uischema) { return !isEmpty_1.default(uischema) && uischema.type === expected; }; };
125
- /**
126
- * Checks whether the given UI schema has an option with the given
127
- * name and whether it has the expected value. If no options property
128
- * is set, returns false.
129
- *
130
- * @param {string} optionName the name of the option to check
131
- * @param {any} optionValue the expected value of the option
132
- */
133
- exports.optionIs = function (optionName, optionValue) { return function (uischema) {
134
- if (isEmpty_1.default(uischema)) {
135
- return false;
136
- }
137
- var options = uischema.options;
138
- return !isEmpty_1.default(options) && options[optionName] === optionValue;
139
- }; };
140
- /**
141
- * Only applicable for Controls.
142
- *
143
- * Checks whether the scope of a control ends with the expected string.
144
- *
145
- * @param {string} expected the expected ending of the reference
146
- */
147
- exports.scopeEndsWith = function (expected) { return function (uischema) {
148
- if (isEmpty_1.default(expected) || !exports.isControl(uischema)) {
149
- return false;
150
- }
151
- return endsWith_1.default(uischema.scope, expected);
152
- }; };
153
- /**
154
- * Only applicable for Controls.
155
- *
156
- * Checks whether the last segment of the scope matches the expected string.
157
- *
158
- * @param {string} expected the expected ending of the reference
159
- */
160
- exports.scopeEndIs = function (expected) { return function (uischema) {
161
- if (isEmpty_1.default(expected) || !exports.isControl(uischema)) {
162
- return false;
163
- }
164
- var schemaPath = uischema.scope;
165
- return !isEmpty_1.default(schemaPath) && last_1.default(schemaPath.split('/')) === expected;
166
- }; };
167
- /**
168
- * A tester that allow composing other testers by && them.
169
- *
170
- * @param {Array<Tester>} testers the testers to be composed
171
- */
172
- exports.and = function () {
173
- var testers = [];
174
- for (var _i = 0; _i < arguments.length; _i++) {
175
- testers[_i] = arguments[_i];
176
- }
177
- return function (uischema, schema) { return testers.reduce(function (acc, tester) { return acc && tester(uischema, schema); }, true); };
178
- };
179
- /**
180
- * A tester that allow composing other testers by || them.
181
- *
182
- * @param {Array<Tester>} testers the testers to be composed
183
- */
184
- exports.or = function () {
185
- var testers = [];
186
- for (var _i = 0; _i < arguments.length; _i++) {
187
- testers[_i] = arguments[_i];
188
- }
189
- return function (uischema, schema) { return testers.reduce(function (acc, tester) { return acc || tester(uischema, schema); }, false); };
190
- };
191
- /**
192
- * Create a ranked tester that will associate a number with a given tester, if the
193
- * latter returns true.
194
- *
195
- * @param {number} rank the rank to be returned in case the tester returns true
196
- * @param {Tester} tester a tester
197
- */
198
- exports.rankWith = function (rank, tester) { return function (uischema, schema) {
199
- if (tester(uischema, schema)) {
200
- return rank;
201
- }
202
- return exports.NOT_APPLICABLE;
203
- }; };
204
- exports.withIncreasedRank = function (by, rankedTester) { return function (uischema, schema) {
205
- var rank = rankedTester(uischema, schema);
206
- if (rank === exports.NOT_APPLICABLE) {
207
- return exports.NOT_APPLICABLE;
208
- }
209
- return rank + by;
210
- }; };
211
- /**
212
- * Default tester for boolean.
213
- * @type {RankedTester}
214
- */
215
- exports.isBooleanControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('boolean'));
216
- // TODO: rather check for properties property
217
- exports.isObjectControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('object'));
218
- exports.isAllOfControl = exports.and(exports.uiTypeIs('Control'), exports.schemaMatches(function (schema) { return schema.hasOwnProperty('allOf'); }));
219
- exports.isAnyOfControl = exports.and(exports.uiTypeIs('Control'), exports.schemaMatches(function (schema) { return schema.hasOwnProperty('anyOf'); }));
220
- exports.isOneOfControl = exports.and(exports.uiTypeIs('Control'), exports.schemaMatches(function (schema) { return schema.hasOwnProperty('oneOf'); }));
221
- /**
222
- * Tests whether the given UI schema is of type Control and if the schema
223
- * has an enum.
224
- * @type {Tester}
225
- */
226
- 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'); })));
227
- /**
228
- * Tests whether the given UI schema is of type Control and if the schema
229
- * has an enum based on oneOf.
230
- * @type {Tester}
231
- */
232
- exports.isOneOfEnumControl = exports.and(exports.uiTypeIs('Control'), exports.schemaMatches(function (schema) {
233
- return schema.hasOwnProperty('oneOf') &&
234
- schema.oneOf.every(function (s) { return s.const !== undefined; });
235
- }));
236
- /**
237
- * Tests whether the given UI schema is of type Control and if the schema
238
- * is of type integer
239
- * @type {Tester}
240
- */
241
- exports.isIntegerControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('integer'));
242
- /**
243
- * Tests whether the given UI schema is of type Control and if the schema
244
- * is of type number
245
- * @type {Tester}
246
- */
247
- exports.isNumberControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('number'));
248
- /**
249
- * Tests whether the given UI schema is of type Control and if the schema
250
- * is of type string
251
- * @type {Tester}
252
- */
253
- exports.isStringControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('string'));
254
- /**
255
- * Tests whether the given UI schema is of type Control and if is has
256
- * a 'multi' option.
257
- * @type {Tester}
258
- */
259
- exports.isMultiLineControl = exports.and(exports.uiTypeIs('Control'), exports.optionIs('multi', true));
260
- /**
261
- * Tests whether the given UI schema is of type Control and whether the schema
262
- * or uischema options has a 'date' format.
263
- * @type {Tester}
264
- */
265
- exports.isDateControl = exports.and(exports.uiTypeIs('Control'), exports.or(exports.formatIs('date'), exports.optionIs('format', 'date')));
266
- /**
267
- * Tests whether the given UI schema is of type Control and whether the schema
268
- * or the uischema options has a 'time' format.
269
- * @type {Tester}
270
- */
271
- exports.isTimeControl = exports.and(exports.uiTypeIs('Control'), exports.or(exports.formatIs('time'), exports.optionIs('format', 'time')));
272
- /**
273
- * Tests whether the given UI schema is of type Control and whether the schema
274
- * or the uischema options has a 'date-time' format.
275
- * @type {Tester}
276
- */
277
- exports.isDateTimeControl = exports.and(exports.uiTypeIs('Control'), exports.or(exports.formatIs('date-time'), exports.optionIs('format', 'date-time')));
278
- /**
279
- * Tests whether the given schema is an array of objects.
280
- * @type {Tester}
281
- */
282
- exports.isObjectArray = exports.and(exports.schemaMatches(function (schema) { return util_1.hasType(schema, 'array') && !Array.isArray(schema.items); } // we don't care about tuples
283
- ), exports.schemaSubPathMatches('items', function (schema) { return util_1.hasType(schema, 'object'); }));
284
- /**
285
- * Tests whether the given UI schema is of type Control and if the schema
286
- * is an array of objects.
287
- * @type {Tester}
288
- */
289
- exports.isObjectArrayControl = exports.and(exports.uiTypeIs('Control'), exports.isObjectArray);
290
- var traverse = function (any, pred) {
291
- if (isArray_1.default(any)) {
292
- return reduce_1.default(any, function (acc, el) { return acc || traverse(el, pred); }, false);
293
- }
294
- if (pred(any)) {
295
- return true;
296
- }
297
- if (any.items) {
298
- return traverse(any.items, pred);
299
- }
300
- if (any.properties) {
301
- return reduce_1.default(toPairs_1.default(any.properties), function (acc, _a) {
302
- var _key = _a[0], val = _a[1];
303
- return acc || traverse(val, pred);
304
- }, false);
305
- }
306
- return false;
307
- };
308
- exports.isObjectArrayWithNesting = function (uischema, schema) {
309
- if (!exports.uiTypeIs('Control')(uischema, schema)) {
310
- return false;
311
- }
312
- var schemaPath = uischema.scope;
313
- var resolvedSchema = util_1.resolveSchema(schema, schemaPath);
314
- var wantedNestingByType = {
315
- object: 2,
316
- array: 1
317
- };
318
- if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {
319
- // check if nested arrays
320
- if (traverse(resolvedSchema.items, function (val) {
321
- if (val === schema) {
322
- return false;
323
- }
324
- // we don't support multiple types
325
- if (typeof val.type !== 'string') {
326
- return true;
327
- }
328
- var typeCount = wantedNestingByType[val.type];
329
- if (typeCount === undefined) {
330
- return false;
331
- }
332
- wantedNestingByType[val.type] = typeCount - 1;
333
- return wantedNestingByType[val.type] === 0;
334
- })) {
335
- return true;
336
- }
337
- // check if uischema options detail is set
338
- if (uischema.options && uischema.options.detail) {
339
- if (typeof uischema.options.detail === 'string') {
340
- return uischema.options.detail.toUpperCase() !== 'DEFAULT';
341
- }
342
- else if (typeof uischema.options.detail === 'object' &&
343
- uischema.options.detail.type) {
344
- return true;
345
- }
346
- }
347
- }
348
- return false;
349
- };
350
- /**
351
- * Synonym for isObjectArrayControl
352
- */
353
- exports.isArrayObjectControl = exports.isObjectArrayControl;
354
- /**
355
- * Tests whether the given UI schema is of type Control and if the schema
356
- * is an array of a primitive type.
357
- * @type {Tester}
358
- */
359
- 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
360
- ), exports.schemaSubPathMatches('items', function (schema) {
361
- var types = util_1.deriveTypes(schema);
362
- return (types.length === 1 &&
363
- includes_1.default(['integer', 'number', 'boolean', 'string'], types[0]));
364
- }));
365
- /**
366
- * Tests whether a given UI schema is of type Control,
367
- * if the schema is of type number or integer and
368
- * whether the schema defines a numerical range with a default value.
369
- * @type {Tester}
370
- */
371
- exports.isRangeControl = exports.and(exports.uiTypeIs('Control'), exports.or(exports.schemaTypeIs('number'), exports.schemaTypeIs('integer')), exports.schemaMatches(function (schema) {
372
- return schema.hasOwnProperty('maximum') &&
373
- schema.hasOwnProperty('minimum') &&
374
- schema.hasOwnProperty('default');
375
- }), exports.optionIs('slider', true));
376
- /**
377
- * Tests whether the given UI schema is of type Control, if the schema
378
- * is of type string and has option format
379
- * @type {Tester}
380
- */
381
- exports.isNumberFormatControl = exports.and(exports.uiTypeIs('Control'), exports.schemaTypeIs('integer'), exports.optionIs('format', true));
382
- exports.isCategorization = function (category) { return category.type === 'Categorization'; };
383
- exports.isCategory = function (uischema) {
384
- return uischema.type === 'Category';
385
- };
386
- exports.hasCategory = function (categorization) {
387
- if (isEmpty_1.default(categorization.elements)) {
388
- return false;
389
- }
390
- // all children of the categorization have to be categories
391
- return categorization.elements
392
- .map(function (elem) {
393
- return exports.isCategorization(elem) ? exports.hasCategory(elem) : exports.isCategory(elem);
394
- })
395
- .reduce(function (prev, curr) { return prev && curr; }, true);
396
- };
397
- exports.categorizationHasCategory = function (uischema) {
398
- return exports.hasCategory(uischema);
399
- };
400
- exports.not = function (tester) { return function (uischema, schema) { return !tester(uischema, schema); }; };
401
- //# sourceMappingURL=testers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testers.js","sourceRoot":"","sources":["../../src/testers/testers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;;;AAEF,mEAAqC;AACrC,2DAA6B;AAC7B,qEAAuC;AACvC,6DAA+B;AAC/B,mEAAqC;AACrC,iEAAmC;AACnC,mEAAqC;AACrC,qEAAuC;AAOvC,gCAA8D;AAE9D;;;;GAIG;AACU,QAAA,cAAc,GAAG,CAAC,CAAC,CAAC;AAcpB,QAAA,SAAS,GAAG,UAAC,QAAa;IACrC,OAAA,CAAC,iBAAO,C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C,CAAC,CAAC,CAAC,kBAAU,CAAC,IAAI,CAAC;IAA7D,CAA6D,CAC9D;SACA,MAAM,CAAC,UAAC,IAAI,EAAE,IAAI,IAAK,OAAA,IAAI,IAAI,IAAI,EAAZ,CAAY,EAAE,IAAI,CAAC,CAAC;AAChD,CAAC,CAAC;AAEW,QAAA,yBAAyB,GAAG,UAAC,QAAyB;IACjE,OAAA,mBAAW,CAAC,QAA0B,CAAC;AAAvC,CAAuC,CAAC;AAE7B,QAAA,GAAG,GAAG,UAAC,MAAc,IAAa,OAAA,UAC7C,QAAyB,EACzB,MAAkB,IACf,OAAA,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAzB,CAAyB,EAHiB,CAGjB,CAAC"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- /*
3
- The MIT License
4
-
5
- Copyright (c) 2017-2019 EclipseSource Munich
6
- https://github.com/eclipsesource/jsonforms
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy
9
- of this software and associated documentation files (the "Software"), to deal
10
- in the Software without restriction, including without limitation the rights
11
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- copies of the Software, and to permit persons to whom the Software is
13
- furnished to do so, subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in
16
- all copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- THE SOFTWARE.
25
- */
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- //# sourceMappingURL=Formatted.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Formatted.js","sourceRoot":"","sources":["../../src/util/Formatted.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE"}
package/lib/util/array.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 move = function (array, index, delta) {
28
- var newIndex = index + delta;
29
- if (newIndex < 0 || newIndex >= array.length) {
30
- return;
31
- } // Already at the top or bottom.
32
- var indexes = [index, newIndex].sort(function (a, b) { return a - b; }); // Sort the indixes
33
- array.splice(indexes[0], 2, array[indexes[1]], array[indexes[0]]);
34
- };
35
- var moveUp = function (array, toMove) {
36
- move(array, toMove, -1);
37
- };
38
- exports.moveUp = moveUp;
39
- var moveDown = function (array, toMove) {
40
- move(array, toMove, 1);
41
- };
42
- exports.moveDown = moveDown;
43
- //# sourceMappingURL=array.js.map
@@ -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"}