@chobantonov/jsonforms-react-renderer-common 0.0.0-stage → 0.1.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 (624) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +79 -2
  3. package/lib/cells/CellSummary.cjs.js +2 -0
  4. package/lib/cells/CellSummary.cjs.js.map +1 -0
  5. package/lib/cells/CellSummary.d.ts +14 -0
  6. package/lib/cells/CellSummary.esm.js +29 -0
  7. package/lib/cells/CellSummary.esm.js.map +1 -0
  8. package/lib/cells/cellMode.cjs.js +2 -0
  9. package/lib/cells/cellMode.cjs.js.map +1 -0
  10. package/lib/cells/cellMode.d.ts +14 -0
  11. package/lib/cells/cellMode.esm.js +6 -0
  12. package/lib/cells/cellMode.esm.js.map +1 -0
  13. package/lib/cells/compositeActions.cjs.js +2 -0
  14. package/lib/cells/compositeActions.cjs.js.map +1 -0
  15. package/lib/cells/compositeActions.d.ts +7 -0
  16. package/lib/cells/compositeActions.esm.js +14 -0
  17. package/lib/cells/compositeActions.esm.js.map +1 -0
  18. package/lib/cells/compositeCellTester.cjs.js +2 -0
  19. package/lib/cells/compositeCellTester.cjs.js.map +1 -0
  20. package/lib/cells/compositeCellTester.d.ts +2 -0
  21. package/lib/cells/compositeCellTester.esm.js +12 -0
  22. package/lib/cells/compositeCellTester.esm.js.map +1 -0
  23. package/lib/cells/compositeSummary.cjs.js +2 -0
  24. package/lib/cells/compositeSummary.cjs.js.map +1 -0
  25. package/lib/cells/compositeSummary.d.ts +10 -0
  26. package/lib/cells/compositeSummary.esm.js +44 -0
  27. package/lib/cells/compositeSummary.esm.js.map +1 -0
  28. package/lib/cells/useCompositeCellPresentation.cjs.js +2 -0
  29. package/lib/cells/useCompositeCellPresentation.cjs.js.map +1 -0
  30. package/lib/cells/useCompositeCellPresentation.d.ts +7 -0
  31. package/lib/cells/useCompositeCellPresentation.esm.js +18 -0
  32. package/lib/cells/useCompositeCellPresentation.esm.js.map +1 -0
  33. package/lib/cells/useCompositeDraft.cjs.js +2 -0
  34. package/lib/cells/useCompositeDraft.cjs.js.map +1 -0
  35. package/lib/cells/useCompositeDraft.d.ts +52 -0
  36. package/lib/cells/useCompositeDraft.esm.js +95 -0
  37. package/lib/cells/useCompositeDraft.esm.js.map +1 -0
  38. package/lib/collections/CollectionErrorNavigation.cjs.js +2 -0
  39. package/lib/collections/CollectionErrorNavigation.cjs.js.map +1 -0
  40. package/lib/collections/CollectionErrorNavigation.d.ts +12 -0
  41. package/lib/collections/CollectionErrorNavigation.esm.js +68 -0
  42. package/lib/collections/CollectionErrorNavigation.esm.js.map +1 -0
  43. package/lib/collections/arrayChoices.cjs.js +2 -0
  44. package/lib/collections/arrayChoices.cjs.js.map +1 -0
  45. package/lib/collections/arrayChoices.d.ts +85 -0
  46. package/lib/collections/arrayChoices.esm.js +54 -0
  47. package/lib/collections/arrayChoices.esm.js.map +1 -0
  48. package/lib/collections/collectionPagination.cjs.js +2 -0
  49. package/lib/collections/collectionPagination.cjs.js.map +1 -0
  50. package/lib/collections/collectionPagination.d.ts +22 -0
  51. package/lib/collections/collectionPagination.esm.js +51 -0
  52. package/lib/collections/collectionPagination.esm.js.map +1 -0
  53. package/lib/collections/columnResize.cjs.js +2 -0
  54. package/lib/collections/columnResize.cjs.js.map +1 -0
  55. package/lib/collections/columnResize.d.ts +16 -0
  56. package/lib/collections/columnResize.esm.js +85 -0
  57. package/lib/collections/columnResize.esm.js.map +1 -0
  58. package/lib/collections/rowDetail.cjs.js +2 -0
  59. package/lib/collections/rowDetail.cjs.js.map +1 -0
  60. package/lib/collections/rowDetail.d.ts +34 -0
  61. package/lib/collections/rowDetail.esm.js +106 -0
  62. package/lib/collections/rowDetail.esm.js.map +1 -0
  63. package/lib/collections/tableColumns.cjs.js +2 -0
  64. package/lib/collections/tableColumns.cjs.js.map +1 -0
  65. package/lib/collections/tableColumns.d.ts +13 -0
  66. package/lib/collections/tableColumns.esm.js +16 -0
  67. package/lib/collections/tableColumns.esm.js.map +1 -0
  68. package/lib/collections/useArrayPanelState.cjs.js +2 -0
  69. package/lib/collections/useArrayPanelState.cjs.js.map +1 -0
  70. package/lib/collections/useArrayPanelState.d.ts +7 -0
  71. package/lib/collections/useArrayPanelState.esm.js +18 -0
  72. package/lib/collections/useArrayPanelState.esm.js.map +1 -0
  73. package/lib/collections/useCollectionDelete.cjs.js +2 -0
  74. package/lib/collections/useCollectionDelete.cjs.js.map +1 -0
  75. package/lib/collections/useCollectionDelete.d.ts +17 -0
  76. package/lib/collections/useCollectionDelete.esm.js +38 -0
  77. package/lib/collections/useCollectionDelete.esm.js.map +1 -0
  78. package/lib/collections/useTableSelection.cjs.js +2 -0
  79. package/lib/collections/useTableSelection.cjs.js.map +1 -0
  80. package/lib/collections/useTableSelection.d.ts +11 -0
  81. package/lib/collections/useTableSelection.esm.js +41 -0
  82. package/lib/collections/useTableSelection.esm.js.map +1 -0
  83. package/lib/composition/AllOfRenderer.cjs.js +2 -0
  84. package/lib/composition/AllOfRenderer.cjs.js.map +1 -0
  85. package/lib/composition/AllOfRenderer.d.ts +5 -0
  86. package/lib/composition/AllOfRenderer.esm.js +33 -0
  87. package/lib/composition/AllOfRenderer.esm.js.map +1 -0
  88. package/lib/composition/CombinatorBranch.cjs.js +2 -0
  89. package/lib/composition/CombinatorBranch.cjs.js.map +1 -0
  90. package/lib/composition/CombinatorBranch.d.ts +17 -0
  91. package/lib/composition/CombinatorBranch.esm.js +54 -0
  92. package/lib/composition/CombinatorBranch.esm.js.map +1 -0
  93. package/lib/composition/CombinatorProperties.cjs.js +2 -0
  94. package/lib/composition/CombinatorProperties.cjs.js.map +1 -0
  95. package/lib/composition/CombinatorProperties.d.ts +12 -0
  96. package/lib/composition/CombinatorProperties.esm.js +20 -0
  97. package/lib/composition/CombinatorProperties.esm.js.map +1 -0
  98. package/lib/composition/ScalarCompositionControl.cjs.js +2 -0
  99. package/lib/composition/ScalarCompositionControl.cjs.js.map +1 -0
  100. package/lib/composition/ScalarCompositionControl.d.ts +6 -0
  101. package/lib/composition/ScalarCompositionControl.esm.js +22 -0
  102. package/lib/composition/ScalarCompositionControl.esm.js.map +1 -0
  103. package/lib/composition/choiceCards.cjs.js +2 -0
  104. package/lib/composition/choiceCards.cjs.js.map +1 -0
  105. package/lib/composition/choiceCards.d.ts +36 -0
  106. package/lib/composition/choiceCards.esm.js +162 -0
  107. package/lib/composition/choiceCards.esm.js.map +1 -0
  108. package/lib/composition/combinators.cjs.js +2 -0
  109. package/lib/composition/combinators.cjs.js.map +1 -0
  110. package/lib/composition/combinators.d.ts +40 -0
  111. package/lib/composition/combinators.esm.js +26 -0
  112. package/lib/composition/combinators.esm.js.map +1 -0
  113. package/lib/composition/discriminatorBranch.cjs.js +2 -0
  114. package/lib/composition/discriminatorBranch.cjs.js.map +1 -0
  115. package/lib/composition/discriminatorBranch.d.ts +6 -0
  116. package/lib/composition/discriminatorBranch.esm.js +41 -0
  117. package/lib/composition/discriminatorBranch.esm.js.map +1 -0
  118. package/lib/composition/scalarComposition.cjs.js +2 -0
  119. package/lib/composition/scalarComposition.cjs.js.map +1 -0
  120. package/lib/composition/scalarComposition.d.ts +27 -0
  121. package/lib/composition/scalarComposition.esm.js +76 -0
  122. package/lib/composition/scalarComposition.esm.js.map +1 -0
  123. package/lib/composition/useCombinatorSelection.cjs.js +2 -0
  124. package/lib/composition/useCombinatorSelection.cjs.js.map +1 -0
  125. package/lib/composition/useCombinatorSelection.d.ts +6 -0
  126. package/lib/composition/useCombinatorSelection.esm.js +22 -0
  127. package/lib/composition/useCombinatorSelection.esm.js.map +1 -0
  128. package/lib/composition/useScalarComposition.cjs.js +2 -0
  129. package/lib/composition/useScalarComposition.cjs.js.map +1 -0
  130. package/lib/composition/useScalarComposition.d.ts +18 -0
  131. package/lib/composition/useScalarComposition.esm.js +24 -0
  132. package/lib/composition/useScalarComposition.esm.js.map +1 -0
  133. package/lib/controls/FileArrayInput.cjs.js +2 -0
  134. package/lib/controls/FileArrayInput.cjs.js.map +1 -0
  135. package/lib/controls/FileArrayInput.d.ts +19 -0
  136. package/lib/controls/FileArrayInput.esm.js +232 -0
  137. package/lib/controls/FileArrayInput.esm.js.map +1 -0
  138. package/lib/controls/controlHelp.cjs.js +2 -0
  139. package/lib/controls/controlHelp.cjs.js.map +1 -0
  140. package/lib/controls/controlHelp.d.ts +15 -0
  141. package/lib/controls/controlHelp.esm.js +9 -0
  142. package/lib/controls/controlHelp.esm.js.map +1 -0
  143. package/lib/controls/inputAdornments.cjs.js +2 -0
  144. package/lib/controls/inputAdornments.cjs.js.map +1 -0
  145. package/lib/controls/inputAdornments.d.ts +32 -0
  146. package/lib/controls/inputAdornments.esm.js +192 -0
  147. package/lib/controls/inputAdornments.esm.js.map +1 -0
  148. package/lib/controls/numeric.cjs.js +2 -0
  149. package/lib/controls/numeric.cjs.js.map +1 -0
  150. package/lib/controls/numeric.d.ts +36 -0
  151. package/lib/controls/numeric.esm.js +9 -0
  152. package/lib/controls/numeric.esm.js.map +1 -0
  153. package/lib/controls/useClearAffordance.cjs.js +2 -0
  154. package/lib/controls/useClearAffordance.cjs.js.map +1 -0
  155. package/lib/controls/useClearAffordance.d.ts +15 -0
  156. package/lib/controls/useClearAffordance.esm.js +17 -0
  157. package/lib/controls/useClearAffordance.esm.js.map +1 -0
  158. package/lib/controls/useDebouncedChange.cjs.js +2 -0
  159. package/lib/controls/useDebouncedChange.cjs.js.map +1 -0
  160. package/lib/controls/useDebouncedChange.d.ts +37 -0
  161. package/lib/controls/useDebouncedChange.esm.js +40 -0
  162. package/lib/controls/useDebouncedChange.esm.js.map +1 -0
  163. package/lib/controls/useFocus.cjs.js +2 -0
  164. package/lib/controls/useFocus.cjs.js.map +1 -0
  165. package/lib/controls/useFocus.d.ts +1 -0
  166. package/lib/controls/useFocus.esm.js +13 -0
  167. package/lib/controls/useFocus.esm.js.map +1 -0
  168. package/lib/core/configNamespaces.cjs.js +2 -0
  169. package/lib/core/configNamespaces.cjs.js.map +1 -0
  170. package/lib/core/configNamespaces.d.ts +32 -0
  171. package/lib/core/configNamespaces.esm.js +15 -0
  172. package/lib/core/configNamespaces.esm.js.map +1 -0
  173. package/lib/core/dataPointer.cjs.js +2 -0
  174. package/lib/core/dataPointer.cjs.js.map +1 -0
  175. package/lib/core/dataPointer.d.ts +1 -0
  176. package/lib/core/dataPointer.esm.js +5 -0
  177. package/lib/core/dataPointer.esm.js.map +1 -0
  178. package/lib/core/detailUiSchema.cjs.js +2 -0
  179. package/lib/core/detailUiSchema.cjs.js.map +1 -0
  180. package/lib/core/detailUiSchema.d.ts +7 -0
  181. package/lib/core/detailUiSchema.esm.js +23 -0
  182. package/lib/core/detailUiSchema.esm.js.map +1 -0
  183. package/lib/core/plainRecord.cjs.js +2 -0
  184. package/lib/core/plainRecord.cjs.js.map +1 -0
  185. package/lib/core/plainRecord.d.ts +1 -0
  186. package/lib/core/plainRecord.esm.js +5 -0
  187. package/lib/core/plainRecord.esm.js.map +1 -0
  188. package/lib/core/uiSchemaCycle.cjs.js +2 -0
  189. package/lib/core/uiSchemaCycle.cjs.js.map +1 -0
  190. package/lib/core/uiSchemaCycle.d.ts +18 -0
  191. package/lib/core/uiSchemaCycle.esm.js +27 -0
  192. package/lib/core/uiSchemaCycle.esm.js.map +1 -0
  193. package/lib/dynamic/DynamicUiProvider.cjs.js +4 -0
  194. package/lib/dynamic/DynamicUiProvider.cjs.js.map +1 -0
  195. package/lib/dynamic/DynamicUiProvider.d.ts +35 -0
  196. package/lib/dynamic/DynamicUiProvider.esm.js +182 -0
  197. package/lib/dynamic/DynamicUiProvider.esm.js.map +1 -0
  198. package/lib/dynamic/dynamicCel.cjs.js +2 -0
  199. package/lib/dynamic/dynamicCel.cjs.js.map +1 -0
  200. package/lib/dynamic/dynamicCel.d.ts +1 -0
  201. package/lib/dynamic/dynamicCel.esm.js +43 -0
  202. package/lib/dynamic/dynamicCel.esm.js.map +1 -0
  203. package/lib/dynamic/dynamicConfig.cjs.js +2 -0
  204. package/lib/dynamic/dynamicConfig.cjs.js.map +1 -0
  205. package/lib/dynamic/dynamicConfig.d.ts +7 -0
  206. package/lib/dynamic/dynamicConfig.esm.js +13 -0
  207. package/lib/dynamic/dynamicConfig.esm.js.map +1 -0
  208. package/lib/dynamic/dynamicRuntime.cjs.js +2 -0
  209. package/lib/dynamic/dynamicRuntime.cjs.js.map +1 -0
  210. package/lib/dynamic/dynamicRuntime.d.ts +4 -0
  211. package/lib/dynamic/dynamicRuntime.esm.js +16 -0
  212. package/lib/dynamic/dynamicRuntime.esm.js.map +1 -0
  213. package/lib/dynamic/dynamicScope.cjs.js +2 -0
  214. package/lib/dynamic/dynamicScope.cjs.js.map +1 -0
  215. package/lib/dynamic/dynamicScope.d.ts +2 -0
  216. package/lib/dynamic/dynamicScope.esm.js +17 -0
  217. package/lib/dynamic/dynamicScope.esm.js.map +1 -0
  218. package/lib/dynamic/dynamicTree.cjs.js +2 -0
  219. package/lib/dynamic/dynamicTree.cjs.js.map +1 -0
  220. package/lib/dynamic/dynamicTree.d.ts +12 -0
  221. package/lib/dynamic/dynamicTree.esm.js +57 -0
  222. package/lib/dynamic/dynamicTree.esm.js.map +1 -0
  223. package/lib/dynamic/dynamicUi.cjs.js +2 -0
  224. package/lib/dynamic/dynamicUi.cjs.js.map +1 -0
  225. package/lib/dynamic/dynamicUi.d.ts +39 -0
  226. package/lib/dynamic/dynamicUi.esm.js +397 -0
  227. package/lib/dynamic/dynamicUi.esm.js.map +1 -0
  228. package/lib/formats/colorFormat.cjs.js +2 -0
  229. package/lib/formats/colorFormat.cjs.js.map +1 -0
  230. package/lib/formats/colorFormat.d.ts +127 -0
  231. package/lib/formats/colorFormat.esm.js +139 -0
  232. package/lib/formats/colorFormat.esm.js.map +1 -0
  233. package/lib/formats/dateValues.cjs.js +2 -0
  234. package/lib/formats/dateValues.cjs.js.map +1 -0
  235. package/lib/formats/dateValues.d.ts +3 -0
  236. package/lib/formats/dateValues.esm.js +21 -0
  237. package/lib/formats/dateValues.esm.js.map +1 -0
  238. package/lib/formats/duration.cjs.js +2 -0
  239. package/lib/formats/duration.cjs.js.map +1 -0
  240. package/lib/formats/duration.d.ts +13 -0
  241. package/lib/formats/duration.esm.js +28 -0
  242. package/lib/formats/duration.esm.js.map +1 -0
  243. package/lib/formats/maskControls.cjs.js +2 -0
  244. package/lib/formats/maskControls.cjs.js.map +1 -0
  245. package/lib/formats/maskControls.d.ts +32 -0
  246. package/lib/formats/maskControls.esm.js +16 -0
  247. package/lib/formats/maskControls.esm.js.map +1 -0
  248. package/lib/formats/maskFormat.cjs.js +2 -0
  249. package/lib/formats/maskFormat.cjs.js.map +1 -0
  250. package/lib/formats/maskFormat.d.ts +198 -0
  251. package/lib/formats/maskFormat.esm.js +79 -0
  252. package/lib/formats/maskFormat.esm.js.map +1 -0
  253. package/lib/formats/temporalBounds.cjs.js +2 -0
  254. package/lib/formats/temporalBounds.cjs.js.map +1 -0
  255. package/lib/formats/temporalBounds.d.ts +82 -0
  256. package/lib/formats/temporalBounds.esm.js +76 -0
  257. package/lib/formats/temporalBounds.esm.js.map +1 -0
  258. package/lib/formats/temporalFormats.cjs.js +2 -0
  259. package/lib/formats/temporalFormats.cjs.js.map +1 -0
  260. package/lib/formats/temporalFormats.d.ts +62 -0
  261. package/lib/formats/temporalFormats.esm.js +18 -0
  262. package/lib/formats/temporalFormats.esm.js.map +1 -0
  263. package/lib/formats/useMaskedInput.cjs.js +2 -0
  264. package/lib/formats/useMaskedInput.cjs.js.map +1 -0
  265. package/lib/formats/useMaskedInput.d.ts +11 -0
  266. package/lib/formats/useMaskedInput.esm.js +80 -0
  267. package/lib/formats/useMaskedInput.esm.js.map +1 -0
  268. package/lib/index.cjs.js +1 -0
  269. package/lib/index.d.ts +42 -0
  270. package/lib/index.esm.js +44 -0
  271. package/lib/interaction/confirmation.cjs.js +2 -0
  272. package/lib/interaction/confirmation.cjs.js.map +1 -0
  273. package/lib/interaction/confirmation.d.ts +112 -0
  274. package/lib/interaction/confirmation.esm.js +18 -0
  275. package/lib/interaction/confirmation.esm.js.map +1 -0
  276. package/lib/interaction/createDeleteConfirmation.cjs.js +2 -0
  277. package/lib/interaction/createDeleteConfirmation.cjs.js.map +1 -0
  278. package/lib/interaction/createDeleteConfirmation.d.ts +10 -0
  279. package/lib/interaction/createDeleteConfirmation.esm.js +17 -0
  280. package/lib/interaction/createDeleteConfirmation.esm.js.map +1 -0
  281. package/lib/interaction/detailDialog.cjs.js +2 -0
  282. package/lib/interaction/detailDialog.cjs.js.map +1 -0
  283. package/lib/interaction/detailDialog.d.ts +30 -0
  284. package/lib/interaction/detailDialog.esm.js +89 -0
  285. package/lib/interaction/detailDialog.esm.js.map +1 -0
  286. package/lib/interaction/pendingChanges.cjs.js +2 -0
  287. package/lib/interaction/pendingChanges.cjs.js.map +1 -0
  288. package/lib/interaction/pendingChanges.d.ts +19 -0
  289. package/lib/interaction/pendingChanges.esm.js +17 -0
  290. package/lib/interaction/pendingChanges.esm.js.map +1 -0
  291. package/lib/interaction/useConfirmationState.cjs.js +2 -0
  292. package/lib/interaction/useConfirmationState.cjs.js.map +1 -0
  293. package/lib/interaction/useConfirmationState.d.ts +11 -0
  294. package/lib/interaction/useConfirmationState.esm.js +39 -0
  295. package/lib/interaction/useConfirmationState.esm.js.map +1 -0
  296. package/lib/interaction/visuallyHidden.cjs.js +2 -0
  297. package/lib/interaction/visuallyHidden.cjs.js.map +1 -0
  298. package/lib/interaction/visuallyHidden.d.ts +9 -0
  299. package/lib/interaction/visuallyHidden.esm.js +14 -0
  300. package/lib/interaction/visuallyHidden.esm.js.map +1 -0
  301. package/lib/layout/categoryState.cjs.js +2 -0
  302. package/lib/layout/categoryState.cjs.js.map +1 -0
  303. package/lib/layout/categoryState.d.ts +66 -0
  304. package/lib/layout/categoryState.esm.js +42 -0
  305. package/lib/layout/categoryState.esm.js.map +1 -0
  306. package/lib/layout/groupState.cjs.js +2 -0
  307. package/lib/layout/groupState.cjs.js.map +1 -0
  308. package/lib/layout/groupState.d.ts +34 -0
  309. package/lib/layout/groupState.esm.js +63 -0
  310. package/lib/layout/groupState.esm.js.map +1 -0
  311. package/lib/layout/layoutContext.cjs.js +2 -0
  312. package/lib/layout/layoutContext.cjs.js.map +1 -0
  313. package/lib/layout/layoutContext.d.ts +16 -0
  314. package/lib/layout/layoutContext.esm.js +26 -0
  315. package/lib/layout/layoutContext.esm.js.map +1 -0
  316. package/lib/layout/layoutSizing.cjs.js +2 -0
  317. package/lib/layout/layoutSizing.cjs.js.map +1 -0
  318. package/lib/layout/layoutSizing.d.ts +104 -0
  319. package/lib/layout/layoutSizing.esm.js +69 -0
  320. package/lib/layout/layoutSizing.esm.js.map +1 -0
  321. package/lib/locale/bg.cjs.js +2 -0
  322. package/lib/locale/bg.cjs.js.map +1 -0
  323. package/lib/locale/bg.d.ts +279 -0
  324. package/lib/locale/bg.esm.js +271 -0
  325. package/lib/locale/bg.esm.js.map +1 -0
  326. package/lib/locale/calendar.cjs.js +2 -0
  327. package/lib/locale/calendar.cjs.js.map +1 -0
  328. package/lib/locale/calendar.d.ts +23 -0
  329. package/lib/locale/calendar.esm.js +57 -0
  330. package/lib/locale/calendar.esm.js.map +1 -0
  331. package/lib/locale/en.cjs.js +2 -0
  332. package/lib/locale/en.cjs.js.map +1 -0
  333. package/lib/locale/en.d.ts +275 -0
  334. package/lib/locale/en.esm.js +271 -0
  335. package/lib/locale/en.esm.js.map +1 -0
  336. package/lib/locale/index.cjs.js +1 -0
  337. package/lib/locale/index.d.ts +3 -0
  338. package/lib/locale/index.esm.js +3 -0
  339. package/lib/locale/intl.cjs.js +2 -0
  340. package/lib/locale/intl.cjs.js.map +1 -0
  341. package/lib/locale/intl.d.ts +2 -0
  342. package/lib/locale/intl.esm.js +11 -0
  343. package/lib/locale/intl.esm.js.map +1 -0
  344. package/lib/locale/rendererLocale.cjs.js +2 -0
  345. package/lib/locale/rendererLocale.cjs.js.map +1 -0
  346. package/lib/locale/rendererLocale.d.ts +40 -0
  347. package/lib/locale/rendererLocale.esm.js +24 -0
  348. package/lib/locale/rendererLocale.esm.js.map +1 -0
  349. package/lib/locale/translate.cjs.js +2 -0
  350. package/lib/locale/translate.cjs.js.map +1 -0
  351. package/lib/locale/translate.d.ts +43 -0
  352. package/lib/locale/translate.esm.js +25 -0
  353. package/lib/locale/translate.esm.js.map +1 -0
  354. package/lib/mixed/MixedDetailControl.cjs.js +2 -0
  355. package/lib/mixed/MixedDetailControl.cjs.js.map +1 -0
  356. package/lib/mixed/MixedDetailControl.d.ts +20 -0
  357. package/lib/mixed/MixedDetailControl.esm.js +73 -0
  358. package/lib/mixed/MixedDetailControl.esm.js.map +1 -0
  359. package/lib/mixed/RecursiveTreeRenderer.cjs.js +2 -0
  360. package/lib/mixed/RecursiveTreeRenderer.cjs.js.map +1 -0
  361. package/lib/mixed/RecursiveTreeRenderer.d.ts +35 -0
  362. package/lib/mixed/RecursiveTreeRenderer.esm.js +206 -0
  363. package/lib/mixed/RecursiveTreeRenderer.esm.js.map +1 -0
  364. package/lib/mixed/createMixedTypeChangeHandler.cjs.js +2 -0
  365. package/lib/mixed/createMixedTypeChangeHandler.cjs.js.map +1 -0
  366. package/lib/mixed/createMixedTypeChangeHandler.d.ts +16 -0
  367. package/lib/mixed/createMixedTypeChangeHandler.esm.js +34 -0
  368. package/lib/mixed/createMixedTypeChangeHandler.esm.js.map +1 -0
  369. package/lib/mixed/mixedComposition.cjs.js +2 -0
  370. package/lib/mixed/mixedComposition.cjs.js.map +1 -0
  371. package/lib/mixed/mixedComposition.d.ts +7 -0
  372. package/lib/mixed/mixedComposition.esm.js +37 -0
  373. package/lib/mixed/mixedComposition.esm.js.map +1 -0
  374. package/lib/mixed/mixedNodeEditor.cjs.js +2 -0
  375. package/lib/mixed/mixedNodeEditor.cjs.js.map +1 -0
  376. package/lib/mixed/mixedNodeEditor.d.ts +12 -0
  377. package/lib/mixed/mixedNodeEditor.esm.js +20 -0
  378. package/lib/mixed/mixedNodeEditor.esm.js.map +1 -0
  379. package/lib/mixed/mixedScalar.cjs.js +2 -0
  380. package/lib/mixed/mixedScalar.cjs.js.map +1 -0
  381. package/lib/mixed/mixedScalar.d.ts +4 -0
  382. package/lib/mixed/mixedScalar.esm.js +6 -0
  383. package/lib/mixed/mixedScalar.esm.js.map +1 -0
  384. package/lib/mixed/mixedSchema.cjs.js +2 -0
  385. package/lib/mixed/mixedSchema.cjs.js.map +1 -0
  386. package/lib/mixed/mixedSchema.d.ts +22 -0
  387. package/lib/mixed/mixedSchema.esm.js +88 -0
  388. package/lib/mixed/mixedSchema.esm.js.map +1 -0
  389. package/lib/mixed/mixedTree.cjs.js +2 -0
  390. package/lib/mixed/mixedTree.cjs.js.map +1 -0
  391. package/lib/mixed/mixedTree.d.ts +19 -0
  392. package/lib/mixed/mixedTree.esm.js +78 -0
  393. package/lib/mixed/mixedTree.esm.js.map +1 -0
  394. package/lib/mixed/mixedTreeActions.cjs.js +2 -0
  395. package/lib/mixed/mixedTreeActions.cjs.js.map +1 -0
  396. package/lib/mixed/mixedTreeActions.d.ts +6 -0
  397. package/lib/mixed/mixedTreeActions.esm.js +17 -0
  398. package/lib/mixed/mixedTreeActions.esm.js.map +1 -0
  399. package/lib/mixed/recursiveTree.cjs.js +2 -0
  400. package/lib/mixed/recursiveTree.cjs.js.map +1 -0
  401. package/lib/mixed/recursiveTree.d.ts +9 -0
  402. package/lib/mixed/recursiveTree.esm.js +49 -0
  403. package/lib/mixed/recursiveTree.esm.js.map +1 -0
  404. package/lib/mixed/useMixedNavigation.cjs.js +2 -0
  405. package/lib/mixed/useMixedNavigation.cjs.js.map +1 -0
  406. package/lib/mixed/useMixedNavigation.d.ts +6 -0
  407. package/lib/mixed/useMixedNavigation.esm.js +21 -0
  408. package/lib/mixed/useMixedNavigation.esm.js.map +1 -0
  409. package/lib/mixed/useMixedRenderer.cjs.js +2 -0
  410. package/lib/mixed/useMixedRenderer.cjs.js.map +1 -0
  411. package/lib/mixed/useMixedRenderer.d.ts +61 -0
  412. package/lib/mixed/useMixedRenderer.esm.js +185 -0
  413. package/lib/mixed/useMixedRenderer.esm.js.map +1 -0
  414. package/lib/mixed/useMixedType.cjs.js +2 -0
  415. package/lib/mixed/useMixedType.cjs.js.map +1 -0
  416. package/lib/mixed/useMixedType.d.ts +6 -0
  417. package/lib/mixed/useMixedType.esm.js +23 -0
  418. package/lib/mixed/useMixedType.esm.js.map +1 -0
  419. package/lib/objects/IsolatedPropertyEditor.cjs.js +2 -0
  420. package/lib/objects/IsolatedPropertyEditor.cjs.js.map +1 -0
  421. package/lib/objects/IsolatedPropertyEditor.d.ts +35 -0
  422. package/lib/objects/IsolatedPropertyEditor.esm.js +27 -0
  423. package/lib/objects/IsolatedPropertyEditor.esm.js.map +1 -0
  424. package/lib/objects/ObjectDetail.cjs.js +2 -0
  425. package/lib/objects/ObjectDetail.cjs.js.map +1 -0
  426. package/lib/objects/ObjectDetail.d.ts +42 -0
  427. package/lib/objects/ObjectDetail.esm.js +103 -0
  428. package/lib/objects/ObjectDetail.esm.js.map +1 -0
  429. package/lib/objects/additionalProperties.cjs.js +2 -0
  430. package/lib/objects/additionalProperties.cjs.js.map +1 -0
  431. package/lib/objects/additionalProperties.d.ts +14 -0
  432. package/lib/objects/additionalProperties.esm.js +41 -0
  433. package/lib/objects/additionalProperties.esm.js.map +1 -0
  434. package/lib/objects/additionalPropertyName.cjs.js +2 -0
  435. package/lib/objects/additionalPropertyName.cjs.js.map +1 -0
  436. package/lib/objects/additionalPropertyName.d.ts +63 -0
  437. package/lib/objects/additionalPropertyName.esm.js +46 -0
  438. package/lib/objects/additionalPropertyName.esm.js.map +1 -0
  439. package/lib/objects/conditionalFields.cjs.js +2 -0
  440. package/lib/objects/conditionalFields.cjs.js.map +1 -0
  441. package/lib/objects/conditionalFields.d.ts +18 -0
  442. package/lib/objects/conditionalFields.esm.js +105 -0
  443. package/lib/objects/conditionalFields.esm.js.map +1 -0
  444. package/lib/objects/dynamicProperties.cjs.js +2 -0
  445. package/lib/objects/dynamicProperties.cjs.js.map +1 -0
  446. package/lib/objects/dynamicProperties.d.ts +10 -0
  447. package/lib/objects/dynamicProperties.esm.js +33 -0
  448. package/lib/objects/dynamicProperties.esm.js.map +1 -0
  449. package/lib/objects/literalPropertySchema.cjs.js +2 -0
  450. package/lib/objects/literalPropertySchema.cjs.js.map +1 -0
  451. package/lib/objects/literalPropertySchema.d.ts +2 -0
  452. package/lib/objects/literalPropertySchema.esm.js +38 -0
  453. package/lib/objects/literalPropertySchema.esm.js.map +1 -0
  454. package/lib/objects/useAdditionalPropertyEntries.cjs.js +2 -0
  455. package/lib/objects/useAdditionalPropertyEntries.cjs.js.map +1 -0
  456. package/lib/objects/useAdditionalPropertyEntries.d.ts +72 -0
  457. package/lib/objects/useAdditionalPropertyEntries.esm.js +71 -0
  458. package/lib/objects/useAdditionalPropertyEntries.esm.js.map +1 -0
  459. package/lib/rolldown-runtime-BocRIvOZ.js +1 -0
  460. package/lib/tuple/TupleControlContent.cjs.js +2 -0
  461. package/lib/tuple/TupleControlContent.cjs.js.map +1 -0
  462. package/lib/tuple/TupleControlContent.d.ts +17 -0
  463. package/lib/tuple/TupleControlContent.esm.js +74 -0
  464. package/lib/tuple/TupleControlContent.esm.js.map +1 -0
  465. package/lib/tuple/TupleField.cjs.js +2 -0
  466. package/lib/tuple/TupleField.cjs.js.map +1 -0
  467. package/lib/tuple/TupleField.d.ts +15 -0
  468. package/lib/tuple/TupleField.esm.js +72 -0
  469. package/lib/tuple/TupleField.esm.js.map +1 -0
  470. package/lib/tuple/tupleSchema.cjs.js +2 -0
  471. package/lib/tuple/tupleSchema.cjs.js.map +1 -0
  472. package/lib/tuple/tupleSchema.d.ts +93 -0
  473. package/lib/tuple/tupleSchema.esm.js +63 -0
  474. package/lib/tuple/tupleSchema.esm.js.map +1 -0
  475. package/lib/tuple/useTupleAdditionalItems.cjs.js +2 -0
  476. package/lib/tuple/useTupleAdditionalItems.cjs.js.map +1 -0
  477. package/lib/tuple/useTupleAdditionalItems.d.ts +45 -0
  478. package/lib/tuple/useTupleAdditionalItems.esm.js +47 -0
  479. package/lib/tuple/useTupleAdditionalItems.esm.js.map +1 -0
  480. package/lib/tuple/useTupleControl.cjs.js +3 -0
  481. package/lib/tuple/useTupleControl.cjs.js.map +1 -0
  482. package/lib/tuple/useTupleControl.d.ts +26 -0
  483. package/lib/tuple/useTupleControl.esm.js +84 -0
  484. package/lib/tuple/useTupleControl.esm.js.map +1 -0
  485. package/lib/tuple/useTupleField.cjs.js +2 -0
  486. package/lib/tuple/useTupleField.cjs.js.map +1 -0
  487. package/lib/tuple/useTupleField.d.ts +38 -0
  488. package/lib/tuple/useTupleField.esm.js +80 -0
  489. package/lib/tuple/useTupleField.esm.js.map +1 -0
  490. package/lib/validation/ItemValidationIndicator.cjs.js +2 -0
  491. package/lib/validation/ItemValidationIndicator.cjs.js.map +1 -0
  492. package/lib/validation/ItemValidationIndicator.d.ts +9 -0
  493. package/lib/validation/ItemValidationIndicator.esm.js +14 -0
  494. package/lib/validation/ItemValidationIndicator.esm.js.map +1 -0
  495. package/lib/validation/errorSummary.cjs.js +9 -0
  496. package/lib/validation/errorSummary.cjs.js.map +1 -0
  497. package/lib/validation/errorSummary.d.ts +44 -0
  498. package/lib/validation/errorSummary.esm.js +194 -0
  499. package/lib/validation/errorSummary.esm.js.map +1 -0
  500. package/lib/validation/preTouchErrors.cjs.js +2 -0
  501. package/lib/validation/preTouchErrors.cjs.js.map +1 -0
  502. package/lib/validation/preTouchErrors.d.ts +77 -0
  503. package/lib/validation/preTouchErrors.esm.js +42 -0
  504. package/lib/validation/preTouchErrors.esm.js.map +1 -0
  505. package/lib/validation/validationIndicator.cjs.js +2 -0
  506. package/lib/validation/validationIndicator.cjs.js.map +1 -0
  507. package/lib/validation/validationIndicator.d.ts +72 -0
  508. package/lib/validation/validationIndicator.esm.js +66 -0
  509. package/lib/validation/validationIndicator.esm.js.map +1 -0
  510. package/lib/webcomponent/element.cjs.js +2 -0
  511. package/lib/webcomponent/element.cjs.js.map +1 -0
  512. package/lib/webcomponent/element.d.ts +48 -0
  513. package/lib/webcomponent/element.esm.js +85 -0
  514. package/lib/webcomponent/element.esm.js.map +1 -0
  515. package/lib/webcomponent/input.cjs.js +2 -0
  516. package/lib/webcomponent/input.cjs.js.map +1 -0
  517. package/lib/webcomponent/input.d.ts +6 -0
  518. package/lib/webcomponent/input.esm.js +25 -0
  519. package/lib/webcomponent/input.esm.js.map +1 -0
  520. package/package.json +86 -3
  521. package/src/cells/CellSummary.tsx +59 -0
  522. package/src/cells/cellMode.tsx +21 -0
  523. package/src/cells/compositeActions.ts +21 -0
  524. package/src/cells/compositeCellTester.ts +15 -0
  525. package/src/cells/compositeSummary.ts +149 -0
  526. package/src/cells/useCompositeCellPresentation.ts +37 -0
  527. package/src/cells/useCompositeDraft.ts +199 -0
  528. package/src/collections/CollectionErrorNavigation.tsx +123 -0
  529. package/src/collections/arrayChoices.ts +235 -0
  530. package/src/collections/collectionPagination.ts +95 -0
  531. package/src/collections/columnResize.tsx +151 -0
  532. package/src/collections/rowDetail.tsx +208 -0
  533. package/src/collections/tableColumns.ts +39 -0
  534. package/src/collections/useArrayPanelState.ts +25 -0
  535. package/src/collections/useCollectionDelete.ts +62 -0
  536. package/src/collections/useTableSelection.ts +77 -0
  537. package/src/composition/AllOfRenderer.tsx +79 -0
  538. package/src/composition/CombinatorBranch.tsx +93 -0
  539. package/src/composition/CombinatorProperties.tsx +56 -0
  540. package/src/composition/ScalarCompositionControl.tsx +34 -0
  541. package/src/composition/choiceCards.tsx +389 -0
  542. package/src/composition/combinators.ts +131 -0
  543. package/src/composition/discriminatorBranch.ts +82 -0
  544. package/src/composition/scalarComposition.ts +193 -0
  545. package/src/composition/useCombinatorSelection.ts +53 -0
  546. package/src/composition/useScalarComposition.ts +67 -0
  547. package/src/controls/FileArrayInput.tsx +407 -0
  548. package/src/controls/controlHelp.ts +28 -0
  549. package/src/controls/inputAdornments.tsx +337 -0
  550. package/src/controls/numeric.ts +43 -0
  551. package/src/controls/useClearAffordance.ts +22 -0
  552. package/src/controls/useDebouncedChange.ts +138 -0
  553. package/src/controls/useFocus.ts +32 -0
  554. package/src/core/configNamespaces.ts +67 -0
  555. package/src/core/dataPointer.ts +8 -0
  556. package/src/core/detailUiSchema.ts +88 -0
  557. package/src/core/plainRecord.ts +8 -0
  558. package/src/core/uiSchemaCycle.tsx +122 -0
  559. package/src/dynamic/DynamicUiProvider.tsx +414 -0
  560. package/src/dynamic/dynamicCel.ts +68 -0
  561. package/src/dynamic/dynamicConfig.ts +26 -0
  562. package/src/dynamic/dynamicRuntime.ts +25 -0
  563. package/src/dynamic/dynamicScope.ts +22 -0
  564. package/src/dynamic/dynamicTree.ts +128 -0
  565. package/src/dynamic/dynamicUi.ts +711 -0
  566. package/src/formats/colorFormat.ts +390 -0
  567. package/src/formats/dateValues.ts +45 -0
  568. package/src/formats/duration.ts +60 -0
  569. package/src/formats/maskControls.ts +88 -0
  570. package/src/formats/maskFormat.ts +375 -0
  571. package/src/formats/temporalBounds.ts +219 -0
  572. package/src/formats/temporalFormats.ts +128 -0
  573. package/src/formats/useMaskedInput.ts +194 -0
  574. package/src/index.ts +42 -0
  575. package/src/interaction/confirmation.ts +211 -0
  576. package/src/interaction/createDeleteConfirmation.ts +23 -0
  577. package/src/interaction/detailDialog.ts +138 -0
  578. package/src/interaction/pendingChanges.tsx +55 -0
  579. package/src/interaction/useConfirmationState.ts +55 -0
  580. package/src/interaction/visuallyHidden.ts +19 -0
  581. package/src/layout/categoryState.ts +189 -0
  582. package/src/layout/groupState.ts +201 -0
  583. package/src/layout/layoutContext.tsx +49 -0
  584. package/src/layout/layoutSizing.ts +369 -0
  585. package/src/locale/bg.ts +309 -0
  586. package/src/locale/calendar.ts +57 -0
  587. package/src/locale/en.ts +375 -0
  588. package/src/locale/index.ts +5 -0
  589. package/src/locale/intl.ts +10 -0
  590. package/src/locale/rendererLocale.ts +74 -0
  591. package/src/locale/translate.ts +98 -0
  592. package/src/mixed/MixedDetailControl.tsx +182 -0
  593. package/src/mixed/RecursiveTreeRenderer.tsx +388 -0
  594. package/src/mixed/createMixedTypeChangeHandler.ts +77 -0
  595. package/src/mixed/mixedComposition.ts +76 -0
  596. package/src/mixed/mixedNodeEditor.ts +47 -0
  597. package/src/mixed/mixedScalar.ts +7 -0
  598. package/src/mixed/mixedSchema.ts +283 -0
  599. package/src/mixed/mixedTree.ts +199 -0
  600. package/src/mixed/mixedTreeActions.ts +60 -0
  601. package/src/mixed/recursiveTree.ts +105 -0
  602. package/src/mixed/useMixedNavigation.ts +36 -0
  603. package/src/mixed/useMixedRenderer.ts +300 -0
  604. package/src/mixed/useMixedType.ts +45 -0
  605. package/src/objects/IsolatedPropertyEditor.tsx +86 -0
  606. package/src/objects/ObjectDetail.tsx +232 -0
  607. package/src/objects/additionalProperties.ts +151 -0
  608. package/src/objects/additionalPropertyName.ts +185 -0
  609. package/src/objects/conditionalFields.ts +173 -0
  610. package/src/objects/dynamicProperties.tsx +68 -0
  611. package/src/objects/literalPropertySchema.ts +100 -0
  612. package/src/objects/useAdditionalPropertyEntries.ts +204 -0
  613. package/src/tuple/TupleControlContent.tsx +152 -0
  614. package/src/tuple/TupleField.tsx +150 -0
  615. package/src/tuple/tupleSchema.ts +245 -0
  616. package/src/tuple/useTupleAdditionalItems.ts +131 -0
  617. package/src/tuple/useTupleControl.tsx +173 -0
  618. package/src/tuple/useTupleField.ts +164 -0
  619. package/src/validation/ItemValidationIndicator.tsx +21 -0
  620. package/src/validation/errorSummary.tsx +489 -0
  621. package/src/validation/preTouchErrors.ts +185 -0
  622. package/src/validation/validationIndicator.ts +202 -0
  623. package/src/webcomponent/element.ts +107 -0
  624. package/src/webcomponent/input.ts +56 -0
