@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,375 @@
1
+ {
2
+ "type": "Categorization",
3
+ "elements": [
4
+ {
5
+ "type": "Category",
6
+ "label": "Interpolation",
7
+ "elements": [
8
+ {
9
+ "type": "Label",
10
+ "i18n": "product",
11
+ "text": "You are subscribed to {product}.",
12
+ "options": {
13
+ "interpolate": true,
14
+ "textParams": {
15
+ "product": "Atlas"
16
+ }
17
+ }
18
+ },
19
+ {
20
+ "type": "Label",
21
+ "i18n": "seats",
22
+ "text": "Your plan includes {seats} {seats == 1 ? \"seat\" : \"seats\"}.",
23
+ "options": {
24
+ "interpolate": true,
25
+ "textParams": {
26
+ "seats": "{data.seats}"
27
+ }
28
+ }
29
+ },
30
+ {
31
+ "type": "Label",
32
+ "i18n": "promo",
33
+ "text": "Promotional code: {code}",
34
+ "options": {
35
+ "interpolate": true,
36
+ "textParams": {
37
+ "code": "{data.promoCode}"
38
+ }
39
+ }
40
+ },
41
+ {
42
+ "type": "Label",
43
+ "i18n": "literal",
44
+ "text": "Write {{seats}} to show a placeholder without resolving it.",
45
+ "options": {
46
+ "interpolate": true
47
+ }
48
+ },
49
+ {
50
+ "type": "Separator"
51
+ },
52
+ {
53
+ "type": "HorizontalLayout",
54
+ "elements": [
55
+ {
56
+ "type": "Control",
57
+ "scope": "#/properties/seats"
58
+ },
59
+ {
60
+ "type": "Control",
61
+ "scope": "#/properties/promoCode"
62
+ }
63
+ ]
64
+ }
65
+ ]
66
+ },
67
+ {
68
+ "type": "Category",
69
+ "label": "Markdown",
70
+ "elements": [
71
+ {
72
+ "type": "Label",
73
+ "i18n": "renewal",
74
+ "text": "Invoices are issued on the **first working day** of each month. See the [billing terms](https://example.com/billing).",
75
+ "options": {
76
+ "markup": "markdown"
77
+ }
78
+ }
79
+ ]
80
+ },
81
+ {
82
+ "type": "Category",
83
+ "label": "Both together",
84
+ "elements": [
85
+ {
86
+ "type": "Label",
87
+ "i18n": "summary",
88
+ "text": "**{account}** is on the {plan} plan, and the next invoice is {amount}.",
89
+ "options": {
90
+ "interpolate": true,
91
+ "markup": "markdown",
92
+ "textParams": {
93
+ "account": "{data.customerName}",
94
+ "plan": "{translate(\"plan.\" + data.plan)}",
95
+ "amount": "{currency(data.amountDue, \"EUR\")}"
96
+ }
97
+ }
98
+ },
99
+ {
100
+ "type": "Label",
101
+ "i18n": "holder",
102
+ "text": "Account holder: {holder}",
103
+ "options": {
104
+ "interpolate": true,
105
+ "markup": "markdown",
106
+ "textParams": {
107
+ "holder": "{data.displayName}"
108
+ }
109
+ }
110
+ },
111
+ {
112
+ "type": "Separator"
113
+ },
114
+ {
115
+ "type": "HorizontalLayout",
116
+ "elements": [
117
+ {
118
+ "type": "Control",
119
+ "scope": "#/properties/customerName"
120
+ },
121
+ {
122
+ "type": "Control",
123
+ "scope": "#/properties/plan"
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "type": "HorizontalLayout",
129
+ "elements": [
130
+ {
131
+ "type": "Control",
132
+ "scope": "#/properties/amountDue"
133
+ },
134
+ {
135
+ "type": "Control",
136
+ "scope": "#/properties/displayName"
137
+ }
138
+ ]
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ "type": "Category",
144
+ "label": "Locale and translation",
145
+ "elements": [
146
+ {
147
+ "type": "Label",
148
+ "i18n": "planName",
149
+ "text": "Your plan is {plan}.",
150
+ "options": {
151
+ "interpolate": true,
152
+ "textParams": {
153
+ "plan": "{translate(\"plan.\" + data.plan)}"
154
+ }
155
+ }
156
+ },
157
+ {
158
+ "type": "Label",
159
+ "i18n": "renews",
160
+ "text": "It renews on {renewal}.",
161
+ "options": {
162
+ "interpolate": true,
163
+ "textParams": {
164
+ "renewal": "{date(data.renewalDate)}"
165
+ }
166
+ }
167
+ },
168
+ {
169
+ "type": "Label",
170
+ "i18n": "price",
171
+ "text": "Seat price {price}, or {beforeTax} before tax.",
172
+ "options": {
173
+ "interpolate": true,
174
+ "textParams": {
175
+ "price": "{currency(data.seatPrice, \"EUR\")}",
176
+ "beforeTax": "{number(data.seatPrice, 2)}"
177
+ }
178
+ }
179
+ },
180
+ {
181
+ "type": "Label",
182
+ "i18n": "reference",
183
+ "text": "Reference {ref} is not a quantity, so it is not formatted.",
184
+ "options": {
185
+ "interpolate": true,
186
+ "textParams": {
187
+ "ref": "{data.reference}"
188
+ }
189
+ }
190
+ },
191
+ {
192
+ "type": "Separator"
193
+ },
194
+ {
195
+ "type": "HorizontalLayout",
196
+ "elements": [
197
+ {
198
+ "type": "Control",
199
+ "scope": "#/properties/plan"
200
+ },
201
+ {
202
+ "type": "Control",
203
+ "scope": "#/properties/renewalDate"
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ "type": "HorizontalLayout",
209
+ "elements": [
210
+ {
211
+ "type": "Control",
212
+ "scope": "#/properties/seatPrice"
213
+ },
214
+ {
215
+ "type": "Control",
216
+ "scope": "#/properties/reference"
217
+ }
218
+ ]
219
+ }
220
+ ]
221
+ },
222
+ {
223
+ "type": "Category",
224
+ "label": "Interpolation off",
225
+ "elements": [
226
+ {
227
+ "type": "Label",
228
+ "i18n": "offPlain",
229
+ "text": "Without interpolate, {product} and {data.customerName} are just characters."
230
+ },
231
+ {
232
+ "type": "Label",
233
+ "i18n": "offParams",
234
+ "text": "Declared parameters are inert too: {product}.",
235
+ "options": {
236
+ "textParams": {
237
+ "product": "Atlas"
238
+ }
239
+ }
240
+ },
241
+ {
242
+ "type": "Separator"
243
+ },
244
+ {
245
+ "type": "Control",
246
+ "scope": "#/properties/customerName"
247
+ }
248
+ ]
249
+ },
250
+ {
251
+ "type": "Category",
252
+ "label": "JavaScript names",
253
+ "elements": [
254
+ {
255
+ "type": "Label",
256
+ "i18n": "ctor",
257
+ "text": "A property called constructor: \"{ctor}\".",
258
+ "options": {
259
+ "interpolate": true,
260
+ "textParams": {
261
+ "ctor": "{data.constructor}"
262
+ }
263
+ }
264
+ },
265
+ {
266
+ "type": "Label",
267
+ "i18n": "ctorSibling",
268
+ "text": "Its siblings are still readable: \"{account}\".",
269
+ "options": {
270
+ "interpolate": true,
271
+ "textParams": {
272
+ "account": "{data.customerName}"
273
+ }
274
+ }
275
+ },
276
+ {
277
+ "type": "Label",
278
+ "i18n": "tostring",
279
+ "text": "And a property called toString: \"{ts}\".",
280
+ "options": {
281
+ "interpolate": true,
282
+ "textParams": {
283
+ "ts": "{data.toString}"
284
+ }
285
+ }
286
+ },
287
+ {
288
+ "type": "Separator"
289
+ },
290
+ {
291
+ "type": "HorizontalLayout",
292
+ "elements": [
293
+ {
294
+ "type": "Control",
295
+ "scope": "#/properties/constructor"
296
+ },
297
+ {
298
+ "type": "Control",
299
+ "scope": "#/properties/toString"
300
+ }
301
+ ]
302
+ },
303
+ {
304
+ "type": "Control",
305
+ "scope": "#/properties/customerName"
306
+ }
307
+ ]
308
+ },
309
+ {
310
+ "type": "Category",
311
+ "label": "Incorrect usage",
312
+ "elements": [
313
+ {
314
+ "type": "Label",
315
+ "i18n": "direct",
316
+ "text": "A data path in the text: \"{data.customerName}\".",
317
+ "options": {
318
+ "interpolate": true
319
+ }
320
+ },
321
+ {
322
+ "type": "Label",
323
+ "i18n": "undeclared",
324
+ "text": "A parameter that was never declared: \"{customer}\".",
325
+ "options": {
326
+ "interpolate": true,
327
+ "textParams": {
328
+ "account": "{data.customerName}"
329
+ }
330
+ }
331
+ },
332
+ {
333
+ "type": "Label",
334
+ "i18n": "unknownFn",
335
+ "text": "A function that does not exist: \"{shout(account)}\".",
336
+ "options": {
337
+ "interpolate": true,
338
+ "textParams": {
339
+ "account": "{data.customerName}"
340
+ }
341
+ }
342
+ },
343
+ {
344
+ "type": "Label",
345
+ "i18n": "badNamespace",
346
+ "text": "A namespace that does not exist: \"{who}\".",
347
+ "options": {
348
+ "interpolate": true,
349
+ "textParams": {
350
+ "who": "{nowhere.name}"
351
+ }
352
+ }
353
+ },
354
+ {
355
+ "type": "Label",
356
+ "i18n": "reserved",
357
+ "text": "A parameter named after a reserved name: \"{locale}\".",
358
+ "options": {
359
+ "interpolate": true,
360
+ "textParams": {
361
+ "locale": "{data.plan}"
362
+ }
363
+ }
364
+ },
365
+ {
366
+ "type": "Separator"
367
+ },
368
+ {
369
+ "type": "Control",
370
+ "scope": "#/properties/customerName"
371
+ }
372
+ ]
373
+ }
374
+ ]
375
+ }
@@ -0,0 +1,162 @@
1
+ # Example: layout sizing
2
+
3
+ **Example ID:** `layout-sizing`\
4
+ **Demo entry:** **Spec: Layout sizing** (`#spec-layout-sizing`)\
5
+ **Domain:** order intake\
6
+ **Specs covered:**
7
+
8
+ - [Layout types and semantics](../../docs/spec.md#6-layout-types-and-sizing)
9
+ - [Wrap, defaults, splitter and Spacer](../../docs/spec.md#6-layout-types-and-sizing)
10
+ - [The layout sizing model](../../docs/spec.md#6-layout-types-and-sizing)
11
+ - [configuration namespacing](../../docs/spec.md#6-layout-types-and-sizing)
12
+
13
+ Sizing lives on **two different elements**, and telling them apart is most of
14
+ the model:
15
+
16
+ | Where | What it configures | Example |
17
+ | --- | --- | --- |
18
+ | `options.layout` on a **child** | how that child participates in its parent | `{ "layout": { "span": 4 } }` |
19
+ | flat `options` on the **layout** | the container itself | `{ "gap": "1rem", "wrap": true }` |
20
+
21
+ "Flat layout options configure immediate children. `options.layout` configures
22
+ child participation."
23
+
24
+ ## Files
25
+
26
+ | File | Role |
27
+ | --- | --- |
28
+ | `schema.json` | Thirteen plain properties; the schema is deliberately dull, because the example is about arrangement. |
29
+ | `uischema.json` | Eight rows: span, weight, precedence, a hidden child, a Spacer, wrapping, and the same three children sized twice to contrast span with weight. |
30
+ | `data.json` | Valid throughout — nothing here is about validation. |
31
+ | `config.json` | `jsonformsExtended.layoutDefaults` with `gridColumns`, `gap` and `wrap`. |
32
+ | `translations.json` | English and Bulgarian. |
33
+
34
+ ## Expected behaviour
35
+
36
+ ### Span, against a grid
37
+
38
+ The first row is 4 / 8 / 4 of a 16-column grid. Widths follow the formula, with
39
+ the gap taken into account:
40
+
41
+ ```text
42
+ c = (W - (G - 1) * g) / G
43
+ spanWidth(n) = n * c + (n - 1) * g
44
+ ```
45
+
46
+ so a span of 4 with a 1rem gap resolves to `calc(25% - 0.75 * 1rem)`.
47
+
48
+ **Change `gridColumns`.** `config.json` sets 16; an individual layout may
49
+ override it. The resolution order is explicit → `layoutDefaults.gridColumns` →
50
+ renderer default → 16.
51
+
52
+ ### Weight, of what is left
53
+
54
+ The second row asks for 2 / 2 / 1, so Origin and Destination each take twice
55
+ Priority's share. **Auto is weight 1** in a horizontal layout, which is why a
56
+ row of plain controls divides evenly — equal shares are a result, not a rule.
57
+
58
+ In a vertical layout Auto means natural height instead, and weight only
59
+ distributes when the parent's height is definite.
60
+
61
+ ### Precedence, and constraints
62
+
63
+ **Fixed > Span > Weight > Auto.** The third row pins Priority at 180px and lets
64
+ Notes take the rest, up to `maxWidth: "32rem"`. Min and max are constraints on
65
+ whichever mode won, never modes themselves — a child with both `weight` and
66
+ `maxWidth` still flexes, it just stops growing at the maximum.
67
+
68
+ `minItemWidth` on the row is a **default** minimum, which a child's own
69
+ `minWidth` overrides.
70
+
71
+ ### A hidden child leaves layout
72
+
73
+ Tick **Needs approval**. The Approval code control appears — and before it does, it
74
+ consumes nothing: no share, and no gap. "Only effective visible UI-schema
75
+ children participate. Hidden children leave layout."
76
+
77
+ This is worth trying with the box unticked and the row inspected: there are two
78
+ slots, not three-with-one-empty. The previous implementation divided the row by
79
+ `elements.length`, so a hidden child still reserved a column.
80
+
81
+ ### Span is absolute; weight is relative
82
+
83
+ The clearest way to see the difference is to take one child away. **Booked by /
84
+ Team / Approved by** appear twice — once at `span` 4 / 8 / 4, once at `weight`
85
+ 1 / 2 / 1 — with **Show team** hiding the middle of each.
86
+
87
+ Untick it:
88
+
89
+ | | Before | After |
90
+ | --- | --- | --- |
91
+ | `span` 4 / 8 / 4 | 25% · 50% · 25% | 25% · 25%, **and half the row empty** |
92
+ | `weight` 1 / 2 / 1 | ¼ · ½ · ¼ | ½ · ½ |
93
+
94
+ Both are correct, and the reason is in the wording. Span resolves "against the
95
+ complete logical grid" — the grid stays sixteen columns wide whoever is in it,
96
+ so the survivors keep the four they asked for and the freed eight are simply
97
+ not used. Weight is a share of what is actually there, so it redivides.
98
+
99
+ The hidden child itself leaves entirely either way: no slot, and no gap. What
100
+ differs is whether the space it held is reclaimed.
101
+
102
+ **Which to reach for.** If a row must stay aligned with the rows above and
103
+ below it, use span — a control keeps its column whatever else is showing. If it
104
+ should always fill the width, use weight.
105
+
106
+ ### Spacer follows the parent's axis
107
+
108
+ The fifth row separates two controls with `{ "type": "Spacer", "size": 48 }`.
109
+ In a row that is 48px of **width**; the same element in a vertical layout is
110
+ 48px of height. `size` is a top-level field, not an option.
111
+
112
+ A Spacer may flex instead: `options.layout.weight` makes it the flexible push
113
+ that drives its neighbours apart.
114
+
115
+ ### Wrap
116
+
117
+ The last row sets `wrap: true` with `minItemWidth: "14rem"`. Narrow the window:
118
+ children that no longer fit move to the next line rather than shrinking past
119
+ their minimum. Without `wrap` they would shrink to the minimum and then
120
+ overflow.
121
+
122
+ `justify` is the main axis, `align` the cross axis.
123
+
124
+ ## Fallback behaviour
125
+
126
+ | Situation | Result |
127
+ | --- | --- |
128
+ | No `options.layout` on a child | Auto — weight 1 horizontally, natural height vertically. |
129
+ | `gridColumns` unset | `layoutDefaults.gridColumns`, then 16. |
130
+ | `wrap` unset | `layoutDefaults.wrap`, then false. |
131
+ | `gap` unset | `layoutDefaults.gap`, then 0. |
132
+ | `span` above `gridColumns` | Clamped, with a diagnostic. |
133
+ | `span` in a vertical layout | Ignored, with a diagnostic — it does not create a horizontal grid. |
134
+ | `span` not a positive integer, `weight` not finite and positive, a negative dimension | Ignored, with a diagnostic. |
135
+
136
+ ## Conformance scope
137
+
138
+ This walkthrough describes the portable contract. Renderer support must be checked
139
+ by a host adapter; the package validates the authored assets, not live UI behavior.
140
+
141
+ ## Fixed and automatic widths
142
+
143
+ The final groups collect the older sizing demonstrations: a single quarter,
144
+ a quarter with one or two Auto children, two fixed quarters leaving half the
145
+ row free, an overflowing 12/8/Auto row, and three equally sized Auto children.
146
+ They reuse the same order fields, so changing layout does not change the data
147
+ or its validation. Labels have matching English and Bulgarian translations.
148
+
149
+ ## Standalone host setup
150
+
151
+ Load the JSON assets listed in [the catalog](../catalog.json) into a host
152
+ with the relevant renderer capabilities. No framework registration module is
153
+ required by this package.
154
+
155
+
156
+ ## Feature navigation
157
+
158
+ Explore one feature at a time using the tabs: **Span**, **Weight**, **Sizing precedence**, **Hidden children**, **Spacer**, **Wrapping**, **Conditional columns**, **Fixed and automatic widths**. Tab titles are localized in English and Bulgarian. The tabs share the existing form data.
159
+
160
+ ## Consolidated demo coverage
161
+
162
+ Nested presentation applies spans to a Label and a Group as well as ordinary controls.
@@ -0,0 +1,10 @@
1
+ {
2
+ "showUnfocusedDescription": true,
3
+ "jsonformsExtended": {
4
+ "layoutDefaults": {
5
+ "gridColumns": 16,
6
+ "gap": "1rem",
7
+ "wrap": false
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "reference": "CN-88213",
3
+ "supplier": "Cascade Supplies",
4
+ "weightKg": 1240,
5
+ "origin": "Portland",
6
+ "destination": "Salem",
7
+ "priority": "Standard",
8
+ "notes": "Check in at reception.",
9
+ "needsApproval": false,
10
+ "showTeam": true,
11
+ "bookedBy": "A. Ferreira",
12
+ "teamName": "PLAN-REVIEW nightly",
13
+ "approvedBy": "M. Todorova"
14
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "type": "object",
3
+ "title": "Order intake",
4
+ "properties": {
5
+ "reference": {
6
+ "type": "string",
7
+ "title": "Reference"
8
+ },
9
+ "supplier": {
10
+ "type": "string",
11
+ "title": "Supplier"
12
+ },
13
+ "weightKg": {
14
+ "type": "number",
15
+ "title": "Weight (kg)"
16
+ },
17
+ "origin": {
18
+ "type": "string",
19
+ "title": "Origin"
20
+ },
21
+ "destination": {
22
+ "type": "string",
23
+ "title": "Destination"
24
+ },
25
+ "priority": {
26
+ "type": "string",
27
+ "title": "Priority"
28
+ },
29
+ "notes": {
30
+ "type": "string",
31
+ "title": "Notes"
32
+ },
33
+ "needsApproval": {
34
+ "type": "boolean",
35
+ "title": "Needs approval"
36
+ },
37
+ "approvalCode": {
38
+ "type": "string",
39
+ "title": "Approval code"
40
+ },
41
+ "showTeam": {
42
+ "type": "boolean",
43
+ "title": "Show team"
44
+ },
45
+ "bookedBy": {
46
+ "type": "string",
47
+ "title": "Booked by"
48
+ },
49
+ "teamName": {
50
+ "type": "string",
51
+ "title": "Team"
52
+ },
53
+ "approvedBy": {
54
+ "type": "string",
55
+ "title": "Approved by"
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "en": {
3
+ "control.clearValue": "Clear value",
4
+ "quarterOnly.label": "One quarter, unused space",
5
+ "quarterAuto.label": "Fixed plus Auto",
6
+ "quarterTwoAuto.label": "Fixed plus two Auto",
7
+ "unusedHalf.label": "Fixed widths leave unused space",
8
+ "overflow.label": "Overflow wraps in order",
9
+ "equalThirds.label": "All Auto, equal thirds",
10
+ "featureNavigation.section1.label": "Span",
11
+ "featureNavigation.section2.label": "Weight",
12
+ "featureNavigation.section3.label": "Sizing precedence",
13
+ "featureNavigation.section4.label": "Hidden children",
14
+ "featureNavigation.section5.label": "Spacer",
15
+ "featureNavigation.section6.label": "Wrapping",
16
+ "featureNavigation.section7.label": "Conditional columns",
17
+ "featureNavigation.section8.label": "Fixed and automatic widths",
18
+ "nestedSizing.tab.label": "Nested presentation",
19
+ "nestedSizing.label.text": "Quarter-width label",
20
+ "nestedSizing.group.label": "Nested group"
21
+ },
22
+ "bg": {
23
+ "control.clearValue": "Изчистване на стойността",
24
+ "quarterOnly.label": "Една четвърт, свободно място",
25
+ "quarterAuto.label": "Фиксирана и автоматична ширина",
26
+ "quarterTwoAuto.label": "Фиксирана и две автоматични ширини",
27
+ "unusedHalf.label": "Фиксираните ширини оставят свободно място",
28
+ "overflow.label": "Пренасяне на следващ ред",
29
+ "equalThirds.label": "Автоматични равни третини",
30
+ "featureNavigation.section1.label": "Обхват",
31
+ "featureNavigation.section2.label": "Тегло",
32
+ "featureNavigation.section3.label": "Приоритет на размерите",
33
+ "featureNavigation.section4.label": "Скрити елементи",
34
+ "featureNavigation.section5.label": "Отстояние",
35
+ "featureNavigation.section6.label": "Пренасяне",
36
+ "featureNavigation.section7.label": "Условни колони",
37
+ "featureNavigation.section8.label": "Фиксирани и автоматични ширини",
38
+ "nestedSizing.tab.label": "Вложено представяне",
39
+ "nestedSizing.label.text": "Етикет с четвърт ширина",
40
+ "nestedSizing.group.label": "Вложена група"
41
+ }
42
+ }