@chobantonov/jsonforms-extended-spec 0.0.0-stage → 0.2.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 +2169 -0
- package/conformance/behavior.json +731 -0
- package/conformance/config-consumption.json +1531 -0
- package/conformance/expected-invalid.json +20 -0
- package/docs/audit.md +150 -0
- package/docs/conditional-fields.md +80 -0
- package/docs/draft-07-visual-support.md +43 -0
- package/docs/external-resources-proposal.md +536 -0
- package/docs/implementation-guide.md +180 -0
- package/docs/implementation-pitfalls.md +802 -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 +8321 -0
- package/docs/todo.md +149 -0
- package/examples/README.md +121 -0
- package/examples/additional-errors/README.md +169 -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 +188 -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 +151 -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 +19 -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 +30 -0
- package/examples/conditional-fields/uischema.json +71 -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 +200 -0
- package/examples/label-interpolation/config.json +8 -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 +375 -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 +77 -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 +327 -0
- package/schemas/jsonforms-extended-uischema.schema.json +1923 -0
- package/schemas/jsonforms-rule.schema.json +104 -0
- package/schemas/jsonforms-uischema.schema.json +1421 -0
- package/typescript/README.md +540 -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 +376 -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 +419 -0
- package/typescript/src/authoring/schemaTypes.ts +143 -0
- package/typescript/src/index.ts +4 -0
- package/typescript/test/schemaContract.test.ts +626 -0
- package/typescript/test/tsconfig.json +10 -0
- package/typescript/test/typedAuthoring.test.ts +140 -0
- package/typescript/test/typedAuthoringCoverage.test.ts +145 -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,150 @@
|
|
|
1
|
+
# Example: array choices and tokens
|
|
2
|
+
|
|
3
|
+
**Example ID:** `array-choices`\
|
|
4
|
+
**Demo entry:** **Spec: Array choices and tokens** (`#spec-array-choices`)\
|
|
5
|
+
**Domain:** notification preferences\
|
|
6
|
+
**Specs covered:**
|
|
7
|
+
|
|
8
|
+
- [Array choices and tokens](../../docs/spec.md#1829-array-choices-and-tokens)
|
|
9
|
+
- [Multi-choice identity, applicability, and safe removal](../../docs/spec.md#1829-array-choices-and-tokens)
|
|
10
|
+
- [restrict and mutation constraints](../../docs/spec.md#1829-array-choices-and-tokens)
|
|
11
|
+
- [Honest rendering of invalid data](../../docs/spec.md#1829-array-choices-and-tokens)
|
|
12
|
+
- [Choice searchability and array-choice variants](../../docs/spec.md#1829-array-choices-and-tokens)
|
|
13
|
+
|
|
14
|
+
One array-of-choices shape, three presentations. The point of the example is
|
|
15
|
+
that **the variant changes the widget and nothing else**: the same schema, the
|
|
16
|
+
same stored values, the same bounds. What genuinely differs is whether the
|
|
17
|
+
schema narrows the items — because that, not an option, decides whether entry
|
|
18
|
+
is free.
|
|
19
|
+
|
|
20
|
+
## Files
|
|
21
|
+
|
|
22
|
+
| File | Role |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `schema.json` | Eight arrays: enum items, constant-based `oneOf` items, free strings, a repeatable array without `uniqueItems`, and one with bounds. |
|
|
25
|
+
| `uischema.json` | The same shapes with no variant, `variant: "multi-select"`, and `variant: "chips"`. |
|
|
26
|
+
| `data.json` | A repeated token, and a value the schema does not offer. |
|
|
27
|
+
| `config.json` | `showUnfocusedDescription` and `restrict`, both top level. |
|
|
28
|
+
| `translations.json` | English and Bulgarian, including the branch labels, the empty-search message and the chips hint. |
|
|
29
|
+
|
|
30
|
+
No `uischemas.json`: nothing here nests.
|
|
31
|
+
|
|
32
|
+
## What the form contains
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
Notification preferences
|
|
36
|
+
Notification channels enum items, no variant -> checkbox group
|
|
37
|
+
Alert channels same shape, multi-select -> compact selection
|
|
38
|
+
Notified teams oneOf const items -> labels from titles
|
|
39
|
+
---
|
|
40
|
+
Catalog tags free strings, chips -> open token entry
|
|
41
|
+
Scan codes no uniqueItems, chips -> "A-117" twice
|
|
42
|
+
Printed labels enum items, chips -> tokens from a fixed list
|
|
43
|
+
---
|
|
44
|
+
Office locations chips, minItems 2 / max 3 -> one value (invalid)
|
|
45
|
+
Imported preferences multi-select -> "Fax" (invalid)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Validation state
|
|
49
|
+
|
|
50
|
+
Validated with Ajv (`allErrors`, `strict: false`), the supplied data produces
|
|
51
|
+
exactly two errors:
|
|
52
|
+
|
|
53
|
+
| Instance path | Keyword | Message |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| `/bonded` | `minItems` | must NOT have fewer than 2 items |
|
|
56
|
+
| `/imported/1` | `enum` | must be equal to one of the allowed values |
|
|
57
|
+
|
|
58
|
+
The first is on the **array**, the second on the **item** — which is where each
|
|
59
|
+
belongs, and which is why the bounds error appears under the control while the
|
|
60
|
+
enum error points at one token.
|
|
61
|
+
|
|
62
|
+
**Scan codes is valid.** `["A-117", "A-117", "B-204"]` has no `uniqueItems`, so
|
|
63
|
+
the repeat is legal data, not a mistake to be tidied away.
|
|
64
|
+
|
|
65
|
+
## Expected behaviour
|
|
66
|
+
|
|
67
|
+
### One shape, three presentations
|
|
68
|
+
|
|
69
|
+
**Notification channels and Alert channels have identical schemas.** The first
|
|
70
|
+
has no variant and gets the automatic checkbox group; the second asks for
|
|
71
|
+
`multi-select` and gets a compact selector. the renderer contract: "explicit selection takes
|
|
72
|
+
precedence over automatic checkboxes", which is why the variant wins over the
|
|
73
|
+
automatic match.
|
|
74
|
+
|
|
75
|
+
**Notified teams stores constants and shows titles.** Select Operations and the
|
|
76
|
+
data holds `"ops"`. "Preserve choice value types and constant titles rather than
|
|
77
|
+
storing display labels."
|
|
78
|
+
|
|
79
|
+
### Chips, and what makes entry free
|
|
80
|
+
|
|
81
|
+
**Catalog tags takes anything.** Its items are plain strings, so the adder is a
|
|
82
|
+
text box: type a value and press Enter. Nothing is written while you type — a
|
|
83
|
+
partial token "remains a local draft until explicitly committed".
|
|
84
|
+
|
|
85
|
+
**Printed labels takes only the three it offers**, because its items carry an
|
|
86
|
+
`enum`. Same variant, different adder. the renderer contract: "the schema determines whether entry
|
|
87
|
+
is free or choice-limited; no separate free-entry option is introduced."
|
|
88
|
+
|
|
89
|
+
**Item constraints still apply to each stored value.** Catalog tags requires
|
|
90
|
+
`minLength: 2`, so a one-character token is reported — "item constraints apply
|
|
91
|
+
to each stored value, not the joined display text".
|
|
92
|
+
|
|
93
|
+
### Repeats and removal
|
|
94
|
+
|
|
95
|
+
**Scan codes holds `A-117` twice, and shows two tokens.** Close the second one
|
|
96
|
+
and the first stays. That is the whole reason the tokens are drawn here rather
|
|
97
|
+
than by a tag-mode select: a select keys its tags by value, so two equal tokens
|
|
98
|
+
are one entry to it and closing either removes both. the renderer contract requires the opposite —
|
|
99
|
+
"remove the selected occurrence when duplicates exist".
|
|
100
|
+
|
|
101
|
+
**Catalog tags has `uniqueItems`, so it refuses a repeat** rather than accepting
|
|
102
|
+
one and quietly collapsing it. Neither control ever deduplicates what was
|
|
103
|
+
already there.
|
|
104
|
+
|
|
105
|
+
### Bounds
|
|
106
|
+
|
|
107
|
+
**Office locations wants between two and three**, and has one, so it reports
|
|
108
|
+
`minItems` and its existing token cannot be removed while `restrict` is on. Add
|
|
109
|
+
a third and the adder stops. Switch `restrict` off in the Config tab to compare:
|
|
110
|
+
adding and removing are allowed and the validator reports the breach instead.
|
|
111
|
+
|
|
112
|
+
### Values the schema does not offer
|
|
113
|
+
|
|
114
|
+
**Imported preferences holds `"Fax"`.** It is shown as a selected
|
|
115
|
+
entry of its own and kept — §19, and "do not silently deduplicate, coerce, or
|
|
116
|
+
discard invalid incoming values". Removing it is an edit; nothing removes it for
|
|
117
|
+
you.
|
|
118
|
+
|
|
119
|
+
**Switch the demo to Bulgarian.** The team labels, the empty-search message and
|
|
120
|
+
the chips hint translate. The stored constants and free tokens do not: they are
|
|
121
|
+
data.
|
|
122
|
+
|
|
123
|
+
## Fallback behaviour
|
|
124
|
+
|
|
125
|
+
| Situation | Result |
|
|
126
|
+
| --- | --- |
|
|
127
|
+
| No variant on a unique enum array | The automatic checkbox group, unchanged. |
|
|
128
|
+
| `variant: "multi-select"` | Compact multiple selection. Requires `uniqueItems` and finite string choices. |
|
|
129
|
+
| `variant: "chips"` | Tokens. `uniqueItems` is optional; without it, repeats are permitted. |
|
|
130
|
+
| Chips over items with an `enum` or constant `oneOf` | A chooser instead of a text box. |
|
|
131
|
+
| Either variant over numeric or structured constants | **Not matched** — these renderers compare values and render labels as text, which is honest for strings only, so the shape is left to a renderer that can edit it. |
|
|
132
|
+
| `restrict: false` | Bounds are reported rather than enforced while editing. |
|
|
133
|
+
| A stored value outside the choices | Kept, shown, and reported. |
|
|
134
|
+
| A disabled or read-only control | No additions and no removals. |
|
|
135
|
+
|
|
136
|
+
## Conformance scope
|
|
137
|
+
|
|
138
|
+
This walkthrough describes the portable contract. Renderer support must be checked
|
|
139
|
+
by a host adapter; the package validates the authored assets, not live UI behavior.
|
|
140
|
+
|
|
141
|
+
## Standalone host setup
|
|
142
|
+
|
|
143
|
+
Load the JSON assets listed in [the catalog](../catalog.json) into a host
|
|
144
|
+
with the relevant renderer capabilities. No framework registration module is
|
|
145
|
+
required by this package.
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
## Feature navigation
|
|
149
|
+
|
|
150
|
+
Explore one feature at a time using the tabs: **Choice presentations**, **Free tokens**, **Bounds and invalid values**. Tab titles are localized in English and Bulgarian. The tabs share the existing form data.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"channels": {
|
|
5
|
+
"type": "array",
|
|
6
|
+
"title": "Notification channels",
|
|
7
|
+
"description": "No variant: the automatic checkbox group.",
|
|
8
|
+
"uniqueItems": true,
|
|
9
|
+
"items": { "type": "string", "enum": ["Email", "SMS", "Post"] }
|
|
10
|
+
},
|
|
11
|
+
"alerts": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"title": "Alert channels",
|
|
14
|
+
"description": "The same shape asked to be a multi-select instead.",
|
|
15
|
+
"uniqueItems": true,
|
|
16
|
+
"items": { "type": "string", "enum": ["Email", "SMS", "Post"] }
|
|
17
|
+
},
|
|
18
|
+
"teams": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"title": "Notified teams",
|
|
21
|
+
"description": "Branch titles are the labels; the constants are stored.",
|
|
22
|
+
"uniqueItems": true,
|
|
23
|
+
"items": {
|
|
24
|
+
"oneOf": [
|
|
25
|
+
{ "const": "eng", "title": "Engineering" },
|
|
26
|
+
{ "const": "fin", "title": "Finance" },
|
|
27
|
+
{ "const": "ops", "title": "Operations" }
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"tags": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"title": "Catalog tags",
|
|
34
|
+
"description": "Free tokens: the items have no enum, so entry is open.",
|
|
35
|
+
"uniqueItems": true,
|
|
36
|
+
"items": { "type": "string", "minLength": 2 }
|
|
37
|
+
},
|
|
38
|
+
"scans": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"title": "Scan codes",
|
|
41
|
+
"description": "No uniqueItems, so the same code may be recorded twice.",
|
|
42
|
+
"items": { "type": "string" }
|
|
43
|
+
},
|
|
44
|
+
"labels": {
|
|
45
|
+
"type": "array",
|
|
46
|
+
"title": "Printed labels",
|
|
47
|
+
"description": "Chips limited to a finite set: tokens, but not free ones.",
|
|
48
|
+
"uniqueItems": true,
|
|
49
|
+
"items": { "type": "string", "enum": ["Fragile", "Heavy", "Upright"] }
|
|
50
|
+
},
|
|
51
|
+
"bonded": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"title": "Office locations",
|
|
54
|
+
"description": "Between two and three, enforced while restrict is on.",
|
|
55
|
+
"uniqueItems": true,
|
|
56
|
+
"minItems": 2,
|
|
57
|
+
"maxItems": 3,
|
|
58
|
+
"items": { "type": "string", "enum": ["Dover", "Felixstowe", "Hull", "Tilbury"] }
|
|
59
|
+
},
|
|
60
|
+
"imported": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"title": "Imported preferences",
|
|
63
|
+
"description": "Holds a value the schema does not offer.",
|
|
64
|
+
"uniqueItems": true,
|
|
65
|
+
"items": { "type": "string", "enum": ["Email", "SMS"] }
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"teams.eng": "Engineering",
|
|
4
|
+
"teams.fin": "Finance",
|
|
5
|
+
"teams.ops": "Operations",
|
|
6
|
+
"enum.noMatches": "No matching choices",
|
|
7
|
+
"chips.addPlaceholder": "Type a value and press Enter",
|
|
8
|
+
"error.minItems": "Choose at least {limit}.",
|
|
9
|
+
"error.enum": "This value is not one of the offered choices.",
|
|
10
|
+
"featureNavigation.section1.label": "Choice presentations",
|
|
11
|
+
"featureNavigation.section2.label": "Free tokens",
|
|
12
|
+
"featureNavigation.section3.label": "Bounds and invalid values",
|
|
13
|
+
"channels.label": "Notification channels",
|
|
14
|
+
"channels.description": "No variant: the automatic checkbox group.",
|
|
15
|
+
"alerts.label": "Alert channels",
|
|
16
|
+
"alerts.description": "The same shape asked to be a multi-select instead.",
|
|
17
|
+
"teams.label": "Notified teams",
|
|
18
|
+
"teams.description": "Branch titles are the labels; the constants are stored.",
|
|
19
|
+
"tags.label": "Catalog tags",
|
|
20
|
+
"tags.description": "Free tokens: the items have no enum, so entry is open.",
|
|
21
|
+
"scans.label": "Scan codes",
|
|
22
|
+
"scans.description": "No uniqueItems, so the same code may be recorded twice.",
|
|
23
|
+
"labels.label": "Printed labels",
|
|
24
|
+
"labels.description": "Chips limited to a finite set: tokens, but not free ones.",
|
|
25
|
+
"bonded.label": "Office locations",
|
|
26
|
+
"bonded.description": "Between two and three, enforced while restrict is on.",
|
|
27
|
+
"imported.label": "Imported preferences",
|
|
28
|
+
"imported.description": "Holds a value the schema does not offer.",
|
|
29
|
+
"specArrayChoices.text0.text": "One array-of-choices shape, three presentations. Only the variant differs.",
|
|
30
|
+
"specArrayChoices.text1.text": "Chips: free tokens, repeated tokens, and limited ones",
|
|
31
|
+
"specArrayChoices.text2.text": "Bounds, and a value the schema does not offer"
|
|
32
|
+
},
|
|
33
|
+
"bg": {
|
|
34
|
+
"teams.eng": "Инженеринг",
|
|
35
|
+
"teams.fin": "Финанси",
|
|
36
|
+
"teams.ops": "Операции",
|
|
37
|
+
"enum.noMatches": "Няма съвпадащи опции",
|
|
38
|
+
"chips.addPlaceholder": "Въведете стойност и натиснете Enter",
|
|
39
|
+
"error.minItems": "Изберете поне {limit}.",
|
|
40
|
+
"error.enum": "Тази стойност не е сред предложените опции.",
|
|
41
|
+
"featureNavigation.section1.label": "Представяне на избори",
|
|
42
|
+
"featureNavigation.section2.label": "Свободни стойности",
|
|
43
|
+
"featureNavigation.section3.label": "Ограничения и невалидни стойности",
|
|
44
|
+
"channels.label": "Канали за известия",
|
|
45
|
+
"channels.description": "Без вариант: автоматичната група отметки.",
|
|
46
|
+
"alerts.label": "Канали за предупреждения",
|
|
47
|
+
"alerts.description": "Същата схема, представена като множествен избор.",
|
|
48
|
+
"teams.label": "Уведомявани екипи",
|
|
49
|
+
"teams.description": "Заглавията на вариантите са етикети; запазват се константите.",
|
|
50
|
+
"tags.label": "Етикети в каталога",
|
|
51
|
+
"tags.description": "Свободни стойности: елементите нямат изброени допустими стойности.",
|
|
52
|
+
"scans.label": "Сканирани кодове",
|
|
53
|
+
"scans.description": "Без uniqueItems един и същ код може да се въведе два пъти.",
|
|
54
|
+
"labels.label": "Печатни етикети",
|
|
55
|
+
"labels.description": "Стойности, ограничени до краен набор.",
|
|
56
|
+
"bonded.label": "Офиси",
|
|
57
|
+
"bonded.description": "Между два и три, докато ограничаването е включено.",
|
|
58
|
+
"imported.label": "Импортирани предпочитания",
|
|
59
|
+
"imported.description": "Съдържа стойност, която схемата не предлага.",
|
|
60
|
+
"specArrayChoices.text0.text": "Една схема за масив с избори, три представяния. Различава се само вариантът.",
|
|
61
|
+
"specArrayChoices.text1.text": "Етикети: свободни, повтарящи се и ограничени стойности",
|
|
62
|
+
"specArrayChoices.text2.text": "Ограничения и стойност, която схемата не предлага"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "VerticalLayout",
|
|
3
|
+
"elements": [
|
|
4
|
+
{
|
|
5
|
+
"type": "Categorization",
|
|
6
|
+
"elements": [
|
|
7
|
+
{
|
|
8
|
+
"type": "Category",
|
|
9
|
+
"label": "Choice presentations",
|
|
10
|
+
"i18n": "featureNavigation.section1",
|
|
11
|
+
"elements": [
|
|
12
|
+
{
|
|
13
|
+
"type": "Label",
|
|
14
|
+
"text": "One array-of-choices shape, three presentations. Only the variant differs."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"type": "Control",
|
|
18
|
+
"scope": "#/properties/channels"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "Control",
|
|
22
|
+
"scope": "#/properties/alerts",
|
|
23
|
+
"options": {
|
|
24
|
+
"variant": "multi-select"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "Control",
|
|
29
|
+
"scope": "#/properties/teams",
|
|
30
|
+
"options": {
|
|
31
|
+
"variant": "multi-select"
|
|
32
|
+
},
|
|
33
|
+
"i18n": "teams"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"type": "Category",
|
|
39
|
+
"label": "Free tokens",
|
|
40
|
+
"i18n": "featureNavigation.section2",
|
|
41
|
+
"elements": [
|
|
42
|
+
{
|
|
43
|
+
"type": "Label",
|
|
44
|
+
"text": "Chips: free tokens, repeated tokens, and limited ones"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "Control",
|
|
48
|
+
"scope": "#/properties/tags",
|
|
49
|
+
"options": {
|
|
50
|
+
"variant": "chips"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "Control",
|
|
55
|
+
"scope": "#/properties/scans",
|
|
56
|
+
"options": {
|
|
57
|
+
"variant": "chips"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "Control",
|
|
62
|
+
"scope": "#/properties/labels",
|
|
63
|
+
"options": {
|
|
64
|
+
"variant": "chips"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "Category",
|
|
71
|
+
"label": "Bounds and invalid values",
|
|
72
|
+
"i18n": "featureNavigation.section3",
|
|
73
|
+
"elements": [
|
|
74
|
+
{
|
|
75
|
+
"type": "Label",
|
|
76
|
+
"text": "Bounds, and a value the schema does not offer"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"type": "Control",
|
|
80
|
+
"scope": "#/properties/bonded",
|
|
81
|
+
"options": {
|
|
82
|
+
"variant": "chips"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "Control",
|
|
87
|
+
"scope": "#/properties/imported",
|
|
88
|
+
"options": {
|
|
89
|
+
"variant": "multi-select"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Example: array controls
|
|
2
|
+
|
|
3
|
+
**Example ID:** `array-controls`\
|
|
4
|
+
**Demo entry:** **Spec: Array controls** (`#spec-array-controls`)\
|
|
5
|
+
**Domain:** conference programme\
|
|
6
|
+
**Specs covered:**
|
|
7
|
+
|
|
8
|
+
- [Array tables and detail forms: baseline versus extension](../../docs/spec.md#1821-expandable-arrays-and-list-with-detail)
|
|
9
|
+
- [Shared array action options](../../docs/spec.md#1821-expandable-arrays-and-list-with-detail)
|
|
10
|
+
- [Expandable array-item forms](../../docs/spec.md#1821-expandable-arrays-and-list-with-detail)
|
|
11
|
+
- [List with detail](../../docs/spec.md#1821-expandable-arrays-and-list-with-detail)
|
|
12
|
+
- [Shared array item labels](../../docs/spec.md#1821-expandable-arrays-and-list-with-detail)
|
|
13
|
+
- [Array Add-item initialization](../../docs/spec.md#1821-expandable-arrays-and-list-with-detail)
|
|
14
|
+
- [Array-level errors and item summaries](../../docs/spec.md#1821-expandable-arrays-and-list-with-detail)
|
|
15
|
+
- [Array matching constraints: contains and matching counts](../../docs/spec.md#1821-expandable-arrays-and-list-with-detail)
|
|
16
|
+
- [AG Grid array control](../../docs/spec.md#1821-expandable-arrays-and-list-with-detail)
|
|
17
|
+
|
|
18
|
+
One schema, five presentations, one tab each. The example exists to make the
|
|
19
|
+
**selection rules** visible rather than described, because that is the part
|
|
20
|
+
that surprises people: you do not pick an array renderer by naming it, except
|
|
21
|
+
when you do.
|
|
22
|
+
|
|
23
|
+
| Tab | Array | Chosen because |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| **Table** | `sessions` | It nests a `room`, which would normally win the detail renderer — `options.table` overrides that. |
|
|
26
|
+
| **Expandable** | `speakers`, `announcements` | The items nest. **No option asks for this**; the shape decides. |
|
|
27
|
+
| **List with detail** | `sponsors` | `type: "ListWithDetail"`. An element type, not a Control option. |
|
|
28
|
+
| **AG Grid** | `tickets` | `options.variant: "ag-grid"`, naming the renderer outright. |
|
|
29
|
+
| **Add, remove and bounds** | `rounds`, `checklist`, `reviewers` | Three different ways of being told what may change. |
|
|
30
|
+
|
|
31
|
+
## Files
|
|
32
|
+
|
|
33
|
+
| File | Role |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `schema.json` | Eight arrays: flat rows, nested rows, nested arrays, bounds, and a `contains`. |
|
|
36
|
+
| `uischema.json` | The five tabs. Plain JSON throughout — nothing here is composed in TypeScript. |
|
|
37
|
+
| `data.json` | Enough to fill every presentation, and one deliberate failure (no lead reviewer). |
|
|
38
|
+
| `config.json` | `restrict: true`, which is what turns `minItems`/`maxItems` into prevention. |
|
|
39
|
+
| `translations.json` | English and Bulgarian, including the tab labels. |
|
|
40
|
+
|
|
41
|
+
## Table: an explicit request beats the ranking
|
|
42
|
+
|
|
43
|
+
`sessions` items contain a nested `room` object. Ordinary selection prefers the
|
|
44
|
+
**expandable** presentation for that shape, so a table has to be asked for:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{ "type": "Control", "scope": "#/properties/sessions",
|
|
48
|
+
"options": { "table": true, "cells": { "room": { "summary": …, "detail": … } } } }
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The nested property stays a **column**. It is not flattened and it is not
|
|
52
|
+
dropped: `cells.room` gives the column a one-line summary and a detail dialog.
|
|
53
|
+
|
|
54
|
+
`summary` is a **scoped control**, not a format string:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
"summary": { "type": "Control", "scope": "#/properties/name" }
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For an object it resolves that one property; for an array it previews up to two
|
|
61
|
+
values and adds "+N more". There is no interpolation syntax — writing
|
|
62
|
+
`"{name} · floor {floor}"` produces the literal fallback, which is how this
|
|
63
|
+
example's first draft ended up displaying `{}`.
|
|
64
|
+
|
|
65
|
+
## Expandable: two controls, opposite options
|
|
66
|
+
|
|
67
|
+
The first `speakers` control takes the defaults. The second, `announcements`,
|
|
68
|
+
inverts every one of them, so the options are visible side by side rather than
|
|
69
|
+
only described:
|
|
70
|
+
|
|
71
|
+
| Option | `speakers` | `announcements` |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| `collapsed` | default — the first item opens | `true` — everything starts closed |
|
|
74
|
+
| `collapseNewItems` | default — a new item opens | `true` — a new item stays closed |
|
|
75
|
+
| `hideAvatar` | default — the index marker shows | `true` — marker gone, index still readable |
|
|
76
|
+
| `hideArraySummaryValidation` | default — child summary shows | `true` — summary hidden, **validation unchanged** |
|
|
77
|
+
| `elementLabelProp` | `name` | `text` |
|
|
78
|
+
| `showSortButtons` | `true` — Move up/down | default — no reorder |
|
|
79
|
+
|
|
80
|
+
`elementLabelProp` is an item-relative **data path**, not a JSON pointer.
|
|
81
|
+
Headers read "Rosa Iqbal", not "Item 1".
|
|
82
|
+
|
|
83
|
+
## List with detail
|
|
84
|
+
|
|
85
|
+
Selected by `type: "ListWithDetail"`. Nothing about `sponsors`' schema asks for
|
|
86
|
+
it, and no Control option can produce it — which is the point of including it
|
|
87
|
+
beside the other four. Pick an item on the left; the form on the right edits
|
|
88
|
+
that item's own data path.
|
|
89
|
+
|
|
90
|
+
## AG Grid
|
|
91
|
+
|
|
92
|
+
`tickets` also nests, and the spec is explicit that this must not push an
|
|
93
|
+
explicitly selected grid into another presentation:
|
|
94
|
+
|
|
95
|
+
> Nested item properties must not force this explicitly selected grid into
|
|
96
|
+
> ListWithDetail or expandable-item presentation.
|
|
97
|
+
|
|
98
|
+
Two things about the grid are easy to get wrong when reading its output:
|
|
99
|
+
|
|
100
|
+
- **A scalar column is a JSON Forms cell, not text.** `code` renders an
|
|
101
|
+
`<input>` bound to the row. Looking for the value in `textContent` finds
|
|
102
|
+
nothing.
|
|
103
|
+
- **Sorting and filtering change the view, never the stored array.** While a
|
|
104
|
+
column is sorted, row dragging is *withdrawn* rather than left to mean
|
|
105
|
+
something ambiguous.
|
|
106
|
+
|
|
107
|
+
## Add, remove and bounds
|
|
108
|
+
|
|
109
|
+
Three arrays, three different reasons an action may be unavailable — which is
|
|
110
|
+
worth separating, because they are unrelated mechanisms.
|
|
111
|
+
|
|
112
|
+
| Array | Mechanism | Effect |
|
|
113
|
+
| --- | --- | --- |
|
|
114
|
+
| `rounds` | `minItems: 1`, `maxItems: 3` + `restrict` | Delete refused at one, Add refused at three. |
|
|
115
|
+
| `checklist` | `disableAdd`, `disableRemove` | Both actions gone **regardless of size**; fields stay editable. |
|
|
116
|
+
| `reviewers` | neither | Both actions available — the contrast that makes the other two mean something. |
|
|
117
|
+
|
|
118
|
+
In every case the **handler is guarded too**, not just the button. The spec
|
|
119
|
+
requires it, and a disabled button is reachable anyway through a keyboard or a
|
|
120
|
+
stale DOM node.
|
|
121
|
+
|
|
122
|
+
### What Add actually creates
|
|
123
|
+
|
|
124
|
+
`rounds` items are the spec's own worked example: a required `name` and an
|
|
125
|
+
`active` with a default. Add produces
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{ "active": true }
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
and the missing `name` **stays an error**. Initialization declares defaults; it
|
|
132
|
+
does not invent a valid item, and it is not a satisfiability solver.
|
|
133
|
+
|
|
134
|
+
### `contains`: an error that belongs to no item
|
|
135
|
+
|
|
136
|
+
`reviewers` must contain a lead:
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
"contains": {
|
|
140
|
+
"type": "object",
|
|
141
|
+
"required": ["lead"],
|
|
142
|
+
"properties": { "lead": { "const": true } }
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The `required` matters — without it, `{ "name": "Ada" }` would count as a
|
|
147
|
+
match. The failure is reported **against the array**, and it is reported for an
|
|
148
|
+
empty array too, where there is no item to hang it on.
|
|
149
|
+
|
|
150
|
+
One thing to expect when reading the raw validator output: Ajv also reports the
|
|
151
|
+
`contains` subschema's own failures at **item** paths, so a single reviewer
|
|
152
|
+
without `lead` produces three errors, not one:
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
/reviewers/0 required must have required property 'lead'
|
|
156
|
+
/reviewers contains must contain at least 1 valid item(s)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Those item-path entries are an artefact of how `contains` is evaluated, not a
|
|
160
|
+
claim that each reviewer is required to be a lead. Presentation should not
|
|
161
|
+
repeat them as if they were.
|
|
162
|
+
|
|
163
|
+
**`minContains`/`maxContains` are deliberately not used here.** They require
|
|
164
|
+
draft 2019-09 or later; this example validates under the demo's default
|
|
165
|
+
dialect, where they would be silently inert — which would make the example
|
|
166
|
+
teach something false.
|
|
167
|
+
|
|
168
|
+
## Expected behaviour
|
|
169
|
+
|
|
170
|
+
| Action | Result |
|
|
171
|
+
| --- | --- |
|
|
172
|
+
| Open **Table** | Sessions in rows; Room is a column showing "Aurora", not an inline form. |
|
|
173
|
+
| Click a Room cell | A detail dialog, not an expanding row. |
|
|
174
|
+
| Open **Expandable** | Speakers with the first item open; announcements all closed. |
|
|
175
|
+
| Edit a speaker's name | The panel header follows it. |
|
|
176
|
+
| Open **AG Grid**, sort a column | The order on screen changes; the stored array does not, and the drag handle withdraws. |
|
|
177
|
+
| Press Delete on the only round | Refused — the button is disabled and the handler declines. |
|
|
178
|
+
| Press Add on rounds three times | Two items are added as `{"active": true}`, then Add is refused. |
|
|
179
|
+
| Look at the opening checklist | No Add, no Delete, every field still editable. |
|
|
180
|
+
| Clear the lead reviewer | An array-level error appears on the array, not on a row. |
|
|
181
|
+
|
|
182
|
+
## Conformance scope
|
|
183
|
+
|
|
184
|
+
This walkthrough describes the portable contract. Renderer support must be checked
|
|
185
|
+
by a host adapter; the package validates the authored assets, not live UI behavior.
|
|
186
|
+
|
|
187
|
+
## Scalar and composite cells
|
|
188
|
+
|
|
189
|
+
The **Scalar and composite cells** tab shows the same conference staff array
|
|
190
|
+
as a table and a grid. It covers strings, integers, enum choices, colors,
|
|
191
|
+
durations, dates, times, date-times, booleans, objects and arrays. A change in
|
|
192
|
+
one view is visible in the other because both edit `staff`.
|
|
193
|
+
|
|
194
|
+
Address summaries use the street; phone summaries use the array itself.
|
|
195
|
+
Open either detail dialog, edit the draft, then cancel or apply it.
|
|
196
|
+
`cells.<property>.showEmptyButton` requests a Clear action inside the dialog;
|
|
197
|
+
clearing a draft must not commit until Apply. This supplements the existing
|
|
198
|
+
Room and Holder detail examples with an array-valued cell.
|
|
199
|
+
|
|
200
|
+
The grid supplies explicit column widths, disables filtering on composite and
|
|
201
|
+
boolean columns, and enables pagination. A page size of one makes the second
|
|
202
|
+
page visible with only two records; the selector offers 1, 2 and 10 rows.
|
|
203
|
+
`showSortButtons` requests row dragging, which is unavailable while the view is
|
|
204
|
+
sorted or filtered. Page changes and view sorting must not reorder form data.
|
|
205
|
+
|
|
206
|
+
The added staff records are schema-valid and add no initial validation errors.
|
|
207
|
+
An adapter without a matching specialized cell must preserve the stored value;
|
|
208
|
+
a fallback is not evidence that its specialized editing behavior is supported.
|
|
209
|
+
|
|
210
|
+
## Standalone host setup
|
|
211
|
+
|
|
212
|
+
Load the JSON assets listed in [the catalog](../catalog.json) into a host
|
|
213
|
+
with the relevant renderer capabilities. No framework registration module is
|
|
214
|
+
required by this package.
|
|
215
|
+
|
|
216
|
+
All array presentations enable `collapsible`. Use the header toggle to hide and
|
|
217
|
+
restore the panel body without losing data or item expansion. Set `collapsed: true`
|
|
218
|
+
to start closed; item `collapsed` remains independent.
|
|
219
|
+
|
|
220
|
+
The reviewers `contains` rule requires at least one entry with `lead: true`.
|
|
221
|
+
The field-specific `arrayControls.reviewers.error.contains` translation explains how to fix
|
|
222
|
+
that array error in English and Bulgarian, without overriding other contains
|
|
223
|
+
messages or requiring the ajv-errors plugin.
|
|
224
|
+
|
|
225
|
+
The Reviewers control explicitly declares `i18n: "arrayControls.reviewers"`,
|
|
226
|
+
so the custom error message is scoped to this example rather than the generic
|
|
227
|
+
`reviewers` data path.
|
|
228
|
+
|
|
229
|
+
## Consolidated demo coverage
|
|
230
|
+
|
|
231
|
+
Staff cells include an alpha color and a composite address with a nested horizontal layout. Both the table and grid share these cell details.
|
|
232
|
+
|
|
233
|
+
## Row and cell editing
|
|
234
|
+
|
|
235
|
+
The **Row and cell dialogs**, **Side panel**, and **Bottom panel** tabs edit the same Sessions data. Row details include Title, Track, Minutes and Room; the Room cell has an independent detail editor. Both dialog types explicitly enable `draggable`, `resizable` and `maximizable`. Drag the header, use the resize corner, and maximize/restore from the header. Dialog changes are drafts until Apply; Cancel discards them. Panel edits apply immediately. The bottom panel starts collapsed.
|
|
236
|
+
|
|
237
|
+
Acceptance: edit a Room in its cell dialog, cancel, then apply; repeat through the row dialog. Exercise geometry controls on both dialogs. Compare immediate edits in the side and bottom panels and verify sibling rows stay unchanged.
|