@jsonforms/examples 3.1.0-alpha.0 → 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 +2 -2
- package/docs/assets/js/search.json +1 -1
- package/docs/globals.html +2011 -3265
- package/docs/index.html +1 -31
- 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/control-options.d.ts +1 -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 +2280 -2873
- package/lib/jsonforms-examples.cjs.js.map +1 -1
- package/lib/jsonforms-examples.esm.js +2272 -2882
- package/lib/jsonforms-examples.esm.js.map +1 -1
- package/package.json +14 -7
- 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 -81
- 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 +4949 -2051
- 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,37 +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
|
-
}
|
|
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
|
+
},
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
export const uischema = {
|
|
@@ -63,37 +64,37 @@ export const uischema = {
|
|
|
63
64
|
elements: [
|
|
64
65
|
{
|
|
65
66
|
type: 'Control',
|
|
66
|
-
scope: '#/properties/string'
|
|
67
|
+
scope: '#/properties/string',
|
|
67
68
|
},
|
|
68
69
|
{
|
|
69
70
|
type: 'Control',
|
|
70
|
-
scope: '#/properties/boolean'
|
|
71
|
+
scope: '#/properties/boolean',
|
|
71
72
|
},
|
|
72
73
|
{
|
|
73
74
|
type: 'Control',
|
|
74
|
-
scope: '#/properties/number'
|
|
75
|
+
scope: '#/properties/number',
|
|
75
76
|
},
|
|
76
77
|
{
|
|
77
78
|
type: 'Control',
|
|
78
|
-
scope: '#/properties/integer'
|
|
79
|
+
scope: '#/properties/integer',
|
|
79
80
|
},
|
|
80
81
|
{
|
|
81
82
|
type: 'Control',
|
|
82
|
-
scope: '#/properties/date'
|
|
83
|
+
scope: '#/properties/date',
|
|
83
84
|
},
|
|
84
85
|
{
|
|
85
86
|
type: 'Control',
|
|
86
|
-
scope: '#/properties/time'
|
|
87
|
+
scope: '#/properties/time',
|
|
87
88
|
},
|
|
88
89
|
{
|
|
89
90
|
type: 'Control',
|
|
90
|
-
scope: '#/properties/dateTime'
|
|
91
|
+
scope: '#/properties/dateTime',
|
|
91
92
|
},
|
|
92
93
|
{
|
|
93
94
|
type: 'Control',
|
|
94
|
-
scope: '#/properties/enum'
|
|
95
|
-
}
|
|
96
|
-
]
|
|
95
|
+
scope: '#/properties/enum',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
97
98
|
};
|
|
98
99
|
|
|
99
100
|
export const data = {
|
|
@@ -104,7 +105,7 @@ export const data = {
|
|
|
104
105
|
date: '2020-06-25',
|
|
105
106
|
time: '23:08:00',
|
|
106
107
|
dateTime: '2020-06-25T23:08:42+02:00',
|
|
107
|
-
enum: 'Two'
|
|
108
|
+
enum: 'Two',
|
|
108
109
|
};
|
|
109
110
|
|
|
110
111
|
export const extendedSchema = {
|
|
@@ -123,16 +124,19 @@ export const extendedSchema = {
|
|
|
123
124
|
},
|
|
124
125
|
trimText: {
|
|
125
126
|
type: 'string',
|
|
126
|
-
description:
|
|
127
|
+
description:
|
|
128
|
+
'Trim indicates whether the control shall grab the full width available',
|
|
127
129
|
},
|
|
128
130
|
restrictText: {
|
|
129
131
|
type: 'string',
|
|
130
132
|
maxLength: 5,
|
|
131
|
-
description:
|
|
133
|
+
description:
|
|
134
|
+
'Restricts the input length to the set value (in this case: 5)',
|
|
132
135
|
},
|
|
133
136
|
unfocusedDescription: {
|
|
134
137
|
type: 'string',
|
|
135
|
-
description:
|
|
138
|
+
description:
|
|
139
|
+
'This description is shown even when the control is not focused',
|
|
136
140
|
},
|
|
137
141
|
hideRequiredAsterisk: {
|
|
138
142
|
type: 'string',
|
|
@@ -140,10 +144,10 @@ export const extendedSchema = {
|
|
|
140
144
|
},
|
|
141
145
|
toggle: {
|
|
142
146
|
type: 'boolean',
|
|
143
|
-
description: 'The "toggle" option renders boolean values as a toggle.'
|
|
144
|
-
}
|
|
147
|
+
description: 'The "toggle" option renders boolean values as a toggle.',
|
|
148
|
+
},
|
|
145
149
|
},
|
|
146
|
-
required: ['hideRequiredAsterisk', 'restrictText']
|
|
150
|
+
required: ['hideRequiredAsterisk', 'restrictText'],
|
|
147
151
|
};
|
|
148
152
|
|
|
149
153
|
export const extendedUischema = {
|
|
@@ -153,53 +157,53 @@ export const extendedUischema = {
|
|
|
153
157
|
type: 'Control',
|
|
154
158
|
scope: '#/properties/multilineString',
|
|
155
159
|
options: {
|
|
156
|
-
multi: true
|
|
157
|
-
}
|
|
160
|
+
multi: true,
|
|
161
|
+
},
|
|
158
162
|
},
|
|
159
163
|
{
|
|
160
164
|
type: 'Control',
|
|
161
165
|
scope: '#/properties/slider',
|
|
162
166
|
options: {
|
|
163
|
-
slider: true
|
|
164
|
-
}
|
|
167
|
+
slider: true,
|
|
168
|
+
},
|
|
165
169
|
},
|
|
166
170
|
{
|
|
167
171
|
type: 'Control',
|
|
168
172
|
scope: '#/properties/trimText',
|
|
169
173
|
options: {
|
|
170
|
-
trim: true
|
|
171
|
-
}
|
|
174
|
+
trim: true,
|
|
175
|
+
},
|
|
172
176
|
},
|
|
173
177
|
{
|
|
174
178
|
type: 'Control',
|
|
175
179
|
scope: '#/properties/restrictText',
|
|
176
180
|
options: {
|
|
177
|
-
restrict: true
|
|
178
|
-
}
|
|
181
|
+
restrict: true,
|
|
182
|
+
},
|
|
179
183
|
},
|
|
180
184
|
{
|
|
181
185
|
type: 'Control',
|
|
182
186
|
scope: '#/properties/unfocusedDescription',
|
|
183
187
|
options: {
|
|
184
|
-
showUnfocusedDescription: true
|
|
185
|
-
}
|
|
188
|
+
showUnfocusedDescription: true,
|
|
189
|
+
},
|
|
186
190
|
},
|
|
187
191
|
{
|
|
188
192
|
type: 'Control',
|
|
189
193
|
scope: '#/properties/hideRequiredAsterisk',
|
|
190
194
|
options: {
|
|
191
|
-
hideRequiredAsterisk: true
|
|
192
|
-
}
|
|
195
|
+
hideRequiredAsterisk: true,
|
|
196
|
+
},
|
|
193
197
|
},
|
|
194
198
|
{
|
|
195
199
|
type: 'Control',
|
|
196
200
|
scope: '#/properties/toggle',
|
|
197
201
|
label: 'Boolean as Toggle',
|
|
198
202
|
options: {
|
|
199
|
-
toggle: true
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
]
|
|
203
|
+
toggle: true,
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
],
|
|
203
207
|
};
|
|
204
208
|
|
|
205
209
|
export const extendedData = {
|
|
@@ -207,16 +211,16 @@ export const extendedData = {
|
|
|
207
211
|
slider: 4,
|
|
208
212
|
trimText: 'abcdefg',
|
|
209
213
|
restrictText: 'abcde',
|
|
210
|
-
toggle: false
|
|
214
|
+
toggle: false,
|
|
211
215
|
};
|
|
212
216
|
|
|
213
217
|
const combinedSchema = {
|
|
214
218
|
...extendedSchema,
|
|
215
219
|
properties: {
|
|
216
220
|
...schema.properties,
|
|
217
|
-
...extendedSchema.properties
|
|
218
|
-
}
|
|
219
|
-
}
|
|
221
|
+
...extendedSchema.properties,
|
|
222
|
+
},
|
|
223
|
+
};
|
|
220
224
|
|
|
221
225
|
const combinedUiSchema = {
|
|
222
226
|
type: 'Categorization',
|
|
@@ -224,24 +228,20 @@ const combinedUiSchema = {
|
|
|
224
228
|
{
|
|
225
229
|
type: 'Category',
|
|
226
230
|
label: 'Normal controls',
|
|
227
|
-
elements: [
|
|
228
|
-
uischema
|
|
229
|
-
]
|
|
231
|
+
elements: [uischema],
|
|
230
232
|
},
|
|
231
233
|
{
|
|
232
234
|
type: 'Category',
|
|
233
235
|
label: 'Configured controls',
|
|
234
|
-
elements: [
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
]
|
|
239
|
-
}
|
|
236
|
+
elements: [extendedUischema],
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
};
|
|
240
240
|
|
|
241
241
|
const combinedData = {
|
|
242
242
|
...data,
|
|
243
|
-
...extendedData
|
|
244
|
-
}
|
|
243
|
+
...extendedData,
|
|
244
|
+
};
|
|
245
245
|
|
|
246
246
|
registerExamples([
|
|
247
247
|
{
|
|
@@ -249,6 +249,6 @@ registerExamples([
|
|
|
249
249
|
label: 'Control Options',
|
|
250
250
|
data: combinedData,
|
|
251
251
|
schema: combinedSchema,
|
|
252
|
-
uischema: combinedUiSchema
|
|
253
|
-
}
|
|
252
|
+
uischema: combinedUiSchema,
|
|
253
|
+
},
|
|
254
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
|
]);
|