@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,40 @@
1
+ import type { JsonSchema } from '@jsonforms/core';
2
+ /**
3
+ * What a `oneOf` branch change keeps, and what it throws away.
4
+ *
5
+ * Section 18: "initialize from the selected branch's generated defaults and
6
+ * preserve existing values of properties declared in the **enclosing
7
+ * schema's own properties**. Those preserved values take precedence over
8
+ * generated defaults."
9
+ *
10
+ * The emphasis is the whole rule. A property is preserved because the
11
+ * enclosing schema declares it - not because the branch being left and the
12
+ * branch being entered happen to use the same name. The specification is
13
+ * explicit about that second case: "do not infer preservation merely because
14
+ * two branches contain the same property name."
15
+ */
16
+ /** The names the enclosing schema declares itself, outside any branch. */
17
+ export declare const enclosingPropertyNames: (schema: JsonSchema | undefined) => string[];
18
+ /** A missing value, or an empty object without an applicable branch, clears selection. */
19
+ export declare const isUnselectedBranchValue: (data: unknown, fittingIndex: number | null | undefined) => boolean;
20
+ /**
21
+ * The part of the current value a branch change would discard.
22
+ *
23
+ * This is what the confirmation policy has to weigh, not the whole value:
24
+ * section 14 says to "evaluate the data actually discarded, excluding
25
+ * enclosing properties preserved during a branch change". Without that, a
26
+ * `complex` policy prompts about `{name: "Alex"}` even though `name` survives
27
+ * the switch untouched and nothing is lost.
28
+ */
29
+ export declare const discardedByBranchChange: (data: unknown, schema: JsonSchema | undefined, excludeDiscriminator?: boolean) => unknown;
30
+ /**
31
+ * The value to commit when a branch change is performed.
32
+ *
33
+ * `defaults` is the branch's generated initial value. Preservation only
34
+ * applies where it means something - both sides have to be objects for there
35
+ * to be named properties to carry across - so a combinator of scalars simply
36
+ * takes the generated default.
37
+ */
38
+ export declare const branchChangeData: (data: unknown, defaults: unknown, schema: JsonSchema | undefined) => unknown;
39
+ /** An object-only array slot remains an editable object when its choice is cleared. */
40
+ export declare const clearedBranchValue: (arrayItem: boolean, branches: JsonSchema[]) => Record<string, unknown> | undefined;
@@ -0,0 +1,26 @@
1
+ import e from "lodash/isEqual";
2
+ // src/composition/combinators.ts
3
+ var t = (e) => Object.keys((e == null ? void 0 : e.properties) ?? {}), n = (e) => typeof e == "object" && !!e && !Array.isArray(e), r = (e, t) => e === void 0 || n(e) && Object.keys(e).length === 0 && (t == null || t < 0), i = (r, i, a = !1) => {
4
+ if (!n(r)) return r;
5
+ let o = new Set(t(i)), s = {};
6
+ for (let [t, n] of Object.entries(r)) {
7
+ let r = i == null ? void 0 : i.oneOf, c = r == null ? void 0 : r.map((e) => {
8
+ var n;
9
+ return (n = e.properties) == null ? void 0 : n[t];
10
+ }), l = a && c && c.length > 1 && c.every((e) => e && Object.prototype.hasOwnProperty.call(e, "const") && (e.const === null || typeof e.const != "object")) && new Set(c.map((e) => JSON.stringify(e.const))).size === c.length && c.some((t) => e(t.const, n));
11
+ !o.has(t) && !l && (s[t] = n);
12
+ }
13
+ return s;
14
+ }, a = (e, r, i) => {
15
+ let a = t(i);
16
+ if (a.length === 0 || !n(e)) return r;
17
+ let o = {};
18
+ for (let t of a) Object.prototype.hasOwnProperty.call(e, t) && (o[t] = e[t]);
19
+ return Object.keys(o).length === 0 ? r : n(r) ? {
20
+ ...r,
21
+ ...o
22
+ } : r === void 0 ? o : r;
23
+ }, o = (e, t) => e && t.length > 0 && t.every((e) => e.type === "object") ? {} : void 0;
24
+ export { a as branchChangeData, o as clearedBranchValue, i as discardedByBranchChange, t as enclosingPropertyNames, r as isUnselectedBranchValue };
25
+
26
+ //# sourceMappingURL=combinators.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combinators.esm.js","names":["isEqual","enclosingPropertyNames","schema","isPlainObject","value","isUnselectedBranchValue","data","fittingIndex","discardedByBranchChange","preserved","discarded","key","branches","fixed","_branch$properties","branch","discriminator","excludeDiscriminator","property","branchChangeData","names","defaults","name","clearedBranchValue","arrayItem"],"sources":["../../src/composition/combinators.ts"],"sourcesContent":["import isEqual from 'lodash/isEqual';\nimport type { JsonSchema } from '@jsonforms/core';\n\n/**\n * What a `oneOf` branch change keeps, and what it throws away.\n *\n * Section 18: \"initialize from the selected branch's generated defaults and\n * preserve existing values of properties declared in the **enclosing\n * schema's own properties**. Those preserved values take precedence over\n * generated defaults.\"\n *\n * The emphasis is the whole rule. A property is preserved because the\n * enclosing schema declares it - not because the branch being left and the\n * branch being entered happen to use the same name. The specification is\n * explicit about that second case: \"do not infer preservation merely because\n * two branches contain the same property name.\"\n */\n\n/** The names the enclosing schema declares itself, outside any branch. */\nexport const enclosingPropertyNames = (\n schema: JsonSchema | undefined,\n): string[] =>\n Object.keys((schema as { properties?: object })?.properties ?? {});\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/** A missing value, or an empty object without an applicable branch, clears selection. */\nexport const isUnselectedBranchValue = (\n data: unknown,\n fittingIndex: number | null | undefined,\n): boolean =>\n data === undefined ||\n (isPlainObject(data) &&\n Object.keys(data).length === 0 &&\n (fittingIndex == null || fittingIndex < 0));\n\n/**\n * The part of the current value a branch change would discard.\n *\n * This is what the confirmation policy has to weigh, not the whole value:\n * section 14 says to \"evaluate the data actually discarded, excluding\n * enclosing properties preserved during a branch change\". Without that, a\n * `complex` policy prompts about `{name: \"Alex\"}` even though `name` survives\n * the switch untouched and nothing is lost.\n */\nexport const discardedByBranchChange = (\n data: unknown,\n schema: JsonSchema | undefined,\n excludeDiscriminator = false,\n): unknown => {\n if (!isPlainObject(data)) {\n return data;\n }\n const preserved = new Set(enclosingPropertyNames(schema));\n const discarded: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(data)) {\n const branches = schema?.oneOf as JsonSchema[] | undefined;\n // Only distinct, fixed primitive values identify a branch. An arbitrary\n // default or an invalid imported value is still user data.\n const fixed = branches?.map((branch) => branch.properties?.[key]);\n const discriminator =\n excludeDiscriminator &&\n fixed &&\n fixed.length > 1 &&\n fixed.every(\n (property) =>\n property &&\n Object.prototype.hasOwnProperty.call(property, 'const') &&\n (property.const === null || typeof property.const !== 'object'),\n ) &&\n new Set(fixed.map((property) => JSON.stringify(property!.const))).size ===\n fixed.length &&\n fixed.some((property) => isEqual(property!.const, value));\n if (!preserved.has(key) && !discriminator) {\n discarded[key] = value;\n }\n }\n return discarded;\n};\n\n/**\n * The value to commit when a branch change is performed.\n *\n * `defaults` is the branch's generated initial value. Preservation only\n * applies where it means something - both sides have to be objects for there\n * to be named properties to carry across - so a combinator of scalars simply\n * takes the generated default.\n */\nexport const branchChangeData = (\n data: unknown,\n defaults: unknown,\n schema: JsonSchema | undefined,\n): unknown => {\n const names = enclosingPropertyNames(schema);\n if (names.length === 0 || !isPlainObject(data)) {\n return defaults;\n }\n const preserved: Record<string, unknown> = {};\n for (const name of names) {\n // Only values that actually exist are preserved; an absent enclosing\n // property must not be materialised as `undefined` by the switch.\n if (Object.prototype.hasOwnProperty.call(data, name)) {\n preserved[name] = data[name];\n }\n }\n if (Object.keys(preserved).length === 0) {\n return defaults;\n }\n if (!isPlainObject(defaults)) {\n /*\n Clearing the selection, or a branch whose default is not an object. The\n enclosing properties are not part of any branch, so they survive - losing\n them here would be the same data loss the rule exists to prevent.\n */\n return defaults === undefined ? preserved : defaults;\n }\n // Preserved values take precedence over the generated defaults.\n return { ...defaults, ...preserved };\n};\n\n/** An object-only array slot remains an editable object when its choice is cleared. */\nexport const clearedBranchValue = (\n arrayItem: boolean,\n branches: JsonSchema[],\n): Record<string, unknown> | undefined =>\n arrayItem &&\n branches.length > 0 &&\n branches.every((branch) => branch.type === 'object')\n ? {}\n : undefined;\n"],"mappings":";;AAmBA,IAAaC,KACX,MAEA,OAAO,MAAAC,KAAA,OAAA,KAAA,IAAMA,EAAoC,eAAc,CAAC,CAAC,GAE7DC,KAAiB,MACrB,OAAOC,KAAU,cAAYA,KAAkB,CAAC,MAAM,QAAQA,CAAK,GAGxDC,KACX,GACA,MAEAC,MAAS,KAAA,KACRH,EAAcG,CAAI,KACjB,OAAO,KAAKA,CAAI,CAAC,CAAC,WAAW,MAC5BC,KAAgB,QAAQA,IAAe,IAW/BC,KACX,GACA,GACA,IAAuB,OACX;CACZ,IAAI,CAACL,EAAcG,CAAI,GACrB,OAAOA;CAET,IAAMG,IAAY,IAAI,IAAIR,EAAuBC,CAAM,CAAC,GAClDQ,IAAqC,CAAC;CAC5C,KAAK,IAAM,CAACC,GAAKP,MAAU,OAAO,QAAQE,CAAI,GAAG;EAC/C,IAAMM,IAAAV,KAAA,OAAA,KAAA,IAAWA,EAAQ,OAGnBW,IAAAD,KAAA,OAAA,KAAA,IAAQA,EAAU,KAAK,MAAW;;GAAO,QAAA,IAAAG,EAAA,eAAA,OAAA,KAAA,IAAAD,EAAaH;EAAA,CAAI,GAC1DK,IACJC,KACAJ,KACAA,EAAM,SAAS,KACfA,EAAM,OACH,MACCK,KACA,OAAO,UAAU,eAAe,KAAKA,GAAU,OAAO,MACrDA,EAAS,UAAU,QAAQ,OAAOA,EAAS,SAAU,SAC1D,KACA,IAAI,IAAIL,EAAM,KAAK,MAAa,KAAK,UAAUK,EAAU,KAAK,CAAC,CAAC,CAAC,CAAC,SAChEL,EAAM,UACRA,EAAM,MAAM,MAAab,EAAQkB,EAAU,OAAOd,CAAK,CAAC;EAC1D,AAAI,CAACK,EAAU,IAAIE,CAAG,KAAK,CAACK,MAC1B,EAAUL,KAAOP;CAErB;CACA,OAAOM;AACT,GAUaS,KACX,GACA,GACA,MACY;CACZ,IAAMC,IAAQnB,EAAuBC,CAAM;CAC3C,IAAIkB,EAAM,WAAW,KAAK,CAACjB,EAAcG,CAAI,GAC3C,OAAOe;CAET,IAAMZ,IAAqC,CAAC;CAC5C,KAAK,IAAMa,KAAQF,GAGjB,AAAI,OAAO,UAAU,eAAe,KAAKd,GAAMgB,CAAI,MACjD,EAAUA,KAAQhB,EAAKgB;CAe3B,OAZI,OAAO,KAAKb,CAAS,CAAC,CAAC,WAAW,IAC7BY,IAEJlB,EAAckB,CAAQ,IASpB;EAAE,GAAGA;EAAU,GAAGZ;CAAU,IAH1BY,MAAa,KAAA,IAAYZ,IAAYY;AAIhD,GAGaE,KACX,GACA,MAEAC,KACAZ,EAAS,SAAS,KAClBA,EAAS,OAAO,MAAWG,EAAO,SAAS,QAAQ,IAC/C,CAAC,IACD,KAAA"}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BocRIvOZ.js"),t=require("../core/dataPointer.cjs.js");let n=require("@jsonforms/core"),r=require("lodash/isEqual");r=e.t(r);var i=(e,t,i,a)=>{if(!a||typeof a!=`object`||Array.isArray(a))return;let o=e[i];if(o!=null&&o.length)try{let e=o.map(e=>e.$ref?(0,n.resolveSchema)(t,e.$ref,t):e),i=e[0];for(let t of Object.keys((i==null?void 0:i.properties)??{})){let n=e.map(e=>{var n;return e==null||(n=e.properties)==null?void 0:n[t]});if(!e.every(e=>{var n;return e==null||(n=e.required)==null?void 0:n.includes(t)})||!n.every(e=>e&&Object.prototype.hasOwnProperty.call(e,`const`)))continue;let i=n.map(e=>e.const);if(i.some((e,t)=>i.slice(0,t).some(t=>(0,r.default)(e,t))))continue;let o=i.findIndex(e=>(0,r.default)(e,a[t]));if(o!==-1)return o}}catch{}},a=(e,r,i,a)=>{try{var o;let s=(o=e.oneOf)==null?void 0:o.map(e=>e.$ref?(0,n.resolveSchema)(r,e.$ref,r):e);if(!(s!=null&&s.length))return!1;let c=Object.keys(s[0].properties??{}).filter(e=>s.every(t=>{var n,r;return((n=t.required)==null?void 0:n.includes(e))&&Object.prototype.hasOwnProperty.call(((r=t.properties)==null?void 0:r[e])??{},`const`)})),l=t.dataPathToPointer(i);return a.some(e=>e.keyword===`required`&&e.instancePath===l&&c.includes(e.params.missingProperty))}catch{return!1}};exports.discriminatorBranch=i,exports.missingDiscriminatorError=a;
2
+ //# sourceMappingURL=discriminatorBranch.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discriminatorBranch.cjs.js","names":["resolveSchema","isEqual","dataPathToPointer","require_rolldown_runtime","require_core_dataPointer","_jsonforms_core","lodash_isEqual","discriminatorBranch","data","branches","schema","keyword","resolved","branch","rootSchema","first","key","values","_branch$properties","_branch$required","value","constants","i","other","index","missingDiscriminatorError","_schema$oneOf","keys","_branch$required2","_branch$properties2","pointer","path","errors","error"],"sources":["../../src/composition/discriminatorBranch.ts"],"sourcesContent":["import { dataPathToPointer } from '../core/dataPointer';\nimport { JsonSchema, resolveSchema } from '@jsonforms/core';\nimport isEqual from 'lodash/isEqual';\n\n/** Infer only an unambiguous, explicit discriminator. Do not expand children or\n * treat this editing hint as schema validation. */\nexport const discriminatorBranch = (\n schema: JsonSchema,\n rootSchema: JsonSchema,\n keyword: 'oneOf' | 'anyOf',\n data: unknown,\n): number | undefined => {\n if (!data || typeof data !== 'object' || Array.isArray(data))\n return undefined;\n const branches = schema[keyword];\n if (!branches?.length) return undefined;\n try {\n const resolved = branches.map((branch) =>\n branch.$ref ? resolveSchema(rootSchema, branch.$ref, rootSchema) : branch,\n );\n const first = resolved[0];\n for (const key of Object.keys(first?.properties ?? {})) {\n const values = resolved.map((branch) => branch?.properties?.[key]);\n if (\n !resolved.every((branch) => branch?.required?.includes(key)) ||\n !values.every(\n (value) =>\n value && Object.prototype.hasOwnProperty.call(value, 'const'),\n )\n )\n continue;\n const constants = values.map((value) => value.const);\n if (\n constants.some((value, i) =>\n constants.slice(0, i).some((other) => isEqual(value, other)),\n )\n )\n continue;\n const index = constants.findIndex((value) =>\n isEqual(value, (data as Record<string, unknown>)[key]),\n );\n if (index !== -1) return index;\n }\n } catch {\n // Unresolved references remain the host's responsibility.\n }\n return undefined;\n};\n\n/** A missing discriminator belongs on the branch selector, not a hidden field. */\nexport const missingDiscriminatorError = (\n schema: JsonSchema,\n rootSchema: JsonSchema,\n path: string,\n errors: import('ajv').ErrorObject[],\n): boolean => {\n try {\n const branches = schema.oneOf?.map((branch) =>\n branch.$ref ? resolveSchema(rootSchema, branch.$ref, rootSchema) : branch,\n );\n if (!branches?.length) return false;\n const keys = Object.keys(branches[0].properties ?? {}).filter((key) =>\n branches.every(\n (branch) =>\n branch.required?.includes(key) &&\n Object.prototype.hasOwnProperty.call(\n branch.properties?.[key] ?? {},\n 'const',\n ),\n ),\n );\n const pointer = dataPathToPointer(path);\n return errors.some(\n (error) =>\n error.keyword === 'required' &&\n error.instancePath === pointer &&\n keys.includes(error.params.missingProperty),\n );\n } catch {\n return false;\n }\n};\n"],"mappings":"A,oOA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b,EAAO,MAAA,EAAOb,EAAAA,cAAAA,CAAcc,EAAYD,EAAO,KAAMC,CAAU,EAAID,CACrE,EACA,GAAI,EAAAJ,GAAA,MAACA,EAAU,QAAQ,MAAO,GAC9B,IAAMkB,EAAO,OAAO,KAAKlB,EAAS,EAAE,CAAC,YAAc,CAAC,CAAC,CAAC,CAAC,OAAQ,GAC7DA,EAAS,MACN,GACC,C,QAAO,QAAA,EAAAI,EAAA,WAAA,KAAA,IAAA,GAAAe,EAAU,SAASZ,CAAG,IAC7B,OAAO,UAAU,eAAe,OAAA,EAC9BH,EAAO,aAAA,KAAA,IAAA,GAAAgB,EAAab,KAAQ,CAAC,EAC7B,OACF,CACJ,CAAA,CACF,EACMc,EAAU5B,EAAAA,kBAAkB6B,CAAI,EACtC,OAAOC,EAAO,KACX,GACCC,EAAM,UAAY,YAClBA,EAAM,eAAiBH,GACvBH,EAAK,SAASM,EAAM,OAAO,eAAe,CAC9C,CACF,MAAQ,CACN,MAAO,EACT,CACF,E"}
@@ -0,0 +1,6 @@
1
+ import { JsonSchema } from '@jsonforms/core';
2
+ /** Infer only an unambiguous, explicit discriminator. Do not expand children or
3
+ * treat this editing hint as schema validation. */
4
+ export declare const discriminatorBranch: (schema: JsonSchema, rootSchema: JsonSchema, keyword: "oneOf" | "anyOf", data: unknown) => number | undefined;
5
+ /** A missing discriminator belongs on the branch selector, not a hidden field. */
6
+ export declare const missingDiscriminatorError: (schema: JsonSchema, rootSchema: JsonSchema, path: string, errors: import("ajv").ErrorObject[]) => boolean;
@@ -0,0 +1,41 @@
1
+ import { dataPathToPointer as e } from "../core/dataPointer.esm.js";
2
+ import { resolveSchema as t } from "@jsonforms/core";
3
+ import n from "lodash/isEqual";
4
+ // src/composition/discriminatorBranch.ts
5
+ var r = (e, r, i, a) => {
6
+ if (!a || typeof a != "object" || Array.isArray(a)) return;
7
+ let o = e[i];
8
+ if (o != null && o.length) try {
9
+ let e = o.map((e) => e.$ref ? t(r, e.$ref, r) : e), i = e[0];
10
+ for (let t of Object.keys((i == null ? void 0 : i.properties) ?? {})) {
11
+ let r = e.map((e) => {
12
+ var n;
13
+ return e == null || (n = e.properties) == null ? void 0 : n[t];
14
+ });
15
+ if (!e.every((e) => {
16
+ var n;
17
+ return e == null || (n = e.required) == null ? void 0 : n.includes(t);
18
+ }) || !r.every((e) => e && Object.prototype.hasOwnProperty.call(e, "const"))) continue;
19
+ let i = r.map((e) => e.const);
20
+ if (i.some((e, t) => i.slice(0, t).some((t) => n(e, t)))) continue;
21
+ let o = i.findIndex((e) => n(e, a[t]));
22
+ if (o !== -1) return o;
23
+ }
24
+ } catch {}
25
+ }, i = (n, r, i, a) => {
26
+ try {
27
+ var o;
28
+ let s = (o = n.oneOf) == null ? void 0 : o.map((e) => e.$ref ? t(r, e.$ref, r) : e);
29
+ if (!(s != null && s.length)) return !1;
30
+ let c = Object.keys(s[0].properties ?? {}).filter((e) => s.every((t) => {
31
+ var n, r;
32
+ return ((n = t.required) == null ? void 0 : n.includes(e)) && Object.prototype.hasOwnProperty.call(((r = t.properties) == null ? void 0 : r[e]) ?? {}, "const");
33
+ })), l = e(i);
34
+ return a.some((e) => e.keyword === "required" && e.instancePath === l && c.includes(e.params.missingProperty));
35
+ } catch {
36
+ return !1;
37
+ }
38
+ };
39
+ export { r as discriminatorBranch, i as missingDiscriminatorError };
40
+
41
+ //# sourceMappingURL=discriminatorBranch.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discriminatorBranch.esm.js","names":["isEqual","discriminatorBranch","data","branches","schema","keyword","resolved","branch","resolveSchema","rootSchema","first","key","values","_branch$properties","_branch$required","value","constants","i","other","index","missingDiscriminatorError","_schema$oneOf","keys","_branch$required2","_branch$properties2","pointer","dataPathToPointer","path","errors","error"],"sources":["../../src/composition/discriminatorBranch.ts"],"sourcesContent":["import { dataPathToPointer } from '../core/dataPointer';\nimport { JsonSchema, resolveSchema } from '@jsonforms/core';\nimport isEqual from 'lodash/isEqual';\n\n/** Infer only an unambiguous, explicit discriminator. Do not expand children or\n * treat this editing hint as schema validation. */\nexport const discriminatorBranch = (\n schema: JsonSchema,\n rootSchema: JsonSchema,\n keyword: 'oneOf' | 'anyOf',\n data: unknown,\n): number | undefined => {\n if (!data || typeof data !== 'object' || Array.isArray(data))\n return undefined;\n const branches = schema[keyword];\n if (!branches?.length) return undefined;\n try {\n const resolved = branches.map((branch) =>\n branch.$ref ? resolveSchema(rootSchema, branch.$ref, rootSchema) : branch,\n );\n const first = resolved[0];\n for (const key of Object.keys(first?.properties ?? {})) {\n const values = resolved.map((branch) => branch?.properties?.[key]);\n if (\n !resolved.every((branch) => branch?.required?.includes(key)) ||\n !values.every(\n (value) =>\n value && Object.prototype.hasOwnProperty.call(value, 'const'),\n )\n )\n continue;\n const constants = values.map((value) => value.const);\n if (\n constants.some((value, i) =>\n constants.slice(0, i).some((other) => isEqual(value, other)),\n )\n )\n continue;\n const index = constants.findIndex((value) =>\n isEqual(value, (data as Record<string, unknown>)[key]),\n );\n if (index !== -1) return index;\n }\n } catch {\n // Unresolved references remain the host's responsibility.\n }\n return undefined;\n};\n\n/** A missing discriminator belongs on the branch selector, not a hidden field. */\nexport const missingDiscriminatorError = (\n schema: JsonSchema,\n rootSchema: JsonSchema,\n path: string,\n errors: import('ajv').ErrorObject[],\n): boolean => {\n try {\n const branches = schema.oneOf?.map((branch) =>\n branch.$ref ? resolveSchema(rootSchema, branch.$ref, rootSchema) : branch,\n );\n if (!branches?.length) return false;\n const keys = Object.keys(branches[0].properties ?? {}).filter((key) =>\n branches.every(\n (branch) =>\n branch.required?.includes(key) &&\n Object.prototype.hasOwnProperty.call(\n branch.properties?.[key] ?? {},\n 'const',\n ),\n ),\n );\n const pointer = dataPathToPointer(path);\n return errors.some(\n (error) =>\n error.keyword === 'required' &&\n error.instancePath === pointer &&\n keys.includes(error.params.missingProperty),\n );\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;AAMA,IAAaC,KACX,GACA,GACA,GACA,MACuB;CACvB,IAAI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B,IAAMmB,IAAO,OAAO,KAAKnB,EAAS,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,QAAQ,MAC7DA,EAAS,OACN,MACC;;GAAO,SAAA,IAAAI,EAAA,aAAA,OAAA,KAAA,IAAAgB,EAAU,SAASZ,CAAG,MAC7B,OAAO,UAAU,eAAe,OAAA,IAC9BJ,EAAO,eAAA,OAAA,KAAA,IAAAiB,EAAab,OAAQ,CAAC,GAC7B,OACF;EACJ,CAAA,CACF,GACMc,IAAUC,EAAkBC,CAAI;EACtC,OAAOC,EAAO,MACX,MACCC,EAAM,YAAY,cAClBA,EAAM,iBAAiBJ,KACvBH,EAAK,SAASO,EAAM,OAAO,eAAe,CAC9C;CACF,QAAQ;EACN,OAAO;CACT;AACF"}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@jsonforms/core");var t=[`string`,`number`,`integer`,`boolean`],n=new Set([`maximum`,`minimum`,`exclusiveMaximum`,`exclusiveMinimum`,`multipleOf`,`maxLength`,`minLength`,`pattern`,`format`,`contentEncoding`,`contentMediaType`]),r=new Set([`title`,`description`,`default`,`examples`,`readOnly`,`writeOnly`,`deprecated`,`$comment`]),i=[`oneOf`,`anyOf`,`allOf`],a=(t,n)=>{let r=t.$ref;if(r===void 0)return t;if(n!==void 0)try{return e.Resolve.schema(n,r,n)}catch{return}},o=e=>e===void 0||typeof e!=`object`?!1:Object.keys(e).every(e=>e===`type`||n.has(e)||r.has(e)),s=e=>{let t=e==null?void 0:e.type;return typeof t==`string`?t:void 0},c=(e,n)=>{if(e===void 0||typeof e!=`object`)return;let r=i.filter(t=>Array.isArray(e[t]));if(r.length!==1)return;let c=e;if(c.enum!==void 0||c.const!==void 0)return;let l=c[r[0]];if(l.length===0)return;let u=new Set,d=s(e);d!==void 0&&u.add(d);for(let e of l){let t=a(e,n);if(!o(t))return;let r=s(t);r!==void 0&&u.add(r)}if(u.size!==1)return;let[f]=Array.from(u);return t.includes(f)?f:void 0},l=(e,t)=>{let n=e,r={};for(let[e,t]of Object.entries(n))i.includes(e)||(r[e]=t);if(!Array.isArray(n.allOf))return r;let o={...r};for(let e of n.allOf){let n=a(e,t);for(let[e,t]of Object.entries(n??{}))o[e]===void 0&&(o[e]=t)}return o};exports.scalarCompositionSchema=l,exports.scalarCompositionType=c;
2
+ //# sourceMappingURL=scalarComposition.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalarComposition.cjs.js","names":["Resolve","_jsonforms_core","PRIMITIVE_TYPES","VALIDATION_KEYWORDS","ANNOTATION_KEYWORDS","COMBINATORS","resolveBranch","ref","branch","rootSchema","isScalarNarrowing","key","typeOf","type","schema","scalarCompositionType","present","keyword","record","branches","types","outerType","raw","branchType","only","scalarCompositionSchema","rest","value","merged"],"sources":["../../src/composition/scalarComposition.ts"],"sourcesContent":["import { JsonSchema, Resolve } from '@jsonforms/core';\n\n/**\n * Composition that describes **one** editor.\n *\n * Section 18's project presentation contract: \"when composition describes one\n * unambiguous scalar editor, render it once and preserve the outer Control's\n * label, description, i18n, options, and data path. Annotation-only branches\n * do not create separate inputs.\"\n *\n * `{ \"type\": \"integer\", \"anyOf\": [{ \"maximum\": 10 }, { \"minimum\": 20 }] }`\n * is one integer input, not two tabs. The branches say what a valid integer\n * is; they do not describe two different things to edit.\n *\n * This decides only **presentation**. The validator still sees the whole\n * schema, so the alternative-match and exclusive-match errors it raises\n * appear beside that single input as usual.\n */\n\nconst PRIMITIVE_TYPES = ['string', 'number', 'integer', 'boolean'];\n\n/**\n * Keywords that constrain a scalar without describing another editor.\n *\n * `enum` and `const` are deliberately absent: they turn a value into a finite\n * choice, which has its own renderers and its own conventions. The\n * specification is explicit that those \"take precedence where applicable\" and\n * that arbitrary branches must not be turned into enum values.\n */\nconst VALIDATION_KEYWORDS = new Set([\n 'maximum',\n 'minimum',\n 'exclusiveMaximum',\n 'exclusiveMinimum',\n 'multipleOf',\n 'maxLength',\n 'minLength',\n 'pattern',\n 'format',\n 'contentEncoding',\n 'contentMediaType',\n]);\n\nconst ANNOTATION_KEYWORDS = new Set([\n 'title',\n 'description',\n 'default',\n 'examples',\n 'readOnly',\n 'writeOnly',\n 'deprecated',\n '$comment',\n]);\n\nconst COMBINATORS = ['oneOf', 'anyOf', 'allOf'] as const;\nexport type Combinator = (typeof COMBINATORS)[number];\n\nconst resolveBranch = (\n branch: JsonSchema,\n rootSchema: JsonSchema | undefined,\n): JsonSchema | undefined => {\n const ref = (branch as { $ref?: string }).$ref;\n if (ref === undefined) {\n return branch;\n }\n if (rootSchema === undefined) {\n return undefined;\n }\n try {\n return Resolve.schema(rootSchema, ref, rootSchema);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Whether a branch only narrows a scalar, rather than describing a structure.\n *\n * Anything this does not recognise makes the composition ambiguous, which is\n * the safe answer: the branch presentation is kept and nothing is lost.\n */\nconst isScalarNarrowing = (branch: JsonSchema | undefined): boolean => {\n if (branch === undefined || typeof branch !== 'object') {\n return false;\n }\n return Object.keys(branch).every(\n (key) =>\n key === 'type' ||\n VALIDATION_KEYWORDS.has(key) ||\n ANNOTATION_KEYWORDS.has(key),\n );\n};\n\nconst typeOf = (schema: JsonSchema | undefined): string | undefined => {\n const type = (schema as { type?: unknown } | undefined)?.type;\n return typeof type === 'string' ? type : undefined;\n};\n\n/**\n * The one primitive type a composition describes, or `undefined` when it\n * describes more than one thing to edit.\n *\n * Returning `undefined` is always safe: it leaves the branch presentation and\n * the full validation exactly as they were.\n */\nexport const scalarCompositionType = (\n schema: JsonSchema | undefined,\n rootSchema?: JsonSchema,\n): string | undefined => {\n if (schema === undefined || typeof schema !== 'object') {\n return undefined;\n }\n const present = COMBINATORS.filter((keyword) =>\n Array.isArray((schema as Record<string, unknown>)[keyword]),\n );\n // Two combinators at once is not one unambiguous editor.\n if (present.length !== 1) {\n return undefined;\n }\n const record = schema as Record<string, unknown>;\n // A finite choice has its own renderers; leave them to it.\n if (record.enum !== undefined || record.const !== undefined) {\n return undefined;\n }\n const branches = record[present[0]] as JsonSchema[];\n if (branches.length === 0) {\n return undefined;\n }\n\n const types = new Set<string>();\n const outerType = typeOf(schema);\n if (outerType !== undefined) {\n types.add(outerType);\n }\n for (const raw of branches) {\n const branch = resolveBranch(raw, rootSchema);\n if (!isScalarNarrowing(branch)) {\n return undefined;\n }\n const branchType = typeOf(branch);\n if (branchType !== undefined) {\n types.add(branchType);\n }\n }\n\n if (types.size !== 1) {\n return undefined;\n }\n const [only] = Array.from(types);\n return PRIMITIVE_TYPES.includes(only) ? only : undefined;\n};\n\n/**\n * The schema to hand the single editor.\n *\n * `allOf` means intersection, so its branches' constraints all apply and\n * folding them in keeps the input honest - this is how the draft-07\n * meta-schema's `nonNegativeIntegerDefault0` becomes one integer input with\n * minimum 0.\n *\n * `oneOf` and `anyOf` are alternatives, and their bounds are dropped: \"Do not\n * copy both branches' bounds onto the input: minimum 20 and maximum 10 would\n * prevent valid entries. Even choosing just one branch's bound would exclude\n * values that the other branch permits.\" Those constraints are left to\n * full-schema validation, which still reports them.\n */\nexport const scalarCompositionSchema = (\n schema: JsonSchema,\n rootSchema?: JsonSchema,\n): JsonSchema => {\n const record = schema as Record<string, unknown>;\n const rest: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(record)) {\n if (!(COMBINATORS as readonly string[]).includes(key)) {\n rest[key] = value;\n }\n }\n if (!Array.isArray(record.allOf)) {\n return rest as JsonSchema;\n }\n const merged: Record<string, unknown> = { ...rest };\n for (const raw of record.allOf as JsonSchema[]) {\n const branch = resolveBranch(raw, rootSchema);\n for (const [key, value] of Object.entries(branch ?? {})) {\n // The outer schema wins: its own constraints and annotations are the\n // ones the author wrote against this property.\n if (merged[key] === undefined) {\n merged[key] = value;\n }\n }\n }\n return merged as JsonSchema;\n};\n"],"mappings":"A,oGAmBA,IAAME,EAAkB,CAAC,SAAU,SAAU,UAAW,SAAS,EAU3DC,EAAsB,IAAI,IAAI,CAClC,UACA,UACA,mBACA,mBACA,aACA,YACA,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CAAM,EAC5Be,IAAe,IAAA,IACjBH,EAAM,IAAIG,CAAU,CAExB,CAEA,GAAIH,EAAM,OAAS,EACjB,OAEF,GAAM,CAACI,GAAQ,MAAM,KAAKJ,CAAK,EAC/B,OAAOlB,EAAgB,SAASsB,CAAI,EAAIA,EAAO,IAAA,EACjD,EAgBaC,GACX,EACA,IACe,CACf,IAAMP,EAASJ,EACTY,EAAgC,CAAC,EACvC,IAAK,GAAM,CAACf,EAAKgB,KAAU,OAAO,QAAQT,CAAM,EACxCb,EAAkC,SAASM,CAAG,IAClD,EAAKA,GAAOgB,GAGhB,GAAI,CAAC,MAAM,QAAQT,EAAO,KAAK,EAC7B,OAAOQ,EAET,IAAME,EAAkC,CAAE,GAAGF,CAAK,EAClD,IAAK,IAAMJ,KAAOJ,EAAO,MAAuB,CAC9C,IAAMV,EAASF,EAAcgB,EAAKb,CAAU,EAC5C,IAAK,GAAM,CAACE,EAAKgB,KAAU,OAAO,QAAQnB,GAAU,CAAC,CAAC,EAGhDoB,EAAOjB,KAAS,IAAA,KAClB,EAAOA,GAAOgB,EAGpB,CACA,OAAOC,CACT,E"}
@@ -0,0 +1,27 @@
1
+ import { JsonSchema } from '@jsonforms/core';
2
+ declare const COMBINATORS: readonly ["oneOf", "anyOf", "allOf"];
3
+ export type Combinator = (typeof COMBINATORS)[number];
4
+ /**
5
+ * The one primitive type a composition describes, or `undefined` when it
6
+ * describes more than one thing to edit.
7
+ *
8
+ * Returning `undefined` is always safe: it leaves the branch presentation and
9
+ * the full validation exactly as they were.
10
+ */
11
+ export declare const scalarCompositionType: (schema: JsonSchema | undefined, rootSchema?: JsonSchema) => string | undefined;
12
+ /**
13
+ * The schema to hand the single editor.
14
+ *
15
+ * `allOf` means intersection, so its branches' constraints all apply and
16
+ * folding them in keeps the input honest - this is how the draft-07
17
+ * meta-schema's `nonNegativeIntegerDefault0` becomes one integer input with
18
+ * minimum 0.
19
+ *
20
+ * `oneOf` and `anyOf` are alternatives, and their bounds are dropped: "Do not
21
+ * copy both branches' bounds onto the input: minimum 20 and maximum 10 would
22
+ * prevent valid entries. Even choosing just one branch's bound would exclude
23
+ * values that the other branch permits." Those constraints are left to
24
+ * full-schema validation, which still reports them.
25
+ */
26
+ export declare const scalarCompositionSchema: (schema: JsonSchema, rootSchema?: JsonSchema) => JsonSchema;
27
+ export {};
@@ -0,0 +1,76 @@
1
+ import { Resolve as e } from "@jsonforms/core";
2
+ // src/composition/scalarComposition.ts
3
+ var t = [
4
+ "string",
5
+ "number",
6
+ "integer",
7
+ "boolean"
8
+ ], n = /* @__PURE__ */ new Set([
9
+ "maximum",
10
+ "minimum",
11
+ "exclusiveMaximum",
12
+ "exclusiveMinimum",
13
+ "multipleOf",
14
+ "maxLength",
15
+ "minLength",
16
+ "pattern",
17
+ "format",
18
+ "contentEncoding",
19
+ "contentMediaType"
20
+ ]), r = /* @__PURE__ */ new Set([
21
+ "title",
22
+ "description",
23
+ "default",
24
+ "examples",
25
+ "readOnly",
26
+ "writeOnly",
27
+ "deprecated",
28
+ "$comment"
29
+ ]), i = [
30
+ "oneOf",
31
+ "anyOf",
32
+ "allOf"
33
+ ], a = (t, n) => {
34
+ let r = t.$ref;
35
+ if (r === void 0) return t;
36
+ if (n !== void 0) try {
37
+ return e.schema(n, r, n);
38
+ } catch {
39
+ return;
40
+ }
41
+ }, o = (e) => e === void 0 || typeof e != "object" ? !1 : Object.keys(e).every((e) => e === "type" || n.has(e) || r.has(e)), s = (e) => {
42
+ let t = e == null ? void 0 : e.type;
43
+ return typeof t == "string" ? t : void 0;
44
+ }, c = (e, n) => {
45
+ if (e === void 0 || typeof e != "object") return;
46
+ let r = i.filter((t) => Array.isArray(e[t]));
47
+ if (r.length !== 1) return;
48
+ let c = e;
49
+ if (c.enum !== void 0 || c.const !== void 0) return;
50
+ let l = c[r[0]];
51
+ if (l.length === 0) return;
52
+ let u = /* @__PURE__ */ new Set(), d = s(e);
53
+ d !== void 0 && u.add(d);
54
+ for (let e of l) {
55
+ let t = a(e, n);
56
+ if (!o(t)) return;
57
+ let r = s(t);
58
+ r !== void 0 && u.add(r);
59
+ }
60
+ if (u.size !== 1) return;
61
+ let [f] = Array.from(u);
62
+ return t.includes(f) ? f : void 0;
63
+ }, l = (e, t) => {
64
+ let n = e, r = {};
65
+ for (let [e, t] of Object.entries(n)) i.includes(e) || (r[e] = t);
66
+ if (!Array.isArray(n.allOf)) return r;
67
+ let o = { ...r };
68
+ for (let e of n.allOf) {
69
+ let n = a(e, t);
70
+ for (let [e, t] of Object.entries(n ?? {})) o[e] === void 0 && (o[e] = t);
71
+ }
72
+ return o;
73
+ };
74
+ export { l as scalarCompositionSchema, c as scalarCompositionType };
75
+
76
+ //# sourceMappingURL=scalarComposition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalarComposition.esm.js","names":["PRIMITIVE_TYPES","VALIDATION_KEYWORDS","ANNOTATION_KEYWORDS","COMBINATORS","resolveBranch","ref","branch","rootSchema","Resolve","isScalarNarrowing","key","typeOf","type","schema","scalarCompositionType","present","keyword","record","branches","types","outerType","raw","branchType","only","scalarCompositionSchema","rest","value","merged"],"sources":["../../src/composition/scalarComposition.ts"],"sourcesContent":["import { JsonSchema, Resolve } from '@jsonforms/core';\n\n/**\n * Composition that describes **one** editor.\n *\n * Section 18's project presentation contract: \"when composition describes one\n * unambiguous scalar editor, render it once and preserve the outer Control's\n * label, description, i18n, options, and data path. Annotation-only branches\n * do not create separate inputs.\"\n *\n * `{ \"type\": \"integer\", \"anyOf\": [{ \"maximum\": 10 }, { \"minimum\": 20 }] }`\n * is one integer input, not two tabs. The branches say what a valid integer\n * is; they do not describe two different things to edit.\n *\n * This decides only **presentation**. The validator still sees the whole\n * schema, so the alternative-match and exclusive-match errors it raises\n * appear beside that single input as usual.\n */\n\nconst PRIMITIVE_TYPES = ['string', 'number', 'integer', 'boolean'];\n\n/**\n * Keywords that constrain a scalar without describing another editor.\n *\n * `enum` and `const` are deliberately absent: they turn a value into a finite\n * choice, which has its own renderers and its own conventions. The\n * specification is explicit that those \"take precedence where applicable\" and\n * that arbitrary branches must not be turned into enum values.\n */\nconst VALIDATION_KEYWORDS = new Set([\n 'maximum',\n 'minimum',\n 'exclusiveMaximum',\n 'exclusiveMinimum',\n 'multipleOf',\n 'maxLength',\n 'minLength',\n 'pattern',\n 'format',\n 'contentEncoding',\n 'contentMediaType',\n]);\n\nconst ANNOTATION_KEYWORDS = new Set([\n 'title',\n 'description',\n 'default',\n 'examples',\n 'readOnly',\n 'writeOnly',\n 'deprecated',\n '$comment',\n]);\n\nconst COMBINATORS = ['oneOf', 'anyOf', 'allOf'] as const;\nexport type Combinator = (typeof COMBINATORS)[number];\n\nconst resolveBranch = (\n branch: JsonSchema,\n rootSchema: JsonSchema | undefined,\n): JsonSchema | undefined => {\n const ref = (branch as { $ref?: string }).$ref;\n if (ref === undefined) {\n return branch;\n }\n if (rootSchema === undefined) {\n return undefined;\n }\n try {\n return Resolve.schema(rootSchema, ref, rootSchema);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Whether a branch only narrows a scalar, rather than describing a structure.\n *\n * Anything this does not recognise makes the composition ambiguous, which is\n * the safe answer: the branch presentation is kept and nothing is lost.\n */\nconst isScalarNarrowing = (branch: JsonSchema | undefined): boolean => {\n if (branch === undefined || typeof branch !== 'object') {\n return false;\n }\n return Object.keys(branch).every(\n (key) =>\n key === 'type' ||\n VALIDATION_KEYWORDS.has(key) ||\n ANNOTATION_KEYWORDS.has(key),\n );\n};\n\nconst typeOf = (schema: JsonSchema | undefined): string | undefined => {\n const type = (schema as { type?: unknown } | undefined)?.type;\n return typeof type === 'string' ? type : undefined;\n};\n\n/**\n * The one primitive type a composition describes, or `undefined` when it\n * describes more than one thing to edit.\n *\n * Returning `undefined` is always safe: it leaves the branch presentation and\n * the full validation exactly as they were.\n */\nexport const scalarCompositionType = (\n schema: JsonSchema | undefined,\n rootSchema?: JsonSchema,\n): string | undefined => {\n if (schema === undefined || typeof schema !== 'object') {\n return undefined;\n }\n const present = COMBINATORS.filter((keyword) =>\n Array.isArray((schema as Record<string, unknown>)[keyword]),\n );\n // Two combinators at once is not one unambiguous editor.\n if (present.length !== 1) {\n return undefined;\n }\n const record = schema as Record<string, unknown>;\n // A finite choice has its own renderers; leave them to it.\n if (record.enum !== undefined || record.const !== undefined) {\n return undefined;\n }\n const branches = record[present[0]] as JsonSchema[];\n if (branches.length === 0) {\n return undefined;\n }\n\n const types = new Set<string>();\n const outerType = typeOf(schema);\n if (outerType !== undefined) {\n types.add(outerType);\n }\n for (const raw of branches) {\n const branch = resolveBranch(raw, rootSchema);\n if (!isScalarNarrowing(branch)) {\n return undefined;\n }\n const branchType = typeOf(branch);\n if (branchType !== undefined) {\n types.add(branchType);\n }\n }\n\n if (types.size !== 1) {\n return undefined;\n }\n const [only] = Array.from(types);\n return PRIMITIVE_TYPES.includes(only) ? only : undefined;\n};\n\n/**\n * The schema to hand the single editor.\n *\n * `allOf` means intersection, so its branches' constraints all apply and\n * folding them in keeps the input honest - this is how the draft-07\n * meta-schema's `nonNegativeIntegerDefault0` becomes one integer input with\n * minimum 0.\n *\n * `oneOf` and `anyOf` are alternatives, and their bounds are dropped: \"Do not\n * copy both branches' bounds onto the input: minimum 20 and maximum 10 would\n * prevent valid entries. Even choosing just one branch's bound would exclude\n * values that the other branch permits.\" Those constraints are left to\n * full-schema validation, which still reports them.\n */\nexport const scalarCompositionSchema = (\n schema: JsonSchema,\n rootSchema?: JsonSchema,\n): JsonSchema => {\n const record = schema as Record<string, unknown>;\n const rest: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(record)) {\n if (!(COMBINATORS as readonly string[]).includes(key)) {\n rest[key] = value;\n }\n }\n if (!Array.isArray(record.allOf)) {\n return rest as JsonSchema;\n }\n const merged: Record<string, unknown> = { ...rest };\n for (const raw of record.allOf as JsonSchema[]) {\n const branch = resolveBranch(raw, rootSchema);\n for (const [key, value] of Object.entries(branch ?? {})) {\n // The outer schema wins: its own constraints and annotations are the\n // ones the author wrote against this property.\n if (merged[key] === undefined) {\n merged[key] = value;\n }\n }\n }\n return merged as JsonSchema;\n};\n"],"mappings":";;AAmBA,IAAMA,IAAkB;CAAC;CAAU;CAAU;CAAW;AAAS,GAU3DC,oBAAsB,IAAI,IAAI;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GAEKC,oBAAsB,IAAI,IAAI;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GAEKC,IAAc;CAAC;CAAS;CAAS;AAAO,GAGxCC,KACJ,GACA,MAC2B;CAC3B,IAAMC,IAAOC,EAA6B;CAC1C,IAAID,MAAQ,KAAA,GACV,OAAOC;CAET,IAAIC,MAAe,KAAA,GAGnB,IAAI;EACF,OAAOC,EAAQ,OAAOD,GAAYF,GAAKE,CAAU;CACnD,QAAQ;EACN;CACF;AACF,GAQME,KAAqB,MACrBH,MAAW,KAAA,KAAa,OAAOA,KAAW,WACrC,KAEF,OAAO,KAAKA,CAAM,CAAC,CAAC,OACxB,MACCI,MAAQ,UACRT,EAAoB,IAAIS,CAAG,KAC3BR,EAAoB,IAAIQ,CAAG,CAC/B,GAGIC,KAAU,MAAuD;CACrE,IAAMC,IAAAC,KAAA,OAAA,KAAA,IAAQA,EAA2C;CACzD,OAAO,OAAOD,KAAS,WAAWA,IAAO,KAAA;AAC3C,GASaE,KACX,GACA,MACuB;CACvB,IAAID,MAAW,KAAA,KAAa,OAAOA,KAAW,UAC5C;CAEF,IAAME,IAAUZ,EAAY,QAAQ,MAClC,MAAM,QAASU,EAAmCG,EAAQ,CAC5D;CAEA,IAAID,EAAQ,WAAW,GACrB;CAEF,IAAME,IAASJ;CAEf,IAAII,EAAO,SAAS,KAAA,KAAaA,EAAO,UAAU,KAAA,GAChD;CAEF,IAAMC,IAAWD,EAAOF,EAAQ;CAChC,IAAIG,EAAS,WAAW,GACtB;CAGF,IAAMC,oBAAQ,IAAI,IAAY,GACxBC,IAAYT,EAAOE,CAAM;CAC/B,AAAIO,MAAc,KAAA,KAChBD,EAAM,IAAIC,CAAS;CAErB,KAAK,IAAMC,KAAOH,GAAU;EAC1B,IAAMZ,IAASF,EAAciB,GAAKd,CAAU;EAC5C,IAAI,CAACE,EAAkBH,CAAM,GAC3B;EAEF,IAAMgB,IAAaX,EAAOL,CAAM;EAChC,AAAIgB,MAAe,KAAA,KACjBH,EAAM,IAAIG,CAAU;CAExB;CAEA,IAAIH,EAAM,SAAS,GACjB;CAEF,IAAM,CAACI,KAAQ,MAAM,KAAKJ,CAAK;CAC/B,OAAOnB,EAAgB,SAASuB,CAAI,IAAIA,IAAO,KAAA;AACjD,GAgBaC,KACX,GACA,MACe;CACf,IAAMP,IAASJ,GACTY,IAAgC,CAAC;CACvC,KAAK,IAAM,CAACf,GAAKgB,MAAU,OAAO,QAAQT,CAAM,GAC9C,AAAMd,EAAkC,SAASO,CAAG,MAClD,EAAKA,KAAOgB;CAGhB,IAAI,CAAC,MAAM,QAAQT,EAAO,KAAK,GAC7B,OAAOQ;CAET,IAAME,IAAkC,EAAE,GAAGF,EAAK;CAClD,KAAK,IAAMJ,KAAOJ,EAAO,OAAuB;EAC9C,IAAMX,IAASF,EAAciB,GAAKd,CAAU;EAC5C,KAAK,IAAM,CAACG,GAAKgB,MAAU,OAAO,QAAQpB,KAAU,CAAC,CAAC,GAGpD,AAAIqB,EAAOjB,OAAS,KAAA,MAClB,EAAOA,KAAOgB;CAGpB;CACA,OAAOC;AACT"}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../validation/validationIndicator.cjs.js"),t=require("../locale/translate.cjs.js"),n=require("./discriminatorBranch.cjs.js");let r=require("@jsonforms/core");function i({schema:i,rootSchema:a,uischema:o,path:s,uischemas:c},l,u){let d=t.useTranslator(),[f,p]=e.displayableErrors(u??{});return{translate:d,selectionError:n.missingDiscriminatorError(i,a,s,[...f??[],...p??[]])?d(`oneOf.chooseKind`,`Choose a kind.`):``,renderInfos:(0,r.createCombinatorRenderInfos)(i[l]??[],a,l,o,s,c).map(e=>{let t=e.schema.i18n;return typeof t==`string`?{...e,label:d(`${t}.label`,e.label)??e.label}:e})}}exports.useCombinatorSelection=i;
2
+ //# sourceMappingURL=useCombinatorSelection.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCombinatorSelection.cjs.js","names":["useTranslator","displayableErrors","missingDiscriminatorError","createCombinatorRenderInfos","require_validation_validationIndicator","require_locale_translate","require_composition_discriminatorBranch","_jsonforms_core","useCombinatorSelection","translate","primaryErrors","additionalErrors","core","schema","rootSchema","path","combinator","uischema","uischemas","prefix","info"],"sources":["../../src/composition/useCombinatorSelection.ts"],"sourcesContent":["import {\n createCombinatorRenderInfos,\n type CombinatorRendererProps,\n type JsonSchema,\n type JsonFormsCore,\n} from '@jsonforms/core';\nimport { displayableErrors } from '../validation/validationIndicator';\nimport { useTranslator } from '../locale/translate';\nimport { missingDiscriminatorError } from './discriminatorBranch';\n\nexport function useCombinatorSelection(\n {\n schema,\n rootSchema,\n uischema,\n path,\n uischemas,\n }: Pick<\n CombinatorRendererProps,\n 'schema' | 'rootSchema' | 'uischema' | 'path' | 'uischemas'\n >,\n combinator: 'anyOf' | 'oneOf',\n core?: JsonFormsCore,\n) {\n const translate = useTranslator();\n const [primaryErrors, additionalErrors] = displayableErrors(core ?? {});\n const missingKind = missingDiscriminatorError(schema, rootSchema, path, [\n ...(primaryErrors ?? []),\n ...(additionalErrors ?? []),\n ]);\n const selectionError = missingKind\n ? translate('oneOf.chooseKind', 'Choose a kind.')\n : '';\n\n const renderInfos = createCombinatorRenderInfos(\n (schema as JsonSchema)[combinator] ?? [],\n rootSchema,\n combinator,\n uischema,\n path,\n uischemas,\n ).map((info) => {\n const prefix = (info.schema as JsonSchema & { i18n?: string }).i18n;\n return typeof prefix === 'string'\n ? {\n ...info,\n label: translate(`${prefix}.label`, info.label) ?? info.label,\n }\n : info;\n });\n\n return { translate, selectionError, renderInfos };\n}\n"],"mappings":"A,kPAUA,SAAgBQ,EACd,CACE,SACA,aACA,WACA,OACA,aAKF,EACA,EACA,CACA,IAAMC,EAAYT,EAAAA,cAAc,EAC1B,CAACU,EAAeC,GAAoBV,EAAAA,kBAAkBW,GAAQ,CAAC,CAAC,EA0BtE,MAAO,CAAE,YAAW,eAzBAV,EAAAA,0BAA0BW,EAAQC,EAAYC,EAAM,CACtE,GAAIL,GAAiB,CAAC,EACtB,GAAIC,GAAoB,CAAC,CAC3B,CACuB,EACnBF,EAAU,mBAAoB,gBAAgB,EAC9C,GAmBgC,aAAA,EAjBhBN,EAAAA,4BAAAA,CACjBU,EAAsBG,IAAe,CAAC,EACvCF,EACAE,EACAC,EACAF,EACAG,CACF,CAAC,CAAC,IAAK,GAAS,CACd,IAAMC,EAAUC,EAAK,OAA0C,KAC/D,OAAO,OAAOD,GAAW,SACrB,CACE,GAAGC,EACH,MAAOX,EAAU,GAAGU,EAAO,QAASC,EAAK,KAAK,GAAKA,EAAK,KAC1D,EACAA,CACN,CAEoC,CAAY,CAClD,C"}
@@ -0,0 +1,6 @@
1
+ import { type CombinatorRendererProps, type JsonFormsCore } from '@jsonforms/core';
2
+ export declare function useCombinatorSelection({ schema, rootSchema, uischema, path, uischemas, }: Pick<CombinatorRendererProps, 'schema' | 'rootSchema' | 'uischema' | 'path' | 'uischemas'>, combinator: 'anyOf' | 'oneOf', core?: JsonFormsCore): {
3
+ translate: import("@jsonforms/core").Translator;
4
+ selectionError: string;
5
+ renderInfos: import("@jsonforms/core").CombinatorSubSchemaRenderInfo[];
6
+ };
@@ -0,0 +1,22 @@
1
+ import { displayableErrors as e } from "../validation/validationIndicator.esm.js";
2
+ import { useTranslator as t } from "../locale/translate.esm.js";
3
+ import { missingDiscriminatorError as n } from "./discriminatorBranch.esm.js";
4
+ import { createCombinatorRenderInfos as r } from "@jsonforms/core";
5
+ // src/composition/useCombinatorSelection.ts
6
+ function i({ schema: i, rootSchema: a, uischema: o, path: s, uischemas: c }, l, u) {
7
+ let d = t(), [f, p] = e(u ?? {});
8
+ return {
9
+ translate: d,
10
+ selectionError: n(i, a, s, [...f ?? [], ...p ?? []]) ? d("oneOf.chooseKind", "Choose a kind.") : "",
11
+ renderInfos: r(i[l] ?? [], a, l, o, s, c).map((e) => {
12
+ let t = e.schema.i18n;
13
+ return typeof t == "string" ? {
14
+ ...e,
15
+ label: d(`${t}.label`, e.label) ?? e.label
16
+ } : e;
17
+ })
18
+ };
19
+ }
20
+ export { i as useCombinatorSelection };
21
+
22
+ //# sourceMappingURL=useCombinatorSelection.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCombinatorSelection.esm.js","names":["useCombinatorSelection","translate","useTranslator","primaryErrors","additionalErrors","displayableErrors","core","missingDiscriminatorError","schema","rootSchema","path","createCombinatorRenderInfos","combinator","uischema","uischemas","prefix","info"],"sources":["../../src/composition/useCombinatorSelection.ts"],"sourcesContent":["import {\n createCombinatorRenderInfos,\n type CombinatorRendererProps,\n type JsonSchema,\n type JsonFormsCore,\n} from '@jsonforms/core';\nimport { displayableErrors } from '../validation/validationIndicator';\nimport { useTranslator } from '../locale/translate';\nimport { missingDiscriminatorError } from './discriminatorBranch';\n\nexport function useCombinatorSelection(\n {\n schema,\n rootSchema,\n uischema,\n path,\n uischemas,\n }: Pick<\n CombinatorRendererProps,\n 'schema' | 'rootSchema' | 'uischema' | 'path' | 'uischemas'\n >,\n combinator: 'anyOf' | 'oneOf',\n core?: JsonFormsCore,\n) {\n const translate = useTranslator();\n const [primaryErrors, additionalErrors] = displayableErrors(core ?? {});\n const missingKind = missingDiscriminatorError(schema, rootSchema, path, [\n ...(primaryErrors ?? []),\n ...(additionalErrors ?? []),\n ]);\n const selectionError = missingKind\n ? translate('oneOf.chooseKind', 'Choose a kind.')\n : '';\n\n const renderInfos = createCombinatorRenderInfos(\n (schema as JsonSchema)[combinator] ?? [],\n rootSchema,\n combinator,\n uischema,\n path,\n uischemas,\n ).map((info) => {\n const prefix = (info.schema as JsonSchema & { i18n?: string }).i18n;\n return typeof prefix === 'string'\n ? {\n ...info,\n label: translate(`${prefix}.label`, info.label) ?? info.label,\n }\n : info;\n });\n\n return { translate, selectionError, renderInfos };\n}\n"],"mappings":";;;;;AAUA,SAAgBA,EACd,EACE,WACA,eACA,aACA,SACA,gBAKF,GACA,GACA;CACA,IAAMC,IAAYC,EAAc,GAC1B,CAACC,GAAeC,KAAoBC,EAAkBC,KAAQ,CAAC,CAAC;CA0BtE,OAAO;EAAE;EAAW,gBAzBAC,EAA0BC,GAAQC,GAAYC,GAAM,CACtE,GAAIP,KAAiB,CAAC,GACtB,GAAIC,KAAoB,CAAC,CAC3B,CACuB,IACnBH,EAAU,oBAAoB,gBAAgB,IAC9C;EAmBgC,aAjBhBU,EACjBH,EAAsBI,MAAe,CAAC,GACvCH,GACAG,GACAC,GACAH,GACAI,CACF,CAAC,CAAC,KAAK,MAAS;GACd,IAAMC,IAAUC,EAAK,OAA0C;GAC/D,OAAO,OAAOD,KAAW,WACrB;IACE,GAAGC;IACH,OAAOf,EAAU,GAAGc,EAAO,SAASC,EAAK,KAAK,KAAKA,EAAK;GAC1D,IACAA;EACN,CAEoC;CAAY;AAClD"}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./scalarComposition.cjs.js");let t=require("@jsonforms/core"),n=require("@jsonforms/react");var r=(0,t.rankWith)(4,(0,t.and)((0,t.uiTypeIs)(`Control`),(0,t.schemaMatches)((t,n)=>e.scalarCompositionType(t,n)!==void 0))),i=[`oneOf`,`anyOf`,`allOf`],a=({schema:r,rootSchema:a,uischema:o,path:s,label:c})=>{var l,u,d,f;let p=(0,n.useJsonForms)(),m=(((l=p.core)==null?void 0:l.errors)??[]).filter(e=>(0,t.getControlPath)(e)===s&&i.includes(e.keyword)),h=((u=p.core)==null?void 0:u.validationMode)!==`ValidateAndHide`&&m.length>0?(0,t.getCombinedErrorMessage)(m,(d=p.i18n)==null?void 0:d.translateError,(f=p.i18n)==null?void 0:f.translate,r,o,s):void 0;return{delegated:{...o,scope:`#`,label:o.label??c},delegatedSchema:e.scalarCompositionSchema(r,a),message:h}};exports.scalarCompositionTester=r,exports.useScalarComposition=a;
2
+ //# sourceMappingURL=useScalarComposition.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScalarComposition.cjs.js","names":["rankWith","and","uiTypeIs","schemaMatches","scalarCompositionType","useJsonForms","getControlPath","getCombinedErrorMessage","scalarCompositionSchema","require_composition_scalarComposition","_jsonforms_core","_jsonforms_react","scalarCompositionTester","schema","rootSchema","COMPOSITION_KEYWORDS","useScalarComposition","_ctx$core","_ctx$core2","_ctx$i18n","_ctx$i18n2","ctx","compositionErrors","error","path","message","uischema","label"],"sources":["../../src/composition/useScalarComposition.ts"],"sourcesContent":["import {\n and,\n getCombinedErrorMessage,\n getControlPath,\n rankWith,\n schemaMatches,\n uiTypeIs,\n type ControlProps,\n type RankedTester,\n} from '@jsonforms/core';\nimport { useJsonForms } from '@jsonforms/react';\nimport {\n scalarCompositionSchema,\n scalarCompositionType,\n} from './scalarComposition';\n\n/** A single scalar editor takes precedence over generic combinator navigation. */\nexport const scalarCompositionTester: RankedTester = rankWith(\n 4,\n and(\n uiTypeIs('Control'),\n schemaMatches(\n (schema, rootSchema) =>\n scalarCompositionType(schema, rootSchema) !== undefined,\n ),\n ),\n);\n\nconst COMPOSITION_KEYWORDS = ['oneOf', 'anyOf', 'allOf'];\n\n/** Core filters combinator errors from child controls, so draw the parent error beside the editor. */\nexport const useScalarComposition = ({\n schema,\n rootSchema,\n uischema,\n path,\n label,\n}: ControlProps) => {\n const ctx = useJsonForms();\n const compositionErrors = (ctx.core?.errors ?? []).filter(\n (error) =>\n getControlPath(error) === path &&\n COMPOSITION_KEYWORDS.includes(error.keyword),\n );\n const message =\n ctx.core?.validationMode !== 'ValidateAndHide' &&\n compositionErrors.length > 0\n ? getCombinedErrorMessage(\n compositionErrors,\n ctx.i18n?.translateError as any,\n ctx.i18n?.translate as any,\n schema,\n uischema,\n path,\n )\n : undefined;\n const delegated = {\n ...uischema,\n scope: '#',\n label: (uischema as { label?: unknown }).label ?? label,\n };\n return {\n delegated,\n delegatedSchema: scalarCompositionSchema(schema, rootSchema),\n message,\n };\n};\n"],"mappings":"A,gLAiBA,IAAaY,GAAA,EAAwCZ,EAAAA,SAAAA,CACnD,GAAA,EACAC,EAAAA,IAAAA,EAAAA,EACEC,EAAAA,SAAAA,CAAS,SAAS,GAAA,EAClBC,EAAAA,cAAAA,EACG,EAAQ,IACPC,EAAAA,sBAAsBS,EAAQC,CAAU,IAAM,IAAA,EAClD,CACF,CACF,EAEMC,EAAuB,CAAC,QAAS,QAAS,OAAO,EAG1CC,GAAwB,CACnC,SACA,aACA,WACA,OACA,WACkB,C,YAClB,IAAMK,GAAA,EAAMhB,EAAAA,aAAAA,CAAa,EACnBiB,KAAA,EAAqBD,EAAI,OAAA,KAAA,IAAA,GAAAJ,EAAM,SAAU,CAAC,EAAA,CAAG,OAChD,IAAA,EACCX,EAAAA,eAAAA,CAAeiB,CAAK,IAAMC,GAC1BT,EAAqB,SAASQ,EAAM,OAAO,CAC/C,EACME,IAAA,EACJJ,EAAI,OAAA,KAAA,IAAA,GAAAH,EAAM,kBAAmB,mBAC7BI,EAAkB,OAAS,GAAA,EACvBf,EAAAA,wBAAAA,CACEe,GAAA,EACAD,EAAI,OAAA,KAAA,IAAA,GAAAF,EAAM,gBAAA,EACVE,EAAI,OAAA,KAAA,IAAA,GAAAD,EAAM,UACVP,EACAa,EACAF,CACF,EACA,IAAA,GAMN,MAAO,CACL,UAAA,CALA,GAAGE,EACH,MAAO,IACP,MAAQA,EAAiC,OAASC,CAGlD,EACA,gBAAiBnB,EAAAA,wBAAwBK,EAAQC,CAAU,EAC3D,SACF,CACF,E"}
@@ -0,0 +1,18 @@
1
+ import { type ControlProps, type RankedTester } from '@jsonforms/core';
2
+ /** A single scalar editor takes precedence over generic combinator navigation. */
3
+ export declare const scalarCompositionTester: RankedTester;
4
+ /** Core filters combinator errors from child controls, so draw the parent error beside the editor. */
5
+ export declare const useScalarComposition: ({ schema, rootSchema, uischema, path, label, }: ControlProps) => {
6
+ delegated: {
7
+ scope: string;
8
+ label: {};
9
+ type: "Control";
10
+ rule?: import("@jsonforms/core").Rule;
11
+ options?: {
12
+ [key: string]: any;
13
+ };
14
+ i18n?: string;
15
+ };
16
+ delegatedSchema: import("@jsonforms/core").JsonSchema;
17
+ message: string | undefined;
18
+ };
@@ -0,0 +1,24 @@
1
+ import { scalarCompositionSchema as e, scalarCompositionType as t } from "./scalarComposition.esm.js";
2
+ import { and as n, getCombinedErrorMessage as r, getControlPath as i, rankWith as a, schemaMatches as o, uiTypeIs as s } from "@jsonforms/core";
3
+ import { useJsonForms as c } from "@jsonforms/react";
4
+ // src/composition/useScalarComposition.ts
5
+ var l = a(4, n(s("Control"), o((e, n) => t(e, n) !== void 0))), u = [
6
+ "oneOf",
7
+ "anyOf",
8
+ "allOf"
9
+ ], d = ({ schema: t, rootSchema: n, uischema: a, path: o, label: s }) => {
10
+ var l, d, f, p;
11
+ let m = c(), h = (((l = m.core) == null ? void 0 : l.errors) ?? []).filter((e) => i(e) === o && u.includes(e.keyword)), g = ((d = m.core) == null ? void 0 : d.validationMode) !== "ValidateAndHide" && h.length > 0 ? r(h, (f = m.i18n) == null ? void 0 : f.translateError, (p = m.i18n) == null ? void 0 : p.translate, t, a, o) : void 0;
12
+ return {
13
+ delegated: {
14
+ ...a,
15
+ scope: "#",
16
+ label: a.label ?? s
17
+ },
18
+ delegatedSchema: e(t, n),
19
+ message: g
20
+ };
21
+ };
22
+ export { l as scalarCompositionTester, d as useScalarComposition };
23
+
24
+ //# sourceMappingURL=useScalarComposition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScalarComposition.esm.js","names":["scalarCompositionTester","rankWith","and","uiTypeIs","schemaMatches","scalarCompositionType","schema","rootSchema","COMPOSITION_KEYWORDS","useScalarComposition","_ctx$core","_ctx$core2","_ctx$i18n","_ctx$i18n2","ctx","useJsonForms","compositionErrors","getControlPath","error","path","message","getCombinedErrorMessage","uischema","label","scalarCompositionSchema"],"sources":["../../src/composition/useScalarComposition.ts"],"sourcesContent":["import {\n and,\n getCombinedErrorMessage,\n getControlPath,\n rankWith,\n schemaMatches,\n uiTypeIs,\n type ControlProps,\n type RankedTester,\n} from '@jsonforms/core';\nimport { useJsonForms } from '@jsonforms/react';\nimport {\n scalarCompositionSchema,\n scalarCompositionType,\n} from './scalarComposition';\n\n/** A single scalar editor takes precedence over generic combinator navigation. */\nexport const scalarCompositionTester: RankedTester = rankWith(\n 4,\n and(\n uiTypeIs('Control'),\n schemaMatches(\n (schema, rootSchema) =>\n scalarCompositionType(schema, rootSchema) !== undefined,\n ),\n ),\n);\n\nconst COMPOSITION_KEYWORDS = ['oneOf', 'anyOf', 'allOf'];\n\n/** Core filters combinator errors from child controls, so draw the parent error beside the editor. */\nexport const useScalarComposition = ({\n schema,\n rootSchema,\n uischema,\n path,\n label,\n}: ControlProps) => {\n const ctx = useJsonForms();\n const compositionErrors = (ctx.core?.errors ?? []).filter(\n (error) =>\n getControlPath(error) === path &&\n COMPOSITION_KEYWORDS.includes(error.keyword),\n );\n const message =\n ctx.core?.validationMode !== 'ValidateAndHide' &&\n compositionErrors.length > 0\n ? getCombinedErrorMessage(\n compositionErrors,\n ctx.i18n?.translateError as any,\n ctx.i18n?.translate as any,\n schema,\n uischema,\n path,\n )\n : undefined;\n const delegated = {\n ...uischema,\n scope: '#',\n label: (uischema as { label?: unknown }).label ?? label,\n };\n return {\n delegated,\n delegatedSchema: scalarCompositionSchema(schema, rootSchema),\n message,\n };\n};\n"],"mappings":";;;;AAiBA,IAAaA,IAAwCC,EACnD,GACAC,EACEC,EAAS,SAAS,GAClBC,GACG,GAAQ,MACPC,EAAsBC,GAAQC,CAAU,MAAM,KAAA,CAClD,CACF,CACF,GAEMC,IAAuB;CAAC;CAAS;CAAS;AAAO,GAG1CC,KAAwB,EACnC,WACA,eACA,aACA,SACA,eACkB;;CAClB,IAAMK,IAAMC,EAAa,GACnBC,OAAA,IAAqBF,EAAI,SAAA,OAAA,KAAA,IAAAJ,EAAM,WAAU,CAAC,EAAA,CAAG,QAChD,MACCO,EAAeC,CAAK,MAAMC,KAC1BX,EAAqB,SAASU,EAAM,OAAO,CAC/C,GACME,MAAA,IACJN,EAAI,SAAA,OAAA,KAAA,IAAAH,EAAM,oBAAmB,qBAC7BK,EAAkB,SAAS,IACvBK,EACEL,IAAA,IACAF,EAAI,SAAA,OAAA,KAAA,IAAAF,EAAM,iBAAA,IACVE,EAAI,SAAA,OAAA,KAAA,IAAAD,EAAM,WACVP,GACAgB,GACAH,CACF,IACA,KAAA;CAMN,OAAO;EACL,WAAA;GALA,GAAGG;GACH,OAAO;GACP,OAAQA,EAAiC,SAASC;EAGlD;EACA,iBAAiBC,EAAwBlB,GAAQC,CAAU;EAC3D;CACF;AACF"}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BocRIvOZ.js"),t=require("../locale/translate.cjs.js");let n=require("react");n=e.t(n);let r=require("@jsonforms/core");var i=e=>e.type===`string`&&(e.contentEncoding===`base64`||e.format===`binary`||e.format===`byte`),a=(e,t)=>{if(e.type!==`array`||!e.items||typeof e.items==`boolean`||Array.isArray(e.items))return;let n=e.items,a=n.$ref?r.Resolve.schema(t,n.$ref,t):n;return a&&i(a)?a:void 0},o=(0,r.rankWith)(7,(0,r.and)((0,r.uiTypeIs)(`Control`),(0,r.schemaMatches)((e,t)=>!!a(e,t)))),s=(e,t)=>new Promise((n,r)=>{let i=new FileReader;i.onerror=()=>r(i.error??Error(`File read failed`)),i.onabort=()=>r(Error(`File read aborted`)),i.onload=()=>{let r=String(i.result??``);if(t.format===`uri`)n(r);else if(t.format===`binary`){let t=r.indexOf(`;base64,`);n(t<0?r:r.slice(0,t)+`;filename=`+encodeURIComponent(e.name)+r.slice(t))}else n(r.slice(r.indexOf(`,`)+1))},i.readAsDataURL(e)}),c=e=>{if(typeof e!=`string`)return;let t=/^data:[^,]*;filename=([^;,]*)/.exec(e);if(t)try{return decodeURIComponent(t[1])}catch{return t[1]}},l=e=>{let r=t.useI18n(),[i,o]=(0,n.useState)(!1),[l,u]=(0,n.useState)(!1),d=(0,n.useRef)(null),[f,p]=(0,n.useState)(!1),[m,h]=(0,n.useState)(``),[g,_]=(0,n.useState)(`warning`),[v,y]=n.default.useState(e.data);Object.is(v,e.data)||(y(()=>e.data),h(``));let[b,x]=(0,n.useState)(new Map),S=(0,n.useRef)(e);(0,n.useLayoutEffect)(()=>{S.current=e},[e]);let C=(0,n.useRef)(!0);(0,n.useEffect)(()=>(C.current=!0,()=>{C.current=!1}),[]);let w=a(e.schema,e.rootSchema);if(!w||e.visible===!1)return null;let T=Array.isArray(e.data)?e.data:[],E={...e.config,...e.uischema.options},D=!e.enabled||e.readonly||f,O=E.restrict!==!1,k=e.PillComponent??`span`,A=e.ButtonComponent??`button`,j=!D&&(!O||T.length>(e.schema.minItems??0));return n.default.createElement(`div`,{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocusCapture:()=>u(!0),onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||u(!1)},style:{minWidth:0,width:`100%`}},n.default.createElement(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,border:e.cell?`none`:`1px solid var(--file-input-border, #8886)`,borderRadius:6,padding:e.cell?0:`2px 4px`,minWidth:0,height:e.cell?28:void 0,boxSizing:`border-box`}},n.default.createElement(`input`,{ref:d,id:e.id,type:`file`,multiple:!0,disabled:D,"aria-label":r(`file.select`),"aria-invalid":!!e.errors,accept:typeof E.accept==`string`?E.accept:w.contentMediaType,onChange:async t=>{let n=Array.from(t.currentTarget.files??[]);if(t.currentTarget.value=``,!n.length||D)return;if(h(``),_(`warning`),O&&e.schema.maxItems!==void 0&&!e.schema.uniqueItems&&T.length+n.length>e.schema.maxItems){h(r(`file.maxItems`,{limit:e.schema.maxItems}));return}for(let e of n)for(let[t,n]of[[`formatMinimum`,(e,t)=>e<t],[`formatExclusiveMinimum`,(e,t)=>e<=t],[`formatMaximum`,(e,t)=>e>t],[`formatExclusiveMaximum`,(e,t)=>e>=t]]){let i=w[t]??E[t],a=Number(i);if(i!==void 0&&Number.isFinite(a)&&a>=0&&n(e.size,a)){let n=r(`file.sizeBound`,{name:e.name,bound:r({formatMinimum:`file.atLeast`,formatExclusiveMinimum:`file.moreThan`,formatMaximum:`file.atMost`,formatExclusiveMaximum:`file.lessThan`}[t]),limit:a});if(h(n),O)return}}let i=e.data;p(!0);try{let t=await Promise.all(n.map(e=>s(e,w)));if(!C.current||S.current.data!==i||S.current.path!==e.path||!S.current.enabled||S.current.readonly)return;let a=[...T];if(t.forEach(t=>{e.schema.uniqueItems&&a.includes(t)||a.push(t)}),O&&e.schema.maxItems!==void 0&&a.length>e.schema.maxItems){h(r(`file.maxItems`,{limit:e.schema.maxItems}));return}x(e=>{let r=new Map(e);return t.forEach((e,t)=>r.set(e,n[t].name)),r}),e.handleChange(e.path,a)}catch{C.current&&(_(`error`),h(r(`file.readFailed`)))}finally{C.current&&p(!1)}},style:{display:`none`}}),n.default.createElement(A,{style:{flex:`0 0 24px`,width:24,height:24,padding:0},type:`button`,"aria-label":r(`file.select`),title:r(`file.select`),disabled:D,onClick:()=>{var e;return(e=d.current)==null?void 0:e.click()}},n.default.createElement(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`},n.default.createElement(`path`,{d:`M14 2H6v20h12V6z M14 2v6h4`}))),f&&n.default.createElement(`span`,{role:`status`},r(`file.reading`)),n.default.createElement(`div`,{"data-file-pills":!0,tabIndex:0,style:{display:`flex`,alignItems:`center`,flex:`1 1 0%`,minWidth:0,flexWrap:e.cell?`nowrap`:`wrap`,gap:4,maxHeight:e.cell?28:`8rem`,overflowX:`auto`,overflowY:e.cell?`hidden`:`auto`,scrollbarWidth:`thin`}},T.map((t,i)=>{let a=c(t)??b.get(String(t))??r(`file.numbered`,{index:i+1});return n.default.createElement(k,{key:i,style:{display:`inline-flex`,alignItems:`center`,gap:4,maxWidth:`12rem`,flexShrink:0,height:22,boxSizing:`border-box`,borderRadius:4,padding:`0 4px`,minWidth:0}},n.default.createElement(`span`,{title:a,tabIndex:0,style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}},a),E.clearable!==!1&&n.default.createElement(A,{type:`button`,style:{width:16,height:16,minWidth:16,padding:0,flexShrink:0,lineHeight:1},disabled:!j,"aria-label":r(`composite.remove`,{label:a}),onClick:()=>{h(``),e.handleChange(e.path,T.filter((e,t)=>t!==i))}},`×`))})),m&&e.cell&&e.FeedbackComponent&&n.default.createElement(e.FeedbackComponent,{message:m,cell:!0,severity:g}),E.clearable!==!1&&T.length>0&&e.enabled&&!e.readonly&&n.default.createElement(A,{style:{marginLeft:`auto`,flex:`0 0 24px`,width:24,height:24,padding:0,opacity:i||l?1:0},type:`button`,"aria-label":r(`file.clearAll`),title:r(`file.clearAll`),disabled:D||O&&(e.schema.minItems??0)>0,onClick:()=>{h(``),e.handleChange(e.path,[])}},`×`)),m&&!e.cell&&(e.FeedbackComponent?n.default.createElement(e.FeedbackComponent,{message:m,severity:g}):n.default.createElement(`span`,{role:`alert`},m)))};exports.FileArrayInput=l,exports.attachmentName=c,exports.encodeFile=s,exports.fileArrayTester=o,exports.fileItemSchema=a,exports.isFileString=i;
2
+ //# sourceMappingURL=FileArrayInput.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileArrayInput.cjs.js","names":["Resolve","rankWith","and","uiTypeIs","schemaMatches","useI18n","useState","useRef","React","require_rolldown_runtime","require_locale_translate","react","_jsonforms_core","isFileString","schema","fileItemSchema","item","resolved","rootSchema","fileArrayTester","root","encodeFile","reader","reject","url","resolve","marker","file","attachmentName","value","match","FileArrayInput","t","hovered","setHovered","focused","setFocused","inputRef","busy","setBusy","error","setError","severity","setSeverity","previousData","setPreviousData","props","names","setNames","latest","mounted","values","options","disabled","restrict","Pill","Button","canRemove","event","files","key","fails","size","limit","raw","sizeError","initialData","encoded","next","result","previous","index","_inputRef$current","name","i"],"sources":["../../src/controls/FileArrayInput.tsx"],"sourcesContent":["import React, { useLayoutEffect, useEffect, useRef, useState } from 'react';\nimport {\n CellProps,\n JsonSchema,\n RankedTester,\n Resolve,\n and,\n rankWith,\n schemaMatches,\n uiTypeIs,\n} from '@jsonforms/core';\nimport { useI18n } from '../locale/translate';\n\nexport const isFileString = (schema: JsonSchema) =>\n schema.type === 'string' &&\n ((schema as any).contentEncoding === 'base64' ||\n schema.format === 'binary' ||\n schema.format === 'byte');\n\nexport const fileItemSchema = (\n schema: JsonSchema,\n rootSchema: JsonSchema,\n): JsonSchema | undefined => {\n if (\n schema.type !== 'array' ||\n !schema.items ||\n typeof schema.items === 'boolean' ||\n Array.isArray(schema.items)\n )\n return undefined;\n const item = schema.items as JsonSchema;\n const resolved = item.$ref\n ? Resolve.schema(rootSchema, item.$ref, rootSchema)\n : item;\n return resolved && isFileString(resolved) ? resolved : undefined;\n};\nexport const fileArrayTester: RankedTester = rankWith(\n 7,\n and(\n uiTypeIs('Control'),\n schemaMatches((schema, root) => Boolean(fileItemSchema(schema, root))),\n ),\n);\n\nexport const encodeFile = (file: File, schema: JsonSchema): Promise<string> =>\n new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = () =>\n reject(reader.error ?? new Error('File read failed'));\n reader.onabort = () => reject(new Error('File read aborted'));\n reader.onload = () => {\n const url = String(reader.result ?? '');\n if (schema.format === 'uri') resolve(url);\n else if (schema.format === 'binary') {\n const marker = url.indexOf(';base64,');\n resolve(\n marker < 0\n ? url\n : url.slice(0, marker) +\n ';filename=' +\n encodeURIComponent(file.name) +\n url.slice(marker),\n );\n } else resolve(url.slice(url.indexOf(',') + 1));\n };\n reader.readAsDataURL(file);\n });\n\nexport const attachmentName = (value: unknown): string | undefined => {\n if (typeof value !== 'string') return undefined;\n const match = /^data:[^,]*;filename=([^;,]*)/.exec(value);\n if (!match) return undefined;\n try {\n return decodeURIComponent(match[1]);\n } catch {\n return match[1];\n }\n};\n\n/** A batch is appended once, in chooser order; failed reads never erase committed files. */\nexport const FileArrayInput = (\n props: CellProps & {\n readonly?: boolean;\n cell?: boolean;\n FeedbackComponent?: React.ComponentType<{\n message: string;\n cell?: boolean;\n severity: 'warning' | 'error';\n }>;\n PillComponent?: React.ElementType;\n ButtonComponent?: React.ElementType;\n },\n) => {\n const t = useI18n();\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState('');\n const [severity, setSeverity] = useState<'warning' | 'error'>('warning');\n\n const [previousData, setPreviousData] = React.useState(props.data);\n if (!Object.is(previousData, props.data)) {\n setPreviousData(() => props.data);\n setError('');\n }\n const [names, setNames] = useState<Map<string, string>>(new Map());\n const latest = useRef(props);\n useLayoutEffect(() => {\n latest.current = props;\n }, [props]);\n const mounted = useRef(true);\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n const item = fileItemSchema(props.schema, props.rootSchema);\n if (!item || props.visible === false) return null;\n const values: unknown[] = Array.isArray(props.data) ? props.data : [];\n const options = { ...props.config, ...props.uischema.options };\n const disabled = !props.enabled || props.readonly || busy;\n const restrict = options.restrict !== false;\n const Pill = props.PillComponent ?? 'span';\n const Button = props.ButtonComponent ?? 'button';\n const canRemove =\n !disabled && (!restrict || values.length > (props.schema.minItems ?? 0));\n const select = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const files = Array.from(event.currentTarget.files ?? []);\n event.currentTarget.value = '';\n if (!files.length || disabled) return;\n setError('');\n setSeverity('warning');\n if (\n restrict &&\n props.schema.maxItems !== undefined &&\n !props.schema.uniqueItems &&\n values.length + files.length > props.schema.maxItems\n ) {\n setError(t('file.maxItems', { limit: props.schema.maxItems }));\n return;\n }\n for (const file of files) {\n for (const [key, fails] of [\n ['formatMinimum', (size: number, limit: number) => size < limit],\n [\n 'formatExclusiveMinimum',\n (size: number, limit: number) => size <= limit,\n ],\n ['formatMaximum', (size: number, limit: number) => size > limit],\n [\n 'formatExclusiveMaximum',\n (size: number, limit: number) => size >= limit,\n ],\n ] as const) {\n const raw = (item as any)[key] ?? options[key];\n const limit = Number(raw);\n if (\n raw !== undefined &&\n Number.isFinite(limit) &&\n limit >= 0 &&\n fails(file.size, limit)\n ) {\n const sizeError = t('file.sizeBound', {\n name: file.name,\n bound: t(\n (\n {\n formatMinimum: 'file.atLeast',\n formatExclusiveMinimum: 'file.moreThan',\n formatMaximum: 'file.atMost',\n formatExclusiveMaximum: 'file.lessThan',\n } as const\n )[key],\n ),\n limit,\n });\n setError(sizeError);\n if (restrict) return;\n }\n }\n }\n const initialData = props.data;\n setBusy(true);\n try {\n const encoded = await Promise.all(\n files.map((file) => encodeFile(file, item)),\n );\n if (\n !mounted.current ||\n latest.current.data !== initialData ||\n latest.current.path !== props.path ||\n !latest.current.enabled ||\n latest.current.readonly\n )\n return;\n const next = [...values];\n encoded.forEach((value) => {\n if (!props.schema.uniqueItems || !next.includes(value))\n next.push(value);\n });\n if (\n restrict &&\n props.schema.maxItems !== undefined &&\n next.length > props.schema.maxItems\n ) {\n setError(t('file.maxItems', { limit: props.schema.maxItems }));\n return;\n }\n setNames((previous) => {\n const result = new Map(previous);\n encoded.forEach((value, index) => result.set(value, files[index].name));\n return result;\n });\n props.handleChange(props.path, next);\n } catch {\n if (mounted.current) {\n setSeverity('error');\n setError(t('file.readFailed'));\n }\n } finally {\n if (mounted.current) setBusy(false);\n }\n };\n return (\n <div\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onFocusCapture={() => setFocused(true)}\n onBlurCapture={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node))\n setFocused(false);\n }}\n style={{ minWidth: 0, width: '100%' }}\n >\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: 4,\n border: props.cell\n ? 'none'\n : '1px solid var(--file-input-border, #8886)',\n borderRadius: 6,\n padding: props.cell ? 0 : '2px 4px',\n minWidth: 0,\n height: props.cell ? 28 : undefined,\n boxSizing: 'border-box',\n }}\n >\n <input\n ref={inputRef}\n id={props.id}\n type='file'\n multiple\n disabled={disabled}\n aria-label={t('file.select')}\n aria-invalid={Boolean(props.errors)}\n accept={\n typeof options.accept === 'string'\n ? options.accept\n : (item as any).contentMediaType\n }\n onChange={select}\n style={{ display: 'none' }}\n />\n <Button\n style={{ flex: '0 0 24px', width: 24, height: 24, padding: 0 }}\n type='button'\n aria-label={t('file.select')}\n title={t('file.select')}\n disabled={disabled}\n onClick={() => inputRef.current?.click()}\n >\n <svg\n width='16'\n height='16'\n viewBox='0 0 24 24'\n fill='none'\n stroke='currentColor'\n strokeWidth='2'\n aria-hidden='true'\n >\n <path d='M14 2H6v20h12V6z M14 2v6h4' />\n </svg>\n </Button>\n {busy && <span role='status'>{t('file.reading')}</span>}\n <div\n data-file-pills\n tabIndex={0}\n style={{\n display: 'flex',\n alignItems: 'center',\n flex: '1 1 0%',\n minWidth: 0,\n flexWrap: props.cell ? 'nowrap' : 'wrap',\n gap: 4,\n maxHeight: props.cell ? 28 : '8rem',\n overflowX: 'auto',\n overflowY: props.cell ? 'hidden' : 'auto',\n scrollbarWidth: 'thin',\n }}\n >\n {values.map((value, index) => {\n const name =\n attachmentName(value) ??\n names.get(String(value)) ??\n t('file.numbered', { index: index + 1 });\n return (\n <Pill\n key={index}\n style={{\n display: 'inline-flex',\n alignItems: 'center',\n gap: 4,\n maxWidth: '12rem',\n flexShrink: 0,\n height: 22,\n boxSizing: 'border-box',\n borderRadius: 4,\n padding: '0 4px',\n minWidth: 0,\n }}\n >\n <span\n title={name}\n tabIndex={0}\n style={{\n flex: 1,\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }}\n >\n {name}\n </span>\n {options.clearable !== false && (\n <Button\n type='button'\n style={{\n width: 16,\n height: 16,\n minWidth: 16,\n padding: 0,\n flexShrink: 0,\n lineHeight: 1,\n }}\n disabled={!canRemove}\n aria-label={t('composite.remove', { label: name })}\n onClick={() => {\n setError('');\n props.handleChange(\n props.path,\n values.filter((_, i) => i !== index),\n );\n }}\n >\n ×\n </Button>\n )}\n </Pill>\n );\n })}\n </div>\n {error && props.cell && props.FeedbackComponent && (\n <props.FeedbackComponent message={error} cell severity={severity} />\n )}\n {options.clearable !== false &&\n values.length > 0 &&\n props.enabled &&\n !props.readonly && (\n <Button\n style={{\n marginLeft: 'auto',\n flex: '0 0 24px',\n width: 24,\n height: 24,\n padding: 0,\n opacity: hovered || focused ? 1 : 0,\n }}\n type='button'\n aria-label={t('file.clearAll')}\n title={t('file.clearAll')}\n disabled={\n disabled || (restrict && (props.schema.minItems ?? 0) > 0)\n }\n onClick={() => {\n setError('');\n props.handleChange(props.path, []);\n }}\n >\n ×\n </Button>\n )}\n </div>\n {error &&\n !props.cell &&\n (props.FeedbackComponent ? (\n <props.FeedbackComponent message={error} severity={severity} />\n ) : (\n <span role='alert'>{error}</span>\n ))}\n </div>\n );\n};\n"],"mappings":"A,+NAaA,IAAaa,EAAgB,GAC3BC,EAAO,OAAS,WACdA,EAAe,kBAAoB,UACnCA,EAAO,SAAW,UAClBA,EAAO,SAAW,QAETC,GACX,EACA,IAC2B,CAC3B,GACED,EAAO,OAAS,SAChB,CAACA,EAAO,OACR,OAAOA,EAAO,OAAU,WACxB,MAAM,QAAQA,EAAO,KAAK,EAE1B,OACF,IAAME,EAAOF,EAAO,MACdG,EAAWD,EAAK,KAClBhB,EAAAA,QAAQ,OAAOkB,EAAYF,EAAK,KAAME,CAAU,EAChDF,EACJ,OAAOC,GAAYJ,EAAaI,CAAQ,EAAIA,EAAW,IAAA,EACzD,EACaE,GAAA,EAAgClB,EAAAA,SAAAA,CAC3C,G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,OAAD,CAAM,KAAK,OAAqB,EAAZ6B,CAAY,EAEjC,CAET,E"}
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { CellProps, JsonSchema, RankedTester } from '@jsonforms/core';
3
+ export declare const isFileString: (schema: JsonSchema) => boolean;
4
+ export declare const fileItemSchema: (schema: JsonSchema, rootSchema: JsonSchema) => JsonSchema | undefined;
5
+ export declare const fileArrayTester: RankedTester;
6
+ export declare const encodeFile: (file: File, schema: JsonSchema) => Promise<string>;
7
+ export declare const attachmentName: (value: unknown) => string | undefined;
8
+ /** A batch is appended once, in chooser order; failed reads never erase committed files. */
9
+ export declare const FileArrayInput: (props: CellProps & {
10
+ readonly?: boolean;
11
+ cell?: boolean;
12
+ FeedbackComponent?: React.ComponentType<{
13
+ message: string;
14
+ cell?: boolean;
15
+ severity: "warning" | "error";
16
+ }>;
17
+ PillComponent?: React.ElementType;
18
+ ButtonComponent?: React.ElementType;
19
+ }) => React.JSX.Element | null;