@jsonforms/examples 3.1.0-alpha.1 → 3.1.0-alpha.3

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 (111) 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 +2074 -3228
  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/arrays.d.ts +13 -2
  11. package/lib/examples/arraysI18n.d.ts +52 -0
  12. package/lib/examples/dates.d.ts +115 -1
  13. package/lib/examples/enum.d.ts +16 -0
  14. package/lib/examples/generate-dynamic.d.ts +15 -0
  15. package/lib/examples/list-with-detail-primitives.d.ts +36 -0
  16. package/lib/examples/list-with-detail-registered.d.ts +55 -1
  17. package/lib/examples/list-with-detail.d.ts +191 -1
  18. package/lib/examples/nestedCategorization.d.ts +57 -0
  19. package/lib/examples/radioGroup.d.ts +42 -1
  20. package/lib/index.d.ts +8 -19
  21. package/lib/jsonforms-examples.cjs.js +2299 -2863
  22. package/lib/jsonforms-examples.cjs.js.map +1 -1
  23. package/lib/jsonforms-examples.esm.js +2288 -2869
  24. package/lib/jsonforms-examples.esm.js.map +1 -1
  25. package/package.json +13 -6
  26. package/rollup.config.js +12 -12
  27. package/src/example.ts +3 -3
  28. package/src/examples/1884.ts +52 -48
  29. package/src/examples/1948.ts +19 -19
  30. package/src/examples/additional-errors.ts +28 -25
  31. package/src/examples/allOf.ts +18 -18
  32. package/src/examples/anyOf-oneOf-allOf-resolve.ts +21 -21
  33. package/src/examples/anyOf.ts +42 -24
  34. package/src/examples/arrays-with-custom-element-label.ts +21 -21
  35. package/src/examples/arrays-with-detail-and-rule.ts +28 -28
  36. package/src/examples/arrays-with-detail.ts +21 -21
  37. package/src/examples/arrays-with-sorting.ts +35 -35
  38. package/src/examples/arrays.ts +40 -35
  39. package/src/examples/arraysI18n.ts +107 -0
  40. package/src/examples/{steppershownav.ts → categorization-stepper-nav-buttons.ts} +6 -6
  41. package/src/examples/{stepper.ts → categorization-stepper.ts} +5 -5
  42. package/src/examples/categorization.ts +119 -119
  43. package/src/examples/conditional-schema-compositions.ts +20 -20
  44. package/src/examples/config.ts +15 -15
  45. package/src/examples/control-options.ts +81 -82
  46. package/src/examples/dates.ts +34 -34
  47. package/src/examples/default.ts +22 -22
  48. package/src/examples/{multi-enum.ts → enum-multi.ts} +14 -14
  49. package/src/examples/enum.ts +65 -33
  50. package/src/examples/enumInArray.ts +10 -10
  51. package/src/examples/{dynamic.ts → generate-dynamic.ts} +10 -10
  52. package/src/examples/generate.ts +2 -2
  53. package/src/examples/generateUI.ts +2 -2
  54. package/src/examples/huge.ts +381 -377
  55. package/src/examples/i18n.ts +37 -28
  56. package/src/examples/if_then_else.ts +4 -4
  57. package/src/examples/layout.ts +29 -29
  58. package/src/examples/{booleanToggle.ts → list-with-detail-primitives.ts} +46 -33
  59. package/src/examples/list-with-detail-registered.ts +26 -26
  60. package/src/examples/list-with-detail.ts +82 -82
  61. package/src/examples/nestedArrays.ts +40 -35
  62. package/src/examples/nestedCategorization.ts +175 -0
  63. package/src/examples/numbers.ts +17 -17
  64. package/src/examples/object.ts +24 -24
  65. package/src/examples/onChange.ts +28 -22
  66. package/src/examples/oneOf-recursive.ts +15 -15
  67. package/src/examples/oneOf.ts +99 -96
  68. package/src/examples/oneOfArray.ts +20 -20
  69. package/src/examples/person.ts +35 -35
  70. package/src/examples/radioGroup.ts +52 -53
  71. package/src/examples/readonly.ts +14 -14
  72. package/src/examples/rule.ts +26 -26
  73. package/src/examples/ruleInheritance.ts +37 -34
  74. package/src/examples/scope.ts +26 -26
  75. package/src/examples/stringArray.ts +10 -10
  76. package/src/examples/text.ts +19 -19
  77. package/src/index.ts +11 -33
  78. package/src/register.ts +6 -3
  79. package/stats.html +2462 -329
  80. package/tsconfig.json +2 -6
  81. package/lib/examples/1169.d.ts +0 -24
  82. package/lib/examples/1220.d.ts +0 -4
  83. package/lib/examples/1253.d.ts +0 -16
  84. package/lib/examples/1254.d.ts +0 -21
  85. package/lib/examples/1645.d.ts +0 -68
  86. package/lib/examples/1779.d.ts +0 -1
  87. package/lib/examples/1996.d.ts +0 -31
  88. package/lib/examples/booleanToggle.d.ts +0 -62
  89. package/lib/examples/day1.d.ts +0 -23
  90. package/lib/examples/day2.d.ts +0 -42
  91. package/lib/examples/day3.d.ts +0 -51
  92. package/lib/examples/day4.d.ts +0 -72
  93. package/lib/examples/day5.d.ts +0 -133
  94. package/lib/examples/day6.d.ts +0 -85
  95. package/lib/examples/dynamic.d.ts +0 -1
  96. package/src/examples/1169.ts +0 -62
  97. package/src/examples/1220.ts +0 -146
  98. package/src/examples/1253.ts +0 -212
  99. package/src/examples/1254.ts +0 -67
  100. package/src/examples/1645.ts +0 -66
  101. package/src/examples/1779.ts +0 -83
  102. package/src/examples/1996.ts +0 -102
  103. package/src/examples/day1.ts +0 -61
  104. package/src/examples/day2.ts +0 -62
  105. package/src/examples/day3.ts +0 -76
  106. package/src/examples/day4.ts +0 -83
  107. package/src/examples/day5.ts +0 -169
  108. package/src/examples/day6.ts +0 -44
  109. /package/lib/examples/{steppershownav.d.ts → categorization-stepper-nav-buttons.d.ts} +0 -0
  110. /package/lib/examples/{stepper.d.ts → categorization-stepper.d.ts} +0 -0
  111. /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,25 @@ 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
