@chobantonov/jsonforms-extended-spec 0.4.0 → 1.0.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.
@@ -2676,5 +2676,248 @@
2676
2676
  },
2677
2677
  "valid": false,
2678
2678
  "section": "9.4a"
2679
+ },
2680
+ {
2681
+ "id": "group-slotted-layout-common",
2682
+ "schema": "jsonforms-uischema.schema.json",
2683
+ "value": {
2684
+ "type": "Group",
2685
+ "elements": [
2686
+ {
2687
+ "type": "VerticalLayout",
2688
+ "slot": "header",
2689
+ "elements": [
2690
+ {
2691
+ "type": "Label",
2692
+ "text": "Heading"
2693
+ }
2694
+ ]
2695
+ },
2696
+ {
2697
+ "type": "Control",
2698
+ "scope": "#/properties/name"
2699
+ },
2700
+ {
2701
+ "type": "Label",
2702
+ "slot": "footer",
2703
+ "text": "Summary"
2704
+ }
2705
+ ]
2706
+ },
2707
+ "valid": true,
2708
+ "section": "8.1"
2709
+ },
2710
+ {
2711
+ "id": "group-unknown-slot-common",
2712
+ "schema": "jsonforms-uischema.schema.json",
2713
+ "value": {
2714
+ "type": "Group",
2715
+ "elements": [
2716
+ {
2717
+ "type": "Label",
2718
+ "slot": "bottom",
2719
+ "text": "Unknown"
2720
+ }
2721
+ ]
2722
+ },
2723
+ "valid": true,
2724
+ "section": "8.1"
2725
+ },
2726
+ {
2727
+ "id": "group-nonstring-slot-common",
2728
+ "schema": "jsonforms-uischema.schema.json",
2729
+ "value": {
2730
+ "type": "Group",
2731
+ "elements": [
2732
+ {
2733
+ "type": "Label",
2734
+ "slot": false
2735
+ }
2736
+ ]
2737
+ },
2738
+ "valid": false,
2739
+ "section": "8.1"
2740
+ },
2741
+ {
2742
+ "id": "group-invalid-slot-content-common",
2743
+ "schema": "jsonforms-uischema.schema.json",
2744
+ "value": {
2745
+ "type": "Group",
2746
+ "elements": [
2747
+ {
2748
+ "type": "VerticalLayout",
2749
+ "slot": "header",
2750
+ "elements": [
2751
+ {
2752
+ "type": "Control",
2753
+ "scope": 42
2754
+ }
2755
+ ]
2756
+ }
2757
+ ]
2758
+ },
2759
+ "valid": false,
2760
+ "section": "8.1"
2761
+ },
2762
+ {
2763
+ "id": "slot-empty-common",
2764
+ "schema": "jsonforms-uischema.schema.json",
2765
+ "value": {
2766
+ "type": "Label",
2767
+ "slot": ""
2768
+ },
2769
+ "valid": false,
2770
+ "section": "8.1"
2771
+ },
2772
+ {
2773
+ "id": "group-slotted-layout-extended",
2774
+ "schema": "jsonforms-extended-uischema.schema.json",
2775
+ "value": {
2776
+ "type": "Group",
2777
+ "elements": [
2778
+ {
2779
+ "type": "VerticalLayout",
2780
+ "slot": "header",
2781
+ "elements": [
2782
+ {
2783
+ "type": "Label",
2784
+ "text": "Heading"
2785
+ }
2786
+ ]
2787
+ },
2788
+ {
2789
+ "type": "Control",
2790
+ "scope": "#/properties/name"
2791
+ },
2792
+ {
2793
+ "type": "Label",
2794
+ "slot": "footer",
2795
+ "text": "Summary"
2796
+ }
2797
+ ]
2798
+ },
2799
+ "valid": true,
2800
+ "section": "8.1"
2801
+ },
2802
+ {
2803
+ "id": "group-unknown-slot-extended",
2804
+ "schema": "jsonforms-extended-uischema.schema.json",
2805
+ "value": {
2806
+ "type": "Group",
2807
+ "elements": [
2808
+ {
2809
+ "type": "Label",
2810
+ "slot": "bottom",
2811
+ "text": "Unknown"
2812
+ }
2813
+ ]
2814
+ },
2815
+ "valid": true,
2816
+ "section": "8.1"
2817
+ },
2818
+ {
2819
+ "id": "group-nonstring-slot-extended",
2820
+ "schema": "jsonforms-extended-uischema.schema.json",
2821
+ "value": {
2822
+ "type": "Group",
2823
+ "elements": [
2824
+ {
2825
+ "type": "Label",
2826
+ "slot": false
2827
+ }
2828
+ ]
2829
+ },
2830
+ "valid": false,
2831
+ "section": "8.1"
2832
+ },
2833
+ {
2834
+ "id": "group-invalid-slot-content-extended",
2835
+ "schema": "jsonforms-extended-uischema.schema.json",
2836
+ "value": {
2837
+ "type": "Group",
2838
+ "elements": [
2839
+ {
2840
+ "type": "VerticalLayout",
2841
+ "slot": "header",
2842
+ "elements": [
2843
+ {
2844
+ "type": "Control",
2845
+ "scope": 42
2846
+ }
2847
+ ]
2848
+ }
2849
+ ]
2850
+ },
2851
+ "valid": false,
2852
+ "section": "8.1"
2853
+ },
2854
+ {
2855
+ "id": "slot-empty-extended",
2856
+ "schema": "jsonforms-extended-uischema.schema.json",
2857
+ "value": {
2858
+ "type": "Label",
2859
+ "slot": ""
2860
+ },
2861
+ "valid": false,
2862
+ "section": "8.1"
2863
+ },
2864
+ {
2865
+ "id": "group-template-name-independent-of-slot",
2866
+ "schema": "jsonforms-extended-uischema.schema.json",
2867
+ "value": {
2868
+ "type": "Group",
2869
+ "elements": [
2870
+ {
2871
+ "type": "Template",
2872
+ "name": "partner-summary",
2873
+ "slot": "header",
2874
+ "elements": []
2875
+ }
2876
+ ]
2877
+ },
2878
+ "valid": true,
2879
+ "section": "8.1"
2880
+ },
2881
+ {
2882
+ "id": "group-duplicate-slot-common",
2883
+ "schema": "jsonforms-uischema.schema.json",
2884
+ "section": "8.1",
2885
+ "value": {
2886
+ "type": "Group",
2887
+ "elements": [
2888
+ {
2889
+ "type": "Label",
2890
+ "slot": "header",
2891
+ "text": "First"
2892
+ },
2893
+ {
2894
+ "type": "Label",
2895
+ "slot": "header",
2896
+ "text": "Body fallback"
2897
+ }
2898
+ ]
2899
+ },
2900
+ "valid": true
2901
+ },
2902
+ {
2903
+ "id": "group-duplicate-slot-extended",
2904
+ "schema": "jsonforms-extended-uischema.schema.json",
2905
+ "section": "8.1",
2906
+ "value": {
2907
+ "type": "Group",
2908
+ "elements": [
2909
+ {
2910
+ "type": "Label",
2911
+ "slot": "header",
2912
+ "text": "First"
2913
+ },
2914
+ {
2915
+ "type": "Label",
2916
+ "slot": "header",
2917
+ "text": "Body fallback"
2918
+ }
2919
+ ]
2920
+ },
2921
+ "valid": true
2679
2922
  }
