@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.
Files changed (366) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +126 -2
  3. package/conformance/authoring.json +2680 -0
  4. package/conformance/behavior.json +1602 -0
  5. package/conformance/config-consumption.json +1542 -0
  6. package/conformance/expected-invalid.json +20 -0
  7. package/docs/audit.md +150 -0
  8. package/docs/conditional-fields.md +122 -0
  9. package/docs/draft-07-visual-support.md +43 -0
  10. package/docs/external-resources-proposal.md +536 -0
  11. package/docs/implementation-guide.md +233 -0
  12. package/docs/implementation-pitfalls.md +968 -0
  13. package/docs/implementation-web-typescript.md +41 -0
  14. package/docs/renderer-and-demo.md +1347 -0
  15. package/docs/renderer-selection.md +99 -0
  16. package/docs/spec.md +8470 -0
  17. package/docs/todo.md +166 -0
  18. package/examples/README.md +127 -0
  19. package/examples/additional-errors/README.md +176 -0
  20. package/examples/additional-errors/config.json +3 -0
  21. package/examples/additional-errors/data.json +11 -0
  22. package/examples/additional-errors/schema.json +56 -0
  23. package/examples/additional-errors/translations.json +64 -0
  24. package/examples/additional-errors/uischema.json +158 -0
  25. package/examples/additional-items-pagination/README.md +8 -0
  26. package/examples/additional-items-pagination/config.json +10 -0
  27. package/examples/additional-items-pagination/data.json +22 -0
  28. package/examples/additional-items-pagination/schema.json +30 -0
  29. package/examples/additional-items-pagination/translations.json +16 -0
  30. package/examples/additional-items-pagination/uischema.json +39 -0
  31. package/examples/additional-properties/README.md +203 -0
  32. package/examples/additional-properties/config.json +5 -0
  33. package/examples/additional-properties/data.json +31 -0
  34. package/examples/additional-properties/schema.json +78 -0
  35. package/examples/additional-properties/translations.json +80 -0
  36. package/examples/additional-properties/uischema.json +104 -0
  37. package/examples/ag-grid/README.md +62 -0
  38. package/examples/ag-grid/config.json +14 -0
  39. package/examples/ag-grid/data.json +124 -0
  40. package/examples/ag-grid/schema.json +48 -0
  41. package/examples/ag-grid/translations.json +58 -0
  42. package/examples/ag-grid/uischema.json +671 -0
  43. package/examples/array-choices/README.md +150 -0
  44. package/examples/array-choices/config.json +4 -0
  45. package/examples/array-choices/data.json +10 -0
  46. package/examples/array-choices/schema.json +68 -0
  47. package/examples/array-choices/translations.json +64 -0
  48. package/examples/array-choices/uischema.json +97 -0
  49. package/examples/array-controls/README.md +237 -0
  50. package/examples/array-controls/config.json +4 -0
  51. package/examples/array-controls/data.json +147 -0
  52. package/examples/array-controls/schema.json +374 -0
  53. package/examples/array-controls/translations.json +186 -0
  54. package/examples/array-controls/uischema.json +685 -0
  55. package/examples/array-detail-modes/README.md +11 -0
  56. package/examples/array-detail-modes/data.json +38 -0
  57. package/examples/array-detail-modes/schema.json +89 -0
  58. package/examples/array-detail-modes/translations.json +36 -0
  59. package/examples/array-detail-modes/uischema.json +73 -0
  60. package/examples/array-detail-modes/uischemas.d.mts +2 -0
  61. package/examples/array-detail-modes/uischemas.json +15 -0
  62. package/examples/boolean-controls/README.md +109 -0
  63. package/examples/boolean-controls/config.json +3 -0
  64. package/examples/boolean-controls/data.json +27 -0
  65. package/examples/boolean-controls/schema.json +98 -0
  66. package/examples/boolean-controls/translations.json +94 -0
  67. package/examples/boolean-controls/uischema.json +126 -0
  68. package/examples/button-actions/README.md +259 -0
  69. package/examples/button-actions/config.json +7 -0
  70. package/examples/button-actions/data.json +5 -0
  71. package/examples/button-actions/host.mjs +14 -0
  72. package/examples/button-actions/schema.json +20 -0
  73. package/examples/button-actions/translations.json +60 -0
  74. package/examples/button-actions/uischema.json +179 -0
  75. package/examples/catalog.json +634 -0
  76. package/examples/categorization/README.md +132 -0
  77. package/examples/categorization/config.json +7 -0
  78. package/examples/categorization/data.json +8 -0
  79. package/examples/categorization/schema.json +29 -0
  80. package/examples/categorization/translations.json +72 -0
  81. package/examples/categorization/uischema.json +288 -0
  82. package/examples/choice-controls/README.md +136 -0
  83. package/examples/choice-controls/config.json +10 -0
  84. package/examples/choice-controls/data.json +61 -0
  85. package/examples/choice-controls/schema.json +406 -0
  86. package/examples/choice-controls/translations.json +154 -0
  87. package/examples/choice-controls/uischema.json +575 -0
  88. package/examples/choice-controls/uischemas.d.mts +2 -0
  89. package/examples/choice-controls/uischemas.json +16 -0
  90. package/examples/code-editor/README.md +74 -0
  91. package/examples/code-editor/data.json +8 -0
  92. package/examples/code-editor/schema.json +28 -0
  93. package/examples/code-editor/translations.json +20 -0
  94. package/examples/code-editor/uischema.json +77 -0
  95. package/examples/collection-pagination/README.md +5 -0
  96. package/examples/collection-pagination/config.json +1 -0
  97. package/examples/collection-pagination/data.json +64 -0
  98. package/examples/collection-pagination/schema.json +23 -0
  99. package/examples/collection-pagination/translations.json +14 -0
  100. package/examples/collection-pagination/uischema.json +14 -0
  101. package/examples/color-control/README.md +154 -0
  102. package/examples/color-control/config.json +7 -0
  103. package/examples/color-control/data.json +11 -0
  104. package/examples/color-control/schema.json +61 -0
  105. package/examples/color-control/translations.json +76 -0
  106. package/examples/color-control/uischema.json +106 -0
  107. package/examples/combinators/README.md +223 -0
  108. package/examples/combinators/config.json +9 -0
  109. package/examples/combinators/data.json +23 -0
  110. package/examples/combinators/schema.json +232 -0
  111. package/examples/combinators/translations.json +178 -0
  112. package/examples/combinators/uischema.json +158 -0
  113. package/examples/conditional-fields/README.md +27 -0
  114. package/examples/conditional-fields/config.json +5 -0
  115. package/examples/conditional-fields/data.json +7 -0
  116. package/examples/conditional-fields/schema.json +59 -0
  117. package/examples/conditional-fields/translations.json +32 -0
  118. package/examples/conditional-fields/uischema.json +131 -0
  119. package/examples/container-validation-indicator/README.md +187 -0
  120. package/examples/container-validation-indicator/config.json +9 -0
  121. package/examples/container-validation-indicator/data.json +68 -0
  122. package/examples/container-validation-indicator/schema.json +222 -0
  123. package/examples/container-validation-indicator/translations.json +120 -0
  124. package/examples/container-validation-indicator/uischema.json +98 -0
  125. package/examples/cron-control/README.md +155 -0
  126. package/examples/cron-control/data.json +15 -0
  127. package/examples/cron-control/schema.json +72 -0
  128. package/examples/cron-control/translations.json +80 -0
  129. package/examples/cron-control/uischema.json +91 -0
  130. package/examples/destructive-confirmation/README.md +210 -0
  131. package/examples/destructive-confirmation/config.json +17 -0
  132. package/examples/destructive-confirmation/data.json +86 -0
  133. package/examples/destructive-confirmation/schema.json +204 -0
  134. package/examples/destructive-confirmation/translations.json +112 -0
  135. package/examples/destructive-confirmation/uischema.json +105 -0
  136. package/examples/draft-07-metaschema/README.md +11 -0
  137. package/examples/draft-07-metaschema/config.json +3 -0
  138. package/examples/draft-07-metaschema/data.json +25 -0
  139. package/examples/draft-07-metaschema/schema.json +172 -0
  140. package/examples/draft-07-metaschema/translations.json +10 -0
  141. package/examples/draft-07-metaschema/uischema.json +14 -0
  142. package/examples/dynamic-playground/README.md +95 -0
  143. package/examples/dynamic-playground/config.json +8 -0
  144. package/examples/dynamic-playground/configuration.json +152 -0
  145. package/examples/dynamic-playground/data.json +15 -0
  146. package/examples/dynamic-playground/dynamic-uischema.json +379 -0
  147. package/examples/dynamic-playground/host.mjs +37 -0
  148. package/examples/dynamic-playground/schema.json +48 -0
  149. package/examples/dynamic-playground/translations.json +76 -0
  150. package/examples/dynamic-playground/uischema.json +36 -0
  151. package/examples/editor-details/README.md +10 -0
  152. package/examples/editor-details/data.json +18 -0
  153. package/examples/editor-details/schema.json +49 -0
  154. package/examples/editor-details/translations.json +28 -0
  155. package/examples/editor-details/uischema.json +53 -0
  156. package/examples/editor-details/uischemas.d.mts +2 -0
  157. package/examples/editor-details/uischemas.json +14 -0
  158. package/examples/file-control/README.md +108 -0
  159. package/examples/file-control/data.json +28 -0
  160. package/examples/file-control/schema.json +89 -0
  161. package/examples/file-control/translations.json +46 -0
  162. package/examples/file-control/uischema.json +152 -0
  163. package/examples/group-layout/README.md +149 -0
  164. package/examples/group-layout/config.json +10 -0
  165. package/examples/group-layout/data.json +9 -0
  166. package/examples/group-layout/schema.json +51 -0
  167. package/examples/group-layout/translations.json +62 -0
  168. package/examples/group-layout/uischema.json +249 -0
  169. package/examples/index.d.ts +17 -0
  170. package/examples/index.js +69 -0
  171. package/examples/input-adornments/README.md +68 -0
  172. package/examples/input-adornments/data.json +41 -0
  173. package/examples/input-adornments/schema.json +207 -0
  174. package/examples/input-adornments/translations.json +106 -0
  175. package/examples/input-adornments/uischema.json +695 -0
  176. package/examples/job-application/README.md +23 -0
  177. package/examples/job-application/config.json +10 -0
  178. package/examples/job-application/data.json +68 -0
  179. package/examples/job-application/schema.json +196 -0
  180. package/examples/job-application/translations.json +388 -0
  181. package/examples/job-application/uischema.json +218 -0
  182. package/examples/job-application/uischemas.json +153 -0
  183. package/examples/json-editor/README.md +28 -0
  184. package/examples/json-editor/schema.json +1 -0
  185. package/examples/json-editor/translations.json +10 -0
  186. package/examples/json-editor/uischema.json +16 -0
  187. package/examples/json-inference/README.md +33 -0
  188. package/examples/json-inference/translations.json +10 -0
  189. package/examples/json-inference/uischema.json +16 -0
  190. package/examples/kitchen-sink/README.md +86 -0
  191. package/examples/kitchen-sink/config.json +14 -0
  192. package/examples/kitchen-sink/data.json +263 -0
  193. package/examples/kitchen-sink/invalid-data.json +263 -0
  194. package/examples/kitchen-sink/schema.json +515 -0
  195. package/examples/kitchen-sink/translations.json +270 -0
  196. package/examples/kitchen-sink/uischema.json +722 -0
  197. package/examples/label-interpolation/README.md +241 -0
  198. package/examples/label-interpolation/config.json +14 -0
  199. package/examples/label-interpolation/data.json +13 -0
  200. package/examples/label-interpolation/schema.json +64 -0
  201. package/examples/label-interpolation/translations.json +94 -0
  202. package/examples/label-interpolation/uischema.json +379 -0
  203. package/examples/layout-sizing/README.md +162 -0
  204. package/examples/layout-sizing/config.json +10 -0
  205. package/examples/layout-sizing/data.json +14 -0
  206. package/examples/layout-sizing/schema.json +58 -0
  207. package/examples/layout-sizing/translations.json +42 -0
  208. package/examples/layout-sizing/uischema.json +558 -0
  209. package/examples/markup-label/README.md +109 -0
  210. package/examples/markup-label/config.json +16 -0
  211. package/examples/markup-label/data.json +5 -0
  212. package/examples/markup-label/schema.json +24 -0
  213. package/examples/markup-label/translations.json +40 -0
  214. package/examples/markup-label/uischema.json +149 -0
  215. package/examples/mixed-control/README.md +164 -0
  216. package/examples/mixed-control/config.json +11 -0
  217. package/examples/mixed-control/data.json +70 -0
  218. package/examples/mixed-control/schema.json +221 -0
  219. package/examples/mixed-control/translations.json +158 -0
  220. package/examples/mixed-control/uischema.json +211 -0
  221. package/examples/null-control/README.md +111 -0
  222. package/examples/null-control/config.json +4 -0
  223. package/examples/null-control/data.json +6 -0
  224. package/examples/null-control/schema.json +36 -0
  225. package/examples/null-control/translations.json +42 -0
  226. package/examples/null-control/uischema.json +56 -0
  227. package/examples/numeric-controls/README.md +94 -0
  228. package/examples/numeric-controls/config.json +4 -0
  229. package/examples/numeric-controls/data.json +8 -0
  230. package/examples/numeric-controls/schema.json +52 -0
  231. package/examples/numeric-controls/translations.json +56 -0
  232. package/examples/numeric-controls/uischema.json +77 -0
  233. package/examples/object-control/README.md +220 -0
  234. package/examples/object-control/config.json +4 -0
  235. package/examples/object-control/data.json +62 -0
  236. package/examples/object-control/schema.json +252 -0
  237. package/examples/object-control/translations.json +160 -0
  238. package/examples/object-control/uischema.json +275 -0
  239. package/examples/object-control/uischemas.d.mts +2 -0
  240. package/examples/object-control/uischemas.json +59 -0
  241. package/examples/password-control/README.md +119 -0
  242. package/examples/password-control/config.json +3 -0
  243. package/examples/password-control/data.json +18 -0
  244. package/examples/password-control/schema.json +65 -0
  245. package/examples/password-control/translations.json +64 -0
  246. package/examples/password-control/uischema.json +94 -0
  247. package/examples/pre-touch-errors/README.md +176 -0
  248. package/examples/pre-touch-errors/config.json +4 -0
  249. package/examples/pre-touch-errors/data.json +5 -0
  250. package/examples/pre-touch-errors/schema.json +56 -0
  251. package/examples/pre-touch-errors/translations.json +68 -0
  252. package/examples/pre-touch-errors/uischema.json +85 -0
  253. package/examples/presentation/README.md +148 -0
  254. package/examples/presentation/config.json +9 -0
  255. package/examples/presentation/data.json +6 -0
  256. package/examples/presentation/schema.json +21 -0
  257. package/examples/presentation/translations.json +64 -0
  258. package/examples/presentation/uischema.json +210 -0
  259. package/examples/property-pagination/README.md +5 -0
  260. package/examples/property-pagination/config.json +1 -0
  261. package/examples/property-pagination/data.json +17 -0
  262. package/examples/property-pagination/schema.json +14 -0
  263. package/examples/property-pagination/translations.json +10 -0
  264. package/examples/property-pagination/uischema.json +24 -0
  265. package/examples/recursive-tree/README.md +49 -0
  266. package/examples/recursive-tree/config.json +1 -0
  267. package/examples/recursive-tree/data.json +40 -0
  268. package/examples/recursive-tree/schema.json +89 -0
  269. package/examples/recursive-tree/translations.json +42 -0
  270. package/examples/recursive-tree/uischema.json +84 -0
  271. package/examples/recursive-tree/uischemas.d.mts +2 -0
  272. package/examples/recursive-tree/uischemas.json +51 -0
  273. package/examples/split-layout/README.md +123 -0
  274. package/examples/split-layout/config.json +3 -0
  275. package/examples/split-layout/data.json +13 -0
  276. package/examples/split-layout/schema.json +50 -0
  277. package/examples/split-layout/translations.json +50 -0
  278. package/examples/split-layout/uischema.json +204 -0
  279. package/examples/string-controls/README.md +159 -0
  280. package/examples/string-controls/config.json +5 -0
  281. package/examples/string-controls/data.json +13 -0
  282. package/examples/string-controls/schema.json +70 -0
  283. package/examples/string-controls/translations.json +76 -0
  284. package/examples/string-controls/uischema.json +148 -0
  285. package/examples/table-row-details/README.md +69 -0
  286. package/examples/table-row-details/config.json +7 -0
  287. package/examples/table-row-details/data.json +280 -0
  288. package/examples/table-row-details/schema.json +61 -0
  289. package/examples/table-row-details/translations.json +56 -0
  290. package/examples/table-row-details/uischema.json +1303 -0
  291. package/examples/template-layout/README.md +250 -0
  292. package/examples/template-layout/config.json +9 -0
  293. package/examples/template-layout/data.json +20 -0
  294. package/examples/template-layout/host.mjs +13 -0
  295. package/examples/template-layout/schema.json +48 -0
  296. package/examples/template-layout/translations.json +70 -0
  297. package/examples/template-layout/uischema.json +177 -0
  298. package/examples/template-slots/README.md +19 -0
  299. package/examples/template-slots/data.json +4 -0
  300. package/examples/template-slots/schema.json +11 -0
  301. package/examples/template-slots/translations.json +26 -0
  302. package/examples/template-slots/uischema.json +47 -0
  303. package/examples/template-slots/uischemas.d.mts +2 -0
  304. package/examples/template-slots/uischemas.json +56 -0
  305. package/examples/temporal-controls/README.md +325 -0
  306. package/examples/temporal-controls/data.json +44 -0
  307. package/examples/temporal-controls/schema.json +208 -0
  308. package/examples/temporal-controls/translations.json +156 -0
  309. package/examples/temporal-controls/uischema.json +297 -0
  310. package/examples/tree-max-depth/README.md +5 -0
  311. package/examples/tree-max-depth/config.json +3 -0
  312. package/examples/tree-max-depth/data.json +31 -0
  313. package/examples/tree-max-depth/schema.json +258 -0
  314. package/examples/tree-max-depth/translations.json +42 -0
  315. package/examples/tree-max-depth/uischema.json +16 -0
  316. package/examples/tree-max-depth/uischemas.d.mts +2 -0
  317. package/examples/tree-max-depth/uischemas.json +50 -0
  318. package/examples/tuple-control/README.md +335 -0
  319. package/examples/tuple-control/config.json +4 -0
  320. package/examples/tuple-control/data.json +61 -0
  321. package/examples/tuple-control/schema.json +218 -0
  322. package/examples/tuple-control/translations.json +142 -0
  323. package/examples/tuple-control/uischema.json +128 -0
  324. package/examples/tuple-control/uischemas.d.mts +2 -0
  325. package/examples/tuple-control/uischemas.json +125 -0
  326. package/examples/validator-profile/README.md +197 -0
  327. package/examples/validator-profile/config.json +9 -0
  328. package/examples/validator-profile/data.json +16 -0
  329. package/examples/validator-profile/schema.json +139 -0
  330. package/examples/validator-profile/translations.json +34 -0
  331. package/examples/validator-profile/uischema.json +59 -0
  332. package/package.json +83 -3
  333. package/provenance.json +140 -0
  334. package/schemas/README.md +82 -0
  335. package/schemas/example.schema.json +37 -0
  336. package/schemas/jsonforms-config.schema.json +427 -0
  337. package/schemas/jsonforms-dynamic-uischema.schema.json +220 -0
  338. package/schemas/jsonforms-extended-config.schema.json +332 -0
  339. package/schemas/jsonforms-extended-uischema.schema.json +1932 -0
  340. package/schemas/jsonforms-rule.schema.json +104 -0
  341. package/schemas/jsonforms-uischema.schema.json +1434 -0
  342. package/typescript/README.md +546 -0
  343. package/typescript/lib/authoring/cssLength.d.ts +33 -0
  344. package/typescript/lib/authoring/cssLength.js +25 -0
  345. package/typescript/lib/authoring/dynamic.d.ts +73 -0
  346. package/typescript/lib/authoring/dynamic.js +8 -0
  347. package/typescript/lib/authoring/forSchema.d.ts +385 -0
  348. package/typescript/lib/authoring/forSchema.js +84 -0
  349. package/typescript/lib/authoring/schemaTypes.d.ts +111 -0
  350. package/typescript/lib/authoring/schemaTypes.js +15 -0
  351. package/typescript/lib/index.d.ts +4 -0
  352. package/typescript/lib/index.js +20 -0
  353. package/typescript/package.json +1 -0
  354. package/typescript/src/authoring/cssLength.ts +79 -0
  355. package/typescript/src/authoring/dynamic.ts +96 -0
  356. package/typescript/src/authoring/forSchema.ts +428 -0
  357. package/typescript/src/authoring/schemaTypes.ts +143 -0
  358. package/typescript/src/index.ts +4 -0
  359. package/typescript/test/schemaContract.test.ts +638 -0
  360. package/typescript/test/tsconfig.json +10 -0
  361. package/typescript/test/typedAuthoring.test.ts +151 -0
  362. package/typescript/test/typedAuthoringCoverage.test.ts +178 -0
  363. package/typescript/test/typedAuthoringCssLength.test.ts +81 -0
  364. package/typescript/test/typedAuthoringNames.test.ts +90 -0
  365. package/typescript/test/typedDynamic.test.ts +88 -0
  366. package/typescript/tsconfig.json +15 -0