@@ -0,0 +1,185 @@
1
+ import {
2
+ ControlElement,
3
+ defaultTranslator,
4
+ type Translator,
5
+ type ErrorTranslator,
6
+ JsonSchema,
7
+ getCombinedErrorMessage,
8
+ getControlPath,
9
+ } from '@jsonforms/core';
10
+ import type { ErrorObject } from 'ajv';
11
+ import { useCallback, useMemo, useState } from 'react';
12
+ import { useJsonForms } from '@jsonforms/react';
13
+ import merge from 'lodash/merge';
14
+
15
+ /**
16
+ * Pre-touch error-message filtering.
17
+ *
18
+ * A form opened on incomplete data greets the user with a required error on
19
+ * every field they have not reached yet. These two options hide those messages
20
+ * until the user has actually visited the field:
21
+ *
22
+ * - `enableFilterErrorsBeforeTouch` - false when absent; true turns filtering on.
23
+ * - `filterErrorKeywordsBeforeTouch` - the keywords to suppress. Absent or
24
+ * empty, with filtering on, suppresses **all** of a control's error text
25
+ * before touch.
26
+ *
27
+ * Both are renderer options with global config defaults that a control's own
28
+ * `options` override, in either direction.
29
+ *
30
+ * **Presentation only.** The form's validity, the structured errors, and the
31
+ * data are all untouched; this decides what one control prints. It cannot make
32
+ * an error appear either - a control whose errors the validation mode already
33
+ * hides stays quiet when filtering is switched off.
34
+ *
35
+ * The algorithm is the one the Vuetify (`vue-vuetify/src/util/composition.ts`)
36
+ * and Svelte renderer families already use, deliberately: these are their
37
+ * option names, so a form authored against them has to behave the same here.
38
+ */
39
+
40
+ export interface FilterErrorsBeforeTouchInput {
41
+ /** Whether this control has been blurred at least once. */
42
+ touched: boolean;
43
+ /** The control's formatted errors, as JSON Forms computed them. */
44
+ errors: string;
45
+ /** `config` merged with the element's `options`. */
46
+ appliedOptions: Record<string, any>;
47
+ /** Every error in the form, from `core`. */
48
+ coreErrors: ErrorObject[] | undefined;
49
+ path: string;
50
+ schema?: JsonSchema;
51
+ uischema?: ControlElement;
52
+ translate?: Translator;
53
+ translateError?: ErrorTranslator;
54
+ }
55
+
56
+ /**
57
+ * The filtered message for one control.
58
+ *
59
+ * Returns `errors` unchanged whenever filtering does not apply, so a control
60
+ * that opts out - or one nobody configured - pays nothing and cannot have its
61
+ * text rewritten by a formatting difference.
62
+ */
63
+ export const filterErrorsBeforeTouch = ({
64
+ touched,
65
+ errors,
66
+ appliedOptions,
67
+ coreErrors,
68
+ path,
69
+ schema,
70
+ uischema,
71
+ translate,
72
+ translateError,
73
+ }: FilterErrorsBeforeTouchInput): string => {
74
+ if (touched || !errors || !appliedOptions.enableFilterErrorsBeforeTouch) {
75
+ return errors;
76
+ }
77
+
78
+ const filterKeywords = appliedOptions.filterErrorKeywordsBeforeTouch;
79
+
80
+ if (Array.isArray(filterKeywords) && filterKeywords.length > 0) {
81
+ /*
82
+ Granular filtering needs the keyword, which the formatted `errors` string
83
+ no longer carries - so the structured errors are read back from core and
84
+ narrowed to this control. `getControlPath` is what maps an Ajv
85
+ `instancePath` onto a JSON Forms path, including for `additionalErrors`
86
+ a host published.
87
+ */
88
+ const errorsAtControl = (coreErrors ?? []).filter(
89
+ (error) => path === getControlPath(error),
90
+ );
91
+
92
+ const errorsToShow = errorsAtControl.filter(
93
+ (error) => !error.keyword || !filterKeywords.includes(error.keyword),
94
+ );
95
+
96
+ /*
97
+ Nothing matched, so nothing is hidden - and the original string is
98
+ returned rather than a recomposed one. Recomposing would be a no-op in
99
+ the ordinary case and a silent difference wherever the control's own
100
+ props carry more than core's errors do.
101
+ */
102
+ if (errorsToShow.length === errorsAtControl.length) {
103
+ return errors;
104
+ }
105
+
106
+ if (!translateError) {
107
+ return errors;
108
+ }
109
+
110
+ return getCombinedErrorMessage(
111
+ errorsToShow,
112
+ translateError,
113
+ translate ?? defaultTranslator,
114
+ schema,
115
+ uischema,
116
+ path,
117
+ );
118
+ }
119
+
120
+ // "an absent or empty array suppresses all otherwise displayable control
121
+ // error text before touch"
122
+ return '';
123
+ };
124
+
125
+ export interface PreTouchErrorsProps {
126
+ errors?: string;
127
+ path: string;
128
+ schema?: JsonSchema;
129
+ uischema?: ControlElement;
130
+ config?: any;
131
+ }
132
+
133
+ export interface PreTouchErrors {
134
+ /** What the control should print: `errors`, a subset of it, or nothing. */
135
+ errors: string;
136
+ focused: boolean;
137
+ touched: boolean;
138
+ onFocus: () => void;
139
+ onBlur: () => void;
140
+ }
141
+
142
+ /**
143
+ * `useFocus` plus the touch state the filter needs.
144
+ *
145
+ * Touch is per control and local, as it is in both reference implementations -
146
+ * there is no shared registry, because nothing outside a control needs to know
147
+ * that it was visited.
148
+ *
149
+ * **Touch is blur, not focus.** "The control becomes touched on blur:
150
+ * receiving focus alone is insufficient, and leaving the control counts even
151
+ * if the user did not change its data." It is also one-way: editing the value,
152
+ * clearing it, or its becoming valid again does not untouch the control.
153
+ */
154
+ export const usePreTouchErrors = (
155
+ props: PreTouchErrorsProps,
156
+ ): PreTouchErrors => {
157
+ const [focused, setFocused] = useState(false);
158
+ const [touched, setTouched] = useState(false);
159
+ const ctx = useJsonForms();
160
+
161
+ const onFocus = useCallback(() => setFocused(true), []);
162
+ const onBlur = useCallback(() => {
163
+ setTouched(true);
164
+ setFocused(false);
165
+ }, []);
166
+
167
+ const appliedOptions = useMemo(
168
+ () => merge({}, props.config ?? {}, props.uischema?.options ?? {}),
169
+ [props.config, props.uischema],
170
+ );
171
+
172
+ const errors = filterErrorsBeforeTouch({
173
+ touched,
174
+ errors: props.errors ?? '',
175
+ appliedOptions,
176
+ coreErrors: ctx.core?.errors as ErrorObject[] | undefined,
177
+ path: props.path,
178
+ schema: props.schema,
179
+ uischema: props.uischema,
180
+ translate: ctx.i18n?.translate,
181
+ translateError: ctx.i18n?.translateError,
182
+ });
183
+
184
+ return { errors, focused, touched, onFocus, onBlur };
185
+ };
@@ -0,0 +1,202 @@
1
+ import { useDynamicTreeResolver } from '../dynamic/DynamicUiProvider';
2
+ import { ErrorObject } from 'ajv';
3
+ import { UISchemaElement, getControlPath } from '@jsonforms/core';
4
+ import { useJsonForms } from '@jsonforms/react';
5
+ import { useMemo } from 'react';
6
+ import { boundDataPaths } from '../layout/groupState';
7
+ import { JSONFORMS_EXTENDED_CONFIG_KEY } from '../core/configNamespaces';
8
+
9
+ /**
10
+ * The dotted data path an error should be attributed to.
11
+ *
12
+ * Delegates to core's `getControlPath`, so the indicator agrees with wherever
13
+ * core puts the message. That matters most for `required`: ajv reports it on
14
+ * the *containing object* (`/contact`, `params.missingProperty: 'phone'`), and
15
+ * core relocates it to `contact.phone`. Matching on the raw `instancePath`
16
+ * makes a required error invisible to every container bound below the object -
17
+ * clearing a field would make its indicator vanish rather than update.
18
+ *
19
+ * `dependencies` and `additionalProperties` are relocated the same way, and
20
+ * `getControlPath` also decodes JSON Pointer escapes.
21
+ */
22
+ export const errorDataPath = (error: ErrorObject): string =>
23
+ getControlPath(error);
24
+
25
+ const EMPTY: ErrorObject[] = [];
26
+
27
+ /**
28
+ * Every ancestor path of every error, so a container can ask "is anything below
29
+ * me failing?" in O(1).
30
+ *
31
+ * An error at `/emergencyContact/phone` contributes `''`, `emergencyContact`
32
+ * and `emergencyContact.phone`. Building costs O(errors x depth) once, against
33
+ * O(containers x errors) for the obvious per-container scan - see Adjustment 5.
34
+ *
35
+ * The segment-boundary rule the specification requires falls out of this:
36
+ * `employees.10.name` never contributes `employees.1`, so a sibling item cannot
37
+ * match. A `startsWith` test is where that bug would otherwise live.
38
+ */
39
+ export const buildErrorIndex = (
40
+ ...errorLists: (ErrorObject[] | undefined)[]
41
+ ): Set<string> => {
42
+ const index = new Set<string>();
43
+ for (const errors of errorLists) {
44
+ for (const error of errors ?? EMPTY) {
45
+ index.add('');
46
+ let prefix = '';
47
+ for (const segment of errorDataPath(error).split('.')) {
48
+ if (segment === '') continue;
49
+ prefix = prefix ? `${prefix}.${segment}` : segment;
50
+ index.add(prefix);
51
+ }
52
+ }
53
+ }
54
+ return index;
55
+ };
56
+
57
+ /**
58
+ * One index per pair of error arrays, shared by every container.
59
+ *
60
+ * Core replaces these arrays on each validation, so their identity is a sound
61
+ * cache key and stale entries are collected. A `useMemo` per container would
62
+ * instead rebuild the index per container, which is worse than not having one.
63
+ */
64
+ const indexCache = new WeakMap<
65
+ ErrorObject[],
66
+ WeakMap<ErrorObject[], Set<string>>
67
+ >();
68
+
69
+ export const sharedErrorIndex = (
70
+ errors: ErrorObject[] | undefined,
71
+ additionalErrors: ErrorObject[] | undefined,
72
+ ): Set<string> => {
73
+ const primary = errors ?? EMPTY;
74
+ const secondary = additionalErrors ?? EMPTY;
75
+ let byAdditional = indexCache.get(primary);
76
+ if (!byAdditional) {
77
+ byAdditional = new WeakMap();
78
+ indexCache.set(primary, byAdditional);
79
+ }
80
+ const cached = byAdditional.get(secondary);
81
+ if (cached) {
82
+ return cached;
83
+ }
84
+ const index = buildErrorIndex(primary, secondary);
85
+ byAdditional.set(secondary, index);
86
+ return index;
87
+ };
88
+
89
+ /**
90
+ * Errors eligible to feed an indicator under the active validation mode.
91
+ *
92
+ * `ValidateAndHide` hides schema errors from ordinary presentation, and
93
+ * `NoValidation` computes none. Host `additionalErrors` remain available in
94
+ * every mode, so they are never filtered out here.
95
+ */
96
+ export const displayableErrors = (core: {
97
+ errors?: ErrorObject[];
98
+ additionalErrors?: ErrorObject[];
99
+ validationMode?: string;
100
+ }): [ErrorObject[] | undefined, ErrorObject[] | undefined] => [
101
+ core.validationMode === 'ValidateAndShow' || core.validationMode === undefined
102
+ ? core.errors
103
+ : undefined,
104
+ core.additionalErrors,
105
+ ];
106
+
107
+ /**
108
+ * Resolves a project-extension option: the element's flat `options.<name>`,
109
+ * then `config.jsonformsExtended.<name>`, then the container-type default.
110
+ * Only `undefined` falls through, so an explicit `false` is a real override.
111
+ */
112
+ export const resolveIndicatorOption = (
113
+ uischema: UISchemaElement | undefined,
114
+ config: Record<string, unknown> | undefined,
115
+ fallback: boolean,
116
+ name = 'showValidationIndicator',
117
+ ): boolean => {
118
+ const local = uischema?.options?.[name];
119
+ if (local !== undefined) {
120
+ return local === true;
121
+ }
122
+ const namespaced = (
123
+ config?.[JSONFORMS_EXTENDED_CONFIG_KEY] as
124
+ | Record<string, unknown>
125
+ | undefined
126
+ )?.[name];
127
+ return namespaced === undefined ? fallback : namespaced === true;
128
+ };
129
+
130
+ export interface ContainerValidation {
131
+ /** Whether the indicator should be rendered at all. */
132
+ show: boolean;
133
+ /**
134
+ * How many eligible errors sit at or below this container, or `undefined`
135
+ * when `showValidationIndicatorCount` is off and the count was never
136
+ * computed.
137
+ *
138
+ * This counts **validator errors, not controls**. Two Controls bound to the
139
+ * same property share one error object, so an invalid value there counts
140
+ * once - fixing either control fixes both. Counting per control would be
141
+ * both wrong and more work.
142
+ */
143
+ count?: number;
144
+ }
145
+
146
+ const belowAny = (path: string, boundPaths: string[]): boolean =>
147
+ boundPaths.some(
148
+ (bound) => path === bound || path.startsWith(`${bound}.`) || bound === '',
149
+ );
150
+
151
+ /**
152
+ * Whether a scope-less container - a Group, a Category - has failing
153
+ * descendants, and how many.
154
+ *
155
+ * Presence is an O(1) index lookup per bound path. The count needs the error
156
+ * list, so it is computed only for containers that are actually showing an
157
+ * indicator, which is few.
158
+ */
159
+ export const useContainerValidation = (
160
+ uischema: UISchemaElement,
161
+ path: string,
162
+ config: Record<string, unknown> | undefined,
163
+ fallback: boolean,
164
+ ): ContainerValidation => {
165
+ const { core } = useJsonForms();
166
+ const resolveTree = useDynamicTreeResolver(path);
167
+ const effectiveUi = resolveTree(uischema);
168
+ const enabled = resolveIndicatorOption(effectiveUi, config, fallback);
169
+ // Presence is O(1) per bound path; the count needs a pass over the errors.
170
+ // Hosts that only want the marker can skip that pass entirely.
171
+ const wantCount = resolveIndicatorOption(
172
+ effectiveUi,
173
+ config,
174
+ false,
175
+ 'showValidationIndicatorCount',
176
+ );
177
+ const [errors, additionalErrors] = core
178
+ ? displayableErrors(core)
179
+ : [undefined, undefined];
180
+
181
+ return useMemo(() => {
182
+ if (!enabled) {
183
+ return { show: false, count: 0 };
184
+ }
185
+ const index = sharedErrorIndex(errors, additionalErrors);
186
+ if (index.size === 0) {
187
+ return { show: false, count: 0 };
188
+ }
189
+ const bound = boundDataPaths(effectiveUi, path);
190
+ if (!bound.some((candidate) => index.has(candidate))) {
191
+ return { show: false, count: 0 };
192
+ }
193
+ if (!wantCount) {
194
+ return { show: true, count: undefined };
195
+ }
196
+ const eligible = [...(errors ?? EMPTY), ...(additionalErrors ?? EMPTY)];
197
+ const count = eligible.filter((error) =>
198
+ belowAny(errorDataPath(error), bound),
199
+ ).length;
200
+ return { show: count > 0, count };
201
+ }, [enabled, wantCount, errors, additionalErrors, effectiveUi, path]);
202
+ };
@@ -0,0 +1,107 @@
1
+ import type { ValidationMode } from '@jsonforms/core';
2
+ import { parseJson, type JsonInput } from './input';
3
+
4
+ export type FormElementState = {
5
+ external?: JsonInput;
6
+ data?: JsonInput;
7
+ schema?: JsonInput;
8
+ uischema?: JsonInput;
9
+ uischemas?: JsonInput;
10
+ config?: JsonInput;
11
+ readonly?: JsonInput;
12
+ validationMode?: ValidationMode;
13
+ locale?: string;
14
+ translations?: JsonInput;
15
+ additionalErrors?: JsonInput;
16
+ dark?: JsonInput;
17
+ mode?: JsonInput;
18
+ rtl?: JsonInput;
19
+ customStyle?: string;
20
+ rendererSettings?: JsonInput;
21
+ };
22
+
23
+ export const formAttributes = [
24
+ 'data',
25
+ 'schema',
26
+ 'uischema',
27
+ 'uischemas',
28
+ 'config',
29
+ 'external',
30
+ 'readonly',
31
+ 'validation-mode',
32
+ 'locale',
33
+ 'translations',
34
+ 'additional-errors',
35
+ 'dark',
36
+ 'mode',
37
+ 'rtl',
38
+ 'custom-style',
39
+ 'renderer-settings',
40
+ ];
41
+
42
+ export abstract class FormElement extends HTMLElement {
43
+ protected abstract state: FormElementState;
44
+ protected abstract setValue(name: string, value: JsonInput): void;
45
+ protected readFormInput() {
46
+ const schema = parseJson(this.state.schema);
47
+ const data = parseJson(this.state.data);
48
+ if (schema === undefined && data == null) return undefined;
49
+ return { schema, data };
50
+ }
51
+ attributeChangedCallback(name: string, _oldValue: string, newValue: string) {
52
+ this.setValue(name, newValue);
53
+ }
54
+
55
+ set data(value: JsonInput) {
56
+ this.setValue('data', value);
57
+ }
58
+ set schema(value: JsonInput) {
59
+ this.setValue('schema', value);
60
+ }
61
+ set uischema(value: JsonInput) {
62
+ this.setValue('uischema', value);
63
+ }
64
+ set uischemas(value: JsonInput) {
65
+ this.setValue('uischemas', value);
66
+ }
67
+ /** Host-owned external values; JSON attributes and object properties are supported. */
68
+ set external(value: JsonInput) {
69
+ this.setValue('external', value);
70
+ }
71
+ get external() {
72
+ return this.state.external;
73
+ }
74
+ set config(value: JsonInput) {
75
+ this.setValue('config', value);
76
+ }
77
+ set readonly(value: JsonInput) {
78
+ this.setValue('readonly', value);
79
+ }
80
+ set validationMode(value: ValidationMode) {
81
+ this.setValue('validationMode', value);
82
+ }
83
+ set locale(value: string) {
84
+ this.setValue('locale', value);
85
+ }
86
+ set translations(value: JsonInput) {
87
+ this.setValue('translations', value);
88
+ }
89
+ set additionalErrors(value: JsonInput) {
90
+ this.setValue('additionalErrors', value);
91
+ }
92
+ set dark(value: JsonInput) {
93
+ this.setValue('dark', value);
94
+ }
95
+ set mode(value: JsonInput) {
96
+ this.setValue('mode', value);
97
+ }
98
+ set rtl(value: JsonInput) {
99
+ this.setValue('rtl', value);
100
+ }
101
+ set customStyle(value: string) {
102
+ this.setValue('customStyle', value);
103
+ }
104
+ set rendererSettings(value: JsonInput) {
105
+ this.setValue('rendererSettings', value);
106
+ }
107
+ }
@@ -0,0 +1,56 @@
1
+ import type { Translator } from '@jsonforms/core';
2
+
3
+ export type JsonInput = unknown;
4
+
5
+ export const parseJson = (value: JsonInput) => {
6
+ if (typeof value !== 'string') return value;
7
+ if (value.trim() === '') return undefined;
8
+ return JSON.parse(value);
9
+ };
10
+
11
+ export const parseBoolean = (value: JsonInput) => {
12
+ if (typeof value === 'boolean') return value;
13
+ if (typeof value === 'string') {
14
+ if (value === '' || value.toLowerCase() === 'true') return true;
15
+ if (value.toLowerCase() === 'false') return false;
16
+ }
17
+ return undefined;
18
+ };
19
+
20
+ export const parseMode = (value: JsonInput) =>
21
+ value === 'dark' || value === 'light' || value === 'system'
22
+ ? value
23
+ : 'system';
24
+
25
+ export const createTranslator = (
26
+ translations: JsonInput,
27
+ locale = 'en',
28
+ ): Translator => {
29
+ if (typeof translations === 'function') return translations as Translator;
30
+ const dictionary = parseJson(translations) as any;
31
+ const own = (object: unknown, key: string): unknown =>
32
+ object !== null &&
33
+ typeof object === 'object' &&
34
+ Object.prototype.hasOwnProperty.call(object, key)
35
+ ? (object as Record<string, unknown>)[key]
36
+ : undefined;
37
+ const lookup = (catalog: unknown, id: string): string | undefined => {
38
+ const exact = own(catalog, id);
39
+ if (typeof exact === 'string') return exact;
40
+ const nested = id
41
+ .split('.')
42
+ .reduce<unknown>((value, part) => own(value, part), catalog);
43
+ if (typeof nested === 'string') return nested;
44
+ // Compatibility with the wrapper's existing { key: { label: text } } catalogs.
45
+ const label = own(exact, 'label');
46
+ return typeof label === 'string' ? label : undefined;
47
+ };
48
+ const normalized = locale.toLowerCase().replaceAll('_', '-');
49
+ return (id: string, defaultMessage: string | undefined) =>
50
+ lookup(own(dictionary, locale), id) ??
51
+ lookup(own(dictionary, normalized), id) ??
52
+ lookup(own(dictionary, normalized.split('-')[0]), id) ??
53
+ lookup(dictionary, id) ??
54
+ defaultMessage ??
55
+ id;
56
+ };