@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
@@ -33,41 +33,53 @@ export const schema = {
33
33
  properties: {
34
34
  street_address: { type: 'string' },
35
35
  city: { type: 'string' },
36
- state: { type: 'string' }
36
+ state: { type: 'string' },
37
37
  },
38
- required: ['street_address', 'city', 'state']
38
+ required: ['street_address', 'city', 'state'],
39
39
  },
40
40
  user: {
41
41
  type: 'object',
42
42
  properties: {
43
43
  name: { type: 'string' },
44
- mail: { type: 'string' }
44
+ mail: { type: 'string' },
45
45
  },
46
- required: ['name', 'mail']
46
+ required: ['name', 'mail'],
47
47
  },
48
48
  users: {
49
49
  type: 'array',
50
- items: { $ref: '#/definitions/user' }
50
+ items: { $ref: '#/definitions/user' },
51
51
  },
52
52
  addresses: {
53
53
  type: 'array',
54
- items: { $ref: '#/definitions/address' }
55
- }
54
+ items: { $ref: '#/definitions/address' },
55
+ },
56
56
  },
57
57
 
58
58
  type: 'object',
59
59
 
60
60
  properties: {
61
61
  addressOrUser: {
62
- anyOf: [{ $ref: '#/definitions/address' }, { $ref: '#/definitions/user' }]
62
+ anyOf: [
63
+ { $ref: '#/definitions/address' },
64
+ { $ref: '#/definitions/user' },
65
+ ],
63
66
  },
64
67
  addressesOrUsers: {
65
68
  anyOf: [
66
69
  { $ref: '#/definitions/addresses' },
67
- { $ref: '#/definitions/users' }
68
- ]
69
- }
70
- }
70
+ { $ref: '#/definitions/users' },
71
+ ],
72
+ },
73
+ addressesOrUsersAnyOfItems: {
74
+ type: 'array',
75
+ items: {
76
+ anyOf: [
77
+ { $ref: '#/definitions/addresses' },
78
+ { $ref: '#/definitions/users' },
79
+ ],
80
+ },
81
+ },
82
+ },
71
83
  };
72
84
 
73
85
  export const uischema = {
@@ -75,30 +87,36 @@ export const uischema = {
75
87
  elements: [
76
88
  {
77
89
  type: 'Control',
78
- scope: '#/properties/addressOrUser'
90
+ scope: '#/properties/addressOrUser',
79
91
  },
80
92
  {
81
93
  type: 'Control',
82
- scope: '#/properties/addressesOrUsers'
83
- }
84
- ]
94
+ scope: '#/properties/addressesOrUsers',
95
+ label: 'Addresses or Users (AnyOf Schema)',
96
+ },
97
+ {
98
+ type: 'Control',
99
+ scope: '#/properties/addressesOrUsersAnyOfItems',
100
+ label: 'Addresses or Users (AnyOf Array Items)',
101
+ },
102
+ ],
85
103
  };
86
104
 
87
105
  const data = {
88
106
  addressOrUser: {
89
107
  street_address: '1600 Pennsylvania Avenue NW',
90
108
  city: 'Washington',
91
- state: 'DC'
92
- }
109
+ state: 'DC',
110
+ },
93
111
  };
94
112
 
95
113
  const schema_simple = {
96
114
  type: 'object',
97
115
  properties: {
98
116
  foo: {
99
- anyOf: [{ type: 'string' }, { enum: ['foo', 'bar'] }]
100
- }
101
- }
117
+ anyOf: [{ type: 'string' }, { enum: ['foo', 'bar'] }],
118
+ },
119
+ },
102
120
  };
103
121
 
104
122
  registerExamples([
@@ -107,13 +125,13 @@ registerExamples([
107
125
  label: 'anyOf',
108
126
  data,
109
127
  schema,
110
- uischema
128
+ uischema,
111
129
  },
112
130
  {
113
131
  name: 'anyOf_simple',
114
132
  label: 'AnyOf Simple',
115
133
  data: { foo: 'foo' },
116
134
  schema: schema_simple,
117
- uischema: undefined
118
- }
135
+ uischema: undefined,
136
+ },
119
137
  ]);
@@ -34,15 +34,15 @@ export const schema = {
34
34
  type: 'object',
35
35
  properties: {
36
36
  message1: {
37
- type: 'string'
37
+ type: 'string',
38
38
  },
39
39
  message2: {
40
- type: 'string'
41
- }
42
- }
43
- }
44
- }
45
- }
40
+ type: 'string',
41
+ },
42
+ },
43
+ },
44
+ },
45
+ },
46
46
  };