@@ -0,0 +1,132 @@
1
+ # Example: categorization — tabs, stepper and accordion
2
+
3
+ **Example ID:** `categorization`\
4
+ **Demo entry:** **Spec: Categorization: tabs, stepper, accordion** (`#spec-categorization`)\
5
+ **Domain:** equipment order\
6
+ **Specs covered:**
7
+
8
+ - [Categorization](../../docs/spec.md#86-categorization)
9
+ - [Accordion categorization](../../docs/spec.md#86-categorization)
10
+ - [Container visibility and hidden children](../../docs/spec.md#86-categorization)
11
+ - [The Categorization navigation contract](../../docs/spec.md#86-categorization)
12
+ - [Container validation indicator](../../docs/spec.md#86-categorization)
13
+
14
+ **The same four categories, rendered three ways, bound to the same data.** Type
15
+ in one and the other two follow. That is the point: which of tabs, stepper and
16
+ accordion is drawn is a presentation choice, and nothing else about the form —
17
+ navigation, visibility, validation or the section indicators — is allowed to
18
+ depend on it.
19
+
20
+ ## Files
21
+
22
+ | File | Role |
23
+ | --- | --- |
24
+ | `schema.json` | Eight properties across four subjects, with the constraints that produce the errors below. |
25
+ | `uischema.json` | One `isBusiness` control, then the same four categories as tabs, as a stepper, and as an accordion. |
26
+ | `data.json` | Deliberately invalid in two places, in two different categories. |
27
+ | `config.json` | `showUnfocusedDescription` flat; both indicators under `jsonformsExtended`. |
28
+ | `translations.json` | English and Bulgarian, including the category labels and both indicator messages. |
29
+
30
+ No `uischemas.json`: nothing here nests.
31
+
32
+ ## What the form contains
33
+
34
+ ```text
35
+ Business account [ ] <- toggles the Business category
36
+
37
+ Tabs — no variant
38
+ Contact | Planning | Notes
39
+
40
+ Stepper — variant: "stepper", showNavButtons
41
+ (1) Contact -> (2) Planning -> (3) Notes
42
+
43
+ Accordion — variant: "accordion", initial: "planning"
44
+ > Contact
45
+ v Planning <- open, because options.initial names it
46
+ > Notes
47
+ ```
48
+
49
+ `Business` is absent from all three until the toggle is on.
50
+
51
+ ## Validation state
52
+
53
+ Validated with Ajv (`allErrors`, `strict: false`), the supplied data produces
54
+ exactly two errors — deliberately one in each of two different categories:
55
+
56
+ | Instance path | Keyword | Message |
57
+ | --- | --- | --- |
58
+ | `/contactName` | `minLength` | must NOT have fewer than 3 characters |
59
+ | `/itemCount` | `maximum` | must be <= 8 |
60
+
61
+ ## Expected behaviour
62
+
63
+ **Both section indicators appear on every presentation.** Contact and Planning
64
+ carry an error marker, and every category holding data carries the dot. A
65
+ Category has no data scope of its own, so both are aggregated from the Controls
66
+ below it — through the one traversal shared with the Group's indicators.
67
+
68
+ Where they sit follows the **shape of the header**: at the end of the bar on an
69
+ accordion, matching a collapsible Group, and beside the label on a tab or a
70
+ step, which is just text with no trailing edge.
71
+
72
+ **The error marker survives being out of view.** The stepper shows one step at
73
+ a time and the accordion one panel; the marker on a step or header you are not
74
+ looking at is the whole reason the indicator exists.
75
+
76
+ **Toggle `Business account` on, then off.** The category appears in all three,
77
+ then disappears. If you select it and then toggle it off, the presentation falls
78
+ back to another visible category rather than leaving a stale panel — §8:
79
+ "when the selected category becomes hidden, select an available visible
80
+ category". Note also that the category is *hidden by its own rule*: a category
81
+ whose children are all hidden would still be shown, and there is no
82
+ `hideWhenEmpty`.
83
+
84
+ **The accordion opens on Planning.** `options.initial` names a direct Category
85
+ `name` — not its label, and not its index. Rename it to something that matches
86
+ nothing and the first category opens instead, with a console warning; the form
87
+ still works.
88
+
89
+ **Click the open accordion header.** It closes, and the accordion is left with
90
+ nothing open — collapse all three and you are looking at the form's outline.
91
+ Section 8 allows an explicit all-closed state; opening a category closes any
92
+ other open category. Two open at once is still impossible.
93
+
94
+ **Close the accordion, then toggle `Business account`.** It stays closed.
95
+ Closing is a state you chose, so the "selected category became hidden, open
96
+ another" rule must not quietly undo it.
97
+
98
+ **Type into a category, then open another.** The first keeps its value: closed
99
+ panels stay mounted, so "closing a category preserves its data and validation".
100
+
101
+ **Switch the demo to Bulgarian.** Category labels translate, because each
102
+ carries an explicit `i18n` prefix. A Category has no scope, so without one the
103
+ lookup key would be the literal English label and the catalog entry would never
104
+ be consulted.
105
+
106
+ ## Fallback behaviour
107
+
108
+ | Situation | Result |
109
+ | --- | --- |
110
+ | No `variant` | Tabs. |
111
+ | `variant` the renderer set does not know | Tabs, at rank 1. An unknown variant is not an error. |
112
+ | `initial` naming no visible category | First visible category, plus a console warning. Nothing is rendered about it — it is an authoring mistake, not something the person filling in the form can act on. |
113
+ | A category with no `name` | Selection follows its position; there is no identity to preserve across a reorder. |
114
+ | Every category hidden | No open panel and no active step, rather than a stale one. |
115
+ | Accordion closed by the reader | Stays closed until they open something, through visibility changes and data edits. |
116
+ | `showNavButtons` or `vertical` on the accordion | Ignored. §8: they "do not alter this presentation". |
117
+
118
+ ## Conformance scope
119
+
120
+ This walkthrough describes the portable contract. Renderer support must be checked
121
+ by a host adapter; the package validates the authored assets, not live UI behavior.
122
+
123
+ ## Standalone host setup
124
+
125
+ Load the JSON assets listed in [the catalog](../catalog.json) into a host
126
+ with the relevant renderer capabilities. No framework registration module is
127
+ required by this package.
128
+
129
+
130
+ ## Feature navigation
131
+
132
+ Explore one feature at a time using the tabs: **Tabs**, **Stepper**, **Accordion**. Tab titles are localized in English and Bulgarian. The tabs share the existing form data.
@@ -0,0 +1,7 @@
1
+ {
2
+ "showUnfocusedDescription": true,
3
+ "jsonformsExtended": {
4
+ "showValidationIndicator": true,
5
+ "showDataIndicator": true
6
+ }
7
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "contactName": "Jo",
3
+ "contactPhone": "0161 496 0000",
4
+ "officeCity": "Manchester",
5
+ "itemCount": 12,
6
+ "isBusiness": false,
7
+ "notes": "Gate code 4417"
8
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "title": "Equipment order",
5
+ "required": ["contactName", "officeCity"],
6
+ "properties": {
7
+ "contactName": {
8
+ "type": "string",
9
+ "title": "Contact name",
10
+ "minLength": 3
11
+ },
12
+ "contactPhone": {
13
+ "type": "string",
14
+ "title": "Phone",
15
+ "pattern": "^[0-9 +()-]{7,}$"
16
+ },
17
+ "officeCity": { "type": "string", "title": "Office city" },
18
+ "dropoffCity": { "type": "string", "title": "Drop-off city" },
19
+ "itemCount": {
20
+ "type": "integer",
21
+ "title": "Items",
22
+ "minimum": 1,
23
+ "maximum": 8
24
+ },
25
+ "isBusiness": { "type": "boolean", "title": "Business account" },
26
+ "companyName": { "type": "string", "title": "Company name" },
27
+ "notes": { "type": "string", "title": "Notes for the coordinator" }
28
+ }
29
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "en": {
3
+ "category.contact.label": "Contact",
4
+ "category.planning.label": "Planning",
5
+ "category.business.label": "Business",
6
+ "category.notes.label": "Notes",
7
+ "hint.visibility": "Toggle this to watch the Business category appear and disappear in all three.",
8
+ "hint.tabs": "Tabs — no variant",
9
+ "hint.stepper": "Stepper — variant: \"stepper\"",
10
+ "hint.accordion": "Accordion — variant: \"accordion\", opening on options.initial",
11
+ "group.dataIndicator": "Section contains data",
12
+ "validation.containerError": "1 error in this section",
13
+ "validation.containerErrors": "{count} errors in this section",
14
+ "categorization.next": "Next",
15
+ "categorization.previous": "Previous",
16
+ "error.minLength": "Use at least {limit} characters.",
17
+ "error.maximum": "Enter {limit} or fewer.",
18
+ "error.pattern": "Enter a valid phone number.",
19
+ "error.required": "This field is required.",
20
+ "featureNavigation.section1.label": "Tabs",
21
+ "featureNavigation.section2.label": "Stepper",
22
+ "featureNavigation.section3.label": "Accordion",
23
+ "specCategorization.schema.label": "Equipment order",
24
+ "specCategorization.schema.properties.contactName.label": "Contact name",
25
+ "specCategorization.schema.properties.contactPhone.label": "Phone",
26
+ "specCategorization.schema.properties.officeCity.label": "Office city",
27
+ "specCategorization.schema.properties.dropoffCity.label": "Drop-off city",
28
+ "specCategorization.schema.properties.itemCount.label": "Items",
29
+ "specCategorization.schema.properties.isBusiness.label": "Business account",
30
+ "specCategorization.schema.properties.companyName.label": "Company name",
31
+ "specCategorization.schema.properties.notes.label": "Notes for the coordinator",
32
+ "hint.visibility.text": "Toggle this to watch the Business category appear and disappear in all three.",
33
+ "hint.tabs.text": "Tabs — no variant",
34
+ "hint.stepper.text": "Stepper — variant: \"stepper\"",
35
+ "hint.accordion.text": "Accordion — variant: \"accordion\", opening on options.initial"
36
+ },
37
+ "bg": {
38
+ "category.contact.label": "Контакт",
39
+ "category.planning.label": "Планиране",
40
+ "category.business.label": "Фирма",
41
+ "category.notes.label": "Бележки",
42
+ "hint.visibility": "Превключете, за да видите как категорията „Фирма“ се появява и изчезва и в трите.",
43
+ "hint.tabs": "Табове — без variant",
44
+ "hint.stepper": "Стъпки — variant: \"stepper\"",
45
+ "hint.accordion": "Акордеон — variant: \"accordion\", отваря се на options.initial",
46
+ "group.dataIndicator": "Секцията съдържа данни",
47
+ "validation.containerError": "1 грешка в тази секция",
48
+ "validation.containerErrors": "{count} грешки в тази секция",
49
+ "categorization.next": "Напред",
50
+ "categorization.previous": "Назад",
51
+ "error.minLength": "Използвайте поне {limit} символа.",
52
+ "error.maximum": "Въведете {limit} или по-малко.",
53
+ "error.pattern": "Въведете валиден телефонен номер.",
54
+ "error.required": "Полето е задължително.",
55
+ "featureNavigation.section1.label": "Раздели",
56
+ "featureNavigation.section2.label": "Стъпки",
57
+ "featureNavigation.section3.label": "Акордеон",
58
+ "specCategorization.schema.label": "Поръчка на оборудване",
59
+ "specCategorization.schema.properties.contactName.label": "Име за контакт",
60
+ "specCategorization.schema.properties.contactPhone.label": "Телефон",
61
+ "specCategorization.schema.properties.officeCity.label": "Град на офиса",
62
+ "specCategorization.schema.properties.dropoffCity.label": "Град за доставка",
63
+ "specCategorization.schema.properties.itemCount.label": "Артикули",
64
+ "specCategorization.schema.properties.isBusiness.label": "Фирмена сметка",
65
+ "specCategorization.schema.properties.companyName.label": "Име на фирмата",
66
+ "specCategorization.schema.properties.notes.label": "Бележки за координатора",
67
+ "hint.visibility.text": "Превключете, за да видите как категорията „Фирма“ се появява и изчезва и в трите.",
68
+ "hint.tabs.text": "Табове — без variant",
69
+ "hint.stepper.text": "Стъпки — variant: \"stepper\"",
70
+ "hint.accordion.text": "Акордеон — variant: \"accordion\", отваря се на options.initial"
71
+ }
72
+ }
@@ -0,0 +1,288 @@
1
+ {
2
+ "type": "VerticalLayout",
3
+ "elements": [
4
+ {
5
+ "type": "Label",
6
+ "text": "Toggle this to watch the Business category appear and disappear in all three.",
7
+ "i18n": "hint.visibility"
8
+ },
9
+ {
10
+ "type": "Control",
11
+ "scope": "#/properties/isBusiness"
12
+ },
13
+ {
14
+ "type": "Categorization",
15
+ "elements": [
16
+ {
17
+ "type": "Category",
18
+ "label": "Tabs",
19
+ "i18n": "featureNavigation.section1",
20
+ "elements": [
21
+ {
22
+ "type": "Label",
23
+ "text": "Tabs — no variant",
24
+ "i18n": "hint.tabs"
25
+ },
26
+ {
27
+ "type": "Categorization",
28
+ "elements": [
29
+ {
30
+ "type": "Category",
31
+ "name": "contact",
32
+ "label": "Contact",
33
+ "i18n": "category.contact",
34
+ "elements": [
35
+ {
36
+ "type": "Control",
37
+ "scope": "#/properties/contactName"
38
+ },
39
+ {
40
+ "type": "Control",
41
+ "scope": "#/properties/contactPhone"
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "type": "Category",
47
+ "name": "planning",
48
+ "label": "Planning",
49
+ "i18n": "category.planning",
50
+ "elements": [
51
+ {
52
+ "type": "Control",
53
+ "scope": "#/properties/officeCity"
54
+ },
55
+ {
56
+ "type": "Control",
57
+ "scope": "#/properties/dropoffCity"
58
+ },
59
+ {
60
+ "type": "Control",
61
+ "scope": "#/properties/itemCount"
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "type": "Category",
67
+ "name": "business",
68
+ "label": "Business",
69
+ "i18n": "category.business",
70
+ "elements": [
71
+ {
72
+ "type": "Control",
73
+ "scope": "#/properties/companyName"
74
+ }
75
+ ],
76
+ "rule": {
77
+ "effect": "SHOW",
78
+ "condition": {
79
+ "scope": "#/properties/isBusiness",
80
+ "schema": {
81
+ "const": true
82
+ },
83
+ "failWhenUndefined": true
84
+ }
85
+ }
86
+ },
87
+ {
88
+ "type": "Category",
89
+ "name": "notes",
90
+ "label": "Notes",
91
+ "i18n": "category.notes",
92
+ "elements": [
93
+ {
94
+ "type": "Control",
95
+ "scope": "#/properties/notes"
96
+ }
97
+ ]
98
+ }
99
+ ]
100
+ }
101
+ ]
102
+ },
103
+ {
104
+ "type": "Category",
105
+ "label": "Stepper",
106
+ "i18n": "featureNavigation.section2",
107
+ "elements": [
108
+ {
109
+ "type": "Label",
110
+ "text": "Stepper — variant: \"stepper\"",
111
+ "i18n": "hint.stepper"
112
+ },
113
+ {
114
+ "type": "Categorization",
115
+ "options": {
116
+ "variant": "stepper",
117
+ "showNavButtons": true
118
+ },
119
+ "elements": [
120
+ {
121
+ "type": "Category",
122
+ "name": "contact",
123
+ "label": "Contact",
124
+ "i18n": "category.contact",
125
+ "elements": [
126
+ {
127
+ "type": "Control",
128
+ "scope": "#/properties/contactName"
129
+ },
130
+ {
131
+ "type": "Control",
132
+ "scope": "#/properties/contactPhone"
133
+ }
134
+ ]
135
+ },
136
+ {
137
+ "type": "Category",
138
+ "name": "planning",
139
+ "label": "Planning",
140
+ "i18n": "category.planning",
141
+ "elements": [
142
+ {
143
+ "type": "Control",
144
+ "scope": "#/properties/officeCity"
145
+ },
146
+ {
147
+ "type": "Control",
148
+ "scope": "#/properties/dropoffCity"
149
+ },
150
+ {
151
+ "type": "Control",
152
+ "scope": "#/properties/itemCount"
153
+ }
154
+ ]
155
+ },
156
+ {
157
+ "type": "Category",
158
+ "name": "business",
159
+ "label": "Business",
160
+ "i18n": "category.business",
161
+ "elements": [
162
+ {
163
+ "type": "Control",
164
+ "scope": "#/properties/companyName"
165
+ }
166
+ ],
167
+ "rule": {
168
+ "effect": "SHOW",
169
+ "condition": {
170
+ "scope": "#/properties/isBusiness",
171
+ "schema": {
172
+ "const": true
173
+ },
174
+ "failWhenUndefined": true
175
+ }
176
+ }
177
+ },
178
+ {
179
+ "type": "Category",
180
+ "name": "notes",
181
+ "label": "Notes",
182
+ "i18n": "category.notes",
183
+ "elements": [
184
+ {
185
+ "type": "Control",
186
+ "scope": "#/properties/notes"
187
+ }
188
+ ]
189
+ }
190
+ ]
191
+ }
192
+ ]
193
+ },
194
+ {
195
+ "type": "Category",
196
+ "label": "Accordion",
197
+ "i18n": "featureNavigation.section3",
198
+ "elements": [
199
+ {
200
+ "type": "Label",
201
+ "text": "Accordion — variant: \"accordion\"",
202
+ "i18n": "hint.accordion"
203
+ },
204
+ {
205
+ "type": "Categorization",
206
+ "options": {
207
+ "variant": "accordion",
208
+ "initial": "planning"
209
+ },
210
+ "elements": [
211
+ {
212
+ "type": "Category",
213
+ "name": "contact",
214
+ "label": "Contact",
215
+ "i18n": "category.contact",
216
+ "elements": [
217
+ {
218
+ "type": "Control",
219
+ "scope": "#/properties/contactName"
220
+ },
221
+ {
222
+ "type": "Control",
223
+ "scope": "#/properties/contactPhone"
224
+ }
225
+ ]
226
+ },
227
+ {
228
+ "type": "Category",
229
+ "name": "planning",
230
+ "label": "Planning",
231
+ "i18n": "category.planning",
232
+ "elements": [
233
+ {
234
+ "type": "Control",
235
+ "scope": "#/properties/officeCity"
236
+ },
237
+ {
238
+ "type": "Control",
239
+ "scope": "#/properties/dropoffCity"
240
+ },
241
+ {
242
+ "type": "Control",
243
+ "scope": "#/properties/itemCount"
244
+ }
245
+ ]
246
+ },
247
+ {
248
+ "type": "Category",
249
+ "name": "business",
250
+ "label": "Business",
251
+ "i18n": "category.business",
252
+ "elements": [
253
+ {
254
+ "type": "Control",
255
+ "scope": "#/properties/companyName"
256
+ }
257
+ ],
258
+ "rule": {
259
+ "effect": "SHOW",
260
+ "condition": {
261
+ "scope": "#/properties/isBusiness",
262
+ "schema": {
263
+ "const": true
264
+ },
265
+ "failWhenUndefined": true
266
+ }
267
+ }
268
+ },
269
+ {
270
+ "type": "Category",
271
+ "name": "notes",
272
+ "label": "Notes",
273
+ "i18n": "category.notes",
274
+ "elements": [
275
+ {
276
+ "type": "Control",
277
+ "scope": "#/properties/notes"
278
+ }
279
+ ]
280
+ }
281
+ ]
282
+ }
283
+ ]
284
+ }
285
+ ]
286
+ }
287
+ ]
288
+ }
@@ -0,0 +1,136 @@
1
+ # Example: choice controls
2
+
3
+ **Example ID:** `choice-controls`\
4
+ **Demo entry:** **Spec: Choice controls** (`#spec-choice-controls`)\
5
+ **Domain:** appointment options\
6
+ **Specs covered:**
7
+
8
+ - [Radio-choice layout and interaction](../../docs/spec.md#185-choice-and-suggested-string-controls)
9
+ - [Choice identity and existing values](../../docs/spec.md#185-choice-and-suggested-string-controls)
10
+ - [Honest rendering of invalid data](../../docs/spec.md#185-choice-and-suggested-string-controls)
11
+ - [Choice and suggested-string controls](../../docs/spec.md#185-choice-and-suggested-string-controls)
12
+ - [Choice searchability](../../docs/spec.md#185-choice-and-suggested-string-controls)
13
+ - [`vertical` orientation](../../docs/spec.md#185-choice-and-suggested-string-controls)
14
+
15
+ ## Validation state
16
+
17
+ Validated with Ajv (`allErrors`, `strict: false`), the supplied data produces
18
+ exactly one error:
19
+
20
+ | Instance path | Keyword | Message |
21
+ | --- | --- | --- |
22
+ | `/supplier` | `enum` | must be equal to one of the allowed values |
23
+
24
+ ## Orientation
25
+
26
+ `options.vertical` is the single orientation encoding, and it means the same
27
+ thing here as on a checkbox group — see
28
+ [the specification](../../docs/spec.md#185-choice-and-suggested-string-controls).
29
+
30
+ | Control | Orientation |
31
+ | --- | --- |
32
+ | Processing speed | Absent, so horizontal, wrapping when the row runs out of space. |
33
+ | Workspace | `vertical: true`, stacked — the labels are long enough that a row reads poorly. |
34
+ | Billing department | `vertical: true` on constant-based `oneOf` choices. |
35
+
36
+ The orientation is announced with `aria-orientation`, so assistive technology
37
+ describes the arrangement actually on screen rather than a default.
38
+
39
+ ## What to try
40
+
41
+ **Nothing is preselected.** `region` has no value, and mounting must not choose
42
+ the first option. Check the Data tab: the property is still absent.
43
+
44
+ **Value identity survives.** `priority` is an integer enum holding `2`. It must
45
+ stay the number `2`, never the string `"2"` — labels and widget identifiers are
46
+ presentation, not the identity of the stored value.
47
+
48
+ **Labels translate, values do not.** `department` has `i18n: "department"`, so
49
+ core looks up `department.fin`. Switch the demo to Bulgarian: the label becomes
50
+ "Финанси" while the stored value stays `"fin"`.
51
+
52
+ **An out-of-domain value is preserved.** `supplier` holds `"Legacy"`, which is not
53
+ in its enum. No radio is selected, the value stays in the data, and validation
54
+ reports it. A renderer must not select the nearest option or clear the field to
55
+ make the widget look valid.
56
+
57
+ ## Fallback behaviour
58
+
59
+ | Situation | Result |
60
+ | --- | --- |
61
+ | No `format: "radio"` | Ordinary enum selection — a dropdown — not radios. |
62
+ | `vertical` absent | Horizontal. Only an explicit `true` stacks. |
63
+ | Two choices with the same translated label | Both still render. They are keyed by value, so distinct values stay distinct choices. |
64
+
65
+ ## Conformance scope
66
+
67
+ This walkthrough describes the portable contract. Renderer support must be checked
68
+ by a host adapter; the package validates the authored assets, not live UI behavior.
69
+
70
+ ## Searchable choices
71
+
72
+ **Office location and Handling team ask for `options.autocomplete: true`**, so
73
+ their dropdowns take a query. The same Office location appears again below without
74
+ the option, which is **this family's default**: not searchable.
75
+
76
+ That default is a choice, and section 18 allows it — "preserves the renderer
77
+ family's documented default. No universal default is imposed" — but it differs
78
+ from Material, where searching is on unless `autocomplete: false`. A document
79
+ that relies on Material's default will render a plain dropdown here. See
80
+ [the specification](../../docs/spec.md#185-choice-and-suggested-string-controls).
81
+
82
+ **Search Handling team for `Oper`.** It matches **Operations**, the visible
83
+ label, not the stored constant `ops` — searching for `ops` finds nothing. The
84
+ labels come from the branch titles and go through the translator, so the same
85
+ search works in Bulgarian against the Bulgarian labels.
86
+
87
+ **Type something no choice matches.** A localized "No matching choices" appears,
88
+ and pressing Enter stores nothing: "search text is not itself a new allowed
89
+ value." For a field that *should* accept other values, the encoding is
90
+ `options.suggestion` on a plain string, not this.
91
+
92
+ ## Standalone host setup
93
+
94
+ Load the JSON assets listed in [the catalog](../catalog.json) into a host
95
+ with the relevant renderer capabilities. Register the trusted tester functions
96
+ exported by `uischemas.json` for the Card detail modes tab. The generated example
97
+ module includes these registrations for demo hosts.
98
+
99
+
100
+ ## Feature navigation
101
+
102
+ Explore one feature at a time using the tabs: **Horizontal radio**, **Vertical radio**, **Constant choices**, **Value identity**, **Searchable choices**. Tab titles are localized in English and Bulgarian. The tabs share the existing form data.
103
+
104
+
105
+ ## Choice cards
106
+ The Choice cards tab covers image data URLs (explicitly enabled in config),
107
+ selected content, rich translated labels, typed values, a disabled card and
108
+ automatic labels. Card branch forms covers explicit Email detail and generated
109
+ Postal detail. Switching populated branch forms uses the shared confirmation
110
+ policy. English and Bulgarian translations accompany the card UI.
111
+
112
+ Card branch forms explicitly uses `confirmation.branchChange: "complex"`. A discriminator-only value switches immediately; entered branch details require confirmation. Branch switch without prompt uses `never`. The default oneOf policy remains `always`.
113
+
114
+ Card validation demonstrates an absent required choice, an invalid imported enum value, and an invalid email within a selected branch, with English and Bulgarian messages.
115
+
116
+ Object and array choices demonstrates preloaded nested object and array constants in dropdowns, radios, and table cells. These values must remain selected after JSON reload. This also provides a parity fixture for renderer families whose composite choice support is not yet certified.
117
+
118
+
119
+ ## Card detail modes
120
+
121
+ The **Card detail modes** tab presents the same `cardContact` value twice:
122
+
123
+ - `choices[].detail: "GENERATE"` bypasses the matching registry entry and shows
124
+ the generated branch fields, including the discriminator.
125
+ - `choices[].detail: "REGISTERED"` uses `uischemas.json` for Email. Its custom
126
+ **Registered email address** label makes registry selection visible, and its
127
+ layout omits the discriminator already controlled by the cards.
128
+
129
+ Edit either email address and the other presentation updates. Switch to Postal
130
+ mail (confirm discarding populated details): no registry entry matches that
131
+ branch, so REGISTERED falls back to generation and both show Street and City.
132
+ The existing Card branch forms tab retains its inline Email detail for comparison.
133
+ The new tab and registered label have English and Bulgarian translations.
134
+
135
+ See the [implementation guide](../../docs/implementation-guide.md#choice-card-branch-details)
136
+ for executed renderer coverage of this example.