+ oneOfEnum: {
49
+ type: 'string',
50
+ oneOf: [{ const: 'foo' }, { const: 'bar' }],
51
+ },
52
+ },
53
+ },
50
54
  },
51
- foo:{type:'string'}
52
- }
55
+ foo: { type: 'string' },
56
+ },
53
57
  };
54
58
 
55
59
  export const uischema = {
@@ -57,16 +61,16 @@ export const uischema = {
57
61
  elements: [
58
62
  {
59
63
  type: 'Control',
60
- scope: '#/properties/foo'
64
+ scope: '#/properties/foo',
61
65
  },
62
66
  {
63
67
  type: 'Control',
64
68
  scope: '#/properties/comments',
65
69
  options: {
66
- showSortButtons: false
67
- }
68
- }
69
- ]
70
+ showSortButtons: false,
71
+ },
72
+ },
73
+ ],
70
74
  };
71
75
 
72
76
  export const uischemaWithSorting = {
@@ -74,49 +78,50 @@ export const uischemaWithSorting = {
74
78
  elements: [
75
79
  {
76
80
  type: 'Control',
77
- scope: '#/properties/foo'
81
+ scope: '#/properties/foo',
78
82
  },
79
83
  {
80
84
  type: 'Control',
81
85
  scope: '#/properties/comments',
82
86
  options: {
83
- showSortButtons: false
84
- }
85
- }
86
- ]
87
+ showSortButtons: false,
88
+ },
89
+ },
90
+ ],
87
91
  };
88
92
 
89
93
  export const data = {
90
94
  comments: [
91
95
  {
92
96
  date: new Date(2001, 8, 11).toISOString().substr(0, 10),
93
- message: 'This is an example message'
97
+ message: 'This is an example message',
94
98
  },
95
99
  {
96
100
  date: new Date().toISOString().substr(0, 10),
97
- message: 'Get ready for booohay'
98
- }
99
- ]
101
+ message: 'Get ready for booohay',
102
+ oneOfEnum: 'test',
103
+ },
104
+ ],
100
105
  };
101
106
 
102
107
  const actions = [
103
108
  {
104
- 'label': 'Enable Sorting',
105
- 'apply': (props: StateProps) => {
109
+ label: 'Enable Sorting',
110
+ apply: (props: StateProps) => {
106
111
  return {
107
112
  ...props,
108
- uischema: uischemaWithSorting
109
- }
110
- }
113
+ uischema: uischemaWithSorting,
114
+ };
115
+ },
111
116
  },
112
117
  {
113
- 'label': 'Disable Sorting',
114
- 'apply': (props: StateProps) => {
118
+ label: 'Disable Sorting',
119
+ apply: (props: StateProps) => {
115
120
  return {
116
121
  ...props,
117
- uischema: uischema
118
- }
119
- }
122
+ uischema: uischema,
123
+ };
124
+ },
120
125
  },
121
126
  ];
122
127
 
@@ -128,8 +133,8 @@ registerExamples([
128
133
  schema,
129
134
  uischema,
130
135
  config: {
131
- withSort: uischemaWithSorting
136
+ withSort: uischemaWithSorting,
132
137
  },
133
- actions
134
- }
138
+ actions,
139
+ },
135
140
  ]);