@jsonforms/examples 3.1.0-alpha.1 → 3.1.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 (111) hide show
  1. package/.eslintrc.js +29 -0
  2. package/.prettierrc.js +6 -0
  3. package/README.md +1 -1
  4. package/docs/assets/js/search.json +1 -1
  5. package/docs/globals.html +2074 -3228
  6. package/docs/index.html +0 -30
  7. package/lib/examples/1884.d.ts +8 -0
  8. package/lib/examples/additional-errors.d.ts +16 -1
  9. package/lib/examples/anyOf.d.ts +15 -2
  10. package/lib/examples/arrays.d.ts +13 -2
  11. package/lib/examples/arraysI18n.d.ts +52 -0
  12. package/lib/examples/dates.d.ts +115 -1
  13. package/lib/examples/enum.d.ts +16 -0
  14. package/lib/examples/generate-dynamic.d.ts +15 -0
  15. package/lib/examples/list-with-detail-primitives.d.ts +36 -0
  16. package/lib/examples/list-with-detail-registered.d.ts +55 -1
  17. package/lib/examples/list-with-detail.d.ts +191 -1
  18. package/lib/examples/nestedCategorization.d.ts +57 -0
  19. package/lib/examples/radioGroup.d.ts +42 -1
  20. package/lib/index.d.ts +8 -19
  21. package/lib/jsonforms-examples.cjs.js +2299 -2863
  22. package/lib/jsonforms-examples.cjs.js.map +1 -1
  23. package/lib/jsonforms-examples.esm.js +2288 -2869
  24. package/lib/jsonforms-examples.esm.js.map +1 -1
  25. package/package.json +13 -6
  26. package/rollup.config.js +12 -12
  27. package/src/example.ts +3 -3
  28. package/src/examples/1884.ts +52 -48
  29. package/src/examples/1948.ts +19 -19
  30. package/src/examples/additional-errors.ts +28 -25
  31. package/src/examples/allOf.ts +18 -18
  32. package/src/examples/anyOf-oneOf-allOf-resolve.ts +21 -21
  33. package/src/examples/anyOf.ts +42 -24
  34. package/src/examples/arrays-with-custom-element-label.ts +21 -21
  35. package/src/examples/arrays-with-detail-and-rule.ts +28 -28
  36. package/src/examples/arrays-with-detail.ts +21 -21
  37. package/src/examples/arrays-with-sorting.ts +35 -35
  38. package/src/examples/arrays.ts +40 -35
  39. package/src/examples/arraysI18n.ts +107 -0
  40. package/src/examples/{steppershownav.ts → categorization-stepper-nav-buttons.ts} +6 -6
  41. package/src/examples/{stepper.ts → categorization-stepper.ts} +5 -5
  42. package/src/examples/categorization.ts +119 -119
  43. package/src/examples/conditional-schema-compositions.ts +20 -20
  44. package/src/examples/config.ts +15 -15
  45. package/src/examples/control-options.ts +81 -82
  46. package/src/examples/dates.ts +34 -34
  47. package/src/examples/default.ts +22 -22
  48. package/src/examples/{multi-enum.ts → enum-multi.ts} +14 -14
  49. package/src/examples/enum.ts +65 -33
  50. package/src/examples/enumInArray.ts +10 -10
  51. package/src/examples/{dynamic.ts → generate-dynamic.ts} +10 -10
  52. package/src/examples/generate.ts +2 -2
  53. package/src/examples/generateUI.ts +2 -2
  54. package/src/examples/huge.ts +381 -377
  55. package/src/examples/i18n.ts +37 -28
  56. package/src/examples/if_then_else.ts +4 -4
  57. package/src/examples/layout.ts +29 -29
  58. package/src/examples/{booleanToggle.ts → list-with-detail-primitives.ts} +46 -33
  59. package/src/examples/list-with-detail-registered.ts +26 -26
  60. package/src/examples/list-with-detail.ts +82 -82
  61. package/src/examples/nestedArrays.ts +40 -35
  62. package/src/examples/nestedCategorization.ts +175 -0
  63. package/src/examples/numbers.ts +17 -17
  64. package/src/examples/object.ts +24 -24
  65. package/src/examples/onChange.ts +28 -22
  66. package/src/examples/oneOf-recursive.ts +15 -15
  67. package/src/examples/oneOf.ts +99 -96
  68. package/src/examples/oneOfArray.ts +20 -20
  69. package/src/examples/person.ts +35 -35
  70. package/src/examples/radioGroup.ts +52 -53
  71. package/src/examples/readonly.ts +14 -14
  72. package/src/examples/rule.ts +26 -26
  73. package/src/examples/ruleInheritance.ts +37 -34
  74. package/src/examples/scope.ts +26 -26
  75. package/src/examples/stringArray.ts +10 -10
  76. package/src/examples/text.ts +19 -19
  77. package/src/index.ts +11 -33
  78. package/src/register.ts +6 -3
  79. package/stats.html +2462 -329
  80. package/tsconfig.json +2 -6
  81. package/lib/examples/1169.d.ts +0 -24
  82. package/lib/examples/1220.d.ts +0 -4
  83. package/lib/examples/1253.d.ts +0 -16
  84. package/lib/examples/1254.d.ts +0 -21
  85. package/lib/examples/1645.d.ts +0 -68
  86. package/lib/examples/1779.d.ts +0 -1
  87. package/lib/examples/1996.d.ts +0 -31
  88. package/lib/examples/booleanToggle.d.ts +0 -62
  89. package/lib/examples/day1.d.ts +0 -23
  90. package/lib/examples/day2.d.ts +0 -42
  91. package/lib/examples/day3.d.ts +0 -51
  92. package/lib/examples/day4.d.ts +0 -72
  93. package/lib/examples/day5.d.ts +0 -133
  94. package/lib/examples/day6.d.ts +0 -85
  95. package/lib/examples/dynamic.d.ts +0 -1
  96. package/src/examples/1169.ts +0 -62
  97. package/src/examples/1220.ts +0 -146
  98. package/src/examples/1253.ts +0 -212
  99. package/src/examples/1254.ts +0 -67
  100. package/src/examples/1645.ts +0 -66
  101. package/src/examples/1779.ts +0 -83
  102. package/src/examples/1996.ts +0 -102
  103. package/src/examples/day1.ts +0 -61
  104. package/src/examples/day2.ts +0 -62
  105. package/src/examples/day3.ts +0 -76
  106. package/src/examples/day4.ts +0 -83
  107. package/src/examples/day5.ts +0 -169
  108. package/src/examples/day6.ts +0 -44
  109. /package/lib/examples/{steppershownav.d.ts → categorization-stepper-nav-buttons.d.ts} +0 -0
  110. /package/lib/examples/{stepper.d.ts → categorization-stepper.d.ts} +0 -0
  111. /package/lib/examples/{multi-enum.d.ts → enum-multi.d.ts} +0 -0