47
47
 
48
48
  export const uischema = {
@@ -58,30 +58,30 @@ export const uischema = {
58
58
  elements: [
59
59
  {
60
60
  type: 'Control',
61
- scope: '#/properties/message1'
61
+ scope: '#/properties/message1',
62
62
  },
63
63
  {
64
64
  type: 'Control',
65
- scope: '#/properties/message2'
66
- }
67
- ]
68
- }
69
- }
70
- }
71
- ]
65
+ scope: '#/properties/message2',
66
+ },
67
+ ],
68
+ },
69
+ },
70
+ },
71
+ ],
72
72
  };
73
73
 
74
74
  export const data = {
75
75
  comments: [
76
76
  {
77
77
  message1: 'This is an example message',
78
- message2: 'This is an example message 2'
78
+ message2: 'This is an example message 2',
79
79
  },
80
80
  {
81
81
  message1: 'Get ready for booohay 1',
82
- message2: 'Get ready for booohay 2'
83
- }
84
- ]
82
+ message2: 'Get ready for booohay 2',
83
+ },
84
+ ],
85
85
  };
86
86
 
87
87
  registerExamples([
@@ -90,6 +90,6 @@ registerExamples([
90
90
  label: 'Array with custom element label',
91
91
  data,
92
92
  schema,
93
- uischema
94
- }
93
+ uischema,
94
+ },
95
95
  ]);
@@ -39,17 +39,17 @@ export const schema = {
39
39
  properties: {
40
40
  date: {
41
41
  type: 'string',
42
- format: 'date'
42
+ format: 'date',
43
43
  },
44
44
  message: {
45
45
  type: 'string',
46
- maxLength: 5
47
- }
48
- }
49
- }
50
- }
46
+ maxLength: 5,
47
+ },
48
+ },
49
+ },
50
+ },
51
51
  },
52
- required: ['occupation', 'nationality']
52
+ required: ['occupation', 'nationality'],
53
53
  };
54
54
 
55
55
  export const uischema = {
@@ -57,11 +57,11 @@ export const uischema = {
57
57
  elements: [
58
58
  {
59
59
  type: 'Control',
60
- scope: '#/properties/occupation'
60
+ scope: '#/properties/occupation',
61
61
  },
62
62
  {
63
63
  type: 'Control',
64
- scope: '#/properties/enableArray'
64
+ scope: '#/properties/enableArray',
65
65
  },
66
66
  {
67
67
  type: 'Control',
@@ -73,14 +73,14 @@ export const uischema = {
73
73
  conditions: [
74
74
  {
75
75
  schema: { const: 'developer' },
76
- scope: '#/properties/occupation'
76
+ scope: '#/properties/occupation',
77
77
  },
78
78
  {
79
79
  schema: { const: true },
80
- scope: '/properties/enableArray'
81
- }
82
- ]
83
- }
80
+ scope: '/properties/enableArray',
81
+ },
82
+ ],
83
+ },
84
84
  },
85
85
  options: {
86
86
  detail: {
@@ -88,17 +88,17 @@ export const uischema = {
88
88
  elements: [
89
89
  {
90
90
  type: 'Control',
91
- scope: '#/properties/message'
91
+ scope: '#/properties/message',
92
92
  },
93
93
  {
94
94
  type: 'Control',
95
- scope: '#/properties/date'
96
- }
97
- ]
98
- }
99
- }
100
- }
101
- ]
95
+ scope: '#/properties/date',
96
+ },
97
+ ],
98
+ },
99
+ },
100
+ },
101
+ ],
102
102
  };
103
103
 
104
104
  export const data = {
@@ -106,13 +106,13 @@ export const data = {
106
106
  comments: [
107
107
  {
108
108
  date: new Date(2001, 8, 11).toISOString().substr(0, 10),
109
- message: 'This is an example message'
109
+ message: 'This is an example message',
110
110
  },
111
111
  {
112
112
  date: new Date().toISOString().substr(0, 10),
113
- message: 'Get ready for booohay'
114
- }
115
- ]
113
+ message: 'Get ready for booohay',
114
+ },
115
+ ],
116
116
  };
117
117
 
118
118
  registerExamples([
@@ -121,6 +121,6 @@ registerExamples([
121
121
  label: 'Array with detail and rule',
122
122
  data,
123
123
  schema,
124
- uischema
125
- }
124
+ uischema,
125
+ },
126
126
  ]);
