@jsonforms/examples 3.0.0-alpha.0 → 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.
Files changed (244) hide show
  1. package/README.md +1 -1
  2. package/docs/assets/js/search.json +1 -1
  3. package/docs/globals.html +2981 -2223
  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 +23 -15
  8. package/lib/{1169.d.ts → examples/1169.d.ts} +24 -24
  9. package/lib/examples/1220.d.ts +4 -0
  10. package/lib/{1253.d.ts → examples/1253.d.ts} +16 -16
  11. package/lib/{1254.d.ts → examples/1254.d.ts} +21 -21
  12. package/lib/examples/1645.d.ts +68 -0
  13. package/lib/examples/1779.d.ts +1 -0
  14. package/lib/{allOf.d.ts → examples/allOf.d.ts} +56 -56
  15. package/lib/{anyOf-oneOf-allOf-resolve.d.ts → examples/anyOf-oneOf-allOf-resolve.d.ts} +44 -44
  16. package/lib/{anyOf.d.ts → examples/anyOf.d.ts} +64 -64
  17. package/lib/{arrays-with-custom-element-label.d.ts → examples/arrays-with-custom-element-label.d.ts} +43 -43
  18. package/lib/{arrays-with-detail-and-rule.d.ts → examples/arrays-with-detail-and-rule.d.ts} +91 -91
  19. package/lib/{arrays-with-detail.d.ts → examples/arrays-with-detail.d.ts} +65 -65
  20. package/lib/{arrays.d.ts → examples/arrays.d.ts} +51 -38
  21. package/lib/{booleanToggle.d.ts → examples/booleanToggle.d.ts} +62 -62
  22. package/lib/{categorization.d.ts → examples/categorization.d.ts} +135 -135
  23. package/lib/{config.d.ts → examples/config.d.ts} +29 -29
  24. package/lib/{control-options.d.ts → examples/control-options.d.ts} +190 -190
  25. package/lib/{dates.d.ts → examples/dates.d.ts} +1 -1
  26. package/lib/{day1.d.ts → examples/day1.d.ts} +23 -23
  27. package/lib/{day2.d.ts → examples/day2.d.ts} +42 -42
  28. package/lib/{day3.d.ts → examples/day3.d.ts} +51 -51
  29. package/lib/{day4.d.ts → examples/day4.d.ts} +72 -72
  30. package/lib/{day5.d.ts → examples/day5.d.ts} +133 -133
  31. package/lib/{day6.d.ts → examples/day6.d.ts} +85 -85
  32. package/lib/{default.d.ts → examples/default.d.ts} +64 -64
  33. package/lib/{dynamic.d.ts → examples/dynamic.d.ts} +1 -1
  34. package/lib/{enum.d.ts → examples/enum.d.ts} +49 -49
  35. package/lib/{enumInArray.d.ts → examples/enumInArray.d.ts} +27 -27
  36. package/lib/{generate.d.ts → examples/generate.d.ts} +12 -12
  37. package/lib/{generateUI.d.ts → examples/generateUI.d.ts} +33 -33
  38. package/lib/{huge.d.ts → examples/huge.d.ts} +1 -1
  39. package/lib/{i18n.d.ts → examples/i18n.d.ts} +25 -25
  40. package/lib/{if_then_else.d.ts → examples/if_then_else.d.ts} +25 -25
  41. package/lib/{layout.d.ts → examples/layout.d.ts} +97 -97
  42. package/lib/{list-with-detail-registered.d.ts → examples/list-with-detail-registered.d.ts} +1 -1
  43. package/lib/{list-with-detail.d.ts → examples/list-with-detail.d.ts} +1 -1
  44. package/lib/{multi-enum.d.ts → examples/multi-enum.d.ts} +34 -34
  45. package/lib/examples/nestedArrays.d.ts +11 -0
  46. package/lib/{numbers.d.ts → examples/numbers.d.ts} +46 -46
  47. package/lib/{object.d.ts → examples/object.d.ts} +56 -56
  48. package/lib/{onChange.d.ts → examples/onChange.d.ts} +18 -18
  49. package/lib/{oneOf-recursive.d.ts → examples/oneOf-recursive.d.ts} +48 -48
  50. package/lib/{oneOf.d.ts → examples/oneOf.d.ts} +53 -53
  51. package/lib/{oneOfArray.d.ts → examples/oneOfArray.d.ts} +53 -53
  52. package/lib/{person.d.ts → examples/person.d.ts} +99 -99
  53. package/lib/{radioGroup.d.ts → examples/radioGroup.d.ts} +1 -1
  54. package/lib/{readonly.d.ts → examples/readonly.d.ts} +36 -36
  55. package/lib/{resolve.d.ts → examples/resolve.d.ts} +45 -45
  56. package/lib/{rule.d.ts → examples/rule.d.ts} +59 -59
  57. package/lib/{ruleInheritance.d.ts → examples/ruleInheritance.d.ts} +26 -26
  58. package/lib/{scope.d.ts → examples/scope.d.ts} +50 -50
  59. package/lib/{stepper.d.ts → examples/stepper.d.ts} +138 -138
  60. package/lib/{steppershownav.d.ts → examples/steppershownav.d.ts} +139 -139
  61. package/lib/{stringArray.d.ts → examples/stringArray.d.ts} +22 -22
  62. package/lib/{text.d.ts → examples/text.d.ts} +37 -37
  63. package/lib/index.d.ts +58 -56
  64. package/lib/jsonforms-examples.cjs.js +6082 -0
  65. package/lib/jsonforms-examples.cjs.js.map +1 -0
  66. package/lib/jsonforms-examples.esm.js +6060 -0
  67. package/lib/jsonforms-examples.esm.js.map +1 -0
  68. package/lib/register.d.ts +3 -3
  69. package/package.json +16 -8
  70. package/rollup.config.js +48 -0
  71. package/src/example.ts +18 -12
  72. package/src/{1169.ts → examples/1169.ts} +1 -1
  73. package/src/{1220.ts → examples/1220.ts} +58 -36
  74. package/src/{1253.ts → examples/1253.ts} +1 -1
  75. package/src/{1254.ts → examples/1254.ts} +1 -1
  76. package/src/examples/1645.ts +66 -0
  77. package/{lib/stringArray.js → src/examples/1779.ts} +47 -25
  78. package/src/{allOf.ts → examples/allOf.ts} +1 -1
  79. package/src/{anyOf-oneOf-allOf-resolve.ts → examples/anyOf-oneOf-allOf-resolve.ts} +1 -1
  80. package/src/{anyOf.ts → examples/anyOf.ts} +1 -1
  81. package/src/{arrays-with-custom-element-label.ts → examples/arrays-with-custom-element-label.ts} +1 -1
  82. package/src/{arrays-with-detail-and-rule.ts → examples/arrays-with-detail-and-rule.ts} +1 -1
  83. package/src/{arrays-with-detail.ts → examples/arrays-with-detail.ts} +1 -1
  84. package/src/{arrays.ts → examples/arrays.ts} +36 -8
  85. package/src/{booleanToggle.ts → examples/booleanToggle.ts} +1 -1
  86. package/src/{categorization.ts → examples/categorization.ts} +1 -1
  87. package/src/{config.ts → examples/config.ts} +1 -1
  88. package/src/{control-options.ts → examples/control-options.ts} +2 -2
  89. package/src/examples/dates.ts +149 -0
  90. package/src/{day1.ts → examples/day1.ts} +1 -1
  91. package/src/{day2.ts → examples/day2.ts} +5 -5
  92. package/src/{day3.ts → examples/day3.ts} +1 -1
  93. package/src/{day4.ts → examples/day4.ts} +1 -1
  94. package/src/{day5.ts → examples/day5.ts} +1 -1
  95. package/src/{day6.ts → examples/day6.ts} +1 -1
  96. package/src/{default.ts → examples/default.ts} +1 -1
  97. package/src/{dynamic.ts → examples/dynamic.ts} +17 -2
  98. package/src/{enum.ts → examples/enum.ts} +1 -1
  99. package/src/{enumInArray.ts → examples/enumInArray.ts} +1 -1
  100. package/src/{generate.ts → examples/generate.ts} +1 -1
  101. package/src/{generateUI.ts → examples/generateUI.ts} +1 -1
  102. package/src/{huge.ts → examples/huge.ts} +1 -1
  103. package/src/{i18n.ts → examples/i18n.ts} +1 -1
  104. package/src/{if_then_else.ts → examples/if_then_else.ts} +1 -1
  105. package/src/{layout.ts → examples/layout.ts} +1 -1
  106. package/src/{list-with-detail-registered.ts → examples/list-with-detail-registered.ts} +1 -1
  107. package/src/{list-with-detail.ts → examples/list-with-detail.ts} +100 -1
  108. package/src/{multi-enum.ts → examples/multi-enum.ts} +1 -1
  109. package/src/{nestedArrays.ts → examples/nestedArrays.ts} +49 -36
  110. package/src/{numbers.ts → examples/numbers.ts} +1 -1
  111. package/src/{object.ts → examples/object.ts} +1 -1
  112. package/src/{onChange.ts → examples/onChange.ts} +2 -2
  113. package/src/{oneOf-recursive.ts → examples/oneOf-recursive.ts} +1 -1
  114. package/src/{oneOf.ts → examples/oneOf.ts} +1 -1
  115. package/src/{oneOfArray.ts → examples/oneOfArray.ts} +1 -1
  116. package/src/{person.ts → examples/person.ts} +1 -1
  117. package/src/{radioGroup.ts → examples/radioGroup.ts} +1 -1
  118. package/src/{readonly.ts → examples/readonly.ts} +1 -1
  119. package/src/{resolve.ts → examples/resolve.ts} +1 -1
  120. package/src/{rule.ts → examples/rule.ts} +1 -1
  121. package/src/{ruleInheritance.ts → examples/ruleInheritance.ts} +25 -2
  122. package/src/{scope.ts → examples/scope.ts} +1 -1
  123. package/src/{stepper.ts → examples/stepper.ts} +1 -1
  124. package/src/{steppershownav.ts → examples/steppershownav.ts} +1 -1
  125. package/src/{stringArray.ts → examples/stringArray.ts} +1 -1
  126. package/src/{text.ts → examples/text.ts} +1 -1
  127. package/src/index.ts +58 -54
  128. package/stats.html +3279 -0
  129. package/docs/interfaces/changeexampleaction.html +0 -159
  130. package/lib/1169.js +0 -60
  131. package/lib/1169.js.map +0 -1
  132. package/lib/1220.d.ts +0 -3
  133. package/lib/1220.js +0 -122
  134. package/lib/1220.js.map +0 -1
  135. package/lib/1253.js +0 -201
  136. package/lib/1253.js.map +0 -1
  137. package/lib/1254.js +0 -66
  138. package/lib/1254.js.map +0 -1
  139. package/lib/allOf.js +0 -91
  140. package/lib/allOf.js.map +0 -1
  141. package/lib/anyOf-oneOf-allOf-resolve.js +0 -94
  142. package/lib/anyOf-oneOf-allOf-resolve.js.map +0 -1
  143. package/lib/anyOf.js +0 -114
  144. package/lib/anyOf.js.map +0 -1
  145. package/lib/arrays-with-custom-element-label.js +0 -94
  146. package/lib/arrays-with-custom-element-label.js.map +0 -1
  147. package/lib/arrays-with-detail-and-rule.js +0 -121
  148. package/lib/arrays-with-detail-and-rule.js.map +0 -1
  149. package/lib/arrays-with-detail.js +0 -96
  150. package/lib/arrays-with-detail.js.map +0 -1
  151. package/lib/arrays.js +0 -98
  152. package/lib/arrays.js.map +0 -1
  153. package/lib/booleanToggle.js +0 -67
  154. package/lib/booleanToggle.js.map +0 -1
  155. package/lib/categorization.js +0 -300
  156. package/lib/categorization.js.map +0 -1
  157. package/lib/config.js +0 -89
  158. package/lib/config.js.map +0 -1
  159. package/lib/control-options.js +0 -239
  160. package/lib/control-options.js.map +0 -1
  161. package/lib/dates.js +0 -88
  162. package/lib/dates.js.map +0 -1
  163. package/lib/day1.js +0 -59
  164. package/lib/day1.js.map +0 -1
  165. package/lib/day2.js +0 -61
  166. package/lib/day2.js.map +0 -1
  167. package/lib/day3.js +0 -64
  168. package/lib/day3.js.map +0 -1
  169. package/lib/day4.js +0 -70
  170. package/lib/day4.js.map +0 -1
  171. package/lib/day5.js +0 -167
  172. package/lib/day5.js.map +0 -1
  173. package/lib/day6.js +0 -41
  174. package/lib/day6.js.map +0 -1
  175. package/lib/default.js +0 -117
  176. package/lib/default.js.map +0 -1
  177. package/lib/dynamic.js +0 -37
  178. package/lib/dynamic.js.map +0 -1
  179. package/lib/enum.js +0 -128
  180. package/lib/enum.js.map +0 -1
  181. package/lib/enumInArray.js +0 -43
  182. package/lib/enumInArray.js.map +0 -1
  183. package/lib/example.js +0 -8
  184. package/lib/example.js.map +0 -1
  185. package/lib/generate.js +0 -41
  186. package/lib/generate.js.map +0 -1
  187. package/lib/generateUI.js +0 -41
  188. package/lib/generateUI.js.map +0 -1
  189. package/lib/huge.js +0 -1360
  190. package/lib/huge.js.map +0 -1
  191. package/lib/i18n.js +0 -92
  192. package/lib/i18n.js.map +0 -1
  193. package/lib/if_then_else.js +0 -48
  194. package/lib/if_then_else.js.map +0 -1
  195. package/lib/index.js +0 -136
  196. package/lib/index.js.map +0 -1
  197. package/lib/layout.js +0 -148
  198. package/lib/layout.js.map +0 -1
  199. package/lib/list-with-detail-registered.js +0 -104
  200. package/lib/list-with-detail-registered.js.map +0 -1
  201. package/lib/list-with-detail.js +0 -205
  202. package/lib/list-with-detail.js.map +0 -1
  203. package/lib/multi-enum.js +0 -75
  204. package/lib/multi-enum.js.map +0 -1
  205. package/lib/nestedArrays.d.ts +0 -4
  206. package/lib/nestedArrays.js +0 -101
  207. package/lib/nestedArrays.js.map +0 -1
  208. package/lib/numbers.js +0 -88
  209. package/lib/numbers.js.map +0 -1
  210. package/lib/object.js +0 -99
  211. package/lib/object.js.map +0 -1
  212. package/lib/onChange.js +0 -68
  213. package/lib/onChange.js.map +0 -1
  214. package/lib/oneOf-recursive.js +0 -80
  215. package/lib/oneOf-recursive.js.map +0 -1
  216. package/lib/oneOf.js +0 -336
  217. package/lib/oneOf.js.map +0 -1
  218. package/lib/oneOfArray.js +0 -95
  219. package/lib/oneOfArray.js.map +0 -1
  220. package/lib/person.js +0 -155
  221. package/lib/person.js.map +0 -1
  222. package/lib/radioGroup.js +0 -86
  223. package/lib/radioGroup.js.map +0 -1
  224. package/lib/readonly.js +0 -80
  225. package/lib/readonly.js.map +0 -1
  226. package/lib/register.js +0 -10
  227. package/lib/register.js.map +0 -1
  228. package/lib/resolve.js +0 -86
  229. package/lib/resolve.js.map +0 -1
  230. package/lib/rule.js +0 -122
  231. package/lib/rule.js.map +0 -1
  232. package/lib/ruleInheritance.js +0 -104
  233. package/lib/ruleInheritance.js.map +0 -1
  234. package/lib/scope.js +0 -112
  235. package/lib/scope.js.map +0 -1
  236. package/lib/stepper.js +0 -44
  237. package/lib/stepper.js.map +0 -1
  238. package/lib/steppershownav.js +0 -45
  239. package/lib/steppershownav.js.map +0 -1
  240. package/lib/stringArray.js.map +0 -1
  241. package/lib/text.js +0 -96
  242. package/lib/text.js.map +0 -1
  243. package/src/dates.ts +0 -85
  244. package/webpack.build.js +0 -12
