@nolwenture/formik-jsonschema-form 2.0.2 → 3.0.0-beta.1

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 (811) hide show
  1. package/README.md +18 -0
  2. package/dist/cjs/common/types/index.js +2 -0
  3. package/dist/cjs/index.js +15 -5
  4. package/dist/cjs/v3/codemod/bindings.js +124 -0
  5. package/dist/cjs/v3/codemod/cli.js +89 -0
  6. package/dist/cjs/v3/codemod/migrate.js +21 -0
  7. package/dist/cjs/v3/codemod/package.js +5 -0
  8. package/dist/cjs/v3/codemod/slots.js +27 -0
  9. package/dist/cjs/v3/codemod/transform.js +61 -0
  10. package/dist/cjs/v3/document/fromDocument.js +50 -0
  11. package/dist/cjs/v3/document/index.js +9 -0
  12. package/dist/cjs/v3/document/render.js +22 -0
  13. package/dist/cjs/v3/raw/compat/v2utils.js +39 -0
  14. package/dist/cjs/v3/raw/core/arrays.js +55 -0
  15. package/dist/cjs/v3/raw/core/choiceStyle.js +14 -0
  16. package/dist/cjs/v3/raw/core/conditionals.js +88 -0
  17. package/dist/cjs/v3/raw/core/dates.js +74 -0
  18. package/dist/cjs/v3/raw/core/defaults.js +31 -0
  19. package/dist/cjs/v3/raw/core/enums.js +37 -0
  20. package/dist/cjs/v3/raw/core/initialValues.js +68 -0
  21. package/dist/cjs/v3/raw/core/issues.js +42 -0
  22. package/dist/cjs/v3/raw/core/json.js +58 -0
  23. package/dist/cjs/v3/raw/core/merge.js +51 -0
  24. package/dist/cjs/v3/raw/core/paths.js +88 -0
  25. package/dist/cjs/v3/raw/core/policies/fileUploadView.js +4 -0
  26. package/dist/cjs/v3/raw/core/policies/optionalNumberInitial.js +7 -0
  27. package/dist/cjs/v3/raw/core/policies/storedFormats.js +5 -0
  28. package/dist/cjs/v3/raw/core/refs.js +104 -0
  29. package/dist/cjs/v3/raw/core/schemaType.js +75 -0
  30. package/dist/cjs/v3/raw/core/titles.js +30 -0
  31. package/dist/cjs/v3/raw/core/trail.js +18 -0
  32. package/dist/cjs/v3/raw/core/uiProps.js +72 -0
  33. package/dist/cjs/v3/raw/core/uiSchema.js +56 -0
  34. package/dist/cjs/v3/raw/dom/bind.js +84 -0
  35. package/dist/cjs/v3/raw/dom/build.js +27 -0
  36. package/dist/cjs/v3/raw/dom/controller.js +87 -0
  37. package/dist/cjs/v3/raw/dom/core.js +67 -0
  38. package/dist/cjs/v3/raw/dom/delegate.js +31 -0
  39. package/dist/cjs/v3/raw/dom/effects.js +67 -0
  40. package/dist/cjs/v3/raw/dom/elements.js +88 -0
  41. package/dist/cjs/v3/raw/dom/emitter.js +47 -0
  42. package/dist/cjs/v3/raw/dom/nodes.js +25 -0
  43. package/dist/cjs/v3/raw/dom/render.js +122 -0
  44. package/dist/cjs/v3/raw/dom/upload.js +186 -0
  45. package/dist/cjs/v3/raw/i18n/en.js +47 -0
  46. package/dist/cjs/v3/raw/i18n/fi.js +44 -0
  47. package/dist/cjs/v3/raw/i18n/index.js +14 -0
  48. package/dist/cjs/v3/raw/index.js +98 -0
  49. package/dist/cjs/v3/raw/model/classes.js +9 -0
  50. package/dist/cjs/v3/raw/model/form/actions.js +154 -0
  51. package/dist/cjs/v3/raw/model/form/any.js +27 -0
  52. package/dist/cjs/v3/raw/model/form/appearance.js +32 -0
  53. package/dist/cjs/v3/raw/model/form/array.js +69 -0
  54. package/dist/cjs/v3/raw/model/form/choice.js +74 -0
  55. package/dist/cjs/v3/raw/model/form/chrome.js +65 -0
  56. package/dist/cjs/v3/raw/model/form/componentTable.js +148 -0
  57. package/dist/cjs/v3/raw/model/form/date.js +53 -0
  58. package/dist/cjs/v3/raw/model/form/dispatch.js +119 -0
  59. package/dist/cjs/v3/raw/model/form/iconData.js +19 -0
  60. package/dist/cjs/v3/raw/model/form/icons.js +10 -0
  61. package/dist/cjs/v3/raw/model/form/index.js +43 -0
  62. package/dist/cjs/v3/raw/model/form/leaf.js +99 -0
  63. package/dist/cjs/v3/raw/model/form/markup.js +46 -0
  64. package/dist/cjs/v3/raw/model/form/object.js +105 -0
  65. package/dist/cjs/v3/raw/model/form/parts.js +26 -0
  66. package/dist/cjs/v3/raw/model/form/searchable.js +81 -0
  67. package/dist/cjs/v3/raw/model/form/templated.js +22 -0
  68. package/dist/cjs/v3/raw/model/form/upload.js +88 -0
  69. package/dist/cjs/v3/raw/model/styledChains.js +43 -0
  70. package/dist/cjs/v3/raw/model/view/build.js +165 -0
  71. package/dist/cjs/v3/raw/model/view/fields.js +102 -0
  72. package/dist/cjs/v3/raw/model/view/index.js +10 -0
  73. package/dist/cjs/v3/raw/model/view/markup.js +62 -0
  74. package/dist/cjs/v3/raw/model/view/toVNode.js +67 -0
  75. package/dist/cjs/v3/raw/model/view/values.js +58 -0
  76. package/dist/cjs/v3/raw/model/vnode.js +21 -0
  77. package/dist/cjs/v3/raw/sanitize/index.js +10 -0
  78. package/dist/cjs/v3/raw/sanitize/sanitizeHtml.js +128 -0
  79. package/dist/cjs/v3/raw/serialize/toDOM.js +150 -0
  80. package/dist/cjs/v3/raw/serialize/toString.js +58 -0
  81. package/dist/cjs/v3/raw/store/createStore.js +133 -0
  82. package/dist/cjs/v3/raw/styles/color.js +112 -0
  83. package/dist/cjs/v3/raw/styles/colorNames.js +30 -0
  84. package/dist/cjs/v3/raw/styles/defaultStyles.js +114 -0
  85. package/dist/cjs/v3/raw/styles/index.js +24 -0
  86. package/dist/cjs/v3/raw/styles/themeToCssVars.js +60 -0
  87. package/dist/cjs/v3/raw/styles/vars.js +28 -0
  88. package/dist/cjs/v3/raw/validation/arrays.js +78 -0
  89. package/dist/cjs/v3/raw/validation/conditions.js +63 -0
  90. package/dist/cjs/v3/raw/validation/index.js +182 -0
  91. package/dist/cjs/v3/raw/validation/keywords.js +113 -0
  92. package/dist/cjs/v3/raw/validation/messages.js +14 -0
  93. package/dist/cjs/v3/raw/validation/patterns.js +74 -0
  94. package/dist/cjs/v3/react/chain.js +7 -0
  95. package/dist/cjs/v3/react/compat.js +11 -0
  96. package/dist/cjs/v3/react/componentsProp.js +23 -0
  97. package/dist/cjs/v3/react/defined.js +6 -0
  98. package/dist/cjs/v3/react/ejs/EJSField.js +75 -0
  99. package/dist/cjs/v3/react/ejs/index.js +8 -0
  100. package/dist/cjs/v3/react/form/components.js +105 -0
  101. package/dist/cjs/v3/react/form/fields.js +75 -0
  102. package/dist/cjs/v3/react/form/host.js +100 -0
  103. package/dist/cjs/{Form/FormRegistry.js → v3/react/form/registry.js} +6 -7
  104. package/dist/cjs/v3/react/form/root.js +42 -0
  105. package/dist/cjs/v3/react/form/runtime.js +117 -0
  106. package/dist/cjs/v3/react/form/templates.js +58 -0
  107. package/dist/cjs/v3/react/form/upload.js +173 -0
  108. package/dist/cjs/v3/react/form/uploadContexts.js +27 -0
  109. package/dist/cjs/v3/react/form/useSetDefault.js +21 -0
  110. package/dist/cjs/v3/react/hostCore.js +59 -0
  111. package/dist/cjs/v3/react/index.js +45 -0
  112. package/dist/cjs/v3/react/selector.js +17 -0
  113. package/dist/cjs/v3/react/slots.js +19 -0
  114. package/dist/cjs/v3/react/toReact.js +63 -0
  115. package/dist/cjs/v3/react/view/components.js +63 -0
  116. package/dist/cjs/v3/react/view/fields.js +46 -0
  117. package/dist/cjs/v3/react/view/host.js +36 -0
  118. package/dist/cjs/v3/react/view/registry.js +20 -0
  119. package/dist/cjs/v3/react/view/root.js +37 -0
  120. package/dist/cjs/v3/react/view/templates.js +50 -0
  121. package/dist/esm/common/types/index.js +2 -0
  122. package/dist/esm/index.js +8 -5
  123. package/dist/esm/v3/document/fromDocument.js +46 -0
  124. package/dist/esm/v3/document/index.js +4 -0
  125. package/dist/esm/v3/document/render.js +18 -0
  126. package/dist/esm/v3/raw/compat/v2utils.js +15 -0
  127. package/dist/esm/v3/raw/core/arrays.js +49 -0
  128. package/dist/esm/v3/raw/core/choiceStyle.js +10 -0
  129. package/dist/esm/v3/raw/core/conditionals.js +82 -0
  130. package/dist/esm/v3/raw/core/dates.js +66 -0
  131. package/dist/esm/v3/raw/core/defaults.js +25 -0
  132. package/dist/esm/v3/raw/core/enums.js +32 -0
  133. package/dist/esm/v3/raw/core/initialValues.js +65 -0
  134. package/dist/esm/v3/raw/core/issues.js +36 -0
  135. package/dist/esm/v3/raw/core/json.js +49 -0
  136. package/dist/esm/v3/raw/core/merge.js +47 -0
  137. package/dist/esm/v3/raw/core/paths.js +79 -0
  138. package/dist/esm/v3/raw/core/policies/fileUploadView.js +1 -0
  139. package/dist/esm/v3/raw/core/policies/optionalNumberInitial.js +3 -0
  140. package/dist/esm/v3/raw/core/policies/storedFormats.js +2 -0
  141. package/dist/esm/v3/raw/core/refs.js +97 -0
  142. package/dist/esm/v3/raw/core/schemaType.js +68 -0
  143. package/dist/esm/v3/raw/core/titles.js +25 -0
  144. package/dist/esm/v3/raw/core/trail.js +14 -0
  145. package/dist/esm/v3/raw/core/uiProps.js +68 -0
  146. package/dist/esm/v3/raw/core/uiSchema.js +47 -0
  147. package/dist/esm/v3/raw/dom/bind.js +80 -0
  148. package/dist/esm/v3/raw/dom/build.js +23 -0
  149. package/dist/esm/v3/raw/dom/controller.js +83 -0
  150. package/dist/esm/v3/raw/dom/core.js +63 -0
  151. package/dist/esm/v3/raw/dom/delegate.js +25 -0
  152. package/dist/esm/v3/raw/dom/effects.js +62 -0
  153. package/dist/esm/v3/raw/dom/elements.js +84 -0
  154. package/dist/esm/v3/raw/dom/emitter.js +43 -0
  155. package/dist/esm/v3/raw/dom/nodes.js +20 -0
  156. package/dist/esm/v3/raw/dom/render.js +118 -0
  157. package/dist/esm/v3/raw/dom/upload.js +182 -0
  158. package/dist/esm/v3/raw/i18n/en.js +44 -0
  159. package/dist/esm/v3/raw/i18n/fi.js +41 -0
  160. package/dist/esm/v3/raw/i18n/index.js +9 -0
  161. package/dist/esm/v3/raw/index.js +33 -0
  162. package/dist/esm/v3/raw/model/classes.js +5 -0
  163. package/dist/esm/v3/raw/model/form/actions.js +150 -0
  164. package/dist/esm/v3/raw/model/form/any.js +23 -0
  165. package/dist/esm/v3/raw/model/form/appearance.js +27 -0
  166. package/dist/esm/v3/raw/model/form/array.js +65 -0
  167. package/dist/esm/v3/raw/model/form/choice.js +65 -0
  168. package/dist/esm/v3/raw/model/form/chrome.js +58 -0
  169. package/dist/esm/v3/raw/model/form/componentTable.js +145 -0
  170. package/dist/esm/v3/raw/model/form/date.js +48 -0
  171. package/dist/esm/v3/raw/model/form/dispatch.js +114 -0
  172. package/dist/esm/v3/raw/model/form/iconData.js +16 -0
  173. package/dist/esm/v3/raw/model/form/icons.js +6 -0
  174. package/dist/esm/v3/raw/model/form/index.js +32 -0
  175. package/dist/esm/v3/raw/model/form/leaf.js +89 -0
  176. package/dist/esm/v3/raw/model/form/markup.js +35 -0
  177. package/dist/esm/v3/raw/model/form/object.js +100 -0
  178. package/dist/esm/v3/raw/model/form/parts.js +21 -0
  179. package/dist/esm/v3/raw/model/form/searchable.js +76 -0
  180. package/dist/esm/v3/raw/model/form/templated.js +17 -0
  181. package/dist/esm/v3/raw/model/form/upload.js +81 -0
  182. package/dist/esm/v3/raw/model/styledChains.js +40 -0
  183. package/dist/esm/v3/raw/model/view/build.js +158 -0
  184. package/dist/esm/v3/raw/model/view/fields.js +90 -0
  185. package/dist/esm/v3/raw/model/view/index.js +6 -0
  186. package/dist/esm/v3/raw/model/view/markup.js +48 -0
  187. package/dist/esm/v3/raw/model/view/toVNode.js +63 -0
  188. package/dist/esm/v3/raw/model/view/values.js +50 -0
  189. package/dist/esm/v3/raw/model/vnode.js +13 -0
  190. package/dist/esm/v3/raw/sanitize/index.js +2 -0
  191. package/dist/esm/v3/raw/sanitize/sanitizeHtml.js +119 -0
  192. package/dist/esm/v3/raw/serialize/toDOM.js +145 -0
  193. package/dist/esm/v3/raw/serialize/toString.js +52 -0
  194. package/dist/esm/v3/raw/store/createStore.js +126 -0
  195. package/dist/esm/v3/raw/styles/color.js +104 -0
  196. package/dist/esm/v3/raw/styles/colorNames.js +27 -0
  197. package/dist/esm/v3/raw/styles/defaultStyles.js +111 -0
  198. package/dist/esm/v3/raw/styles/index.js +14 -0
  199. package/dist/esm/v3/raw/styles/themeToCssVars.js +55 -0
  200. package/dist/esm/v3/raw/styles/vars.js +24 -0
  201. package/dist/esm/v3/raw/validation/arrays.js +40 -0
  202. package/dist/esm/v3/raw/validation/conditions.js +60 -0
  203. package/dist/esm/v3/raw/validation/index.js +146 -0
  204. package/dist/esm/v3/raw/validation/keywords.js +73 -0
  205. package/dist/esm/v3/raw/validation/messages.js +10 -0
  206. package/dist/esm/v3/raw/validation/patterns.js +68 -0
  207. package/dist/esm/v3/react/chain.js +4 -0
  208. package/dist/esm/v3/react/compat.js +8 -0
  209. package/dist/esm/v3/react/componentsProp.js +18 -0
  210. package/dist/esm/v3/react/defined.js +2 -0
  211. package/dist/esm/v3/react/ejs/EJSField.js +67 -0
  212. package/dist/esm/v3/react/ejs/index.js +3 -0
  213. package/dist/esm/v3/react/form/components.js +101 -0
  214. package/dist/esm/v3/react/form/fields.js +70 -0
  215. package/dist/esm/v3/react/form/host.js +95 -0
  216. package/dist/esm/{Form/FormRegistry.js → v3/react/form/registry.js} +5 -3
  217. package/dist/esm/v3/react/form/root.js +38 -0
  218. package/dist/esm/v3/react/form/runtime.js +113 -0
  219. package/dist/esm/v3/react/form/templates.js +55 -0
  220. package/dist/esm/v3/react/form/upload.js +168 -0
  221. package/dist/esm/v3/react/form/uploadContexts.js +24 -0
  222. package/dist/esm/v3/react/form/useSetDefault.js +17 -0
  223. package/dist/esm/v3/react/hostCore.js +52 -0
  224. package/dist/esm/v3/react/index.js +18 -0
  225. package/dist/esm/v3/react/selector.js +13 -0
  226. package/dist/esm/v3/react/slots.js +15 -0
  227. package/dist/esm/v3/react/toReact.js +58 -0
  228. package/dist/esm/v3/react/view/components.js +59 -0
  229. package/dist/esm/v3/react/view/fields.js +43 -0
  230. package/dist/esm/v3/react/view/host.js +32 -0
  231. package/dist/esm/v3/react/view/registry.js +16 -0
  232. package/dist/esm/v3/react/view/root.js +33 -0
  233. package/dist/esm/v3/react/view/templates.js +47 -0
  234. package/dist/types/common/types/Form.d.ts +9 -32
  235. package/dist/types/common/types/Utils.d.ts +11 -0
  236. package/dist/types/common/types/index.d.ts +2 -0
  237. package/dist/types/index.d.ts +6 -4
  238. package/dist/types/v3/codemod/bindings.d.ts +18 -0
  239. package/dist/types/v3/codemod/cli.d.ts +2 -0
  240. package/dist/types/v3/codemod/migrate.d.ts +8 -0
  241. package/dist/types/v3/codemod/package.d.ts +2 -0
  242. package/dist/types/v3/codemod/slots.d.ts +13 -0
  243. package/dist/types/v3/codemod/transform.d.ts +29 -0
  244. package/dist/types/v3/document/fromDocument.d.ts +22 -0
  245. package/dist/types/v3/document/index.d.ts +4 -0
  246. package/dist/types/v3/document/render.d.ts +11 -0
  247. package/dist/types/v3/raw/compat/v2utils.d.ts +14 -0
  248. package/dist/types/v3/raw/core/arrays.d.ts +22 -0
  249. package/dist/types/v3/raw/core/choiceStyle.d.ts +4 -0
  250. package/dist/types/v3/raw/core/conditionals.d.ts +6 -0
  251. package/dist/types/v3/raw/core/dates.d.ts +8 -0
  252. package/dist/types/v3/raw/core/defaults.d.ts +15 -0
  253. package/dist/types/v3/raw/core/enums.d.ts +18 -0
  254. package/dist/types/v3/raw/core/initialValues.d.ts +12 -0
  255. package/dist/types/v3/raw/core/issues.d.ts +17 -0
  256. package/dist/types/v3/raw/core/json.d.ts +52 -0
  257. package/dist/types/v3/raw/core/merge.d.ts +6 -0
  258. package/dist/types/v3/raw/core/paths.d.ts +17 -0
  259. package/dist/types/v3/raw/core/policies/fileUploadView.d.ts +2 -0
  260. package/dist/types/v3/raw/core/policies/optionalNumberInitial.d.ts +4 -0
  261. package/dist/types/v3/raw/core/policies/storedFormats.d.ts +4 -0
  262. package/dist/types/v3/raw/core/refs.d.ts +41 -0
  263. package/dist/types/v3/raw/core/schemaType.d.ts +16 -0
  264. package/dist/types/v3/raw/core/titles.d.ts +2 -0
  265. package/dist/types/v3/raw/core/trail.d.ts +5 -0
  266. package/dist/types/v3/raw/core/uiProps.d.ts +12 -0
  267. package/dist/types/v3/raw/core/uiSchema.d.ts +19 -0
  268. package/dist/types/v3/raw/dom/bind.d.ts +2 -0
  269. package/dist/types/v3/raw/dom/build.d.ts +10 -0
  270. package/dist/types/v3/raw/dom/controller.d.ts +37 -0
  271. package/dist/types/v3/raw/dom/core.d.ts +43 -0
  272. package/dist/types/v3/raw/dom/delegate.d.ts +18 -0
  273. package/dist/types/v3/raw/dom/effects.d.ts +18 -0
  274. package/dist/types/v3/raw/dom/elements.d.ts +17 -0
  275. package/dist/types/v3/raw/dom/emitter.d.ts +8 -0
  276. package/dist/types/v3/raw/dom/nodes.d.ts +3 -0
  277. package/dist/types/v3/raw/dom/render.d.ts +2 -0
  278. package/dist/types/v3/raw/dom/types.d.ts +112 -0
  279. package/dist/types/v3/raw/dom/upload.d.ts +16 -0
  280. package/dist/types/v3/raw/i18n/en.d.ts +42 -0
  281. package/dist/types/v3/raw/i18n/fi.d.ts +2 -0
  282. package/dist/types/v3/raw/i18n/index.d.ts +9 -0
  283. package/dist/types/v3/raw/index.d.ts +43 -0
  284. package/dist/types/v3/raw/model/classes.d.ts +2 -0
  285. package/dist/types/v3/raw/model/form/actions.d.ts +41 -0
  286. package/dist/types/v3/raw/model/form/any.d.ts +5 -0
  287. package/dist/types/v3/raw/model/form/appearance.d.ts +9 -0
  288. package/dist/types/v3/raw/model/form/array.d.ts +4 -0
  289. package/dist/types/v3/raw/model/form/choice.d.ts +16 -0
  290. package/dist/types/v3/raw/model/form/chrome.d.ts +20 -0
  291. package/dist/types/v3/raw/model/form/componentTable.d.ts +2 -0
  292. package/dist/types/v3/raw/model/form/date.d.ts +13 -0
  293. package/dist/types/v3/raw/model/form/dispatch.d.ts +13 -0
  294. package/dist/types/v3/raw/model/form/iconData.d.ts +4 -0
  295. package/dist/types/v3/raw/model/form/icons.d.ts +2 -0
  296. package/dist/types/v3/raw/model/form/index.d.ts +38 -0
  297. package/dist/types/v3/raw/model/form/leaf.d.ts +29 -0
  298. package/dist/types/v3/raw/model/form/markup.d.ts +39 -0
  299. package/dist/types/v3/raw/model/form/object.d.ts +9 -0
  300. package/dist/types/v3/raw/model/form/parts.d.ts +10 -0
  301. package/dist/types/v3/raw/model/form/searchable.d.ts +5 -0
  302. package/dist/types/v3/raw/model/form/templated.d.ts +14 -0
  303. package/dist/types/v3/raw/model/form/types.d.ts +179 -0
  304. package/dist/types/v3/raw/model/form/upload.d.ts +28 -0
  305. package/dist/types/v3/raw/model/host.d.ts +46 -0
  306. package/dist/types/v3/raw/model/styledChains.d.ts +1 -0
  307. package/dist/types/v3/raw/model/view/build.d.ts +21 -0
  308. package/dist/types/v3/raw/model/view/fields.d.ts +31 -0
  309. package/dist/types/v3/raw/model/view/index.d.ts +6 -0
  310. package/dist/types/v3/raw/model/view/markup.d.ts +39 -0
  311. package/dist/types/v3/raw/model/view/toVNode.d.ts +3 -0
  312. package/dist/types/v3/raw/model/view/types.d.ts +109 -0
  313. package/dist/types/v3/raw/model/view/values.d.ts +10 -0
  314. package/dist/types/v3/raw/model/vnode.d.ts +24 -0
  315. package/dist/types/v3/raw/sanitize/index.d.ts +2 -0
  316. package/dist/types/v3/raw/sanitize/sanitizeHtml.d.ts +30 -0
  317. package/dist/types/v3/raw/serialize/toDOM.d.ts +14 -0
  318. package/dist/types/v3/raw/serialize/toString.d.ts +4 -0
  319. package/dist/types/v3/raw/store/createStore.d.ts +39 -0
  320. package/dist/types/v3/raw/styles/color.d.ts +15 -0
  321. package/dist/types/v3/raw/styles/colorNames.d.ts +1 -0
  322. package/dist/types/v3/raw/styles/defaultStyles.d.ts +1 -0
  323. package/dist/types/v3/raw/styles/index.d.ts +8 -0
  324. package/dist/types/v3/raw/styles/themeToCssVars.d.ts +4 -0
  325. package/dist/types/v3/raw/styles/vars.d.ts +43 -0
  326. package/dist/types/v3/raw/validation/arrays.d.ts +16 -0
  327. package/dist/types/v3/raw/validation/conditions.d.ts +10 -0
  328. package/dist/types/v3/raw/validation/index.d.ts +30 -0
  329. package/dist/types/v3/raw/validation/keywords.d.ts +10 -0
  330. package/dist/types/v3/raw/validation/messages.d.ts +8 -0
  331. package/dist/types/v3/raw/validation/patterns.d.ts +8 -0
  332. package/dist/types/v3/react/chain.d.ts +1 -0
  333. package/dist/types/v3/react/compat.d.ts +4 -0
  334. package/dist/types/v3/react/componentsProp.d.ts +5 -0
  335. package/dist/types/v3/react/defined.d.ts +1 -0
  336. package/dist/types/v3/react/ejs/EJSField.d.ts +14 -0
  337. package/dist/types/v3/react/ejs/index.d.ts +1 -0
  338. package/dist/types/v3/react/form/components.d.ts +3 -0
  339. package/dist/types/v3/react/form/fields.d.ts +8 -0
  340. package/dist/types/v3/react/form/host.d.ts +9 -0
  341. package/dist/types/v3/react/form/registry.d.ts +46 -0
  342. package/dist/types/v3/react/form/root.d.ts +32 -0
  343. package/dist/types/v3/react/form/runtime.d.ts +3 -0
  344. package/dist/types/v3/react/form/templates.d.ts +1 -0
  345. package/dist/types/v3/react/form/upload.d.ts +3 -0
  346. package/dist/types/v3/react/form/uploadContexts.d.ts +34 -0
  347. package/dist/types/v3/react/form/useSetDefault.d.ts +5 -0
  348. package/dist/types/v3/react/hostCore.d.ts +24 -0
  349. package/dist/types/v3/react/index.d.ts +23 -0
  350. package/dist/types/v3/react/selector.d.ts +10 -0
  351. package/dist/types/v3/react/slots.d.ts +4 -0
  352. package/dist/types/v3/react/toReact.d.ts +10 -0
  353. package/dist/types/v3/react/view/components.d.ts +8 -0
  354. package/dist/types/v3/react/view/fields.d.ts +4 -0
  355. package/dist/types/v3/react/view/host.d.ts +6 -0
  356. package/dist/types/v3/react/view/registry.d.ts +34 -0
  357. package/dist/types/v3/react/view/root.d.ts +32 -0
  358. package/dist/types/v3/react/view/templates.d.ts +15 -0
  359. package/package.json +97 -11
  360. package/styles.css +187 -0
  361. package/dist/cjs/Form/Form.js +0 -38
  362. package/dist/cjs/Form/components/Clickable.js +0 -11
  363. package/dist/cjs/Form/components/ErrorMessage.js +0 -23
  364. package/dist/cjs/Form/components/FieldInfo.js +0 -144
  365. package/dist/cjs/Form/components/FieldInput.js +0 -86
  366. package/dist/cjs/Form/components/Form.js +0 -52
  367. package/dist/cjs/Form/components/Icon.js +0 -5
  368. package/dist/cjs/Form/components/RequiredIndicator.js +0 -9
  369. package/dist/cjs/Form/components/index.js +0 -58
  370. package/dist/cjs/Form/fields/AnyField/AnyField.js +0 -30
  371. package/dist/cjs/Form/fields/AnyField/index.js +0 -38
  372. package/dist/cjs/Form/fields/AnyField/styledComponents.js +0 -6
  373. package/dist/cjs/Form/fields/ArrayField/ArrayField.js +0 -130
  374. package/dist/cjs/Form/fields/ArrayField/index.js +0 -38
  375. package/dist/cjs/Form/fields/ArrayField/styledComponents.js +0 -22
  376. package/dist/cjs/Form/fields/BooleanField/BooleanField.js +0 -26
  377. package/dist/cjs/Form/fields/BooleanField/index.js +0 -38
  378. package/dist/cjs/Form/fields/BooleanField/styledComponents.js +0 -18
  379. package/dist/cjs/Form/fields/DateField/DateField.js +0 -26
  380. package/dist/cjs/Form/fields/DateField/DateInput.js +0 -121
  381. package/dist/cjs/Form/fields/DateField/dateParsing.js +0 -68
  382. package/dist/cjs/Form/fields/DateField/index.js +0 -42
  383. package/dist/cjs/Form/fields/DateField/styledComponents.js +0 -60
  384. package/dist/cjs/Form/fields/FileUploadField/FileUploadField.js +0 -69
  385. package/dist/cjs/Form/fields/FileUploadField/FileUploadFieldInput.js +0 -21
  386. package/dist/cjs/Form/fields/FileUploadField/index.js +0 -41
  387. package/dist/cjs/Form/fields/FileUploadField/styledComponents.js +0 -63
  388. package/dist/cjs/Form/fields/FilesUploadField/FilesUploadField.js +0 -102
  389. package/dist/cjs/Form/fields/FilesUploadField/FilesUploadFieldInput.js +0 -174
  390. package/dist/cjs/Form/fields/FilesUploadField/index.js +0 -41
  391. package/dist/cjs/Form/fields/FilesUploadField/styledComponents.js +0 -217
  392. package/dist/cjs/Form/fields/MultipleChoiceField/MultipleChoiceField.js +0 -35
  393. package/dist/cjs/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.js +0 -40
  394. package/dist/cjs/Form/fields/MultipleChoiceField/index.js +0 -41
  395. package/dist/cjs/Form/fields/MultipleChoiceField/styledComponents.js +0 -24
  396. package/dist/cjs/Form/fields/NullField/NullField.js +0 -15
  397. package/dist/cjs/Form/fields/NullField/index.js +0 -37
  398. package/dist/cjs/Form/fields/NumberField/NumberField.js +0 -16
  399. package/dist/cjs/Form/fields/NumberField/index.js +0 -38
  400. package/dist/cjs/Form/fields/NumberField/styledComponents.js +0 -6
  401. package/dist/cjs/Form/fields/ObjectField/ObjectField.js +0 -190
  402. package/dist/cjs/Form/fields/ObjectField/ObjectFieldSection.js +0 -17
  403. package/dist/cjs/Form/fields/ObjectField/index.js +0 -41
  404. package/dist/cjs/Form/fields/ObjectField/styledComponents.js +0 -50
  405. package/dist/cjs/Form/fields/ObjectField/types.js +0 -10
  406. package/dist/cjs/Form/fields/RadioField/RadioField.js +0 -19
  407. package/dist/cjs/Form/fields/RadioField/RadioFieldInput.js +0 -11
  408. package/dist/cjs/Form/fields/RadioField/index.js +0 -41
  409. package/dist/cjs/Form/fields/RadioField/styledComponents.js +0 -78
  410. package/dist/cjs/Form/fields/SchemaField/SchemaField.js +0 -38
  411. package/dist/cjs/Form/fields/SchemaField/index.js +0 -37
  412. package/dist/cjs/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.js +0 -20
  413. package/dist/cjs/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.js +0 -27
  414. package/dist/cjs/Form/fields/SearchableMultiTagSelectField/index.js +0 -41
  415. package/dist/cjs/Form/fields/SearchableMultiTagSelectField/styledComponents.js +0 -71
  416. package/dist/cjs/Form/fields/SearchableSelectField/SearchableSelectField.js +0 -147
  417. package/dist/cjs/Form/fields/SearchableSelectField/index.js +0 -40
  418. package/dist/cjs/Form/fields/SearchableSelectField/styledComponents.js +0 -53
  419. package/dist/cjs/Form/fields/StringField/StringField.js +0 -44
  420. package/dist/cjs/Form/fields/StringField/index.js +0 -37
  421. package/dist/cjs/Form/fields/StringField/styledComponents.js +0 -6
  422. package/dist/cjs/Form/fields/TextAreaField/TextAreaField.js +0 -21
  423. package/dist/cjs/Form/fields/TextAreaField/index.js +0 -38
  424. package/dist/cjs/Form/fields/TextAreaField/styledComponents.js +0 -17
  425. package/dist/cjs/Form/fields/ToggleField/ToggleField.js +0 -19
  426. package/dist/cjs/Form/fields/ToggleField/ToggleFieldInput.js +0 -11
  427. package/dist/cjs/Form/fields/ToggleField/index.js +0 -41
  428. package/dist/cjs/Form/fields/ToggleField/styledComponents.js +0 -58
  429. package/dist/cjs/Form/fields/index.js +0 -93
  430. package/dist/cjs/Form/hooks/index.js +0 -17
  431. package/dist/cjs/Form/hooks/useSetDefault.js +0 -32
  432. package/dist/cjs/Form/index.js +0 -26
  433. package/dist/cjs/Form/styles/common.js +0 -259
  434. package/dist/cjs/Form/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -36
  435. package/dist/cjs/Form/templates/ArrayFieldTemplate/index.js +0 -38
  436. package/dist/cjs/Form/templates/ArrayFieldTemplate/styledComponents.js +0 -28
  437. package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +0 -41
  438. package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/index.js +0 -38
  439. package/dist/cjs/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.js +0 -55
  440. package/dist/cjs/Form/templates/FieldTemplate/FieldTemplate.js +0 -28
  441. package/dist/cjs/Form/templates/FieldTemplate/index.js +0 -37
  442. package/dist/cjs/Form/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -32
  443. package/dist/cjs/Form/templates/ObjectFieldTemplate/index.js +0 -38
  444. package/dist/cjs/Form/templates/ObjectFieldTemplate/styledComponents.js +0 -57
  445. package/dist/cjs/Form/templates/index.js +0 -55
  446. package/dist/cjs/Form/types/index.js +0 -17
  447. package/dist/cjs/FormView/FormView.js +0 -36
  448. package/dist/cjs/FormView/FormViewRegistry.js +0 -19
  449. package/dist/cjs/FormView/components/Field.js +0 -131
  450. package/dist/cjs/FormView/components/Form.js +0 -9
  451. package/dist/cjs/FormView/components/Icon.js +0 -7
  452. package/dist/cjs/FormView/components/index.js +0 -56
  453. package/dist/cjs/FormView/fields/AnyField.js +0 -26
  454. package/dist/cjs/FormView/fields/ArrayField.js +0 -32
  455. package/dist/cjs/FormView/fields/BooleanField.js +0 -33
  456. package/dist/cjs/FormView/fields/DateField.js +0 -12
  457. package/dist/cjs/FormView/fields/EJSField.js +0 -39
  458. package/dist/cjs/FormView/fields/FileUploadField.js +0 -7
  459. package/dist/cjs/FormView/fields/FilesUploadField.js +0 -7
  460. package/dist/cjs/FormView/fields/MultipleChoiceField.js +0 -30
  461. package/dist/cjs/FormView/fields/NullField.js +0 -14
  462. package/dist/cjs/FormView/fields/NumberField.js +0 -12
  463. package/dist/cjs/FormView/fields/ObjectField/ObjectField.js +0 -57
  464. package/dist/cjs/FormView/fields/ObjectField/ObjectFieldSection.js +0 -11
  465. package/dist/cjs/FormView/fields/ObjectField/index.js +0 -41
  466. package/dist/cjs/FormView/fields/ObjectField/styledComponents.js +0 -6
  467. package/dist/cjs/FormView/fields/RadioField.js +0 -15
  468. package/dist/cjs/FormView/fields/SchemaField.js +0 -38
  469. package/dist/cjs/FormView/fields/SearchableMultiTagSelectField.js +0 -14
  470. package/dist/cjs/FormView/fields/SearchableSelectField.js +0 -13
  471. package/dist/cjs/FormView/fields/StringField.js +0 -24
  472. package/dist/cjs/FormView/fields/TextAreaField.js +0 -18
  473. package/dist/cjs/FormView/fields/ToggleField.js +0 -15
  474. package/dist/cjs/FormView/fields/index.js +0 -81
  475. package/dist/cjs/FormView/index.js +0 -25
  476. package/dist/cjs/FormView/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -20
  477. package/dist/cjs/FormView/templates/ArrayFieldTemplate/index.js +0 -38
  478. package/dist/cjs/FormView/templates/ArrayFieldTemplate/styledComponents.js +0 -15
  479. package/dist/cjs/FormView/templates/FieldTemplate/FieldTemplate.js +0 -18
  480. package/dist/cjs/FormView/templates/FieldTemplate/index.js +0 -37
  481. package/dist/cjs/FormView/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -30
  482. package/dist/cjs/FormView/templates/ObjectFieldTemplate/index.js +0 -38
  483. package/dist/cjs/FormView/templates/ObjectFieldTemplate/styledComponents.js +0 -65
  484. package/dist/cjs/FormView/templates/index.js +0 -52
  485. package/dist/cjs/common/FileUploadContext.js +0 -15
  486. package/dist/cjs/common/FilesUploadContext.js +0 -14
  487. package/dist/cjs/common/constants.js +0 -13
  488. package/dist/cjs/common/index.js +0 -20
  489. package/dist/cjs/utils/createInitialValues.js +0 -38
  490. package/dist/cjs/utils/createValidationSchema.js +0 -397
  491. package/dist/cjs/utils/deepOverlap.js +0 -18
  492. package/dist/cjs/utils/extractUiSchema.js +0 -22
  493. package/dist/cjs/utils/getEnums.js +0 -56
  494. package/dist/cjs/utils/getHiddenProperties.js +0 -11
  495. package/dist/cjs/utils/getStyle.js +0 -21
  496. package/dist/cjs/utils/getTitleAndDescription.js +0 -19
  497. package/dist/cjs/utils/getTypes.js +0 -60
  498. package/dist/cjs/utils/immutablySwapItems.js +0 -10
  499. package/dist/cjs/utils/index.js +0 -31
  500. package/dist/cjs/utils/mergeSchemas.js +0 -30
  501. package/dist/cjs/utils/orderAdditionalProperties.js +0 -12
  502. package/dist/cjs/utils/orderByUiSchema.js +0 -29
  503. package/dist/cjs/utils/resolveSchema.js +0 -117
  504. package/dist/cjs/utils/setTitleValues.js +0 -25
  505. package/dist/cjs/utils/solveReferences.js +0 -25
  506. package/dist/esm/Form/Form.js +0 -34
  507. package/dist/esm/Form/components/Clickable.js +0 -7
  508. package/dist/esm/Form/components/ErrorMessage.js +0 -16
  509. package/dist/esm/Form/components/FieldInfo.js +0 -140
  510. package/dist/esm/Form/components/FieldInput.js +0 -50
  511. package/dist/esm/Form/components/Form.js +0 -13
  512. package/dist/esm/Form/components/Icon.js +0 -2
  513. package/dist/esm/Form/components/RequiredIndicator.js +0 -6
  514. package/dist/esm/Form/components/index.js +0 -22
  515. package/dist/esm/Form/fields/AnyField/AnyField.js +0 -26
  516. package/dist/esm/Form/fields/AnyField/index.js +0 -2
  517. package/dist/esm/Form/fields/AnyField/styledComponents.js +0 -3
  518. package/dist/esm/Form/fields/ArrayField/ArrayField.js +0 -126
  519. package/dist/esm/Form/fields/ArrayField/index.js +0 -2
  520. package/dist/esm/Form/fields/ArrayField/styledComponents.js +0 -16
  521. package/dist/esm/Form/fields/BooleanField/BooleanField.js +0 -22
  522. package/dist/esm/Form/fields/BooleanField/index.js +0 -2
  523. package/dist/esm/Form/fields/BooleanField/styledComponents.js +0 -15
  524. package/dist/esm/Form/fields/DateField/DateField.js +0 -22
  525. package/dist/esm/Form/fields/DateField/DateInput.js +0 -117
  526. package/dist/esm/Form/fields/DateField/dateParsing.js +0 -62
  527. package/dist/esm/Form/fields/DateField/index.js +0 -3
  528. package/dist/esm/Form/fields/DateField/styledComponents.js +0 -54
  529. package/dist/esm/Form/fields/FileUploadField/FileUploadField.js +0 -65
  530. package/dist/esm/Form/fields/FileUploadField/FileUploadFieldInput.js +0 -17
  531. package/dist/esm/Form/fields/FileUploadField/index.js +0 -5
  532. package/dist/esm/Form/fields/FileUploadField/styledComponents.js +0 -57
  533. package/dist/esm/Form/fields/FilesUploadField/FilesUploadField.js +0 -98
  534. package/dist/esm/Form/fields/FilesUploadField/FilesUploadFieldInput.js +0 -137
  535. package/dist/esm/Form/fields/FilesUploadField/index.js +0 -5
  536. package/dist/esm/Form/fields/FilesUploadField/styledComponents.js +0 -211
  537. package/dist/esm/Form/fields/MultipleChoiceField/MultipleChoiceField.js +0 -31
  538. package/dist/esm/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.js +0 -36
  539. package/dist/esm/Form/fields/MultipleChoiceField/index.js +0 -5
  540. package/dist/esm/Form/fields/MultipleChoiceField/styledComponents.js +0 -18
  541. package/dist/esm/Form/fields/NullField/NullField.js +0 -11
  542. package/dist/esm/Form/fields/NullField/index.js +0 -1
  543. package/dist/esm/Form/fields/NumberField/NumberField.js +0 -12
  544. package/dist/esm/Form/fields/NumberField/index.js +0 -2
  545. package/dist/esm/Form/fields/NumberField/styledComponents.js +0 -3
  546. package/dist/esm/Form/fields/ObjectField/ObjectField.js +0 -186
  547. package/dist/esm/Form/fields/ObjectField/ObjectFieldSection.js +0 -13
  548. package/dist/esm/Form/fields/ObjectField/index.js +0 -5
  549. package/dist/esm/Form/fields/ObjectField/styledComponents.js +0 -47
  550. package/dist/esm/Form/fields/ObjectField/types.js +0 -7
  551. package/dist/esm/Form/fields/RadioField/RadioField.js +0 -15
  552. package/dist/esm/Form/fields/RadioField/RadioFieldInput.js +0 -7
  553. package/dist/esm/Form/fields/RadioField/index.js +0 -5
  554. package/dist/esm/Form/fields/RadioField/styledComponents.js +0 -75
  555. package/dist/esm/Form/fields/SchemaField/SchemaField.js +0 -34
  556. package/dist/esm/Form/fields/SchemaField/index.js +0 -1
  557. package/dist/esm/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.js +0 -16
  558. package/dist/esm/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.js +0 -23
  559. package/dist/esm/Form/fields/SearchableMultiTagSelectField/index.js +0 -5
  560. package/dist/esm/Form/fields/SearchableMultiTagSelectField/styledComponents.js +0 -68
  561. package/dist/esm/Form/fields/SearchableSelectField/SearchableSelectField.js +0 -143
  562. package/dist/esm/Form/fields/SearchableSelectField/index.js +0 -4
  563. package/dist/esm/Form/fields/SearchableSelectField/styledComponents.js +0 -50
  564. package/dist/esm/Form/fields/StringField/StringField.js +0 -40
  565. package/dist/esm/Form/fields/StringField/index.js +0 -1
  566. package/dist/esm/Form/fields/StringField/styledComponents.js +0 -3
  567. package/dist/esm/Form/fields/TextAreaField/TextAreaField.js +0 -17
  568. package/dist/esm/Form/fields/TextAreaField/index.js +0 -2
  569. package/dist/esm/Form/fields/TextAreaField/styledComponents.js +0 -11
  570. package/dist/esm/Form/fields/ToggleField/ToggleField.js +0 -15
  571. package/dist/esm/Form/fields/ToggleField/ToggleFieldInput.js +0 -7
  572. package/dist/esm/Form/fields/ToggleField/index.js +0 -5
  573. package/dist/esm/Form/fields/ToggleField/styledComponents.js +0 -55
  574. package/dist/esm/Form/fields/index.js +0 -57
  575. package/dist/esm/Form/hooks/index.js +0 -1
  576. package/dist/esm/Form/hooks/useSetDefault.js +0 -28
  577. package/dist/esm/Form/index.js +0 -7
  578. package/dist/esm/Form/styles/common.js +0 -256
  579. package/dist/esm/Form/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -32
  580. package/dist/esm/Form/templates/ArrayFieldTemplate/index.js +0 -2
  581. package/dist/esm/Form/templates/ArrayFieldTemplate/styledComponents.js +0 -24
  582. package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.js +0 -37
  583. package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/index.js +0 -2
  584. package/dist/esm/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.js +0 -51
  585. package/dist/esm/Form/templates/FieldTemplate/FieldTemplate.js +0 -24
  586. package/dist/esm/Form/templates/FieldTemplate/index.js +0 -1
  587. package/dist/esm/Form/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -28
  588. package/dist/esm/Form/templates/ObjectFieldTemplate/index.js +0 -2
  589. package/dist/esm/Form/templates/ObjectFieldTemplate/styledComponents.js +0 -53
  590. package/dist/esm/Form/templates/index.js +0 -19
  591. package/dist/esm/Form/types/index.js +0 -1
  592. package/dist/esm/FormView/FormView.js +0 -29
  593. package/dist/esm/FormView/FormViewRegistry.js +0 -13
  594. package/dist/esm/FormView/components/Field.js +0 -123
  595. package/dist/esm/FormView/components/Form.js +0 -6
  596. package/dist/esm/FormView/components/Icon.js +0 -4
  597. package/dist/esm/FormView/components/index.js +0 -17
  598. package/dist/esm/FormView/fields/AnyField.js +0 -22
  599. package/dist/esm/FormView/fields/ArrayField.js +0 -28
  600. package/dist/esm/FormView/fields/BooleanField.js +0 -29
  601. package/dist/esm/FormView/fields/DateField.js +0 -8
  602. package/dist/esm/FormView/fields/EJSField.js +0 -32
  603. package/dist/esm/FormView/fields/FileUploadField.js +0 -3
  604. package/dist/esm/FormView/fields/FilesUploadField.js +0 -3
  605. package/dist/esm/FormView/fields/MultipleChoiceField.js +0 -26
  606. package/dist/esm/FormView/fields/NullField.js +0 -10
  607. package/dist/esm/FormView/fields/NumberField.js +0 -8
  608. package/dist/esm/FormView/fields/ObjectField/ObjectField.js +0 -53
  609. package/dist/esm/FormView/fields/ObjectField/ObjectFieldSection.js +0 -7
  610. package/dist/esm/FormView/fields/ObjectField/index.js +0 -5
  611. package/dist/esm/FormView/fields/ObjectField/styledComponents.js +0 -3
  612. package/dist/esm/FormView/fields/RadioField.js +0 -11
  613. package/dist/esm/FormView/fields/SchemaField.js +0 -34
  614. package/dist/esm/FormView/fields/SearchableMultiTagSelectField.js +0 -10
  615. package/dist/esm/FormView/fields/SearchableSelectField.js +0 -9
  616. package/dist/esm/FormView/fields/StringField.js +0 -20
  617. package/dist/esm/FormView/fields/TextAreaField.js +0 -14
  618. package/dist/esm/FormView/fields/ToggleField.js +0 -11
  619. package/dist/esm/FormView/fields/index.js +0 -45
  620. package/dist/esm/FormView/index.js +0 -6
  621. package/dist/esm/FormView/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +0 -16
  622. package/dist/esm/FormView/templates/ArrayFieldTemplate/index.js +0 -2
  623. package/dist/esm/FormView/templates/ArrayFieldTemplate/styledComponents.js +0 -11
  624. package/dist/esm/FormView/templates/FieldTemplate/FieldTemplate.js +0 -14
  625. package/dist/esm/FormView/templates/FieldTemplate/index.js +0 -1
  626. package/dist/esm/FormView/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +0 -26
  627. package/dist/esm/FormView/templates/ObjectFieldTemplate/index.js +0 -2
  628. package/dist/esm/FormView/templates/ObjectFieldTemplate/styledComponents.js +0 -58
  629. package/dist/esm/FormView/templates/index.js +0 -16
  630. package/dist/esm/common/FileUploadContext.js +0 -12
  631. package/dist/esm/common/FilesUploadContext.js +0 -11
  632. package/dist/esm/common/constants.js +0 -10
  633. package/dist/esm/common/index.js +0 -4
  634. package/dist/esm/utils/createInitialValues.js +0 -35
  635. package/dist/esm/utils/createValidationSchema.js +0 -361
  636. package/dist/esm/utils/deepOverlap.js +0 -14
  637. package/dist/esm/utils/extractUiSchema.js +0 -18
  638. package/dist/esm/utils/getEnums.js +0 -51
  639. package/dist/esm/utils/getHiddenProperties.js +0 -7
  640. package/dist/esm/utils/getStyle.js +0 -18
  641. package/dist/esm/utils/getTitleAndDescription.js +0 -14
  642. package/dist/esm/utils/getTypes.js +0 -53
  643. package/dist/esm/utils/immutablySwapItems.js +0 -7
  644. package/dist/esm/utils/index.js +0 -15
  645. package/dist/esm/utils/mergeSchemas.js +0 -26
  646. package/dist/esm/utils/orderAdditionalProperties.js +0 -9
  647. package/dist/esm/utils/orderByUiSchema.js +0 -26
  648. package/dist/esm/utils/resolveSchema.js +0 -112
  649. package/dist/esm/utils/setTitleValues.js +0 -21
  650. package/dist/esm/utils/solveReferences.js +0 -22
  651. package/dist/types/Form/Form.d.ts +0 -2
  652. package/dist/types/Form/FormRegistry.d.ts +0 -3
  653. package/dist/types/Form/components/Clickable.d.ts +0 -15
  654. package/dist/types/Form/components/ErrorMessage.d.ts +0 -3
  655. package/dist/types/Form/components/FieldInfo.d.ts +0 -10
  656. package/dist/types/Form/components/FieldInput.d.ts +0 -19
  657. package/dist/types/Form/components/Form.d.ts +0 -6
  658. package/dist/types/Form/components/Icon.d.ts +0 -1
  659. package/dist/types/Form/components/RequiredIndicator.d.ts +0 -1
  660. package/dist/types/Form/components/index.d.ts +0 -249
  661. package/dist/types/Form/fields/AnyField/AnyField.d.ts +0 -2
  662. package/dist/types/Form/fields/AnyField/index.d.ts +0 -2
  663. package/dist/types/Form/fields/AnyField/styledComponents.d.ts +0 -3
  664. package/dist/types/Form/fields/ArrayField/ArrayField.d.ts +0 -2
  665. package/dist/types/Form/fields/ArrayField/index.d.ts +0 -2
  666. package/dist/types/Form/fields/ArrayField/styledComponents.d.ts +0 -13
  667. package/dist/types/Form/fields/BooleanField/BooleanField.d.ts +0 -2
  668. package/dist/types/Form/fields/BooleanField/index.d.ts +0 -2
  669. package/dist/types/Form/fields/BooleanField/styledComponents.d.ts +0 -3
  670. package/dist/types/Form/fields/DateField/DateField.d.ts +0 -2
  671. package/dist/types/Form/fields/DateField/DateInput.d.ts +0 -17
  672. package/dist/types/Form/fields/DateField/dateParsing.d.ts +0 -9
  673. package/dist/types/Form/fields/DateField/index.d.ts +0 -3
  674. package/dist/types/Form/fields/DateField/styledComponents.d.ts +0 -4
  675. package/dist/types/Form/fields/FileUploadField/FileUploadField.d.ts +0 -2
  676. package/dist/types/Form/fields/FileUploadField/FileUploadFieldInput.d.ts +0 -25
  677. package/dist/types/Form/fields/FileUploadField/index.d.ts +0 -17
  678. package/dist/types/Form/fields/FileUploadField/styledComponents.d.ts +0 -11
  679. package/dist/types/Form/fields/FilesUploadField/FilesUploadField.d.ts +0 -2
  680. package/dist/types/Form/fields/FilesUploadField/FilesUploadFieldInput.d.ts +0 -42
  681. package/dist/types/Form/fields/FilesUploadField/index.d.ts +0 -37
  682. package/dist/types/Form/fields/FilesUploadField/styledComponents.d.ts +0 -32
  683. package/dist/types/Form/fields/MultipleChoiceField/MultipleChoiceField.d.ts +0 -2
  684. package/dist/types/Form/fields/MultipleChoiceField/MultipleChoiceFieldInput.d.ts +0 -17
  685. package/dist/types/Form/fields/MultipleChoiceField/index.d.ts +0 -22
  686. package/dist/types/Form/fields/MultipleChoiceField/styledComponents.d.ts +0 -16
  687. package/dist/types/Form/fields/NullField/NullField.d.ts +0 -2
  688. package/dist/types/Form/fields/NullField/index.d.ts +0 -1
  689. package/dist/types/Form/fields/NumberField/NumberField.d.ts +0 -2
  690. package/dist/types/Form/fields/NumberField/index.d.ts +0 -2
  691. package/dist/types/Form/fields/NumberField/styledComponents.d.ts +0 -1
  692. package/dist/types/Form/fields/ObjectField/ObjectField.d.ts +0 -2
  693. package/dist/types/Form/fields/ObjectField/ObjectFieldSection.d.ts +0 -3
  694. package/dist/types/Form/fields/ObjectField/index.d.ts +0 -20
  695. package/dist/types/Form/fields/ObjectField/styledComponents.d.ts +0 -15
  696. package/dist/types/Form/fields/ObjectField/types.d.ts +0 -19
  697. package/dist/types/Form/fields/RadioField/RadioField.d.ts +0 -2
  698. package/dist/types/Form/fields/RadioField/RadioFieldInput.d.ts +0 -11
  699. package/dist/types/Form/fields/RadioField/index.d.ts +0 -22
  700. package/dist/types/Form/fields/RadioField/styledComponents.d.ts +0 -16
  701. package/dist/types/Form/fields/SchemaField/SchemaField.d.ts +0 -2
  702. package/dist/types/Form/fields/SchemaField/index.d.ts +0 -1
  703. package/dist/types/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectField.d.ts +0 -2
  704. package/dist/types/Form/fields/SearchableMultiTagSelectField/SearchableMultiTagSelectFieldInput.d.ts +0 -11
  705. package/dist/types/Form/fields/SearchableMultiTagSelectField/index.d.ts +0 -21
  706. package/dist/types/Form/fields/SearchableMultiTagSelectField/styledComponents.d.ts +0 -15
  707. package/dist/types/Form/fields/SearchableSelectField/SearchableSelectField.d.ts +0 -2
  708. package/dist/types/Form/fields/SearchableSelectField/index.d.ts +0 -2
  709. package/dist/types/Form/fields/SearchableSelectField/styledComponents.d.ts +0 -22
  710. package/dist/types/Form/fields/SearchableSelectField/types.d.ts +0 -25
  711. package/dist/types/Form/fields/StringField/StringField.d.ts +0 -2
  712. package/dist/types/Form/fields/StringField/index.d.ts +0 -1
  713. package/dist/types/Form/fields/StringField/styledComponents.d.ts +0 -3
  714. package/dist/types/Form/fields/TextAreaField/TextAreaField.d.ts +0 -2
  715. package/dist/types/Form/fields/TextAreaField/index.d.ts +0 -2
  716. package/dist/types/Form/fields/TextAreaField/styledComponents.d.ts +0 -5
  717. package/dist/types/Form/fields/ToggleField/ToggleField.d.ts +0 -2
  718. package/dist/types/Form/fields/ToggleField/ToggleFieldInput.d.ts +0 -6
  719. package/dist/types/Form/fields/ToggleField/index.d.ts +0 -13
  720. package/dist/types/Form/fields/ToggleField/styledComponents.d.ts +0 -7
  721. package/dist/types/Form/fields/index.d.ts +0 -191
  722. package/dist/types/Form/hooks/index.d.ts +0 -1
  723. package/dist/types/Form/hooks/useSetDefault.d.ts +0 -2
  724. package/dist/types/Form/index.d.ts +0 -8
  725. package/dist/types/Form/styles/common.d.ts +0 -2
  726. package/dist/types/Form/templates/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +0 -2
  727. package/dist/types/Form/templates/ArrayFieldTemplate/index.d.ts +0 -2
  728. package/dist/types/Form/templates/ArrayFieldTemplate/styledComponents.d.ts +0 -30
  729. package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/CollapsibleObjectFieldTemplate.d.ts +0 -2
  730. package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/index.d.ts +0 -2
  731. package/dist/types/Form/templates/CollapsibleObjectFieldTemplate/styledComponents.d.ts +0 -36
  732. package/dist/types/Form/templates/FieldTemplate/FieldTemplate.d.ts +0 -2
  733. package/dist/types/Form/templates/FieldTemplate/index.d.ts +0 -1
  734. package/dist/types/Form/templates/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +0 -2
  735. package/dist/types/Form/templates/ObjectFieldTemplate/index.d.ts +0 -2
  736. package/dist/types/Form/templates/ObjectFieldTemplate/styledComponents.d.ts +0 -27
  737. package/dist/types/Form/templates/index.d.ts +0 -57
  738. package/dist/types/Form/types/FormRegistryContext.d.ts +0 -23
  739. package/dist/types/Form/types/index.d.ts +0 -1
  740. package/dist/types/FormView/FormView.d.ts +0 -4
  741. package/dist/types/FormView/FormViewRegistry.d.ts +0 -3
  742. package/dist/types/FormView/components/Field.d.ts +0 -35
  743. package/dist/types/FormView/components/Form.d.ts +0 -1
  744. package/dist/types/FormView/components/Icon.d.ts +0 -1
  745. package/dist/types/FormView/components/index.d.ts +0 -53
  746. package/dist/types/FormView/fields/AnyField.d.ts +0 -2
  747. package/dist/types/FormView/fields/ArrayField.d.ts +0 -2
  748. package/dist/types/FormView/fields/BooleanField.d.ts +0 -2
  749. package/dist/types/FormView/fields/DateField.d.ts +0 -2
  750. package/dist/types/FormView/fields/EJSField.d.ts +0 -2
  751. package/dist/types/FormView/fields/FileUploadField.d.ts +0 -2
  752. package/dist/types/FormView/fields/FilesUploadField.d.ts +0 -2
  753. package/dist/types/FormView/fields/MultipleChoiceField.d.ts +0 -2
  754. package/dist/types/FormView/fields/NullField.d.ts +0 -2
  755. package/dist/types/FormView/fields/NumberField.d.ts +0 -2
  756. package/dist/types/FormView/fields/ObjectField/ObjectField.d.ts +0 -2
  757. package/dist/types/FormView/fields/ObjectField/ObjectFieldSection.d.ts +0 -7
  758. package/dist/types/FormView/fields/ObjectField/index.d.ts +0 -8
  759. package/dist/types/FormView/fields/ObjectField/styledComponents.d.ts +0 -2
  760. package/dist/types/FormView/fields/RadioField.d.ts +0 -2
  761. package/dist/types/FormView/fields/SchemaField.d.ts +0 -2
  762. package/dist/types/FormView/fields/SearchableMultiTagSelectField.d.ts +0 -2
  763. package/dist/types/FormView/fields/SearchableSelectField.d.ts +0 -2
  764. package/dist/types/FormView/fields/StringField.d.ts +0 -2
  765. package/dist/types/FormView/fields/TextAreaField.d.ts +0 -2
  766. package/dist/types/FormView/fields/ToggleField.d.ts +0 -2
  767. package/dist/types/FormView/fields/index.d.ts +0 -9
  768. package/dist/types/FormView/index.d.ts +0 -7
  769. package/dist/types/FormView/templates/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +0 -2
  770. package/dist/types/FormView/templates/ArrayFieldTemplate/index.d.ts +0 -2
  771. package/dist/types/FormView/templates/ArrayFieldTemplate/styledComponents.d.ts +0 -10
  772. package/dist/types/FormView/templates/FieldTemplate/FieldTemplate.d.ts +0 -2
  773. package/dist/types/FormView/templates/FieldTemplate/index.d.ts +0 -1
  774. package/dist/types/FormView/templates/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +0 -2
  775. package/dist/types/FormView/templates/ObjectFieldTemplate/index.d.ts +0 -2
  776. package/dist/types/FormView/templates/ObjectFieldTemplate/styledComponents.d.ts +0 -10
  777. package/dist/types/FormView/templates/index.d.ts +0 -23
  778. package/dist/types/FormView/types/FormViewRegistryContext.d.ts +0 -21
  779. package/dist/types/FormView/types/index.d.ts +0 -1
  780. package/dist/types/common/FileUploadContext.d.ts +0 -18
  781. package/dist/types/common/FilesUploadContext.d.ts +0 -17
  782. package/dist/types/common/constants.d.ts +0 -10
  783. package/dist/types/common/index.d.ts +0 -4
  784. package/dist/types/styles/types.d.ts +0 -216
  785. package/dist/types/utils/createInitialValues.d.ts +0 -7
  786. package/dist/types/utils/createValidationSchema.d.ts +0 -31
  787. package/dist/types/utils/deepOverlap.d.ts +0 -1
  788. package/dist/types/utils/extractUiSchema.d.ts +0 -9
  789. package/dist/types/utils/getEnums.d.ts +0 -30
  790. package/dist/types/utils/getHiddenProperties.d.ts +0 -2
  791. package/dist/types/utils/getStyle.d.ts +0 -5
  792. package/dist/types/utils/getTitleAndDescription.d.ts +0 -12
  793. package/dist/types/utils/getTypes.d.ts +0 -5
  794. package/dist/types/utils/immutablySwapItems.d.ts +0 -1
  795. package/dist/types/utils/index.d.ts +0 -15
  796. package/dist/types/utils/mergeSchemas.d.ts +0 -1
  797. package/dist/types/utils/orderAdditionalProperties.d.ts +0 -2
  798. package/dist/types/utils/orderByUiSchema.d.ts +0 -2
  799. package/dist/types/utils/resolveSchema.d.ts +0 -4
  800. package/dist/types/utils/setTitleValues.d.ts +0 -1
  801. package/dist/types/utils/solveReferences.d.ts +0 -10
  802. /package/dist/cjs/{Form/fields/SearchableSelectField/types.js → common/types/Utils.js} +0 -0
  803. /package/dist/cjs/{styles → v3/raw/dom}/types.js +0 -0
  804. /package/dist/cjs/{Form/types/FormRegistryContext.js → v3/raw/model/form/types.js} +0 -0
  805. /package/dist/cjs/{FormView/types/FormViewRegistryContext.js → v3/raw/model/host.js} +0 -0
  806. /package/dist/cjs/{FormView/types/index.js → v3/raw/model/view/types.js} +0 -0
  807. /package/dist/esm/{Form/fields/SearchableSelectField/types.js → common/types/Utils.js} +0 -0
  808. /package/dist/esm/{styles → v3/raw/dom}/types.js +0 -0
  809. /package/dist/esm/{Form/types/FormRegistryContext.js → v3/raw/model/form/types.js} +0 -0
  810. /package/dist/esm/{FormView/types/FormViewRegistryContext.js → v3/raw/model/host.js} +0 -0
  811. /package/dist/esm/{FormView/types/index.js → v3/raw/model/view/types.js} +0 -0
