@jsonforms/examples 2.5.2 → 3.0.0-alpha.3

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 (294) hide show
  1. package/README.md +1 -1
  2. package/docs/assets/js/search.json +1 -1
  3. package/docs/globals.html +3380 -2419
  4. package/docs/index.html +16 -25
  5. package/docs/interfaces/exampledescription.html +34 -6
  6. package/docs/interfaces/stateprops.html +229 -0
  7. package/lib/example.d.ts +14 -6
  8. package/lib/example.js +0 -5
  9. package/lib/example.js.map +1 -1
  10. package/lib/{1169.d.ts → examples/1169.d.ts} +0 -0
  11. package/lib/{1169.js → examples/1169.js} +2 -1
  12. package/lib/examples/1169.js.map +1 -0
  13. package/lib/examples/1220.d.ts +4 -0
  14. package/lib/{1220.js → examples/1220.js} +51 -35
  15. package/lib/examples/1220.js.map +1 -0
  16. package/lib/{1253.d.ts → examples/1253.d.ts} +0 -0
  17. package/lib/{1253.js → examples/1253.js} +2 -1
  18. package/lib/examples/1253.js.map +1 -0
  19. package/lib/{1254.d.ts → examples/1254.d.ts} +0 -0
  20. package/lib/{1254.js → examples/1254.js} +2 -1
  21. package/lib/examples/1254.js.map +1 -0
  22. package/lib/examples/1645.d.ts +68 -0
  23. package/lib/examples/1645.js +65 -0
  24. package/lib/examples/1645.js.map +1 -0
  25. package/lib/{radioGroup.d.ts → examples/1779.d.ts} +0 -0
  26. package/lib/examples/1779.js +82 -0
  27. package/lib/examples/1779.js.map +1 -0
  28. package/lib/{allOf.d.ts → examples/allOf.d.ts} +0 -0
  29. package/lib/{allOf.js → examples/allOf.js} +2 -1
  30. package/lib/examples/allOf.js.map +1 -0
  31. package/lib/{anyOf-oneOf-allOf-resolve.d.ts → examples/anyOf-oneOf-allOf-resolve.d.ts} +0 -0
  32. package/lib/{anyOf-oneOf-allOf-resolve.js → examples/anyOf-oneOf-allOf-resolve.js} +2 -1
  33. package/lib/examples/anyOf-oneOf-allOf-resolve.js.map +1 -0
  34. package/lib/{anyOf.d.ts → examples/anyOf.d.ts} +0 -0
  35. package/lib/{anyOf.js → examples/anyOf.js} +2 -1
  36. package/lib/examples/anyOf.js.map +1 -0
  37. package/lib/{arrays-with-custom-element-label.d.ts → examples/arrays-with-custom-element-label.d.ts} +0 -0
  38. package/lib/{arrays-with-custom-element-label.js → examples/arrays-with-custom-element-label.js} +2 -1
  39. package/lib/examples/arrays-with-custom-element-label.js.map +1 -0
  40. package/lib/{arrays-with-detail-and-rule.d.ts → examples/arrays-with-detail-and-rule.d.ts} +0 -0
  41. package/lib/{arrays-with-detail-and-rule.js → examples/arrays-with-detail-and-rule.js} +2 -1
  42. package/lib/examples/arrays-with-detail-and-rule.js.map +1 -0
  43. package/lib/{arrays-with-detail.d.ts → examples/arrays-with-detail.d.ts} +0 -0
  44. package/lib/{arrays-with-detail.js → examples/arrays-with-detail.js} +2 -1
  45. package/lib/examples/arrays-with-detail.js.map +1 -0
  46. package/lib/{arrays.d.ts → examples/arrays.d.ts} +13 -0
  47. package/lib/{arrays.js → examples/arrays.js} +31 -9
  48. package/lib/examples/arrays.js.map +1 -0
  49. package/lib/{booleanToggle.d.ts → examples/booleanToggle.d.ts} +0 -0
  50. package/lib/{booleanToggle.js → examples/booleanToggle.js} +2 -1
  51. package/lib/examples/booleanToggle.js.map +1 -0
  52. package/lib/{categorization.d.ts → examples/categorization.d.ts} +0 -0
  53. package/lib/{categorization.js → examples/categorization.js} +2 -1
  54. package/lib/examples/categorization.js.map +1 -0
  55. package/lib/{config.d.ts → examples/config.d.ts} +0 -0
  56. package/lib/{config.js → examples/config.js} +2 -1
  57. package/lib/examples/config.js.map +1 -0
  58. package/lib/{control-options.d.ts → examples/control-options.d.ts} +0 -0
  59. package/lib/{control-options.js → examples/control-options.js} +3 -2
  60. package/lib/examples/control-options.js.map +1 -0
  61. package/lib/{dates.d.ts → examples/dates.d.ts} +0 -0
  62. package/lib/examples/dates.js +150 -0
  63. package/lib/examples/dates.js.map +1 -0
  64. package/lib/{day1.d.ts → examples/day1.d.ts} +0 -0
  65. package/lib/{day1.js → examples/day1.js} +2 -1
  66. package/lib/examples/day1.js.map +1 -0
  67. package/lib/{day2.d.ts → examples/day2.d.ts} +0 -0
  68. package/lib/{day2.js → examples/day2.js} +6 -5
  69. package/lib/examples/day2.js.map +1 -0
  70. package/lib/{day3.d.ts → examples/day3.d.ts} +0 -0
  71. package/lib/{day3.js → examples/day3.js} +3 -2
  72. package/lib/examples/day3.js.map +1 -0
  73. package/lib/{day4.d.ts → examples/day4.d.ts} +0 -0
  74. package/lib/{day4.js → examples/day4.js} +3 -2
  75. package/lib/examples/day4.js.map +1 -0
  76. package/lib/{day5.d.ts → examples/day5.d.ts} +0 -0
  77. package/lib/{day5.js → examples/day5.js} +2 -1
  78. package/lib/examples/day5.js.map +1 -0
  79. package/lib/{day6.d.ts → examples/day6.d.ts} +0 -0
  80. package/lib/{day6.js → examples/day6.js} +2 -1
  81. package/lib/examples/day6.js.map +1 -0
  82. package/lib/{default.d.ts → examples/default.d.ts} +0 -0
  83. package/lib/{default.js → examples/default.js} +2 -1
  84. package/lib/examples/default.js.map +1 -0
  85. package/lib/{dynamic.d.ts → examples/dynamic.d.ts} +0 -0
  86. package/lib/examples/dynamic.js +23 -0
  87. package/lib/examples/dynamic.js.map +1 -0
  88. package/lib/{enum.d.ts → examples/enum.d.ts} +0 -0
  89. package/lib/{enum.js → examples/enum.js} +2 -1
  90. package/lib/examples/enum.js.map +1 -0
  91. package/lib/examples/enumInArray.d.ts +27 -0
  92. package/lib/examples/enumInArray.js +44 -0
  93. package/lib/examples/enumInArray.js.map +1 -0
  94. package/lib/{generate.d.ts → examples/generate.d.ts} +0 -0
  95. package/lib/{generate.js → examples/generate.js} +2 -1
  96. package/lib/examples/generate.js.map +1 -0
  97. package/lib/{generateUI.d.ts → examples/generateUI.d.ts} +0 -0
  98. package/lib/{generateUI.js → examples/generateUI.js} +2 -1
  99. package/lib/examples/generateUI.js.map +1 -0
  100. package/lib/{huge.d.ts → examples/huge.d.ts} +0 -0
  101. package/lib/{huge.js → examples/huge.js} +2 -1
  102. package/lib/examples/huge.js.map +1 -0
  103. package/lib/{i18n.d.ts → examples/i18n.d.ts} +1 -1
  104. package/lib/{i18n.js → examples/i18n.js} +4 -2
  105. package/lib/examples/i18n.js.map +1 -0
  106. package/lib/{if_then_else.d.ts → examples/if_then_else.d.ts} +0 -0
  107. package/lib/{if_then_else.js → examples/if_then_else.js} +2 -1
  108. package/lib/examples/if_then_else.js.map +1 -0
  109. package/lib/{layout.d.ts → examples/layout.d.ts} +0 -0
  110. package/lib/{layout.js → examples/layout.js} +2 -1
  111. package/lib/examples/layout.js.map +1 -0
  112. package/lib/{list-with-detail-registered.d.ts → examples/list-with-detail-registered.d.ts} +0 -0
  113. package/lib/{list-with-detail-registered.js → examples/list-with-detail-registered.js} +1 -1
  114. package/lib/examples/list-with-detail-registered.js.map +1 -0
  115. package/lib/{list-with-detail.d.ts → examples/list-with-detail.d.ts} +0 -0
  116. package/lib/{list-with-detail.js → examples/list-with-detail.js} +98 -1
  117. package/lib/examples/list-with-detail.js.map +1 -0
  118. package/lib/{multi-enum.d.ts → examples/multi-enum.d.ts} +0 -0
  119. package/lib/{multi-enum.js → examples/multi-enum.js} +2 -1
  120. package/lib/examples/multi-enum.js.map +1 -0
  121. package/lib/examples/nestedArrays.d.ts +11 -0
  122. package/lib/{nestedArrays.js → examples/nestedArrays.js} +40 -24
  123. package/lib/examples/nestedArrays.js.map +1 -0
  124. package/lib/{numbers.d.ts → examples/numbers.d.ts} +0 -0
  125. package/lib/{numbers.js → examples/numbers.js} +2 -1
  126. package/lib/examples/numbers.js.map +1 -0
  127. package/lib/{object.d.ts → examples/object.d.ts} +0 -0
  128. package/lib/{object.js → examples/object.js} +2 -1
  129. package/lib/examples/object.js.map +1 -0
  130. package/lib/{onChange.d.ts → examples/onChange.d.ts} +1 -1
  131. package/lib/{onChange.js → examples/onChange.js} +6 -3
  132. package/lib/examples/onChange.js.map +1 -0
  133. package/lib/{oneOf-recursive.d.ts → examples/oneOf-recursive.d.ts} +0 -0
  134. package/lib/{oneOf-recursive.js → examples/oneOf-recursive.js} +2 -1
  135. package/lib/examples/oneOf-recursive.js.map +1 -0
  136. package/lib/{oneOf.d.ts → examples/oneOf.d.ts} +0 -0
  137. package/lib/{oneOf.js → examples/oneOf.js} +2 -1
  138. package/lib/examples/oneOf.js.map +1 -0
  139. package/lib/{oneOfArray.d.ts → examples/oneOfArray.d.ts} +0 -0
  140. package/lib/{oneOfArray.js → examples/oneOfArray.js} +2 -1
  141. package/lib/examples/oneOfArray.js.map +1 -0
  142. package/lib/{person.d.ts → examples/person.d.ts} +0 -0
  143. package/lib/{person.js → examples/person.js} +2 -1
  144. package/lib/examples/person.js.map +1 -0
  145. package/lib/examples/radioGroup.d.ts +1 -0
  146. package/lib/{radioGroup.js → examples/radioGroup.js} +1 -1
  147. package/lib/examples/radioGroup.js.map +1 -0
  148. package/lib/examples/readonly.d.ts +36 -0
  149. package/lib/examples/readonly.js +81 -0
  150. package/lib/examples/readonly.js.map +1 -0
  151. package/lib/{resolve.d.ts → examples/resolve.d.ts} +0 -0
  152. package/lib/{resolve.js → examples/resolve.js} +2 -1
  153. package/lib/examples/resolve.js.map +1 -0
  154. package/lib/{rule.d.ts → examples/rule.d.ts} +0 -0
  155. package/lib/{rule.js → examples/rule.js} +2 -1
  156. package/lib/examples/rule.js.map +1 -0
  157. package/lib/{ruleInheritance.d.ts → examples/ruleInheritance.d.ts} +0 -0
  158. package/lib/{ruleInheritance.js → examples/ruleInheritance.js} +19 -26
  159. package/lib/examples/ruleInheritance.js.map +1 -0
  160. package/lib/{scope.d.ts → examples/scope.d.ts} +0 -0
  161. package/lib/{scope.js → examples/scope.js} +2 -1
  162. package/lib/examples/scope.js.map +1 -0
  163. package/lib/{stepper.d.ts → examples/stepper.d.ts} +0 -0
  164. package/lib/{stepper.js → examples/stepper.js} +2 -1
  165. package/lib/examples/stepper.js.map +1 -0
  166. package/lib/{steppershownav.d.ts → examples/steppershownav.d.ts} +0 -0
  167. package/lib/{steppershownav.js → examples/steppershownav.js} +2 -1
  168. package/lib/examples/steppershownav.js.map +1 -0
  169. package/lib/{stringArray.d.ts → examples/stringArray.d.ts} +0 -0
  170. package/lib/{stringArray.js → examples/stringArray.js} +2 -1
  171. package/lib/examples/stringArray.js.map +1 -0
  172. package/lib/{text.d.ts → examples/text.d.ts} +0 -0
  173. package/lib/{text.js → examples/text.js} +2 -1
  174. package/lib/examples/text.js.map +1 -0
  175. package/lib/index.d.ts +56 -52
  176. package/lib/index.js +61 -51
  177. package/lib/index.js.map +1 -1
  178. package/lib/register.js +5 -2
  179. package/lib/register.js.map +1 -1
  180. package/package.json +5 -4
  181. package/src/example.ts +18 -12
  182. package/src/{1169.ts → examples/1169.ts} +1 -1
  183. package/src/{1220.ts → examples/1220.ts} +58 -36
  184. package/src/{1253.ts → examples/1253.ts} +1 -1
  185. package/src/{1254.ts → examples/1254.ts} +1 -1
  186. package/src/examples/1645.ts +66 -0
  187. package/src/examples/1779.ts +83 -0
  188. package/src/{allOf.ts → examples/allOf.ts} +1 -1
  189. package/src/{anyOf-oneOf-allOf-resolve.ts → examples/anyOf-oneOf-allOf-resolve.ts} +1 -1
  190. package/src/{anyOf.ts → examples/anyOf.ts} +1 -1
  191. package/src/{arrays-with-custom-element-label.ts → examples/arrays-with-custom-element-label.ts} +1 -1
  192. package/src/{arrays-with-detail-and-rule.ts → examples/arrays-with-detail-and-rule.ts} +1 -1
  193. package/src/{arrays-with-detail.ts → examples/arrays-with-detail.ts} +1 -1
  194. package/src/{arrays.ts → examples/arrays.ts} +36 -8
  195. package/src/{booleanToggle.ts → examples/booleanToggle.ts} +1 -1
  196. package/src/{categorization.ts → examples/categorization.ts} +1 -1
  197. package/src/{config.ts → examples/config.ts} +1 -1
  198. package/src/{control-options.ts → examples/control-options.ts} +2 -2
  199. package/src/examples/dates.ts +149 -0
  200. package/src/{day1.ts → examples/day1.ts} +1 -1
  201. package/src/{day2.ts → examples/day2.ts} +5 -5
  202. package/src/{day3.ts → examples/day3.ts} +1 -1
  203. package/src/{day4.ts → examples/day4.ts} +1 -1
  204. package/src/{day5.ts → examples/day5.ts} +1 -1
  205. package/src/{day6.ts → examples/day6.ts} +1 -1
  206. package/src/{default.ts → examples/default.ts} +1 -1
  207. package/src/{dynamic.ts → examples/dynamic.ts} +17 -2
  208. package/src/{enum.ts → examples/enum.ts} +1 -1
  209. package/src/examples/enumInArray.ts +44 -0
  210. package/src/{generate.ts → examples/generate.ts} +1 -1
  211. package/src/{generateUI.ts → examples/generateUI.ts} +1 -1
  212. package/src/{huge.ts → examples/huge.ts} +1 -1
  213. package/src/{i18n.ts → examples/i18n.ts} +1 -1
  214. package/src/{if_then_else.ts → examples/if_then_else.ts} +1 -1
  215. package/src/{layout.ts → examples/layout.ts} +1 -1
  216. package/src/{list-with-detail-registered.ts → examples/list-with-detail-registered.ts} +1 -1
  217. package/src/{list-with-detail.ts → examples/list-with-detail.ts} +100 -1
  218. package/src/{multi-enum.ts → examples/multi-enum.ts} +1 -1
  219. package/src/{nestedArrays.ts → examples/nestedArrays.ts} +49 -36
  220. package/src/{numbers.ts → examples/numbers.ts} +1 -1
  221. package/src/{object.ts → examples/object.ts} +1 -1
  222. package/src/{onChange.ts → examples/onChange.ts} +2 -2
  223. package/src/{oneOf-recursive.ts → examples/oneOf-recursive.ts} +1 -1
  224. package/src/{oneOf.ts → examples/oneOf.ts} +1 -1
  225. package/src/{oneOfArray.ts → examples/oneOfArray.ts} +1 -1
  226. package/src/{person.ts → examples/person.ts} +1 -1
  227. package/src/{radioGroup.ts → examples/radioGroup.ts} +1 -1
  228. package/src/examples/readonly.ts +81 -0
  229. package/src/{resolve.ts → examples/resolve.ts} +1 -1
  230. package/src/{rule.ts → examples/rule.ts} +1 -1
  231. package/src/{ruleInheritance.ts → examples/ruleInheritance.ts} +25 -2
  232. package/src/{scope.ts → examples/scope.ts} +1 -1
  233. package/src/{stepper.ts → examples/stepper.ts} +1 -1
  234. package/src/{steppershownav.ts → examples/steppershownav.ts} +1 -1
  235. package/src/{stringArray.ts → examples/stringArray.ts} +1 -1
  236. package/src/{text.ts → examples/text.ts} +1 -1
  237. package/src/index.ts +60 -52
  238. package/docs/interfaces/changeexampleaction.html +0 -159
  239. package/lib/1169.js.map +0 -1
  240. package/lib/1220.d.ts +0 -3
  241. package/lib/1220.js.map +0 -1
  242. package/lib/1253.js.map +0 -1
  243. package/lib/1254.js.map +0 -1
  244. package/lib/allOf.js.map +0 -1
  245. package/lib/anyOf-oneOf-allOf-resolve.js.map +0 -1
  246. package/lib/anyOf.js.map +0 -1
  247. package/lib/arrays-with-custom-element-label.js.map +0 -1
  248. package/lib/arrays-with-detail-and-rule.js.map +0 -1
  249. package/lib/arrays-with-detail.js.map +0 -1
  250. package/lib/arrays.js.map +0 -1
  251. package/lib/booleanToggle.js.map +0 -1
  252. package/lib/categorization.js.map +0 -1
  253. package/lib/config.js.map +0 -1
  254. package/lib/control-options.js.map +0 -1
  255. package/lib/dates.js +0 -88
  256. package/lib/dates.js.map +0 -1
  257. package/lib/day1.js.map +0 -1
  258. package/lib/day2.js.map +0 -1
  259. package/lib/day3.js.map +0 -1
  260. package/lib/day4.js.map +0 -1
  261. package/lib/day5.js.map +0 -1
  262. package/lib/day6.js.map +0 -1
  263. package/lib/default.js.map +0 -1
  264. package/lib/dynamic.js +0 -37
  265. package/lib/dynamic.js.map +0 -1
  266. package/lib/enum.js.map +0 -1
  267. package/lib/generate.js.map +0 -1
  268. package/lib/generateUI.js.map +0 -1
  269. package/lib/huge.js.map +0 -1
  270. package/lib/i18n.js.map +0 -1
  271. package/lib/if_then_else.js.map +0 -1
  272. package/lib/layout.js.map +0 -1
  273. package/lib/list-with-detail-registered.js.map +0 -1
  274. package/lib/list-with-detail.js.map +0 -1
  275. package/lib/multi-enum.js.map +0 -1
  276. package/lib/nestedArrays.d.ts +0 -4
  277. package/lib/nestedArrays.js.map +0 -1
  278. package/lib/numbers.js.map +0 -1
  279. package/lib/object.js.map +0 -1
  280. package/lib/onChange.js.map +0 -1
  281. package/lib/oneOf-recursive.js.map +0 -1
  282. package/lib/oneOf.js.map +0 -1
  283. package/lib/oneOfArray.js.map +0 -1
  284. package/lib/person.js.map +0 -1
  285. package/lib/radioGroup.js.map +0 -1
  286. package/lib/resolve.js.map +0 -1
  287. package/lib/rule.js.map +0 -1
  288. package/lib/ruleInheritance.js.map +0 -1
  289. package/lib/scope.js.map +0 -1
  290. package/lib/stepper.js.map +0 -1
  291. package/lib/steppershownav.js.map +0 -1
  292. package/lib/stringArray.js.map +0 -1
  293. package/lib/text.js.map +0 -1
  294. package/src/dates.ts +0 -85