package/lib/register.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { ExampleDescription } from './example';
2
- export declare const registerExamples: (examples: ExampleDescription[]) => void;
3
- export declare const getExamples: () => ExampleDescription[];
1
+ import { ExampleDescription } from './example';
2
+ export declare const registerExamples: (examples: ExampleDescription[]) => void;
3
+ export declare const getExamples: () => ExampleDescription[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonforms/examples",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-beta.0",
4
4
  "description": "JSON Forms Example Data",
5
5
  "repository": "https://github.com/eclipsesource/jsonforms",
6
6
  "bugs": "https://github.com/eclipsesource/jsonforms/issues",
@@ -31,25 +31,33 @@
31
31
  "layout",
32
32
  "customization"
33
33
  ],
34
- "main": "./lib/index.js",
34
+ "main": "lib/jsonforms-examples.cjs.js",
35
+ "module": "lib/jsonforms-examples.esm.js",
35
36
  "typings": "./lib/index.d.ts",
36
37
  "scripts": {
37
- "build": "tsc",
38
+ "build": "rollup -c rollup.config.js",
38
39
  "clean": "rimraf lib coverage dist .nyc_output 2> /dev/null",
39
40
  "lint": "tslint --project ../../tslint.json --exclude src/models/jsonSchema.ts",
40
41
  "test": "echo 'Nothing to do for `examples` package'",
41
42
  "doc": "typedoc --name 'JSON Forms Examples' --mode file --excludeExternals --theme ../../typedoc-jsonforms --out docs src"
42
43
  },
