@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 @@
1
+ {"version":3,"file":"temporalBounds.esm.js","names":["dayjs","CLOCK_DAY","temporalBounds","min","max","key","lower","exclusive","raw","schema","bound","parseDateValue","formats","timeOnly","candidate","precision","clockStart","empty","effectiveRestrict","options","flat","config","resolveDataPointer","match","pointer","up","segments","path","base","rest","current","rootData","segment","resolveDataBounds","changed","resolved","value"],"sources":["../../src/formats/temporalBounds.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport { parseDateValue } from './dateValues';\n\n/**\n * Picker limits from `formatMinimum` and friends.\n *\n * Section 18's temporal contract:\n *\n * | Keyword | Meaning for the widget |\n * | --- | --- |\n * | `formatMinimum` | Inclusive lower bound: prevent choices and completed commits before it. |\n * | `formatExclusiveMinimum` | Exclusive lower bound: \"the boundary itself is not selectable\". |\n * | `formatMaximum` | Inclusive upper bound. |\n * | `formatExclusiveMaximum` | Exclusive upper bound. |\n *\n * \"The preventive bound behavior above follows effective `restrict`\" - these\n * limits are about what the picker *offers*. They never clamp a value that is\n * already stored: \"does not authorize clamping existing data\". A value outside\n * the bounds stays exactly as it is, shown with its validation error, and the\n * validator remains the thing that decides validity.\n *\n * The four keywords come from `ajv-formats`, not from JSON Schema itself, and\n * Ajv only compares them when the schema carries a `format` it knows how to\n * order. A UI-only `options.format` cannot supply that, so a control selected\n * that way gets bounds in the picker and no validation behind them.\n */\n\n/**\n * Just the four keywords, read off whatever schema object is to hand.\n *\n * An index signature rather than four optional fields: they are `ajv-formats`\n * extensions, so `JsonSchema` does not declare them and a structural type of\n * four optional unknowns has no property in common with it.\n */\nexport type TemporalBoundsSchema = Record<string, unknown>;\n\nexport type BoundPrecision = 'day' | 'minute' | 'second';\n\nexport interface TemporalBounds {\n min?: dayjs.Dayjs;\n max?: dayjs.Dayjs;\n /** True when the bounds leave nothing selectable at all. */\n empty: boolean;\n}\n\n/** The arbitrary day a bare time is placed on, so two clock values compare. */\nconst CLOCK_DAY = '2000-01-01';\n\n/**\n * Resolves the four keywords into one selectable range.\n *\n * **Exclusivity is resolved at the picker's precision**, which the section\n * requires: \"exclusivity must be preserved at the picker's supported\n * precision\". A date picker offering whole days cannot express \"after\n * 2026-09-19 but not 2026-09-19 itself\" except by starting at the 20th, so an\n * exclusive lower bound steps one unit forward and an exclusive upper bound\n * one unit back.\n *\n * `timeOnly` normalises both bounds onto one arbitrary day, so a time picker\n * compares clock values without inventing a reference date - the approach the\n * Svelte renderer family takes for the same reason.\n */\nexport const temporalBounds = (\n schema: TemporalBoundsSchema | undefined,\n formats: string[],\n precision: BoundPrecision,\n timeOnly = false,\n): TemporalBounds => {\n let min: dayjs.Dayjs | undefined;\n let max: dayjs.Dayjs | undefined;\n\n for (const [key, lower, exclusive] of [\n ['formatMinimum', true, false],\n ['formatExclusiveMinimum', true, true],\n ['formatMaximum', false, false],\n ['formatExclusiveMaximum', false, true],\n ] as const) {\n const raw = (schema as Record<string, unknown> | undefined)?.[key];\n if (typeof raw !== 'string') {\n continue;\n }\n let bound = parseDateValue(raw, formats);\n if (!bound) {\n continue;\n }\n if (timeOnly) {\n bound = bound.year(2000).month(0).date(1);\n }\n\n let candidate = bound.startOf(precision);\n if (\n lower &&\n (candidate.isBefore(bound) || (exclusive && candidate.isSame(bound)))\n ) {\n // Either the bound sits mid-unit - so the first whole unit at or after\n // it is the next one - or it is exclusive and must be stepped past.\n candidate = candidate.add(1, precision);\n } else if (!lower && exclusive && candidate.isSame(bound)) {\n candidate = candidate.subtract(1, precision);\n }\n\n // Several keywords may apply at once; the tightest one wins.\n if (lower) {\n if (!min || candidate.isAfter(min)) {\n min = candidate;\n }\n } else if (!max || candidate.isBefore(max)) {\n max = candidate;\n }\n }\n\n const clockStart = dayjs(CLOCK_DAY).startOf('day');\n const empty =\n !!(min && max && min.isAfter(max)) ||\n (timeOnly &&\n !!(\n (min && !min.isBefore(clockStart.add(1, 'day'))) ||\n (max && max.isBefore(clockStart))\n ));\n\n return { min, max, empty };\n};\n\n/** Preventive picker limits follow the local option, then flat form config. */\nexport const effectiveRestrict = (\n options: Record<string, unknown> | undefined,\n config: unknown,\n): boolean => {\n if (typeof options?.restrict === 'boolean') {\n return options.restrict;\n }\n const flat = (config as Record<string, unknown> | undefined)?.restrict;\n return typeof flat === 'boolean' ? flat : true;\n};\n\n/**\n * A bound written as an Ajv `$data` reference, resolved against the form data.\n *\n * `{ \"formatMinimum\": { \"$data\": \"1/from\" } }` is how a date range says \"not\n * before the other end\", and it is the reason the four bound keywords exist in\n * pairs at all. The pointer is a **JSON Relative Pointer**, relative to the\n * *instance* being validated: `1/from` means up one level from this property,\n * then `from`.\n *\n * Section 18 keeps this separate from literal bounds - \"literal bounds and\n * `$data` references are separate support capabilities. A renderer claiming\n * literal-bound support must not imply that it resolves `$data` bounds\" - so\n * it is resolved deliberately here rather than being assumed to come for free.\n *\n * Returns undefined for anything it cannot follow, which leaves the bound\n * simply unapplied: the picker offers more than it might, and the validator\n * still has the final say.\n */\nexport const resolveDataPointer = (\n pointer: string,\n path: string | undefined,\n rootData: unknown,\n): unknown => {\n const match = /^(\\d+)(?:\\/(.*))?$/.exec(pointer);\n if (!match) {\n // Absolute pointers and the `#` key-name suffix are not supported; a\n // relative pointer is what a sibling bound needs.\n return undefined;\n }\n const up = Number(match[1]);\n const segments = (path ?? '').split('.').filter(Boolean);\n if (up > segments.length) {\n return undefined;\n }\n const base = up === 0 ? segments : segments.slice(0, segments.length - up);\n const rest = (match[2] ?? '').split('/').filter(Boolean);\n let current: unknown = rootData;\n for (const segment of [...base, ...rest]) {\n if (current === null || typeof current !== 'object') {\n return undefined;\n }\n current = (current as Record<string, unknown>)[segment];\n }\n return current;\n};\n\n/**\n * The bound keywords with any `$data` references replaced by their values.\n *\n * Keeps `temporalBounds` working on strings alone, which is what makes its\n * arithmetic testable without a form around it.\n */\nexport const resolveDataBounds = (\n schema: TemporalBoundsSchema | undefined,\n path: string | undefined,\n rootData: unknown,\n): TemporalBoundsSchema | undefined => {\n if (!schema) {\n return schema;\n }\n let changed = false;\n const resolved: Record<string, unknown> = { ...schema };\n for (const key of [\n 'formatMinimum',\n 'formatMaximum',\n 'formatExclusiveMinimum',\n 'formatExclusiveMaximum',\n ]) {\n const raw = (schema as Record<string, unknown>)[key];\n const pointer = (raw as { $data?: unknown } | undefined)?.$data;\n if (typeof pointer !== 'string') {\n continue;\n }\n changed = true;\n const value = resolveDataPointer(pointer, path, rootData);\n if (typeof value === 'string') {\n resolved[key] = value;\n } else {\n // Not filled in yet, or not a string: no bound rather than a wrong one.\n delete resolved[key];\n }\n }\n return changed ? resolved : schema;\n};\n"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BocRIvOZ.js"),t=require("./dateValues.cjs.js");let n=require("dayjs");n=e.t(n);var r=`YYYY-MM-DD`,i=`HH:mm:ssZ`,a=`YYYY-MM-DD[T]HH:mm:ssZ`,o={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i},s=`2001-02-03T04:05:06`,c=(e,r)=>{let i=o[e];return!i||i.test(t.formatDate((0,n.default)(s),r))},l=`temporal.saveFormatInvalid`,u=new Set,d=(e,t)=>{if(c(e,t))return;let n=`${String(e)}|${t}`;u.has(n)||(u.add(n),console.warn(`${l}: the save format ${JSON.stringify(t)} produces values that \`format: ${JSON.stringify(e)}\` rejects, so the control cannot be made valid. Either drop the schema \`format\` and select the control with \`options.format\`, or use a save format carrying the parts RFC 3339 requires.`))};exports.SAVE_FORMAT_DIAGNOSTIC=l,exports.saveFormatSatisfies=c,exports.specDateSaveFormat=r,exports.specDateTimeSaveFormat=a,exports.specTimeSaveFormat=i,exports.warnOnSaveFormat=d;
2
+ //# sourceMappingURL=temporalFormats.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporalFormats.cjs.js","names":["formatDate","require_rolldown_runtime","require_formats_dateValues","dayjs","specDateSaveFormat","specTimeSaveFormat","specDateTimeSaveFormat","RFC3339","PROBE_INSTANT","saveFormatSatisfies","pattern","jsonFormat","saveFormat","SAVE_FORMAT_DIAGNOSTIC","warned","warnOnSaveFormat","key"],"sources":["../../src/formats/temporalFormats.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport { formatDate } from './dateValues';\n\n/**\n * The serialization formats a temporal control saves in.\n *\n * Section 18 fixes these defaults, and the reason is not style: a control is\n * selected **by** the schema's `format` keyword, so the value it writes has to\n * satisfy that same keyword. JSON Forms' `createAjv` validates formats in full\n * mode, where RFC 3339 `time` and `date-time` both require seconds **and** a\n * timezone offset.\n *\n * Core's `defaultTimeFormat` is `HH:mm:ss`, which has no offset - so a time\n * control wrote `17:04:09` and the form went invalid the moment anyone used\n * the picker, with no way to fix it from the picker either. Every value it\n * could produce was invalid.\n *\n * | Format | Written | Accepted by `format: \"time\"` |\n * | --- | --- | --- |\n * | `HH:mm:ss` | `17:04:09` | no |\n * | `HH:mm:ssZ` | `17:04:09-04:00` | yes |\n *\n * `date` needs no offset and core's default already matches the section.\n */\n\n/** Section 18: `YYYY-MM-DD`. */\nexport const specDateSaveFormat = 'YYYY-MM-DD';\n\n/** Section 18: `HH:mm:ssZ`, \"including offset under this format\". */\nexport const specTimeSaveFormat = 'HH:mm:ssZ';\n\n/**\n * Section 18: `YYYY-MM-DDTHH:mm:ssZ`.\n *\n * The `T` is escaped. dayjs passes an unrecognised letter through unchanged,\n * so both spellings produce the same string - but `T` sits directly against\n * `DD`, and escaping says that it is a literal rather than leaving the reader\n * to check the token table.\n */\nexport const specDateTimeSaveFormat = 'YYYY-MM-DD[T]HH:mm:ssZ';\n\n/*\n RFC 3339, as `ajv-formats` applies it in full mode. Inlined rather than\n imported because the check below has to run in a cell, where pulling in a\n validator would be out of proportion to the question being asked.\n*/\nconst RFC3339 = {\n date: /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/,\n time: /^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,\n 'date-time':\n /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,\n};\n\n/**\n * The instant the check below formats, chosen rather than picked at random.\n *\n * **Every component is a single digit.** That is the whole point: a format\n * using an unpadded token - `H:mm:ss` rather than `HH:mm:ss` - emits a\n * two-digit hour anyway for any instant after 09:59, so a probe taken from\n * the afternoon quietly accepts it. At 04:05:06 the same format emits\n * `4:05:06`, which RFC 3339 rejects, and the author hears about it.\n *\n * It is fixed rather than `dayjs()` because the answer must not depend on\n * when the form happens to be rendered.\n */\nconst PROBE_INSTANT = '2001-02-03T04:05:06';\n\n/**\n * Whether a save format can produce a value the schema's `format` accepts.\n *\n * The trap this exists for: a control selected by `format: \"time\"` given\n * `timeSaveFormat: \"HH:mm\"` writes `23:03`, which that same keyword rejects -\n * so the form is invalid the instant anyone edits it, and no amount of picking\n * repairs it. It reads like a display setting and is a validity setting.\n *\n * The check is empirical rather than a parse of the format string: the\n * reference instant above is formatted and the result tested. That way a\n * format nobody anticipated is judged by what it actually emits.\n *\n * Returns true when there is nothing to object to - including when the schema\n * carries no ordered `format` at all, which is the whole point of choosing a\n * control through `options.format` instead.\n */\nexport const saveFormatSatisfies = (\n jsonFormat: unknown,\n saveFormat: string,\n): boolean => {\n const pattern = RFC3339[jsonFormat as keyof typeof RFC3339];\n if (!pattern) {\n return true;\n }\n return pattern.test(formatDate(dayjs(PROBE_INSTANT), saveFormat));\n};\n\n/** Stable code, per section 21. */\nexport const SAVE_FORMAT_DIAGNOSTIC = 'temporal.saveFormatInvalid';\n\nconst warned = new Set<string>();\n\n/**\n * Warns once per offending combination.\n *\n * A console warning rather than a rendered message, following the precedent\n * set for `Categorization`'s `initial` (adjustment 10.5): this is an authoring\n * mistake in the UI schema, not something the person filling in the form can\n * act on. They already get the validation error.\n */\nexport const warnOnSaveFormat = (\n jsonFormat: unknown,\n saveFormat: string,\n): void => {\n if (saveFormatSatisfies(jsonFormat, saveFormat)) {\n return;\n }\n const key = `${String(jsonFormat)}|${saveFormat}`;\n if (warned.has(key)) {\n return;\n }\n warned.add(key);\n // oxlint-disable-next-line no-console\n console.warn(\n `${SAVE_FORMAT_DIAGNOSTIC}: the save format ${JSON.stringify(\n saveFormat,\n )} produces values that \\`format: ${JSON.stringify(\n jsonFormat,\n )}\\` rejects, so the control cannot be made valid. Either drop the schema \\`format\\` and select the control with \\`options.format\\`, or use a save format carrying the parts RFC 3339 requires.`,\n );\n};\n"],"mappings":"A,uLA0BA,IAAaI,EAAqB,aAGrBC,EAAqB,YAUrBC,EAAyB,yBAOhCC,EAAU,CACd,KAAM,6BACN,KAAM,6EACN,YACE,qGACJ,EAcMC,EAAgB,sBAkBTC,GACX,EACA,IACY,CACZ,IAAMC,EAAUH,EAAQI,GAIxB,MAHA,CAAKD,GAGEA,EAAQ,KAAKV,EAAAA,YAAAA,EAAWG,EAAA,QAAA,CAAMK,CAAa,EAAGI,CAAU,CAAC,CAClE,EAGaC,EAAyB,6BAEhCC,EAAS,IAAI,IAUNC,GACX,EACA,IACS,CACT,GAAIN,EAAoBE,EAAYC,CAAU,EAC5C,OAEF,IAAMI,EAAM,GAAG,OAAOL,CAAU,EAAE,GAAGC,IACjCE,EAAO,IAAIE,CAAG,IAGlBF,EAAO,IAAIE,CAAG,EAEd,QAAQ,KACN,GAAGH,EAAuB,oBAAoB,KAAK,UACjDD,CACF,EAAE,kCAAkC,KAAK,UACvCD,CACF,EAAE,8LACJ,EACF,E"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The serialization formats a temporal control saves in.
3
+ *
4
+ * Section 18 fixes these defaults, and the reason is not style: a control is
5
+ * selected **by** the schema's `format` keyword, so the value it writes has to
6
+ * satisfy that same keyword. JSON Forms' `createAjv` validates formats in full
7
+ * mode, where RFC 3339 `time` and `date-time` both require seconds **and** a
8
+ * timezone offset.
9
+ *
10
+ * Core's `defaultTimeFormat` is `HH:mm:ss`, which has no offset - so a time
11
+ * control wrote `17:04:09` and the form went invalid the moment anyone used
12
+ * the picker, with no way to fix it from the picker either. Every value it
13
+ * could produce was invalid.
14
+ *
15
+ * | Format | Written | Accepted by `format: "time"` |
16
+ * | --- | --- | --- |
17
+ * | `HH:mm:ss` | `17:04:09` | no |
18
+ * | `HH:mm:ssZ` | `17:04:09-04:00` | yes |
19
+ *
20
+ * `date` needs no offset and core's default already matches the section.
21
+ */
22
+ /** Section 18: `YYYY-MM-DD`. */
23
+ export declare const specDateSaveFormat = "YYYY-MM-DD";
24
+ /** Section 18: `HH:mm:ssZ`, "including offset under this format". */
25
+ export declare const specTimeSaveFormat = "HH:mm:ssZ";
26
+ /**
27
+ * Section 18: `YYYY-MM-DDTHH:mm:ssZ`.
28
+ *
29
+ * The `T` is escaped. dayjs passes an unrecognised letter through unchanged,
30
+ * so both spellings produce the same string - but `T` sits directly against
31
+ * `DD`, and escaping says that it is a literal rather than leaving the reader
32
+ * to check the token table.
33
+ */
34
+ export declare const specDateTimeSaveFormat = "YYYY-MM-DD[T]HH:mm:ssZ";
35
+ /**
36
+ * Whether a save format can produce a value the schema's `format` accepts.
37
+ *
38
+ * The trap this exists for: a control selected by `format: "time"` given
39
+ * `timeSaveFormat: "HH:mm"` writes `23:03`, which that same keyword rejects -
40
+ * so the form is invalid the instant anyone edits it, and no amount of picking
41
+ * repairs it. It reads like a display setting and is a validity setting.
42
+ *
43
+ * The check is empirical rather than a parse of the format string: the
44
+ * reference instant above is formatted and the result tested. That way a
45
+ * format nobody anticipated is judged by what it actually emits.
46
+ *
47
+ * Returns true when there is nothing to object to - including when the schema
48
+ * carries no ordered `format` at all, which is the whole point of choosing a
49
+ * control through `options.format` instead.
50
+ */
51
+ export declare const saveFormatSatisfies: (jsonFormat: unknown, saveFormat: string) => boolean;
52
+ /** Stable code, per section 21. */
53
+ export declare const SAVE_FORMAT_DIAGNOSTIC = "temporal.saveFormatInvalid";
54
+ /**
55
+ * Warns once per offending combination.
56
+ *
57
+ * A console warning rather than a rendered message, following the precedent
58
+ * set for `Categorization`'s `initial` (adjustment 10.5): this is an authoring
59
+ * mistake in the UI schema, not something the person filling in the form can
60
+ * act on. They already get the validation error.
61
+ */
62
+ export declare const warnOnSaveFormat: (jsonFormat: unknown, saveFormat: string) => void;
@@ -0,0 +1,18 @@
1
+ import { formatDate as e } from "./dateValues.esm.js";
2
+ import t from "dayjs";
3
+ // src/formats/temporalFormats.ts
4
+ var n = "YYYY-MM-DD", r = "HH:mm:ssZ", i = "YYYY-MM-DD[T]HH:mm:ssZ", a = {
5
+ date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/,
6
+ time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,
7
+ "date-time": /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i
8
+ }, o = "2001-02-03T04:05:06", s = (n, r) => {
9
+ let i = a[n];
10
+ return !i || i.test(e(t(o), r));
11
+ }, c = "temporal.saveFormatInvalid", l = /* @__PURE__ */ new Set(), u = (e, t) => {
12
+ if (s(e, t)) return;
13
+ let n = `${String(e)}|${t}`;
14
+ l.has(n) || (l.add(n), console.warn(`${c}: the save format ${JSON.stringify(t)} produces values that \`format: ${JSON.stringify(e)}\` rejects, so the control cannot be made valid. Either drop the schema \`format\` and select the control with \`options.format\`, or use a save format carrying the parts RFC 3339 requires.`));
15
+ };
16
+ export { c as SAVE_FORMAT_DIAGNOSTIC, s as saveFormatSatisfies, n as specDateSaveFormat, i as specDateTimeSaveFormat, r as specTimeSaveFormat, u as warnOnSaveFormat };
17
+
18
+ //# sourceMappingURL=temporalFormats.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporalFormats.esm.js","names":["dayjs","specDateSaveFormat","specTimeSaveFormat","specDateTimeSaveFormat","RFC3339","PROBE_INSTANT","saveFormatSatisfies","pattern","jsonFormat","formatDate","saveFormat","SAVE_FORMAT_DIAGNOSTIC","warned","warnOnSaveFormat","key"],"sources":["../../src/formats/temporalFormats.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport { formatDate } from './dateValues';\n\n/**\n * The serialization formats a temporal control saves in.\n *\n * Section 18 fixes these defaults, and the reason is not style: a control is\n * selected **by** the schema's `format` keyword, so the value it writes has to\n * satisfy that same keyword. JSON Forms' `createAjv` validates formats in full\n * mode, where RFC 3339 `time` and `date-time` both require seconds **and** a\n * timezone offset.\n *\n * Core's `defaultTimeFormat` is `HH:mm:ss`, which has no offset - so a time\n * control wrote `17:04:09` and the form went invalid the moment anyone used\n * the picker, with no way to fix it from the picker either. Every value it\n * could produce was invalid.\n *\n * | Format | Written | Accepted by `format: \"time\"` |\n * | --- | --- | --- |\n * | `HH:mm:ss` | `17:04:09` | no |\n * | `HH:mm:ssZ` | `17:04:09-04:00` | yes |\n *\n * `date` needs no offset and core's default already matches the section.\n */\n\n/** Section 18: `YYYY-MM-DD`. */\nexport const specDateSaveFormat = 'YYYY-MM-DD';\n\n/** Section 18: `HH:mm:ssZ`, \"including offset under this format\". */\nexport const specTimeSaveFormat = 'HH:mm:ssZ';\n\n/**\n * Section 18: `YYYY-MM-DDTHH:mm:ssZ`.\n *\n * The `T` is escaped. dayjs passes an unrecognised letter through unchanged,\n * so both spellings produce the same string - but `T` sits directly against\n * `DD`, and escaping says that it is a literal rather than leaving the reader\n * to check the token table.\n */\nexport const specDateTimeSaveFormat = 'YYYY-MM-DD[T]HH:mm:ssZ';\n\n/*\n RFC 3339, as `ajv-formats` applies it in full mode. Inlined rather than\n imported because the check below has to run in a cell, where pulling in a\n validator would be out of proportion to the question being asked.\n*/\nconst RFC3339 = {\n date: /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/,\n time: /^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,\n 'date-time':\n /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,\n};\n\n/**\n * The instant the check below formats, chosen rather than picked at random.\n *\n * **Every component is a single digit.** That is the whole point: a format\n * using an unpadded token - `H:mm:ss` rather than `HH:mm:ss` - emits a\n * two-digit hour anyway for any instant after 09:59, so a probe taken from\n * the afternoon quietly accepts it. At 04:05:06 the same format emits\n * `4:05:06`, which RFC 3339 rejects, and the author hears about it.\n *\n * It is fixed rather than `dayjs()` because the answer must not depend on\n * when the form happens to be rendered.\n */\nconst PROBE_INSTANT = '2001-02-03T04:05:06';\n\n/**\n * Whether a save format can produce a value the schema's `format` accepts.\n *\n * The trap this exists for: a control selected by `format: \"time\"` given\n * `timeSaveFormat: \"HH:mm\"` writes `23:03`, which that same keyword rejects -\n * so the form is invalid the instant anyone edits it, and no amount of picking\n * repairs it. It reads like a display setting and is a validity setting.\n *\n * The check is empirical rather than a parse of the format string: the\n * reference instant above is formatted and the result tested. That way a\n * format nobody anticipated is judged by what it actually emits.\n *\n * Returns true when there is nothing to object to - including when the schema\n * carries no ordered `format` at all, which is the whole point of choosing a\n * control through `options.format` instead.\n */\nexport const saveFormatSatisfies = (\n jsonFormat: unknown,\n saveFormat: string,\n): boolean => {\n const pattern = RFC3339[jsonFormat as keyof typeof RFC3339];\n if (!pattern) {\n return true;\n }\n return pattern.test(formatDate(dayjs(PROBE_INSTANT), saveFormat));\n};\n\n/** Stable code, per section 21. */\nexport const SAVE_FORMAT_DIAGNOSTIC = 'temporal.saveFormatInvalid';\n\nconst warned = new Set<string>();\n\n/**\n * Warns once per offending combination.\n *\n * A console warning rather than a rendered message, following the precedent\n * set for `Categorization`'s `initial` (adjustment 10.5): this is an authoring\n * mistake in the UI schema, not something the person filling in the form can\n * act on. They already get the validation error.\n */\nexport const warnOnSaveFormat = (\n jsonFormat: unknown,\n saveFormat: string,\n): void => {\n if (saveFormatSatisfies(jsonFormat, saveFormat)) {\n return;\n }\n const key = `${String(jsonFormat)}|${saveFormat}`;\n if (warned.has(key)) {\n return;\n }\n warned.add(key);\n // oxlint-disable-next-line no-console\n console.warn(\n `${SAVE_FORMAT_DIAGNOSTIC}: the save format ${JSON.stringify(\n saveFormat,\n )} produces values that \\`format: ${JSON.stringify(\n jsonFormat,\n )}\\` rejects, so the control cannot be made valid. Either drop the schema \\`format\\` and select the control with \\`options.format\\`, or use a save format carrying the parts RFC 3339 requires.`,\n );\n};\n"],"mappings":";;;AA0BA,IAAaC,IAAqB,cAGrBC,IAAqB,aAUrBC,IAAyB,0BAOhCC,IAAU;CACd,MAAM;CACN,MAAM;CACN,aACE;AACJ,GAcMC,IAAgB,uBAkBTC,KACX,GACA,MACY;CACZ,IAAMC,IAAUH,EAAQI;CAIxB,OAHA,CAAKD,KAGEA,EAAQ,KAAKE,EAAWT,EAAMK,CAAa,GAAGK,CAAU,CAAC;AAClE,GAGaC,IAAyB,8BAEhCC,oBAAS,IAAI,IAAY,GAUlBC,KACX,GACA,MACS;CACT,IAAIP,EAAoBE,GAAYE,CAAU,GAC5C;CAEF,IAAMI,IAAM,GAAG,OAAON,CAAU,EAAE,GAAGE;CACrC,AAAIE,EAAO,IAAIE,CAAG,MAGlBF,EAAO,IAAIE,CAAG,GAEd,QAAQ,KACN,GAAGH,EAAuB,oBAAoB,KAAK,UACjDD,CACF,EAAE,kCAAkC,KAAK,UACvCF,CACF,EAAE,8LACJ;AACF"}
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./maskFormat.cjs.js");let t=require("react");var n=new Set,r=(e,t)=>{let r=`${e}:${t}`;n.has(r)||(n.add(r),console.warn(`Mask token '${e}' has an invalid pattern and was ignored: ${t}`))};function i({data:n,config:i,uischema:a,path:o,handleChange:s,schema:c},l,u){let d={...i,...a.options},f=(0,t.useMemo)(()=>e.resolveMaskSettings(a.options,i,r),[a.options,i]),p=(0,t.useMemo)(()=>f?e.createMask(f):void 0,[f]),m=(0,t.useRef)(void 0),[h,g]=(0,t.useState)(void 0),[_,v]=(0,t.useState)(!1),y=(0,t.useRef)(!1),b=typeof n==`string`?n:``,x=(f==null?void 0:f.returnMaskedValue)===!0,S=(0,t.useMemo)(()=>u===`defer`&&_&&h!==void 0?h:p?h!==void 0&&e.storedValue(p,h,x)===b?h:e.displayValue(p,b,x):b,[u,_,h,p,x,b]),C=(0,t.useCallback)(t=>{g(t),p?s(o,e.storedValue(p,t,x)||void 0):s(o,t||void 0)},[s,p,o,x]),w=(0,t.useCallback)(()=>{g(void 0),s(o,void 0)},[s,o]);(0,t.useLayoutEffect)(()=>{let e=m.current;if(e===void 0)return;m.current=void 0;let t=l();t&&t.value===S&&t.setSelectionRange(e,e)});let T=(0,t.useCallback)(t=>{let n=l(),r=n?n.value:t.currentTarget.value;if(y.current){u===`defer`?g(r):C(r);return}if(!p){C(r);return}let i=(t.nativeEvent.inputType??``).startsWith(`delete`),a=n?n.selectionStart:null,o=e.maskEdit(p,r,i);if(d.restrict&&!e.withinMaxLength(e.storedValue(p,o,x),c.maxLength)){if(n){n.value=S;let e=Math.max(0,(a??S.length)-1);n.setSelectionRange(e,e)}}else m.current=e.nextCaret(p,r,a,o,i),C(o)},[u,l,d.restrict,C,S,p,x,c.maxLength]);return{appliedUiSchemaOptions:d,settings:f,display:S,onClear:w,onChange:T,onCompositionStart(){y.current=!0,u===`defer`&&v(!0)},onCompositionEnd(e){y.current=!1,u===`defer`&&v(!1),T(e)}}}exports.useMaskedInput=i;
2
+ //# sourceMappingURL=useMaskedInput.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMaskedInput.cjs.js","names":["useMemo","resolveMaskSettings","createMask","useRef","useState","storedValue","displayValue","useCallback","maskEdit","withinMaxLength","nextCaret","require_formats_maskFormat","react","reportedMasks","warnInvalidToken","key","token","pattern","useMaskedInput","appliedUiSchemaOptions","config","uischema","settings","mask","pendingCaret","draft","setDraft","composing","setComposing","composingRef","stored","data","returnMaskedValue","display","compositionMode","commit","next","handleChange","path","onClear","position","field","getInput","onChange","raw","event","deleting","caret","masked","schema","restore"],"sources":["../../src/formats/useMaskedInput.ts"],"sourcesContent":["import type { CellProps } from '@jsonforms/core';\nimport React, {\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n createMask,\n displayValue,\n maskEdit,\n nextCaret,\n resolveMaskSettings,\n storedValue,\n withinMaxLength,\n} from './maskFormat';\n\nconst reportedMasks = new Set<string>();\n\nconst warnInvalidToken = (token: string, pattern: string) => {\n const key = `${token}:${pattern}`;\n if (reportedMasks.has(key)) {\n return;\n }\n reportedMasks.add(key);\n // oxlint-disable-next-line no-console\n console.warn(\n `Mask token '${token}' has an invalid pattern and was ignored: ${pattern}`,\n );\n};\n\nexport function useMaskedInput(\n {\n data,\n config,\n uischema,\n path,\n handleChange,\n schema,\n }: Pick<\n CellProps,\n 'data' | 'config' | 'uischema' | 'path' | 'handleChange' | 'schema'\n >,\n getInput: () => HTMLInputElement | null | undefined,\n compositionMode: 'defer' | 'commit',\n) {\n const appliedUiSchemaOptions = {\n ...(config as Record<string, unknown> | undefined),\n ...uischema.options,\n } as Record<string, any>;\n const settings = useMemo(\n () => resolveMaskSettings(uischema.options, config, warnInvalidToken),\n [uischema.options, config],\n );\n const mask = useMemo(\n () => (settings ? createMask(settings) : undefined),\n [settings],\n );\n\n const pendingCaret = useRef<number | undefined>(undefined);\n const [draft, setDraft] = useState<string | undefined>(undefined);\n // Set while an input-method editor is composing. The specification is\n // explicit that a mask \"must not overwrite the active draft or prematurely\n // treat it as a finalized value\", so nothing is masked until composition ends\n // - otherwise the intermediate romaji of a Japanese entry would be filtered\n // away character by character and the word could never be typed.\n const [composing, setComposing] = useState(false);\n const composingRef = useRef(false);\n\n const stored = typeof data === 'string' ? data : '';\n const returnMaskedValue = settings?.returnMaskedValue === true;\n\n const display = useMemo(() => {\n if (compositionMode === 'defer' && composing && draft !== undefined)\n return draft;\n if (!mask) {\n return stored;\n }\n if (\n draft !== undefined &&\n storedValue(mask, draft, returnMaskedValue) === stored\n ) {\n return draft;\n }\n return displayValue(mask, stored, returnMaskedValue);\n }, [compositionMode, composing, draft, mask, returnMaskedValue, stored]);\n\n const commit = useCallback(\n (next: string) => {\n setDraft(next);\n if (!mask) {\n handleChange(path, next || undefined);\n return;\n }\n handleChange(\n path,\n storedValue(mask, next, returnMaskedValue) || undefined,\n );\n },\n [handleChange, mask, path, returnMaskedValue],\n );\n\n const onClear = useCallback(() => {\n setDraft(undefined);\n handleChange(path, undefined);\n }, [handleChange, path]);\n\n useLayoutEffect(() => {\n const position = pendingCaret.current;\n if (position === undefined) {\n return;\n }\n pendingCaret.current = undefined;\n const field = getInput();\n if (field && field.value === display) {\n field.setSelectionRange(position, position);\n }\n });\n\n const onChange = useCallback(\n (event: React.SyntheticEvent<HTMLInputElement>) => {\n // Some input adapters deliver events from a cloned node. Restore the live input.\n const field = getInput();\n const raw = field ? field.value : event.currentTarget.value;\n if (composingRef.current) {\n if (compositionMode === 'defer') setDraft(raw);\n else commit(raw);\n return;\n }\n if (!mask) {\n commit(raw);\n return;\n }\n const deleting = (\n (event.nativeEvent as InputEvent).inputType ?? ''\n ).startsWith('delete');\n const caret = field ? field.selectionStart : null;\n const masked = maskEdit(mask, raw, deleting);\n\n // `restrict` limits the **stored** string, so this is the only place the\n // limit can be applied: the displayed text is a different length and the\n // input's own `maxlength` would count the wrong characters.\n if (\n appliedUiSchemaOptions.restrict &&\n !withinMaxLength(\n storedValue(mask, masked, returnMaskedValue),\n schema.maxLength,\n )\n ) {\n // Refused, so no state changes and React will not re-render - which\n // would leave the rejected keystroke sitting in the DOM. Put the\n // accepted text back by hand, with the caret where the refused\n // character would have gone.\n if (field) {\n field.value = display;\n const restore = Math.max(0, (caret ?? display.length) - 1);\n field.setSelectionRange(restore, restore);\n }\n return;\n }\n\n pendingCaret.current = nextCaret(mask, raw, caret, masked, deleting);\n commit(masked);\n },\n [\n compositionMode,\n getInput,\n appliedUiSchemaOptions.restrict,\n commit,\n display,\n mask,\n returnMaskedValue,\n schema.maxLength,\n ],\n );\n\n return {\n appliedUiSchemaOptions,\n settings,\n display,\n onClear,\n onChange,\n onCompositionStart() {\n composingRef.current = true;\n if (compositionMode === 'defer') setComposing(true);\n },\n onCompositionEnd(event: React.SyntheticEvent<HTMLInputElement>) {\n composingRef.current = false;\n if (compositionMode === 'defer') setComposing(false);\n onChange(event);\n },\n };\n}\n"],"mappings":"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"}
@@ -0,0 +1,11 @@
1
+ import type { CellProps } from '@jsonforms/core';
2
+ import React from 'react';
3
+ export declare function useMaskedInput({ data, config, uischema, path, handleChange, schema, }: Pick<CellProps, 'data' | 'config' | 'uischema' | 'path' | 'handleChange' | 'schema'>, getInput: () => HTMLInputElement | null | undefined, compositionMode: 'defer' | 'commit'): {
4
+ appliedUiSchemaOptions: Record<string, any>;
5
+ settings: import("./maskFormat").MaskSettings | undefined;
6
+ display: string;
7
+ onClear: () => void;
8
+ onChange: (event: React.SyntheticEvent<HTMLInputElement>) => void;
9
+ onCompositionStart(): void;
10
+ onCompositionEnd(event: React.SyntheticEvent<HTMLInputElement>): void;
11
+ };
@@ -0,0 +1,80 @@
1
+ import { createMask as e, displayValue as t, maskEdit as n, nextCaret as r, resolveMaskSettings as i, storedValue as a, withinMaxLength as o } from "./maskFormat.esm.js";
2
+ import { useCallback as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
3
+ // src/formats/useMaskedInput.ts
4
+ var f = /* @__PURE__ */ new Set(), p = (e, t) => {
5
+ let n = `${e}:${t}`;
6
+ f.has(n) || (f.add(n), console.warn(`Mask token '${e}' has an invalid pattern and was ignored: ${t}`));
7
+ };
8
+ function m({ data: f, config: m, uischema: h, path: g, handleChange: _, schema: v }, y, b) {
9
+ let x = {
10
+ ...m,
11
+ ...h.options
12
+ }, S = l(() => i(h.options, m, p), [h.options, m]), C = l(() => S ? e(S) : void 0, [S]), w = u(void 0), [T, E] = d(void 0), [D, O] = d(!1), k = u(!1), A = typeof f == "string" ? f : "", j = (S == null ? void 0 : S.returnMaskedValue) === !0, M = l(() => b === "defer" && D && T !== void 0 ? T : C ? T !== void 0 && a(C, T, j) === A ? T : t(C, A, j) : A, [
13
+ b,
14
+ D,
15
+ T,
16
+ C,
17
+ j,
18
+ A
19
+ ]), N = s((e) => {
20
+ E(e), C ? _(g, a(C, e, j) || void 0) : _(g, e || void 0);
21
+ }, [
22
+ _,
23
+ C,
24
+ g,
25
+ j
26
+ ]), P = s(() => {
27
+ E(void 0), _(g, void 0);
28
+ }, [_, g]);
29
+ c(() => {
30
+ let e = w.current;
31
+ if (e === void 0) return;
32
+ w.current = void 0;
33
+ let t = y();
34
+ t && t.value === M && t.setSelectionRange(e, e);
35
+ });
36
+ let F = s((e) => {
37
+ let t = y(), i = t ? t.value : e.currentTarget.value;
38
+ if (k.current) {
39
+ b === "defer" ? E(i) : N(i);
40
+ return;
41
+ }
42
+ if (!C) {
43
+ N(i);
44
+ return;
45
+ }
46
+ let s = (e.nativeEvent.inputType ?? "").startsWith("delete"), c = t ? t.selectionStart : null, l = n(C, i, s);
47
+ if (x.restrict && !o(a(C, l, j), v.maxLength)) {
48
+ if (t) {
49
+ t.value = M;
50
+ let e = Math.max(0, (c ?? M.length) - 1);
51
+ t.setSelectionRange(e, e);
52
+ }
53
+ } else w.current = r(C, i, c, l, s), N(l);
54
+ }, [
55
+ b,
56
+ y,
57
+ x.restrict,
58
+ N,
59
+ M,
60
+ C,
61
+ j,
62
+ v.maxLength
63
+ ]);
64
+ return {
65
+ appliedUiSchemaOptions: x,
66
+ settings: S,
67
+ display: M,
68
+ onClear: P,
69
+ onChange: F,
70
+ onCompositionStart() {
71
+ k.current = !0, b === "defer" && O(!0);
72
+ },
73
+ onCompositionEnd(e) {
74
+ k.current = !1, b === "defer" && O(!1), F(e);
75
+ }
76
+ };
77
+ }
78
+ export { m as useMaskedInput };
79
+
80
+ //# sourceMappingURL=useMaskedInput.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMaskedInput.esm.js","names":["reportedMasks","warnInvalidToken","key","token","pattern","useMaskedInput","appliedUiSchemaOptions","config","uischema","settings","useMemo","resolveMaskSettings","mask","createMask","pendingCaret","useRef","draft","setDraft","useState","composing","setComposing","composingRef","stored","data","returnMaskedValue","display","compositionMode","storedValue","displayValue","commit","useCallback","next","handleChange","path","onClear","position","field","getInput","onChange","raw","event","deleting","caret","masked","maskEdit","withinMaxLength","schema","restore","nextCaret"],"sources":["../../src/formats/useMaskedInput.ts"],"sourcesContent":["import type { CellProps } from '@jsonforms/core';\nimport React, {\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n createMask,\n displayValue,\n maskEdit,\n nextCaret,\n resolveMaskSettings,\n storedValue,\n withinMaxLength,\n} from './maskFormat';\n\nconst reportedMasks = new Set<string>();\n\nconst warnInvalidToken = (token: string, pattern: string) => {\n const key = `${token}:${pattern}`;\n if (reportedMasks.has(key)) {\n return;\n }\n reportedMasks.add(key);\n // oxlint-disable-next-line no-console\n console.warn(\n `Mask token '${token}' has an invalid pattern and was ignored: ${pattern}`,\n );\n};\n\nexport function useMaskedInput(\n {\n data,\n config,\n uischema,\n path,\n handleChange,\n schema,\n }: Pick<\n CellProps,\n 'data' | 'config' | 'uischema' | 'path' | 'handleChange' | 'schema'\n >,\n getInput: () => HTMLInputElement | null | undefined,\n compositionMode: 'defer' | 'commit',\n) {\n const appliedUiSchemaOptions = {\n ...(config as Record<string, unknown> | undefined),\n ...uischema.options,\n } as Record<string, any>;\n const settings = useMemo(\n () => resolveMaskSettings(uischema.options, config, warnInvalidToken),\n [uischema.options, config],\n );\n const mask = useMemo(\n () => (settings ? createMask(settings) : undefined),\n [settings],\n );\n\n const pendingCaret = useRef<number | undefined>(undefined);\n const [draft, setDraft] = useState<string | undefined>(undefined);\n // Set while an input-method editor is composing. The specification is\n // explicit that a mask \"must not overwrite the active draft or prematurely\n // treat it as a finalized value\", so nothing is masked until composition ends\n // - otherwise the intermediate romaji of a Japanese entry would be filtered\n // away character by character and the word could never be typed.\n const [composing, setComposing] = useState(false);\n const composingRef = useRef(false);\n\n const stored = typeof data === 'string' ? data : '';\n const returnMaskedValue = settings?.returnMaskedValue === true;\n\n const display = useMemo(() => {\n if (compositionMode === 'defer' && composing && draft !== undefined)\n return draft;\n if (!mask) {\n return stored;\n }\n if (\n draft !== undefined &&\n storedValue(mask, draft, returnMaskedValue) === stored\n ) {\n return draft;\n }\n return displayValue(mask, stored, returnMaskedValue);\n }, [compositionMode, composing, draft, mask, returnMaskedValue, stored]);\n\n const commit = useCallback(\n (next: string) => {\n setDraft(next);\n if (!mask) {\n handleChange(path, next || undefined);\n return;\n }\n handleChange(\n path,\n storedValue(mask, next, returnMaskedValue) || undefined,\n );\n },\n [handleChange, mask, path, returnMaskedValue],\n );\n\n const onClear = useCallback(() => {\n setDraft(undefined);\n handleChange(path, undefined);\n }, [handleChange, path]);\n\n useLayoutEffect(() => {\n const position = pendingCaret.current;\n if (position === undefined) {\n return;\n }\n pendingCaret.current = undefined;\n const field = getInput();\n if (field && field.value === display) {\n field.setSelectionRange(position, position);\n }\n });\n\n const onChange = useCallback(\n (event: React.SyntheticEvent<HTMLInputElement>) => {\n // Some input adapters deliver events from a cloned node. Restore the live input.\n const field = getInput();\n const raw = field ? field.value : event.currentTarget.value;\n if (composingRef.current) {\n if (compositionMode === 'defer') setDraft(raw);\n else commit(raw);\n return;\n }\n if (!mask) {\n commit(raw);\n return;\n }\n const deleting = (\n (event.nativeEvent as InputEvent).inputType ?? ''\n ).startsWith('delete');\n const caret = field ? field.selectionStart : null;\n const masked = maskEdit(mask, raw, deleting);\n\n // `restrict` limits the **stored** string, so this is the only place the\n // limit can be applied: the displayed text is a different length and the\n // input's own `maxlength` would count the wrong characters.\n if (\n appliedUiSchemaOptions.restrict &&\n !withinMaxLength(\n storedValue(mask, masked, returnMaskedValue),\n schema.maxLength,\n )\n ) {\n // Refused, so no state changes and React will not re-render - which\n // would leave the rejected keystroke sitting in the DOM. Put the\n // accepted text back by hand, with the caret where the refused\n // character would have gone.\n if (field) {\n field.value = display;\n const restore = Math.max(0, (caret ?? display.length) - 1);\n field.setSelectionRange(restore, restore);\n }\n return;\n }\n\n pendingCaret.current = nextCaret(mask, raw, caret, masked, deleting);\n commit(masked);\n },\n [\n compositionMode,\n getInput,\n appliedUiSchemaOptions.restrict,\n commit,\n display,\n mask,\n returnMaskedValue,\n schema.maxLength,\n ],\n );\n\n return {\n appliedUiSchemaOptions,\n settings,\n display,\n onClear,\n onChange,\n onCompositionStart() {\n composingRef.current = true;\n if (compositionMode === 'defer') setComposing(true);\n },\n onCompositionEnd(event: React.SyntheticEvent<HTMLInputElement>) {\n composingRef.current = false;\n if (compositionMode === 'defer') setComposing(false);\n onChange(event);\n },\n };\n}\n"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./cells/cellMode.cjs.js"),t=require("./cells/compositeActions.cjs.js"),n=require("./cells/compositeSummary.cjs.js"),r=require("./collections/arrayChoices.cjs.js"),i=require("./composition/combinators.cjs.js"),a=require("./composition/scalarComposition.cjs.js"),o=require("./controls/numeric.cjs.js"),s=require("./controls/useClearAffordance.cjs.js"),c=require("./controls/useDebouncedChange.cjs.js"),l=require("./controls/useFocus.cjs.js"),u=require("./core/configNamespaces.cjs.js"),d=require("./core/uiSchemaCycle.cjs.js"),f=require("./dynamic/DynamicUiProvider.cjs.js"),p=require("./locale/en.cjs.js"),m=require("./locale/bg.cjs.js"),h=require("./dynamic/dynamicConfig.cjs.js"),g=require("./dynamic/dynamicRuntime.cjs.js"),_=require("./dynamic/dynamicUi.cjs.js"),v=require("./formats/colorFormat.cjs.js"),y=require("./formats/dateValues.cjs.js"),b=require("./formats/duration.cjs.js"),x=require("./formats/maskControls.cjs.js"),S=require("./formats/maskFormat.cjs.js"),C=require("./formats/temporalBounds.cjs.js"),w=require("./formats/temporalFormats.cjs.js"),T=require("./interaction/confirmation.cjs.js"),E=require("./interaction/pendingChanges.cjs.js"),D=require("./interaction/visuallyHidden.cjs.js"),O=require("./layout/categoryState.cjs.js"),k=require("./layout/groupState.cjs.js"),A=require("./layout/layoutContext.cjs.js"),j=require("./layout/layoutSizing.cjs.js"),M=require("./locale/rendererLocale.cjs.js"),N=require("./locale/translate.cjs.js"),P=require("./mixed/mixedSchema.cjs.js"),F=require("./mixed/mixedTree.cjs.js"),I=require("./objects/additionalProperties.cjs.js"),L=require("./objects/additionalPropertyName.cjs.js"),R=require("./objects/dynamicProperties.cjs.js"),z=require("./objects/literalPropertySchema.cjs.js"),B=require("./tuple/tupleSchema.cjs.js"),V=require("./validation/preTouchErrors.cjs.js"),H=require("./validation/validationIndicator.cjs.js");exports.ANY_TYPES=P.ANY_TYPES,exports.COLOR_SAVE_FORMATS=v.COLOR_SAVE_FORMATS,exports.CellModeProvider=e.CellModeProvider,exports.DEFAULT_COLOR_SAVE_FORMAT=v.DEFAULT_COLOR_SAVE_FORMAT,exports.DEFAULT_GRID_COLUMNS=j.DEFAULT_GRID_COLUMNS,exports.DEFAULT_MASK_SETTINGS=S.DEFAULT_MASK_SETTINGS,exports.DEFAULT_MASK_TOKENS=S.DEFAULT_MASK_TOKENS,exports.DynamicCell=f.DynamicCell,exports.DynamicJsonForms=f.DynamicJsonForms,exports.DynamicPropertyProvider=R.DynamicPropertyProvider,exports.DynamicRenderer=f.DynamicRenderer,exports.DynamicUiProvider=f.DynamicUiProvider,exports.EMPTY_DURATION=b.EMPTY_DURATION,exports.JSONFORMS_CONFIG_KEY=u.JSONFORMS_CONFIG_KEY,exports.JSONFORMS_EXTENDED_CONFIG_KEY=u.JSONFORMS_EXTENDED_CONFIG_KEY,exports.MASKA_DEFAULT_TOKENS=S.MASKA_DEFAULT_TOKENS,exports.NO_CATEGORY=O.NO_CATEGORY,exports.PendingChangesProvider=E.PendingChangesProvider,exports.SAVE_FORMAT_DIAGNOSTIC=w.SAVE_FORMAT_DIAGNOSTIC,exports.TRUST_DYNAMIC_FUNCTIONS=h.TRUST_DYNAMIC_FUNCTIONS,exports.UI_SCHEMA_CYCLE_DIAGNOSTIC=d.UI_SCHEMA_CYCLE_DIAGNOSTIC,exports.UNCONSTRAINED_TYPES=B.UNCONSTRAINED_TYPES,exports.UiSchemaCycleProvider=d.UiSchemaCycleProvider,exports.addChoice=r.addChoice,exports.arrayChoiceItemErrors=r.arrayChoiceItemErrors,exports.arrayChoicesOf=r.arrayChoicesOf,exports.asArrayValue=r.asArrayValue,exports.asColorSaveFormat=v.asColorSaveFormat,exports.assignOwnProperty=L.assignOwnProperty,exports.bgRendererLocale=m.bgRendererLocale,exports.boundDataPaths=k.boundDataPaths,exports.branchChangeData=i.branchChangeData,exports.buildErrorIndex=H.buildErrorIndex,exports.buildMixedTree=F.buildMixedTree,exports.canAddChoice=r.canAddChoice,exports.canRemoveChoice=r.canRemoveChoice,exports.categoryKey=O.categoryKey,exports.clearedBranchValue=i.clearedBranchValue,exports.clearedDynamicPropertyValue=R.clearedDynamicPropertyValue,exports.codePointLength=S.codePointLength,exports.collectBoundPaths=k.collectBoundPaths,exports.compileTokenPattern=S.compileTokenPattern,exports.compositeSummary=n.compositeSummary,exports.compositeSummaryPresentation=n.compositeSummaryPresentation,exports.confirmationRequired=T.confirmationRequired,exports.containerStyle=j.containerStyle,exports.createAdditionalPropertyNameSchema=L.createAdditionalPropertyNameSchema,exports.createDynamicUiCache=_.createDynamicUiCache,exports.createDynamicUiMemo=_.createDynamicUiMemo,exports.createDynamicUiResolver=_.createDynamicUiResolver,exports.createMask=S.createMask,exports.defaultRendererLocales=M.defaultRendererLocales,exports.deleteMixedTreeNode=F.deleteMixedTreeNode,exports.discardedByBranchChange=i.discardedByBranchChange,exports.displayValue=S.displayValue,exports.displayableErrors=H.displayableErrors,exports.dynamicAuthoredElement=f.dynamicAuthoredElement,exports.dynamicBoundValue=_.dynamicBoundValue,exports.dynamicCellEntry=f.dynamicCellEntry,exports.dynamicCellValue=_.dynamicCellValue,exports.dynamicItemAt=_.dynamicItemAt,exports.dynamicPath=_.dynamicPath,exports.dynamicRendererEntry=f.dynamicRendererEntry,exports.dynamicUiOptions=h.dynamicUiOptions,exports.effectiveRestrict=C.effectiveRestrict,exports.enRendererLocale=p.enRendererLocale,exports.i18nDefaults=p.enRendererLocale,exports.enclosingPropertyNames=i.enclosingPropertyNames,exports.errorDataPath=H.errorDataPath,exports.extendedConfig=u.extendedConfig,exports.extendedMaskTester=x.extendedMaskTester,exports.fallbackConfirmationPolicy=T.fallbackConfirmationPolicy,exports.filterErrorsBeforeTouch=V.filterErrorsBeforeTouch,exports.findMixedTreeNode=F.findMixedTreeNode,exports.fitsMask=S.fitsMask,exports.formatDate=y.formatDate,exports.formatDuration=b.formatDuration,exports.formatDurationComponents=b.formatDurationComponents,exports.getData=y.parseDateValue,exports.getJsonDataType=P.getJsonDataType,exports.getMatchingAdditionalPropertySchema=I.getMatchingAdditionalPropertySchema,exports.getRendererLocales=M.getRendererLocales,exports.getSchemaTypes=P.getSchemaTypes,exports.groupHasData=k.groupHasData,exports.hasAdditionalProperties=I.hasAdditionalProperties,exports.hasGroupValue=k.hasGroupValue,exports.hasMaskPattern=x.hasMaskPattern,exports.hasStringItems=r.hasStringItems,exports.hsbToRgb=v.hsbToRgb,exports.hslToRgb=v.hslToRgb,exports.isArrayElementPath=P.isArrayElementPath,exports.isChipsControl=r.isChipsControl,exports.isColor=v.isColor,exports.isComplexTupleSchema=B.isComplexTupleSchema,exports.isComplexValue=T.isComplexValue,exports.isDefaultGeneratedUiSchema=P.isDefaultGeneratedUiSchema,exports.isDiscardableValue=T.isDiscardableValue,exports.isMaskPattern=x.isMaskPattern,exports.isMixedControl=P.isMixedControl,exports.isMixedSchema=P.isMixedSchema,exports.isMultiSelectControl=r.isMultiSelectControl,exports.isSelected=r.isSelected,exports.isTransparent=v.isTransparent,exports.isUnselectedBranchValue=i.isUnselectedBranchValue,exports.itemOptionsOf=j.itemOptionsOf,exports.itemSizing=j.itemSizing,exports.literalPropertySchema=z.literalPropertySchema,exports.loadDynamicUiExpressions=g.loadDynamicUiExpressions,exports.maskEdit=S.maskEdit,exports.mixedControlFor=P.mixedControlFor,exports.mixedControlTester=P.mixedControlTester,exports.mixedDataType=F.mixedDataType,exports.mixedPathKey=F.mixedPathKey,exports.mixedTreeLabel=F.mixedTreeLabel,exports.needsIsolatedEditor=L.needsIsolatedEditor,exports.nextCaret=S.nextCaret,exports.normalizeHue=v.normalizeHue,exports.parseColor=v.parseColor,exports.parseDuration=b.parseDuration,exports.placeholderKeyFor=v.placeholderKeyFor,exports.preventsEmpty=t.preventsEmpty,exports.registerRendererLocale=M.registerRendererLocale,exports.removeChoice=r.removeChoice,exports.removeChoiceAt=r.removeChoiceAt,exports.removeInapplicableKeywords=P.removeInapplicableKeywords,exports.renameMixedTreeNode=F.renameMixedTreeNode,exports.renamePropertyKey=I.renamePropertyKey,exports.rendererDefault=M.rendererDefault,exports.resolveCollapsed=k.resolveCollapsed,exports.resolveConfirmationPolicy=T.resolveConfirmationPolicy,exports.resolveDataBounds=C.resolveDataBounds,exports.resolveDataPointer=C.resolveDataPointer,exports.resolveDynamicUi=_.resolveDynamicUi,exports.resolveExtendedOption=u.resolveExtendedOption,exports.resolveGap=j.resolveGap,exports.resolveGridColumns=j.resolveGridColumns,exports.resolveIndicatorOption=H.resolveIndicatorOption,exports.resolveInitialIndex=O.resolveInitialIndex,exports.resolveItemSchema=r.resolveItemSchema,exports.resolveMaskSettings=S.resolveMaskSettings,exports.resolveMixedArrayItems=P.resolveMixedArrayItems,exports.resolveRendererLocale=M.resolveRendererLocale,exports.resolveTupleSchema=B.resolveTupleSchema,exports.resolveWrap=j.resolveWrap,exports.rgbToHsb=v.rgbToHsb,exports.sameChoice=r.sameChoice,exports.sanitizeComponents=b.sanitizeComponents,exports.saveFormatSatisfies=w.saveFormatSatisfies,exports.scalarCompositionSchema=a.scalarCompositionSchema,exports.scalarCompositionType=a.scalarCompositionType,exports.schemaForType=P.schemaForType,exports.serializeColor=v.serializeColor,exports.setRendererLocales=M.setRendererLocales,exports.sharedErrorIndex=H.sharedErrorIndex,exports.shouldConfirm=T.shouldConfirm,exports.spanBasis=j.spanBasis,exports.specDateSaveFormat=w.specDateSaveFormat,exports.specDateTimeSaveFormat=w.specDateTimeSaveFormat,exports.specTimeSaveFormat=w.specTimeSaveFormat,exports.storedValue=S.storedValue,exports.temporalBounds=C.temporalBounds,exports.toAdditionalPropertyItem=I.toAdditionalPropertyItem,exports.toCommittableNumber=o.toCommittableNumber,exports.toCss=j.toCss,exports.toCssColor=v.toCssColor,exports.toMaskTokens=S.toMaskTokens,exports.toObjectSchema=I.toObjectSchema,exports.tupleControlTester=B.tupleControlTester,exports.tupleDefinition=B.tupleDefinition,exports.tupleEmptyValue=B.tupleEmptyValue,exports.tupleFieldOwnsLabel=B.tupleFieldOwnsLabel,exports.tupleInitialValue=B.tupleInitialValue,exports.tupleRenderSchema=B.tupleRenderSchema,exports.useCategorySelection=O.useCategorySelection,exports.useCellMode=e.useCellMode,exports.useClearAffordance=s.useClearAffordance,exports.useContainerValidation=H.useContainerValidation,exports.useDebouncedChange=c.useDebouncedChange,exports.useDynamicElements=f.useDynamicElements,exports.useDynamicExternal=f.useDynamicExternal,exports.useDynamicProperty=R.useDynamicProperty,exports.useDynamicResolution=f.useDynamicResolution,exports.useDynamicTreeResolver=f.useDynamicTreeResolver,exports.useEffectiveElements=A.useEffectiveElements,exports.useFocus=l.useFocus,exports.useGroupExpansion=k.useGroupExpansion,exports.useGroupHeaderTitle=k.useGroupHeaderTitle,exports.useGroupState=k.useGroupState,exports.useI18n=N.useI18n,exports.useI18nDefault=N.useI18nDefault,exports.usePreTouchErrors=V.usePreTouchErrors,exports.useRegisterPendingChange=E.useRegisterPendingChange,exports.useTranslator=N.useTranslator,exports.useUiSchemaCycleGuard=d.useUiSchemaCycleGuard,exports.validateAdditionalPropertyName=L.validateAdditionalPropertyName,exports.visuallyHidden=D.visuallyHidden,exports.warnOnSaveFormat=w.warnOnSaveFormat,exports.withAjvProps=A.withAjvProps,exports.withDynamicCells=f.withDynamicCells,exports.withDynamicRenderers=f.withDynamicRenderers,exports.withinMaxLength=S.withinMaxLength;
package/lib/index.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ export * from './cells/cellMode';
2
+ export * from './cells/compositeActions';
3
+ export * from './cells/compositeSummary';
4
+ export * from './collections/arrayChoices';
5
+ export * from './composition/combinators';
6
+ export * from './composition/scalarComposition';
7
+ export * from './controls/numeric';
8
+ export * from './controls/useClearAffordance';
9
+ export * from './controls/useDebouncedChange';
10
+ export * from './controls/useFocus';
11
+ export * from './core/configNamespaces';
12
+ export * from './core/uiSchemaCycle';
13
+ export * from './dynamic/DynamicUiProvider';
14
+ export * from './dynamic/dynamicConfig';
15
+ export { loadDynamicUiExpressions } from './dynamic/dynamicRuntime';
16
+ export * from './dynamic/dynamicUi';
17
+ export * from './formats/colorFormat';
18
+ export { formatDate, parseDateValue as getData } from './formats/dateValues';
19
+ export * from './formats/duration';
20
+ export { hasMaskPattern, extendedMaskTester } from './formats/maskControls';
21
+ export * from './formats/maskFormat';
22
+ export * from './formats/temporalBounds';
23
+ export * from './formats/temporalFormats';
24
+ export * from './interaction/confirmation';
25
+ export * from './interaction/pendingChanges';
26
+ export * from './interaction/visuallyHidden';
27
+ export * from './layout/categoryState';
28
+ export * from './layout/groupState';
29
+ export * from './layout/layoutContext';
30
+ export * from './layout/layoutSizing';
31
+ export * from './locale';
32
+ export * from './locale/rendererLocale';
33
+ export * from './locale/translate';
34
+ export * from './mixed/mixedSchema';
35
+ export * from './mixed/mixedTree';
36
+ export * from './objects/additionalProperties';
37
+ export * from './objects/additionalPropertyName';
38
+ export * from './objects/dynamicProperties';
39
+ export * from './objects/literalPropertySchema';
40
+ export * from './tuple/tupleSchema';
41
+ export * from './validation/preTouchErrors';
42
+ export * from './validation/validationIndicator';
@@ -0,0 +1,44 @@
1
+ import { CellModeProvider as ee, useCellMode as te } from "./cells/cellMode.esm.js";
2
+ import { preventsEmpty as e } from "./cells/compositeActions.esm.js";
3
+ import { compositeSummary as t, compositeSummaryPresentation as n } from "./cells/compositeSummary.esm.js";
4
+ import { addChoice as r, arrayChoiceItemErrors as i, arrayChoicesOf as a, asArrayValue as o, canAddChoice as s, canRemoveChoice as c, hasStringItems as l, isChipsControl as u, isMultiSelectControl as d, isSelected as f, removeChoice as p, removeChoiceAt as m, resolveItemSchema as h, sameChoice as g } from "./collections/arrayChoices.esm.js";
5
+ import { branchChangeData as _, clearedBranchValue as v, discardedByBranchChange as y, enclosingPropertyNames as b, isUnselectedBranchValue as x } from "./composition/combinators.esm.js";
6
+ import { scalarCompositionSchema as S, scalarCompositionType as C } from "./composition/scalarComposition.esm.js";
7
+ import { toCommittableNumber as w } from "./controls/numeric.esm.js";
8
+ import { useClearAffordance as T } from "./controls/useClearAffordance.esm.js";
9
+ import { useDebouncedChange as E } from "./controls/useDebouncedChange.esm.js";
10
+ import { useFocus as D } from "./controls/useFocus.esm.js";
11
+ import { JSONFORMS_CONFIG_KEY as O, JSONFORMS_EXTENDED_CONFIG_KEY as k, extendedConfig as A, resolveExtendedOption as j } from "./core/configNamespaces.esm.js";
12
+ import { UI_SCHEMA_CYCLE_DIAGNOSTIC as M, UiSchemaCycleProvider as N, useUiSchemaCycleGuard as P } from "./core/uiSchemaCycle.esm.js";
13
+ import { DynamicCell as F, DynamicJsonForms as I, DynamicRenderer as L, DynamicUiProvider as R, dynamicAuthoredElement as z, dynamicCellEntry as B, dynamicRendererEntry as V, useDynamicElements as H, useDynamicExternal as U, useDynamicResolution as W, useDynamicTreeResolver as G, withDynamicCells as K, withDynamicRenderers as q } from "./dynamic/DynamicUiProvider.esm.js";
14
+ import { enRendererLocale as J } from "./locale/en.esm.js";
15
+ import { bgRendererLocale as Y } from "./locale/bg.esm.js";
16
+ import { TRUST_DYNAMIC_FUNCTIONS as X, dynamicUiOptions as Z } from "./dynamic/dynamicConfig.esm.js";
17
+ import { loadDynamicUiExpressions as Q } from "./dynamic/dynamicRuntime.esm.js";
18
+ import { createDynamicUiCache as ne, createDynamicUiMemo as re, createDynamicUiResolver as ie, dynamicBoundValue as ae, dynamicCellValue as oe, dynamicItemAt as se, dynamicPath as ce, resolveDynamicUi as le } from "./dynamic/dynamicUi.esm.js";
19
+ import { COLOR_SAVE_FORMATS as ue, DEFAULT_COLOR_SAVE_FORMAT as de, asColorSaveFormat as fe, hsbToRgb as pe, hslToRgb as me, isColor as he, isTransparent as ge, normalizeHue as _e, parseColor as ve, placeholderKeyFor as ye, rgbToHsb as be, serializeColor as xe, toCssColor as Se } from "./formats/colorFormat.esm.js";
20
+ import { formatDate as Ce, parseDateValue as we } from "./formats/dateValues.esm.js";
21
+ import { EMPTY_DURATION as Te, formatDuration as Ee, formatDurationComponents as De, parseDuration as Oe, sanitizeComponents as ke } from "./formats/duration.esm.js";
22
+ import { extendedMaskTester as Ae, hasMaskPattern as je, isMaskPattern as Me } from "./formats/maskControls.esm.js";
23
+ import { DEFAULT_MASK_SETTINGS as Ne, DEFAULT_MASK_TOKENS as Pe, MASKA_DEFAULT_TOKENS as Fe, codePointLength as Ie, compileTokenPattern as Le, createMask as Re, displayValue as ze, fitsMask as Be, maskEdit as Ve, nextCaret as He, resolveMaskSettings as Ue, storedValue as We, toMaskTokens as Ge, withinMaxLength as Ke } from "./formats/maskFormat.esm.js";
24
+ import { effectiveRestrict as qe, resolveDataBounds as Je, resolveDataPointer as Ye, temporalBounds as Xe } from "./formats/temporalBounds.esm.js";
25
+ import { SAVE_FORMAT_DIAGNOSTIC as Ze, saveFormatSatisfies as Qe, specDateSaveFormat as $e, specDateTimeSaveFormat as et, specTimeSaveFormat as tt, warnOnSaveFormat as nt } from "./formats/temporalFormats.esm.js";
26
+ import { confirmationRequired as rt, fallbackConfirmationPolicy as it, isComplexValue as $, isDiscardableValue as at, resolveConfirmationPolicy as ot, shouldConfirm as st } from "./interaction/confirmation.esm.js";
27
+ import { PendingChangesProvider as ct, useRegisterPendingChange as lt } from "./interaction/pendingChanges.esm.js";
28
+ import { visuallyHidden as ut } from "./interaction/visuallyHidden.esm.js";
29
+ import { NO_CATEGORY as dt, categoryKey as ft, resolveInitialIndex as pt, useCategorySelection as mt } from "./layout/categoryState.esm.js";
30
+ import { boundDataPaths as ht, collectBoundPaths as gt, groupHasData as _t, hasGroupValue as vt, resolveCollapsed as yt, useGroupExpansion as bt, useGroupHeaderTitle as xt, useGroupState as St } from "./layout/groupState.esm.js";
31
+ import { useEffectiveElements as Ct, withAjvProps as wt } from "./layout/layoutContext.esm.js";
32
+ import { DEFAULT_GRID_COLUMNS as Tt, containerStyle as Et, itemOptionsOf as Dt, itemSizing as Ot, resolveGap as kt, resolveGridColumns as At, resolveWrap as jt, spanBasis as Mt, toCss as Nt } from "./layout/layoutSizing.esm.js";
33
+ import { defaultRendererLocales as Pt, getRendererLocales as Ft, registerRendererLocale as It, rendererDefault as Lt, resolveRendererLocale as Rt, setRendererLocales as zt } from "./locale/rendererLocale.esm.js";
34
+ import { useI18n as Bt, useI18nDefault as Vt, useTranslator as Ht } from "./locale/translate.esm.js";
35
+ import { ANY_TYPES as Ut, getJsonDataType as Wt, getSchemaTypes as Gt, isArrayElementPath as Kt, isDefaultGeneratedUiSchema as qt, isMixedControl as Jt, isMixedSchema as Yt, mixedControlFor as Xt, mixedControlTester as Zt, removeInapplicableKeywords as Qt, resolveMixedArrayItems as $t, schemaForType as en } from "./mixed/mixedSchema.esm.js";
36
+ import { buildMixedTree as tn, deleteMixedTreeNode as nn, findMixedTreeNode as rn, mixedDataType as an, mixedPathKey as on, mixedTreeLabel as sn, renameMixedTreeNode as cn } from "./mixed/mixedTree.esm.js";
37
+ import { getMatchingAdditionalPropertySchema as ln, hasAdditionalProperties as un, renamePropertyKey as dn, toAdditionalPropertyItem as fn, toObjectSchema as pn } from "./objects/additionalProperties.esm.js";
38
+ import { assignOwnProperty as mn, createAdditionalPropertyNameSchema as hn, needsIsolatedEditor as gn, validateAdditionalPropertyName as _n } from "./objects/additionalPropertyName.esm.js";
39
+ import { DynamicPropertyProvider as vn, clearedDynamicPropertyValue as yn, useDynamicProperty as bn } from "./objects/dynamicProperties.esm.js";
40
+ import { literalPropertySchema as xn } from "./objects/literalPropertySchema.esm.js";
41
+ import { UNCONSTRAINED_TYPES as Sn, isComplexTupleSchema as Cn, resolveTupleSchema as wn, tupleControlTester as Tn, tupleDefinition as En, tupleEmptyValue as Dn, tupleFieldOwnsLabel as On, tupleInitialValue as kn, tupleRenderSchema as An } from "./tuple/tupleSchema.esm.js";
42
+ import { filterErrorsBeforeTouch as jn, usePreTouchErrors as Mn } from "./validation/preTouchErrors.esm.js";
43
+ import { buildErrorIndex as Nn, displayableErrors as Pn, errorDataPath as Fn, resolveIndicatorOption as In, sharedErrorIndex as Ln, useContainerValidation as Rn } from "./validation/validationIndicator.esm.js";
44
+ export { Ut as ANY_TYPES, ue as COLOR_SAVE_FORMATS, ee as CellModeProvider, de as DEFAULT_COLOR_SAVE_FORMAT, Tt as DEFAULT_GRID_COLUMNS, Ne as DEFAULT_MASK_SETTINGS, Pe as DEFAULT_MASK_TOKENS, F as DynamicCell, I as DynamicJsonForms, vn as DynamicPropertyProvider, L as DynamicRenderer, R as DynamicUiProvider, Te as EMPTY_DURATION, O as JSONFORMS_CONFIG_KEY, k as JSONFORMS_EXTENDED_CONFIG_KEY, Fe as MASKA_DEFAULT_TOKENS, dt as NO_CATEGORY, ct as PendingChangesProvider, Ze as SAVE_FORMAT_DIAGNOSTIC, X as TRUST_DYNAMIC_FUNCTIONS, M as UI_SCHEMA_CYCLE_DIAGNOSTIC, Sn as UNCONSTRAINED_TYPES, N as UiSchemaCycleProvider, r as addChoice, i as arrayChoiceItemErrors, a as arrayChoicesOf, o as asArrayValue, fe as asColorSaveFormat, mn as assignOwnProperty, Y as bgRendererLocale, ht as boundDataPaths, _ as branchChangeData, Nn as buildErrorIndex, tn as buildMixedTree, s as canAddChoice, c as canRemoveChoice, ft as categoryKey, v as clearedBranchValue, yn as clearedDynamicPropertyValue, Ie as codePointLength, gt as collectBoundPaths, Le as compileTokenPattern, t as compositeSummary, n as compositeSummaryPresentation, rt as confirmationRequired, Et as containerStyle, hn as createAdditionalPropertyNameSchema, ne as createDynamicUiCache, re as createDynamicUiMemo, ie as createDynamicUiResolver, Re as createMask, Pt as defaultRendererLocales, nn as deleteMixedTreeNode, y as discardedByBranchChange, ze as displayValue, Pn as displayableErrors, z as dynamicAuthoredElement, ae as dynamicBoundValue, B as dynamicCellEntry, oe as dynamicCellValue, se as dynamicItemAt, ce as dynamicPath, V as dynamicRendererEntry, Z as dynamicUiOptions, qe as effectiveRestrict, J as enRendererLocale, J as i18nDefaults, b as enclosingPropertyNames, Fn as errorDataPath, A as extendedConfig, Ae as extendedMaskTester, it as fallbackConfirmationPolicy, jn as filterErrorsBeforeTouch, rn as findMixedTreeNode, Be as fitsMask, Ce as formatDate, Ee as formatDuration, De as formatDurationComponents, we as getData, Wt as getJsonDataType, ln as getMatchingAdditionalPropertySchema, Ft as getRendererLocales, Gt as getSchemaTypes, _t as groupHasData, un as hasAdditionalProperties, vt as hasGroupValue, je as hasMaskPattern, l as hasStringItems, pe as hsbToRgb, me as hslToRgb, Kt as isArrayElementPath, u as isChipsControl, he as isColor, Cn as isComplexTupleSchema, $ as isComplexValue, qt as isDefaultGeneratedUiSchema, at as isDiscardableValue, Me as isMaskPattern, Jt as isMixedControl, Yt as isMixedSchema, d as isMultiSelectControl, f as isSelected, ge as isTransparent, x as isUnselectedBranchValue, Dt as itemOptionsOf, Ot as itemSizing, xn as literalPropertySchema, Q as loadDynamicUiExpressions, Ve as maskEdit, Xt as mixedControlFor, Zt as mixedControlTester, an as mixedDataType, on as mixedPathKey, sn as mixedTreeLabel, gn as needsIsolatedEditor, He as nextCaret, _e as normalizeHue, ve as parseColor, Oe as parseDuration, ye as placeholderKeyFor, e as preventsEmpty, It as registerRendererLocale, p as removeChoice, m as removeChoiceAt, Qt as removeInapplicableKeywords, cn as renameMixedTreeNode, dn as renamePropertyKey, Lt as rendererDefault, yt as resolveCollapsed, ot as resolveConfirmationPolicy, Je as resolveDataBounds, Ye as resolveDataPointer, le as resolveDynamicUi, j as resolveExtendedOption, kt as resolveGap, At as resolveGridColumns, In as resolveIndicatorOption, pt as resolveInitialIndex, h as resolveItemSchema, Ue as resolveMaskSettings, $t as resolveMixedArrayItems, Rt as resolveRendererLocale, wn as resolveTupleSchema, jt as resolveWrap, be as rgbToHsb, g as sameChoice, ke as sanitizeComponents, Qe as saveFormatSatisfies, S as scalarCompositionSchema, C as scalarCompositionType, en as schemaForType, xe as serializeColor, zt as setRendererLocales, Ln as sharedErrorIndex, st as shouldConfirm, Mt as spanBasis, $e as specDateSaveFormat, et as specDateTimeSaveFormat, tt as specTimeSaveFormat, We as storedValue, Xe as temporalBounds, fn as toAdditionalPropertyItem, w as toCommittableNumber, Nt as toCss, Se as toCssColor, Ge as toMaskTokens, pn as toObjectSchema, Tn as tupleControlTester, En as tupleDefinition, Dn as tupleEmptyValue, On as tupleFieldOwnsLabel, kn as tupleInitialValue, An as tupleRenderSchema, mt as useCategorySelection, te as useCellMode, T as useClearAffordance, Rn as useContainerValidation, E as useDebouncedChange, H as useDynamicElements, U as useDynamicExternal, bn as useDynamicProperty, W as useDynamicResolution, G as useDynamicTreeResolver, Ct as useEffectiveElements, D as useFocus, bt as useGroupExpansion, xt as useGroupHeaderTitle, St as useGroupState, Bt as useI18n, Vt as useI18nDefault, Mn as usePreTouchErrors, lt as useRegisterPendingChange, Ht as useTranslator, P as useUiSchemaCycleGuard, _n as validateAdditionalPropertyName, ut as visuallyHidden, nt as warnOnSaveFormat, wt as withAjvProps, K as withDynamicCells, q as withDynamicRenderers, Ke as withinMaxLength };
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=[`always`,`never`,`complex`],t=t=>e.includes(t)?t:void 0,n=(e,t)=>e===`mixed`&&t===`typeChange`||t===`delete`?`complex`:`always`,r=e=>{let t=e==null?void 0:e.jsonformsExtended,n=t==null?void 0:t.confirmation;return n&&typeof n==`object`?n:void 0},i=({options:e,config:i,catalogId:a,operation:o})=>{var s;let c=e==null?void 0:e.confirmation,l=t(c==null?void 0:c[o]);if(l)return l;let u=r(i),d=u==null?void 0:u.renderers;return t(d==null||(s=d[a])==null?void 0:s[o])||t(u==null?void 0:u.default)||n(a,o)},a=e=>e!==void 0,o=e=>Array.isArray(e)?e.length>0:typeof e==`object`&&!!e&&Object.keys(e).length>0,s=(e,t)=>e===`never`?!1:e===`complex`?t.some(o):t.some(a),c=(e,t)=>s(i(e),t);exports.confirmationRequired=s,exports.fallbackConfirmationPolicy=n,exports.isComplexValue=o,exports.isDiscardableValue=a,exports.resolveConfirmationPolicy=i,exports.shouldConfirm=c;
2
+ //# sourceMappingURL=confirmation.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirmation.cjs.js","names":["POLICIES","asPolicy","value","fallbackConfirmationPolicy","catalogId","operation","namespaceOf","extended","config","\"jsonformsExtended\"","confirmation","\"confirmation\"","resolveConfirmationPolicy","_renderers$catalogId","element","options","fromElement","namespace","renderers","isDiscardableValue","isComplexValue","confirmationRequired","policy","discarded","shouldConfirm","resolve"],"sources":["../../src/interaction/confirmation.ts"],"sourcesContent":["/**\n * The shared destructive-change confirmation policy, with no React in it.\n *\n * Section 14 defines one policy for every renderer that discards data, so this\n * module owns the whole of it: which policy applies, and whether that policy\n * prompts for the values actually being discarded. The renderers only supply\n * the values and act on the answer.\n *\n * Confirmation is **separate from permission**. It never bypasses `restrict`,\n * readonly, disabled state or schema constraints, and it is not a second\n * chance to do something the form already forbids.\n */\n\nexport type ConfirmationPolicy = 'always' | 'never' | 'complex';\n\n/**\n * The operations the policy covers. Ordinary typing, navigation, adding a\n * value and re-selecting the current type or branch are not among them.\n */\nexport type ConfirmationOperation = 'typeChange' | 'branchChange' | 'delete';\n\n/**\n * The built-in catalog ids used by the base renderer families.\n *\n * Stable semantic identifiers, \"not library component names\" - so a host's\n * configuration survives a renderer being rewritten or renamed.\n *\n * For an action hosted inside another renderer, the id is **the owner of the\n * action**: a dynamic property's Delete is `additionalProperties` even though\n * an object renderer draws it, and the mixed workspace's tree Delete is\n * `mixed`.\n */\nexport type BaseConfirmationCatalogId =\n | 'compositeCell'\n | 'mixed'\n | 'oneOf'\n | 'arrayTable'\n | 'arrayLayout'\n | 'listWithDetail'\n | 'additionalProperties'\n | 'additionalItems';\n\n/**\n * Any stable catalog id, including those contributed by optional extensions.\n *\n * Section 14's list also names `agGrid`, which is **not** enumerated here: that\n * renderer lives in the extended package, and this one must not know about\n * anything downstream of it. The extended set passes its own id as a plain\n * string; the `string & {}` keeps editor completion for the base ids listed\n * above while leaving the vocabulary open.\n */\n// oxlint-disable-next-line @typescript-eslint/ban-types\nexport type ConfirmationCatalogId = BaseConfirmationCatalogId | (string & {});\n\nconst POLICIES: ConfirmationPolicy[] = ['always', 'never', 'complex'];\n\nconst asPolicy = (value: unknown): ConfirmationPolicy | undefined =>\n POLICIES.includes(value as ConfirmationPolicy)\n ? (value as ConfirmationPolicy)\n : undefined;\n\n/**\n * The documented fallback, used when nothing configures the operation.\n *\n * Mixed type changes and all deletions fall back to `complex`; other operations fall back to\n * `always`. Section 14 spells out the consequence: \"the default configuration\n * example deliberately opts into always globally while restoring complex for\n * mixed type changes; without that exception a global always also applies to\n * mixed type changes\" - so a configured `default` really does replace this,\n * rather than being merged with it.\n */\nexport const fallbackConfirmationPolicy = (\n catalogId: ConfirmationCatalogId,\n operation: ConfirmationOperation,\n): ConfirmationPolicy =>\n (catalogId === 'mixed' && operation === 'typeChange') ||\n operation === 'delete'\n ? 'complex'\n : 'always';\n\nconst namespaceOf = (config: unknown): Record<string, unknown> | undefined => {\n const extended = (config as Record<string, unknown> | undefined)?.[\n 'jsonformsExtended'\n ];\n const confirmation = (extended as Record<string, unknown> | undefined)?.[\n 'confirmation'\n ];\n return confirmation && typeof confirmation === 'object'\n ? (confirmation as Record<string, unknown>)\n : undefined;\n};\n\nexport interface ResolveConfirmationOptions {\n /** The element's `uischema.options`. */\n options?: Record<string, unknown>;\n /** The global JSON Forms `config`. */\n config?: unknown;\n catalogId: ConfirmationCatalogId;\n operation: ConfirmationOperation;\n}\n\n/**\n * Section 14's resolution order, exactly:\n *\n * 1. `options.confirmation[operation]`\n * 2. `config.jsonformsExtended.confirmation.renderers[catalogId][operation]`\n * 3. `config.jsonformsExtended.confirmation.default`\n * 4. the documented fallback\n *\n * Unrecognized values are ignored rather than treated as `never`, so a typo\n * cannot silently switch confirmation off.\n */\nexport const resolveConfirmationPolicy = ({\n options,\n config,\n catalogId,\n operation,\n}: ResolveConfirmationOptions): ConfirmationPolicy => {\n const element = options?.confirmation as Record<string, unknown> | undefined;\n const fromElement = asPolicy(element?.[operation]);\n if (fromElement) {\n return fromElement;\n }\n\n const namespace = namespaceOf(config);\n const renderers = namespace?.renderers as\n | Record<string, Record<string, unknown>>\n | undefined;\n const fromRenderer = asPolicy(renderers?.[catalogId]?.[operation]);\n if (fromRenderer) {\n return fromRenderer;\n }\n\n const fromDefault = asPolicy(namespace?.default);\n if (fromDefault) {\n return fromDefault;\n }\n\n return fallbackConfirmationPolicy(catalogId, operation);\n};\n\n/**\n * Whether a value counts as something there is to discard.\n *\n * Section 14: \"no prompt when there is no value to discard. False, zero, empty\n * strings, and empty containers are existing values.\" Only absence is nothing -\n * `null` is a value a user chose, and so is `{}`.\n */\nexport const isDiscardableValue = (value: unknown): boolean =>\n value !== undefined;\n\n/**\n * Whether a value is the \"complex\" kind: a **nonempty** object or array.\n *\n * \"A nonempty object has at least one own key; a nonempty array has at least\n * one item, independently of whether its nested values are empty\" - so\n * `{ a: {} }` qualifies and `{}` does not.\n */\nexport const isComplexValue = (value: unknown): boolean => {\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n return (\n typeof value === 'object' &&\n value !== null &&\n Object.keys(value as object).length > 0\n );\n};\n\n/**\n * Whether the policy prompts for the values being discarded.\n *\n * Takes a list because \"for batches, one confirmation covers the operation;\n * complex applies if any discarded value qualifies\" - so a multi-row delete\n * asks once, and asks at all if any one row holds something complex.\n *\n * `complex` deliberately inspects **the old value, not the destination type**:\n * changing a populated object into a string prompts, and changing a string into\n * an object does not.\n */\nexport const confirmationRequired = (\n policy: ConfirmationPolicy,\n discarded: unknown[],\n): boolean => {\n if (policy === 'never') {\n return false;\n }\n if (policy === 'complex') {\n return discarded.some(isComplexValue);\n }\n return discarded.some(isDiscardableValue);\n};\n\n/**\n * The whole decision in one call, for a renderer that has a value in hand.\n */\nexport const shouldConfirm = (\n resolve: ResolveConfirmationOptions,\n discarded: unknown[],\n): boolean =>\n confirmationRequired(resolveConfirmationPolicy(resolve), discarded);\n\nexport interface ConfirmationRequest {\n operation: ConfirmationOperation;\n catalogId: ConfirmationCatalogId;\n discarded: unknown[];\n options?: Record<string, unknown>;\n config?: unknown;\n /** Rechecks current mutation guards when the user confirms. */\n perform: () => void;\n}\n"],"mappings":"A,mEAsDA,IAAMA,EAAiC,CAAC,SAAU,QAAS,SAAS,EAE9DC,EAAY,GAChBD,EAAS,SAASE,CAA2B,EACxCA,EACD,IAAA,GAYOC,GACX,EACA,IAECC,IAAc,SAAWC,IAAc,cACxCA,IAAc,SACV,UACA,SAEAC,EAAe,GAAyD,CAC5E,IAAMC,EAAAC,GAAA,KAAA,IAAA,GAAYA,EAChBC,kBAEIC,EAAAH,GAAA,KAAA,IAAA,GAAgBA,EACpBI,aAEF,OAAOD,GAAgB,OAAOA,GAAiB,SAC1CA,EACD,IAAA,EACN,EAsBaE,GAA6B,CACxC,UACA,SACA,YACA,eACoD,C,MACpD,IAAME,EAAAC,GAAA,KAAA,IAAA,GAAUA,EAAS,aACnBC,EAAcf,EAAAa,GAAA,KAAA,IAAA,GAASA,EAAUT,EAAU,EACjD,GAAIW,EACF,OAAOA,EAGT,IAAMC,EAAYX,EAAYE,CAAM,EAC9BU,EAAAD,GAAA,KAAA,IAAA,GAAYA,EAAW,UAa7B,OAVqBhB,EAAAiB,GAAA,OAAA,EAASA,EAAYd,KAAA,KAAA,IAAA,GAAAS,EAAaR,EACnD,GAIgBJ,EAAAgB,GAAA,KAAA,IAAA,GAASA,EAAW,OACpC,GAIGd,EAA2BC,EAAWC,CAAS,CACxD,EASac,EAAsB,GACjCjB,IAAU,IAAA,GASCkB,EAAkB,GACzB,MAAM,QAAQlB,CAAK,EACdA,EAAM,OAAS,EAGtB,OAAOA,GAAU,YACjBA,GACA,OAAO,KAAKA,CAAe,CAAC,CAAC,OAAS,EAe7BmB,GACX,EACA,IAEIC,IAAW,QACN,GAELA,IAAW,UACNC,EAAU,KAAKH,CAAc,EAE/BG,EAAU,KAAKJ,CAAkB,EAM7BK,GACX,EACA,IAEAH,EAAqBT,EAA0Ba,CAAO,EAAGF,CAAS,E"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * The shared destructive-change confirmation policy, with no React in it.
3
+ *
4
+ * Section 14 defines one policy for every renderer that discards data, so this
5
+ * module owns the whole of it: which policy applies, and whether that policy
6
+ * prompts for the values actually being discarded. The renderers only supply
7
+ * the values and act on the answer.
8
+ *
9
+ * Confirmation is **separate from permission**. It never bypasses `restrict`,
10
+ * readonly, disabled state or schema constraints, and it is not a second
11
+ * chance to do something the form already forbids.
12
+ */
13
+ export type ConfirmationPolicy = 'always' | 'never' | 'complex';
14
+ /**
15
+ * The operations the policy covers. Ordinary typing, navigation, adding a
16
+ * value and re-selecting the current type or branch are not among them.
17
+ */
18
+ export type ConfirmationOperation = 'typeChange' | 'branchChange' | 'delete';
19
+ /**
20
+ * The built-in catalog ids used by the base renderer families.
21
+ *
22
+ * Stable semantic identifiers, "not library component names" - so a host's
23
+ * configuration survives a renderer being rewritten or renamed.
24
+ *
25
+ * For an action hosted inside another renderer, the id is **the owner of the
26
+ * action**: a dynamic property's Delete is `additionalProperties` even though
27
+ * an object renderer draws it, and the mixed workspace's tree Delete is
28
+ * `mixed`.
29
+ */
30
+ export type BaseConfirmationCatalogId = 'compositeCell' | 'mixed' | 'oneOf' | 'arrayTable' | 'arrayLayout' | 'listWithDetail' | 'additionalProperties' | 'additionalItems';
31
+ /**
32
+ * Any stable catalog id, including those contributed by optional extensions.
33
+ *
34
+ * Section 14's list also names `agGrid`, which is **not** enumerated here: that
35
+ * renderer lives in the extended package, and this one must not know about
36
+ * anything downstream of it. The extended set passes its own id as a plain
37
+ * string; the `string & {}` keeps editor completion for the base ids listed
38
+ * above while leaving the vocabulary open.
39
+ */
40
+ export type ConfirmationCatalogId = BaseConfirmationCatalogId | (string & {});
41
+ /**
42
+ * The documented fallback, used when nothing configures the operation.
43
+ *
44
+ * Mixed type changes and all deletions fall back to `complex`; other operations fall back to
45
+ * `always`. Section 14 spells out the consequence: "the default configuration
46
+ * example deliberately opts into always globally while restoring complex for
47
+ * mixed type changes; without that exception a global always also applies to
48
+ * mixed type changes" - so a configured `default` really does replace this,
49
+ * rather than being merged with it.
50
+ */
51
+ export declare const fallbackConfirmationPolicy: (catalogId: ConfirmationCatalogId, operation: ConfirmationOperation) => ConfirmationPolicy;
52
+ export interface ResolveConfirmationOptions {
53
+ /** The element's `uischema.options`. */
54
+ options?: Record<string, unknown>;
55
+ /** The global JSON Forms `config`. */
56
+ config?: unknown;
57
+ catalogId: ConfirmationCatalogId;
58
+ operation: ConfirmationOperation;
59
+ }
60
+ /**
61
+ * Section 14's resolution order, exactly:
62
+ *
63
+ * 1. `options.confirmation[operation]`
64
+ * 2. `config.jsonformsExtended.confirmation.renderers[catalogId][operation]`
65
+ * 3. `config.jsonformsExtended.confirmation.default`
66
+ * 4. the documented fallback
67
+ *
68
+ * Unrecognized values are ignored rather than treated as `never`, so a typo
69
+ * cannot silently switch confirmation off.
70
+ */
71
+ export declare const resolveConfirmationPolicy: ({ options, config, catalogId, operation, }: ResolveConfirmationOptions) => ConfirmationPolicy;
72
+ /**
73
+ * Whether a value counts as something there is to discard.
74
+ *
75
+ * Section 14: "no prompt when there is no value to discard. False, zero, empty
76
+ * strings, and empty containers are existing values." Only absence is nothing -
77
+ * `null` is a value a user chose, and so is `{}`.
78
+ */
79
+ export declare const isDiscardableValue: (value: unknown) => boolean;
80
+ /**
81
+ * Whether a value is the "complex" kind: a **nonempty** object or array.
82
+ *
83
+ * "A nonempty object has at least one own key; a nonempty array has at least
84
+ * one item, independently of whether its nested values are empty" - so
85
+ * `{ a: {} }` qualifies and `{}` does not.
86
+ */
87
+ export declare const isComplexValue: (value: unknown) => boolean;
88
+ /**
89
+ * Whether the policy prompts for the values being discarded.
90
+ *
91
+ * Takes a list because "for batches, one confirmation covers the operation;
92
+ * complex applies if any discarded value qualifies" - so a multi-row delete
93
+ * asks once, and asks at all if any one row holds something complex.
94
+ *
95
+ * `complex` deliberately inspects **the old value, not the destination type**:
96
+ * changing a populated object into a string prompts, and changing a string into
97
+ * an object does not.
98
+ */
99
+ export declare const confirmationRequired: (policy: ConfirmationPolicy, discarded: unknown[]) => boolean;
100
+ /**
101
+ * The whole decision in one call, for a renderer that has a value in hand.
102
+ */
103
+ export declare const shouldConfirm: (resolve: ResolveConfirmationOptions, discarded: unknown[]) => boolean;
104
+ export interface ConfirmationRequest {
105
+ operation: ConfirmationOperation;
106
+ catalogId: ConfirmationCatalogId;
107
+ discarded: unknown[];
108
+ options?: Record<string, unknown>;
109
+ config?: unknown;
110
+ /** Rechecks current mutation guards when the user confirms. */
111
+ perform: () => void;
112
+ }
@@ -0,0 +1,18 @@
1
+ // src/interaction/confirmation.ts
2
+ var e = [
3
+ "always",
4
+ "never",
5
+ "complex"
6
+ ], t = (t) => e.includes(t) ? t : void 0, n = (e, t) => e === "mixed" && t === "typeChange" || t === "delete" ? "complex" : "always", r = (e) => {
7
+ let t = e == null ? void 0 : e.jsonformsExtended, n = t == null ? void 0 : t.confirmation;
8
+ return n && typeof n == "object" ? n : void 0;
9
+ }, i = ({ options: e, config: i, catalogId: a, operation: o }) => {
10
+ var s;
11
+ let c = e == null ? void 0 : e.confirmation, l = t(c == null ? void 0 : c[o]);
12
+ if (l) return l;
13
+ let u = r(i), d = u == null ? void 0 : u.renderers;
14
+ return t(d == null || (s = d[a]) == null ? void 0 : s[o]) || t(u == null ? void 0 : u.default) || n(a, o);
15
+ }, a = (e) => e !== void 0, o = (e) => Array.isArray(e) ? e.length > 0 : typeof e == "object" && !!e && Object.keys(e).length > 0, s = (e, t) => e === "never" ? !1 : e === "complex" ? t.some(o) : t.some(a), c = (e, t) => s(i(e), t);
16
+ export { s as confirmationRequired, n as fallbackConfirmationPolicy, o as isComplexValue, a as isDiscardableValue, i as resolveConfirmationPolicy, c as shouldConfirm };
17
+
18
+ //# sourceMappingURL=confirmation.esm.js.map