@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.
Files changed (110) 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 +1860 -3124
  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/arraysI18n.d.ts +52 -0
  11. package/lib/examples/dates.d.ts +115 -1
  12. package/lib/examples/enum.d.ts +3 -0
  13. package/lib/examples/generate-dynamic.d.ts +15 -0
  14. package/lib/examples/list-with-detail-primitives.d.ts +36 -0
  15. package/lib/examples/list-with-detail-registered.d.ts +55 -1
  16. package/lib/examples/list-with-detail.d.ts +191 -1
  17. package/lib/examples/nestedCategorization.d.ts +57 -0
  18. package/lib/examples/radioGroup.d.ts +42 -1
  19. package/lib/index.d.ts +8 -19
  20. package/lib/jsonforms-examples.cjs.js +2279 -2873
  21. package/lib/jsonforms-examples.cjs.js.map +1 -1
  22. package/lib/jsonforms-examples.esm.js +2271 -2882
  23. package/lib/jsonforms-examples.esm.js.map +1 -1
  24. package/package.json +13 -6
  25. package/rollup.config.js +12 -12
  26. package/src/example.ts +3 -3
  27. package/src/examples/1884.ts +52 -48
  28. package/src/examples/1948.ts +19 -19
  29. package/src/examples/additional-errors.ts +28 -25
  30. package/src/examples/allOf.ts +18 -18
  31. package/src/examples/anyOf-oneOf-allOf-resolve.ts +21 -21
  32. package/src/examples/anyOf.ts +42 -24
  33. package/src/examples/arrays-with-custom-element-label.ts +21 -21
  34. package/src/examples/arrays-with-detail-and-rule.ts +28 -28
  35. package/src/examples/arrays-with-detail.ts +21 -21
  36. package/src/examples/arrays-with-sorting.ts +35 -35
  37. package/src/examples/arrays.ts +35 -35
  38. package/src/examples/arraysI18n.ts +107 -0
  39. package/src/examples/{steppershownav.ts → categorization-stepper-nav-buttons.ts} +6 -6
  40. package/src/examples/{stepper.ts → categorization-stepper.ts} +5 -5
  41. package/src/examples/categorization.ts +119 -119
  42. package/src/examples/conditional-schema-compositions.ts +20 -20
  43. package/src/examples/config.ts +15 -15
  44. package/src/examples/control-options.ts +81 -82
  45. package/src/examples/dates.ts +34 -34
  46. package/src/examples/default.ts +22 -22
  47. package/src/examples/{multi-enum.ts → enum-multi.ts} +14 -14
  48. package/src/examples/enum.ts +40 -33
  49. package/src/examples/enumInArray.ts +10 -10
  50. package/src/examples/{dynamic.ts → generate-dynamic.ts} +10 -10
  51. package/src/examples/generate.ts +2 -2
  52. package/src/examples/generateUI.ts +2 -2
  53. package/src/examples/huge.ts +381 -377
  54. package/src/examples/i18n.ts +37 -28
  55. package/src/examples/if_then_else.ts +4 -4
  56. package/src/examples/layout.ts +29 -29
  57. package/src/examples/{booleanToggle.ts → list-with-detail-primitives.ts} +46 -33
  58. package/src/examples/list-with-detail-registered.ts +26 -26
  59. package/src/examples/list-with-detail.ts +82 -82
  60. package/src/examples/nestedArrays.ts +40 -35
  61. package/src/examples/nestedCategorization.ts +175 -0
  62. package/src/examples/numbers.ts +17 -17
  63. package/src/examples/object.ts +24 -24
  64. package/src/examples/onChange.ts +28 -22
  65. package/src/examples/oneOf-recursive.ts +15 -15
  66. package/src/examples/oneOf.ts +99 -96
  67. package/src/examples/oneOfArray.ts +20 -20
  68. package/src/examples/person.ts +35 -35
  69. package/src/examples/radioGroup.ts +52 -53
  70. package/src/examples/readonly.ts +14 -14
  71. package/src/examples/rule.ts +26 -26
  72. package/src/examples/ruleInheritance.ts +37 -34
  73. package/src/examples/scope.ts +26 -26
  74. package/src/examples/stringArray.ts +10 -10
  75. package/src/examples/text.ts +19 -19
  76. package/src/index.ts +11 -33
  77. package/src/register.ts +6 -3
  78. package/stats.html +2462 -329
  79. package/tsconfig.json +2 -6
  80. package/lib/examples/1169.d.ts +0 -24
  81. package/lib/examples/1220.d.ts +0 -4
  82. package/lib/examples/1253.d.ts +0 -16
  83. package/lib/examples/1254.d.ts +0 -21
  84. package/lib/examples/1645.d.ts +0 -68
  85. package/lib/examples/1779.d.ts +0 -1
  86. package/lib/examples/1996.d.ts +0 -31
  87. package/lib/examples/booleanToggle.d.ts +0 -62
  88. package/lib/examples/day1.d.ts +0 -23
  89. package/lib/examples/day2.d.ts +0 -42
  90. package/lib/examples/day3.d.ts +0 -51
  91. package/lib/examples/day4.d.ts +0 -72
  92. package/lib/examples/day5.d.ts +0 -133
  93. package/lib/examples/day6.d.ts +0 -85
  94. package/lib/examples/dynamic.d.ts +0 -1
  95. package/src/examples/1169.ts +0 -62
  96. package/src/examples/1220.ts +0 -146
  97. package/src/examples/1253.ts +0 -212
  98. package/src/examples/1254.ts +0 -67
  99. package/src/examples/1645.ts +0 -66
  100. package/src/examples/1779.ts +0 -83
  101. package/src/examples/1996.ts +0 -102
  102. package/src/examples/day1.ts +0 -61
  103. package/src/examples/day2.ts +0 -62
  104. package/src/examples/day3.ts +0 -76
  105. package/src/examples/day4.ts +0 -83
  106. package/src/examples/day5.ts +0 -169
  107. package/src/examples/day6.ts +0 -44
  108. /package/lib/examples/{steppershownav.d.ts → categorization-stepper-nav-buttons.d.ts} +0 -0
  109. /package/lib/examples/{stepper.d.ts → categorization-stepper.d.ts} +0 -0
  110. /package/lib/examples/{multi-enum.d.ts → enum-multi.d.ts} +0 -0