43
44
  "dependencies": {
44
- "@jsonforms/core": "^3.0.0-alpha.0",
45
- "ajv-i18n": "^3.5.0",
46
- "redux": "^4.0.4"
45
+ "ajv-i18n": "^3.5.0"
46
+ },
47
+ "peerDependencies": {
48
+ "@jsonforms/core": "^3.0.0-beta.0"
47
49
  },
48
50
  "devDependencies": {
51
+ "@jsonforms/core": "^3.0.0-beta.0",
49
52
  "rimraf": "^3.0.2",
53
+ "rollup": "^2.7.3",
54
+ "rollup-plugin-cleanup": "^3.2.1",
55
+ "rollup-plugin-typescript2": "^0.31.1",
56
+ "rollup-plugin-visualizer": "^5.4.1",
57
+ "tslib": "^2.2.0",
50
58
  "tslint": "^5.20.1",
51
59
  "typedoc": "^0.19.2",
52
- "typescript": "3.8.3"
60
+ "typescript": "4.2.3"
53
61
  },
54
- "gitHead": "148c39c0d1142c17bd377d8307a5816b63b0e4e3"
62
+ "gitHead": "8540d2f63abe25ee079192bc7d45e7ba4be00eac"
55
63
  }
@@ -0,0 +1,48 @@
1
+ import typescript from 'rollup-plugin-typescript2';
2
+ import cleanup from 'rollup-plugin-cleanup';
3
+ import { visualizer } from 'rollup-plugin-visualizer';
4
+
5
+ const packageJson = require('./package.json');
6
+
7
+ const baseConfig = {
8
+ input: 'src/index.ts',
9
+ external: [
10
+ ...Object.keys(packageJson.dependencies),
11
+ ...Object.keys(packageJson.peerDependencies),
12
+ /^lodash\/.*/
13
+ ]
14
+ };
15
+
16
+ export default [
17
+ {
18
+ ...baseConfig,
19
+ output: {
20
+ file: packageJson.module,
21
+ format: 'esm',
22
+ sourcemap: true
23
+ },
24
+ plugins: [
25
+ typescript(),
26
+ cleanup({ extensions: ['js', 'ts', 'jsx', 'tsx'] }),
27
+ visualizer({ open: false })
28
+ ]
29
+ },
30
+ {
31
+ ...baseConfig,
32
+ output: {
33
+ file: packageJson.main,
34
+ format: 'cjs',
35
+ sourcemap: true
36
+ },
37
+ plugins: [
38
+ typescript({
39
+ tsconfigOverride: {
40
+ compilerOptions: {
41
+ target: 'ES5'
42
+ }
43
+ }
44
+ }),
45
+ cleanup({ extensions: ['js', 'ts', 'jsx', 'tsx'] })
46
+ ]
47
+ }
48
+ ];
package/src/example.ts CHANGED
@@ -22,7 +22,13 @@
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 { JsonSchema, UISchemaElement } from '@jsonforms/core';
25
+ import {
26
+ JsonFormsCellRendererRegistryEntry,
27
+ JsonFormsUISchemaRegistryEntry,
28
+ JsonFormsRendererRegistryEntry,
29
+ JsonSchema,
30
+ UISchemaElement
31
+ } from '@jsonforms/core';
26
32
 
