@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,79 @@
1
+ // Path handling for the RAW core (§2.4). Internal paths are segment arrays; the
2
+ // Formik string form (`a[0].b`) is derived. No formik import: its getIn would pull
3
+ // React into RAW. Prototype keys are never traversed (SEC-8 / SEC-FMK-5).
4
+ import { hasOwn, PROTOTYPE_KEYS } from "./json";
5
+ /** Splits a Formik/lodash path string: `a.b[0].c` -> ["a", "b", 0, "c"]. */
6
+ export const toPath = (path) => {
7
+ if (Array.isArray(path))
8
+ return path;
9
+ if (path === "")
10
+ return [];
11
+ const segments = [];
12
+ path.replace(/\[(\d+)\]|\[["']([^"']*)["']\]|([^.[\]]+)/g, (_m, index, quoted, plain) => {
13
+ if (index !== undefined)
14
+ segments.push(Number(index));
15
+ else
16
+ segments.push(quoted !== undefined ? quoted : plain);
17
+ return "";
18
+ });
19
+ return segments;
20
+ };
21
+ /** Formik string form of a path: ["a", 0, "b"] -> "a[0].b"; root is "". */
22
+ export const toFormikPath = (path) => path.reduce((acc, segment) => {
23
+ if (typeof segment === "number")
24
+ return `${acc}[${segment}]`;
25
+ return acc === "" ? segment : `${acc}.${segment}`;
26
+ }, "");
27
+ export const isPrototypeKey = (key) => PROTOTYPE_KEYS.has(key);
28
+ /** A key the Formik string form cannot address without changing its meaning (Q-FMK-4). */
29
+ export const isAmbiguousKey = (key) => /[.[\]]/.test(key);
30
+ /** Reads a value; undefined when any step is missing, wrong-typed or a prototype key. */
31
+ export const getIn = (value, path) => {
32
+ let current = value;
33
+ for (const segment of toPath(path)) {
34
+ if (current === null || typeof current !== "object")
35
+ return undefined;
36
+ const key = String(segment);
37
+ if (isPrototypeKey(key) || !hasOwn(current, key))
38
+ return undefined;
39
+ current = current[key];
40
+ }
41
+ return current;
42
+ };
43
+ /** Formik/lodash: a missing container becomes an array when the next key is a non-negative integer. */
44
+ const isIndex = (segment) => typeof segment === "number" || /^(0|[1-9]\d*)$/.test(segment);
45
+ const cloneContainer = (value, nextSegment) => {
46
+ if (Array.isArray(value))
47
+ return value.slice();
48
+ if (value !== null && typeof value === "object")
49
+ return { ...value };
50
+ return isIndex(nextSegment) ? [] : {};
51
+ };
52
+ /**
53
+ * Immutable write. Returns the original value unchanged when the path contains a
54
+ * prototype key (the caller reports KEY_REJECTED). Wrong-typed intermediate values
55
+ * are replaced by a fresh container, like Formik's setIn.
56
+ */
57
+ export const setIn = (value, path, next) => {
58
+ const segments = toPath(path);
59
+ if (segments.length === 0)
60
+ return next;
61
+ if (segments.some((s) => typeof s === "string" && isPrototypeKey(s)))
62
+ return value;
63
+ const write = (current, index) => {
64
+ const segment = segments[index];
65
+ const container = cloneContainer(current, segment);
66
+ const key = String(segment);
67
+ if (index === segments.length - 1) {
68
+ if (next === undefined && !Array.isArray(container))
69
+ delete container[key];
70
+ else
71
+ container[key] = next;
72
+ return container;
73
+ }
74
+ const child = hasOwn(current, key) ? current[key] : undefined;
75
+ container[key] = write(child, index + 1);
76
+ return container;
77
+ };
78
+ return write(value, 0);
79
+ };
@@ -0,0 +1 @@
1
+ export const FILE_UPLOAD_VIEW = "todo";
@@ -0,0 +1,3 @@
1
+ export const OPTIONAL_NUMBER_INITIAL = "absent";
2
+ /** `undefined` means "leave the key out". */
3
+ export const optionalNumberInitialValue = (policy = OPTIONAL_NUMBER_INITIAL) => policy === "zero" ? 0 : policy === "empty" ? "" : undefined;
@@ -0,0 +1,2 @@
1
+ export const MULTI_SELECT_STORAGE = "strings";
2
+ export const BOOLEAN_RADIO_STORAGE = "strings";
@@ -0,0 +1,97 @@
1
+ import { hasOwn, isPlainObject, PROTOTYPE_KEYS } from "./json";
2
+ import { ignoreIssues, issue } from "./issues";
3
+ import { mergeSchemas } from "./merge";
4
+ /** Maximum alias hops / nested expansions of the same chain (plan §5.2 SEC-9). */
5
+ export const MAX_REF_DEPTH = 32;
6
+ const decode = (segment) => {
7
+ let s = segment.replace(/~1/g, "/").replace(/~0/g, "~");
8
+ try {
9
+ s = decodeURIComponent(s);
10
+ }
11
+ catch {
12
+ // keep the raw segment when it is not valid percent-encoding
13
+ }
14
+ return s;
15
+ };
16
+ /** Parses `#/definitions/a~1b` style pointers; undefined for anything else. */
17
+ export const parseRef = (ref) => {
18
+ const match = /^#\/(definitions|\$defs)\/(.+)$/.exec(ref);
19
+ if (!match)
20
+ return undefined;
21
+ return { root: match[1], segments: match[2].split("/").map(decode) };
22
+ };
23
+ const walk = (container, segments) => {
24
+ let current = container;
25
+ for (const segment of segments) {
26
+ if (PROTOTYPE_KEYS.has(segment) || !hasOwn(current, segment))
27
+ return undefined;
28
+ current = current[segment];
29
+ }
30
+ return current;
31
+ };
32
+ /** uiSchema definitions are keyed without the intermediate `properties` segments (2.x mapping). */
33
+ const uiTarget = (ui, segments) => walk(ui, segments.filter((s) => s !== "properties"));
34
+ /**
35
+ * Resolves the `$ref` of one schema node. Never throws: unsupported, missing,
36
+ * cyclic or too deep references produce an issue and a schema without `$ref`.
37
+ */
38
+ export const resolveRefs = (schema, uiSchema, ctx) => {
39
+ const sink = ctx.sink ?? ignoreIssues;
40
+ if (!isPlainObject(schema) || typeof schema.$ref !== "string")
41
+ return { schema, uiSchema };
42
+ const visited = new Set();
43
+ let current = schema;
44
+ let ui = uiSchema ?? {};
45
+ let depth = 0;
46
+ while (isPlainObject(current) && typeof current.$ref === "string") {
47
+ const ref = current.$ref;
48
+ const { $ref: _drop, ...rest } = current;
49
+ if (visited.has(ref)) {
50
+ sink(issue("REF_CYCLE", ctx.path, ref));
51
+ return { schema: rest, uiSchema: ui };
52
+ }
53
+ if (depth >= MAX_REF_DEPTH) {
54
+ sink(issue("REF_DEPTH_EXCEEDED", ctx.path, ref));
55
+ return { schema: rest, uiSchema: ui };
56
+ }
57
+ visited.add(ref);
58
+ depth += 1;
59
+ const pointer = parseRef(ref);
60
+ if (!pointer) {
61
+ sink(issue("REF_UNSUPPORTED", ctx.path, ref));
62
+ return { schema: rest, uiSchema: ui };
63
+ }
64
+ const source = pointer.root === "definitions" ? ctx.definitions : ctx.defs;
65
+ const target = walk(source, pointer.segments);
66
+ if (!isPlainObject(target)) {
67
+ sink(issue("REF_NOT_FOUND", ctx.path, ref));
68
+ return { schema: rest, uiSchema: ui };
69
+ }
70
+ const uiDefinition = pointer.root === "definitions" ? uiTarget(ctx.uiSchemaDefinitions, pointer.segments) : undefined;
71
+ ui = mergeSchemas(isPlainObject(uiDefinition) ? uiDefinition : {}, ui);
72
+ current = mergeSchemas(target, rest);
73
+ if (!hasOwn(target, "$ref"))
74
+ delete current.$ref;
75
+ }
76
+ return { schema: current, uiSchema: ui };
77
+ };
78
+ /**
79
+ * 2.x-compatible signature (src/utils/solveReferences.ts): `definitions` is the
80
+ * root `definitions`. `$defs` is read from the same object when given via ctx.
81
+ */
82
+ export const solveReferences = (schema, definitions, uiSchema, uiSchemaDefinitions, options = {}) => resolveRefs(schema, uiSchema, { ...options, definitions, uiSchemaDefinitions });
83
+ /** Q-REF-5 (kept, documented): only `properties` are inspected. Cycle-safe (Q-PP-3). */
84
+ export const hasReferences = (schema, seen = new Set()) => {
85
+ const properties = isPlainObject(schema) ? schema.properties : undefined;
86
+ if (!isPlainObject(properties) || seen.has(schema))
87
+ return false;
88
+ seen.add(schema);
89
+ return Object.keys(properties).some((key) => {
90
+ const value = properties[key];
91
+ if (!isPlainObject(value))
92
+ return false;
93
+ if (value.properties)
94
+ return hasReferences(value, seen);
95
+ return Object.keys(value).includes("$ref");
96
+ });
97
+ };
@@ -0,0 +1,68 @@
1
+ import { isSchemaObject } from "./json";
2
+ /** Same answer as 2.x getTypes.getSchemaType for every input 2.x accepted. */
3
+ export const getSchemaType = (schema) => {
4
+ if (!isSchemaObject(schema))
5
+ return undefined;
6
+ const { type } = schema;
7
+ if (!type && schema.const)
8
+ return guessType(schema.const);
9
+ if (!type && schema.enum)
10
+ return "string";
11
+ if (!type && (schema.properties || schema.additionalProperties))
12
+ return "object";
13
+ if (Array.isArray(type) && type.length === 2 && type.includes("null"))
14
+ return type.find((t) => t !== "null");
15
+ return type;
16
+ };
17
+ /** 2.x guessType (getTypes.ts), unchanged: used for `const` type guessing. */
18
+ export const guessType = (value) => {
19
+ if (Array.isArray(value))
20
+ return "array";
21
+ if (typeof value === "string")
22
+ return "string";
23
+ if (value === null)
24
+ return "null";
25
+ if (typeof value === "boolean")
26
+ return "boolean";
27
+ if (!isNaN(value))
28
+ return "number";
29
+ if (typeof value === "object")
30
+ return "object";
31
+ return "string";
32
+ };
33
+ /**
34
+ * v3 normalisation used by initial values and validation: always one type plus a
35
+ * nullable flag; "any" when nothing can be inferred (never a throw).
36
+ */
37
+ export const normaliseType = (schema) => {
38
+ if (!isSchemaObject(schema))
39
+ return { type: "any", nullable: false };
40
+ const raw = schema.type;
41
+ if (Array.isArray(raw)) {
42
+ const nonNull = raw.filter((t) => t !== "null");
43
+ return { type: nonNull[0] ?? (raw.length ? "null" : "any"), nullable: raw.includes("null") };
44
+ }
45
+ if (raw)
46
+ return { type: raw, nullable: false };
47
+ if (schema.const !== undefined)
48
+ return { type: guessType(schema.const), nullable: false };
49
+ if (schema.enum && schema.enum.length > 0) {
50
+ const kinds = new Set(schema.enum.map((v) => (v === null ? "null" : guessType(v))));
51
+ return { type: kinds.size === 1 ? [...kinds][0] : "any", nullable: kinds.has("null") };
52
+ }
53
+ if (schema.properties || schema.additionalProperties)
54
+ return { type: "object", nullable: false };
55
+ if (schema.items || schema.additionalItems)
56
+ return { type: "array", nullable: false };
57
+ return { type: "any", nullable: false };
58
+ };
59
+ /** Default value used when an item or property is created (2.x getDefaultValueForType). */
60
+ export const defaultValueForType = (type) => {
61
+ if (type && !Array.isArray(type)) {
62
+ if (type === "array")
63
+ return [];
64
+ if (type === "object")
65
+ return {};
66
+ }
67
+ return undefined;
68
+ };
@@ -0,0 +1,25 @@
1
+ // setTitleValues and immutablySwapItems ported from 2.x. setTitleValues no longer
2
+ // throws when the stored value at `name` is not an array (2.x: `getIn(...)[index]`).
3
+ import { getIn } from "./paths";
4
+ // Replaces ${key} placeholders in a collapsible title with the item's values.
5
+ export const setTitleValues = (name, title, defaultTitle, values) => {
6
+ const match = name.match(/^([a-zA-Z_$][\w[\].$]*)\[(\d+)\]$/);
7
+ const base = match ? match[1] : name;
8
+ const index = match ? parseInt(match[2], 10) : -1;
9
+ const container = getIn(values, base);
10
+ const itemValues = match ? (Array.isArray(container) ? container[index] : undefined) : container;
11
+ const fallbackName = base.split(".").slice(-1)[0];
12
+ return title.replace(/\$\{([\w$.:]+)\}/g, (placeholder) => {
13
+ const key = placeholder.slice(2, -1);
14
+ const value = itemValues ? getIn(itemValues, key) : undefined;
15
+ if (key === "index")
16
+ return (index + 1).toString();
17
+ return value ? String(value) : defaultTitle || fallbackName;
18
+ });
19
+ };
20
+ export function immutablySwapItems(items, firstIndex, secondIndex) {
21
+ const results = items.slice();
22
+ results[firstIndex] = items[secondIndex];
23
+ results[secondIndex] = items[firstIndex];
24
+ return results;
25
+ }
@@ -0,0 +1,14 @@
1
+ import { issue } from "./issues";
2
+ import { MAX_SCHEMA_DEPTH } from "./json";
3
+ /** True when `node` may be expanded below `trail`; otherwise reports REF_CYCLE or REF_DEPTH_EXCEEDED and returns false. */
4
+ export const mayEnter = (node, trail, sink, path) => {
5
+ if (trail.includes(node)) {
6
+ sink(issue("REF_CYCLE", path || undefined));
7
+ return false;
8
+ }
9
+ if (trail.length >= MAX_SCHEMA_DEPTH) {
10
+ sink(issue("REF_DEPTH_EXCEEDED", path || undefined));
11
+ return false;
12
+ }
13
+ return true;
14
+ };
@@ -0,0 +1,68 @@
1
+ import { issue } from "./issues";
2
+ import { isPlainObject } from "./json";
3
+ /** Allowed keys (React names) and the HTML attribute each becomes. */
4
+ const KEYS = {
5
+ placeholder: "placeholder", autoComplete: "autocomplete", inputMode: "inputmode", min: "min", max: "max", step: "step",
6
+ maxLength: "maxlength", className: "class", title: "title", id: "id", tabIndex: "tabindex", disabled: "disabled", readOnly: "readonly",
7
+ };
8
+ /**
9
+ * Style properties (camelCase) allowed in `style`: typography, colour, box and flex/grid layout.
10
+ * Not allowed: positioning (`position`, `inset`, `top`..., `zIndex`), `background(-image)`,
11
+ * `content`, `transform`, `filter`, anything with `url(`, `expression(` or `javascript:` (provisional).
12
+ */
13
+ export const STYLE_PROPERTIES = new Set([
14
+ "color", "backgroundColor", "opacity", "fontFamily", "fontSize", "fontStyle", "fontWeight", "lineHeight", "letterSpacing",
15
+ "textAlign", "textDecoration", "textTransform", "whiteSpace", "wordBreak", "overflowWrap", "verticalAlign",
16
+ "display", "boxSizing", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight", "overflow",
17
+ "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft",
18
+ "border", "borderTop", "borderRight", "borderBottom", "borderLeft", "borderColor", "borderStyle", "borderWidth", "borderRadius",
19
+ "flex", "flexDirection", "flexWrap", "flexGrow", "flexShrink", "flexBasis", "alignItems", "alignSelf", "justifyContent", "gap",
20
+ "rowGap", "columnGap", "gridTemplateColumns", "gridColumn", "gridRow", "breakInside", "breakBefore", "breakAfter",
21
+ "pageBreakInside", "pageBreakBefore", "pageBreakAfter",
22
+ ]);
23
+ const UNSAFE_VALUE = /url\s*\(|expression\s*\(|javascript:|@import|[<>{};\\]/i;
24
+ const kebab = (name) => name.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
25
+ const primitive = (v) => typeof v === "string" || typeof v === "number" || typeof v === "boolean";
26
+ const styleOf = (style, rejected) => {
27
+ if (!isPlainObject(style)) {
28
+ rejected.push("style");
29
+ return undefined;
30
+ }
31
+ const rules = [];
32
+ for (const [name, value] of Object.entries(style)) {
33
+ if (STYLE_PROPERTIES.has(name) && (typeof value === "string" || typeof value === "number") && !UNSAFE_VALUE.test(String(value)))
34
+ rules.push(`${kebab(name)}:${value}`);
35
+ else
36
+ rejected.push(`style.${name}`);
37
+ }
38
+ return rules.length ? rules.join(";") : undefined;
39
+ };
40
+ /** `{attrs, rejected}`: HTML attributes for a library element; rejected keys are reported on `sink`. */
41
+ export const filterUiProps = (uiProps, path = "", sink) => {
42
+ const attrs = {};
43
+ const rejected = [];
44
+ if (uiProps === undefined || uiProps === null)
45
+ return { attrs, rejected };
46
+ if (!isPlainObject(uiProps))
47
+ rejected.push("(not an object)");
48
+ else {
49
+ for (const [key, value] of Object.entries(uiProps)) {
50
+ const isData = /^data-[a-z0-9-]+$/i.test(key) && !/^data-(fjsf-|keyword$)/i.test(key);
51
+ const isAria = /^aria-[a-z]+$/i.test(key);
52
+ if (key === "style") {
53
+ const css = styleOf(value, rejected);
54
+ if (css)
55
+ attrs.style = css;
56
+ }
57
+ else if ((isData || isAria || Object.prototype.hasOwnProperty.call(KEYS, key)) && primitive(value)) {
58
+ attrs[isData || isAria ? key.toLowerCase() : KEYS[key]] = value;
59
+ }
60
+ else
61
+ rejected.push(key);
62
+ }
63
+ }
64
+ if (sink)
65
+ for (const key of rejected)
66
+ sink(issue("PROP_REJECTED", path, key));
67
+ return { attrs, rejected };
68
+ };
@@ -0,0 +1,47 @@
1
+ import { isPlainObject } from "./json";
2
+ /** Flattens `ui:*` keys (prefix removed) and `ui:options` into one object (2.x semantics). */
3
+ export const extractUiSchema = (ui = {}) => {
4
+ const schema = isPlainObject(ui) ? { ...ui } : {};
5
+ if (schema.props !== undefined)
6
+ schema["ui:props"] = { ...(schema["ui:props"] ?? {}), ...(schema.props ?? {}) };
7
+ const { "ui:options": options = {}, ...rest } = schema;
8
+ const result = {};
9
+ for (const key of Object.keys(rest))
10
+ result[key.replace("ui:", "")] = rest[key];
11
+ return { ...result, ...(isPlainObject(options) ? options : {}) };
12
+ };
13
+ const fieldsOf = (order) => order.flatMap((entry) => (typeof entry === "string" ? entry : entry?.fields ?? []));
14
+ export const getHiddenProperties = (order, properties) => {
15
+ if (!Array.isArray(order) || order.includes("*"))
16
+ return [];
17
+ const listed = fieldsOf(order);
18
+ return properties.filter((key) => !listed.includes(key));
19
+ };
20
+ export function orderByUiSchema(order, allProperties) {
21
+ if (order === undefined || allProperties === undefined)
22
+ return allProperties;
23
+ if (!Array.isArray(order))
24
+ return allProperties;
25
+ if (!order.includes("*"))
26
+ return order;
27
+ const unique = [...new Set(order)];
28
+ const listed = fieldsOf(unique);
29
+ const result = [];
30
+ for (const entry of unique) {
31
+ if (entry === "*")
32
+ result.push(...allProperties.filter((p) => !listed.includes(p)));
33
+ else
34
+ result.push(entry);
35
+ }
36
+ return result;
37
+ }
38
+ export function orderAdditionalProperties(order, values) {
39
+ if (!Array.isArray(order) || order.length === 0)
40
+ return values;
41
+ const relevant = fieldsOf(order).filter((item) => values.includes(item) || item === "*");
42
+ return orderByUiSchema(relevant, values);
43
+ }
44
+ export const getTitle = ({ title, uiSchema, schema, name }) => uiSchema?.["ui:options"]?.hideTitle
45
+ ? undefined
46
+ : title || uiSchema?.["ui:title"] || schema?.title || name?.split(".")[name.split(".").length - 1];
47
+ export const getDescription = ({ description, uiSchema, schema }) => description || uiSchema?.["ui:options"]?.description || uiSchema?.["ui:description"] || schema?.description;
@@ -0,0 +1,80 @@
1
+ import { controlEvent, delegate, isTextControl } from "./delegate";
2
+ export const bindEvents = (core, target) => {
3
+ const undelegate = delegate(target, core.records, (on, event, el) => {
4
+ switch (event.type) {
5
+ case "input":
6
+ case "change": {
7
+ if (!on.change)
8
+ break;
9
+ if (isTextControl(el)) {
10
+ // React's onChange: `input` or `change`, once per new value
11
+ const value = el.value;
12
+ if (core.tracked.get(el) === value)
13
+ break;
14
+ core.tracked.set(el, value);
15
+ core.dispatch(on.change, { value });
16
+ }
17
+ else if (event.type === "change" && !core.uploads.handle(on.change, event, el))
18
+ core.dispatch(on.change, controlEvent(el));
19
+ break;
20
+ }
21
+ case "focusout": {
22
+ // React's onBlur is focusout: it also fires on a container when focus leaves one of its controls
23
+ const related = event.relatedTarget;
24
+ if (on.focusout)
25
+ core.dispatch(on.focusout, { leftContainer: !related || !el.contains(related) });
26
+ else if (on.blur)
27
+ core.dispatch(on.blur, { value: event.target?.value });
28
+ break;
29
+ }
30
+ case "focusin":
31
+ if (on.focus)
32
+ core.dispatch(on.focus);
33
+ break;
34
+ case "paste":
35
+ if (on.paste) {
36
+ event.preventDefault();
37
+ core.dispatch(on.paste, { value: event.clipboardData?.getData("text")?.trim() ?? "" });
38
+ }
39
+ break;
40
+ case "mousedown":
41
+ if (on.mousedown)
42
+ event.preventDefault();
43
+ break;
44
+ case "keydown":
45
+ // Q-SEL-2: Enter in a search input never submits the form (the document listener still selects).
46
+ if (on.keydown?.type === "preventEnter" && event.key === "Enter")
47
+ event.preventDefault();
48
+ break;
49
+ case "click":
50
+ if (!on.click)
51
+ break;
52
+ if (el.tagName === "A" || on.click.type === "preventDefault")
53
+ event.preventDefault();
54
+ if (on.click.type !== "preventDefault" && !core.uploads.handle(on.click, event, el))
55
+ core.dispatch(on.click);
56
+ break;
57
+ case "submit":
58
+ if (on.submit) {
59
+ event.preventDefault();
60
+ void core.store.submitForm().catch((error) => globalThis.console?.warn?.("fjsf: an unhandled error was caught from submit", error));
61
+ }
62
+ break;
63
+ default: {
64
+ // dragenter / dragleave / dragover / drop: the files upload
65
+ const action = on[event.type];
66
+ if (action)
67
+ core.uploads.handle(action, event, el);
68
+ }
69
+ }
70
+ });
71
+ // 2.x listened on the document while a searchable dropdown was open; one listener per controller here.
72
+ const doc = target.ownerDocument;
73
+ // Q-SEL-1: only the open select whose container holds the key's target (the focused one) reacts.
74
+ const onKey = (e) => [...core.keyActions.values()].filter(({ el }) => el.contains(e.target)).forEach(({ action }) => core.dispatch(action, { keyName: e.key }));
75
+ doc.addEventListener("keydown", onKey);
76
+ return () => {
77
+ undelegate();
78
+ doc.removeEventListener("keydown", onKey);
79
+ };
80
+ };
@@ -0,0 +1,23 @@
1
+ import { createFormContext, formField, formShell } from "../model/form";
2
+ import { buildViewNode } from "../model/view";
3
+ import { formShellMarkup } from "../model/view/markup";
4
+ import { toVNode } from "../model/view/toVNode";
5
+ export const buildTree = (schema, uiSchema, state, ui, o, sink) => {
6
+ const customFields = Object.keys(o.fields ?? {});
7
+ if (o.mode === "view") {
8
+ const view = buildViewNode(schema, uiSchema ?? {}, state.values, { customFields, formLocalization: o.formLocalization, sink, fileUploadView: o.fileUploadView });
9
+ return { tree: formShellMarkup(o.className, [toVNode(view)]) };
10
+ }
11
+ const ctx = createFormContext(schema, uiSchema, { values: state.values, errors: state.errors, touched: state.touched, submitting: state.isSubmitting }, {
12
+ customFields,
13
+ formLocalization: o.formLocalization ?? {},
14
+ formOptions: o.formOptions ?? {},
15
+ locale: o.locale,
16
+ ui,
17
+ hideUnmarkedAdditionalProperties: o.hideUnmarkedAdditionalProperties,
18
+ orderable: !!o.orderable,
19
+ sink,
20
+ });
21
+ const content = formField(ctx, { name: "", schema, ui: uiSchema ?? {} }, []);
22
+ return { tree: formShell(content, { className: o.className, hideSubmit: !!o.hideSubmit, submitting: state.isSubmitting }), ctx };
23
+ };
@@ -0,0 +1,83 @@
1
+ import { bindEvents } from "./bind";
2
+ import { createCore } from "./core";
3
+ import { renderCore } from "./render";
4
+ export class FormController {
5
+ core;
6
+ unbind;
7
+ unsubscribe;
8
+ destroyed = false;
9
+ constructor(init) {
10
+ this.core = createCore(init, (core) => renderCore(core, this));
11
+ const { ui: _ui, ...state } = init.state ?? {};
12
+ if (Object.keys(state).length)
13
+ this.core.store.setState(state);
14
+ this.unsubscribe = this.core.store.subscribe(() => this.core.schedule());
15
+ }
16
+ /** The RAW store (the state adapter): values, errors, touched, isSubmitting, submitCount. */
17
+ get store() {
18
+ return this.core.store;
19
+ }
20
+ /** Draws the form into `target` and binds its events; idempotent per target. */
21
+ mount(target) {
22
+ if (this.destroyed || this.core.target === target)
23
+ return;
24
+ this.unbind?.();
25
+ this.core.target = target;
26
+ this.unbind = bindEvents(this.core, target);
27
+ this.core.render();
28
+ }
29
+ /** New schema / uiSchema / values / options; the form is redrawn (in place). */
30
+ update(partial) {
31
+ const core = this.core;
32
+ if ("schema" in partial)
33
+ core.schema = partial.schema;
34
+ if ("uiSchema" in partial)
35
+ core.uiSchema = partial.uiSchema;
36
+ if (partial.options)
37
+ core.options = { ...core.options, ...partial.options };
38
+ if ("schema" in partial || "uiSchema" in partial)
39
+ core.reported.clear();
40
+ if ("values" in partial)
41
+ core.act(() => core.store.setValues(partial.values, false));
42
+ core.schedule();
43
+ }
44
+ /** Removes every listener (the document one too) and stops the uploads' timers; idempotent. */
45
+ destroy() {
46
+ if (this.destroyed)
47
+ return;
48
+ this.destroyed = true;
49
+ this.unbind?.();
50
+ this.unsubscribe();
51
+ this.core.uploads.destroy();
52
+ this.core.emitter.clear();
53
+ this.core.target = undefined;
54
+ this.core.keyActions.clear();
55
+ }
56
+ getState() {
57
+ return { ...this.core.store.getState(), ui: this.core.ui };
58
+ }
59
+ /** The VNode tree of the last render: what every serialiser draws (toString / toDOM / toReact). */
60
+ getViewModel() {
61
+ return this.core.tree;
62
+ }
63
+ /** The 2.x error map of `values`; without values, of the current ones, which then become the errors. */
64
+ async validate(values) {
65
+ const errors = await this.core.store.validateForm(values);
66
+ if (values === undefined)
67
+ this.core.store.setState({ errors });
68
+ return errors;
69
+ }
70
+ /** What the submit button does: touch all, validate, then `submit` and `options.onSubmit` when valid. */
71
+ submit() {
72
+ return this.core.store.submitForm().catch((error) => globalThis.console?.warn?.("fjsf: an unhandled error was caught from submit", error));
73
+ }
74
+ on(type, handler) {
75
+ return this.core.emitter.on(type, handler);
76
+ }
77
+ off(type, handler) {
78
+ this.core.emitter.off(type, handler);
79
+ }
80
+ once(type, handler) {
81
+ return this.core.emitter.once(type, handler);
82
+ }
83
+ }
@@ -0,0 +1,63 @@
1
+ import { createStore } from "../store/createStore";
2
+ import { createEmitter } from "./emitter";
3
+ import { openPicker, runAction } from "./effects";
4
+ import { createUploads } from "./upload";
5
+ const warn = (what) => (error) => globalThis.console?.warn?.(`fjsf: ${what}`, error);
6
+ export const createCore = (init, render) => {
7
+ const core = {
8
+ schema: init.schema,
9
+ uiSchema: init.uiSchema,
10
+ options: init.options ?? {},
11
+ ui: init.state?.ui ?? {},
12
+ emitter: createEmitter(),
13
+ records: new WeakMap(),
14
+ tracked: new WeakMap(),
15
+ keyActions: new Map(),
16
+ seen: new Set(),
17
+ reported: new Set(),
18
+ scrolled: new Map(),
19
+ slotProps: new Map(),
20
+ scheduled: false,
21
+ };
22
+ core.emit = (event) => core.emitter.emit(event);
23
+ core.act = (update) => void update().catch(warn("a state update failed"));
24
+ core.render = () => render(core);
25
+ core.schedule = () => {
26
+ if (core.scheduled || !core.target)
27
+ return;
28
+ core.scheduled = true;
29
+ queueMicrotask(() => {
30
+ core.scheduled = false;
31
+ core.render();
32
+ });
33
+ };
34
+ core.element = (id) => [...(core.target?.querySelectorAll("[id]") ?? [])].find((el) => el.id === id);
35
+ core.store = createStore({
36
+ initialValues: init.values ?? {},
37
+ validationSchema: core.options.validationSchema,
38
+ validateOnChange: core.options.validateOnChange,
39
+ validateOnBlur: core.options.validateOnBlur,
40
+ onValidated: (errors) => core.emit({ type: "validate", errors }),
41
+ onSubmit: (values) => {
42
+ core.emit({ type: "submit", values });
43
+ return core.options.onSubmit?.(values);
44
+ },
45
+ });
46
+ core.uploads = createUploads({
47
+ uploads: () => core.options.uploads,
48
+ values: () => core.store.getState().values,
49
+ setValue: (path, value) => core.act(() => core.store.setFieldValue(path, value)),
50
+ rerender: core.schedule,
51
+ pick: (id) => core.element(id)?.click(),
52
+ });
53
+ core.dispatch = (action, event = {}) => runAction({
54
+ store: core.store,
55
+ ui: () => core.ui,
56
+ setUi: (ui) => ((core.ui = ui), core.schedule()),
57
+ emit: core.emit,
58
+ askKey: core.options.askKey ?? (() => (typeof globalThis.prompt === "function" ? globalThis.prompt("Give key") : null)),
59
+ picker: (id) => openPicker(core.element(id)),
60
+ failed: warn("an action failed"),
61
+ }, action, event);
62
+ return core;
63
+ };