@@ -1,19 +1,19 @@
1
1
  /*
2
2
  The MIT License
3
-
3
+
4
4
  Copyright (c) 2017-2019 EclipseSource Munich
5
5
  https://github.com/eclipsesource/jsonforms
6
-
6
+
7
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  of this software and associated documentation files (the "Software"), to deal
9
9
  in the Software without restriction, including without limitation the rights
10
10
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
11
  copies of the Software, and to permit persons to whom the Software is
12
12
  furnished to do so, subject to the following conditions:
13
-
13
+
14
14
  The above copyright notice and this permission notice shall be included in
15
15
  all copies or substantial portions of the Software.
16
-
16
+
17
17
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
18
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
19
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -22,7 +22,8 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
+ import { StateProps } from '../example';
26
27
 
27
28
  export const schema = {
28
29
  type: 'object',
@@ -46,13 +47,18 @@ export const schema = {
46
47
  }
47
48
  }
48
49
  }
49
- }
50
+ },
51
+ foo:{type:'string'}
50
52
  }
51
53
  };
52
54
 
53
55
  export const uischema = {
54
56
  type: 'VerticalLayout',
55
57
  elements: [
58
+ {
59
+ type: 'Control',
60
+ scope: '#/properties/foo'
61
+ },
56
62
  {
57
63
  type: 'Control',
58
64
  scope: '#/properties/comments'
@@ -60,7 +66,7 @@ export const uischema = {
60
66
  ]
61
67
  };
62
68
 
63
- const uischemaWithSorting = {
69
+ export const uischemaWithSorting = {
64
70
  type: 'VerticalLayout',
65
71
  elements: [
66
72
  {
@@ -86,6 +92,27 @@ export const data = {
86
92
  ]
87
93
  };
88
94
 
95
+ const actions = [
96
+ {
97
+ 'label': 'Enable Sorting',
98
+ 'apply': (props: StateProps) => {
99
+ return {
100
+ ...props,
101
+ uischema: uischemaWithSorting
102
+ }
103
+ }
104
+ },
105
+ {
106
+ 'label': 'Disable Sorting',
107
+ 'apply': (props: StateProps) => {
108
+ return {
109
+ ...props,
110
+ uischema: uischema
111
+ }
112
+ }
113
+ },
114
+ ];
115
+
89
116
  registerExamples([
90
117
  {
91
118
  name: 'array',
@@ -95,6 +122,7 @@ registerExamples([
95
122
  uischema,
96
123
  config: {
97
124
  withSort: uischemaWithSorting
98
- }
125
+ },
126
+ actions
99
127
  }
100
128
  ]);
@@ -23,7 +23,7 @@
23
23
  THE SOFTWARE.
24
24
  */