27
33
  export interface ExampleDescription {
28
34
  name: string;
@@ -30,17 +36,17 @@ export interface ExampleDescription {
30
36
  data: any;
31
37
  schema: JsonSchema;
32
38
  uischema: UISchemaElement;
39
+ uischemas?: JsonFormsUISchemaRegistryEntry[];
33
40
  config?: any;
41
+ actions?: {label: string, apply: (props: StateProps) => any}[];
34
42
  }
35
- export const CHANGE_EXAMPLE: 'jsonforms-example/CHANGE' =
36
- 'jsonforms-example/CHANGE';
37
- export interface ChangeExampleAction {
38
- type: 'jsonforms-example/CHANGE';
39
- example: ExampleDescription;
43
+
44
+ export interface StateProps {
45
+ data: any;
46
+ schema?: JsonSchema;
47
+ uischema?: UISchemaElement;
48
+ renderers: JsonFormsRendererRegistryEntry[];
49
+ cells?: JsonFormsCellRendererRegistryEntry[];
50
+ config?: any;
51
+ uischemas?: JsonFormsUISchemaRegistryEntry[];
40
52
  }
41
- export const changeExample = (
42
- example: ExampleDescription
43
- ): ChangeExampleAction => ({
44
- type: CHANGE_EXAMPLE,
45
- example: example
46
- });
@@ -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,8 +22,9 @@
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';
26
- import { Actions, JsonSchema, NOT_APPLICABLE, AnyAction, Dispatch } from '@jsonforms/core';
25
+ import { registerExamples } from '../register';
26
+ import { JsonFormsUISchemaRegistryEntry, JsonSchema, NOT_APPLICABLE } from '@jsonforms/core';
27
+ import { StateProps } from '../example';
27
28
 
28
29
  const data = {
29
30
  orders: [
@@ -68,40 +69,70 @@ const schema = {
68
69
  }
69
70
  };
70
71
 
71
- const uischema = {
72
+ export const uischema = {
72
73
  type: 'Control',
73
74
  scope: '#/properties/orders'
74
75
  };
75
- const detail_uischema = {
76
- type: 'VerticalLayout',
77
- elements: [
78
- {
79
- type: 'Control',
80
- scope: '#/properties/title'
81
- },
82
- {
83
- type: 'Control',
84
- scope: '#/properties/ordered'
76
+
77
+ const uischemas = [
78
+ {
79
+ tester: (_jsonSchema: JsonSchema, schemaPath: string) => {
80
+ return schemaPath === '#/properties/orders' ? 2 : NOT_APPLICABLE;
85
81
  },
86
- {
82
+ uischema: {
87
83
  type: 'VerticalLayout',
88
84
  elements: [
89
85
  {
90
86
  type: 'Control',
91
- scope: '#/properties/assignee'
92
- }
93
- ],
94
- rule: {
95
- effect: 'SHOW',
96
- condition: {
97
- type: 'LEAF',
98
- scope: '#/properties/ordered',
99
- expectedValue: true
87
+ scope: '#/properties/title'
88
+ },
89
+ {
90
+ type: 'Control',
91
+ scope: '#/properties/ordered'
92
+ },
93
+ {
94
+ type: 'VerticalLayout',
95
+ elements: [
96
+ {
97
+ type: 'Control',
98
+ scope: '#/properties/assignee'
99
+ }
100
+ ],
101
+ rule: {
102
+ effect: 'SHOW',
103
+ condition: {
104
+ type: 'LEAF',
105
+ scope: '#/properties/ordered',
106
+ expectedValue: true
107
+ }
108
+ }
100
109
  }
110
+ ]
111
+ },
112
+ },
113
+ ];
114
+
115
+ const actions = [
116
+ {
117
+ 'label': 'Register Issue 1220 UISchema',
118
+ 'apply': (props: StateProps) => {
119
+ return {
120
+ ...props,
121
+ uischemas: uischemas
101
122
  }
102
123
  }
103
- ]
104
- };
124
+ },
125
+ {
126
+ 'label': 'Unregister Issue 1220 UISchema',
127
+ 'apply': (props: StateProps) => {
128
+ const uischemas: JsonFormsUISchemaRegistryEntry[] = undefined;
129
+ return {
130
+ ...props,
131
+ uischemas: uischemas
132
+ }
133
+ }
134
+ },
135
+ ];
105
136
 
106
137
  registerExamples([
107
138
  {
@@ -109,16 +140,7 @@ registerExamples([
109
140
  label: 'Issue 1220',
110
141
  data,
111
142
  schema,
112
- uischema
143
+ uischema,
144
+ actions
113
145
  }
114
146
  ]);
115
-
116
- const nestedArrayTester = (_jsonSchema: JsonSchema, schemaPath: string) => {
117
- return schemaPath === '#/properties/orders' ? 2 : NOT_APPLICABLE;
118
- };
119
- export const registerIssue1220UISchema = (dispatch: Dispatch<AnyAction>) => {
120
- dispatch(Actions.registerUISchema(nestedArrayTester, detail_uischema));
121
- };
122
- export const unregisterIssue1220UISchema = (dispatch: Dispatch<AnyAction>) => {
123
- dispatch(Actions.unregisterUISchema(nestedArrayTester));
124
- };
@@ -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',
@@ -0,0 +1,66 @@
1
+ /*
2
+ The MIT License
3
+
4
+ Copyright (c) 2021 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
+ import { UISchemaElement } from '@jsonforms/core';
27
+
28
+ export const schema = {
29
+ type: 'object',
30
+ properties: {
31
+ propText0: {type: 'string'},
32
+ propText1: {type: 'string'},
33
+ propText2: {type: 'string'},
34
+ propText3: {type: 'string'},
35
+ propText4: {type: 'string'},
36
+ propText5: {type: 'string'},
37
+ propText6: {type: 'string'},
38
+ propText7: {type: 'string'},
39
+ propText8: {type: 'string'},
40
+ propText9: {type: 'string'},
41
+ propNumber0: {type: 'number'},
42
+ propNumber1: {type: 'number'},
43
+ propNumber2: {type: 'number'},
44
+ propNumber3: {type: 'number'},
45
+ propNumber4: {type: 'number'},
46
+ propNumber5: {type: 'number'},
47
+ propNumber6: {type: 'number'},
48
+ propNumber7: {type: 'number'},
49
+ propNumber8: {type: 'number'},
50
+ propNumber9: {type: 'number'},
51
+ }
52
+ };
53
+
54
+ export const uischema: UISchemaElement = undefined;
55
+
56
+ export const data = {};
57
+
58
+ registerExamples([
59
+ {
60
+ name: '1645',
61
+ label: 'Issue 1645',
62
+ data,
63
+ schema,
64
+ uischema
65
+ }
66
+ ]);
@@ -1,9 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /*
4
2
  The MIT License
5
3
 
6
- Copyright (c) 2017-2019 EclipseSource Munich
4
+ Copyright (c) 2017-2021 EclipseSource Munich
7
5
  https://github.com/eclipsesource/jsonforms
8
6
 
9
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -24,38 +22,62 @@ Object.defineProperty(exports, "__esModule", { value: true });
24
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
23
  THE SOFTWARE.
26
24
  */
27
- var register_1 = require("./register");
28
- exports.schema = {
25
+ import { registerExamples } from '../register';
26
+
27
+ const data = {
28
+ 'an-array-of-strings': ['foo', 'bar', 'foobar']
29
+ };
30
+ const schema = {
29
31
  type: 'object',
30
32
  properties: {
31
- comments: {
33
+ 'an-array-of-strings': {
32
34
  type: 'array',
33
35
  items: {
34
- type: 'string',
35
- maxLength: 5
36
+ type: 'string'
36
37
  }
37
38
  }
38
39
  }
39
40
  };
40
- exports.uischema = {
41
- type: 'VerticalLayout',
42
- elements: [
43
- {
44
- type: 'Control',
45
- scope: '#/properties/comments'
41
+ const uischema = {
42
+ "type": "ListWithDetail",
43
+ "scope": "#/properties/an-array-of-strings"
44
+ };
45
+
46
+ registerExamples([
47
+ {
48
+ name: '1779-string',
49
+ label: 'List With Detail primitive (string)',
50
+ data,
51
+ schema,
52
+ uischema
53
+ }
54
+ ]);
55
+
56
+ const data_number = {
57
+ 'an-array-of-numbers': [1, 2, 3]
58
+ };
59
+ const schema_number = {
60
+ type: 'object',
61
+ properties: {
62
+ 'an-array-of-numbers': {
63
+ type: 'array',
64
+ items: {
65
+ type: 'number'
66
+ }
46
67
  }
47
- ]
68
+ }
48
69
  };
49
- exports.data = {
50
- comments: ['one string', 'two strings']
70
+ const uischema_number = {
71
+ "type": "ListWithDetail",
72
+ "scope": "#/properties/an-array-of-numbers"
51
73
  };
52
- register_1.registerExamples([
74
+
75
+ registerExamples([
53
76
  {
54
- name: 'stringArray',
55
- label: 'Array of Strings',
56
- data: exports.data,
57
- schema: exports.schema,
58
- uischema: exports.uischema
77
+ name: '1779-number',
78
+ label: 'List With Detail primitive (number)',
79
+ data: data_number,
80
+ schema: schema_number,
81
+ uischema: uischema_number
59
82
  }
60
- ]);
61
- //# sourceMappingURL=stringArray.js.map
83
+ ]);
@@ -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
  $schema: 'http://json-schema.org/draft-07/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
 
27
27
  export const schema = {
28
28
  $defs: {
@@ -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
  $schema: 'http://json-schema.org/draft-07/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
 
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
  import { personCoreSchema } from './person';
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 { personCoreSchema } from './person';
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,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
  };