2680
2923
  ]
@@ -666,26 +666,35 @@
666
666
  "id": "group-header-accessible-name",
667
667
  "section": "8.1",
668
668
  "input": {
669
- "groupLabel": "Contact",
670
- "header": [
671
- {
672
- "type": "Button",
673
- "label": "Help"
674
- },
675
- {
676
- "type": "Label",
677
- "text": "Verified",
678
- "i18n": "contact.heading"
679
- },
680
- {
681
- "type": "Label",
682
- "text": "Supporting text"
683
- }
684
- ],
685
669
  "catalog": {
686
670
  "contact.heading.text": "Потвърдено"
687
671
  },
688
- "locale": "bg"
672
+ "locale": "bg",
673
+ "uischema": {
674
+ "type": "Group",
675
+ "label": "Contact",
676
+ "elements": [
677
+ {
678
+ "type": "VerticalLayout",
679
+ "slot": "header",
680
+ "elements": [
681
+ {
682
+ "type": "Button",
683
+ "label": "Help"
684
+ },
685
+ {
686
+ "type": "Label",
687
+ "text": "Verified",
688
+ "i18n": "contact.heading"
689
+ },
690
+ {
691
+ "type": "Label",
692
+ "text": "Supporting text"
693
+ }
694
+ ]
695
+ }
696
+ ]
697
+ }
689
698
  },