@@ -1,62 +0,0 @@
1
- /*
2
- The MIT License
3
-
4
- Copyright (c) 2017-2019 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
- Level1: {
32
- type: 'array',
33
- items: {
34
- type: 'object',
35
- properties: {
36
- Level2: {
37
- type: 'object',
38
- properties: {
39
- Level3: {
40
- type: 'string'
41
- }
42
- }
43
- }
44
- }
45
- }
46
- }
47
- }
48
- };
49
-
50
- export const uischema: UISchemaElement = undefined;
51
-
52
- export const data = {};
53
-
54
- registerExamples([
55
- {
56
- name: '1169',
57
- label: 'Issue 1169',
58
- data,
59
- schema,
60
- uischema
61
- }
62
- ]);
@@ -1,146 +0,0 @@
1
- /*
2
- The MIT License
3
-
4
- Copyright (c) 2017-2019 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 { JsonFormsUISchemaRegistryEntry, JsonSchema, NOT_APPLICABLE } from '@jsonforms/core';
27
- import { StateProps } from '../example';
28
-
29
- const data = {
30
- orders: [
31
- {
32
- title: '42 killer robots',
33
- ordered: true,
34
- assignee: 'Philip J. Fry'
35
- }
36
- ]
37
- };
38
-
39
- const schema = {
40
- definitions: {
41
- order: {
42
- type: 'object',
43
- properties: {
44
- title: {
45
- type: 'string',
46
- minLength: 5
47
- },
48
- ordered: { type: 'boolean' },
49
- assignee: { type: 'string' },
50
- // needed to enforce nested layout instead of table
51
- choices: {
52
- type: 'array',
53
- items: {
54
- type: 'string'
55
- }
56
- }
57
- },
58
- required: ['title']
59
- }
60
- },
61
- type: 'object',
62
- properties: {
63
- orders: {
64
- type: 'array',
65
- items: {
66
- $ref: '#/definitions/order'
67
- }
68
- }
69
- }
70
- };
71
-
72
- export const uischema = {
73
- type: 'Control',
74
- scope: '#/properties/orders'
75
- };
76
-
77
- const uischemas = [
78
- {
79
- tester: (_jsonSchema: JsonSchema, schemaPath: string) => {
80
- return schemaPath === '#/properties/orders' ? 2 : NOT_APPLICABLE;
81
- },
82
- uischema: {
83
- type: 'VerticalLayout',
84
- elements: [
85
- {
86
- type: 'Control',
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
- }
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
122
- }
123
- }
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
- ];
136
-
137
- registerExamples([
138
- {
139
- name: '1220',
140
- label: 'Issue 1220',
141
- data,
142
- schema,
143
- uischema,
144
- actions
145
- }
146
- ]);
@@ -1,212 +0,0 @@
1
- /*
2
- The MIT License
3
-
4
- Copyright (c) 2017-2019 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
-
27
- export const schema = {
28
- type: 'object',
29
- properties: {
30
- value: {
31
- oneOf: [
32
- {
33
- title: 'String',
34
- type: 'string'
35
- },
36
- {
37
- title: 'Number',
38
- type: 'number'
39
- }
40
- ]
41
- }
42
- }
43
- };
44
-
45
- export const uischema = {
46
- type: 'Control',
47
- label: 'Value',
48
- scope: '#/properties/value'
49
- };
50
-
51
- const data = {};
52
-
53
- const schema2 = {
54
- type: 'object',
55
- properties: {
56
- oneOrMoreThings: {
57
- oneOf: [
58
- {
59
- $ref: '#/definitions/thing'
60
- },
61
- {
62
- $ref: '#/definitions/thingArray'
63
- }
64
- ]
65
- }
66
- },
67
- definitions: {
68
- thing: {
69
- title: 'Thing',
70
- type: 'string'
71
- },
72
- thingArray: {
73
- title: 'Things',
74
- type: 'array',
75
- items: {
76
- $ref: '#/definitions/thing'
77
- }
78
- }
79
- }
80
- };
81
-
82
- const schema3 = {
83
- type: 'object',
84
- properties: {
85
- thingOrThings: {
86
- oneOf: [
87
- {
88
- title: 'Thing',
89
- type: 'object',
90
- properties: {
91
- thing: {
92
- $ref: '#/definitions/thing'
93
- }
94
- }
95
- },
96
- {
97
- $ref: '#/definitions/thingArray'
98
- }
99
- ]
100
- }
101
- },
102
- definitions: {
103
- thing: {
104
- title: 'Thing',
105
- type: 'string'
106
- },
107
- thingArray: {
108
- title: 'Things',
109
- type: 'array',
110
- items: {
111
- $ref: '#/definitions/thing'
112
- }
113
- }
114
- }
115
- };
116
-
117
- const uischema2 = {
118
- type: 'Control',
119
- label: 'Value',
120
- scope: '#/properties/oneOrMoreThings'
121
- };
122
-
123
- const uischema3 = {
124
- type: 'Control',
125
- label: 'Value',
126
- scope: '#/properties/thingOrThings'
127
- };
128
-
129
- const schema4 = {
130
- definitions: {
131
- color: {
132
- type: 'string',
133
- enum: ['red', 'green', 'blue']
134
- }
135
- },
136
- type: 'object',
137
- properties: {
138
- things: {
139
- type: 'array',
140
- items: {
141
- type: 'object',
142
- properties: {
143
- somethingElse: {
144
- type: 'string'
145
- },
146
- thing: {
147
- type: 'string',
148
- enum: ['thing']
149
- },
150
- anotherThing: {
151
- $ref: '#/definitions/color'
152
- }
153
- }
154
- }
155
- }
156
- }
157
- };
158
-
159
- const uischema4 = {
160
- type: 'Control',
161
- scope: '#/properties/things'
162
- };
163
-
164
- registerExamples([
165
- {
166
- name: 'issue-1253',
167
- label: 'issue 1253 (oneOf)',
168
- data,
169
- schema,
170
- uischema
171
- }
172
- ]);
173
-
174
- registerExamples([
175
- {
176
- name: 'issue-1253-wrong-path-binding',
177
- label: 'issue 1253 (oneOf) - wrong path binding',
178
- data,
179
- schema: schema,
180
- uischema: uischema
181
- }
182
- ]);
183
-
184
- registerExamples([
185
- {
186
- name: 'issue-1253-cell-missing-cell',
187
- label: 'issue 1253 (oneOf) - missing cell renderer',
188
- data,
189
- schema: schema2,
190
- uischema: uischema2
191
- }
192
- ]);
193
-
194
- registerExamples([
195
- {
196
- name: 'issue-1253-add-button-empty-row',
197
- label: 'issue 1253 (oneOf) - add button does nothing',
198
- data,
199
- schema: schema3,
200
- uischema: uischema3
201
- }
202
- ]);
203
-
204
- registerExamples([
205
- {
206
- name: 'issue-1253-enum-error',
207
- label: 'issue 1253 (enum)',
208
- data,
209
- schema: schema4,
210
- uischema: uischema4
211
- }
212
- ]);
@@ -1,67 +0,0 @@
1
- /*
2
- The MIT License
3
-
4
- Copyright (c) 2017-2019 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
-
27
- export const schema = {
28
- type: 'object',
29
- properties: {
30
- name: {
31
- type: 'string',
32
- minLength: 1
33
- },
34
- version: {
35
- const: '1.0'
36
- }
37
- },
38
- required: ['version']
39
- };
40
-
41
- export const uischema = {
42
- type: 'HorizontalLayout',
43
- elements: [
44
- {
45
- type: 'Control',
46
- label: 'Name',
47
- scope: '#/properties/name'
48
- },
49
- {
50
- type: 'Control',
51
- label: 'Version',
52
- scope: '#/properties/version'
53
- }
54
- ]
55
- };
56
-
57
- const data = {};
58
-
59
- registerExamples([
60
- {
61
- name: 'issue-1254',
62
- label: 'issue 1254 (JSONSchema constants)',
63
- data,
64
- schema,
65
- uischema
66
- }
67
- ]);
@@ -1,66 +0,0 @@
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,83 +0,0 @@
1
- /*
2
- The MIT License
3
-
4
- Copyright (c) 2017-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
-
27
- const data = {
28
- 'an-array-of-strings': ['foo', 'bar', 'foobar']
29
- };
30
- const schema = {
31
- type: 'object',
32
- properties: {
33
- 'an-array-of-strings': {
34
- type: 'array',
35
- items: {
36
- type: 'string'
37
- }
38
- }
39
- }
40
- };
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
- }
67
- }
68
- }
69
- };
70
- const uischema_number = {
71
- "type": "ListWithDetail",
72
- "scope": "#/properties/an-array-of-numbers"
73
- };
74
-
75
- registerExamples([
76
- {
77
- name: '1779-number',
78
- label: 'List With Detail primitive (number)',
79
- data: data_number,
80
- schema: schema_number,
81
- uischema: uischema_number
82
- }
83
- ]);