@chobantonov/jsonforms-extended-spec 0.2.0 → 0.3.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.
Files changed (31) hide show
  1. package/conformance/authoring.json +511 -0
  2. package/conformance/behavior.json +875 -4
  3. package/conformance/config-consumption.json +13 -2
  4. package/docs/conditional-fields.md +44 -2
  5. package/docs/implementation-guide.md +56 -3
  6. package/docs/implementation-pitfalls.md +167 -1
  7. package/docs/spec.md +156 -7
  8. package/docs/todo.md +17 -0
  9. package/examples/README.md +8 -2
  10. package/examples/additional-errors/README.md +7 -0
  11. package/examples/additional-properties/README.md +15 -0
  12. package/examples/color-control/README.md +4 -1
  13. package/examples/conditional-fields/README.md +11 -3
  14. package/examples/conditional-fields/translations.json +4 -2
  15. package/examples/conditional-fields/uischema.json +67 -7
  16. package/examples/index.js +2 -2
  17. package/examples/label-interpolation/README.md +41 -0
  18. package/examples/label-interpolation/config.json +8 -2
  19. package/examples/label-interpolation/uischema.json +6 -2
  20. package/package.json +1 -1
  21. package/schemas/README.md +8 -3
  22. package/schemas/jsonforms-config.schema.json +1 -1
  23. package/schemas/jsonforms-extended-config.schema.json +5 -0
  24. package/schemas/jsonforms-extended-uischema.schema.json +10 -1
  25. package/schemas/jsonforms-uischema.schema.json +14 -1
  26. package/typescript/README.md +8 -2
  27. package/typescript/lib/authoring/forSchema.d.ts +10 -1
  28. package/typescript/src/authoring/forSchema.ts +10 -1
  29. package/typescript/test/schemaContract.test.ts +12 -0
  30. package/typescript/test/typedAuthoring.test.ts +12 -1
  31. package/typescript/test/typedAuthoringCoverage.test.ts +33 -0
@@ -186,3 +186,18 @@ The **Static and dynamic properties** tab shows **Inventory details** with schem
186
186
  Reference and Quantity fields, followed by editable Warehouse and Handling keys
187
187
  in Additional Properties. Both sections belong inside the same object boundary.
188
188
  Static fields must not appear again in the dynamic list.
189
+
190
+
191
+ ## Proposed acceptance cases for clearing values
192
+
193
+ In a host using the real renderer registry, load an object with an additional
194
+ string property whose schema defines a nonempty default. Activate the field
195
+ clear button, then repeat by deleting all text. Verify that the exact key has
196
+ the empty string value, its editor stays mounted, and the user can enter a new
197
+ value. Verify that explicit Delete removes the key and row. Repeat with an empty
198
+ key and a dotted key through the host's literal-key editor.
199
+
200
+ For an additional property containing an object with a declared string field,
201
+ clear that nested field and verify its normal absence semantics while its
202
+ additional-property parent and row remain present. These are proposed host
203
+ acceptance cases, not executable tests in this specification package.
@@ -116,7 +116,10 @@ the stored text is shown beside the swatch exactly as stored.
116
116
 
117
117
  **Clearing works from inside the picker.** Open any field's picker and use the
118
118
  clear affordance in the panel. For Print spot color it is the only one there
119
- is, which is why it is not optional.
119
+ is, which is why it is not optional. As a proposed acceptance case, clear a
120
+ populated picker while its panel remains open: the stored value and the panel's
121
+ channel and alpha text should become empty. Switching HEX/RGB/HSB views should
122
+ leave the value empty; selecting a new color should populate it again.
120
123
 
121
124
  **Switch the demo to Bulgarian.** The entry hints, the clear-value tooltip, the
122
125
  picker's accessible name and the hex3 guidance all translate. The stored colors
@@ -1,14 +1,22 @@
1
1
  # Conditional object fields
2
2
 
3
- Config opts in; local options.conditionalFields:false overrides it. Both tabs
3
+ Config opts in; local options.conditionalFields:false overrides it. All tabs
4
4
  edit the same data. Switch customerType to personal: nickname replaces VAT, and
5
5
  Name remains visible but is no longer required. Switch back: VAT is preserved.
6
6
  Remove purchaseOrder in the Data editor to deactivate its schema dependency;
7
7
  an empty string still counts as present. Billing address is retained in data.
8
8
  The second tab demonstrates freely placed branch-only fields in ordinary groups.
9
9
 
10
- Use an object Control (scope # at the document root) to resolve the active fields.
11
- A manually authored root layout by itself does not install the object projection.
10
+ The third tab uses ordinary VerticalLayout, HorizontalLayout and Group elements
11
+ without an object Control. The root Categorization enables conditional projection
12
+ for its layout subtree. Name stays visible and its required star follows the
13
+ business condition, while inactive branch-only controls disappear. All tabs edit
14
+ the same data. Object Controls remain available for generated/registered details.
15
+
16
+ Enable options.conditionalFields on the first layout at the current object
17
+ boundary, or use the global config default. Descendant layout settings do not
18
+ reverse that owner's projection. A local false on the entry overrides global true.
19
+ Nested objects and array items use their own schema/data context.
12
20
  Validation always uses the original schema. Hiding a field does not erase it or
13
21
  relax additionalProperties. In Draft-07, additionalProperties:false in the base
14
22
  schema does not recognize properties declared only in then/else: declare allowed
@@ -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": "Control",
38
- "scope": "#/properties/name"
39
- },
40
- {
41
- "type": "Control",
42
- "scope": "#/properties/nickname"
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
  }