@chobantonov/jsonforms-extended-spec 1.0.0 → 1.1.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/docs/spec.md CHANGED
@@ -811,7 +811,8 @@ switch. With no slot assignments, the Group is an ordinary body-only Group.
811
811
  Each region uses the **first direct child in authored `elements` order** whose
812
812
  `slot` exactly matches that region. Later children with the same slot name remain
813
813
  in the body, as if their `slot` were omitted. Unrecognized slot names likewise
814
- use ordinary body placement. These are valid fallback cases, not configuration
814
+ use ordinary body placement. There is no dedicated `body` slot; `slot: "body"`
815
+ is an unrecognized name and uses the same fallback. These are valid fallback cases, not configuration
815
816
  errors; no child is discarded or rendered twice. Body fallback children follow
816
817
  ordinary body collapse, data-presence and validation-indicator behavior.
817
818
 
@@ -856,10 +857,11 @@ the heading row. The cover and one heading area remain visible when collapsed;
856
857
  only the body and footer hide. Keep authored interactive header and footer content
857
858
  outside the disclosure trigger. Group visibility hides every region. Enabled,
858
859
  read-only and rule behavior apply to dispatched children as usual. Group data-presence
859
- and validation indicators aggregate only the body children and their
860
- descendants, including duplicate/unknown-slot fallback children and excluding
861
- children selected for regions, even though all children are stored
862
- in `elements`. This presentation boundary does not change document validation.
860
+ and validation indicators aggregate bound Controls across **all** children in
861
+ `elements` and their descendants, including cover, header, footer and body
862
+ fallback children. Placement does not change binding participation. Labels,
863
+ images and other presentation-only elements do not contribute data or errors
864
+ merely by displaying content or carrying a `scope` field. This presentation boundary does not change document validation.
863
865
 
864
866
  For Groups that declare regions, keep the authored content in one card frame.
865
867
  In a collapsible presentation, the cover and one heading area stay inside the
@@ -901,14 +903,16 @@ name control and footer button.
901
903
 
902
904
  `ImageView` retains its URL policy and alternative-text rules (§13.1); `Button`
903
905
  retains the action, disabled and pending rules (§14). Authors can place any
904
- supported UI-schema element in a region, but should keep editable fields in
905
- unslotted body children so collapse and section indicators have predictable meaning.
906
+ supported UI-schema element in any region, including editable fields. A field
907
+ in the footer, header or cover participates in Group indicators just as a body
908
+ field does. Collapse and ordinary visibility rules do not exclude bindings from
909
+ aggregation; conditional omission still removes inactive presentation bindings.
906
910
 
907
911
  | Option | Default | Behaviour |
908
912
  | --- | --- | --- |
909
913
  | `collapsible` | `false` | Enables an accessible disclosure control |
910
914
  | `collapsed` | `false` | Initializes expansion and synchronizes it when the effective boolean changes. Ignored unless `collapsible` is true |
911
- | `showDataIndicator` | `false` | Shows a data-presence indicator when at least one bound body descendant contains data |
915
+ | `showDataIndicator` | `false` | Shows a data-presence indicator when at least one bound descendant in any region contains data |
912
916
  | `showValidationIndicator` | `false` | Shows an aggregated descendant-error indicator. See §8.3 |
913
917
 
