@chobantonov/jsonforms-extended-spec 1.0.0 → 1.1.1
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/behavior.json +263 -9
- package/conformance/cel-helpers.json +231 -0
- package/docs/implementation-guide.md +91 -1
- package/docs/implementation-pitfalls.md +108 -2
- package/docs/spec.md +77 -8
- package/examples/group-layout/README.md +15 -1
- package/examples/group-layout/data.json +2 -1
- package/examples/group-layout/schema.json +10 -1
- package/examples/group-layout/translations.json +10 -2
- package/examples/group-layout/uischema.json +41 -0
- package/examples/index.js +2 -2
- package/examples/label-interpolation/README.md +29 -2
- package/examples/label-interpolation/data.json +3 -1
- package/examples/label-interpolation/schema.json +9 -0
- package/examples/label-interpolation/translations.json +12 -2
- package/examples/label-interpolation/uischema.json +44 -0
- package/package.json +1 -1
|
@@ -38,8 +38,8 @@ changing rather than taken on trust.
|
|
|
38
38
|
| --- | --- |
|
|
39
39
|
| **Interpolation** | static parameters, data through a parameter, a plural, absent data, a literal brace |
|
|
40
40
|
| **Markdown** | Markdown with no interpolation |
|
|
41
|
-
| **Both together** | a value inside the author's own markup,
|
|
42
|
-
| **Locale and translation** | `translate()`, `date()`, `currency()`, `number()`, and a value left unformatted |
|
|
41
|
+
| **Both together** | a value inside the author's own markup, a value that *contains* markup, and a component-encoded profile link |
|
|
42
|
+
| **Locale and translation** | `translate()`, `date()`, `dateTime()`, `currency()`, `number()`, and a value left unformatted |
|
|
43
43
|
| **Interpolation off** | what the same text does without the option |
|
|
44
44
|
| **JavaScript names** | a property called `constructor`, and one called `toString` |
|
|
45
45
|
| **Incorrect usage** | the five things that are reported, and why |
|
|
@@ -255,3 +255,30 @@ Proposed adapter acceptance cases (not executed renderer tests in this package):
|
|
|
255
255
|
- Supply a non-boolean local `textParamSpans` through unchecked input: it inherits
|
|
256
256
|
the host default rather than becoming truthy or forcing false. Authoring
|
|
257
257
|
validation must still reject it.
|
|
258
|
+
|
|
259
|
+
## URL components and date-time instants
|
|
260
|
+
|
|
261
|
+
The profile link uses `[{name}](#/users/{encodeUriComponent(id)})` with parameters
|
|
262
|
+
bound to `data.customerName` and `data.accountId`. Edit the identifier to include
|
|
263
|
+
`/`, `?`, `&`, `#`, spaces or Unicode: the value remains one encoded component.
|
|
264
|
+
The link label remains literal text even when the account name contains Markdown.
|
|
265
|
+
Percent escapes in the input are encoded again; markup escaping and the resolved
|
|
266
|
+
URL policy still apply. For numeric identifiers, call
|
|
267
|
+
`encodeUriComponent(string(id))` explicitly.
|
|
268
|
+
|
|
269
|
+
The meeting label calls `dateTime(when)` on `data.meetingAt`. Its medium-date and
|
|
270
|
+
short-time output follows the form locale and viewer time zone. The timestamp
|
|
271
|
+
`2026-10-01T14:30:00+02:00` represents the same instant as the initial value and
|
|
272
|
+
must display identically in the same environment. A calendar date continues to
|
|
273
|
+
use `date`, and a clock-only value uses `time`.
|
|
274
|
+
|
|
275
|
+
These labels also work when a browser/JavaScript host mounts the same documents:
|
|
276
|
+
the CEL helper belongs to the host evaluator rather than a JavaScript global.
|
|
277
|
+
The portable helper signatures and edge cases are specified in
|
|
278
|
+
[§9.3a](../../docs/spec.md#93a-portable-url-component-and-date-time-helpers).
|
|
279
|
+
|
|
280
|
+
The locale tab also exercises integer-valued expressions: `number(count, 2)`
|
|
281
|
+
receives a `size()` result, `percent(1)` receives an integer literal, and
|
|
282
|
+
`dateTime(timestamp(when))` receives a native CEL timestamp. These must have the
|
|
283
|
+
same formatting behavior as equivalent data values and timestamp strings. A
|
|
284
|
+
host-provided `Date` follows the same timestamp overload in JavaScript clients.
|
|
@@ -55,6 +55,15 @@
|
|
|
55
55
|
"toString": {
|
|
56
56
|
"type": "string",
|
|
57
57
|
"title": "toString (a legal property name)"
|
|
58
|
+
},
|
|
59
|
+
"accountId": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"title": "Account identifier"
|
|
62
|
+
},
|
|
63
|
+
"meetingAt": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"format": "date-time",
|
|
66
|
+
"title": "Meeting time"
|
|
58
67
|
}
|
|
59
68
|
},
|
|
60
69
|
"required": [
|
|
@@ -45,7 +45,12 @@
|
|
|
45
45
|
"Incorrect usage": "Incorrect usage",
|
|
46
46
|
"hostLocale.text": "Current language: {language}.",
|
|
47
47
|
"namedLocale.text": "Explicit parameter named locale: {locale}.",
|
|
48
|
-
"undeclaredLocale.text": "Locale without a declared parameter: \"{locale}\"."
|
|
48
|
+
"undeclaredLocale.text": "Locale without a declared parameter: \"{locale}\".",
|
|
49
|
+
"encodedProfile.text": "[{name}](#/users/{encodeUriComponent(id)})",
|
|
50
|
+
"meetingTime.text": "Meeting: {dateTime(when)}.",
|
|
51
|
+
"accountId.label": "Account identifier",
|
|
52
|
+
"meetingAt.label": "Meeting time",
|
|
53
|
+
"overloadExamples.text": "Count: {number(count, 2)}; whole ratio: {percent(1)}; timestamp: {dateTime(timestamp(when))}."
|
|
49
54
|
},
|
|
50
55
|
"bg": {
|
|
51
56
|
"product.text": "Абонирани сте за {product}.",
|
|
@@ -93,6 +98,11 @@
|
|
|
93
98
|
"Incorrect usage": "Неправилна употреба",
|
|
94
99
|
"hostLocale.text": "Текущ език: {language}.",
|
|
95
100
|
"namedLocale.text": "Изрично зададен параметър с име locale: {locale}.",
|
|
96
|
-
"undeclaredLocale.text": "Език без деклариран параметър: „{locale}“."
|
|
101
|
+
"undeclaredLocale.text": "Език без деклариран параметър: „{locale}“.",
|
|
102
|
+
"encodedProfile.text": "[{name}](#/users/{encodeUriComponent(id)})",
|
|
103
|
+
"meetingTime.text": "Среща: {dateTime(when)}.",
|
|
104
|
+
"accountId.label": "Идентификатор на акаунта",
|
|
105
|
+
"meetingAt.label": "Час на срещата",
|
|
106
|
+
"overloadExamples.text": "Брой: {number(count, 2)}; цял дял: {percent(1)}; времеви отпечатък: {dateTime(timestamp(when))}."
|
|
97
107
|
}
|
|
98
108
|
}
|
|
@@ -140,6 +140,23 @@
|
|
|
140
140
|
"scope": "#/properties/displayName"
|
|
141
141
|
}
|
|
142
142
|
]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"type": "Label",
|
|
146
|
+
"i18n": "encodedProfile",
|
|
147
|
+
"text": "[{name}](#/users/{encodeUriComponent(id)})",
|
|
148
|
+
"options": {
|
|
149
|
+
"interpolate": true,
|
|
150
|
+
"markup": "markdown",
|
|
151
|
+
"textParams": {
|
|
152
|
+
"name": "{data.customerName}",
|
|
153
|
+
"id": "{data.accountId}"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"type": "Control",
|
|
159
|
+
"scope": "#/properties/accountId"
|
|
143
160
|
}
|
|
144
161
|
]
|
|
145
162
|
},
|
|
@@ -242,6 +259,33 @@
|
|
|
242
259
|
"scope": "#/properties/reference"
|
|
243
260
|
}
|
|
244
261
|
]
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"type": "Label",
|
|
265
|
+
"i18n": "meetingTime",
|
|
266
|
+
"text": "Meeting: {dateTime(when)}.",
|
|
267
|
+
"options": {
|
|
268
|
+
"interpolate": true,
|
|
269
|
+
"textParams": {
|
|
270
|
+
"when": "{data.meetingAt}"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"type": "Control",
|
|
276
|
+
"scope": "#/properties/meetingAt"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"type": "Label",
|
|
280
|
+
"i18n": "overloadExamples",
|
|
281
|
+
"text": "Count: {number(count, 2)}; whole ratio: {percent(1)}; timestamp: {dateTime(timestamp(when))}.",
|
|
282
|
+
"options": {
|
|
283
|
+
"interpolate": true,
|
|
284
|
+
"textParams": {
|
|
285
|
+
"count": "{size([data.plan])}",
|
|
286
|
+
"when": "{data.meetingAt}"
|
|
287
|
+
}
|
|
288
|
+
}
|
|
245
289
|
}
|
|
246
290
|
]
|
|
247
291
|
},
|