690
699
  "expected": {
691
700
  "groupAccessibleName": "Потвърдено",
@@ -1915,21 +1924,34 @@
1915
1924
  "options": {
1916
1925
  "conditionalFields": true
1917
1926
  },
1918
- "header": [
1927
+ "elements": [
1919
1928
  {
1920
- "type": "Label",
1921
- "text": "Customer"
1929
+ "type": "Control",
1930
+ "scope": "#/properties/vat",
1931
+ "slot": "cover"
1922
1932
  },
1923
1933
  {
1924
- "type": "Control",
1925
- "scope": "#/properties/vat"
1934
+ "type": "VerticalLayout",
1935
+ "elements": [
1936
+ {
1937
+ "type": "Label",
1938
+ "text": "Customer"
1939
+ },
1940
+ {
1941
+ "type": "Control",
1942
+ "scope": "#/properties/vat"
1943
+ },
1944
+ {
1945
+ "type": "Control",
1946
+ "scope": "#/properties/nickname"
1947
+ }
1948
+ ],
1949
+ "slot": "header"
1926
1950
  },
1927
1951
  {
1928
1952
  "type": "Control",
1929
1953
  "scope": "#/properties/nickname"
1930
- }
1931
- ],
1932
- "footer": [
1954
+ },
1933
1955
  {
1934
1956
  "type": "VerticalLayout",
1935
1957
  "options": {
@@ -1944,17 +1966,8 @@
1944
1966
  "type": "Control",
1945
1967
  "scope": "#/properties/nickname"
1946
1968
  }
1947
- ]
1948
- }
1949
- ],
1950
- "cover": {
1951
- "type": "Control",
1952
- "scope": "#/properties/vat"
1953
- },
1954
- "elements": [
1955
- {
1956
- "type": "Control",
1957
- "scope": "#/properties/nickname"
1969
+ ],
1970
+ "slot": "footer"
1958
1971
  }
1959
1972
  ]
1960
1973
  }
@@ -3096,5 +3109,227 @@
3096
3109
  "schemaKeywordRemainsReadOnly": true,
3097
3110
  "otherIntegrationsDeclareAliasCapability": true
3098
3111
  }