@@ -29,29 +29,44 @@ export const schema = {
29
29
  properties: {
30
30
  plainEnum: {
31
31
  type: 'string',
32
- enum: ['foo', 'bar']
32
+ enum: ['foo', 'bar'],
33
33
  },
34
34
  plainEnumSet: {
35
35
  type: 'string',
36
- enum: ['foo', 'bar']
36
+ enum: ['foo', 'bar'],
37
+ },
38
+ enumWithError: {
39
+ type: 'string',
40
+ enum: ['foo', 'bar'],
37
41
  },
38
42
  oneOfEnum: {
39
- type: 'string',
40
- oneOf: [
41
- {const: 'foo', title: 'Foo'},
42
- {const: 'bar', title: 'Bar'},
43
- {const: 'foobar', title: 'FooBar'}
44
- ]
43
+ type: 'string',
44
+ oneOf: [
45
+ { const: 'foo', title: 'Foo' },
46
+ { const: 'bar', title: 'Bar' },
47
+ { const: 'foobar', title: 'FooBar' },
48
+ ],
45
49
  },
46
50
  oneOfEnumSet: {
47
51
  type: 'string',
48
52
  oneOf: [
49
- {const: 'foo', title: 'Foo'},
50
- {const: 'bar', title: 'Bar'},
51
- {const: 'foobar', title: 'FooBar'}
52
- ]
53
- }
54
- }
53
+ { const: 'foo', title: 'Foo' },
54
+ { const: 'bar', title: 'Bar' },
55
+ { const: 'foobar', title: 'FooBar' },
56
+ ],
57
+ },
58
+ oneOfEnumWithError: {
59
+ type: 'string',
60
+ oneOf: [
61
+ { const: 'foo', title: 'Foo' },
62
+ { const: 'bar', title: 'Bar' },
63
+ { const: 'foobar', title: 'FooBar' },
64
+ ],
65
+ },
66
+ constEnum: {
67
+ const: 'Const Value',
68
+ },
69
+ },
55
70
  };
56
71
 
57
72
  export const uischema = {
@@ -63,27 +78,35 @@ export const uischema = {
63
78
  elements: [
64
79
  {
65
80
  type: 'Control',
66
- scope: '#/properties/plainEnum'
81
+ scope: '#/properties/constEnum',
82
+ },
83
+ {
84
+ type: 'Control',
85
+ scope: '#/properties/plainEnum',
67
86
  },
68
87
  {
69
88
  type: 'Control',
70
- scope: '#/properties/plainEnumSet'
89
+ scope: '#/properties/plainEnumSet',
71
90
  },
72
91
  {
73
92
  type: 'Control',
74
93
  scope: '#/properties/plainEnum',
75
94
  options: {
76
- autocomplete: false
77
- }
95
+ autocomplete: false,
96
+ },
78
97
  },
79
98
  {
80
99
  type: 'Control',
81
100
  scope: '#/properties/plainEnumSet',
82
101
  options: {
83
- autocomplete: false
84
- }
102
+ autocomplete: false,
103
+ },
104
+ },
105
+ {
106
+ type: 'Control',
107
+ scope: '#/properties/enumWithError',
85
108
  },
86
- ]
109
+ ],
87
110
  },
