@jsonforms/examples 3.1.0-alpha.1 → 3.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +29 -0
- package/.prettierrc.js +6 -0
- package/README.md +1 -1
- package/docs/assets/js/search.json +1 -1
- package/docs/globals.html +1860 -3124
- package/docs/index.html +0 -30
- package/lib/examples/1884.d.ts +8 -0
- package/lib/examples/additional-errors.d.ts +16 -1
- package/lib/examples/anyOf.d.ts +15 -2
- package/lib/examples/arraysI18n.d.ts +52 -0
- package/lib/examples/dates.d.ts +115 -1
- package/lib/examples/enum.d.ts +3 -0
- package/lib/examples/generate-dynamic.d.ts +15 -0
- package/lib/examples/list-with-detail-primitives.d.ts +36 -0
- package/lib/examples/list-with-detail-registered.d.ts +55 -1
- package/lib/examples/list-with-detail.d.ts +191 -1
- package/lib/examples/nestedCategorization.d.ts +57 -0
- package/lib/examples/radioGroup.d.ts +42 -1
- package/lib/index.d.ts +8 -19
- package/lib/jsonforms-examples.cjs.js +2279 -2873
- package/lib/jsonforms-examples.cjs.js.map +1 -1
- package/lib/jsonforms-examples.esm.js +2271 -2882
- package/lib/jsonforms-examples.esm.js.map +1 -1
- package/package.json +13 -6
- package/rollup.config.js +12 -12
- package/src/example.ts +3 -3
- package/src/examples/1884.ts +52 -48
- package/src/examples/1948.ts +19 -19
- package/src/examples/additional-errors.ts +28 -25
- package/src/examples/allOf.ts +18 -18
- package/src/examples/anyOf-oneOf-allOf-resolve.ts +21 -21
- package/src/examples/anyOf.ts +42 -24
- package/src/examples/arrays-with-custom-element-label.ts +21 -21
- package/src/examples/arrays-with-detail-and-rule.ts +28 -28
- package/src/examples/arrays-with-detail.ts +21 -21
- package/src/examples/arrays-with-sorting.ts +35 -35
- package/src/examples/arrays.ts +35 -35
- package/src/examples/arraysI18n.ts +107 -0
- package/src/examples/{steppershownav.ts → categorization-stepper-nav-buttons.ts} +6 -6
- package/src/examples/{stepper.ts → categorization-stepper.ts} +5 -5
- package/src/examples/categorization.ts +119 -119
- package/src/examples/conditional-schema-compositions.ts +20 -20
- package/src/examples/config.ts +15 -15
- package/src/examples/control-options.ts +81 -82
- package/src/examples/dates.ts +34 -34
- package/src/examples/default.ts +22 -22
- package/src/examples/{multi-enum.ts → enum-multi.ts} +14 -14
- package/src/examples/enum.ts +40 -33
- package/src/examples/enumInArray.ts +10 -10
- package/src/examples/{dynamic.ts → generate-dynamic.ts} +10 -10
- package/src/examples/generate.ts +2 -2
- package/src/examples/generateUI.ts +2 -2
- package/src/examples/huge.ts +381 -377
- package/src/examples/i18n.ts +37 -28
- package/src/examples/if_then_else.ts +4 -4
- package/src/examples/layout.ts +29 -29
- package/src/examples/{booleanToggle.ts → list-with-detail-primitives.ts} +46 -33
- package/src/examples/list-with-detail-registered.ts +26 -26
- package/src/examples/list-with-detail.ts +82 -82
- package/src/examples/nestedArrays.ts +40 -35
- package/src/examples/nestedCategorization.ts +175 -0
- package/src/examples/numbers.ts +17 -17
- package/src/examples/object.ts +24 -24
- package/src/examples/onChange.ts +28 -22
- package/src/examples/oneOf-recursive.ts +15 -15
- package/src/examples/oneOf.ts +99 -96
- package/src/examples/oneOfArray.ts +20 -20
- package/src/examples/person.ts +35 -35
- package/src/examples/radioGroup.ts +52 -53
- package/src/examples/readonly.ts +14 -14
- package/src/examples/rule.ts +26 -26
- package/src/examples/ruleInheritance.ts +37 -34
- package/src/examples/scope.ts +26 -26
- package/src/examples/stringArray.ts +10 -10
- package/src/examples/text.ts +19 -19
- package/src/index.ts +11 -33
- package/src/register.ts +6 -3
- package/stats.html +2462 -329
- package/tsconfig.json +2 -6
- package/lib/examples/1169.d.ts +0 -24
- package/lib/examples/1220.d.ts +0 -4
- package/lib/examples/1253.d.ts +0 -16
- package/lib/examples/1254.d.ts +0 -21
- package/lib/examples/1645.d.ts +0 -68
- package/lib/examples/1779.d.ts +0 -1
- package/lib/examples/1996.d.ts +0 -31
- package/lib/examples/booleanToggle.d.ts +0 -62
- package/lib/examples/day1.d.ts +0 -23
- package/lib/examples/day2.d.ts +0 -42
- package/lib/examples/day3.d.ts +0 -51
- package/lib/examples/day4.d.ts +0 -72
- package/lib/examples/day5.d.ts +0 -133
- package/lib/examples/day6.d.ts +0 -85
- package/lib/examples/dynamic.d.ts +0 -1
- package/src/examples/1169.ts +0 -62
- package/src/examples/1220.ts +0 -146
- package/src/examples/1253.ts +0 -212
- package/src/examples/1254.ts +0 -67
- package/src/examples/1645.ts +0 -66
- package/src/examples/1779.ts +0 -83
- package/src/examples/1996.ts +0 -102
- package/src/examples/day1.ts +0 -61
- package/src/examples/day2.ts +0 -62
- package/src/examples/day3.ts +0 -76
- package/src/examples/day4.ts +0 -83
- package/src/examples/day5.ts +0 -169
- package/src/examples/day6.ts +0 -44
- /package/lib/examples/{steppershownav.d.ts → categorization-stepper-nav-buttons.d.ts} +0 -0
- /package/lib/examples/{stepper.d.ts → categorization-stepper.d.ts} +0 -0
- /package/lib/examples/{multi-enum.d.ts → enum-multi.d.ts} +0 -0
package/src/examples/enum.ts
CHANGED
|
@@ -29,29 +29,32 @@ 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
37
|
},
|
|
38
38
|
oneOfEnum: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
type: 'string',
|
|
40
|
+
oneOf: [
|
|
41
|
+
{ const: 'foo', title: 'Foo' },
|
|
42
|
+
{ const: 'bar', title: 'Bar' },
|
|
43
|
+
{ const: 'foobar', title: 'FooBar' },
|
|
44
|
+
],
|
|
45
45
|
},
|
|
46
46
|
oneOfEnumSet: {
|
|
47
47
|
type: 'string',
|
|
48
48
|
oneOf: [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
]
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
{ const: 'foo', title: 'Foo' },
|
|
50
|
+
{ const: 'bar', title: 'Bar' },
|
|
51
|
+
{ const: 'foobar', title: 'FooBar' },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
constEnum: {
|
|
55
|
+
const: 'Const Value',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
55
58
|
};
|
|
56
59
|
|
|
57
60
|
export const uischema = {
|
|
@@ -63,27 +66,31 @@ export const uischema = {
|
|
|
63
66
|
elements: [
|
|
64
67
|
{
|
|
65
68
|
type: 'Control',
|
|
66
|
-
scope: '#/properties/
|
|
69
|
+
scope: '#/properties/constEnum',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: 'Control',
|
|
73
|
+
scope: '#/properties/plainEnum',
|
|
67
74
|
},
|
|
68
75
|
{
|
|
69
76
|
type: 'Control',
|
|
70
|
-
scope: '#/properties/plainEnumSet'
|
|
77
|
+
scope: '#/properties/plainEnumSet',
|
|
71
78
|
},
|
|
72
79
|
{
|
|
73
80
|
type: 'Control',
|
|
74
81
|
scope: '#/properties/plainEnum',
|
|
75
82
|
options: {
|
|
76
|
-
autocomplete: false
|
|
77
|
-
}
|
|
83
|
+
autocomplete: false,
|
|
84
|
+
},
|
|
78
85
|
},
|
|
79
86
|
{
|
|
80
87
|
type: 'Control',
|
|
81
88
|
scope: '#/properties/plainEnumSet',
|
|
82
89
|
options: {
|
|
83
|
-
autocomplete: false
|
|
84
|
-
}
|
|
90
|
+
autocomplete: false,
|
|
91
|
+
},
|
|
85
92
|
},
|
|
86
|
-
]
|
|
93
|
+
],
|
|
87
94
|
},
|
|
88
95
|
{
|
|
89
96
|
type: 'Group',
|
|
@@ -91,32 +98,32 @@ export const uischema = {
|
|
|
91
98
|
elements: [
|
|
92
99
|
{
|
|
93
100
|
type: 'Control',
|
|
94
|
-
scope: '#/properties/oneOfEnum'
|
|
101
|
+
scope: '#/properties/oneOfEnum',
|
|
95
102
|
},
|
|
96
103
|
{
|
|
97
104
|
type: 'Control',
|
|
98
|
-
scope: '#/properties/oneOfEnumSet'
|
|
105
|
+
scope: '#/properties/oneOfEnumSet',
|
|
99
106
|
},
|
|
100
107
|
{
|
|
101
108
|
type: 'Control',
|
|
102
109
|
scope: '#/properties/oneOfEnum',
|
|
103
110
|
options: {
|
|
104
|
-
autocomplete: false
|
|
105
|
-
}
|
|
111
|
+
autocomplete: false,
|
|
112
|
+
},
|
|
106
113
|
},
|
|
107
114
|
{
|
|
108
115
|
type: 'Control',
|
|
109
116
|
scope: '#/properties/oneOfEnumSet',
|
|
110
117
|
options: {
|
|
111
|
-
autocomplete: false
|
|
112
|
-
}
|
|
118
|
+
autocomplete: false,
|
|
119
|
+
},
|
|
113
120
|
},
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
]
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
],
|
|
117
124
|
};
|
|
118
125
|
|
|
119
|
-
export const data = {plainEnumSet: 'foo', oneOfEnumSet: 'bar'};
|
|
126
|
+
export const data = { plainEnumSet: 'foo', oneOfEnumSet: 'bar' };
|
|
120
127
|
|
|
121
128
|
registerExamples([
|
|
122
129
|
{
|
|
@@ -124,6 +131,6 @@ registerExamples([
|
|
|
124
131
|
label: 'Enums',
|
|
125
132
|
data,
|
|
126
133
|
schema,
|
|
127
|
-
uischema
|
|
128
|
-
}
|
|
134
|
+
uischema,
|
|
135
|
+
},
|
|
129
136
|
]);
|
|
@@ -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
|
-
|
|
31
|
-
|
|
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
|
|
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
|
]);
|
package/src/examples/generate.ts
CHANGED