914
918
  ```json
@@ -1426,6 +1430,64 @@ zone renders the previous day for readers west of the meridian, which is a
1426
1430
  one-day error that appears for some readers only; such a value MUST be
1427
1431
  formatted as UTC.
1428
1432
 
1433
+ Numeric formatting MUST accept both CEL `int` and `double` values. In
1434
+ particular, JSON data numbers and integer-valued literals or computations MUST
1435
+ not require different authoring expressions. The portable signatures are
1436
+ `number(int|double): string`, `number(int|double, int): string`,
1437
+ `currency(int|double, string): string`, and `percent(int|double): string`;
1438
+ `int|double` denotes two separate overloads. The second `number` argument fixes
1439
+ both minimum and maximum fraction digits. CEL integer precision MUST be retained
1440
+ until formatting, including values outside JavaScript's safe integer range.
1441
+
1442
+ The temporal functions `date`, `time`, and `dateTime` MUST also accept CEL
1443
+ `google.protobuf.Timestamp` values, including a value produced by
1444
+ `timestamp("2026-10-01T12:30:00Z")`. A JavaScript host may supply its `Date`
1445
+ representation of that type. Format timestamps as instants in the viewer's time
1446
+ zone, using medium date, short time, or both respectively. The string overloads
1447
+ keep their existing calendar-date, clock-only, and timestamp semantics. This does
1448
+ not introduce numeric epoch overloads: a number's units cannot be inferred from
1449
+ its CEL type. Unparseable temporal values follow the expression-failure policy.
1450
+
1451
+ ### 9.3a Portable URL-component and date-time helpers
1452
+
1453
+ Hosts evaluating the canonical CEL text-expression profile MUST expose these
1454
+ case-sensitive signatures, including hosts consumed through HTML or JavaScript.
1455
+ They are registered CEL functions, independent of JavaScript globals.
1456
+
1457
+ | Signature | Behavior |
1458
+ | --- | --- |
1459
+ | `encodeUriComponent(string): string` | Encode a single URL path segment or query value using the UTF-8 percent-encoding semantics of JavaScript `encodeURIComponent`. Encoding is locale-independent. |
1460
+ | `dateTime(string): string` and `dateTime(google.protobuf.Timestamp): string` | For an RFC 3339 date-time with `Z` or an explicit offset, format its instant using the active form locale, a medium date and a short time in the viewer's time zone, equivalent to `Intl.DateTimeFormat(locale, { dateStyle: 'medium', timeStyle: 'short' })`. |
1461
+
1462
+ `encodeUriComponent` MUST encode reserved delimiters such as `/`, `?`, `&`, `#`,
1463
+ and `=`, spaces as `%20`, and a literal `%` as `%25`. It MUST retain the same
1464
+ unescaped characters as `encodeURIComponent`, including `!`, `~`, `*`, apostrophes,
1465
+ and parentheses. It does not detect previously encoded text: `a%2Fb` becomes
1466
+ `a%252Fb`. An unpaired UTF-16 surrogate fails the expression. The CEL argument is
1467
+ string-only; use `encodeUriComponent(string(id))` for a numeric identifier.
1468
+
1469
+ For example, with declared `name` and `id` text parameters:
1470
+
1471
+ ```md
1472
+ [{name}](#/users/{encodeUriComponent(id)})
1473
+ ```
1474
+
1475
+ Component encoding MUST NOT replace the substitution escaping in §9.4 or the
1476
+ resolved-destination URL policy in §12. Parentheses and apostrophes left by
1477
+ component encoding still pass through the renderer's normal markup escaping.
1478
+
1479
+ `dateTime` preserves the instant represented by an offset; equivalent timestamps
1480
+ MUST render identically for the same locale and viewer time zone. Switching the
1481
+ form locale re-formats the value. The viewer's zone is a host environment input,
1482
+ so adapters MUST control it when comparing acceptance output across platforms;
1483
+ localized strings may also vary with locale-data versions. Use `date` for calendar
1484
+ dates and `time` for clock-only values. Values the formatter cannot parse, wrong
1485
+ CEL argument types, and encoding errors follow the existing expression-failure
1486
+ policy in §9.2; they MUST NOT take down the surrounding form.
1487
+
1488
+ The JSON cases in `conformance/cel-helpers.json` are portable adapter inputs,
1489
+ not evidence of execution by a renderer.
1490
+
1429
1491
  ### 9.4 Substitution, escaping and order
1430
1492
 
1431
1493
  **Pipeline:** effective `textParams` → translation and message lookup →
@@ -4009,6 +4071,13 @@ latest draft is valid.
4009
4071
  - **Clear supersedes queued edits**, so an old callback cannot restore the
4010
4072
  cleared value.
4011
4073
 
4074
+ A completed commit may equal the value already stored in the current model. In
4075
+ that case, any pending contribution for that edit MUST settle without requiring
4076
+ a data-change event or a new data snapshot: there may be no such acknowledgement.
4077
+ Notify participating validity consumers when this state changes. Preserve newer
4078
+ queued drafts, unresolved edits and independent pending validation; completing a
4079
+ no-op write does not make those contributions valid.
4080
+
4012
4081
  **Disposal must leave no stale write callback active**, and there are three
4013
4082
  ways a queued write outlives its target — only one of which is disposal:
4014
4083
 
@@ -167,8 +167,22 @@ required by this package.
167
167
 
168
168
  ## Feature navigation
169
169
 
170
- Explore one feature at a time using the tabs: **Identity group**, **Contact group**, **Insurance group**, **Audit group**, **False and zero**, and **Card regions**. Tab titles are localized in English and Bulgarian. The tabs share the existing form data.
170
+ Explore one feature at a time using the tabs: **Identity group**, **Contact group**, **Insurance group**, **Audit group**, **False and zero**, **Card regions**, and **Region bindings**. Tab titles are localized in English and Bulgarian. The tabs share the existing form data.
171
171
 