@@ -37,17 +37,17 @@ export const schema = {
37
37
  properties: {
38
38
  date: {
39
39
  type: 'string',
40
- format: 'date'
40
+ format: 'date',
41
41
  },
42
42
  message: {
43
43
  type: 'string',
44
- maxLength: 5
45
- }
46
- }
47
- }
48
- }
44
+ maxLength: 5,
45
+ },
46
+ },
47
+ },
48
+ },
49
49
  },
50
- required: ['occupation', 'nationality']
50
+ required: ['occupation', 'nationality'],
51
51
  };
52
52
 
53
53
  export const uischema = {
@@ -63,30 +63,30 @@ export const uischema = {
63
63
  elements: [
64
64
  {
65
65
  type: 'Control',
66
- scope: '#/properties/message'
66
+ scope: '#/properties/message',
67
67
  },
68
68
  {
69
69
  type: 'Control',
70
- scope: '#/properties/date'
71
- }
72
- ]
73
- }
74
- }
75
- }
76
- ]
70
+ scope: '#/properties/date',
71
+ },
72
+ ],
73
+ },
74
+ },
75
+ },
76
+ ],
77
77
  };
78
78
 
79
79
  export const data = {
80
80
  comments: [
81
81
  {
82
82
  date: new Date(2001, 8, 11).toISOString().substr(0, 10),
83
- message: 'This is an example message'
83
+ message: 'This is an example message',
84
84
  },
85
85
  {
86
86
  date: new Date().toISOString().substr(0, 10),
87
- message: 'Get ready for booohay'
88
- }
89
- ]
87
+ message: 'Get ready for booohay',
88
+ },
89
+ ],
90
90
  };
91
91
 
92
92
  registerExamples([
@@ -95,6 +95,6 @@ registerExamples([
95
95
  label: 'Array with detail',
96
96
  data,
97
97
  schema,
98
- uischema
99
- }
98
+ uischema,
99
+ },
100
100
  ]);
@@ -35,21 +35,21 @@ export const schema = {
35
35
  properties: {
36
36
  date: {
37
37
  type: 'string',
38
- format: 'date'
38
+ format: 'date',
39
39
  },
40
40
  message: {
41
41
  type: 'string',
42
- maxLength: 5
42
+ maxLength: 5,
43
43
  },
44
44
  enum: {
45
45
  type: 'string',
46
- const: 'foo'
47
- }
48
- }
49
- }
46
+ const: 'foo',
47
+ },
48
+ },
49
+ },
50
50
  },
51
- foo:{type:'string'}
52
- }
51
+ foo: { type: 'string' },
52
+ },
53
53
  };
54
54
 
55
55
  export const uischema = {
@@ -57,16 +57,16 @@ export const uischema = {
57
57
  elements: [
58
58
  {
59
59
  type: 'Control',
60
- scope: '#/properties/foo'
60
+ scope: '#/properties/foo',
61
61
  },
62
62
  {
63
63
  type: 'Control',
64
64
  scope: '#/properties/comments',
65
65
  options: {
66
- showSortButtons: true
67
- }
68
- }
69
- ]
66
+ showSortButtons: true,
67
+ },
68
+ },
69
+ ],
70
70
  };
71
71
 
72
72
  export const uischemaWithSorting = {
@@ -74,49 +74,49 @@ export const uischemaWithSorting = {
74
74
  elements: [
75
75
  {
76
76
  type: 'Control',
77
- scope: '#/properties/foo'
77
+ scope: '#/properties/foo',
78
78
  },
79
79
  {
80
80
  type: 'Control',
81
81
  scope: '#/properties/comments',
82
82
  options: {
83
- showSortButtons: true
84
- }
85
- }
86
- ]
83
+ showSortButtons: true,
84
+ },
85
+ },
86
+ ],
87
87
  };
88
88
 
89
89
  export const data = {
90
90
  comments: [
91
91
  {
92
92
  date: new Date(2001, 8, 11).toISOString().substr(0, 10),
93
- message: 'This is an example message With sorting'
93
+ message: 'This is an example message With sorting',
94
94
  },
95
95
  {
96
96
  date: new Date().toISOString().substr(0, 10),
97
- message: 'Get ready for booohay'
98
- }
99
- ]
97
+ message: 'Get ready for booohay',
98
+ },
99
+ ],
100
100
  };
101
101
 
