@chobantonov/jsonforms-extended-spec 0.2.0 → 0.4.0
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/conformance/authoring.json +511 -0
- package/conformance/behavior.json +2373 -4
- package/conformance/config-consumption.json +13 -2
- package/docs/audit.md +17 -2
- package/docs/conditional-fields.md +133 -6
- package/docs/external-resources-proposal.md +8 -2
- package/docs/implementation-guide.md +129 -90
- package/docs/implementation-pitfalls.md +393 -1
- package/docs/implementation-web-typescript.md +2 -5
- package/docs/renderer-and-demo.md +47 -34
- package/docs/spec.md +235 -14
- package/docs/todo.md +72 -18
- package/examples/README.md +8 -2
- package/examples/additional-errors/README.md +7 -0
- package/examples/additional-properties/README.md +15 -0
- package/examples/catalog.json +16 -1
- package/examples/color-control/README.md +4 -1
- package/examples/conditional-fields/README.md +21 -3
- package/examples/conditional-fields/translations.json +4 -2
- package/examples/conditional-fields/uischema.json +67 -7
- package/examples/conditional-template-slots/README.md +14 -0
- package/examples/conditional-template-slots/config.json +7 -0
- package/examples/conditional-template-slots/data.json +5 -0
- package/examples/conditional-template-slots/schema.json +37 -0
- package/examples/conditional-template-slots/translations.json +16 -0
- package/examples/conditional-template-slots/uischema.json +22 -0
- package/examples/index.js +4 -3
- package/examples/kitchen-sink/README.md +93 -4
- package/examples/kitchen-sink/config.json +7 -0
- package/examples/kitchen-sink/data.json +14 -2
- package/examples/kitchen-sink/invalid-data.json +13 -1
- package/examples/kitchen-sink/schema.json +100 -1
- package/examples/kitchen-sink/translations.json +80 -2
- package/examples/kitchen-sink/uischema.json +239 -4
- package/examples/label-interpolation/README.md +58 -1
- package/examples/label-interpolation/config.json +8 -2
- package/examples/label-interpolation/translations.json +8 -4
- package/examples/label-interpolation/uischema.json +31 -8
- package/package.json +1 -1
- package/schemas/README.md +8 -3
- package/schemas/jsonforms-config.schema.json +1 -1
- package/schemas/jsonforms-extended-config.schema.json +5 -0
- package/schemas/jsonforms-extended-uischema.schema.json +11 -2
- package/schemas/jsonforms-uischema.schema.json +14 -1
- package/typescript/README.md +8 -2
- package/typescript/lib/authoring/forSchema.d.ts +10 -1
- package/typescript/src/authoring/forSchema.ts +10 -1
- package/typescript/test/schemaContract.test.ts +12 -0
- package/typescript/test/typedAuthoring.test.ts +12 -1
- package/typescript/test/typedAuthoringCoverage.test.ts +33 -0
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"Generated fields.label": "Generated fields",
|
|
12
12
|
"Authored placement.label": "Authored placement",
|
|
13
13
|
"Identity.label": "Identity",
|
|
14
|
-
"Billing.label": "Billing"
|
|
14
|
+
"Billing.label": "Billing",
|
|
15
|
+
"Direct layout.label": "Direct layout"
|
|
15
16
|
},
|
|
16
17
|
"bg": {
|
|
17
18
|
"customerType.label": "Вид клиент",
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
"Generated fields.label": "Генерирани полета",
|
|
26
27
|
"Authored placement.label": "Зададено разположение",
|
|
27
28
|
"Identity.label": "Самоличност",
|
|
28
|
-
"Billing.label": "Фактуриране"
|
|
29
|
+
"Billing.label": "Фактуриране",
|
|
30
|
+
"Direct layout.label": "Директно оформление"
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -34,12 +34,17 @@
|
|
|
34
34
|
"label": "Identity",
|
|
35
35
|
"elements": [
|
|
36
36
|
{
|
|
37
|
-
"type": "
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
"type": "HorizontalLayout",
|
|
38
|
+
"elements": [
|
|
39
|
+
{
|
|
40
|
+
"type": "Control",
|
|
41
|
+
"scope": "#/properties/name"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"type": "Control",
|
|
45
|
+
"scope": "#/properties/nickname"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
43
48
|
}
|
|
44
49
|
]
|
|
45
50
|
},
|
|
@@ -66,6 +71,61 @@
|
|
|
66
71
|
}
|
|
67
72
|
}
|
|
68
73
|
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"type": "Category",
|
|
77
|
+
"label": "Direct layout",
|
|
78
|
+
"elements": [
|
|
79
|
+
{
|
|
80
|
+
"type": "VerticalLayout",
|
|
81
|
+
"elements": [
|
|
82
|
+
{
|
|
83
|
+
"type": "Control",
|
|
84
|
+
"scope": "#/properties/customerType"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"type": "Group",
|
|
88
|
+
"label": "Identity",
|
|
89
|
+
"elements": [
|
|
90
|
+
{
|
|
91
|
+
"type": "HorizontalLayout",
|
|
92
|
+
"elements": [
|
|
93
|
+
{
|
|
94
|
+
"type": "Control",
|
|
95
|
+
"scope": "#/properties/name"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"type": "Control",
|
|
99
|
+
"scope": "#/properties/nickname"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "Group",
|
|
107
|
+
"label": "Billing",
|
|
108
|
+
"elements": [
|
|
109
|
+
{
|
|
110
|
+
"type": "Control",
|
|
111
|
+
"scope": "#/properties/vatNumber"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"type": "Control",
|
|
115
|
+
"scope": "#/properties/purchaseOrder"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"type": "Control",
|
|
119
|
+
"scope": "#/properties/billingAddress"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
]
|
|
69
126
|
}
|
|
70
|
-
]
|
|
127
|
+
],
|
|
128
|
+
"options": {
|
|
129
|
+
"conditionalFields": true
|
|
130
|
+
}
|
|
71
131
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Conditional template slots
|
|
2
|
+
|
|
3
|
+
This root TemplateLayout owns the object projection. The three authored decimal
|
|
4
|
+
slots are customer type (0), VAT (1), and notes (2). With personal data, slot 1 is
|
|
5
|
+
known but empty; notes stays in slot 2. Business data restores VAT and requires
|
|
6
|
+
both VAT and notes. Switching back retains VAT in data and removes the two
|
|
7
|
+
conditional required indicators. No unknown-slot warning or fallback is expected.
|
|
8
|
+
|
|
9
|
+
The Ractive profile requires the host's explicit script-evaluation permission.
|
|
10
|
+
Use it only for trusted templates. Equivalent acceptance vectors cover named and
|
|
11
|
+
explicit numeric addresses, supported JSX references, compiled native slots,
|
|
12
|
+
registered Template/Slot composition, unknown names and retained editor focus.
|
|
13
|
+
Profile support must be verified in an adapter; these fixtures alone do not
|
|
14
|
+
certify any renderer. The original schema remains the document validator.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"kind": {
|
|
5
|
+
"type": "string",
|
|
6
|
+
"enum": [
|
|
7
|
+
"personal",
|
|
8
|
+
"business"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"notes": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"if": {
|
|
16
|
+
"properties": {
|
|
17
|
+
"kind": {
|
|
18
|
+
"const": "business"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": [
|
|
22
|
+
"kind"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"then": {
|
|
26
|
+
"properties": {
|
|
27
|
+
"vatNumber": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"minLength": 3
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"required": [
|
|
33
|
+
"vatNumber",
|
|
34
|
+
"notes"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"kind.label": "Customer type",
|
|
4
|
+
"kind.personal": "Personal",
|
|
5
|
+
"kind.business": "Business",
|
|
6
|
+
"vatNumber.label": "VAT number",
|
|
7
|
+
"notes.label": "Notes"
|
|
8
|
+
},
|
|
9
|
+
"bg": {
|
|
10
|
+
"kind.label": "Вид клиент",
|
|
11
|
+
"kind.personal": "Физическо лице",
|
|
12
|
+
"kind.business": "Фирма",
|
|
13
|
+
"vatNumber.label": "ДДС номер",
|
|
14
|
+
"notes.label": "Бележки"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "TemplateLayout",
|
|
3
|
+
"lang": "ractive",
|
|
4
|
+
"options": {
|
|
5
|
+
"conditionalFields": true
|
|
6
|
+
},
|
|
7
|
+
"template": "<section><div data-kind>{{>0}}</div><div data-vat>{{>1}}</div><div data-notes>{{>2}}</div></section>",
|
|
8
|
+
"elements": [
|
|
9
|
+
{
|
|
10
|
+
"type": "Control",
|
|
11
|
+
"scope": "#/properties/kind"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "Control",
|
|
15
|
+
"scope": "#/properties/vatNumber"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "Control",
|
|
19
|
+
"scope": "#/properties/notes"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|