@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.
Files changed (366) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +126 -2
  3. package/conformance/authoring.json +2169 -0
  4. package/conformance/behavior.json +731 -0
  5. package/conformance/config-consumption.json +1531 -0
  6. package/conformance/expected-invalid.json +20 -0
  7. package/docs/audit.md +150 -0
  8. package/docs/conditional-fields.md +80 -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 +180 -0
  12. package/docs/implementation-pitfalls.md +802 -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 +8321 -0
  17. package/docs/todo.md +149 -0
  18. package/examples/README.md +121 -0
  19. package/examples/additional-errors/README.md +169 -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 +188 -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 +151 -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 +19 -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 +30 -0
  118. package/examples/conditional-fields/uischema.json +71 -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 +200 -0
  198. package/examples/label-interpolation/config.json +8 -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 +375 -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 +77 -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 +327 -0
  339. package/schemas/jsonforms-extended-uischema.schema.json +1923 -0
  340. package/schemas/jsonforms-rule.schema.json +104 -0
  341. package/schemas/jsonforms-uischema.schema.json +1421 -0
  342. package/typescript/README.md +540 -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 +376 -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 +419 -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 +626 -0
  360. package/typescript/test/tsconfig.json +10 -0
  361. package/typescript/test/typedAuthoring.test.ts +140 -0
  362. package/typescript/test/typedAuthoringCoverage.test.ts +145 -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,335 @@