102
102
  const actions = [
103
103
  {
104
- 'label': 'Enable Sorting',
105
- 'apply': (props: StateProps) => {
104
+ label: 'Enable Sorting',
105
+ apply: (props: StateProps) => {
106
106
  return {
107
107
  ...props,
108
- uischema: uischemaWithSorting
109
- }
110
- }
108
+ uischema: uischemaWithSorting,
109
+ };
110
+ },
111
111
  },
112
112
  {
113
- 'label': 'Disable Sorting',
114
- 'apply': (props: StateProps) => {
113
+ label: 'Disable Sorting',
114
+ apply: (props: StateProps) => {
115
115
  return {
116
116
  ...props,
117
- uischema: uischema
118
- }
119
- }
117
+ uischema: uischema,
118
+ };
119
+ },
120
120
  },
121
121
  ];
122
122
 
@@ -128,8 +128,8 @@ registerExamples([
128
128
  schema,
129
129
  uischema,
130
130
  config: {
131
- withSort: uischemaWithSorting
131
+ withSort: uischemaWithSorting,
132
132
  },
133
- actions
134
- }
133
+ actions,
134
+ },
135
135
  ]);
@@ -35,21 +35,21 @@ export const schema = {
35
35
  properties: {
36
36
  date: {
37
37
  type: 'string',
38
- format: 'date'
38
+ format: 'date',
39
39
  },
40
40
  message: {
41
41
  type: 'string',
42
- maxLength: 5
42
+ maxLength: 5,
43
43
  },
44
44
  enum: {
45
45
  type: 'string',
46
- const: 'foo'
47
- }
48
- }
49
- }
46
+ const: 'foo',
47
+ },
48
+ },
49
+ },
50
50
  },
51
- foo:{type:'string'}
52
- }
51
+ foo: { type: 'string' },
52
+ },
53
53
  };
54
54
 
55
55
  export const uischema = {
@@ -57,16 +57,16 @@ export const uischema = {
57
57
  elements: [
58
58
  {
59
59
  type: 'Control',
60
- scope: '#/properties/foo'
60
+ scope: '#/properties/foo',
61
61
  },
62
62
  {
63
63
  type: 'Control',
64
64
  scope: '#/properties/comments',
65
65
  options: {
66
- showSortButtons: false
67
- }
68
- }
69
- ]
66
+ showSortButtons: false,
67
+ },
68
+ },
69
+ ],
70
70
  };
71
71
 
72
72
  export const uischemaWithSorting = {
@@ -74,49 +74,49 @@ export const uischemaWithSorting = {
74
74
  elements: [
75
75
  {
76
76
  type: 'Control',
77
- scope: '#/properties/foo'
77
+ scope: '#/properties/foo',
78
78
  },
79
79
  {
80
80
  type: 'Control',
81
81
  scope: '#/properties/comments',
82
82
  options: {
83
- showSortButtons: false
84
- }
85
- }
86
- ]
83
+ showSortButtons: false,
84
+ },
85
+ },
86
+ ],
87
87
  };
88
88
 
89
89
  export const data = {
90
90
  comments: [
91
91
  {
92
92
  date: new Date(2001, 8, 11).toISOString().substr(0, 10),
93
- message: 'This is an example message'
93
+ message: 'This is an example message',
94
94
  },
95
95
  {
96
96
  date: new Date().toISOString().substr(0, 10),
97
- message: 'Get ready for booohay'
98
- }
99
- ]
97
+ message: 'Get ready for booohay',
98
+ },
99
+ ],
100
100
  };
101
101
 
102
102
  const actions = [
103
103
  {
104
- 'label': 'Enable Sorting',
105
- 'apply': (props: StateProps) => {
104
+ label: 'Enable Sorting',
105
+ apply: (props: StateProps) => {
106
106
  return {
107
107
  ...props,
108
- uischema: uischemaWithSorting
109
- }
110
- }
108
+ uischema: uischemaWithSorting,
109
+ };
110
+ },
111
111
  },
112
112
  {
113
- 'label': 'Disable Sorting',
114
- 'apply': (props: StateProps) => {
113
+ label: 'Disable Sorting',
114
+ apply: (props: StateProps) => {
115
115
  return {
116
116
  ...props,
117
- uischema: uischema
118
- }
119
- }
117
+ uischema: uischema,
118
+ };
119
+ },
120
120
  },
121
121
  ];
122
122
 
@@ -128,8 +128,8 @@ registerExamples([
128
128
  schema,
129
129
  uischema,
130
130
  config: {
131
- withSort: uischemaWithSorting
131
+ withSort: uischemaWithSorting,
132
132
  },
133
- actions
134
- }
133
+ actions,
134
+ },
135
135
  ]);