3112
+ },
3113
+ {
3114
+ "id": "group-child-slot-placement",
3115
+ "section": "8.1",
3116
+ "input": {
3117
+ "uischema": {
3118
+ "type": "Group",
3119
+ "elements": [
3120
+ {
3121
+ "type": "Label",
3122
+ "slot": "footer",
3123
+ "text": "Actions"
3124
+ },
3125
+ {
3126
+ "type": "Label",
3127
+ "name": "header",
3128
+ "text": "Body first"
3129
+ },
3130
+ {
3131
+ "type": "Template",
3132
+ "name": "partner-summary",
3133
+ "slot": "header",
3134
+ "elements": []
3135
+ },
3136
+ {
3137
+ "type": "Group",
3138
+ "elements": [
3139
+ {
3140
+ "type": "Label",
3141
+ "slot": "header",
3142
+ "text": "Nested title"
3143
+ },
3144
+ {
3145
+ "type": "Label",
3146
+ "text": "Nested body"
3147
+ }
3148
+ ]
3149
+ }
3150
+ ],
3151
+ "label": "Partner"
3152
+ },
3153
+ "registeredTemplateName": "partner-summary"
3154
+ },
3155
+ "expected": {
3156
+ "visualRegionOrder": [
3157
+ "header",
3158
+ "body",
3159
+ "footer"
3160
+ ],
3161
+ "headerTemplateLookup": "partner-summary",
3162
+ "bodyAuthoredIndices": [
3163
+ 1,
3164
+ 3
3165
+ ],
3166
+ "unslottedNameHeaderRemainsBody": true,
3167
+ "nestedSlotDoesNotFillOuterHeader": true,
3168
+ "childrenTraversableOnlyThroughElements": true,
3169
+ "noSlotsMappingRequired": true,
3170
+ "groupAccessibleName": "Partner",
3171
+ "registeredTemplateExpansionNotSearchedForTitle": true
3172
+ }
3173
+ },
3174
+ {
3175
+ "id": "group-child-slot-fallback",
3176
+ "section": "8.1",
3177
+ "input": {
3178
+ "cases": [
3179
+ {
3180
+ "type": "Group",
3181
+ "elements": [
3182
+ {
3183
+ "type": "Label",
3184
+ "slot": "header",
3185
+ "text": "First"
3186
+ },
3187
+ {
3188
+ "type": "Label",
3189
+ "slot": "header",
3190
+ "text": "Second"
3191
+ },
3192
+ {
3193
+ "type": "Label",
3194
+ "text": "Body"
3195
+ }
3196
+ ]
3197
+ },
3198
+ {
3199
+ "type": "Group",
3200
+ "elements": [
3201
+ {
3202
+ "type": "Label",
3203
+ "slot": "bottom",
3204
+ "text": "Unknown"
3205
+ },
3206
+ {
3207
+ "type": "Label",
3208
+ "text": "Body"
3209
+ }
3210
+ ]
3211
+ }
3212
+ ],
3213
+ "actions": [
3214
+ "render each case",
3215
+ "hide the first header child in the duplicate case",
3216
+ "collapse and reopen the Group"
3217
+ ]
3218
+ },
3219
+ "expected": {
3220
+ "cases": [
3221
+ {
3222
+ "headerAuthoredIndex": 0,
3223
+ "bodyAuthoredIndices": [
3224
+ 1,
3225
+ 2
3226
+ ]
3227
+ },
3228
+ {
3229
+ "bodyAuthoredIndices": [
3230
+ 0,
3231
+ 1
3232
+ ]
3233
+ }
3234
+ ],
3235
+ "everyChildDispatchedOnce": true,
3236
+ "duplicatesAndUnknownNamesAreValid": true,
3237
+ "bodyFallbackIncludesCollapseAndIndicators": true,
3238
+ "hiddenFirstMatchDoesNotPromoteLaterMatch": true,
3239
+ "bodyOrderPreserved": true
3240
+ }
3241
+ },
3242
+ {
3243
+ "id": "group-child-slot-body-indicators",
3244
+ "section": "8.1",
3245
+ "input": {
3246
+ "uischema": {
3247
+ "type": "Group",
3248
+ "options": {
3249
+ "showDataIndicator": true,
3250
+ "showValidationIndicator": true
3251
+ },
3252
+ "elements": [
3253
+ {
3254
+ "type": "Control",
3255
+ "scope": "#/properties/regionOnly",
3256
+ "slot": "header"
3257
+ },
3258
+ {
3259
+ "type": "Control",
3260
+ "scope": "#/properties/body"
3261
+ }
3262
+ ]
3263
+ },
3264
+ "data": {
3265
+ "regionOnly": "present"
3266
+ },
3267
+ "errors": [
3268
+ {
3269
+ "instancePath": "/regionOnly",
3270
+ "keyword": "pattern",
3271
+ "message": "invalid region value"
3272
+ }
3273
+ ]
3274
+ },
3275
+ "expected": {
3276
+ "groupDataIndicator": false,
3277
+ "groupDescendantValidationIndicator": false,
3278
+ "regionControlRetainsLocalError": true,
3279
+ "originalDocumentErrorsUnchanged": true,
3280
+ "bodyValueOrErrorIncludedWhenAdded": true
3281
+ }
3282
+ },
3283
+ {
3284
+ "id": "group-child-slot-visibility",
3285
+ "section": "8.1",
3286
+ "input": {
3287
+ "uischema": {
3288
+ "type": "Group",
3289
+ "label": "Fallback",
3290
+ "options": {
3291
+ "collapsible": true
3292
+ },
3293
+ "elements": [
3294
+ {
3295
+ "type": "VerticalLayout",
3296
+ "slot": "header",
3297
+ "rule": {
3298
+ "effect": "SHOW",
3299
+ "condition": {
3300
+ "scope": "#/properties/showHeader",
3301
+ "schema": {
3302
+ "const": true
3303
+ }
3304
+ }
3305
+ },
3306
+ "elements": [
3307
+ {
3308
+ "type": "Label",
3309
+ "text": "Custom heading"
3310
+ }
3311
+ ]
3312
+ },
3313
+ {
3314
+ "type": "Control",
3315
+ "scope": "#/properties/notes"
3316
+ }
3317
+ ]
3318
+ },
3319
+ "actions": [
3320
+ "focus notes and select text",
3321
+ "hide header through external data update",
3322
+ "show header again",
3323
+ "collapse Group"
3324
+ ]
3325
+ },
3326
+ "expected": {
3327
+ "hiddenHeaderNeverBecomesBody": true,
3328
+ "hiddenHeaderUsesGroupLabel": true,
3329
+ "visibleHeaderUsesResolvedLabel": true,
3330
+ "bodyFocusSelectionDraftAndPendingWriteRetained": true,
3331
+ "collapseKeepsHeaderVisibleAndHidesBodyAndFooter": true,
3332
+ "dataUnchangedByPlacementOrCollapse": true
3333
+ }
3099
3334
  }