88
111
  {
89
112
  type: 'Group',
@@ -91,32 +114,41 @@ export const uischema = {
91
114
  elements: [
92
115
  {
93
116
  type: 'Control',
94
- scope: '#/properties/oneOfEnum'
117
+ scope: '#/properties/oneOfEnum',
95
118
  },
96
119
  {
97
120
  type: 'Control',
98
- scope: '#/properties/oneOfEnumSet'
121
+ scope: '#/properties/oneOfEnumSet',
99
122
  },
100
123
  {
101
124
  type: 'Control',
102
125
  scope: '#/properties/oneOfEnum',
103
126
  options: {
104
- autocomplete: false
105
- }
127
+ autocomplete: false,
128
+ },
106
129
  },
107
130
  {
108
131
  type: 'Control',
109
132
  scope: '#/properties/oneOfEnumSet',
110
133
  options: {
111
- autocomplete: false
112
- }
134
+ autocomplete: false,
135
+ },
136
+ },
137
+ {
138
+ type: 'Control',
139
+ scope: '#/properties/oneOfEnumWithError',
113
140
  },
114
- ]
115
- }
116
- ]
141
+ ],
142
+ },
143
+ ],
117
144
  };
118
145
 
119
- export const data = {plainEnumSet: 'foo', oneOfEnumSet: 'bar'};
146
+ export const data = {
147
+ plainEnumSet: 'foo',
148
+ enumWithError: 'bogus',
149
+ oneOfEnumSet: 'bar',
150
+ oneOfEnumWithError: 'bogus',
151
+ };
120
152
 
121
153
  registerExamples([
122
154
  {
@@ -124,6 +156,6 @@ registerExamples([
124
156
  label: 'Enums',
125
157
  data,
126
158
  schema,
127
- uischema
128
- }
159
+ uischema,
160
+ },
129
161
  ]);
@@ -7,18 +7,18 @@ export const schema = {
7
7
  properties: {
8
8
  plainEnum: {
9
9
  type: 'string',
10
- enum: ['foo', 'bar']
10
+ enum: ['foo', 'bar'],
11
11
  },
12
12
  oneOfEnum: {
13
13
  type: 'string',
14
14
  oneOf: [
15
15
  { const: 'foo', title: 'Foo' },
16
16
  { const: 'bar', title: 'Bar' },
17
- { const: 'foobar', title: 'FooBar' }
18
- ]
17
+ { const: 'foobar', title: 'FooBar' },
18
+ ],
19
19
  },
20
- }
21
- }
20
+ },
21
+ },
22
22
  };
23
23
 
24
24
  export const uischema = {
@@ -26,9 +26,9 @@ export const uischema = {
26
26
  elements: [
27
27
  {
28
28
  type: 'Control',
29
- scope: '#'
30
- }
31
- ]
29
+ scope: '#',
30
+ },
31
+ ],
32
32
  };
33
33
 
34
34
  export const data: any[] = [];
@@ -39,6 +39,6 @@ registerExamples([
39
39
  label: 'Array containing enums',
40
40
  data,
41
41
  schema,
42
- uischema
43
- }
42
+ uischema,
43
+ },
44
44
  ]);
@@ -25,25 +25,25 @@
25
25
  import { StateProps } from '../example';
26
26
  import { registerExamples } from '../register';
27
27
 
28
- const actions = [
28
+ export const actions = [
29
29
  {
30
- 'label': 'Change data',
31
- 'apply': (props: StateProps) => {
30
+ label: 'Change data',
31
+ apply: (props: StateProps) => {
32
32
  return {
33
33
  ...props,
34
- data: { id: 'aaa' }
35
- }
36
- }
34
+ data: { id: 'aaa' },
35
+ };
36
+ },
37
37
  },
38
- ]
38
+ ];
39
39
 
40
40
  registerExamples([
41
41
  {
42
42
  name: 'dynamic',
43
- label: 'Dynamic Change',
43
+ label: 'Generate both schemas - Dynamic data change',
44
44
  schema: undefined,
45
45
  uischema: undefined,
46
46
  data: { name: 'bla' },
47
- actions
48
- }
47
+ actions,
48
+ },
49
49
  ]);
@@ -36,6 +36,6 @@ registerExamples([
36
36
  label: 'Generate both Schemas',
37
37
  data,
38
38
  schema,
39
- uischema
40
- }
39
+ uischema,
40
+ },
41
41
  ]);
@@ -36,6 +36,6 @@ registerExamples([
36
36
  label: 'Generate UI Schema',
37
37
  data,
38
38
  schema,
39
- uischema
40
- }
39
+ uischema,
40
+ },
41
41
  ]);