172
172
  ## Consolidated demo coverage
173
173
 
174
174
  The False and zero tab starts collapsed with `false` and `0`: both count as present data.
175
+
176
+ ## Indicators include fields in every region
177
+
178
+ The **Region bindings** tab has its only bound Control in the footer. That note
179
+ is required, so clearing or removing its value remains invalid. It starts
180
+ collapsed with a populated valid value, so the data indicator appears even though
181
+ the body has no bound fields. Open it and enter `x`: data and error indicators
182
+ appear. Clear the value: only the error indicator remains. Collapsing the Group
183
+ does not remove those signals. The header/body Labels are presentation only.
184
+ The same binding participation applies to header and cover Controls, unslotted
185
+ children and unknown-slot fallback children (including `slot: "body"`).
186
+
187
+ This is a portable acceptance example; the spec validates its assets, while
188
+ renderer adapters must execute the interactions above.
@@ -5,5 +5,6 @@
5
5
  "contactEmail": "support@example.test",
6
6
  "alternatePhone": "+1 503 555 0113",
7
7
  "active": false,
8
- "count": 0
8
+ "count": 0,
9
+ "regionNote": "Ready"
9
10
  }
@@ -46,6 +46,15 @@
46
46
  "count": {
47
47
  "type": "integer",
48
48
  "i18n": "presence.count"
49
+ },
50
+ "regionNote": {
51
+ "type": "string",
52
+ "minLength": 3,
53
+ "title": "Footer note",
54
+ "i18n": "regionNote"
49
55
  }
50
- }
56
+ },
57
+ "required": [
58
+ "regionNote"
59
+ ]
51
60
  }
@@ -27,7 +27,11 @@
27
27
  "regions.tab.label": "Card regions",
28
28
  "regions.footer.text": "Preview language",
29
29
  "regions.header.title.text": "Hospitality partner",
30
- "regions.header.description.text": "Verified service partner · Member since 2018"
30
+ "regions.header.description.text": "Verified service partner · Member since 2018",
31
+ "featureNavigation.regionBindings.label": "Region bindings",
32
+ "regionBindings.heading.text": "Field in the footer",
33
+ "regionBindings.body.text": "The body contains no bound fields.",
34
+ "regionNote.label": "Footer note"
31
35
  },
32
36
  "bg": {
33
37
  "group.dataIndicator": "Съдържа данни",
@@ -57,6 +61,10 @@
57
61
  "regions.tab.label": "Секции на картата",
58
62
  "regions.footer.text": "Език на прегледа",
59
63
  "regions.header.title.text": "Партньор в хотелиерството",
60
- "regions.header.description.text": "Проверен партньор · Член от 2018 г."
64
+ "regions.header.description.text": "Проверен партньор · Член от 2018 г.",
65
+ "featureNavigation.regionBindings.label": "Полета в областите",
66
+ "regionBindings.heading.text": "Поле в долната част",
67
+ "regionBindings.body.text": "Основната част не съдържа свързани полета.",
68
+ "regionNote.label": "Бележка в долната част"
61
69
  }
62
70
  }
@@ -251,6 +251,47 @@
251
251
  ]
252
252
  }
253
253
  ]
254
+ },
255
+ {
256
+ "type": "Category",
257
+ "label": "Region bindings",
258
+ "i18n": "featureNavigation.regionBindings",
259
+ "elements": [
260
+ {
261
+ "type": "Group",
262
+ "label": "All region bindings",
263
+ "options": {
264
+ "collapsible": true,
265
+ "collapsed": true,
266
+ "showDataIndicator": true,
267
+ "showValidationIndicator": true,
268
+ "showValidationIndicatorCount": true
269
+ },
270
+ "elements": [
271
+ {
272
+ "type": "Label",
273
+ "text": "Field in the footer",
274
+ "i18n": "regionBindings.heading",
275
+ "slot": "header"
276
+ },
277
+ {
278
+ "type": "Label",
279
+ "text": "The body contains no bound fields.",
280
+ "i18n": "regionBindings.body"
281
+ },
282
+ {
283
+ "type": "HorizontalLayout",
284
+ "slot": "footer",
285
+ "elements": [
286
+ {
287
+ "type": "Control",
288
+ "scope": "#/properties/regionNote"
289
+ }
290
+ ]
291
+ }
292
+ ]
293
+ }
294
+ ]
254
295
  }
255
296
  ]
256
297
  }