@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/config.ts
CHANGED
|
@@ -30,14 +30,14 @@ export const schema = {
|
|
|
30
30
|
postalCode: {
|
|
31
31
|
type: 'string',
|
|
32
32
|
description: 'A Postal Code',
|
|
33
|
-
maxLength: 5
|
|
33
|
+
maxLength: 5,
|
|
34
34
|
},
|
|
35
35
|
recurrenceInterval: {
|
|
36
36
|
type: 'integer',
|
|
37
|
-
description: 'A recurrence interval'
|
|
38
|
-
}
|
|
37
|
+
description: 'A recurrence interval',
|
|
38
|
+
},
|
|
39
39
|
},
|
|
40
|
-
required: ['postalCode']
|
|
40
|
+
required: ['postalCode'],
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
export const uischema = {
|
|
@@ -49,27 +49,27 @@ export const uischema = {
|
|
|
49
49
|
{
|
|
50
50
|
type: 'Control',
|
|
51
51
|
scope: '#/properties/postalCode',
|
|
52
|
-
label: 'Postal Code'
|
|
52
|
+
label: 'Postal Code',
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
type: 'Control',
|
|
56
56
|
scope: '#/properties/recurrenceInterval',
|
|
57
|
-
label: 'Recurrence Interval'
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
]
|
|
57
|
+
label: 'Recurrence Interval',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
export const data = {
|
|
65
|
-
postalCode: '12345'
|
|
65
|
+
postalCode: '12345',
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
const config = {
|
|
69
69
|
restrict: true,
|
|
70
70
|
trim: true,
|
|
71
71
|
showUnfocusedDescription: true,
|
|
72
|
-
hideRequiredAsterisk: true
|
|
72
|
+
hideRequiredAsterisk: true,
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
registerExamples([
|
|
@@ -78,7 +78,7 @@ registerExamples([
|
|
|
78
78
|
label: 'Configuration (Default)',
|
|
79
79
|
data,
|
|
80
80
|
schema,
|
|
81
|
-
uischema: uischema
|
|
81
|
+
uischema: uischema,
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
name: 'configCustom',
|
|
@@ -86,6 +86,6 @@ registerExamples([
|
|
|
86
86
|
data,
|
|
87
87
|
schema,
|
|
88
88
|
uischema,
|
|
89
|
-
config
|
|
90
|
-
}
|
|
89
|
+
config,
|
|
90
|
+
},
|
|
91
91
|
]);
|
|
@@ -25,38 +25,38 @@
|
|
|
25
25
|
import { registerExamples } from '../register';
|
|
26
26
|
|
|
27
27
|
export const schema = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
string: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
},
|
|
33
|
+
boolean: {
|
|
34
|
+
type: 'boolean',
|
|
35
|
+
description: 'Boolean description as a tooltip',
|
|
36
|
+
},
|
|
37
|
+
number: {
|
|
38
|
+
type: 'number',
|
|
39
|
+
},
|
|
40
|
+
integer: {
|
|
41
|
+
type: 'integer',
|
|
42
|
+
},
|
|
43
|
+
date: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
format: 'date',
|
|
46
|
+
},
|
|
47
|
+
time: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
format: 'time',
|
|
50
|
+
},
|
|
51
|
+
dateTime: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
format: 'date-time',
|
|
54
|
+
},
|
|
55
|
+
enum: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
enum: ['One', 'Two', 'Three'],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export const uischema = {
|
|
@@ -64,37 +64,37 @@ export const uischema = {
|
|
|
64
64
|
elements: [
|
|
65
65
|
{
|
|
66
66
|
type: 'Control',
|
|
67
|
-
scope: '#/properties/string'
|
|
67
|
+
scope: '#/properties/string',
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
type: 'Control',
|
|
71
|
-
scope: '#/properties/boolean'
|
|
71
|
+
scope: '#/properties/boolean',
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
type: 'Control',
|
|
75
|
-
scope: '#/properties/number'
|
|
75
|
+
scope: '#/properties/number',
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
type: 'Control',
|
|
79
|
-
scope: '#/properties/integer'
|
|
79
|
+
scope: '#/properties/integer',
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
type: 'Control',
|
|
83
|
-
scope: '#/properties/date'
|
|
83
|
+
scope: '#/properties/date',
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
type: 'Control',
|
|
87
|
-
scope: '#/properties/time'
|
|
87
|
+
scope: '#/properties/time',
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
type: 'Control',
|
|
91
|
-
scope: '#/properties/dateTime'
|
|
91
|
+
scope: '#/properties/dateTime',
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
type: 'Control',
|
|
95
|
-
scope: '#/properties/enum'
|
|
96
|
-
}
|
|
97
|
-
]
|
|
95
|
+
scope: '#/properties/enum',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
export const data = {
|
|
@@ -105,7 +105,7 @@ export const data = {
|
|
|
105
105
|
date: '2020-06-25',
|
|
106
106
|
time: '23:08:00',
|
|
107
107
|
dateTime: '2020-06-25T23:08:42+02:00',
|
|
108
|
-
enum: 'Two'
|
|
108
|
+
enum: 'Two',
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
export const extendedSchema = {
|
|
@@ -124,16 +124,19 @@ export const extendedSchema = {
|
|
|
124
124
|
},
|
|
125
125
|
trimText: {
|
|
126
126
|
type: 'string',
|
|
127
|
-
description:
|
|
127
|
+
description:
|
|
128
|
+
'Trim indicates whether the control shall grab the full width available',
|
|
128
129
|
},
|
|
129
130
|
restrictText: {
|
|
130
131
|
type: 'string',
|
|
131
132
|
maxLength: 5,
|
|
132
|
-
description:
|
|
133
|
+
description:
|
|
134
|
+
'Restricts the input length to the set value (in this case: 5)',
|
|
133
135
|
},
|
|
134
136
|
unfocusedDescription: {
|
|
135
137
|
type: 'string',
|
|
136
|
-
description:
|
|
138
|
+
description:
|
|
139
|
+
'This description is shown even when the control is not focused',
|
|
137
140
|
},
|
|
138
141
|
hideRequiredAsterisk: {
|
|
139
142
|
type: 'string',
|
|
@@ -141,10 +144,10 @@ export const extendedSchema = {
|
|
|
141
144
|
},
|
|
142
145
|
toggle: {
|
|
143
146
|
type: 'boolean',
|
|
144
|
-
description: 'The "toggle" option renders boolean values as a toggle.'
|
|
145
|
-
}
|
|
147
|
+
description: 'The "toggle" option renders boolean values as a toggle.',
|
|
148
|
+
},
|
|
146
149
|
},
|
|
147
|
-
required: ['hideRequiredAsterisk', 'restrictText']
|
|
150
|
+
required: ['hideRequiredAsterisk', 'restrictText'],
|
|
148
151
|
};
|
|
149
152
|
|
|
150
153
|
export const extendedUischema = {
|
|
@@ -154,53 +157,53 @@ export const extendedUischema = {
|
|
|
154
157
|
type: 'Control',
|
|
155
158
|
scope: '#/properties/multilineString',
|
|
156
159
|
options: {
|
|
157
|
-
multi: true
|
|
158
|
-
}
|
|
160
|
+
multi: true,
|
|
161
|
+
},
|
|
159
162
|
},
|
|
160
163
|
{
|
|
161
164
|
type: 'Control',
|
|
162
165
|
scope: '#/properties/slider',
|
|
163
166
|
options: {
|
|
164
|
-
slider: true
|
|
165
|
-
}
|
|
167
|
+
slider: true,
|
|
168
|
+
},
|
|
166
169
|
},
|
|
167
170
|
{
|
|
168
171
|
type: 'Control',
|
|
169
172
|
scope: '#/properties/trimText',
|
|
170
173
|
options: {
|
|
171
|
-
trim: true
|
|
172
|
-
}
|
|
174
|
+
trim: true,
|
|
175
|
+
},
|
|
173
176
|
},
|
|
174
177
|
{
|
|
175
178
|
type: 'Control',
|
|
176
179
|
scope: '#/properties/restrictText',
|
|
177
180
|
options: {
|
|
178
|
-
restrict: true
|
|
179
|
-
}
|
|
181
|
+
restrict: true,
|
|
182
|
+
},
|
|
180
183
|
},
|
|
181
184
|
{
|
|
182
185
|
type: 'Control',
|
|
183
186
|
scope: '#/properties/unfocusedDescription',
|
|
184
187
|
options: {
|
|
185
|
-
showUnfocusedDescription: true
|
|
186
|
-
}
|
|
188
|
+
showUnfocusedDescription: true,
|
|
189
|
+
},
|
|
187
190
|
},
|
|
188
191
|
{
|
|
189
192
|
type: 'Control',
|
|
190
193
|
scope: '#/properties/hideRequiredAsterisk',
|
|
191
194
|
options: {
|
|
192
|
-
hideRequiredAsterisk: true
|
|
193
|
-
}
|
|
195
|
+
hideRequiredAsterisk: true,
|
|
196
|
+
},
|
|
194
197
|
},
|
|
195
198
|
{
|
|
196
199
|
type: 'Control',
|
|
197
200
|
scope: '#/properties/toggle',
|
|
198
201
|
label: 'Boolean as Toggle',
|
|
199
202
|
options: {
|
|
200
|
-
toggle: true
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
]
|
|
203
|
+
toggle: true,
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
],
|
|
204
207
|
};
|
|
205
208
|
|
|
206
209
|
export const extendedData = {
|
|
@@ -208,16 +211,16 @@ export const extendedData = {
|
|
|
208
211
|
slider: 4,
|
|
209
212
|
trimText: 'abcdefg',
|
|
210
213
|
restrictText: 'abcde',
|
|
211
|
-
toggle: false
|
|
214
|
+
toggle: false,
|
|
212
215
|
};
|
|
213
216
|
|
|
214
217
|
const combinedSchema = {
|
|
215
218
|
...extendedSchema,
|
|
216
219
|
properties: {
|
|
217
220
|
...schema.properties,
|
|
218
|
-
...extendedSchema.properties
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
+
...extendedSchema.properties,
|
|
222
|
+
},
|
|
223
|
+
};
|
|
221
224
|
|
|
222
225
|
const combinedUiSchema = {
|
|
223
226
|
type: 'Categorization',
|
|
@@ -225,24 +228,20 @@ const combinedUiSchema = {
|
|
|
225
228
|
{
|
|
226
229
|
type: 'Category',
|
|
227
230
|
label: 'Normal controls',
|
|
228
|
-
elements: [
|
|
229
|
-
uischema
|
|
230
|
-
]
|
|
231
|
+
elements: [uischema],
|
|
231
232
|
},
|
|
232
233
|
{
|
|
233
234
|
type: 'Category',
|
|
234
235
|
label: 'Configured controls',
|
|
235
|
-
elements: [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
]
|
|
240
|
-
}
|
|
236
|
+
elements: [extendedUischema],
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
};
|
|
241
240
|
|
|
242
241
|
const combinedData = {
|
|
243
242
|
...data,
|
|
244
|
-
...extendedData
|
|
245
|
-
}
|
|
243
|
+
...extendedData,
|
|
244
|
+
};
|
|
246
245
|
|
|
247
246
|
registerExamples([
|
|
248
247
|
{
|
|
@@ -250,6 +249,6 @@ registerExamples([
|
|
|
250
249
|
label: 'Control Options',
|
|
251
250
|
data: combinedData,
|
|
252
251
|
schema: combinedSchema,
|
|
253
|
-
uischema: combinedUiSchema
|
|
254
|
-
}
|
|
252
|
+
uischema: combinedUiSchema,
|
|
253
|
+
},
|
|
255
254
|
]);
|
package/src/examples/dates.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import { registerExamples } from '../register';
|
|
26
26
|
|
|
27
|
-
const schema = {
|
|
27
|
+
export const schema = {
|
|
28
28
|
type: 'object',
|
|
29
29
|
properties: {
|
|
30
30
|
schemaBased: {
|
|
@@ -33,40 +33,40 @@ const schema = {
|
|
|
33
33
|
date: {
|
|
34
34
|
type: 'string',
|
|
35
35
|
format: 'date',
|
|
36
|
-
description: 'schema-based date picker'
|
|
36
|
+
description: 'schema-based date picker',
|
|
37
37
|
},
|
|
38
38
|
time: {
|
|
39
39
|
type: 'string',
|
|
40
40
|
format: 'time',
|
|
41
|
-
description: 'schema-based time picker'
|
|
41
|
+
description: 'schema-based time picker',
|
|
42
42
|
},
|
|
43
43
|
datetime: {
|
|
44
44
|
type: 'string',
|
|
45
45
|
format: 'date-time',
|
|
46
|
-
description: 'schema-based datetime picker'
|
|
47
|
-
}
|
|
48
|
-
}
|
|
46
|
+
description: 'schema-based datetime picker',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
49
|
},
|
|
50
50
|
uiSchemaBased: {
|
|
51
51
|
type: 'object',
|
|
52
52
|
properties: {
|
|
53
53
|
date: {
|
|
54
54
|
type: 'string',
|
|
55
|
-
description: 'does not allow to select days'
|
|
55
|
+
description: 'does not allow to select days',
|
|
56
56
|
},
|
|
57
57
|
time: {
|
|
58
58
|
type: 'string',
|
|
59
|
-
description: '24 hour format'
|
|
59
|
+
description: '24 hour format',
|
|
60
60
|
},
|
|
61
61
|
datetime: {
|
|
62
62
|
type: 'string',
|
|
63
|
-
description: 'uischema-based datetime picker'
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
63
|
+
description: 'uischema-based datetime picker',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
68
|
};
|
|
69
|
-
const uischema = {
|
|
69
|
+
export const uischema = {
|
|
70
70
|
type: 'VerticalLayout',
|
|
71
71
|
elements: [
|
|
72
72
|
{
|
|
@@ -74,17 +74,17 @@ const uischema = {
|
|
|
74
74
|
elements: [
|
|
75
75
|
{
|
|
76
76
|
type: 'Control',
|
|
77
|
-
scope: '#/properties/schemaBased/properties/date'
|
|
77
|
+
scope: '#/properties/schemaBased/properties/date',
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
type: 'Control',
|
|
81
|
-
scope: '#/properties/schemaBased/properties/time'
|
|
81
|
+
scope: '#/properties/schemaBased/properties/time',
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
type: 'Control',
|
|
85
|
-
scope: '#/properties/schemaBased/properties/datetime'
|
|
86
|
-
}
|
|
87
|
-
]
|
|
85
|
+
scope: '#/properties/schemaBased/properties/datetime',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
type: 'HorizontalLayout',
|
|
@@ -100,7 +100,7 @@ const uischema = {
|
|
|
100
100
|
okLabel: 'Do it',
|
|
101
101
|
views: ['year', 'month'],
|
|
102
102
|
dateFormat: 'YYYY.MM',
|
|
103
|
-
dateSaveFormat: 'YYYY-MM'
|
|
103
|
+
dateSaveFormat: 'YYYY-MM',
|
|
104
104
|
},
|
|
105
105
|
},
|
|
106
106
|
{
|
|
@@ -108,8 +108,8 @@ const uischema = {
|
|
|
108
108
|
scope: '#/properties/uiSchemaBased/properties/time',
|
|
109
109
|
options: {
|
|
110
110
|
format: 'time',
|
|
111
|
-
ampm: true
|
|
112
|
-
}
|
|
111
|
+
ampm: true,
|
|
112
|
+
},
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
type: 'Control',
|
|
@@ -118,25 +118,25 @@ const uischema = {
|
|
|
118
118
|
format: 'date-time',
|
|
119
119
|
dateTimeFormat: 'DD-MM-YY hh:mm:a',
|
|
120
120
|
dateTimeSaveFormat: 'YYYY/MM/DD h:mm a',
|
|
121
|
-
ampm: true
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
]
|
|
121
|
+
ampm: true,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
127
|
};
|
|
128
128
|
|
|
129
|
-
const data = {
|
|
129
|
+
export const data = {
|
|
130
130
|
schemaBased: {
|
|
131
131
|
date: new Date().toISOString().substr(0, 10),
|
|
132
132
|
time: '13:37',
|
|
133
|
-
datetime: new Date().toISOString()
|
|
133
|
+
datetime: new Date().toISOString(),
|
|
134
134
|
},
|
|
135
135
|
uiSchemaBased: {
|
|
136
136
|
date: new Date().toISOString().substr(0, 10),
|
|
137
137
|
time: '13:37',
|
|
138
|
-
datetime: '1999/12/11 10:05 am'
|
|
139
|
-
}
|
|
138
|
+
datetime: '1999/12/11 10:05 am',
|
|
139
|
+
},
|
|
140
140
|
};
|
|
141
141
|
registerExamples([
|
|
142
142
|
{
|
|
@@ -144,6 +144,6 @@ registerExamples([
|
|
|
144
144
|
label: 'Dates',
|
|
145
145
|
data,
|
|
146
146
|
schema,
|
|
147
|
-
uischema
|
|
148
|
-
}
|
|
147
|
+
uischema,
|
|
148
|
+
},
|
|
149
149
|
]);
|
package/src/examples/default.ts
CHANGED
|
@@ -29,34 +29,34 @@ export const schema = {
|
|
|
29
29
|
properties: {
|
|
30
30
|
name: {
|
|
31
31
|
type: 'string',
|
|
32
|
-
default: 'foo'
|
|
32
|
+
default: 'foo',
|
|
33
33
|
},
|
|
34
34
|
name_noDefault: {
|
|
35
|
-
type: 'string'
|
|
35
|
+
type: 'string',
|
|
36
36
|
},
|
|
37
37
|
description: {
|
|
38
38
|
type: 'string',
|
|
39
|
-
default: 'bar'
|
|
39
|
+
default: 'bar',
|
|
40
40
|
},
|
|
41
41
|
done: {
|
|
42
42
|
type: 'boolean',
|
|
43
|
-
default: false
|
|
43
|
+
default: false,
|
|
44
44
|
},
|
|
45
45
|
rating: {
|
|
46
46
|
type: 'integer',
|
|
47
|
-
default: 5
|
|
47
|
+
default: 5,
|
|
48
48
|
},
|
|
49
49
|
cost: {
|
|
50
50
|
type: 'number',
|
|
51
|
-
default: 5.5
|
|
51
|
+
default: 5.5,
|
|
52
52
|
},
|
|
53
53
|
dueDate: {
|
|
54
54
|
type: 'string',
|
|
55
55
|
format: 'date',
|
|
56
|
-
default: '2019-04-01'
|
|
57
|
-
}
|
|
56
|
+
default: '2019-04-01',
|
|
57
|
+
},
|
|
58
58
|
},
|
|
59
|
-
required: ['name', 'name_noDefault']
|
|
59
|
+
required: ['name', 'name_noDefault'],
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export const uischema = {
|
|
@@ -64,37 +64,37 @@ export const uischema = {
|
|
|
64
64
|
elements: [
|
|
65
65
|
{
|
|
66
66
|
type: 'Control',
|
|
67
|
-
scope: '#/properties/name'
|
|
67
|
+
scope: '#/properties/name',
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
type: 'Control',
|
|
71
|
-
scope: '#/properties/name_noDefault'
|
|
71
|
+
scope: '#/properties/name_noDefault',
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
type: 'Control',
|
|
75
75
|
label: false,
|
|
76
|
-
scope: '#/properties/done'
|
|
76
|
+
scope: '#/properties/done',
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
type: 'Control',
|
|
80
80
|
scope: '#/properties/description',
|
|
81
81
|
options: {
|
|
82
|
-
multi: true
|
|
83
|
-
}
|
|
82
|
+
multi: true,
|
|
83
|
+
},
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
type: 'Control',
|
|
87
|
-
scope: '#/properties/rating'
|
|
87
|
+
scope: '#/properties/rating',
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
type: 'Control',
|
|
91
|
-
scope: '#/properties/cost'
|
|
91
|
+
scope: '#/properties/cost',
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
type: 'Control',
|
|
95
|
-
scope: '#/properties/dueDate'
|
|
96
|
-
}
|
|
97
|
-
]
|
|
95
|
+
scope: '#/properties/dueDate',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
export const data = {
|
|
@@ -104,7 +104,7 @@ export const data = {
|
|
|
104
104
|
done: true,
|
|
105
105
|
rating: 1,
|
|
106
106
|
cost: 3.14,
|
|
107
|
-
dueDate: '2019-05-01'
|
|
107
|
+
dueDate: '2019-05-01',
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
registerExamples([
|
|
@@ -113,6 +113,6 @@ registerExamples([
|
|
|
113
113
|
label: 'Default',
|
|
114
114
|
data,
|
|
115
115
|
schema,
|
|
116
|
-
uischema
|
|
117
|
-
}
|
|
116
|
+
uischema,
|
|
117
|
+
},
|
|
118
118
|
]);
|
|
@@ -34,19 +34,19 @@ export const schema = {
|
|
|
34
34
|
oneOf: [
|
|
35
35
|
{ const: 'foo', title: 'My Foo' },
|
|
36
36
|
{ const: 'bar', title: 'My Bar' },
|
|
37
|
-
{ const: 'foobar', title: 'My FooBar' }
|
|
38
|
-
]
|
|
39
|
-
}
|
|
37
|
+
{ const: 'foobar', title: 'My FooBar' },
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
40
|
},
|
|
41
41
|
multiEnum: {
|
|
42
42
|
type: 'array',
|
|
43
43
|
uniqueItems: true,
|
|
44
44
|
items: {
|
|
45
45
|
type: 'string',
|
|
46
|
-
enum: ['foo', 'bar', 'foobar']
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
46
|
+
enum: ['foo', 'bar', 'foobar'],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
export const uischema = {
|
|
@@ -54,13 +54,13 @@ export const uischema = {
|
|
|
54
54
|
elements: [
|
|
55
55
|
{
|
|
56
56
|
type: 'Control',
|
|
57
|
-
scope: '#/properties/oneOfMultiEnum'
|
|
57
|
+
scope: '#/properties/oneOfMultiEnum',
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
type: 'Control',
|
|
61
|
-
scope: '#/properties/multiEnum'
|
|
62
|
-
}
|
|
63
|
-
]
|
|
61
|
+
scope: '#/properties/multiEnum',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
export const data = { oneOfMultiEnum: ['foo'], multiEnum: ['bar'] };
|
|
@@ -68,9 +68,9 @@ export const data = { oneOfMultiEnum: ['foo'], multiEnum: ['bar'] };
|
|
|
68
68
|
registerExamples([
|
|
69
69
|
{
|
|
70
70
|
name: 'multi-enum',
|
|
71
|
-
label: 'Multi
|
|
71
|
+
label: 'Enum - Multi selection',
|
|
72
72
|
data,
|
|
73
73
|
schema,
|
|
74
|
-
uischema
|
|
75
|
-
}
|
|
74
|
+
uischema,
|
|
75
|
+
},
|
|
76
76
|
]);
|