3100
3335
  ]
@@ -85,7 +85,9 @@ Retained inactive properties are reserved from the additional-property editor.
85
85
 
86
86
  Moving controls among groups, columns and categories must not change conditional
87
87
  semantics or introduce frames. Preserve layout options, regions, rules, order and
88
- empty authored containers. A Group's header, footer and cover belong to the same
88
+ empty authored containers. Group regions are direct children in `elements`
89
+ assigned through `slot`; preserve their assignments before filtering. A Group's
90
+ header, footer and cover belong to the same
89
91
  object boundary as its body: field bindings use the projection and inactive
90
92
  branch-only bindings are omitted, including a directly bound cover Control.
91
93
  Layouts inside regions inherit the owner's decision; filtering still stops at
@@ -186,7 +188,9 @@ repository. The dated source audit below has its own narrower evidence boundary.
186
188
  Inspection of the Svelte checkout at `d7ae9954` found object-Control conditional
187
189
  projection, but did not establish direct-layout entry support. Its discovery
188
190
  helper rescans conditional/reference/allOf structure; its layout filter recreates
189
- containers and traverses `elements`, without filtering Group regions. Portable
191
+ containers and traverses `elements`, without filtering the separate Group region
192
+ fields used at that revision. This audit predates the child `slot` contract and
193
+ does not establish support for it. Portable
190
194
  layout and region child keys use positions, so conditional removal before a
191
195
  retained editor presents the same identity risk described in the pitfalls.
192
196
  The object-detail path passes its projected schema onward; whole-value editor
@@ -117,7 +117,8 @@ Use `options.conditionalFields: true` on an object Control or an object-context
117
117
  layout entry (VerticalLayout, HorizontalLayout, Group, Categorization, TemplateLayout, Template or Slot), or use
118
118
  `config.jsonformsExtended.conditionalFields` as the default. Local false opts out.
119
119
  The entry owns the projection for descendant layouts and Categories at that