25
25
 
26
- import { registerExamples } from "./register";
26
+ import { registerExamples } from '../register';
27
27
 
28
28
  export const schema = {
29
29
  type: 'object',
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
 
27
27
  export const schema = {
28
28
  type: 'object',
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
 
27
27
  export const schema = {
28
28
  type: 'object',
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
 
27
27
  export const schema = {
28
28
  type: 'object',
@@ -102,7 +102,7 @@ export const data = {
102
102
  number: 50.5,
103
103
  integer: 50,
104
104
  date: '2020-06-25',
105
- time: '23:08',
105
+ time: '23:08:00',
106
106
  dateTime: '2020-06-25T23:08:42+02:00',
107
107
  enum: 'Two'
108
108
  };
@@ -0,0 +1,149 @@
1
+ /*
2
+ The MIT License
3
+
4
+ Copyright (c) 2017-2019 EclipseSource Munich
5
+ https://github.com/eclipsesource/jsonforms
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+ import { registerExamples } from '../register';
26
+
27
+ const schema = {
28
+ type: 'object',
29
+ properties: {
30
+ schemaBased: {
31
+ type: 'object',
32
+ properties: {
33
+ date: {
34
+ type: 'string',
35
+ format: 'date',
36
+ description: 'schema-based date picker'
37
+ },
38
+ time: {
39
+ type: 'string',
40
+ format: 'time',
41
+ description: 'schema-based time picker'
42
+ },
43
+ datetime: {
44
+ type: 'string',
45
+ format: 'date-time',
46
+ description: 'schema-based datetime picker'
47
+ }
48
+ }
49
+ },
50
+ uiSchemaBased: {
51
+ type: 'object',
52
+ properties: {
53
+ date: {
54
+ type: 'string',
55
+ description: 'does not allow to select days'
56
+ },
57
+ time: {
58
+ type: 'string',
59
+ description: '24 hour format'
60
+ },
61
+ datetime: {
62
+ type: 'string',
63
+ description: 'uischema-based datetime picker'
64
+ }
65
+ }
66
+ }
67
+ }
68
+ };
69
+ const uischema = {
70
+ type: 'VerticalLayout',
71
+ elements: [
72
+ {
73
+ type: 'HorizontalLayout',
74
+ elements: [
75
+ {
76
+ type: 'Control',
77
+ scope: '#/properties/schemaBased/properties/date'
78
+ },
79
+ {
80
+ type: 'Control',
81
+ scope: '#/properties/schemaBased/properties/time'
82
+ },
83
+ {
84
+ type: 'Control',
85
+ scope: '#/properties/schemaBased/properties/datetime'
86
+ }
87
+ ]
88
+ },
89
+ {
90
+ type: 'HorizontalLayout',
91
+ elements: [
92
+ {
93
+ type: 'Control',
94
+ scope: '#/properties/uiSchemaBased/properties/date',
95
+ label: 'Year Month Picker',
96
+ options: {
97
+ format: 'date',
98
+ clearLabel: 'Clear it!',
99
+ cancelLabel: 'Abort',
100
+ okLabel: 'Do it',
101
+ views: ['year', 'month'],
102
+ dateFormat: 'YYYY.MM',
103
+ dateSaveFormat: 'YYYY-MM'
104
+ },
105
+ },
106
+ {
107
+ type: 'Control',
108
+ scope: '#/properties/uiSchemaBased/properties/time',
109
+ options: {
110
+ format: 'time',
111
+ ampm: true
112
+ }
113
+ },
114
+ {
115
+ type: 'Control',
116
+ scope: '#/properties/uiSchemaBased/properties/datetime',
117
+ options: {
118
+ format: 'date-time',
119
+ dateTimeFormat: 'DD-MM-YY hh:mm:a',
120
+ dateTimeSaveFormat: 'YYYY/MM/DD h:mm a',
121
+ ampm: true
122
+ }
123
+ }
124
+ ]
125
+ }
126
+ ]
127
+ };
128
+
129
+ const data = {
130
+ schemaBased: {
131
+ date: new Date().toISOString().substr(0, 10),
132
+ time: '13:37',
133
+ datetime: new Date().toISOString()
134
+ },
135
+ uiSchemaBased: {
136
+ date: new Date().toISOString().substr(0, 10),
137
+ time: '13:37',
138
+ datetime: '1999/12/11 10:05 am'
139
+ }
140
+ };
141
+ registerExamples([
142
+ {
143
+ name: 'dates',
144
+ label: 'Dates',
145
+ data,
146
+ schema,
147
+ uischema
148
+ }
149
+ ]);
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
  import { UISchemaElement } from '@jsonforms/core';
27
27
 
28
28
  export const schema = {
@@ -1,19 +1,19 @@
1
1
  /*
2
2
  The MIT License
3
-
3
+
4
4
  Copyright (c) 2017-2019 EclipseSource Munich
5
5
  https://github.com/eclipsesource/jsonforms
6
-
6
+
7
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  of this software and associated documentation files (the "Software"), to deal
9
9
  in the Software without restriction, including without limitation the rights
10
10
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
11
  copies of the Software, and to permit persons to whom the Software is
12
12
  furnished to do so, subject to the following conditions:
13
-
13
+
14
14
  The above copyright notice and this permission notice shall be included in
15
15
  all copies or substantial portions of the Software.
16
-
16
+
17
17
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
18
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
19
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
  import { data as day1Data, schema as day1Schema } from './day1';
27
27
 
28
28
  export const schema = day1Schema;
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
  import {
27
27
  data as day2Data,
28
28
  schema as day2Schema,
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
  import {
27
27
  data as day3Data,
28
28
  schema as day3Schema,
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
  import { data as day4Data, schema as day4Schema } from './day4';
27
27
 
28
28
  export const schema = day4Schema;
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
  import {
27
27
  data as day5Data,
28
28
  schema as day5Schema,
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
 
27
27
  export const schema = {
28
28
  type: 'object',
@@ -22,13 +22,28 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { StateProps } from '../example';
26
+ import { registerExamples } from '../register';
27
+
28
+ const actions = [
29
+ {
30
+ 'label': 'Change data',
31
+ 'apply': (props: StateProps) => {
32
+ return {
33
+ ...props,
34
+ data: { id: 'aaa' }
35
+ }
36
+ }
37
+ },
38
+ ]
39
+
26
40
  registerExamples([
27
41
  {
28
42
  name: 'dynamic',
29
43
  label: 'Dynamic Change',
30
44
  schema: undefined,
31
45
  uischema: undefined,
32
- data: { name: 'bla' }
46
+ data: { name: 'bla' },
47
+ actions
33
48
  }
34
49
  ]);
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
 
27
27
  export const schema = {
28
28
  type: 'object',
@@ -0,0 +1,44 @@
1
+ import { registerExamples } from '../register';
2
+
3
+ export const schema = {
4
+ type: 'array',
5
+ items: {
6
+ type: 'object',
7
+ properties: {
8
+ plainEnum: {
9
+ type: 'string',
10
+ enum: ['foo', 'bar']
11
+ },
12
+ oneOfEnum: {
13
+ type: 'string',
14
+ oneOf: [
15
+ { const: 'foo', title: 'Foo' },
16
+ { const: 'bar', title: 'Bar' },
17
+ { const: 'foobar', title: 'FooBar' }
18
+ ]
19
+ },
20
+ }
21
+ }
22
+ };
23
+
24
+ export const uischema = {
25
+ type: 'VerticalLayout',
26
+ elements: [
27
+ {
28
+ type: 'Control',
29
+ scope: '#'
30
+ }
31
+ ]
32
+ };
33
+
34
+ export const data: any[] = [];
35
+
36
+ registerExamples([
37
+ {
38
+ name: 'enumInArray',
39
+ label: 'Array containing enums',
40
+ data,
41
+ schema,
42
+ uischema
43
+ }
44
+ ]);
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
  import { data as personData } from './person';
27
27
  import { JsonSchema, UISchemaElement } from '@jsonforms/core';
28
28
 
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
  import { data as personData, personCoreSchema } from './person';
27
27
  import { UISchemaElement } from '@jsonforms/core';
28
28
 
@@ -1,4 +1,4 @@
1
- import { registerExamples } from './register';
1
+ import { registerExamples } from '../register';
2
2
  const schema = {
3
3
  $schema: 'http://json-schema.org/schema#',
4
4
 
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
  import { personCoreSchema } from './person';
27
27
  import { JsonFormsCore, updateErrors, AnyAction, Dispatch } from '@jsonforms/core';
28
28
  const localize = require('ajv-i18n');
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
  import { UISchemaElement } from '@jsonforms/core';
27
27
 
28
28
  export const schema = {
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
  import { data as personData, schema as personSchema } from './person';
27
27
 
28
28
  export const schema = personSchema;
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
 
27
27
  const data = {
28
28
  warehouseitems: [
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
 
27
27
  const data = {
28
28
  orders: [
@@ -195,6 +195,95 @@ const uischema = {
195
195
  }
196
196
  };
197
197
 
198
+ const uischemaNoLabelRef = {
199
+ type: 'ListWithDetail',
200
+ scope: '#/properties/orders',
201
+ options: {
202
+ detail: {
203
+ type: 'VerticalLayout',
204
+ elements: [
205
+ {
206
+ type: 'HorizontalLayout',
207
+ elements: [
208
+ {
209
+ type: 'Control',
210
+ scope: '#/properties/title'
211
+ },
212
+ {
213
+ type: 'Control',
214
+ scope: '#/properties/processId'
215
+ }
216
+ ]
217
+ },
218
+ {
219
+ type: 'Group',
220
+ label: 'Customer',
221
+ elements: [
222
+ {
223
+ type: 'Control',
224
+ label: 'ID',
225
+ scope: '#/properties/customer/properties/id'
226
+ },
227
+ {
228
+ type: 'Control',
229
+ label: 'Name',
230
+ scope: '#/properties/customer/properties/name'
231
+ },
232
+ {
233
+ type: 'Control',
234
+ label: 'Department',
235
+ scope: '#/properties/customer/properties/department'
236
+ }
237
+ ]
238
+ },
239
+ {
240
+ type: 'VerticalLayout',
241
+ elements: [
242
+ {
243
+ type: 'VerticalLayout',
244
+ elements: [
245
+ {
246
+ type: 'HorizontalLayout',
247
+ elements: [
248
+ {
249
+ type: 'Control',
250
+ scope: '#/properties/ordered',
251
+ options: {
252
+ toggle: true
253
+ }
254
+ },
255
+ {
256
+ type: 'Control',
257
+ scope: '#/properties/assignee'
258
+ }
259
+ ]
260
+ },
261
+ {
262
+ type: 'HorizontalLayout',
263
+ elements: [
264
+ {
265
+ type: 'Control',
266
+ scope: '#/properties/startDate'
267
+ },
268
+ {
269
+ type: 'Control',
270
+ scope: '#/properties/endDate'
271
+ }
272
+ ]
273
+ },
274
+ {
275
+ type: 'Control',
276
+ scope: '#/properties/status'
277
+ }
278
+ ]
279
+ }
280
+ ]
281
+ }
282
+ ]
283
+ }
284
+ }
285
+ };
286
+
198
287
  registerExamples([
199
288
  {
200
289
  name: 'list-with-detail',
@@ -204,3 +293,13 @@ registerExamples([
204
293
  uischema
205
294
  }
206
295
  ]);
296
+
297
+ registerExamples([
298
+ {
299
+ name: 'list-with-detail-no-labelref',
300
+ label: 'List With Detail (No Label Ref)',
301
+ data,
302
+ schema,
303
+ uischema:uischemaNoLabelRef
304
+ }
305
+ ]);
@@ -22,7 +22,7 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
- import { registerExamples } from './register';
25
+ import { registerExamples } from '../register';
26
26
 
27
27
  export const schema = {
28
28
  type: 'object',