@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,47 @@
1
+ {
2
+ "type": "VerticalLayout",
3
+ "elements": [
4
+ {
5
+ "type": "Label",
6
+ "text": "Named UI schemas reuse the current data. Edit either name field to update both."
7
+ },
8
+ {
9
+ "type": "Template",
10
+ "name": "contact-card",
11
+ "elements": [
12
+ {
13
+ "type": "Label",
14
+ "name": "heading",
15
+ "text": "Custom heading"
16
+ },
17
+ {
18
+ "type": "Control",
19
+ "name": "body",
20
+ "scope": "#/properties/name",
21
+ "label": "Contact name"
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ "type": "Template",
27
+ "name": "contact-card"
28
+ },
29
+ {
30
+ "type": "Template",
31
+ "name": "nested-card",
32
+ "elements": [
33
+ {
34
+ "type": "Label",
35
+ "name": "heading",
36
+ "text": "Inherited heading"
37
+ },
38
+ {
39
+ "type": "Control",
40
+ "name": "body",
41
+ "scope": "#/properties/email",
42
+ "label": "Inherited email"
43
+ }
44
+ ]
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,2 @@
1
+ import type { JsonFormsUISchemaRegistryEntry } from '@jsonforms/core';
2
+ export declare const uischemas: JsonFormsUISchemaRegistryEntry[];
@@ -0,0 +1,56 @@
1
+ [
2
+ {
3
+ "uischema": {
4
+ "type": "Group",
5
+ "name": "contact-card",
6
+ "label": "Reusable contact",
7
+ "elements": [
8
+ {
9
+ "type": "Slot",
10
+ "name": "heading",
11
+ "elements": [
12
+ {
13
+ "type": "Label",
14
+ "text": "Default heading"
15
+ }
16
+ ]
17
+ },
18
+ {
19
+ "type": "Slot",
20
+ "name": "body",
21
+ "elements": [
22
+ {
23
+ "type": "Control",
24
+ "scope": "#/properties/name",
25
+ "label": "Default name"
26
+ }
27
+ ]
28
+ },
29
+ {
30
+ "type": "Slot",
31
+ "name": "optional"
32
+ }
33
+ ]
34
+ }
35
+ },
36
+ {
37
+ "uischema": {
38
+ "type": "Group",
39
+ "name": "nested-card",
40
+ "label": "Nested composition",
41
+ "elements": [
42
+ {
43
+ "type": "Template",
44
+ "name": "contact-card",
45
+ "elements": [
46
+ {
47
+ "type": "Label",
48
+ "name": "heading",
49
+ "text": "Local heading overrides inherited heading"
50
+ }
51
+ ]
52
+ }
53
+ ]
54
+ }
55
+ }
56
+ ]
@@ -0,0 +1,325 @@
1
+ # Example: temporal controls
2
+
3
+ **Example ID:** `temporal-controls`\
4
+ **Demo entry:** **Spec: Temporal controls** (`#spec-temporal-controls`)\
5
+ **Domain:** an appointment booking\
6
+ **Specs covered:**
7
+
8
+ - [Date, time and date-time controls](../../docs/spec.md#1819-scalar-controls-and-temporal-editing)
9
+ - [Temporal controls: schema-driven behavior](../../docs/spec.md#1819-scalar-controls-and-temporal-editing)
10
+ - [Duration control](../../docs/spec.md#1819-scalar-controls-and-temporal-editing)
11
+ - [Schema-driven and UI-driven format selection](../../docs/spec.md#1819-scalar-controls-and-temporal-editing)
12
+ - [Temporal serialization and picker bounds](../../docs/spec.md#1819-scalar-controls-and-temporal-editing)
13
+
14
+ Four controls that all store **strings**, split by *how the control was
15
+ chosen*. That split is the whole example, because it decides something people
16
+ routinely get wrong: **what validates the value.**
17
+
18
+ | | Selected by the schema | Selected by the UI schema |
19
+ | --- | --- | --- |
20
+ | How | `{"type":"string","format":"date"}` | `{"type":"string"}` + `options.format: "date"` |
21
+ | Picks the renderer | yes | yes |
22
+ | Gives the validator something to check | **yes** | **no** |
23
+ | The value must be | RFC 3339 for that keyword | anything; only `pattern` applies |
24
+
25
+ Both routes reach the same renderer and take the same options. They are not
26
+ interchangeable, and the second column is why a form can legitimately store
27
+ `YYYY/MM/DD h:mm a` with nothing objecting.
28
+
29
+ ## Files
30
+
31
+ | File | Role |
32
+ | --- | --- |
33
+ | `schema.json` | Four groups: `schemaBased` with format keywords, `uiSchemaBased` as plain strings, `bounded` for the range limits, `composed` for `$ref`, tuples and mixed types. |
34
+ | `uischema.json` | A `Categorization`, one tab per group. |
35
+ | — | The fixture needs `createFormsAjv()`; the plain validator cannot compile its `$data` bound. |
36
+ | `data.json` | A filled booking. One value is deliberately out of range — see below. |
37
+ | `translations.json` | English and Bulgarian. |
38
+
39
+ ## Selected by the schema
40
+
41
+ ```json
42
+ { "time": { "type": "string", "format": "time" } }
43
+ ```
44
+
45
+ No options at all, so every default applies:
46
+
47
+ | Option | Default | Writes |
48
+ | --- | --- | --- |
49
+ | `dateSaveFormat` | `YYYY-MM-DD` | `2026-10-14` |
50
+ | `timeSaveFormat` | `HH:mm:ssZ` | `09:30:00Z` |
51
+ | `dateTimeSaveFormat` | `YYYY-MM-DDTHH:mm:ssZ` | `2026-10-13T17:00:00Z` |
52
+
53
+ Each satisfies the keyword that selected its control. **That is not a
54
+ coincidence, and it used to be false** — the defaults were `HH:mm:ss` and
55
+ `YYYY-MM-DD HH:mm`, while RFC 3339 requires seconds *and* an offset. A time
56
+ control went invalid the moment anyone used the picker, and the picker could
57
+ not repair it, because every value it could produce was invalid. See
58
+ [the specification](../../docs/spec.md#1819-scalar-controls-and-temporal-editing).
59
+
60
+ `duration` is here too: `PT1H30M`, ISO 8601, staged in a picker that Cancel
61
+ discards, and `P0D` for zero.
62
+
63
+ ### Seconds are a display decision, not a storage one
64
+
65
+ The save format always carries seconds — RFC 3339 requires them — but whether
66
+ they are **on screen** is the display format's business. the renderer contract: "seconds in the
67
+ format enable seconds interaction".
68
+
69
+ | Control | `timeFormat` | Shows | Picker columns |
70
+ | --- | --- | --- | --- |
71
+ | Start time | default | `09:30` | hour, minute |
72
+ | Start time, to the second | `HH:mm:ss` | `09:30:45` | hour, minute, **second** |
73
+
74
+ Both store a value with seconds. The difference is whether anyone can set
75
+ them — and that has a consequence worth knowing:
76
+
77
+ > **Seconds you cannot see are zeroed by the next edit.** Start from
78
+ > `09:30:45Z`, type `11:15` into the two-column control, and the stored value
79
+ > becomes `11:15:00…`. The seconds were never on screen to be preserved.
80
+
81
+ So if seconds carry meaning in your data, put them in the display format. If
82
+ they do not, the default is the right one and the trailing `:00` is honest.
83
+
84
+ ### Overriding a save format here is a trap
85
+
86
+ Setting `timeSaveFormat: "HH:mm"` on a control that carries `format: "time"`
87
+ makes it write `23:03`, which that keyword rejects — an unfixable error that
88
+ reads like a display setting. The renderer now says so:
89
+
90
+ ```
91
+ temporal.saveFormatInvalid: the save format "HH:mm" produces values that
92
+ `format: "time"` rejects, so the control cannot be made valid.
93
+ ```
94
+
95
+ A console warning rather than a message in the form, because it is an
96
+ authoring mistake and the person filling in the form already sees the
97
+ validation error. This follows the precedent set for `Categorization`'s
98
+ `initial`.
99
+
100
+ If a house format is what you want, that is what the next tab is for.
101
+
102
+ ## Selected by the UI schema
103
+
104
+ The schema says only `type: "string"`. `options.format` picks the renderer,
105
+ and nothing checks the shape.
106
+
107
+ | Control | Options | Stores |
108
+ | --- | --- | --- |
109
+ | Year and month picker | `format: "date"`, `views: ["year","month"]`, `dateFormat: "YYYY.MM"`, `dateSaveFormat: "YYYY-MM"` | `2027-01` |
110
+ | Opening time | `format: "time"`, `ampm: true`, `timeSaveFormat: "HH:mm"` | `08:00` |
111
+ | Opening time, to the second | the same, with `timeFormat`/`timeSaveFormat` carrying `ss` | `08:00:30` |
112
+ | Collection window | the same seconds-bearing formats, plus `views: ["hours","minutes"]` | `09:30:00` |
113
+ | Published at | `format: "date-time"`, `dateTimeFormat: "DD-MM-YY hh:mm a"`, `dateTimeSaveFormat: "YYYY/MM/DD h:mm a"` | `2026/11/02 3:05 pm` |
114
+ | Published at, to the second | the same, with `ss` in both | `2026/11/02 3:05:30 pm` |
115
+ | Published at, chosen to the minute | the same, plus `views: ["year","day","hours","minutes"]` | `2026/11/02 3:05:30 pm` |
116
+
117
+ Each of `time` and `date-time` appears **twice**, with and without seconds, so
118
+ the pair can be compared directly. On this side the save format is free too,
119
+ so a with-seconds control can store a bare `HH:mm:ss` — no offset, and nothing
120
+ to object.
121
+
122
+ **`08:00` is the point.** Under `format: "time"` it could never validate;
123
+ here there is no keyword to object, and it is exactly what the form wants to
124
+ store. The same goes for the third row, whose stored spelling is nobody's
125
+ standard but this form's.
126
+
127
+ `pattern` is the only validation available, and the first control uses it:
128
+ `^[0-9]{4}-[0-9]{2}$`. Type a month by hand that does not match and the error
129
+ appears — from `pattern`, not from any format.
130
+
131
+ ### `views` names the panels, never the storage
132
+
133
+ `views` is **not date-only**. A date control takes `year`, `month`, `day`; a
134
+ time control takes `hours`, `minutes`, `seconds`; a date-time control takes
135
+ both.
136
+
137
+ | Control here | `views` | What changes |
138
+ | --- | --- | --- |
139
+ | Year and month picker | `["year","month"]` | The calendar stops at months |
140
+ | Collection window | `["hours","minutes"]` | The picker drops its **seconds column** |
141
+ | Published at, chosen to the minute | `["year","day","hours","minutes"]` | Only the time half applies |
142
+
143
+ **Compare "Opening time, to the second" with "Collection window."** The two
144
+ carry the *same* `timeFormat` and `timeSaveFormat` — both display and store
145
+ `HH:mm:ss` — and differ only by `views`. Open each: the first offers three
146
+ columns, the second two, and both still store seconds. That is the whole
147
+ point, and it is why the fixture demonstrates the option against a
148
+ seconds-bearing format rather than a convenient one.
149
+
150
+ Before this, granularity was **inferred from the save format** — no `D` meant
151
+ a month picker. That is the same coupling backwards: it let the storage decide
152
+ the interaction. The inference survives only as a fallback when `views` is
153
+ absent.
154
+
155
+ Two details worth knowing:
156
+
157
+ - **A date-time control applies only the time half.** Its picker always offers
158
+ a full date, so narrowing the calendar would leave it unable to express a
159
+ value it has to store. The date views in that array are accepted and
160
+ ignored.
161
+ - **An array naming no view of a kind leaves that half to the display
162
+ format**, rather than blanking it — so `views: ["year","month"]` on a *time*
163
+ control changes nothing, instead of producing an empty panel.
164
+
165
+ ### `ampm` is presentation
166
+
167
+ A twelve-hour display over whatever is stored. It changes no save format.
168
+
169
+ ## Restricting the range
170
+
171
+ `formatMinimum`, `formatMaximum` and their exclusive forms limit **what the
172
+ picker offers**. Section 18: "the preventive bound behavior above follows
173
+ effective `restrict`".
174
+
175
+ | Property | Schema | Effect |
176
+ | --- | --- | --- |
177
+ | Booking date | `formatMinimum`/`formatMaximum` across October | Only October. Both bounds are themselves selectable. |
178
+ | Strictly after 19 October | `formatExclusiveMinimum: "2026-10-19"` | The 19th is greyed out; the first selectable day is the 20th. |
179
+ | Within office hours | a `time` range | Hours outside 09:00–17:00 are not offered. |
180
+ | Appointment slot | a `date-time` range | Days outside are greyed out; hours are narrowed on the **first and last day only**. |
181
+
182
+ ### Exclusivity is resolved at the picker's precision
183
+
184
+ A calendar offering whole days cannot express "after the 19th but not the 19th
185
+ itself" — so an exclusive lower bound starts at the 20th and an exclusive
186
+ upper bound ends at the 18th. That is the specification's own worked example,
187
+ and the same stepping applies a minute at a time at minute precision.
188
+
189
+ ### A bound never rewrites stored data
190
+
191
+ The last control has the same October bounds with **`restrict: false`** and a
192
+ value of `2026-12-24`. The picker offers every date, the value is left exactly
193
+ as it is, and validation still objects — "does not authorize clamping existing
194
+ data". This is the one deliberate error the example ships with.
195
+
196
+ The four keywords come from `ajv-formats`, not JSON Schema, and Ajv compares
197
+ them only when the schema carries a `format` it can order — so they belong on
198
+ the schema-based side and do nothing for a UI-selected control.
199
+
200
+ ### Restriction precedence
201
+
202
+ `restrict` resolves from element `options.restrict`, then authored flat
203
+ `config.restrict`, then **`true`** — §15's shared preferred default. The
204
+ `jsonformsExtended` namespace has no `restrict` setting. Renderers must
205
+ preserve the difference between an omitted host setting and JSON Forms core's
206
+ injected `restrict: false` when applying the preferred default.
207
+
208
+ ## In other structures
209
+
210
+ The same controls, reached the way a real schema reaches them.
211
+
212
+ ### A `$ref` shared by two properties
213
+
214
+ ```json
215
+ "$defs": { "dateRange": { "type": "object", "properties": {
216
+ "from": { "type": "string", "format": "date" },
217
+ "to": { "type": "string", "format": "date", "formatMinimum": { "$data": "1/from" } }
218
+ } } }
219
+ ```
220
+
221
+ `bookingPeriod` and `reportPeriod` both point at it. Each gets its own pickers
222
+ and its own data; the definition is shared, the state is not.
223
+
224
+ ### `$data`: one end of a range against the other
225
+
226
+ `formatMinimum: { "$data": "1/from" }` is why the bound keywords are worth
227
+ having in pairs. The pointer is a **JSON Relative Pointer**, relative to the
228
+ instance: `1/from` means up one level from `to`, then `from`. Invert a period
229
+ and the error appears on `to`.
230
+
231
+ The picker honours it too — the calendar for `to` greys out everything before
232
+ `from`, and follows along as `from` changes.
233
+
234
+ > **This needs a validator that enables `$data`.** Ajv rejects the schema at
235
+ > *compile* time otherwise — `formatMinimum value must be ["string"]` — so the
236
+ > form does not degrade, it stops. JSON Forms' plain `createAjv()` does not
237
+ > enable it; `createFormsAjv()` does, and the web component uses it by
238
+ > default.
239
+
240
+ ### Both tuple spellings
241
+
242
+ The fixture uses draft-07 positional `items` so its two date positions are
243
+ validated by the default profile. A renderer recognizing `prefixItems` does not
244
+ mean a draft-07 validator enforces it. For a 2020-12 form, use that dialect's
245
+ meta-schema and validator together; do not mix its tuple keywords into draft-07.
246
+
247
+ ## Expected behaviour
248
+
249
+ | Action | Result |
250
+ | --- | --- |
251
+ | Open a schema-based picker and choose | The field shows the display format; the data takes a value the keyword accepts. |
252
+ | Clear a value | Empty, not today's date. |
253
+ | Clear **Appointment date** | Required — "Choose an appointment date." |
254
+ | Type a bad month in the second tab | A `pattern` error; no format is involved. |
255
+ | Compare the two **Opening time** controls | Same data shape, one with a seconds column and one without. |
256
+ | Edit the two-column time | The seconds become `00`; they were never on screen. |
257
+ | Open **Year and month picker** | Months, not days — and the save format has no bearing on that. |
258
+ | Open **Booking date** | September and November are greyed out. |
259
+ | Open **Strictly after 19 October** | The 19th is greyed out; the 20th is not. |
260
+ | Open **Same bounds, restrict off** | Every date is offered, and the error stays. |
261
+ | Invert a booking period | `to` reports `formatMinimum`, and its calendar greys out the earlier days. |
262
+ | Change **From** | The bound on **To** follows it. |
263
+
264
+ ## Not implemented
265
+
266
+ From gaps §6.5 and §7.4:
267
+
268
+ | Missing | Consequence |
269
+ | --- | --- |
270
+ | `showActions`, `okLabel`, `cancelLabel` on the pickers | Picker edits commit immediately; nothing to stage or cancel. (The duration control does have this.) |
271
+ | `mask` | No format-aware typing mask, and therefore no `mask: false` opt-out. |
272
+ | `pickerIcon`, `clearable`, `timezone` / `saveTimezone` | Not read. `allowClear` follows `enabled` unconditionally. |
273
+ | Localized `L` / `LT` display defaults | Hard-coded `YYYY-MM-DD` and `HH:mm` instead of the localized token with those as fallbacks. |
274
+ | Duration: guided text editing, partial-prefix drafts | Typing commits each partial string directly. (The field labels **are** localized now — see below.) |
275
+
276
+ There is also a **second, competing renderer**: `NativeControl` matches
277
+ `isDateControl` / `isTimeControl` at rank 2 and renders a bare
278
+ `<input type="date">`. The pickers win at rank 4 in the default registry, but
279
+ a consumer assembling a partial registry can get the native input unexpectedly.
280
+
281
+ ### The duration picker follows the locale
282
+
283
+ Switch **Locale** to German or Bulgarian with the picker open. Its unit
284
+ labels, the years-to-seconds / weeks mode switch, the add and remove actions
285
+ and the Apply and Cancel buttons all change language — and this example's
286
+ `translations.json` defines none of them.
287
+
288
+ That is the point of it: a form's catalog is authored for the form's own
289
+ labels, so the renderer set's own strings have to come from somewhere else.
290
+ They fall back to the **locale bundle** for the current language and only then
291
+ to English. See
292
+ [the specification](../../docs/spec.md#1819-scalar-controls-and-temporal-editing).
293
+
294
+ Switch to a language no bundle carries — Japanese — and the picker is English
295
+ again while the rest of the form is unaffected. A missing bundle degrades to
296
+ English rather than to blank labels.
297
+
298
+ ### Timezone display
299
+
300
+ A valid `time` or `date-time` carries an offset, and the picker shows it in
301
+ the **viewer's** timezone — `09:30:00+02:00` reads as `03:30` in a UTC−4
302
+ browser, and editing writes the browser's offset. The fixture stores `Z`
303
+ values so the data is unambiguous, and the tests assert the *shape* of a
304
+ displayed time rather than a wall clock. `timezone` / `saveTimezone` are
305
+ PROVISIONAL in the specification and unimplemented, so there is no way to
306
+ express a different intent yet.
307
+
308
+ ## Conformance scope
309
+
310
+ This walkthrough describes the portable contract. Renderer support must be checked
311
+ by a host adapter; the package validates the authored assets, not live UI behavior.
312
+
313
+ ## Week-based duration and action visibility
314
+
315
+ The **Support period** field starts at `P2W` and sets `showActions: false`.
316
+ Compare it with **Session length**, which keeps the default actions. Both
317
+ remain ISO 8601 duration strings; hiding the action bar does not disable editing
318
+ or turn the value into a date. The added value is valid under the demo validator
319
+ and adds no error to the validation state documented above.
320
+
321
+ ## Standalone host setup
322
+
323
+ Load the JSON assets listed in [the catalog](../catalog.json) into a host
324
+ with the relevant renderer capabilities. No framework registration module is
325
+ required by this package.
@@ -0,0 +1,44 @@
1
+ {
2
+ "schemaBased": {
3
+ "date": "2026-10-14",
4
+ "time": "09:30:00Z",
5
+ "datetime": "2026-10-13T17:00:00Z",
6
+ "duration": "PT1H30M",
7
+ "timeWithSeconds": "09:30:45Z",
8
+ "weeks": "P2W"
9
+ },
10
+ "uiSchemaBased": {
11
+ "month": "2027-01",
12
+ "time": "08:00",
13
+ "datetime": "2026/11/02 3:05 pm",
14
+ "timeSeconds": "08:00:30",
15
+ "datetimeSeconds": "2026/11/02 3:05:30 pm",
16
+ "coarseTime": "09:30:00"
17
+ },
18
+ "bounded": {
19
+ "bookingDate": "2026-10-14",
20
+ "notBefore": "2026-10-20",
21
+ "officeHours": "10:00:00Z",
22
+ "slot": "2026-10-07T11:00:00Z",
23
+ "unrestricted": "2026-12-24"
24
+ },
25
+ "composed": {
26
+ "bookingPeriod": {
27
+ "from": "2026-10-01",
28
+ "to": "2026-10-05"
29
+ },
30
+ "reportPeriod": {
31
+ "from": "2026-11-01",
32
+ "to": "2026-11-30"
33
+ },
34
+ "tupleRange": [
35
+ "2026-10-01",
36
+ "2026-10-05"
37
+ ],
38
+ "legacyTupleRange": [
39
+ "2026-10-01",
40
+ "2026-10-05"
41
+ ],
42
+ "maybeDate": "2026-10-14"
43
+ }
44
+ }
@@ -0,0 +1,208 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "schemaBased": {
5
+ "type": "object",
6
+ "title": "Selected by the schema",
7
+ "properties": {
8
+ "date": {
9
+ "type": "string",
10
+ "format": "date",
11
+ "title": "Appointment date",
12
+ "description": "format: date. Validated as a calendar date."
13
+ },
14
+ "time": {
15
+ "type": "string",
16
+ "format": "time",
17
+ "title": "Start time",
18
+ "description": "format: time. RFC 3339 requires seconds and an offset."
19
+ },
20
+ "datetime": {
21
+ "type": "string",
22
+ "format": "date-time",
23
+ "title": "Send reminder at",
24
+ "description": "format: date-time."
25
+ },
26
+ "duration": {
27
+ "type": "string",
28
+ "format": "duration",
29
+ "title": "Session length",
30
+ "description": "format: duration. An ISO 8601 period."
31
+ },
32
+ "timeWithSeconds": {
33
+ "type": "string",
34
+ "format": "time",
35
+ "title": "Start time, to the second",
36
+ "description": "The same format keyword, with seconds on screen."
37
+ },
38
+ "weeks": {
39
+ "type": "string",
40
+ "format": "duration",
41
+ "title": "Support period"
42
+ }
43
+ },
44
+ "required": [
45
+ "date"
46
+ ]
47
+ },
48
+ "uiSchemaBased": {
49
+ "type": "object",
50
+ "title": "Selected by the UI schema",
51
+ "properties": {
52
+ "month": {
53
+ "type": "string",
54
+ "title": "Renewal month",
55
+ "pattern": "^[0-9]{4}-[0-9]{2}$",
56
+ "description": "A plain string. Only `pattern` validates it."
57
+ },
58
+ "time": {
59
+ "type": "string",
60
+ "title": "Opening time",
61
+ "description": "A plain string shown on a twelve-hour clock."
62
+ },
63
+ "datetime": {
64
+ "type": "string",
65
+ "title": "Published at",
66
+ "description": "A plain string stored in a house format."
67
+ },
68
+ "timeSeconds": {
69
+ "type": "string",
70
+ "title": "Opening time, to the second",
71
+ "description": "A plain string storing HH:mm:ss."
72
+ },
73
+ "datetimeSeconds": {
74
+ "type": "string",
75
+ "title": "Published at, to the second",
76
+ "description": "A plain string storing seconds in a house format."
77
+ },
78
+ "coarseTime": {
79
+ "type": "string",
80
+ "title": "Collection window",
81
+ "description": "Stores seconds, but is chosen to the minute. `views` and the save format are independent."
82
+ }
83
+ }
84
+ },
85
+ "bounded": {
86
+ "type": "object",
87
+ "title": "Restricting the range",
88
+ "properties": {
89
+ "bookingDate": {
90
+ "type": "string",
91
+ "format": "date",
92
+ "title": "Booking date",
93
+ "formatMinimum": "2026-10-01",
94
+ "formatMaximum": "2026-10-31"
95
+ },
96
+ "notBefore": {
97
+ "type": "string",
98
+ "format": "date",
99
+ "title": "Strictly after 19 October",
100
+ "formatExclusiveMinimum": "2026-10-19"
101
+ },
102
+ "officeHours": {
103
+ "type": "string",
104
+ "format": "time",
105
+ "title": "Within office hours",
106
+ "formatMinimum": "09:00:00Z",
107
+ "formatMaximum": "17:00:00Z"
108
+ },
109
+ "slot": {
110
+ "type": "string",
111
+ "format": "date-time",
112
+ "title": "Appointment slot",
113
+ "formatMinimum": "2026-10-05T09:00:00Z",
114
+ "formatMaximum": "2026-10-09T17:00:00Z"
115
+ },
116
+ "unrestricted": {
117
+ "type": "string",
118
+ "format": "date",
119
+ "title": "Same bounds, restrict off",
120
+ "formatMinimum": "2026-10-01",
121
+ "formatMaximum": "2026-10-31"
122
+ }
123
+ }
124
+ },
125
+ "composed": {
126
+ "type": "object",
127
+ "title": "In other structures",
128
+ "properties": {
129
+ "bookingPeriod": {
130
+ "$ref": "#/$defs/dateRange",
131
+ "title": "Booking period"
132
+ },
133
+ "reportPeriod": {
134
+ "$ref": "#/$defs/dateRange",
135
+ "title": "Report period"
136
+ },
137
+ "tupleRange": {
138
+ "type": "array",
139
+ "title": "Cover (tuple)",
140
+ "minItems": 2,
141
+ "items": [
142
+ {
143
+ "type": "string",
144
+ "format": "date",
145
+ "title": "From"
146
+ },
147
+ {
148
+ "type": "string",
149
+ "format": "date",
150
+ "title": "To"
151
+ }
152
+ ]
153
+ },
154
+ "legacyTupleRange": {
155
+ "type": "array",
156
+ "title": "Cover (draft-07 tuple)",
157
+ "items": [
158
+ {
159
+ "type": "string",
160
+ "format": "date",
161
+ "title": "From"
162
+ },
163
+ {
164
+ "type": "string",
165
+ "format": "date",
166
+ "title": "To"
167
+ }
168
+ ],
169
+ "additionalItems": false,
170
+ "minItems": 2
171
+ },
172
+ "maybeDate": {
173
+ "type": [
174
+ "string",
175
+ "null"
176
+ ],
177
+ "format": "date",
178
+ "title": "Optional date"
179
+ }
180
+ }
181
+ }
182
+ },
183
+ "$defs": {
184
+ "dateRange": {
185
+ "type": "object",
186
+ "properties": {
187
+ "from": {
188
+ "type": "string",
189
+ "format": "date",
190
+ "title": "From"
191
+ },
192
+ "to": {
193
+ "type": "string",
194
+ "format": "date",
195
+ "title": "To",
196
+ "formatMinimum": {
197
+ "$data": "1/from"
198
+ }
199
+ }
200
+ },
201
+ "required": [
202
+ "from",
203
+ "to"
204
+ ]
205
+ }
206
+ },
207
+ "$schema": "http://json-schema.org/draft-07/schema#"
208
+ }