1
+ # Example: tuple control
2
+
3
+ **Example ID:** `tuple-control`\
4
+ **Demo entry:** **Spec: Tuple control** (`#spec-tuple-control`)\
5
+ **Domain:** work order\
6
+ **Specs covered:**
7
+
8
+ - [Tuple control: positional array fields](../../docs/spec.md#1811-tuple-control-positional-array-fields)
9
+ - [Array Add-item initialization](../../docs/spec.md#1811-tuple-control-positional-array-fields)
10
+ - [Complex position summaries and dialog details](../../docs/spec.md#1811-tuple-control-positional-array-fields)
11
+ - [Honest rendering of invalid data](../../docs/spec.md#1811-tuple-control-positional-array-fields)
12
+ - [The tuple control](../../docs/spec.md#1811-tuple-control-positional-array-fields)
13
+
14
+ Eight positional arrays from one project record. The point of the example is
15
+ that **a tuple is one value with several editors, not several values** — which
16
+ is why no declared position can be added, removed or reordered, and why an edit
17
+ at one position can change another.
18
+
19
+ ## Files
20
+
21
+ | File | Role |
22
+ | --- | --- |
23
+ | `schema.json` | Eight positional (`items: [...]`) arrays, one uniform fixed-length array, and one array that asks for a tuple it cannot be. |
24
+ | `uischema.json` | `variant`, `vertical`, `showBorder`, `detail`, the dialog action labels, and the deliberate misconfiguration. |
25
+ | `data.json` | One empty tuple, one with a trailing value its schema forbids, one invalid position, and two complex positions. |
26
+ | `config.json` | `showUnfocusedDescription` and `restrict`, both top level. |
27
+ | `translations.json` | English and Bulgarian, including the two per-position label keys and the `{position}` fallback. |
28
+ | `uischemas.json` | Registry entries for the complex positions, one per entry shape. **`.ts`, not `.json`** — see below. |
29
+
30
+ ### Why `uischemas.json` and not `uischemas.json`
31
+
32
+ A registry entry carries a **tester function**, and the UI-schema registry is
33
+ host code rather than part of the serialized UI model: the renderer contract says to "use the
34
+ existing ranked UI-schema registry to select a position-specific Control", which
35
+ is a host mechanism. A UI schema is JSON; a registry is not.
36
+
37
+ One consequence is visible in the demo: the **UI Schemas** tab shows these
38
+ entries without their testers, because `JSON.stringify` cannot carry a function.
39
+ Applying that tab leaves entries that match nothing, and the two complex
40
+ positions fall back to a generated form — the summaries stay, the tailored
41
+ dialog does not. The renderer ignores entries with no callable tester rather
42
+ than crashing on one.
43
+
44
+ ## What the form contains
45
+
46
+ ```text
47
+ Project record
48
+ Drop-off coordinates positional, showBorder: false -> [45.52, -122.68]
49
+ Crate dimensions uniform + variant, vertical -> [120, 80, -5] (invalid)
50
+ Survey point positional, options.detail -> Group, Longitude before Latitude
51
+ ---
52
+ Order line positional, empty -> []
53
+ Inspection record typed tail, min 2 / max 4 -> [..., ..., "Call the yard..."]
54
+ Supplier reference open tail, max 3 -> ["Cascade Supplies", 42]
55
+ ---
56
+ Project contact object + array positions -> dialogs
57
+ Handoff contacts four complex positions -> one per registry-entry shape
58
+ Imported assignment closed tail, three values -> [..., ..., "Imported..."] (invalid)
59
+ Asked for a tuple uniform, no equal bounds -> configuration diagnostic
60
+ ```
61
+
62
+ ## Validation state
63
+
64
+ Validated with Ajv (`allErrors`, `strict: false`), the supplied data produces
65
+ exactly two errors — deliberately one of each placement the renderer contract distinguishes:
66
+
67
+ | Instance path | Keyword | Message |
68
+ | --- | --- | --- |
69
+ | `/dimensions/2` | `minimum` | must be >= 0 |
70
+ | `/legacyAssignment` | `additionalItems` | must NOT have more than 2 items |
71
+
72
+ **Crate dimensions is a position error.** It appears beside Item 3 and nowhere
73
+ else; Items 1 and 2 are valid and are not marked.
74
+
75
+ **Imported assignment is an array error.** It appears beneath the tuple as a
76
+ whole. the renderer contract: "an array-level error must not automatically mark every positional
77
+ field invalid" — Leg code and Sequence both hold valid values and are shown as
78
+ such.
79
+
80
+ ## Expected behaviour
81
+
82
+ **Order line is empty. Type a quantity without touching the product code.** The
83
+ data becomes `["", 4]` in a single update — not `[undefined, 4]`, not a sparse
84
+ array, and not two separate writes. This is the shared Array Add-item
85
+ initialization contract, and the renderer contract gives this exact case as its example.
86
+
87
+ **Drop-off coordinates does the same with numbers.** Clear both, then type the
88
+ second one: the first becomes `0`, because a number's initial value is zero.
89
+ Zero is a real value here, not a placeholder.
90
+
91
+ **Clear the product code once the order line exists.** It becomes `""` and
92
+ stays at position 0. Clearing "must never splice the array, shift later
93
+ positions, or write undefined into it".
94
+
95
+ **Now clear a quantity.** Nothing is committed and a message appears beside the
96
+ field. A number has no natural empty value, and the renderer contract forbids quietly
97
+ substituting one: "do not silently replace it with zero or null". The edit is
98
+ held as a draft until a number is entered.
99
+
100
+ **No declared position has an Add, Delete or Reorder action.** Only the
101
+ Additional items section has them, and only past the prefix.
102
+
103
+ **Inspection record has a typed tail.** Add appends an empty `Note` string.
104
+ `maxItems` is 4 and `restrict` is on, so Add stops at four values. Switch
105
+ `restrict` off in the Config tab to compare: adding is allowed and the
106
+ validator reports the excess instead.
107
+
108
+ **Supplier reference has an open tail.** Its trailing values are edited through
109
+ the mixed control, so a value's type can be changed from the editor — the data
110
+ already holds a string and a number.
111
+
112
+ **Project contact opens dialogs.** The closed positions show summaries: the
113
+ street for the address, the phone numbers for the list. Only the Edit icon
114
+ opens the dialog; the summary text is selectable. Opening one and cancelling
115
+ writes nothing. **Clear** empties Address to `{}` and Phone numbers to `[]`,
116
+ keeping both positions — it never produces a one-element array.
117
+
118
+ **Imported assignment keeps its extra value.** The schema forbids a third
119
+ position, and the value is preserved with a Delete beside it rather than
120
+ truncated on load. Add stays disabled: the schema still permits no tail.
121
+
122
+ **The last control reports instead of guessing.** It asks for
123
+ `variant: "tuple"` on a uniform array with no equal bounds, which the renderer contract calls an
124
+ unsupported configuration requiring "a configuration diagnostic rather than
125
+ guessing a positional count".
126
+
127
+ **Switch the demo to Bulgarian.** Coordinates are labelled Easting/Northing in
128
+ English and their Bulgarian equivalents; Crate dimensions falls back to
129
+ "Item 1..3" / "Елемент 1..3". Both come from the same mechanism, which is the
130
+ next point.
131
+
132
+ ### Placing the positions yourself
133
+
134
+ A tuple's children come from the schema, not from UI-schema elements — which is
135
+ why there is no Add or Reorder for the declared positions. But *where* those
136
+ positions appear is presentation, and `options.detail` decides it.
137
+
138
+ **Survey point** carries one. Its three positions — Latitude, Longitude,
139
+ Elevation — are placed by:
140
+
141
+ ```json
142
+ {
143
+ "detail": {
144
+ "type": "VerticalLayout",
145
+ "elements": [
146
+ {
147
+ "type": "Group",
148
+ "label": "Ground position",
149
+ "elements": [
150
+ {
151
+ "type": "HorizontalLayout",
152
+ "elements": [
153
+ { "type": "Control", "scope": "#/items/1" },
154
+ { "type": "Control", "scope": "#/items/0" }
155
+ ]
156
+ }
157
+ ]
158
+ },
159
+ { "type": "Control", "scope": "#/items/2" }
160
+ ]
161
+ }
162
+ }
163
+ ```
164
+
165
+ Longitude appears **before** Latitude, inside a real Group, with Elevation
166
+ below. The reversal is the point: the order on screen is the layout's, and the
167
+ order in the data is unchanged — editing the first field on screen still writes
168
+ to index 1.
169
+
170
+ **A position is addressed by index**, with `#/items/N` or the draft 2020-12
171
+ spelling `#/prefixItems/N`. Both work, because `toDataPath` already resolves
172
+ them.
173
+
174
+ **A scope may also reach inside a position.** Everything in the layout resolves
175
+ against the tuple, so one layout can mix the two freely:
176
+
177
+ | Scope | Renders |
178
+ | --- | --- |
179
+ | `#/items/1` | the whole position — with its label, summary and Edit dialog |
180
+ | `#/items/0/properties/city` | just that field, from inside position 0 |
181
+
182
+ That is one scope base, however deep you go — the same relationship
183
+ `#/properties/city` has to an object control.
184
+
185
+ **Positions stay positions.** They are still rendered by the tuple's own field
186
+ component wherever the layout puts them, so a position keeps its label, its
187
+ complex-value summary and its Edit dialog. A layout changes the arrangement,
188
+ not what a position is.
189
+
190
+ ### What a registry entry may look like
191
+
192
+ A **complex** position - an object or array - shows a compact summary with an
193
+ Edit action rather than an inline form. What that summary and that dialog
194
+ contain comes from the UI-schema registry, and there are four shapes an entry
195
+ can take. `Handoff contacts` has one position for each.
196
+
197
+ | Entry | Preview | Dialog |
198
+ | --- | --- | --- |
199
+ | Control with `summary` **and** `detail` | the summary scope, resolved against the position | the `detail` |
200
+ | Control with `detail` only | localized **View details** | the `detail` |
201
+ | A layout, with no wrapping Control | localized **View details** | the layout itself |
202
+ | No matching entry | localized **View details** | a generated form |
203
+
204
+ The third is the specification's "a registry entry that is already a layout
205
+ remains usable directly as the dialog detail" — no `Control` wrapper and no
206
+ `detail` key needed.
207
+
208
+ A missing value shows the localized **Not set**, and neither previewing nor
209
+ opening a dialog creates or normalizes data.
210
+
211
+ > **A combination used to be missing here.** A Control entry carrying
212
+ > `summary` but **no** `detail` froze the browser, so it was kept out of the
213
+ > fixture. That is fixed: the cause was never tuple-specific — any registry
214
+ > entry that is a Control matching an object's schema made the object renderer
215
+ > dispatch it back to itself. Such an entry now falls back to the generated
216
+ > layout and reports `uischema.registryCycle`. See
217
+ > [20.7](../../docs/spec.md#1811-tuple-control-positional-array-fields).
218
+ >
219
+ > The fixture still shows `summary` **with** `detail`, because that is what an
220
+ > author should write: the fallback is a recovery, not a feature.
221
+
222
+ ### Leaving a position out
223
+
224
+ A layout may name only some positions; the rest are not drawn. That is useful —
225
+ and it is the one thing about `layout` that needs care, because **the data
226
+ behind a hidden position is still there and still validated.**
227
+
228
+ Left alone, that would produce a form that is invalid with nothing on screen
229
+ saying why: the position that failed is precisely the one nobody drew. The
230
+ specification rules it out — "hiding a control does not discard its underlying
231
+ errors or exempt its data from validation. Ensure eligible errors remain
232
+ discoverable without forcing hidden controls visible merely to show them."
233
+
234
+ So the tuple reports an omitted position's errors **itself**, in its own error
235
+ area, prefixed with the position's name:
236
+
237
+ ```text
238
+ Longitude: must be >= 0
239
+ ```
240
+
241
+ The prefix is there because the field that would have identified the message is
242
+ not on screen. A position that *is* drawn keeps reporting beside itself,
243
+ unprefixed and once — the tuple does not repeat it.
244
+
245
+ What a layout still cannot do is change the data. Hiding a position does not
246
+ remove its value, relax its constraints, or exempt it from the array's own
247
+ bounds.
248
+
249
+ **The Group is a real Group.** The layout is dispatched through the renderer
250
+ registry rather than interpreted, so it gets the ordinary Group renderer with
251
+ its collapse state and indicators — and any layout type the form already
252
+ supports works here, not a fixed list of three.
253
+
254
+ ### Two `detail`s, on two different elements
255
+
256
+ `detail` here means what it means everywhere else: **a UI schema whose scopes
257
+ resolve against this control's own schema.** For an object that is
258
+ `#/properties/city`; for a tuple it is `#/items/0`.
259
+
260
+ What can confuse is that a tuple has *two* levels, and both use the name — but
261
+ they sit on different elements and never meet:
262
+
263
+ | Where | What it lays out | Scopes resolve against |
264
+ | --- | --- | --- |
265
+ | the **tuple's** Control | the positions | the tuple — `#/items/N` |
266
+ | a **position's** Control, from the registry | that position's dialog | the position's value — `#/properties/city` |
267
+
268
+ So a form can carry both at once, as the tuple test does: the tuple's `detail`
269
+ puts Rank before Address, and the registry's `detail` decides what the Address
270
+ dialog contains. Your summary/detail pair on a position is untouched — summary
271
+ inline, Edit opens the detail, no summary means "View details".
272
+
273
+ A tuple-wide `detail` is **not** forwarded into positions. It used to be, which
274
+ applied one dialog layout to every complex position whatever its schema, and
275
+ crashed outright on an array-typed one. Leaving position dialogs to the
276
+ registry is what the specification recommends anyway: "omit it when selecting
277
+ individual registry entries".
278
+
279
+ **Not `options.layout`.** The specification reserves that for how a control
280
+ participates in **its parent's** layout — `span`, `weight`, `width` and the
281
+ rest. A tuple sitting in a HorizontalLayout may carry it, and it has nothing to
282
+ do with the tuple's positions.
283
+
284
+ `vertical` describes the default row or column, so a `detail` supersedes it.
285
+
286
+ ## Labels and internationalization
287
+
288
+ **Coordinates carry per-position `i18n` prefixes** (`coordinates.x`,
289
+ `coordinates.y`) so the two positions can have different labels. This is not
290
+ decoration. Core's path-derived translation prefix **strips array indices**, so
291
+ `coordinates.0` and `coordinates.1` resolve to the *same* key — the renderer contract warns about
292
+ exactly this, and an explicit schema `i18n` is the remedy it prescribes.
293
+
294
+ **Crate dimensions shows the other half of that rule.** It is a uniform array:
295
+ all three positions share one schema and therefore one set of metadata, so they
296
+ cannot have distinct titles and fall back to the localized position label.
297
+ `tuple.position` takes `{position}` as a parameter rather than gluing a number
298
+ onto a translated word. Displayed numbering is one-based; the data path stays
299
+ zero-based.
300
+
301
+ ## Fallback behaviour
302
+
303
+ | Situation | Result |
304
+ | --- | --- |
305
+ | `options.detail` absent | The default row, or a column under `vertical`. |
306
+ | `options.detail` is an object with a `type` | It places the positions; `vertical` no longer applies. |
307
+ | `options.detail` is an object with no `type` | Ignored; the default arrangement is used. |
308
+ | A layout naming only some positions | Only those render. The rest are absent, not blank — and their errors are reported by the tuple, named. |
309
+ | A layout naming an index the schema does not declare | Nothing is rendered for it, and no position is invented. |
310
+ | A positional schema with no `title` and no `i18n` | The localized position label, `Item {position}`. |
311
+ | No `vertical` | A row that wraps. `true` stacks into a column. |
312
+ | No `showBorder` | Bordered. Only an explicit `false` removes it. |
313
+ | Equal `minItems`/`maxItems` and **no** `variant` | An ordinary array control. Equal bounds alone change nothing. |
314
+ | `variant: "tuple"` without equal bounds | The configuration diagnostic, not a guessed count. |
315
+ | No `additionalItems` / `items` tail | Open: trailing values are permitted and edited through the mixed control. |
316
+ | A tail of `false` with trailing data present | Preserved, with Delete offered and Add disabled. |
317
+ | A missing complex position | "Not set", and opening it creates nothing. |
318
+ | `restrict: false` | Bounds are reported by the validator instead of preventing the edit. |
319
+ | `disableAdd` / `disableRemove` | The corresponding action is disabled; the declared positions are unaffected either way. |
320
+
321
+ ## Conformance scope
322
+
323
+ This walkthrough describes the portable contract. Renderer support must be checked
324
+ by a host adapter; the package validates the authored assets, not live UI behavior.
325
+
326
+ ## Standalone host setup
327
+
328
+ - Register the trusted tester functions exported by uischemas.json.
329
+
330
+ Import `uischemas` from [uischemas.json](uischemas.json) and register its entries.
331
+
332
+
333
+ ## Feature navigation
334
+
335
+ Explore one feature at a time using the tabs: **Positional editors**, **Missing and trailing values**, **Complex and invalid values**. Tab titles are localized in English and Bulgarian. The tabs share the existing form data.
@@ -0,0 +1,4 @@
1
+ {
2
+ "showUnfocusedDescription": true,
3
+ "restrict": true
4
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "coordinates": [
3
+ 45.52,
4
+ -122.68
5
+ ],
6
+ "dimensions": [
7
+ 120,
8
+ 80,
9
+ -5
10
+ ],
11
+ "survey": [
12
+ 45.5272,
13
+ -122.6819,
14
+ 15.2
15
+ ],
16
+ "orderLine": [],
17
+ "inspection": [
18
+ "Marta Oliveira",
19
+ false,
20
+ "Call the yard before arrival"
21
+ ],
22
+ "flexible": [
23
+ "Cascade Supplies",
24
+ 42
25
+ ],
26
+ "projectContact": [
27
+ {
28
+ "street": "1200 NW Naito Parkway"
29
+ },
30
+ [
31
+ "+1 503 555 0142"
32
+ ]
33
+ ],
34
+ "handoffContacts": [
35
+ {
36
+ "name": "A. Ferreira",
37
+ "desk": "Support"
38
+ },
39
+ {
40
+ "name": "M. Todorova",
41
+ "desk": "Yard"
42
+ },
43
+ {
44
+ "name": "R. Okafor",
45
+ "desk": "Gate"
46
+ },
47
+ {
48
+ "name": "S. Lindqvist",
49
+ "desk": "Night"
50
+ }
51
+ ],
52
+ "legacyAssignment": [
53
+ "LEG-01",
54
+ 3,
55
+ "Imported extra value"
56
+ ],
57
+ "misconfigured": [
58
+ 1,
59
+ 2
60
+ ]
61
+ }
@@ -0,0 +1,218 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "coordinates": {
5
+ "type": "array",
6
+ "title": "Drop-off coordinates",
7
+ "items": [
8
+ {
9
+ "type": "number",
10
+ "title": "X",
11
+ "i18n": "coordinates.x"
12
+ },
13
+ {
14
+ "type": "number",
15
+ "title": "Y",
16
+ "i18n": "coordinates.y"
17
+ }
18
+ ],
19
+ "minItems": 2,
20
+ "additionalItems": false
21
+ },
22
+ "dimensions": {
23
+ "type": "array",
24
+ "title": "Crate dimensions in centimetres",
25
+ "items": {
26
+ "type": "number",
27
+ "minimum": 0
28
+ },
29
+ "minItems": 3,
30
+ "maxItems": 3
31
+ },
32
+ "survey": {
33
+ "type": "array",
34
+ "title": "Survey point",
35
+ "description": "Its positions are placed by options.layout, not by the default row.",
36
+ "items": [
37
+ {
38
+ "type": "number",
39
+ "title": "Latitude"
40
+ },
41
+ {
42
+ "type": "number",
43
+ "title": "Longitude"
44
+ },
45
+ {
46
+ "type": "number",
47
+ "title": "Elevation (m)"
48
+ }
49
+ ],
50
+ "minItems": 3,
51
+ "additionalItems": false
52
+ },
53
+ "orderLine": {
54
+ "type": "array",
55
+ "title": "Order line",
56
+ "items": [
57
+ {
58
+ "type": "string",
59
+ "title": "Product code"
60
+ },
61
+ {
62
+ "type": "integer",
63
+ "title": "Quantity",
64
+ "minimum": 1
65
+ }
66
+ ],
67
+ "additionalItems": false
68
+ },
69
+ "inspection": {
70
+ "type": "array",
71
+ "title": "Inspection record",
72
+ "items": [
73
+ {
74
+ "type": "string",
75
+ "title": "Inspector",
76
+ "default": "Unassigned"
77
+ },
78
+ {
79
+ "type": "boolean",
80
+ "title": "Approved"
81
+ }
82
+ ],
83
+ "additionalItems": {
84
+ "type": "string",
85
+ "title": "Note"
86
+ },
87
+ "minItems": 2,
88
+ "maxItems": 4
89
+ },
90
+ "flexible": {
91
+ "type": "array",
92
+ "title": "Supplier reference and free values",
93
+ "items": [
94
+ {
95
+ "type": "string",
96
+ "title": "Supplier"
97
+ }
98
+ ],
99
+ "additionalItems": true,
100
+ "maxItems": 3
101
+ },
102
+ "projectContact": {
103
+ "type": "array",
104
+ "title": "Project contact",
105
+ "items": [
106
+ {
107
+ "type": "object",
108
+ "title": "Address",
109
+ "properties": {
110
+ "street": {
111
+ "type": "string",
112
+ "title": "Street"
113
+ },
114
+ "city": {
115
+ "type": "string",
116
+ "title": "City",
117
+ "default": "Portland"
118
+ }
119
+ }
120
+ },
121
+ {
122
+ "type": "array",
123
+ "title": "Phone numbers",
124
+ "items": {
125
+ "type": "string"
126
+ }
127
+ }
128
+ ],
129
+ "additionalItems": false
130
+ },
131
+ "handoffContacts": {
132
+ "type": "array",
133
+ "title": "Handoff contacts",
134
+ "description": "Four complex positions, each with a different registry entry.",
135
+ "items": [
136
+ {
137
+ "type": "object",
138
+ "title": "Both",
139
+ "properties": {
140
+ "name": {
141
+ "type": "string",
142
+ "title": "Name"
143
+ },
144
+ "desk": {
145
+ "type": "string",
146
+ "title": "Desk"
147
+ }
148
+ }
149
+ },
150
+ {
151
+ "type": "object",
152
+ "title": "DetailOnly",
153
+ "properties": {
154
+ "name": {
155
+ "type": "string",
156
+ "title": "Name"
157
+ },
158
+ "desk": {
159
+ "type": "string",
160
+ "title": "Desk"
161
+ }
162
+ }
163
+ },
164
+ {
165
+ "type": "object",
166
+ "title": "LayoutEntry",
167
+ "properties": {
168
+ "name": {
169
+ "type": "string",
170
+ "title": "Name"
171
+ },
172
+ "desk": {
173
+ "type": "string",
174
+ "title": "Desk"
175
+ }
176
+ }
177
+ },
178
+ {
179
+ "type": "object",
180
+ "title": "NoEntry",
181
+ "properties": {
182
+ "name": {
183
+ "type": "string",
184
+ "title": "Name"
185
+ },
186
+ "desk": {
187
+ "type": "string",
188
+ "title": "Desk"
189
+ }
190
+ }
191
+ }
192
+ ],
193
+ "additionalItems": false
194
+ },
195
+ "legacyAssignment": {
196
+ "type": "array",
197
+ "title": "Imported assignment",
198
+ "items": [
199
+ {
200
+ "type": "string",
201
+ "title": "Leg code"
202
+ },
203
+ {
204
+ "type": "integer",
205
+ "title": "Sequence"
206
+ }
207
+ ],
208
+ "additionalItems": false
209
+ },
210
+ "misconfigured": {
211
+ "type": "array",
212
+ "title": "Asked for a tuple it cannot be",
213
+ "items": {
214
+ "type": "number"
215
+ }
216
+ }
217
+ }
218
+ }