@@ -0,0 +1,55 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { errorMarkup, formChrome } from "../../raw/model/form/chrome";
3
+ import { arrayTemplateMarkup, collapsibleTemplateMarkup, fieldTemplateMarkup, objectTemplateMarkup } from "../../raw/model/form/markup";
4
+ import { extractUiSchema } from "../../raw/core/uiSchema";
5
+ import { getIn } from "../../raw/core/paths";
6
+ import { setTitleValues } from "../../raw/core/titles";
7
+ import { hole } from "../../raw/model/vnode";
8
+ import { useFormBuild } from "./fields";
9
+ import { useFormRender } from "./host";
10
+ const fieldProps = (props) => ({
11
+ name: props.name ?? "",
12
+ schema: props.schema,
13
+ ui: props.uiSchema,
14
+ required: !!props.required,
15
+ kind: props["data-fjsf-kind"],
16
+ hidden: props["data-fjsf-hidden"] === "true",
17
+ data: Object.fromEntries(Object.entries(props).filter(([k]) => k.startsWith("data-") && k !== "data-fjsf-kind" && k !== "data-fjsf-hidden")),
18
+ });
19
+ const FieldTemplate = (props) => {
20
+ const ctx = useFormBuild();
21
+ const render = useFormRender();
22
+ return _jsx(_Fragment, { children: render(fieldTemplateMarkup(formChrome(ctx, fieldProps(props)), [hole()]), props.children) });
23
+ };
24
+ const ObjectFieldTemplate = (props) => {
25
+ const ctx = useFormBuild();
26
+ const render = useFormRender();
27
+ return _jsx(_Fragment, { children: render(objectTemplateMarkup(formChrome(ctx, fieldProps(props), false), [hole()]), props.children) });
28
+ };
29
+ const CollapsibleObjectFieldTemplate = (props) => {
30
+ const ctx = useFormBuild();
31
+ const render = useFormRender();
32
+ const ui = extractUiSchema(props.uiSchema);
33
+ const id = `${props.name ?? ""}#object`;
34
+ const collapsed = !!(ctx.ui.collapsed?.[id] ?? ui.isCollapsedOnLoad ?? true);
35
+ const icon = String(collapsed ? ui.collapsedIcon ?? "▸" : ui.openIcon ?? "▾");
36
+ const chrome = formChrome(ctx, fieldProps(props), false);
37
+ // 2.x: setTitleValues(name, getTitle ?? "", ui:options.defaultTitle ?? "", values).
38
+ const title = typeof chrome.title === "string" || chrome.title === undefined ? setTitleValues(props.name ?? "", chrome.title ?? "", String(ui.defaultTitle ?? ""), ctx.values) || undefined : chrome.title;
39
+ const markup = collapsibleTemplateMarkup({ ...chrome, title }, [hole()], { collapsed, id, ariaLabel: String(ui.props?.ariaLabel ?? props.name ?? ""), icon });
40
+ return _jsx(_Fragment, { children: render(markup, props.children) });
41
+ };
42
+ const ArrayFieldTemplate = (props) => {
43
+ const ctx = useFormBuild();
44
+ const render = useFormRender();
45
+ const name = props.name ?? "";
46
+ const error = typeof getIn(ctx.errors, name) === "string" ? errorMarkup(ctx, name, extractUiSchema(props.uiSchema).props?.error) : null;
47
+ const items = Array.isArray(props.items) ? props.items.map((item, index) => props.renderItem(item, index)) : null;
48
+ return _jsx(_Fragment, { children: render(arrayTemplateMarkup({ ...formChrome(ctx, fieldProps(props), false), error }, [hole()]), items) });
49
+ };
50
+ export const FormTemplates = {
51
+ ArrayFieldTemplate,
52
+ CollapsibleObjectFieldTemplate,
53
+ FieldTemplate,
54
+ ObjectFieldTemplate,
55
+ };
@@ -0,0 +1,168 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext, useEffect, useMemo, useRef, useState } from "react";
3
+ import { useFormikContext } from "formik";
4
+ import { getIn } from "../../raw/core/paths";
5
+ import { fileUploadMarkup, filesOf, filesUploadMarkup } from "../../raw/model/form/upload";
6
+ import { toReact } from "../toReact";
7
+ import { childProps, useFormBuild } from "./fields";
8
+ import { formBind, formHost } from "./host";
9
+ import { FormRegistry, FormRuntimeContext } from "./registry";
10
+ import { FileUploadContext, FilesUploadContext } from "./uploadContexts";
11
+ const click = (id) => globalThis.document?.getElementById(id)?.click();
12
+ /** Renders RAW markup: upload actions go to `local`, everything else to the Form runtime. */
13
+ const useRender = (local) => {
14
+ const registry = useContext(FormRegistry);
15
+ const runtime = useContext(FormRuntimeContext);
16
+ const formik = useFormikContext();
17
+ const base = formBind(runtime, formik);
18
+ return (markup) => toReact(markup, {
19
+ host: formHost(registry),
20
+ bind: (node, props) => {
21
+ const out = base(node, props);
22
+ for (const [event, action] of Object.entries(node.on ?? {})) {
23
+ const handle = local[action?.type];
24
+ if (!handle)
25
+ continue;
26
+ const name = { change: "onChange", click: "onClick", dragenter: "onDragEnter", dragleave: "onDragLeave", dragover: "onDragOver", drop: "onDrop" }[event];
27
+ if (name)
28
+ out[name] = (e) => handle(e, action);
29
+ }
30
+ return out;
31
+ },
32
+ });
33
+ };
34
+ export const FileUploadField = (props) => {
35
+ const ctx = useFormBuild();
36
+ const formik = useFormikContext();
37
+ const { uploadFile, fetchFile, removeFile } = useContext(FileUploadContext);
38
+ const value = getIn(formik?.values, props.name);
39
+ const [uploadedFile, setUploadedFile] = useState(null);
40
+ const [progress, setProgress] = useState(0);
41
+ // The fake-progress timer must not outlive the field.
42
+ const timer = useRef(undefined);
43
+ useEffect(() => () => clearInterval(timer.current), []);
44
+ useEffect(() => {
45
+ let alive = true;
46
+ Promise.resolve()
47
+ .then(() => fetchFile(value))
48
+ .then((file) => alive && setUploadedFile(file ?? null), () => alive && setUploadedFile(null));
49
+ return () => void (alive = false);
50
+ }, [value]);
51
+ const upload = async (file) => {
52
+ const data = new FormData();
53
+ data.append("file", file);
54
+ try {
55
+ // 2.x: a fake progress so the bar shows for fast uploads, then the real one at 100%.
56
+ let fake = 0;
57
+ clearInterval(timer.current);
58
+ timer.current = setInterval(() => ((fake += 10) <= 100 ? setProgress(fake) : clearInterval(timer.current)), 100);
59
+ const result = await uploadFile({ data, onUploadProgress: (e) => e.total != null && Math.round((e.loaded * 100) / e.total) === 100 && setProgress(100) });
60
+ formik.setFieldValue(props.name, result);
61
+ }
62
+ catch (error) {
63
+ console.error("File upload failed", error);
64
+ }
65
+ };
66
+ const render = useRender({
67
+ filePick: (_e, action) => !action.locked && click(action.id),
68
+ fileChosen: (e) => {
69
+ const file = e.currentTarget.files?.[0];
70
+ if (file) {
71
+ void upload(file);
72
+ e.target.value = null;
73
+ }
74
+ },
75
+ fileRemove: async () => {
76
+ if (uploadedFile?.name && props.schema?.readOnly !== true) {
77
+ await removeFile(String(uploadedFile.name));
78
+ setProgress(0);
79
+ formik.setFieldValue(props.name, null);
80
+ }
81
+ },
82
+ });
83
+ return _jsx(_Fragment, { children: render(fileUploadMarkup(ctx, childProps(props), { value, uploadedFile, progress })) });
84
+ };
85
+ /** 2.x handleDrop's accept filter. */
86
+ const accepted = (file, types) => {
87
+ const list = Array.isArray(types) ? types : typeof types === "string" ? types.split(",").map((t) => t.trim()).filter(Boolean) : [];
88
+ return !list.length || list.some((t) => (t.endsWith("/*") ? file.type.startsWith(t.slice(0, -2)) : t === file.type));
89
+ };
90
+ export const FilesUploadField = (props) => {
91
+ const ctx = useFormBuild();
92
+ const formik = useFormikContext();
93
+ const { uploadFiles, removeFile } = useContext(FilesUploadContext);
94
+ // 2.x memoised this: a fresh [] per render would re-run the effect below on every render.
95
+ const stored = getIn(formik?.values, props.name);
96
+ const value = useMemo(() => stored ?? [], [stored]);
97
+ const [files, setFiles] = useState([]);
98
+ const [progress, setProgress] = useState({});
99
+ const [dragging, setDragging] = useState(false);
100
+ const depth = useRef(0);
101
+ const readOnly = props.schema?.readOnly === true;
102
+ const ip = props.uiSchema?.["ui:props"] ?? props.uiSchema?.props ?? {};
103
+ const multiple = ip.allowMultipleFiles ?? true;
104
+ useEffect(() => {
105
+ if (!Array.isArray(value))
106
+ return;
107
+ setFiles(filesOf(value));
108
+ filesOf(value).forEach((f) => setProgress((p) => ({ ...p, [f.progressId]: 100 })));
109
+ }, [value]);
110
+ const upload = async (list) => {
111
+ const withIds = list.map((data) => ({ data, progressId: data.name + data.size + data.lastModified + Math.random() }));
112
+ setFiles((f) => f.concat(withIds.map(({ data, progressId }) => ({ name: data.name, size: data.size, progressId, mimeType: data.type, id: null }))));
113
+ try {
114
+ const result = await uploadFiles({ files: withIds, onUploadProgress: (e, id) => e.total != null && setProgress((p) => ({ ...p, [id]: Math.round((e.loaded * 100) / e.total) })) });
115
+ setFiles((prev) => prev.map((item) => ({ ...item, id: result.find((r) => r.progressId === item.progressId)?.id ?? item.id })));
116
+ formik.setFieldValue(props.name, (Array.isArray(value) ? value : []).concat(result.map(({ progressId: _p, ...rest }) => rest)));
117
+ }
118
+ catch (error) {
119
+ console.error("File upload failed", error);
120
+ }
121
+ };
122
+ const stop = (e) => {
123
+ e.preventDefault();
124
+ e.stopPropagation();
125
+ };
126
+ const render = useRender({
127
+ filePick: (_e, action) => !action.locked && click(action.id),
128
+ filesChosen: (e) => e.target.files && void upload([...e.target.files]),
129
+ filesRemove: async (_e, action) => {
130
+ const file = files.find((f) => f.progressId === action.progressId);
131
+ if (!file?.id)
132
+ return;
133
+ await removeFile(file);
134
+ setProgress(({ [file.progressId]: _gone, ...rest }) => rest);
135
+ setFiles((prev) => prev.filter((f) => f.id !== file.id));
136
+ formik.setFieldValue(props.name, (Array.isArray(value) ? value : []).filter((f) => f?.id !== file.id));
137
+ },
138
+ filesDrag: (e, action) => {
139
+ if (readOnly)
140
+ return;
141
+ stop(e);
142
+ if (action.enter === true) {
143
+ depth.current++;
144
+ if (e.dataTransfer?.items?.length)
145
+ setDragging(true);
146
+ }
147
+ else if (action.enter === false && --depth.current === 0)
148
+ setDragging(false);
149
+ },
150
+ filesDrop: (e) => {
151
+ if (readOnly)
152
+ return;
153
+ stop(e);
154
+ setDragging(false);
155
+ depth.current = 0;
156
+ let dropped = [...(e.dataTransfer?.files ?? [])];
157
+ if (!multiple && files.length > 0)
158
+ dropped = [];
159
+ else if (!multiple)
160
+ dropped = dropped.slice(0, 1);
161
+ dropped = dropped.filter((f) => accepted(f, ip.acceptedFiletypes));
162
+ if (dropped.length)
163
+ void upload(dropped);
164
+ e.dataTransfer?.clearData?.();
165
+ },
166
+ });
167
+ return _jsx(_Fragment, { children: render(filesUploadMarkup(ctx, childProps(props), { value, files, progress, dragging })) });
168
+ };
@@ -0,0 +1,24 @@
1
+ // FileUploadContext / FilesUploadContext: the host's upload functions (2.x src/common/File(s)UploadContext,
2
+ // same shape and defaults). pro3 provides them around its forms.
3
+ import { createContext } from "react";
4
+ export const FileUploadContext = createContext({
5
+ uploadFile: () => {
6
+ console.error("Lacking upload from FileUploadContext");
7
+ return Promise.reject();
8
+ },
9
+ fetchFile: (value) => Promise.resolve(value),
10
+ removeFile: () => {
11
+ console.error("Lacking remove from FileUploadContext");
12
+ return Promise.reject();
13
+ },
14
+ });
15
+ export const FilesUploadContext = createContext({
16
+ uploadFiles: () => {
17
+ console.error("Lacking upload from FilesUploadContext");
18
+ return Promise.reject();
19
+ },
20
+ removeFile: () => {
21
+ console.error("Lacking remove from FileUploadContext");
22
+ return Promise.reject();
23
+ },
24
+ });
@@ -0,0 +1,17 @@
1
+ // useSetDefault: deprecated 3.x wrapper over the RAW defaults (§3.1, §2.7). 2.x called useField
2
+ // after an early return (rules of hooks); this calls its hooks unconditionally and sets the
3
+ // default once, on mount, when the value is unset (D2 Q-FMK-2: falsy defaults are honoured).
4
+ import { useEffect } from "react";
5
+ import { useFormikContext } from "formik";
6
+ import { defaultFor } from "../../raw/core/defaults";
7
+ import { getIn } from "../../raw/core/paths";
8
+ export const useSetDefault = (props) => {
9
+ const formik = useFormikContext();
10
+ useEffect(() => {
11
+ if (!props.name || !formik)
12
+ return;
13
+ const value = defaultFor(props.schema, getIn(formik.values, props.name), { forceDefaultValue: props.forceDefaultValue });
14
+ if (value !== undefined)
15
+ formik.setFieldValue(props.name, value);
16
+ }, []);
17
+ };
@@ -0,0 +1,52 @@
1
+ import { createElement, Fragment, isValidElement } from "react";
2
+ import { extractUiSchema } from "../raw/core/uiSchema";
3
+ import { ChainContext } from "./chain";
4
+ import { reactProps, toReact } from "./toReact";
5
+ /** Own entries only: a uiSchema naming `constructor` or `toString` finds nothing (SEC-6, SEC-SSR-3). */
6
+ export const own = (map, name) => map && name !== undefined && Object.prototype.hasOwnProperty.call(map, name) ? map[name] : undefined;
7
+ /** 2.x `components.A ?? components.B`. */
8
+ export const lookup = (map, names) => {
9
+ for (const name of names)
10
+ if (own(map, name) !== undefined)
11
+ return map[name];
12
+ return undefined;
13
+ };
14
+ /** Continues the $ref chain below a React boundary. */
15
+ export const chained = (chain, element) => (chain?.length ? createElement(ChainContext.Provider, { value: chain }, element) : element);
16
+ export const createHost = (defaults) => (registry, hole, holes = {}) => (node, native, env) => {
17
+ const host = node.host;
18
+ switch (host.kind) {
19
+ case "hole":
20
+ return (host.name ? holes[host.name] : hole) ?? null;
21
+ case "value":
22
+ return isValidElement(host.value) ? host.value : native();
23
+ case "component": {
24
+ const C = lookup(registry.components ?? {}, host.names);
25
+ if (C === undefined || C === lookup(defaults.components, host.names))
26
+ return native();
27
+ if (host.props)
28
+ return createElement(C, host.props, ...(host.children ?? []).map((c) => toReact(c, env)));
29
+ // The override gets the element's props (and handlers); the default classes belong to the default primitive.
30
+ const base = reactProps(node.attrs);
31
+ const { className, ...props } = node.on && env.bind ? env.bind(node, base) : base;
32
+ const library = new Set(defaults.defaultClasses(host.names));
33
+ const mine = String(className ?? "").split(" ").filter((c) => c && !library.has(c)).join(" ");
34
+ return createElement(C, mine ? { ...props, className: mine } : props, ...node.children.map((c) => toReact(c, env)));
35
+ }
36
+ case "template": {
37
+ const T = own(registry.templates, host.override) || own(registry.templates, host.template);
38
+ if (!T || T === defaults.templates[host.template])
39
+ return native();
40
+ if (host.template === "ArrayFieldTemplate") {
41
+ const renderItem = (_, index) => createElement(Fragment, { key: index }, toReact(host.itemNodes?.[index], env));
42
+ return chained(host.chain, createElement(T, { ...host.props, items: host.items, renderItem }));
43
+ }
44
+ return chained(host.chain, createElement(T, { ...host.props, children: defaults.children(registry, host, env) }));
45
+ }
46
+ case "field": {
47
+ const fn = extractUiSchema(host.props.uiSchema).field;
48
+ const F = typeof fn === "function" ? fn : own(registry.fields, host.field);
49
+ return F ? chained(host.chain, createElement(F, host.props)) : native();
50
+ }
51
+ }
52
+ };
@@ -0,0 +1,18 @@
1
+ // @nolwenture/formik-jsonschema-form/react (v3): the React layer over the RAW core.
2
+ // S3: the read-only FormView (pro3's view and PDF path). S4: the Form.
3
+ export { FormView } from "./view/root";
4
+ export { FormViewRegistry } from "./view/registry";
5
+ export { FormViewFields, SchemaField } from "./view/fields";
6
+ export { FormViewTemplates } from "./view/templates";
7
+ export { FormViewComponents, compatComponents } from "./view/components";
8
+ export { reactProps, toReact } from "./toReact";
9
+ export { Form } from "./form/root";
10
+ export { FormRegistry } from "./form/registry";
11
+ export { FormFields, SchemaField as FormSchemaField } from "./form/fields";
12
+ export { FormTemplates } from "./form/templates";
13
+ export { FormComponents, formCompatComponents } from "./form/components";
14
+ /** @deprecated 3.x: defaults are applied per node appearance (§2.7a); kept as a wrapper. */
15
+ export { useSetDefault } from "./form/useSetDefault";
16
+ export { FileUploadContext, FilesUploadContext } from "./form/uploadContexts";
17
+ // S7: styling (§4.3), the same helpers as `./raw`: load `styles.css` (or getDefaultStyles()) and set the theme variables.
18
+ export { cssVarsToString, fjsfClassNames, fjsfSelectors, getDefaultStyles, themeToCssVars } from "../raw/styles";
@@ -0,0 +1,13 @@
1
+ /** `classes`: the element's chain, base first; the last one is the component's own class. */
2
+ export const asStyledSelector = (component, tag, classes) => {
3
+ const own = classes[classes.length - 1];
4
+ return Object.assign(component, {
5
+ styledComponentId: own,
6
+ foldedComponentIds: classes.slice(0, -1).join(" "),
7
+ target: tag,
8
+ attrs: [],
9
+ // `Default` is a slot's prop (a styled(FormComponents.X) slot), never a DOM attribute
10
+ shouldForwardProp: (prop) => prop !== "Default",
11
+ toString: () => `.${own}`,
12
+ });
13
+ };
@@ -0,0 +1,15 @@
1
+ import { createElement, forwardRef } from "react";
2
+ export const withSlots = (defaults, fallback, slots = {}, aliases = {}) => {
3
+ const map = { ...defaults };
4
+ for (const [given, Slot] of Object.entries(slots)) {
5
+ const key = aliases[given] ?? given;
6
+ if (!Object.prototype.hasOwnProperty.call(defaults, key) || key === "getComponents" || (typeof Slot !== "function" && typeof Slot !== "object") || !Slot)
7
+ continue;
8
+ const Default = defaults[key] ?? defaults[fallback[key]];
9
+ // React 19 passes `ref` as a prop: forward it only when the caller set one (2.x passed none).
10
+ const C = forwardRef((props, ref) => createElement(Slot, ref ? { ...props, ref, Default } : { ...props, Default }));
11
+ C.displayName = `Slot(${key})`;
12
+ map[key] = C;
13
+ }
14
+ return map;
15
+ };
@@ -0,0 +1,58 @@
1
+ import { createElement, Fragment } from "react";
2
+ const VOID = new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "source", "track", "wbr"]);
3
+ const SAFE_NAME = /^[a-zA-Z_:][-a-zA-Z0-9_:.]*$/;
4
+ const SAFE_TAG = /^[a-z][a-z0-9-]*$/;
5
+ const HANDLER = /^on/i;
6
+ const RENAMED = {
7
+ class: "className", for: "htmlFor", readonly: "readOnly", tabindex: "tabIndex", autocomplete: "autoComplete", inputmode: "inputMode", maxlength: "maxLength",
8
+ "stroke-width": "strokeWidth",
9
+ };
10
+ const BOOLEAN = new Set(["selected", "checked", "disabled", "readonly", "multiple", "hidden", "required"]);
11
+ /** "color:red; font-size:1px" -> { color: "red", fontSize: "1px" } (library-owned styles only). Custom properties (`--x-y`) keep their name. */
12
+ const styleObject = (style) => Object.fromEntries(style
13
+ .split(";")
14
+ .map((rule) => rule.split(":"))
15
+ .filter(([k, v]) => k?.trim() && v !== undefined)
16
+ .map(([k, ...v]) => [k.trim().startsWith("--") ? k.trim() : k.trim().replace(/-([a-z])/g, (_, c) => c.toUpperCase()), v.join(":").trim()]));
17
+ export const reactProps = (attrs) => {
18
+ const props = {};
19
+ for (const [name, value] of Object.entries(attrs)) {
20
+ if (!SAFE_NAME.test(name) || HANDLER.test(name) || value === undefined || value === null || value === false)
21
+ continue;
22
+ const key = RENAMED[name] ?? name;
23
+ if (name === "style" && typeof value === "string")
24
+ props.style = styleObject(value);
25
+ else
26
+ props[key] = value === true ? (BOOLEAN.has(name) ? true : "true") : value;
27
+ }
28
+ return props;
29
+ };
30
+ const render = (children, env) => children.map((c) => toReact(c, env));
31
+ /** React wants the selected option as the select's value, not `selected` on the option. */
32
+ const selectChildren = (node, props) => {
33
+ const selected = node.children.find((c) => typeof c === "object" && !!c && c.tag === "option" && c.attrs.selected === true);
34
+ if (selected)
35
+ props.defaultValue = selected.attrs.value;
36
+ return node.children.map((c) => (typeof c === "object" && c && c.tag === "option" ? { ...c, attrs: { ...c.attrs, selected: undefined } } : c));
37
+ };
38
+ const native = (node, env) => {
39
+ if (node.tag === "#fragment")
40
+ return createElement(Fragment, null, ...render(node.children, env));
41
+ if (!SAFE_TAG.test(node.tag))
42
+ return null;
43
+ const own = reactProps(node.attrs);
44
+ const props = node.on && env.bind ? env.bind(node, own) : own;
45
+ if (VOID.has(node.tag))
46
+ return createElement(node.tag, props);
47
+ const children = node.tag === "select" ? selectChildren(node, props) : node.children;
48
+ return createElement(node.tag, props, ...render(children, env));
49
+ };
50
+ export const toReact = (child, env = {}) => {
51
+ if (child === null || child === undefined || child === false)
52
+ return null;
53
+ if (typeof child === "string" || typeof child === "number")
54
+ return child;
55
+ if (child.host && env.host)
56
+ return env.host(child, () => native(child, env), env);
57
+ return native(child, env);
58
+ };
@@ -0,0 +1,59 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { createElement, forwardRef, useContext } from "react";
3
+ import { en } from "../../raw/i18n/en";
4
+ import { booleanValueMarkup, checkIconMarkup, choicesValueMarkup, sectionMarkup, viewClass, VIEW_OVERRIDE_ONLY, VIEW_PRIMITIVES, } from "../../raw/model/view/markup";
5
+ import { reactAttr, reactText } from "../../raw/model/view/values";
6
+ import { h, hole } from "../../raw/model/vnode";
7
+ import { toReact } from "../toReact";
8
+ import { viewHost } from "./host";
9
+ import { withSlots } from "../slots";
10
+ import { asStyledSelector } from "../selector";
11
+ import { FormViewRegistry } from "./registry";
12
+ const cx = (...names) => names.filter((n) => typeof n === "string" && n).join(" ");
13
+ const primitive = (name) => {
14
+ // `Default` (a slot's prop, forwarded by styled(FormViewComponents.X) slots) is never a DOM attribute.
15
+ const C = forwardRef(({ className, Default: _default, ...props }, ref) => createElement(VIEW_PRIMITIVES[name], { ...props, ref, className: cx(viewClass(name), className) }));
16
+ C.displayName = name;
17
+ return asStyledSelector(C, VIEW_PRIMITIVES[name], [viewClass(name)]);
18
+ };
19
+ const withClass = (node, className) => ({ ...node, attrs: { ...node.attrs, class: cx(node.attrs.class, className) } });
20
+ const TIMES = "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z";
21
+ const BooleanFieldValue = ({ className, value, label, selectedLabel, notSelectedLabel }) => {
22
+ const selected = value === true;
23
+ const text = label !== undefined ? reactText(label) : selected ? selectedLabel ?? en["view.boolean.selected"] : notSelectedLabel ?? en["view.boolean.notSelected"];
24
+ return _jsx(_Fragment, { children: toReact(withClass(booleanValueMarkup(selected, text), className)) });
25
+ };
26
+ const MultipleChoiceFieldValue = ({ values = [], style }) => (_jsx(_Fragment, { children: toReact(choicesValueMarkup(values.map((v) => ({ value: reactAttr(v.const) ?? "", title: reactText(v.title), selected: !!v.selected })), style)) }));
27
+ /** Reads ObjectFieldSectionWrapper/Title from the registry, like 2.x. */
28
+ const ObjectFieldSection = ({ title, children }) => {
29
+ const registry = useContext(FormViewRegistry);
30
+ // The composite's own markup (fieldset + legend), with the registry's primitives.
31
+ const markup = sectionMarkup(title, [hole()]).children[0];
32
+ return _jsx(_Fragment, { children: toReact(markup, { host: viewHost(registry, children) }) });
33
+ };
34
+ const icon = (name, markup) => {
35
+ const C = ({ className }) => _jsx(_Fragment, { children: toReact(markup(cx(viewClass(name), className))) });
36
+ C.displayName = name;
37
+ return C;
38
+ };
39
+ export const FormViewComponents = {
40
+ ...Object.fromEntries(Object.keys(VIEW_PRIMITIVES).map((name) => [name, primitive(name)])),
41
+ ...Object.fromEntries(VIEW_OVERRIDE_ONLY.map((name) => [name, undefined])),
42
+ BooleanFieldValue,
43
+ MultipleChoiceFieldValue,
44
+ ObjectFieldSection,
45
+ SelectedIcon: icon("SelectedIcon", (c) => checkIconMarkup(c)),
46
+ NotSelectedIcon: icon("NotSelectedIcon", (c) => h("svg", { class: c, viewBox: "0 0 352 512", "aria-hidden": "true", focusable: "false" }, h("path", { d: TIMES }))),
47
+ /** 2.x helper (ObjectFieldTemplate): the object template's components from a map. */
48
+ getComponents: (components) => ({
49
+ Wrapper: components.ObjectFieldTemplateWrapper,
50
+ Title: components.ObjectFieldTemplateTitle,
51
+ Description: components.ObjectFieldTemplateDescription ?? components.FieldDescription,
52
+ }),
53
+ };
54
+ const FALLBACK = {
55
+ ArrayFieldTemplateDescription: "FieldDescription", ArrayFieldTemplateTitle: "ObjectFieldTemplateTitle",
56
+ ArrayFieldTemplateWrapper: "ObjectFieldTemplateWrapper", ObjectFieldTemplateDescription: "FieldDescription",
57
+ };
58
+ /** registry.components: the defaults, with each known slot wrapped around its `Default`. Unknown keys are ignored. */
59
+ export const compatComponents = (slots = {}) => withSlots(FormViewComponents, FALLBACK, slots);
@@ -0,0 +1,43 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext } from "react";
3
+ import { useFormikContext } from "formik";
4
+ import { componentField, createViewContext, schemaField } from "../../raw/model/view/build";
5
+ import { toVNode } from "../../raw/model/view/toVNode";
6
+ import { useViewRender } from "./host";
7
+ import { FormViewRegistry, ViewChainContext, ViewRootContext } from "./registry";
8
+ /** The RAW build context of the current form: Formik values, registry definitions, replaced fields. */
9
+ const useBuildContext = () => {
10
+ const registry = useContext(FormViewRegistry);
11
+ const root = useContext(ViewRootContext);
12
+ const formik = useFormikContext();
13
+ const fields = registry.fields ?? {};
14
+ const customFields = Object.keys(fields).filter((key) => fields[key] !== FormViewFields[key]);
15
+ return createViewContext({ definitions: registry.definitions, $defs: root.defs }, { definitions: registry.uiSchemaDefinitions }, formik?.values ?? {}, {
16
+ customFields,
17
+ formLocalization: registry.formLocalization,
18
+ fileUploadView: root.fileUploadView,
19
+ sink: root.sink,
20
+ });
21
+ };
22
+ const viewField = (name, build) => {
23
+ const F = (props) => {
24
+ const ctx = useBuildContext();
25
+ const chain = useContext(ViewChainContext);
26
+ const render = useViewRender();
27
+ return _jsx(_Fragment, { children: render(toVNode(build(props, ctx, chain))) });
28
+ };
29
+ F.displayName = name;
30
+ return F;
31
+ };
32
+ const kindOf = (props) => props["data-fjsf-kind"];
33
+ /** 2.x SchemaField: resolve refs, pick the field (ui:field, registry, type), render it. */
34
+ export const SchemaField = viewField("SchemaField", (p, ctx, chain) => schemaField(p.name ?? "", p.schema, p.uiSchema, ctx, kindOf(p), chain));
35
+ const builtIn = (component) => viewField(component, (p, ctx, chain) => componentField(component, p.name ?? "", p.schema, p.uiSchema, ctx, kindOf(p), chain));
36
+ const NAMES = [
37
+ "AnyField", "ArrayField", "BooleanField", "DateField", "FileUploadField", "FilesUploadField", "MultipleChoiceField", "NullField",
38
+ "NumberField", "ObjectField", "RadioField", "SearchableMultiTagSelectField", "SearchableSelectField", "StringField", "TextAreaField", "ToggleField",
39
+ ];
40
+ export const FormViewFields = {
41
+ ...Object.fromEntries(NAMES.map((name) => [name, builtIn(name)])),
42
+ SchemaField,
43
+ };
@@ -0,0 +1,32 @@
1
+ import { createElement, useContext } from "react";
2
+ import { viewClass } from "../../raw/model/view/markup";
3
+ import { createHost } from "../hostCore";
4
+ import { toReact } from "../toReact";
5
+ import { FormViewComponents } from "./components";
6
+ import { FormViewTemplates } from "./templates";
7
+ import { FormViewRegistry } from "./registry";
8
+ /**
9
+ * 2.x ObjectField's children: `<SchemaField key name schema uiSchema/>` per property and
10
+ * `<ObjectFieldSection key title>` per `ui:order` section, from the registry (C6).
11
+ */
12
+ const objectChildren = (registry, fields) => {
13
+ const Field = registry.fields.SchemaField;
14
+ const field = (c) => createElement(Field, { key: c.key, name: c.name, schema: c.schema, uiSchema: c.uiSchema });
15
+ return fields.map((c) => "section" in c ? createElement(registry.components.ObjectFieldSection, { key: c.fields.map((f) => f.key).join("_"), title: c.section }, c.fields.map(field)) : field(c));
16
+ };
17
+ // Getters: components.tsx imports this module, so the defaults are read at render time, not at load.
18
+ export const viewHost = createHost({
19
+ get components() {
20
+ return FormViewComponents;
21
+ },
22
+ get templates() {
23
+ return FormViewTemplates;
24
+ },
25
+ defaultClasses: (names) => names.map(viewClass),
26
+ children: (registry, host, env) => host.template === "ObjectFieldTemplate" ? objectChildren(registry, host.childFields ?? []) : host.children.length ? toReact(host.children[0], env) : undefined,
27
+ });
28
+ /** toReact with the current registry; `hole` is where a template's React children go. */
29
+ export const useViewRender = () => {
30
+ const registry = useContext(FormViewRegistry);
31
+ return (node, hole) => toReact(node, { host: viewHost(registry, hole) });
32
+ };
@@ -0,0 +1,16 @@
1
+ import { createContext } from "react";
2
+ export const FormViewRegistry = createContext({
3
+ fields: {},
4
+ templates: {},
5
+ components: {},
6
+ definitions: {},
7
+ uiSchemaDefinitions: {},
8
+ formContext: {},
9
+ formOptions: {},
10
+ formLocalization: {},
11
+ useItemsAsAdditionalItems: false,
12
+ hideUnmarkedAdditionalProperties: false,
13
+ });
14
+ export const ViewRootContext = createContext({});
15
+ /** The $refs being expanded above a React boundary (shared with Form, ../chain.ts). */
16
+ export { ChainContext as ViewChainContext } from "../chain";
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { isPlainObject } from "../../raw/core/json";
4
+ import { warnComponentsProp } from "../componentsProp";
5
+ import { defined } from "../defined";
6
+ import { formShellMarkup } from "../../raw/model/view/markup";
7
+ import { hole } from "../../raw/model/vnode";
8
+ import { toReact } from "../toReact";
9
+ import { compatComponents } from "./components";
10
+ import { FormViewFields, SchemaField } from "./fields";
11
+ import { viewHost } from "./host";
12
+ import { FormViewRegistry, ViewRootContext } from "./registry";
13
+ import { FormViewTemplates } from "./templates";
14
+ export const FormView = (props) => {
15
+ warnComponentsProp(props.components);
16
+ const { schema, uiSchema = {}, className, fields, templates, slots, formContext = {}, formOptions = {}, formLocalization = {} } = props;
17
+ const registry = useMemo(() => ({
18
+ fields: { ...FormViewFields, ...defined(fields) },
19
+ templates: { ...FormViewTemplates, ...templates },
20
+ components: compatComponents(slots),
21
+ definitions: schema?.definitions,
22
+ uiSchemaDefinitions: uiSchema?.definitions,
23
+ formContext,
24
+ formOptions,
25
+ formLocalization,
26
+ useItemsAsAdditionalItems: props.useItemsAsAdditionalItems ?? false,
27
+ hideUnmarkedAdditionalProperties: props.hideUnmarkedAdditionalProperties ?? false,
28
+ }), [schema, uiSchema, fields, templates, slots, formContext, formOptions, formLocalization, props.useItemsAsAdditionalItems, props.hideUnmarkedAdditionalProperties]);
29
+ const root = useMemo(() => ({ defs: isPlainObject(schema) && isPlainObject(schema.$defs) ? schema.$defs : undefined, fileUploadView: props.fileUploadView, sink: props.sink }), [schema, props.fileUploadView, props.sink]);
30
+ const content = _jsx(registry.fields.SchemaField, { name: "", schema: schema, uiSchema: uiSchema });
31
+ return (_jsx(FormViewRegistry.Provider, { value: registry, children: _jsx(ViewRootContext.Provider, { value: root, children: toReact(formShellMarkup(className, [hole()]), { host: viewHost(registry, content) }) }) }));
32
+ };
33
+ export { SchemaField };