@chobantonov/jsonforms-extended-spec 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +126 -2
- package/conformance/authoring.json +2680 -0
- package/conformance/behavior.json +1602 -0
- package/conformance/config-consumption.json +1542 -0
- package/conformance/expected-invalid.json +20 -0
- package/docs/audit.md +150 -0
- package/docs/conditional-fields.md +122 -0
- package/docs/draft-07-visual-support.md +43 -0
- package/docs/external-resources-proposal.md +536 -0
- package/docs/implementation-guide.md +233 -0
- package/docs/implementation-pitfalls.md +968 -0
- package/docs/implementation-web-typescript.md +41 -0
- package/docs/renderer-and-demo.md +1347 -0
- package/docs/renderer-selection.md +99 -0
- package/docs/spec.md +8470 -0
- package/docs/todo.md +166 -0
- package/examples/README.md +127 -0
- package/examples/additional-errors/README.md +176 -0
- package/examples/additional-errors/config.json +3 -0
- package/examples/additional-errors/data.json +11 -0
- package/examples/additional-errors/schema.json +56 -0
- package/examples/additional-errors/translations.json +64 -0
- package/examples/additional-errors/uischema.json +158 -0
- package/examples/additional-items-pagination/README.md +8 -0
- package/examples/additional-items-pagination/config.json +10 -0
- package/examples/additional-items-pagination/data.json +22 -0
- package/examples/additional-items-pagination/schema.json +30 -0
- package/examples/additional-items-pagination/translations.json +16 -0
- package/examples/additional-items-pagination/uischema.json +39 -0
- package/examples/additional-properties/README.md +203 -0
- package/examples/additional-properties/config.json +5 -0
- package/examples/additional-properties/data.json +31 -0
- package/examples/additional-properties/schema.json +78 -0
- package/examples/additional-properties/translations.json +80 -0
- package/examples/additional-properties/uischema.json +104 -0
- package/examples/ag-grid/README.md +62 -0
- package/examples/ag-grid/config.json +14 -0
- package/examples/ag-grid/data.json +124 -0
- package/examples/ag-grid/schema.json +48 -0
- package/examples/ag-grid/translations.json +58 -0
- package/examples/ag-grid/uischema.json +671 -0
- package/examples/array-choices/README.md +150 -0
- package/examples/array-choices/config.json +4 -0
- package/examples/array-choices/data.json +10 -0
- package/examples/array-choices/schema.json +68 -0
- package/examples/array-choices/translations.json +64 -0
- package/examples/array-choices/uischema.json +97 -0
- package/examples/array-controls/README.md +237 -0
- package/examples/array-controls/config.json +4 -0
- package/examples/array-controls/data.json +147 -0
- package/examples/array-controls/schema.json +374 -0
- package/examples/array-controls/translations.json +186 -0
- package/examples/array-controls/uischema.json +685 -0
- package/examples/array-detail-modes/README.md +11 -0
- package/examples/array-detail-modes/data.json +38 -0
- package/examples/array-detail-modes/schema.json +89 -0
- package/examples/array-detail-modes/translations.json +36 -0
- package/examples/array-detail-modes/uischema.json +73 -0
- package/examples/array-detail-modes/uischemas.d.mts +2 -0
- package/examples/array-detail-modes/uischemas.json +15 -0
- package/examples/boolean-controls/README.md +109 -0
- package/examples/boolean-controls/config.json +3 -0
- package/examples/boolean-controls/data.json +27 -0
- package/examples/boolean-controls/schema.json +98 -0
- package/examples/boolean-controls/translations.json +94 -0
- package/examples/boolean-controls/uischema.json +126 -0
- package/examples/button-actions/README.md +259 -0
- package/examples/button-actions/config.json +7 -0
- package/examples/button-actions/data.json +5 -0
- package/examples/button-actions/host.mjs +14 -0
- package/examples/button-actions/schema.json +20 -0
- package/examples/button-actions/translations.json +60 -0
- package/examples/button-actions/uischema.json +179 -0
- package/examples/catalog.json +634 -0
- package/examples/categorization/README.md +132 -0
- package/examples/categorization/config.json +7 -0
- package/examples/categorization/data.json +8 -0
- package/examples/categorization/schema.json +29 -0
- package/examples/categorization/translations.json +72 -0
- package/examples/categorization/uischema.json +288 -0
- package/examples/choice-controls/README.md +136 -0
- package/examples/choice-controls/config.json +10 -0
- package/examples/choice-controls/data.json +61 -0
- package/examples/choice-controls/schema.json +406 -0
- package/examples/choice-controls/translations.json +154 -0
- package/examples/choice-controls/uischema.json +575 -0
- package/examples/choice-controls/uischemas.d.mts +2 -0
- package/examples/choice-controls/uischemas.json +16 -0
- package/examples/code-editor/README.md +74 -0
- package/examples/code-editor/data.json +8 -0
- package/examples/code-editor/schema.json +28 -0
- package/examples/code-editor/translations.json +20 -0
- package/examples/code-editor/uischema.json +77 -0
- package/examples/collection-pagination/README.md +5 -0
- package/examples/collection-pagination/config.json +1 -0
- package/examples/collection-pagination/data.json +64 -0
- package/examples/collection-pagination/schema.json +23 -0
- package/examples/collection-pagination/translations.json +14 -0
- package/examples/collection-pagination/uischema.json +14 -0
- package/examples/color-control/README.md +154 -0
- package/examples/color-control/config.json +7 -0
- package/examples/color-control/data.json +11 -0
- package/examples/color-control/schema.json +61 -0
- package/examples/color-control/translations.json +76 -0
- package/examples/color-control/uischema.json +106 -0
- package/examples/combinators/README.md +223 -0
- package/examples/combinators/config.json +9 -0
- package/examples/combinators/data.json +23 -0
- package/examples/combinators/schema.json +232 -0
- package/examples/combinators/translations.json +178 -0
- package/examples/combinators/uischema.json +158 -0
- package/examples/conditional-fields/README.md +27 -0
- package/examples/conditional-fields/config.json +5 -0
- package/examples/conditional-fields/data.json +7 -0
- package/examples/conditional-fields/schema.json +59 -0
- package/examples/conditional-fields/translations.json +32 -0
- package/examples/conditional-fields/uischema.json +131 -0
- package/examples/container-validation-indicator/README.md +187 -0
- package/examples/container-validation-indicator/config.json +9 -0
- package/examples/container-validation-indicator/data.json +68 -0
- package/examples/container-validation-indicator/schema.json +222 -0
- package/examples/container-validation-indicator/translations.json +120 -0
- package/examples/container-validation-indicator/uischema.json +98 -0
- package/examples/cron-control/README.md +155 -0
- package/examples/cron-control/data.json +15 -0
- package/examples/cron-control/schema.json +72 -0
- package/examples/cron-control/translations.json +80 -0
- package/examples/cron-control/uischema.json +91 -0
- package/examples/destructive-confirmation/README.md +210 -0
- package/examples/destructive-confirmation/config.json +17 -0
- package/examples/destructive-confirmation/data.json +86 -0
- package/examples/destructive-confirmation/schema.json +204 -0
- package/examples/destructive-confirmation/translations.json +112 -0
- package/examples/destructive-confirmation/uischema.json +105 -0
- package/examples/draft-07-metaschema/README.md +11 -0
- package/examples/draft-07-metaschema/config.json +3 -0
- package/examples/draft-07-metaschema/data.json +25 -0
- package/examples/draft-07-metaschema/schema.json +172 -0
- package/examples/draft-07-metaschema/translations.json +10 -0
- package/examples/draft-07-metaschema/uischema.json +14 -0
- package/examples/dynamic-playground/README.md +95 -0
- package/examples/dynamic-playground/config.json +8 -0
- package/examples/dynamic-playground/configuration.json +152 -0
- package/examples/dynamic-playground/data.json +15 -0
- package/examples/dynamic-playground/dynamic-uischema.json +379 -0
- package/examples/dynamic-playground/host.mjs +37 -0
- package/examples/dynamic-playground/schema.json +48 -0
- package/examples/dynamic-playground/translations.json +76 -0
- package/examples/dynamic-playground/uischema.json +36 -0
- package/examples/editor-details/README.md +10 -0
- package/examples/editor-details/data.json +18 -0
- package/examples/editor-details/schema.json +49 -0
- package/examples/editor-details/translations.json +28 -0
- package/examples/editor-details/uischema.json +53 -0
- package/examples/editor-details/uischemas.d.mts +2 -0
- package/examples/editor-details/uischemas.json +14 -0
- package/examples/file-control/README.md +108 -0
- package/examples/file-control/data.json +28 -0
- package/examples/file-control/schema.json +89 -0
- package/examples/file-control/translations.json +46 -0
- package/examples/file-control/uischema.json +152 -0
- package/examples/group-layout/README.md +149 -0
- package/examples/group-layout/config.json +10 -0
- package/examples/group-layout/data.json +9 -0
- package/examples/group-layout/schema.json +51 -0
- package/examples/group-layout/translations.json +62 -0
- package/examples/group-layout/uischema.json +249 -0
- package/examples/index.d.ts +17 -0
- package/examples/index.js +69 -0
- package/examples/input-adornments/README.md +68 -0
- package/examples/input-adornments/data.json +41 -0
- package/examples/input-adornments/schema.json +207 -0
- package/examples/input-adornments/translations.json +106 -0
- package/examples/input-adornments/uischema.json +695 -0
- package/examples/job-application/README.md +23 -0
- package/examples/job-application/config.json +10 -0
- package/examples/job-application/data.json +68 -0
- package/examples/job-application/schema.json +196 -0
- package/examples/job-application/translations.json +388 -0
- package/examples/job-application/uischema.json +218 -0
- package/examples/job-application/uischemas.json +153 -0
- package/examples/json-editor/README.md +28 -0
- package/examples/json-editor/schema.json +1 -0
- package/examples/json-editor/translations.json +10 -0
- package/examples/json-editor/uischema.json +16 -0
- package/examples/json-inference/README.md +33 -0
- package/examples/json-inference/translations.json +10 -0
- package/examples/json-inference/uischema.json +16 -0
- package/examples/kitchen-sink/README.md +86 -0
- package/examples/kitchen-sink/config.json +14 -0
- package/examples/kitchen-sink/data.json +263 -0
- package/examples/kitchen-sink/invalid-data.json +263 -0
- package/examples/kitchen-sink/schema.json +515 -0
- package/examples/kitchen-sink/translations.json +270 -0
- package/examples/kitchen-sink/uischema.json +722 -0
- package/examples/label-interpolation/README.md +241 -0
- package/examples/label-interpolation/config.json +14 -0
- package/examples/label-interpolation/data.json +13 -0
- package/examples/label-interpolation/schema.json +64 -0
- package/examples/label-interpolation/translations.json +94 -0
- package/examples/label-interpolation/uischema.json +379 -0
- package/examples/layout-sizing/README.md +162 -0
- package/examples/layout-sizing/config.json +10 -0
- package/examples/layout-sizing/data.json +14 -0
- package/examples/layout-sizing/schema.json +58 -0
- package/examples/layout-sizing/translations.json +42 -0
- package/examples/layout-sizing/uischema.json +558 -0
- package/examples/markup-label/README.md +109 -0
- package/examples/markup-label/config.json +16 -0
- package/examples/markup-label/data.json +5 -0
- package/examples/markup-label/schema.json +24 -0
- package/examples/markup-label/translations.json +40 -0
- package/examples/markup-label/uischema.json +149 -0
- package/examples/mixed-control/README.md +164 -0
- package/examples/mixed-control/config.json +11 -0
- package/examples/mixed-control/data.json +70 -0
- package/examples/mixed-control/schema.json +221 -0
- package/examples/mixed-control/translations.json +158 -0
- package/examples/mixed-control/uischema.json +211 -0
- package/examples/null-control/README.md +111 -0
- package/examples/null-control/config.json +4 -0
- package/examples/null-control/data.json +6 -0
- package/examples/null-control/schema.json +36 -0
- package/examples/null-control/translations.json +42 -0
- package/examples/null-control/uischema.json +56 -0
- package/examples/numeric-controls/README.md +94 -0
- package/examples/numeric-controls/config.json +4 -0
- package/examples/numeric-controls/data.json +8 -0
- package/examples/numeric-controls/schema.json +52 -0
- package/examples/numeric-controls/translations.json +56 -0
- package/examples/numeric-controls/uischema.json +77 -0
- package/examples/object-control/README.md +220 -0
- package/examples/object-control/config.json +4 -0
- package/examples/object-control/data.json +62 -0
- package/examples/object-control/schema.json +252 -0
- package/examples/object-control/translations.json +160 -0
- package/examples/object-control/uischema.json +275 -0
- package/examples/object-control/uischemas.d.mts +2 -0
- package/examples/object-control/uischemas.json +59 -0
- package/examples/password-control/README.md +119 -0
- package/examples/password-control/config.json +3 -0
- package/examples/password-control/data.json +18 -0
- package/examples/password-control/schema.json +65 -0
- package/examples/password-control/translations.json +64 -0
- package/examples/password-control/uischema.json +94 -0
- package/examples/pre-touch-errors/README.md +176 -0
- package/examples/pre-touch-errors/config.json +4 -0
- package/examples/pre-touch-errors/data.json +5 -0
- package/examples/pre-touch-errors/schema.json +56 -0
- package/examples/pre-touch-errors/translations.json +68 -0
- package/examples/pre-touch-errors/uischema.json +85 -0
- package/examples/presentation/README.md +148 -0
- package/examples/presentation/config.json +9 -0
- package/examples/presentation/data.json +6 -0
- package/examples/presentation/schema.json +21 -0
- package/examples/presentation/translations.json +64 -0
- package/examples/presentation/uischema.json +210 -0
- package/examples/property-pagination/README.md +5 -0
- package/examples/property-pagination/config.json +1 -0
- package/examples/property-pagination/data.json +17 -0
- package/examples/property-pagination/schema.json +14 -0
- package/examples/property-pagination/translations.json +10 -0
- package/examples/property-pagination/uischema.json +24 -0
- package/examples/recursive-tree/README.md +49 -0
- package/examples/recursive-tree/config.json +1 -0
- package/examples/recursive-tree/data.json +40 -0
- package/examples/recursive-tree/schema.json +89 -0
- package/examples/recursive-tree/translations.json +42 -0
- package/examples/recursive-tree/uischema.json +84 -0
- package/examples/recursive-tree/uischemas.d.mts +2 -0
- package/examples/recursive-tree/uischemas.json +51 -0
- package/examples/split-layout/README.md +123 -0
- package/examples/split-layout/config.json +3 -0
- package/examples/split-layout/data.json +13 -0
- package/examples/split-layout/schema.json +50 -0
- package/examples/split-layout/translations.json +50 -0
- package/examples/split-layout/uischema.json +204 -0
- package/examples/string-controls/README.md +159 -0
- package/examples/string-controls/config.json +5 -0
- package/examples/string-controls/data.json +13 -0
- package/examples/string-controls/schema.json +70 -0
- package/examples/string-controls/translations.json +76 -0
- package/examples/string-controls/uischema.json +148 -0
- package/examples/table-row-details/README.md +69 -0
- package/examples/table-row-details/config.json +7 -0
- package/examples/table-row-details/data.json +280 -0
- package/examples/table-row-details/schema.json +61 -0
- package/examples/table-row-details/translations.json +56 -0
- package/examples/table-row-details/uischema.json +1303 -0
- package/examples/template-layout/README.md +250 -0
- package/examples/template-layout/config.json +9 -0
- package/examples/template-layout/data.json +20 -0
- package/examples/template-layout/host.mjs +13 -0
- package/examples/template-layout/schema.json +48 -0
- package/examples/template-layout/translations.json +70 -0
- package/examples/template-layout/uischema.json +177 -0
- package/examples/template-slots/README.md +19 -0
- package/examples/template-slots/data.json +4 -0
- package/examples/template-slots/schema.json +11 -0
- package/examples/template-slots/translations.json +26 -0
- package/examples/template-slots/uischema.json +47 -0
- package/examples/template-slots/uischemas.d.mts +2 -0
- package/examples/template-slots/uischemas.json +56 -0
- package/examples/temporal-controls/README.md +325 -0
- package/examples/temporal-controls/data.json +44 -0
- package/examples/temporal-controls/schema.json +208 -0
- package/examples/temporal-controls/translations.json +156 -0
- package/examples/temporal-controls/uischema.json +297 -0
- package/examples/tree-max-depth/README.md +5 -0
- package/examples/tree-max-depth/config.json +3 -0
- package/examples/tree-max-depth/data.json +31 -0
- package/examples/tree-max-depth/schema.json +258 -0
- package/examples/tree-max-depth/translations.json +42 -0
- package/examples/tree-max-depth/uischema.json +16 -0
- package/examples/tree-max-depth/uischemas.d.mts +2 -0
- package/examples/tree-max-depth/uischemas.json +50 -0
- package/examples/tuple-control/README.md +335 -0
- package/examples/tuple-control/config.json +4 -0
- package/examples/tuple-control/data.json +61 -0
- package/examples/tuple-control/schema.json +218 -0
- package/examples/tuple-control/translations.json +142 -0
- package/examples/tuple-control/uischema.json +128 -0
- package/examples/tuple-control/uischemas.d.mts +2 -0
- package/examples/tuple-control/uischemas.json +125 -0
- package/examples/validator-profile/README.md +197 -0
- package/examples/validator-profile/config.json +9 -0
- package/examples/validator-profile/data.json +16 -0
- package/examples/validator-profile/schema.json +139 -0
- package/examples/validator-profile/translations.json +34 -0
- package/examples/validator-profile/uischema.json +59 -0
- package/package.json +83 -3
- package/provenance.json +140 -0
- package/schemas/README.md +82 -0
- package/schemas/example.schema.json +37 -0
- package/schemas/jsonforms-config.schema.json +427 -0
- package/schemas/jsonforms-dynamic-uischema.schema.json +220 -0
- package/schemas/jsonforms-extended-config.schema.json +332 -0
- package/schemas/jsonforms-extended-uischema.schema.json +1932 -0
- package/schemas/jsonforms-rule.schema.json +104 -0
- package/schemas/jsonforms-uischema.schema.json +1434 -0
- package/typescript/README.md +546 -0
- package/typescript/lib/authoring/cssLength.d.ts +33 -0
- package/typescript/lib/authoring/cssLength.js +25 -0
- package/typescript/lib/authoring/dynamic.d.ts +73 -0
- package/typescript/lib/authoring/dynamic.js +8 -0
- package/typescript/lib/authoring/forSchema.d.ts +385 -0
- package/typescript/lib/authoring/forSchema.js +84 -0
- package/typescript/lib/authoring/schemaTypes.d.ts +111 -0
- package/typescript/lib/authoring/schemaTypes.js +15 -0
- package/typescript/lib/index.d.ts +4 -0
- package/typescript/lib/index.js +20 -0
- package/typescript/package.json +1 -0
- package/typescript/src/authoring/cssLength.ts +79 -0
- package/typescript/src/authoring/dynamic.ts +96 -0
- package/typescript/src/authoring/forSchema.ts +428 -0
- package/typescript/src/authoring/schemaTypes.ts +143 -0
- package/typescript/src/index.ts +4 -0
- package/typescript/test/schemaContract.test.ts +638 -0
- package/typescript/test/tsconfig.json +10 -0
- package/typescript/test/typedAuthoring.test.ts +151 -0
- package/typescript/test/typedAuthoringCoverage.test.ts +178 -0
- package/typescript/test/typedAuthoringCssLength.test.ts +81 -0
- package/typescript/test/typedAuthoringNames.test.ts +90 -0
- package/typescript/test/typedDynamic.test.ts +88 -0
- package/typescript/tsconfig.json +15 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "VerticalLayout",
|
|
3
|
+
"elements": [
|
|
4
|
+
{
|
|
5
|
+
"type": "Control",
|
|
6
|
+
"scope": "#/properties/username"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"type": "Categorization",
|
|
10
|
+
"elements": [
|
|
11
|
+
{
|
|
12
|
+
"type": "Category",
|
|
13
|
+
"label": "Password",
|
|
14
|
+
"i18n": "featureNavigation.section1",
|
|
15
|
+
"elements": [
|
|
16
|
+
{
|
|
17
|
+
"type": "Label",
|
|
18
|
+
"text": "Selected by the schema format"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "Control",
|
|
22
|
+
"scope": "#/properties/password"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "Category",
|
|
28
|
+
"label": "UI format selection",
|
|
29
|
+
"i18n": "featureNavigation.section2",
|
|
30
|
+
"elements": [
|
|
31
|
+
{
|
|
32
|
+
"type": "Label",
|
|
33
|
+
"text": "Selected by options.format on a plain string"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "Control",
|
|
37
|
+
"scope": "#/properties/recoveryPhrase",
|
|
38
|
+
"options": {
|
|
39
|
+
"format": "password"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "Control",
|
|
44
|
+
"scope": "#/properties/hint"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "Category",
|
|
50
|
+
"label": "Verification code",
|
|
51
|
+
"i18n": "featureNavigation.section3",
|
|
52
|
+
"elements": [
|
|
53
|
+
{
|
|
54
|
+
"type": "Label",
|
|
55
|
+
"text": "A fixed-length code: the same password, drawn one character per box"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "Control",
|
|
59
|
+
"scope": "#/properties/verificationCode",
|
|
60
|
+
"options": {
|
|
61
|
+
"variant": "otp"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "Control",
|
|
66
|
+
"scope": "#/properties/backupCode",
|
|
67
|
+
"options": {
|
|
68
|
+
"variant": "otp"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"type": "Category",
|
|
75
|
+
"label": "Table cells",
|
|
76
|
+
"i18n": "featureNavigation.section4",
|
|
77
|
+
"elements": [
|
|
78
|
+
{
|
|
79
|
+
"type": "Label",
|
|
80
|
+
"text": "Masking survives inside a table cell"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"type": "Control",
|
|
84
|
+
"scope": "#/properties/serviceAccounts",
|
|
85
|
+
"options": {
|
|
86
|
+
"table": true
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Example: pre-touch error filtering
|
|
2
|
+
|
|
3
|
+
**Example ID:** `pre-touch-errors`\
|
|
4
|
+
**Demo entry:** **Spec: Pre-touch error filtering** (`#spec-pre-touch-errors`)\
|
|
5
|
+
**Domain:** supplier onboarding\
|
|
6
|
+
**Specs covered:**
|
|
7
|
+
|
|
8
|
+
- [— Error-message filtering before touch](../../docs/spec.md#157-pre-touch-error-filtering)
|
|
9
|
+
- [honest rendering](../../docs/spec.md#157-pre-touch-error-filtering)
|
|
10
|
+
|
|
11
|
+
A form where **nothing has been filled in yet**, so every required field is
|
|
12
|
+
already complaining. That is the situation the option exists for: a form that
|
|
13
|
+
greets a user with seven errors they have not had a chance to cause.
|
|
14
|
+
|
|
15
|
+
Turning on **Enable Filter Errors Before Touch** in the settings panel hides the
|
|
16
|
+
*required* messages until the user has actually visited each field — and leaves
|
|
17
|
+
every other error alone, because those describe something the user did.
|
|
18
|
+
|
|
19
|
+
## Files
|
|
20
|
+
|
|
21
|
+
| File | Role |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| `schema.json` | Four required properties, plus errors of three other kinds so filtering can be seen to be selective. |
|
|
24
|
+
| `uischema.json` | One control opts out with `options.enableFilterErrorsBeforeTouch: false`. |
|
|
25
|
+
| `data.json` | Deliberately incomplete: three required properties absent, one malformed value, one short string, one short array. |
|
|
26
|
+
| `config.json` | `filterErrorKeywordsBeforeTouch: ["required"]` — the keyword list, with filtering itself left **off** so the errors show first. |
|
|
27
|
+
| `translations.json` | English and Bulgarian for every message involved. |
|
|
28
|
+
|
|
29
|
+
No `uischemas.json`: the array's items use the generated form.
|
|
30
|
+
|
|
31
|
+
## Validation state
|
|
32
|
+
|
|
33
|
+
Validated with Ajv (`allErrors`, `strict: false`), the supplied data is
|
|
34
|
+
**invalid**, with exactly seven errors:
|
|
35
|
+
|
|
36
|
+
| Keyword | Path | Message |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| `required` | `/` | must have required property 'legalName' |
|
|
39
|
+
| `required` | `/` | must have required property 'contactEmail' |
|
|
40
|
+
| `required` | `/` | must have required property 'internalCode' |
|
|
41
|
+
| `required` | `/offices/0` | must have required property 'city' |
|
|
42
|
+
| `pattern` | `/memberNumber` | must match pattern "^[0-9]{7}$" |
|
|
43
|
+
| `minLength` | `/notes` | must NOT have fewer than 10 characters |
|
|
44
|
+
| `minItems` | `/offices` | must NOT have fewer than 2 items |
|
|
45
|
+
|
|
46
|
+
Four `required` and three that are not. That split is the whole point of the
|
|
47
|
+
fixture: a filter that hid all seven would be indistinguishable from one that
|
|
48
|
+
hid the right four.
|
|
49
|
+
|
|
50
|
+
`membershipExpiry` is absent and **not** required, so it contributes nothing —
|
|
51
|
+
the control that should be quiet throughout.
|
|
52
|
+
|
|
53
|
+
## Expected behaviour
|
|
54
|
+
|
|
55
|
+
### With filtering off, which is the default
|
|
56
|
+
|
|
57
|
+
Everything above is on screen from the first render. **Legal name**, **Contact
|
|
58
|
+
email** and **Internal code** each say they are required; **Member number** says
|
|
59
|
+
its format is wrong; **Notes** asks for ten characters; **Offices** asks for
|
|
60
|
+
two entries and its one item asks for a city.
|
|
61
|
+
|
|
62
|
+
`filterErrorKeywordsBeforeTouch` is set in `config.json` and does nothing,
|
|
63
|
+
because it is "ignored when filtering is disabled".
|
|
64
|
+
|
|
65
|
+
### Turn on Enable Filter Errors Before Touch
|
|
66
|
+
|
|
67
|
+
The three top-level **required** messages disappear. Still on screen:
|
|
68
|
+
|
|
69
|
+
- **Member number** — a `pattern` error. The user typed `12ab`; that is not a
|
|
70
|
+
message about something they have yet to do.
|
|
71
|
+
- **Notes** — a `minLength` error, for the same reason.
|
|
72
|
+
- **Offices** — a `minItems` error on the array itself.
|
|
73
|
+
- **Internal code** — its control sets
|
|
74
|
+
`options.enableFilterErrorsBeforeTouch: false`, and a per-control option
|
|
75
|
+
overrides the global config.
|
|
76
|
+
|
|
77
|
+
### Touch is blur, not focus
|
|
78
|
+
|
|
79
|
+
**Click into Legal name and click out again without typing.** The required
|
|
80
|
+
message comes back. "The control becomes touched on blur: receiving focus alone
|
|
81
|
+
is insufficient, and leaving the control counts even if the user did not change
|
|
82
|
+
its data."
|
|
83
|
+
|
|
84
|
+
**Click into Contact email and stop there.** Nothing reappears while the cursor
|
|
85
|
+
is still in the field — focus alone is not touch.
|
|
86
|
+
|
|
87
|
+
Once touched, a control shows whatever the active `validationMode` permits,
|
|
88
|
+
with no further keyword filtering. Touching is one-way: it is not undone by
|
|
89
|
+
typing, clearing the field, or the value becoming valid and invalid again.
|
|
90
|
+
|
|
91
|
+
### Clear the keyword list
|
|
92
|
+
|
|
93
|
+
Empty **Filter Error Keywords Before Touch** while filtering stays on. Now
|
|
94
|
+
*every* untouched control's error text is suppressed — **Member number**'s
|
|
95
|
+
`pattern` and **Notes**'s `minLength` go too — because "an absent or empty
|
|
96
|
+
array suppresses all otherwise displayable control error text before touch".
|
|
97
|
+
|
|
98
|
+
**Offices** keeps its `minItems` error: that one belongs to the array, and
|
|
99
|
+
arrays are not part of this feature (see below).
|
|
100
|
+
|
|
101
|
+
Put `required` back and only the required messages hide again.
|
|
102
|
+
|
|
103
|
+
### The form is still invalid
|
|
104
|
+
|
|
105
|
+
This is presentation only. While the required messages are hidden:
|
|
106
|
+
|
|
107
|
+
- the form's validity is unchanged — it is invalid, and anything reading
|
|
108
|
+
validity sees that;
|
|
109
|
+
- the structured errors are unchanged, so a host collecting them gets all seven;
|
|
110
|
+
- no data is modified and no validation is suspended.
|
|
111
|
+
|
|
112
|
+
**Check it:** the container validation indicators and any validity readout stay
|
|
113
|
+
in their error state while the individual messages are hidden. A filter that
|
|
114
|
+
made the form look valid would be a different and much worse feature.
|
|
115
|
+
|
|
116
|
+
### It does not make hidden errors appear
|
|
117
|
+
|
|
118
|
+
Switch **Validation mode** to `ValidateAndHide` and turn filtering **off**.
|
|
119
|
+
Nothing appears: disabling the filter "restores ordinary presentation subject to
|
|
120
|
+
validationMode; it does not force core errors to appear under ValidateAndHide or
|
|
121
|
+
NoValidation." The filter can only ever subtract.
|
|
122
|
+
|
|
123
|
+
### Arrays: the item's fields filter, the summary does not
|
|
124
|
+
|
|
125
|
+
**Offices** carries a `minItems` error of its own and a child `required`
|
|
126
|
+
error underneath.
|
|
127
|
+
|
|
128
|
+
**The child `city` field filters like any other control** — its required
|
|
129
|
+
message is hidden until you blur it, because it is an ordinary control inside
|
|
130
|
+
the item form.
|
|
131
|
+
|
|
132
|
+
**The array's own `minItems` error is not filtered**, and neither is the
|
|
133
|
+
child-error summary in the array header. The specification treats summary
|
|
134
|
+
participation as a separate, per-renderer question — "document supported
|
|
135
|
+
summary behavior and runtime touch-state lifecycle rather than assuming every
|
|
136
|
+
array renderer shares an implementation". Hosts must declare their supported
|
|
137
|
+
summary behavior.
|
|
138
|
+
|
|
139
|
+
So the honest statement is: filtering here is a **control-level** feature. An
|
|
140
|
+
array header keeps saying what is wrong beneath it, which is arguably what a
|
|
141
|
+
summary is for.
|
|
142
|
+
|
|
143
|
+
### Localization
|
|
144
|
+
|
|
145
|
+
**Switch the demo to Bulgarian.** Every message that appears — and every one
|
|
146
|
+
that reappears after touch — is translated. Filtering decides *whether* a
|
|
147
|
+
message is shown, never which language it is in.
|
|
148
|
+
|
|
149
|
+
## Fallback behaviour
|
|
150
|
+
|
|
151
|
+
| Situation | Result |
|
|
152
|
+
| --- | --- |
|
|
153
|
+
| `enableFilterErrorsBeforeTouch` absent | False. Ordinary presentation. |
|
|
154
|
+
| Filtering on, `filterErrorKeywordsBeforeTouch` absent or `[]` | All pre-touch control error text is suppressed. |
|
|
155
|
+
| Filtering off, keywords set | Keywords ignored. |
|
|
156
|
+
| A control sets the option | It overrides the global config, in either direction. |
|
|
157
|
+
| A control touched, filtering still on | That control filters nothing any more. |
|
|
158
|
+
| An error whose keyword is not listed | Displayed, even before touch. |
|
|
159
|
+
| A host-supplied `additionalError` | Filtered by the same keyword rules; a nonmatching one is not lost because a matching core error was suppressed. |
|
|
160
|
+
| Any of the above | Validity, structured errors and data are untouched. |
|
|
161
|
+
|
|
162
|
+
## Conformance scope
|
|
163
|
+
|
|
164
|
+
This walkthrough describes the portable contract. Renderer support must be checked
|
|
165
|
+
by a host adapter; the package validates the authored assets, not live UI behavior.
|
|
166
|
+
|
|
167
|
+
## Standalone host setup
|
|
168
|
+
|
|
169
|
+
Load the JSON assets listed in [the catalog](../catalog.json) into a host
|
|
170
|
+
with the relevant renderer capabilities. No framework registration module is
|
|
171
|
+
required by this package.
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## Feature navigation
|
|
175
|
+
|
|
176
|
+
Explore one feature at a time using the tabs: **Required fields**, **Field override**, **Other validation**, **Collection summary**. Tab titles are localized in English and Bulgarian. The tabs share the existing form data.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"title": "Supplier onboarding",
|
|
4
|
+
"required": ["legalName", "contactEmail", "memberNumber", "internalCode"],
|
|
5
|
+
"properties": {
|
|
6
|
+
"legalName": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"title": "Legal name",
|
|
9
|
+
"description": "Required and absent: the only error on it is a required one.",
|
|
10
|
+
"minLength": 2
|
|
11
|
+
},
|
|
12
|
+
"contactEmail": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"format": "email",
|
|
15
|
+
"title": "Contact email",
|
|
16
|
+
"description": "Also required and absent."
|
|
17
|
+
},
|
|
18
|
+
"memberNumber": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"title": "Member number",
|
|
21
|
+
"description": "Required and present, but malformed: a pattern error, not a required one.",
|
|
22
|
+
"pattern": "^[0-9]{7}$"
|
|
23
|
+
},
|
|
24
|
+
"internalCode": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"title": "Internal code",
|
|
27
|
+
"description": "Required and absent, with filtering switched off on the control itself."
|
|
28
|
+
},
|
|
29
|
+
"notes": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"title": "Notes",
|
|
32
|
+
"description": "Not required. Too short, so it carries a minLength error.",
|
|
33
|
+
"minLength": 10
|
|
34
|
+
},
|
|
35
|
+
"membershipExpiry": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"format": "date",
|
|
38
|
+
"title": "Membership expiry",
|
|
39
|
+
"description": "Not required and absent: no error at all."
|
|
40
|
+
},
|
|
41
|
+
"offices": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"title": "Offices",
|
|
44
|
+
"description": "Two are required, and the one present is missing its city.",
|
|
45
|
+
"minItems": 2,
|
|
46
|
+
"items": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": ["city"],
|
|
49
|
+
"properties": {
|
|
50
|
+
"city": { "type": "string", "title": "City" },
|
|
51
|
+
"code": { "type": "string", "title": "Code" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"error.required": "This field is required.",
|
|
4
|
+
"error.pattern": "Check the format of this value.",
|
|
5
|
+
"error.minLength": "Enter at least {limit} characters.",
|
|
6
|
+
"error.minItems": "Add at least {limit} entries.",
|
|
7
|
+
"memberNumber.error.pattern": "A member number is exactly seven digits.",
|
|
8
|
+
"contactEmail.error.format": "Enter an address we can reach you at.",
|
|
9
|
+
"control.clearValue": "Clear value",
|
|
10
|
+
"featureNavigation.section1.label": "Required fields",
|
|
11
|
+
"featureNavigation.section2.label": "Field override",
|
|
12
|
+
"featureNavigation.section3.label": "Other validation",
|
|
13
|
+
"featureNavigation.section4.label": "Collection summary",
|
|
14
|
+
"legalName.label": "Legal name",
|
|
15
|
+
"legalName.description": "Required and absent: the only error on it is a required one.",
|
|
16
|
+
"contactEmail.label": "Contact email",
|
|
17
|
+
"contactEmail.description": "Also required and absent.",
|
|
18
|
+
"memberNumber.label": "Member number",
|
|
19
|
+
"memberNumber.description": "Required and present, but malformed: a pattern error, not a required one.",
|
|
20
|
+
"internalCode.label": "Internal code",
|
|
21
|
+
"internalCode.description": "Required and absent, with filtering switched off on the control itself.",
|
|
22
|
+
"notes.label": "Notes",
|
|
23
|
+
"notes.description": "Not required. Too short, so it carries a minLength error.",
|
|
24
|
+
"membershipExpiry.label": "Membership expiry",
|
|
25
|
+
"membershipExpiry.description": "Not required and absent: no error at all.",
|
|
26
|
+
"offices.label": "Offices",
|
|
27
|
+
"offices.description": "Two are required, and the one present is missing its city.",
|
|
28
|
+
"offices.city.label": "City",
|
|
29
|
+
"offices.code.label": "Code",
|
|
30
|
+
"specPreTouch.ui.elements.0.elements.0.elements.0.text": "Every error below is visible. Turn on Enable Filter Errors Before Touch to hide only the required ones.",
|
|
31
|
+
"specPreTouch.ui.elements.0.elements.1.elements.0.text": "This one opts out, so its required error stays visible either way.",
|
|
32
|
+
"specPreTouch.ui.elements.0.elements.2.elements.0.text": "Errors that are not required errors",
|
|
33
|
+
"specPreTouch.ui.elements.0.elements.3.elements.0.text": "A summary over children that can be touched"
|
|
34
|
+
},
|
|
35
|
+
"bg": {
|
|
36
|
+
"error.required": "Полето е задължително.",
|
|
37
|
+
"error.pattern": "Проверете формата на тази стойност.",
|
|
38
|
+
"error.minLength": "Въведете поне {limit} знака.",
|
|
39
|
+
"error.minItems": "Добавете поне {limit} записа.",
|
|
40
|
+
"memberNumber.error.pattern": "Членският номер е точно седем цифри.",
|
|
41
|
+
"contactEmail.error.format": "Въведете адрес, на който можем да се свържем с вас.",
|
|
42
|
+
"control.clearValue": "Изчистване на стойността",
|
|
43
|
+
"featureNavigation.section1.label": "Задължителни полета",
|
|
44
|
+
"featureNavigation.section2.label": "Настройка на поле",
|
|
45
|
+
"featureNavigation.section3.label": "Друга валидация",
|
|
46
|
+
"featureNavigation.section4.label": "Обобщение на колекция",
|
|
47
|
+
"legalName.label": "Юридическо име",
|
|
48
|
+
"legalName.description": "Задължително и липсващо: единствената грешка е за задължително поле.",
|
|
49
|
+
"contactEmail.label": "Имейл за контакт",
|
|
50
|
+
"contactEmail.description": "Също е задължително и липсва.",
|
|
51
|
+
"memberNumber.label": "Членски номер",
|
|
52
|
+
"memberNumber.description": "Задължително и попълнено, но с неправилен формат: грешката е за шаблона.",
|
|
53
|
+
"internalCode.label": "Вътрешен код",
|
|
54
|
+
"internalCode.description": "Задължително и липсващо, с изключено филтриране за самото поле.",
|
|
55
|
+
"notes.label": "Бележки",
|
|
56
|
+
"notes.description": "Незадължително. Твърде кратко, затова има грешка за минимална дължина.",
|
|
57
|
+
"membershipExpiry.label": "Край на членството",
|
|
58
|
+
"membershipExpiry.description": "Незадължително и липсващо: няма грешка.",
|
|
59
|
+
"offices.label": "Офиси",
|
|
60
|
+
"offices.description": "Необходими са два офиса, а в добавения липсва град.",
|
|
61
|
+
"offices.city.label": "Град",
|
|
62
|
+
"offices.code.label": "Код",
|
|
63
|
+
"specPreTouch.ui.elements.0.elements.0.elements.0.text": "Всички грешки по-долу са видими. Включете филтрирането на грешки преди посещение на полето, за да скриете само тези за задължителни полета.",
|
|
64
|
+
"specPreTouch.ui.elements.0.elements.1.elements.0.text": "За това поле филтрирането е изключено, затова грешката за задължително поле остава видима.",
|
|
65
|
+
"specPreTouch.ui.elements.0.elements.2.elements.0.text": "Грешки, които не са за задължителни полета",
|
|
66
|
+
"specPreTouch.ui.elements.0.elements.3.elements.0.text": "Обобщение на вложени полета, които могат да бъдат посетени"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "VerticalLayout",
|
|
3
|
+
"elements": [
|
|
4
|
+
{
|
|
5
|
+
"type": "Categorization",
|
|
6
|
+
"elements": [
|
|
7
|
+
{
|
|
8
|
+
"type": "Category",
|
|
9
|
+
"label": "Required fields",
|
|
10
|
+
"i18n": "featureNavigation.section1",
|
|
11
|
+
"elements": [
|
|
12
|
+
{
|
|
13
|
+
"type": "Label",
|
|
14
|
+
"text": "Every error below is visible. Turn on Enable Filter Errors Before Touch to hide only the required ones."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"type": "Control",
|
|
18
|
+
"scope": "#/properties/legalName"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "Control",
|
|
22
|
+
"scope": "#/properties/contactEmail"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"type": "Control",
|
|
26
|
+
"scope": "#/properties/memberNumber"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "Category",
|
|
32
|
+
"label": "Field override",
|
|
33
|
+
"i18n": "featureNavigation.section2",
|
|
34
|
+
"elements": [
|
|
35
|
+
{
|
|
36
|
+
"type": "Label",
|
|
37
|
+
"text": "This one opts out, so its required error stays visible either way."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "Control",
|
|
41
|
+
"scope": "#/properties/internalCode",
|
|
42
|
+
"options": {
|
|
43
|
+
"enableFilterErrorsBeforeTouch": false
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "Category",
|
|
50
|
+
"label": "Other validation",
|
|
51
|
+
"i18n": "featureNavigation.section3",
|
|
52
|
+
"elements": [
|
|
53
|
+
{
|
|
54
|
+
"type": "Label",
|
|
55
|
+
"text": "Errors that are not required errors"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "Control",
|
|
59
|
+
"scope": "#/properties/notes"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"type": "Control",
|
|
63
|
+
"scope": "#/properties/membershipExpiry"
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"type": "Category",
|
|
69
|
+
"label": "Collection summary",
|
|
70
|
+
"i18n": "featureNavigation.section4",
|
|
71
|
+
"elements": [
|
|
72
|
+
{
|
|
73
|
+
"type": "Label",
|
|
74
|
+
"text": "A summary over children that can be touched"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"type": "Control",
|
|
78
|
+
"scope": "#/properties/offices"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Example: presentation elements
|
|
2
|
+
|
|
3
|
+
**Example ID:** `presentation`\
|
|
4
|
+
**Demo entry:** **Spec: Presentation elements** (`#spec-presentation`)\
|
|
5
|
+
**Domain:** a course handbook page\
|
|
6
|
+
**Specs covered:**
|
|
7
|
+
|
|
8
|
+
- [ImageView, Separator and Link](../../docs/spec.md#13-imageview-separator-link-and-templates)
|
|
9
|
+
- [Wrap, defaults, splitter and Spacer](../../docs/spec.md#13-imageview-separator-link-and-templates)
|
|
10
|
+
- [URL and extension security configuration](../../docs/spec.md#13-imageview-separator-link-and-templates)
|
|
11
|
+
- [When a selection writes, and when it only displays](../../docs/spec.md#13-imageview-separator-link-and-templates)
|
|
12
|
+
|
|
13
|
+
The elements that read nothing and write nothing: **ImageView**, **Link**,
|
|
14
|
+
**Spacer**, **Separator** and **Label**. They are the least interesting
|
|
15
|
+
elements in the model and the easiest to get quietly wrong, because a mistake
|
|
16
|
+
shows up as an absence.
|
|
17
|
+
|
|
18
|
+
## Files
|
|
19
|
+
|
|
20
|
+
| File | Role |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `schema.json` | Four properties: two to bind images and text to, one to hide with, one for the layout row. |
|
|
23
|
+
| `uischema.json` | A `Categorization`, one tab per element family. |
|
|
24
|
+
| `data.json` | Carries an inline badge image, so `scope` has something to resolve. |
|
|
25
|
+
| `config.json` | `allowImageDataUrls: true` — see below. |
|
|
26
|
+
| `translations.json` | English and Bulgarian. |
|
|
27
|
+
|
|
28
|
+
## ImageView
|
|
29
|
+
|
|
30
|
+
**`src`, `scope` and `alt` are top-level fields**, not options:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{ "type": "ImageView", "src": "/images/logo.png", "alt": "Company" }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
At least one of `src` and `scope` is required, and they are not alternatives
|
|
37
|
+
for one another. A defined `src` wins outright — including `""`, which is how
|
|
38
|
+
an author says "no image here" without deleting the element. An invalid `src`
|
|
39
|
+
does **not** fall through to `scope`, because that would display a different
|
|
40
|
+
image than the one that was named.
|
|
41
|
+
|
|
42
|
+
The second image in the tab is bound instead:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{ "type": "ImageView", "scope": "#/properties/badgeImage", "alt": "Course completion badge" }
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Clear the **Badge image URL** field and the image disappears without
|
|
49
|
+
complaint — "empty or missing source data displays no image". Type something
|
|
50
|
+
that is not a URL and it stays gone, with a diagnostic: a non-string value is
|
|
51
|
+
reported rather than coerced.
|
|
52
|
+
|
|
53
|
+
The third image has `alt: ""`. That is the documented way to declare an image
|
|
54
|
+
decorative, and a screen reader skips it. A **missing** `alt` is a different
|
|
55
|
+
statement, and is reported — the image still renders, because withholding
|
|
56
|
+
content over a missing annotation helps nobody.
|
|
57
|
+
|
|
58
|
+
### Why this example needs a config
|
|
59
|
+
|
|
60
|
+
`config.json` sets `allowImageDataUrls: true`. The images here are inline
|
|
61
|
+
SVG `data:` URLs so the example needs no network, and inline image payloads
|
|
62
|
+
are **off by default**: they bypass whatever `img-src` allow-list the host
|
|
63
|
+
maintains. Remove the flag and the images are refused, with a diagnostic
|
|
64
|
+
naming the source.
|
|
65
|
+
|
|
66
|
+
The flag opens inline *images* only. A `data:` URL of any other media type
|
|
67
|
+
stays refused however it is used, so it cannot become a way to smuggle in a
|
|
68
|
+
document.
|
|
69
|
+
|
|
70
|
+
## Link
|
|
71
|
+
|
|
72
|
+
A Link navigates. A Button invokes a command — they are not interchangeable,
|
|
73
|
+
and a renderer may style a Button to look like a link without becoming one.
|
|
74
|
+
|
|
75
|
+
| Element | Result |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `href: "https://example.com/courses"` | An ordinary anchor. |
|
|
78
|
+
| `target: "_blank"` | `rel="noopener noreferrer"` is added. |
|
|
79
|
+
| `href: ""` | Plain, non-navigating text. |
|
|
80
|
+
| `href: "javascript:alert(1)"` | Plain, non-navigating text. |
|
|
81
|
+
|
|
82
|
+
`noopener` is a **MUST**: without it the opened page receives a handle on this
|
|
83
|
+
one and can navigate the form away. `noreferrer` is a SHOULD, and is added.
|
|
84
|
+
An author-supplied `rel` is kept, and these are added to it.
|
|
85
|
+
|
|
86
|
+
The last two rows are the same behaviour for two different reasons. An empty
|
|
87
|
+
href is legitimate and renders "plain semantics rather than inventing a
|
|
88
|
+
destination"; a refused scheme is treated identically, so the label stays
|
|
89
|
+
readable and nothing becomes clickable.
|
|
90
|
+
|
|
91
|
+
## Spacer and Separator
|
|
92
|
+
|
|
93
|
+
**`size` is a top-level field on Spacer**, defaulting to 32. The tab shows
|
|
94
|
+
the default and an explicit 64.
|
|
95
|
+
|
|
96
|
+
**`options.vertical` is Separator's one orientation encoding**, following the
|
|
97
|
+
project convention rather than a JSON Forms core option. The vertical
|
|
98
|
+
separator in the row also carries `aria-orientation="vertical"`, because an
|
|
99
|
+
`<hr>` has an implicit `separator` role whose orientation defaults to
|
|
100
|
+
horizontal — without it a screen reader describes two side-by-side sections as
|
|
101
|
+
stacked.
|
|
102
|
+
|
|
103
|
+
A vertical separator takes its extent from the layout and supplies none of its
|
|
104
|
+
own, which is why it appears inside a `HorizontalLayout` here. On its own in a
|
|
105
|
+
column it would have no height to fill.
|
|
106
|
+
|
|
107
|
+
## Expected behaviour
|
|
108
|
+
|
|
109
|
+
| Action | Result |
|
|
110
|
+
| --- | --- |
|
|
111
|
+
| Turn off **Show the banner** | The banner goes; the rule governs it like any element. |
|
|
112
|
+
| Clear **Badge image URL** | The bound image goes, with no message. |
|
|
113
|
+
| Open the Link tab | Two anchors, two pieces of plain text. |
|
|
114
|
+
| Inspect the `_blank` link | `rel="noopener noreferrer"`. |
|
|
115
|
+
| Edit anything | No presentation element reacts, because none of them reads the data — except the bound image, which is the one that does. |
|
|
116
|
+
|
|
117
|
+
## Fallback behaviour
|
|
118
|
+
|
|
119
|
+
| Situation | Result |
|
|
120
|
+
| --- | --- |
|
|
121
|
+
| `src` and `scope` both absent | `image.noSource`. |
|
|
122
|
+
| `scope` points at a non-string schema | `image.scopeNotString`. |
|
|
123
|
+
| Bound value is an object or a number | `image.nonStringSource` — never coerced. |
|
|
124
|
+
| `alt` omitted | `image.missingAlt`, and the image still renders. |
|
|
125
|
+
| Any source the URL policy refuses | `image.urlRefused`, and no image. |
|
|
126
|
+
| `options.src` / `options.alt` | Still read, below the top-level fields. |
|
|
127
|
+
|
|
128
|
+
## Conformance scope
|
|
129
|
+
|
|
130
|
+
This walkthrough describes the portable contract. Renderer support must be checked
|
|
131
|
+
by a host adapter; the package validates the authored assets, not live UI behavior.
|
|
132
|
+
|
|
133
|
+
## Link localization and zero spacing
|
|
134
|
+
|
|
135
|
+
The Links tab also includes a relative handbook link, a documentation link in
|
|
136
|
+
a new tab, and a `mailto:` link. Each has an explicit `i18n` prefix and matching
|
|
137
|
+
English/Bulgarian catalog entries. Change locale to compare them with the
|
|
138
|
+
unprefixed **Untranslated link**, which keeps its authored label. These are
|
|
139
|
+
example destinations, not application routes supplied by the demo.
|
|
140
|
+
|
|
141
|
+
The spacing tab ends with `size: 0`. It contributes no spacer height, unlike
|
|
142
|
+
an omitted size, which uses the default. These presentation elements do not
|
|
143
|
+
change the fixture's validation state.
|
|
144
|
+
|
|
145
|
+
## Standalone host setup
|
|
146
|
+
|
|
147
|
+
Load the JSON assets listed in [the catalog](../catalog.json) into the host form.
|
|
148
|
+
No custom registry hooks are required.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"courseName": "Introduction to accessible forms",
|
|
3
|
+
"badgeImage": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2NDAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgNjQwIDEyMCI+PHJlY3Qgd2lkdGg9IjY0MCIgaGVpZ2h0PSIxMjAiIHJ4PSIxMiIgZmlsbD0iIzE2NjUzNCIvPjxjaXJjbGUgY3g9IjYwIiBjeT0iNjAiIHI9IjI4IiBmaWxsPSIjMzhiZGY4Ii8+PHRleHQgeD0iMTEwIiB5PSI3MCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMjgiIGZpbGw9IndoaXRlIj5Db21wbGV0ZWQ8L3RleHQ+PC9zdmc+",
|
|
4
|
+
"notes": "Bring a laptop.",
|
|
5
|
+
"showBanner": true
|
|
6
|
+
}
|