120
- object boundary; their local options are ignored in either direction. Filter
120
+ object boundary; their local options are ignored in either direction. Traverse every Group child through `elements`; partition direct-child `slot`
121
+ assignments for placement and body-only indicators before filtering. Filter
121
122
  Group regions as well as bodies, and retain empty authored containers and
122
123
  existing layout slots. Whole-value editors retain the original schema; object
123
124
  field editors may reuse the projection. Nested object and array-item boundaries
@@ -278,18 +278,20 @@ A remembered oneOf selection must not leave a phantom branch editor after the bo
278
278
 
279
279
  ## Group regions share one collapsible card
280
280
 
281
- `cover`, `header` and `footer` are structural children of Group, rendered
282
- through the normal registry in the current schema and data context. An authored
283
- `header` takes precedence over `label` for the visible title. Two
281
+ Group regions are direct `elements` children with `slot: "cover"`,
282
+ `slot: "header"` or `slot: "footer"`, rendered through the normal registry in the current schema and data context. An authored
283
+ header child takes precedence over `label` for the visible title. Two
284
284
  Label elements can supply a title and smaller supporting text. Keep all regions
285
285
  inside one card frame. Keep the cover and heading visible when collapsed; hide
286
- the body and footer. The first header Label supplies the Group's resolved
287
- accessible name; use the Group label when no header Label exists. Recompute
286
+ the body and footer. The first visible Label in the header child or its authored
287
+ layout subtree supplies the Group's resolved accessible name; use the Group label when none
288
+ exists. Do not search Control details or registered Template expansions. Recompute
288
289
  that name when locale or effective dynamic header text changes. Resolving a
289
290
  dynamic Label only at child dispatch leaves the parent's name stale. Keep
290
291
  authored interactive content outside the disclosure trigger: nesting a Button
291
292
  inside it makes keyboard and pointer behavior
292
- ambiguous. Data and validation indicators aggregate only through `elements`. Acceptance:
293
+ ambiguous. Data and validation indicators aggregate only through resolved body
294
+ children (including slot fallback children), not every child in `elements`. Acceptance:
293
295
  mount the Card regions tab in `examples/group-layout/uischema.json` closed,
294
296
  open it, activate a footer button without changing expansion, close it, then hide
295
297
  the Group. Verify region visibility, action dispatch and unchanged data at each step.
@@ -303,6 +305,26 @@ footer child fill a full-width slot obscures its relationship to the title
303
305
  and each other. Verify row alignment and responsive wrapping in a wide and a
304
306
  narrow host, as well as the disclosure and action independence above.
305
307
 
308
+ ### Placement metadata is independent of element identity
309
+
310
+ Do not use `name` to select Group regions: a Template's name already selects its
311
+ registered content. Keep all children in `elements`, and read only a direct
312
+ child's `slot`. A nested `slot: "header"` must not fill an ancestor's header.
313
+ Use one layout child for several region elements. Select the first authored
314
+ match for each recognized region; later matches and unknown slot names remain
315
+ in the body, in authored order, with ordinary body indicators and collapse
316
+ behavior. Do not combine repeated assignments or drop fallback children. There is no Group `slots` map to enable placement. Compute placement from
317
+ authored children before filtering; an invisible header must not become body
318
+ content or promote a later match out of the body, and its disappearance must not
319
+ reset a retained body editor.
320
+
321
+ **Acceptance:** Place a Template named `partner-summary` in the header using
322
+ `slot`, and an unslotted child named `header` in the body. Verify independent
323
+ registry lookup and placement. Repeat with reordered children, a nested Group,
324
+ unknown and duplicate assignments (rendered once in the body), and a first-match
325
+ header disappearing and returning without promoting its duplicate.
326
+ These are proposed adapter acceptance cases, not executed renderer tests.
327
+
306
328
  ## Equivalent composition feedback
307
329
 
308
330
  Document validation may report the same missing property through multiple alternatives, and local active-branch validation may report it again. Present equivalent errors once: compare instance path, keyword, parameters and message, rather than schema location alone. Preserve different constraint parameters, messages and targets. Deduplication of displayed branch feedback must not alter document validation or its emitted errors.