@dwidge/json-forms-expo 0.0.2

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 (301) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +30 -0
  3. package/dist/cjs/FileAttachment/AttachmentEdit.js +14 -0
  4. package/dist/cjs/FileAttachment/AttachmentEdit.js.map +1 -0
  5. package/dist/cjs/FileAttachment/AttachmentListEdit.js +21 -0
  6. package/dist/cjs/FileAttachment/AttachmentListEdit.js.map +1 -0
  7. package/dist/cjs/FileAttachment/AttachmentListView.js +13 -0
  8. package/dist/cjs/FileAttachment/AttachmentListView.js.map +1 -0
  9. package/dist/cjs/FileAttachment/AttachmentScreen.js +14 -0
  10. package/dist/cjs/FileAttachment/AttachmentScreen.js.map +1 -0
  11. package/dist/cjs/FileAttachment/AttachmentView.js +14 -0
  12. package/dist/cjs/FileAttachment/AttachmentView.js.map +1 -0
  13. package/dist/cjs/FileAttachment/index.js +24 -0
  14. package/dist/cjs/FileAttachment/index.js.map +1 -0
  15. package/dist/cjs/FileAttachment/useFileAttachmentUrl.js +12 -0
  16. package/dist/cjs/FileAttachment/useFileAttachmentUrl.js.map +1 -0
  17. package/dist/cjs/FileAttachment/useFileUrl.js +11 -0
  18. package/dist/cjs/FileAttachment/useFileUrl.js.map +1 -0
  19. package/dist/cjs/Form/EditFormAttachmentScreen.js +61 -0
  20. package/dist/cjs/Form/EditFormAttachmentScreen.js.map +1 -0
  21. package/dist/cjs/Form/FormEdit.js +12 -0
  22. package/dist/cjs/Form/FormEdit.js.map +1 -0
  23. package/dist/cjs/Form/FormEditScreen.js +29 -0
  24. package/dist/cjs/Form/FormEditScreen.js.map +1 -0
  25. package/dist/cjs/Form/FormListEdit.js +22 -0
  26. package/dist/cjs/Form/FormListEdit.js.map +1 -0
  27. package/dist/cjs/Form/FormListScreen.js +28 -0
  28. package/dist/cjs/Form/FormListScreen.js.map +1 -0
  29. package/dist/cjs/Form/FormListView.js +18 -0
  30. package/dist/cjs/Form/FormListView.js.map +1 -0
  31. package/dist/cjs/Form/FormSelectScreen.js +21 -0
  32. package/dist/cjs/Form/FormSelectScreen.js.map +1 -0
  33. package/dist/cjs/Form/FormSelectView.js +16 -0
  34. package/dist/cjs/Form/FormSelectView.js.map +1 -0
  35. package/dist/cjs/Form/FormView.js +12 -0
  36. package/dist/cjs/Form/FormView.js.map +1 -0
  37. package/dist/cjs/Form/index.js +26 -0
  38. package/dist/cjs/Form/index.js.map +1 -0
  39. package/dist/cjs/FormAttachment/FormAttachmentEdit.js +30 -0
  40. package/dist/cjs/FormAttachment/FormAttachmentEdit.js.map +1 -0
  41. package/dist/cjs/FormAttachment/FormAttachmentEditScreen.js +15 -0
  42. package/dist/cjs/FormAttachment/FormAttachmentEditScreen.js.map +1 -0
  43. package/dist/cjs/FormAttachment/FormAttachmentListEdit.js +27 -0
  44. package/dist/cjs/FormAttachment/FormAttachmentListEdit.js.map +1 -0
  45. package/dist/cjs/FormAttachment/FormAttachmentListScreen.js +31 -0
  46. package/dist/cjs/FormAttachment/FormAttachmentListScreen.js.map +1 -0
  47. package/dist/cjs/FormAttachment/FormAttachmentListView.js +21 -0
  48. package/dist/cjs/FormAttachment/FormAttachmentListView.js.map +1 -0
  49. package/dist/cjs/FormAttachment/FormAttachmentView.js +15 -0
  50. package/dist/cjs/FormAttachment/FormAttachmentView.js.map +1 -0
  51. package/dist/cjs/FormAttachment/index.js +23 -0
  52. package/dist/cjs/FormAttachment/index.js.map +1 -0
  53. package/dist/cjs/hooks/FileApi.js +15 -0
  54. package/dist/cjs/hooks/FileApi.js.map +1 -0
  55. package/dist/cjs/hooks/FileAttachmentApi.js +13 -0
  56. package/dist/cjs/hooks/FileAttachmentApi.js.map +1 -0
  57. package/dist/cjs/hooks/FormApi.js +13 -0
  58. package/dist/cjs/hooks/FormApi.js.map +1 -0
  59. package/dist/cjs/hooks/FormAttachmentApi.js +12 -0
  60. package/dist/cjs/hooks/FormAttachmentApi.js.map +1 -0
  61. package/dist/cjs/hooks/FormsContext.js +30 -0
  62. package/dist/cjs/hooks/FormsContext.js.map +1 -0
  63. package/dist/cjs/hooks/createApi.js +40 -0
  64. package/dist/cjs/hooks/createApi.js.map +1 -0
  65. package/dist/cjs/hooks/index.js +27 -0
  66. package/dist/cjs/hooks/index.js.map +1 -0
  67. package/dist/cjs/hooks/useCreateBlankAttachment.js +21 -0
  68. package/dist/cjs/hooks/useCreateBlankAttachment.js.map +1 -0
  69. package/dist/cjs/hooks/useCreateBlankForm.js +12 -0
  70. package/dist/cjs/hooks/useCreateBlankForm.js.map +1 -0
  71. package/dist/cjs/hooks/useCreateBlankFormAttachment.js +14 -0
  72. package/dist/cjs/hooks/useCreateBlankFormAttachment.js.map +1 -0
  73. package/dist/cjs/hooks/useParams.js +8 -0
  74. package/dist/cjs/hooks/useParams.js.map +1 -0
  75. package/dist/cjs/index.js +22 -0
  76. package/dist/cjs/index.js.map +1 -0
  77. package/dist/cjs/package.json +3 -0
  78. package/dist/cjs/types/File2.js +3 -0
  79. package/dist/cjs/types/File2.js.map +1 -0
  80. package/dist/cjs/types/FileAttachment.js +3 -0
  81. package/dist/cjs/types/FileAttachment.js.map +1 -0
  82. package/dist/cjs/types/Form1.js +3 -0
  83. package/dist/cjs/types/Form1.js.map +1 -0
  84. package/dist/cjs/types/FormAttachment.js +3 -0
  85. package/dist/cjs/types/FormAttachment.js.map +1 -0
  86. package/dist/cjs/types/index.js +21 -0
  87. package/dist/cjs/types/index.js.map +1 -0
  88. package/dist/esm/FileAttachment/AttachmentEdit.js +10 -0
  89. package/dist/esm/FileAttachment/AttachmentEdit.js.map +1 -0
  90. package/dist/esm/FileAttachment/AttachmentListEdit.js +14 -0
  91. package/dist/esm/FileAttachment/AttachmentListEdit.js.map +1 -0
  92. package/dist/esm/FileAttachment/AttachmentListView.js +9 -0
  93. package/dist/esm/FileAttachment/AttachmentListView.js.map +1 -0
  94. package/dist/esm/FileAttachment/AttachmentScreen.js +10 -0
  95. package/dist/esm/FileAttachment/AttachmentScreen.js.map +1 -0
  96. package/dist/esm/FileAttachment/AttachmentView.js +10 -0
  97. package/dist/esm/FileAttachment/AttachmentView.js.map +1 -0
  98. package/dist/esm/FileAttachment/index.js +8 -0
  99. package/dist/esm/FileAttachment/index.js.map +1 -0
  100. package/dist/esm/FileAttachment/useFileAttachmentUrl.js +8 -0
  101. package/dist/esm/FileAttachment/useFileAttachmentUrl.js.map +1 -0
  102. package/dist/esm/FileAttachment/useFileUrl.js +7 -0
  103. package/dist/esm/FileAttachment/useFileUrl.js.map +1 -0
  104. package/dist/esm/Form/EditFormAttachmentScreen.js +57 -0
  105. package/dist/esm/Form/EditFormAttachmentScreen.js.map +1 -0
  106. package/dist/esm/Form/FormEdit.js +8 -0
  107. package/dist/esm/Form/FormEdit.js.map +1 -0
  108. package/dist/esm/Form/FormEditScreen.js +25 -0
  109. package/dist/esm/Form/FormEditScreen.js.map +1 -0
  110. package/dist/esm/Form/FormListEdit.js +15 -0
  111. package/dist/esm/Form/FormListEdit.js.map +1 -0
  112. package/dist/esm/Form/FormListScreen.js +24 -0
  113. package/dist/esm/Form/FormListScreen.js.map +1 -0
  114. package/dist/esm/Form/FormListView.js +11 -0
  115. package/dist/esm/Form/FormListView.js.map +1 -0
  116. package/dist/esm/Form/FormSelectScreen.js +17 -0
  117. package/dist/esm/Form/FormSelectScreen.js.map +1 -0
  118. package/dist/esm/Form/FormSelectView.js +12 -0
  119. package/dist/esm/Form/FormSelectView.js.map +1 -0
  120. package/dist/esm/Form/FormView.js +8 -0
  121. package/dist/esm/Form/FormView.js.map +1 -0
  122. package/dist/esm/Form/index.js +10 -0
  123. package/dist/esm/Form/index.js.map +1 -0
  124. package/dist/esm/FormAttachment/FormAttachmentEdit.js +26 -0
  125. package/dist/esm/FormAttachment/FormAttachmentEdit.js.map +1 -0
  126. package/dist/esm/FormAttachment/FormAttachmentEditScreen.js +11 -0
  127. package/dist/esm/FormAttachment/FormAttachmentEditScreen.js.map +1 -0
  128. package/dist/esm/FormAttachment/FormAttachmentListEdit.js +20 -0
  129. package/dist/esm/FormAttachment/FormAttachmentListEdit.js.map +1 -0
  130. package/dist/esm/FormAttachment/FormAttachmentListScreen.js +27 -0
  131. package/dist/esm/FormAttachment/FormAttachmentListScreen.js.map +1 -0
  132. package/dist/esm/FormAttachment/FormAttachmentListView.js +14 -0
  133. package/dist/esm/FormAttachment/FormAttachmentListView.js.map +1 -0
  134. package/dist/esm/FormAttachment/FormAttachmentView.js +11 -0
  135. package/dist/esm/FormAttachment/FormAttachmentView.js.map +1 -0
  136. package/dist/esm/FormAttachment/index.js +7 -0
  137. package/dist/esm/FormAttachment/index.js.map +1 -0
  138. package/dist/esm/hooks/FileApi.js +12 -0
  139. package/dist/esm/hooks/FileApi.js.map +1 -0
  140. package/dist/esm/hooks/FileAttachmentApi.js +10 -0
  141. package/dist/esm/hooks/FileAttachmentApi.js.map +1 -0
  142. package/dist/esm/hooks/FormApi.js +10 -0
  143. package/dist/esm/hooks/FormApi.js.map +1 -0
  144. package/dist/esm/hooks/FormAttachmentApi.js +9 -0
  145. package/dist/esm/hooks/FormAttachmentApi.js.map +1 -0
  146. package/dist/esm/hooks/FormsContext.js +26 -0
  147. package/dist/esm/hooks/FormsContext.js.map +1 -0
  148. package/dist/esm/hooks/createApi.js +36 -0
  149. package/dist/esm/hooks/createApi.js.map +1 -0
  150. package/dist/esm/hooks/index.js +11 -0
  151. package/dist/esm/hooks/index.js.map +1 -0
  152. package/dist/esm/hooks/useCreateBlankAttachment.js +14 -0
  153. package/dist/esm/hooks/useCreateBlankAttachment.js.map +1 -0
  154. package/dist/esm/hooks/useCreateBlankForm.js +8 -0
  155. package/dist/esm/hooks/useCreateBlankForm.js.map +1 -0
  156. package/dist/esm/hooks/useCreateBlankFormAttachment.js +10 -0
  157. package/dist/esm/hooks/useCreateBlankFormAttachment.js.map +1 -0
  158. package/dist/esm/hooks/useParams.js +4 -0
  159. package/dist/esm/hooks/useParams.js.map +1 -0
  160. package/dist/esm/index.js +6 -0
  161. package/dist/esm/index.js.map +1 -0
  162. package/dist/esm/package.json +3 -0
  163. package/dist/esm/types/File2.js +2 -0
  164. package/dist/esm/types/File2.js.map +1 -0
  165. package/dist/esm/types/FileAttachment.js +2 -0
  166. package/dist/esm/types/FileAttachment.js.map +1 -0
  167. package/dist/esm/types/Form1.js +2 -0
  168. package/dist/esm/types/Form1.js.map +1 -0
  169. package/dist/esm/types/FormAttachment.js +2 -0
  170. package/dist/esm/types/FormAttachment.js.map +1 -0
  171. package/dist/esm/types/index.js +5 -0
  172. package/dist/esm/types/index.js.map +1 -0
  173. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  174. package/dist/tsconfig.tsbuildinfo +1 -0
  175. package/dist/types/FileAttachment/AttachmentEdit.d.ts +6 -0
  176. package/dist/types/FileAttachment/AttachmentEdit.d.ts.map +1 -0
  177. package/dist/types/FileAttachment/AttachmentListEdit.d.ts +9 -0
  178. package/dist/types/FileAttachment/AttachmentListEdit.d.ts.map +1 -0
  179. package/dist/types/FileAttachment/AttachmentListView.d.ts +9 -0
  180. package/dist/types/FileAttachment/AttachmentListView.d.ts.map +1 -0
  181. package/dist/types/FileAttachment/AttachmentScreen.d.ts +8 -0
  182. package/dist/types/FileAttachment/AttachmentScreen.d.ts.map +1 -0
  183. package/dist/types/FileAttachment/AttachmentView.d.ts +6 -0
  184. package/dist/types/FileAttachment/AttachmentView.d.ts.map +1 -0
  185. package/dist/types/FileAttachment/index.d.ts +8 -0
  186. package/dist/types/FileAttachment/index.d.ts.map +1 -0
  187. package/dist/types/FileAttachment/useFileAttachmentUrl.d.ts +2 -0
  188. package/dist/types/FileAttachment/useFileAttachmentUrl.d.ts.map +1 -0
  189. package/dist/types/FileAttachment/useFileUrl.d.ts +2 -0
  190. package/dist/types/FileAttachment/useFileUrl.d.ts.map +1 -0
  191. package/dist/types/Form/EditFormAttachmentScreen.d.ts +40 -0
  192. package/dist/types/Form/EditFormAttachmentScreen.d.ts.map +1 -0
  193. package/dist/types/Form/FormEdit.d.ts +4 -0
  194. package/dist/types/Form/FormEdit.d.ts.map +1 -0
  195. package/dist/types/Form/FormEditScreen.d.ts +4 -0
  196. package/dist/types/Form/FormEditScreen.d.ts.map +1 -0
  197. package/dist/types/Form/FormListEdit.d.ts +6 -0
  198. package/dist/types/Form/FormListEdit.d.ts.map +1 -0
  199. package/dist/types/Form/FormListScreen.d.ts +8 -0
  200. package/dist/types/Form/FormListScreen.d.ts.map +1 -0
  201. package/dist/types/Form/FormListView.d.ts +5 -0
  202. package/dist/types/Form/FormListView.d.ts.map +1 -0
  203. package/dist/types/Form/FormSelectScreen.d.ts +6 -0
  204. package/dist/types/Form/FormSelectScreen.d.ts.map +1 -0
  205. package/dist/types/Form/FormSelectView.d.ts +8 -0
  206. package/dist/types/Form/FormSelectView.d.ts.map +1 -0
  207. package/dist/types/Form/FormView.d.ts +5 -0
  208. package/dist/types/Form/FormView.d.ts.map +1 -0
  209. package/dist/types/Form/index.d.ts +10 -0
  210. package/dist/types/Form/index.d.ts.map +1 -0
  211. package/dist/types/FormAttachment/FormAttachmentEdit.d.ts +9 -0
  212. package/dist/types/FormAttachment/FormAttachmentEdit.d.ts.map +1 -0
  213. package/dist/types/FormAttachment/FormAttachmentEditScreen.d.ts +5 -0
  214. package/dist/types/FormAttachment/FormAttachmentEditScreen.d.ts.map +1 -0
  215. package/dist/types/FormAttachment/FormAttachmentListEdit.d.ts +11 -0
  216. package/dist/types/FormAttachment/FormAttachmentListEdit.d.ts.map +1 -0
  217. package/dist/types/FormAttachment/FormAttachmentListScreen.d.ts +7 -0
  218. package/dist/types/FormAttachment/FormAttachmentListScreen.d.ts.map +1 -0
  219. package/dist/types/FormAttachment/FormAttachmentListView.d.ts +5 -0
  220. package/dist/types/FormAttachment/FormAttachmentListView.d.ts.map +1 -0
  221. package/dist/types/FormAttachment/FormAttachmentView.d.ts +6 -0
  222. package/dist/types/FormAttachment/FormAttachmentView.d.ts.map +1 -0
  223. package/dist/types/FormAttachment/index.d.ts +7 -0
  224. package/dist/types/FormAttachment/index.d.ts.map +1 -0
  225. package/dist/types/hooks/FileApi.d.ts +35 -0
  226. package/dist/types/hooks/FileApi.d.ts.map +1 -0
  227. package/dist/types/hooks/FileAttachmentApi.d.ts +35 -0
  228. package/dist/types/hooks/FileAttachmentApi.d.ts.map +1 -0
  229. package/dist/types/hooks/FormApi.d.ts +35 -0
  230. package/dist/types/hooks/FormApi.d.ts.map +1 -0
  231. package/dist/types/hooks/FormAttachmentApi.d.ts +35 -0
  232. package/dist/types/hooks/FormAttachmentApi.d.ts.map +1 -0
  233. package/dist/types/hooks/FormsContext.d.ts +20 -0
  234. package/dist/types/hooks/FormsContext.d.ts.map +1 -0
  235. package/dist/types/hooks/createApi.d.ts +36 -0
  236. package/dist/types/hooks/createApi.d.ts.map +1 -0
  237. package/dist/types/hooks/index.d.ts +11 -0
  238. package/dist/types/hooks/index.d.ts.map +1 -0
  239. package/dist/types/hooks/useCreateBlankAttachment.d.ts +10 -0
  240. package/dist/types/hooks/useCreateBlankAttachment.d.ts.map +1 -0
  241. package/dist/types/hooks/useCreateBlankForm.d.ts +6 -0
  242. package/dist/types/hooks/useCreateBlankForm.d.ts.map +1 -0
  243. package/dist/types/hooks/useCreateBlankFormAttachment.d.ts +13 -0
  244. package/dist/types/hooks/useCreateBlankFormAttachment.d.ts.map +1 -0
  245. package/dist/types/hooks/useParams.d.ts +7 -0
  246. package/dist/types/hooks/useParams.d.ts.map +1 -0
  247. package/dist/types/index.d.ts +6 -0
  248. package/dist/types/index.d.ts.map +1 -0
  249. package/dist/types/types/File2.d.ts +16 -0
  250. package/dist/types/types/File2.d.ts.map +1 -0
  251. package/dist/types/types/FileAttachment.d.ts +10 -0
  252. package/dist/types/types/FileAttachment.d.ts.map +1 -0
  253. package/dist/types/types/Form1.d.ts +14 -0
  254. package/dist/types/types/Form1.d.ts.map +1 -0
  255. package/dist/types/types/FormAttachment.d.ts +13 -0
  256. package/dist/types/types/FormAttachment.d.ts.map +1 -0
  257. package/dist/types/types/index.d.ts +5 -0
  258. package/dist/types/types/index.d.ts.map +1 -0
  259. package/package.json +73 -0
  260. package/src/FileAttachment/AttachmentEdit.tsx +14 -0
  261. package/src/FileAttachment/AttachmentListEdit.tsx +45 -0
  262. package/src/FileAttachment/AttachmentListView.tsx +12 -0
  263. package/src/FileAttachment/AttachmentScreen.tsx +21 -0
  264. package/src/FileAttachment/AttachmentView.tsx +14 -0
  265. package/src/FileAttachment/index.ts +7 -0
  266. package/src/FileAttachment/useFileAttachmentUrl.ts +15 -0
  267. package/src/FileAttachment/useFileUrl.ts +12 -0
  268. package/src/Form/EditFormAttachmentScreen.tsx +101 -0
  269. package/src/Form/FormEdit.tsx +15 -0
  270. package/src/Form/FormEditScreen.tsx +54 -0
  271. package/src/Form/FormListEdit.tsx +32 -0
  272. package/src/Form/FormListScreen.tsx +54 -0
  273. package/src/Form/FormListView.tsx +23 -0
  274. package/src/Form/FormSelectScreen.tsx +49 -0
  275. package/src/Form/FormSelectView.tsx +31 -0
  276. package/src/Form/FormView.tsx +11 -0
  277. package/src/Form/index.ts +9 -0
  278. package/src/FormAttachment/FormAttachmentEdit.tsx +72 -0
  279. package/src/FormAttachment/FormAttachmentEditScreen.tsx +21 -0
  280. package/src/FormAttachment/FormAttachmentListEdit.tsx +40 -0
  281. package/src/FormAttachment/FormAttachmentListScreen.tsx +62 -0
  282. package/src/FormAttachment/FormAttachmentListView.tsx +30 -0
  283. package/src/FormAttachment/FormAttachmentView.tsx +25 -0
  284. package/src/FormAttachment/index.ts +6 -0
  285. package/src/hooks/FileApi.ts +13 -0
  286. package/src/hooks/FileAttachmentApi.ts +11 -0
  287. package/src/hooks/FormApi.ts +11 -0
  288. package/src/hooks/FormAttachmentApi.ts +10 -0
  289. package/src/hooks/FormsContext.ts +29 -0
  290. package/src/hooks/createApi.ts +65 -0
  291. package/src/hooks/index.ts +10 -0
  292. package/src/hooks/useCreateBlankAttachment.ts +24 -0
  293. package/src/hooks/useCreateBlankForm.ts +12 -0
  294. package/src/hooks/useCreateBlankFormAttachment.ts +20 -0
  295. package/src/hooks/useParams.ts +9 -0
  296. package/src/index.ts +5 -0
  297. package/src/types/File2.ts +19 -0
  298. package/src/types/FileAttachment.ts +9 -0
  299. package/src/types/Form1.ts +17 -0
  300. package/src/types/FormAttachment.ts +19 -0
  301. package/src/types/index.ts +4 -0
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Boost Software License - Version 1.0 - August 17th, 2003
2
+
3
+ Permission is hereby granted, free of charge, to any person or organization
4
+ obtaining a copy of the software and accompanying documentation covered by
5
+ this license (the "Software") to use, reproduce, display, distribute,
6
+ execute, and transmit the Software, and to prepare derivative works of the
7
+ Software, and to permit third-parties to whom the Software is furnished to
8
+ do so, all subject to the following:
9
+
10
+ The copyright notices in the Software and this entire statement, including
11
+ the above license grant, this restriction and the following disclaimer,
12
+ must be included in all copies of the Software, in whole or in part, and
13
+ all derivative works of the Software, unless such copies or derivative
14
+ works are solely in the form of machine-executable object code generated by
15
+ a source language processor.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
20
+ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
21
+ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
22
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23
+ DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # License
2
+
3
+ Copyright DWJ 2024.
4
+ Distributed under the Boost Software License, Version 1.0.
5
+ https://www.boost.org/LICENSE_1_0.txt
6
+
7
+ # Credits
8
+
9
+ The MIT License
10
+
11
+ Copyright (c) 2017-2019 EclipseSource Munich
12
+ https://github.com/eclipsesource/jsonforms
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in
22
+ all copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30
+ THE SOFTWARE.
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttachmentEdit = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const components_expo_1 = require("@dwidge/components-expo");
9
+ const FileApi_1 = require("../hooks/FileApi");
10
+ const FileAttachmentApi_1 = require("../hooks/FileAttachmentApi");
11
+ const useParams_1 = require("../hooks/useParams");
12
+ const AttachmentEdit = ({ id = (0, useParams_1.useParams)().AttachmentId, attachment: [attachment] = FileAttachmentApi_1.FileAttachmentApi.useItem(id), file: [file, setFile] = FileApi_1.FileApi.useItem(attachment?.FileId), }) => (0, jsx_runtime_1.jsx)(components_expo_1.FileEdit, { file: [file, setFile] });
13
+ exports.AttachmentEdit = AttachmentEdit;
14
+ //# sourceMappingURL=AttachmentEdit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentEdit.js","sourceRoot":"","sources":["../../../src/FileAttachment/AttachmentEdit.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,6DAAmD;AACnD,8CAA2C;AAC3C,kEAA+D;AAC/D,kDAA+C;AAExC,MAAM,cAAc,GAAG,CAAC,EAC7B,EAAE,GAAG,IAAA,qBAAS,GAAE,CAAC,YAAY,EAC7B,UAAU,EAAE,CAAC,UAAU,CAAC,GAAG,qCAAiB,CAAC,OAAO,CAAC,EAAE,CAAC,EACxD,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,iBAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,GAC5D,EAAE,EAAE,CAAC,uBAAC,0BAAQ,IAAC,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,GAAI,CAAC;AAJ7B,QAAA,cAAc,kBAIe"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AttachmentListEdit = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ // Copyright DWJ 2024.
9
+ // Distributed under the Boost Software License, Version 1.0.
10
+ // https://www.boost.org/LICENSE_1_0.txt
11
+ const components_rnw_1 = require("@dwidge/components-rnw");
12
+ const assert_1 = __importDefault(require("assert"));
13
+ const react_1 = require("react");
14
+ const FileAttachmentApi_1 = require("../hooks/FileAttachmentApi");
15
+ const useCreateBlankAttachment_1 = require("../hooks/useCreateBlankAttachment");
16
+ const useParams_1 = require("../hooks/useParams");
17
+ const AttachmentEdit_1 = require("./AttachmentEdit");
18
+ const AttachmentListEdit = ({ ids = (0, useParams_1.useParams)(), elements = FileAttachmentApi_1.FileAttachmentApi.useGetList(ids), selection: [selection, setSelection] = (0, react_1.useState)([]), onCreateAttachment = (0, useCreateBlankAttachment_1.useCreateBlankAttachment)({ AttachIds: ids }), onDeleteAttachmentList = FileAttachmentApi_1.FileAttachmentApi.useDeleteList(), }) => ((0, jsx_runtime_1.jsxs)(components_rnw_1.StyledView, { column: true, children: [(0, jsx_runtime_1.jsx)(components_rnw_1.UnstyledList, { items: elements, keyExtractor: (item) => ((0, assert_1.default)(item.id), item.id), selection: [selection, setSelection], render: (item) => (0, jsx_runtime_1.jsx)(AttachmentEdit_1.AttachmentEdit, { id: item.id }), selectStyle: components_rnw_1.viewStyles.select, style: components_rnw_1.viewStyles.unselect }), (0, jsx_runtime_1.jsxs)(components_rnw_1.StyledView, { row: true, gap: true, center: true, middle: true, children: [(0, jsx_runtime_1.jsx)(components_rnw_1.StyledButton, { icon: "add", onPress: onCreateAttachment }), (0, jsx_runtime_1.jsx)(components_rnw_1.StyledButton, { icon: "remove", onPress: onDeleteAttachmentList &&
19
+ (() => onDeleteAttachmentList(selection.map((id) => ({ id })))) })] })] }));
20
+ exports.AttachmentListEdit = AttachmentListEdit;
21
+ //# sourceMappingURL=AttachmentListEdit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentListEdit.js","sourceRoot":"","sources":["../../../src/FileAttachment/AttachmentListEdit.tsx"],"names":[],"mappings":";;;;;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,2DAKgC;AAChC,oDAA4B;AAC5B,iCAAiC;AACjC,kEAA+D;AAC/D,gFAA6E;AAC7E,kDAAuD;AACvD,qDAAkD;AAE3C,MAAM,kBAAkB,GAAG,CAAC,EACjC,GAAG,GAAG,IAAA,qBAAS,GAAY,EAC3B,QAAQ,GAAG,qCAAiB,CAAC,UAAU,CAAC,GAAG,CAAC,EAC5C,SAAS,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAW,EAAE,CAAC,EAC7D,kBAAkB,GAAG,IAAA,mDAAwB,EAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EACjE,sBAAsB,GAAG,qCAAiB,CAAC,aAAa,EAAE,GAC3D,EAAE,EAAE,CAAC,CACJ,wBAAC,2BAAU,IAAC,MAAM,mBAChB,uBAAC,6BAAY,IACX,KAAK,EAAE,QAAQ,EACf,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAA,gBAAM,EAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,EAClD,SAAS,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,EACpC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAC,+BAAc,IAAC,EAAE,EAAE,IAAI,CAAC,EAAE,GAAI,EACjD,WAAW,EAAE,2BAAU,CAAC,MAAM,EAC9B,KAAK,EAAE,2BAAU,CAAC,QAAQ,GAC1B,EACF,wBAAC,2BAAU,IAAC,GAAG,QAAC,GAAG,QAAC,MAAM,QAAC,MAAM,mBAC/B,uBAAC,6BAAY,IAAC,IAAI,EAAC,KAAK,EAAC,OAAO,EAAE,kBAAkB,GAAI,EACxD,uBAAC,6BAAY,IACX,IAAI,EAAC,QAAQ,EACb,OAAO,EACL,sBAAsB;wBACtB,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAEjE,IACS,IACF,CACd,CAAC;AA3BW,QAAA,kBAAkB,sBA2B7B"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttachmentListView = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const FileAttachmentApi_1 = require("../hooks/FileAttachmentApi");
9
+ const useParams_1 = require("../hooks/useParams");
10
+ const AttachmentView_1 = require("./AttachmentView");
11
+ const AttachmentListView = ({ ids = (0, useParams_1.useParams)(), attachments = FileAttachmentApi_1.FileAttachmentApi.useGetList(ids), }) => attachments?.map((a) => (0, jsx_runtime_1.jsx)(AttachmentView_1.AttachmentView, { id: a.id }, a.id));
12
+ exports.AttachmentListView = AttachmentListView;
13
+ //# sourceMappingURL=AttachmentListView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentListView.js","sourceRoot":"","sources":["../../../src/FileAttachment/AttachmentListView.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,kEAA+D;AAC/D,kDAA+C;AAC/C,qDAAkD;AAE3C,MAAM,kBAAkB,GAAG,CAAC,EACjC,GAAG,GAAG,IAAA,qBAAS,GAAE,EACjB,WAAW,GAAG,qCAAiB,CAAC,UAAU,CAAC,GAAG,CAAC,GAChD,EAAE,EAAE,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,uBAAC,+BAAc,IAAY,EAAE,EAAE,CAAC,CAAC,EAAE,IAAd,CAAC,CAAC,EAAE,CAAc,CAAC,CAAC;AAH1D,QAAA,kBAAkB,sBAGwC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttachmentScreen = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const components_expo_1 = require("@dwidge/components-expo");
9
+ const components_rnw_1 = require("@dwidge/components-rnw");
10
+ const useParams_1 = require("../hooks/useParams");
11
+ const AttachmentListEdit_1 = require("./AttachmentListEdit");
12
+ const AttachmentScreen = ({ ids = (0, useParams_1.useParams)() }) => ((0, jsx_runtime_1.jsxs)(components_rnw_1.ScreenView, { children: [(0, jsx_runtime_1.jsx)(components_expo_1.StyledHeader, { title: "Attachments" }), (0, jsx_runtime_1.jsx)(components_rnw_1.ScrollView, { gap: true, pad: true, children: (0, jsx_runtime_1.jsx)(components_rnw_1.StyledView, { flex: true, column: true, children: (0, jsx_runtime_1.jsx)(components_rnw_1.StyledView, { children: (0, jsx_runtime_1.jsx)(AttachmentListEdit_1.AttachmentListEdit, { ids: ids }) }) }) })] }));
13
+ exports.AttachmentScreen = AttachmentScreen;
14
+ //# sourceMappingURL=AttachmentScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentScreen.js","sourceRoot":"","sources":["../../../src/FileAttachment/AttachmentScreen.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,6DAAuD;AACvD,2DAA4E;AAC5E,kDAA+C;AAC/C,6DAA0D;AAEnD,MAAM,gBAAgB,GAAG,CAAC,EAAE,GAAG,GAAG,IAAA,qBAAS,GAAE,EAAE,EAAE,EAAE,CAAC,CACzD,wBAAC,2BAAU,eACT,uBAAC,8BAAY,IAAC,KAAK,EAAC,aAAa,GAAG,EACpC,uBAAC,2BAAU,IAAC,GAAG,QAAC,GAAG,kBACjB,uBAAC,2BAAU,IAAC,IAAI,QAAC,MAAM,kBACrB,uBAAC,2BAAU,cACT,uBAAC,uCAAkB,IAAC,GAAG,EAAE,GAAG,GAAI,GACrB,GACF,GACF,IACF,CACd,CAAC;AAXW,QAAA,gBAAgB,oBAW3B"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttachmentView = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const hooks_expo_1 = require("@dwidge/hooks-expo");
9
+ const components_expo_1 = require("@dwidge/components-expo");
10
+ const FileAttachmentApi_1 = require("../hooks/FileAttachmentApi");
11
+ const FileApi_1 = require("../hooks/FileApi");
12
+ const AttachmentView = ({ id = (0, hooks_expo_1.useIdStringParam)(), attachment: [attachment] = FileAttachmentApi_1.FileAttachmentApi.useItem(id), file: [file, setFile] = FileApi_1.FileApi.useItem(attachment?.FileId), }) => (0, jsx_runtime_1.jsx)(components_expo_1.FileView, { file: [file, setFile] });
13
+ exports.AttachmentView = AttachmentView;
14
+ //# sourceMappingURL=AttachmentView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentView.js","sourceRoot":"","sources":["../../../src/FileAttachment/AttachmentView.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,mDAAsD;AACtD,6DAAmD;AACnD,kEAA+D;AAC/D,8CAA2C;AAEpC,MAAM,cAAc,GAAG,CAAC,EAC7B,EAAE,GAAG,IAAA,6BAAgB,GAAE,EACvB,UAAU,EAAE,CAAC,UAAU,CAAC,GAAG,qCAAiB,CAAC,OAAO,CAAC,EAAE,CAAC,EACxD,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,iBAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,GAC5D,EAAE,EAAE,CAAC,uBAAC,0BAAQ,IAAC,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,GAAI,CAAC;AAJ7B,QAAA,cAAc,kBAIe"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./AttachmentEdit"), exports);
18
+ __exportStar(require("./AttachmentListEdit"), exports);
19
+ __exportStar(require("./AttachmentListView"), exports);
20
+ __exportStar(require("./AttachmentScreen"), exports);
21
+ __exportStar(require("./AttachmentView"), exports);
22
+ __exportStar(require("./useFileAttachmentUrl"), exports);
23
+ __exportStar(require("./useFileUrl"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/FileAttachment/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,uDAAqC;AACrC,uDAAqC;AACrC,qDAAmC;AACnC,mDAAiC;AACjC,yDAAuC;AACvC,+CAA6B"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // Copyright DWJ 2024.
3
+ // Distributed under the Boost Software License, Version 1.0.
4
+ // https://www.boost.org/LICENSE_1_0.txt
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useFileAttachmentUrl = void 0;
7
+ const FileApi_1 = require("../hooks/FileApi");
8
+ const FileAttachmentApi_1 = require("../hooks/FileAttachmentApi");
9
+ const useFileAttachmentUrl = (attachmentId) => useFileAttachmentUrlInternal(attachmentId);
10
+ exports.useFileAttachmentUrl = useFileAttachmentUrl;
11
+ const useFileAttachmentUrlInternal = (attachmentId, attachment = FileAttachmentApi_1.FileAttachmentApi.useGetItem(attachmentId), file = FileApi_1.FileApi.useGetItem(attachment?.FileId)) => file?.getUrl;
12
+ //# sourceMappingURL=useFileAttachmentUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFileAttachmentUrl.js","sourceRoot":"","sources":["../../../src/FileAttachment/useFileAttachmentUrl.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;;;AAExC,8CAA2C;AAC3C,kEAA+D;AAExD,MAAM,oBAAoB,GAAG,CAClC,YAAqB,EACM,EAAE,CAAC,4BAA4B,CAAC,YAAY,CAAC,CAAC;AAF9D,QAAA,oBAAoB,wBAE0C;AAC3E,MAAM,4BAA4B,GAAG,CACnC,YAAqB,EACrB,UAAU,GAAG,qCAAiB,CAAC,UAAU,CAAC,YAAY,CAAC,EACvD,IAAI,GAAG,iBAAO,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM,CAAC,EAC7C,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // Copyright DWJ 2024.
3
+ // Distributed under the Boost Software License, Version 1.0.
4
+ // https://www.boost.org/LICENSE_1_0.txt
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useFileUrl = void 0;
7
+ const FileApi_1 = require("../hooks/FileApi");
8
+ const useFileUrl = (fileId) => useFileUrlInternal(fileId);
9
+ exports.useFileUrl = useFileUrl;
10
+ const useFileUrlInternal = (fileId, file = FileApi_1.FileApi.useGetItem(fileId)) => file?.getUrl;
11
+ //# sourceMappingURL=useFileUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFileUrl.js","sourceRoot":"","sources":["../../../src/FileAttachment/useFileUrl.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;;;AAExC,8CAA2C;AAEpC,MAAM,UAAU,GAAG,CAAC,MAAe,EAA6B,EAAE,CACvE,kBAAkB,CAAC,MAAM,CAAC,CAAC;AADhB,QAAA,UAAU,cACM;AAC7B,MAAM,kBAAkB,GAAG,CACzB,MAAe,EACf,IAAI,GAAG,iBAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EACjC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EditFormAttachmentScreen = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const components_expo_1 = require("@dwidge/components-expo");
9
+ const components_rnw_1 = require("@dwidge/components-rnw");
10
+ const json_schema_form_rnw_1 = require("@dwidge/json-schema-form-rnw");
11
+ const react_1 = require("react");
12
+ const zod_1 = require("zod");
13
+ const useFormId = () => "123";
14
+ const useForm = (id) => (0, react_1.useState)({
15
+ title: "untitled",
16
+ fields: [],
17
+ });
18
+ const formSchema = {
19
+ type: "object",
20
+ properties: {
21
+ title: {
22
+ type: "string",
23
+ title: "Name",
24
+ },
25
+ fields: {
26
+ type: "array",
27
+ title: "Fields",
28
+ items: {
29
+ type: "object",
30
+ properties: {
31
+ title: {
32
+ type: "string",
33
+ title: "Name",
34
+ },
35
+ type: {
36
+ type: "string",
37
+ enum: ["string", "number", "boolean"],
38
+ title: "Type",
39
+ },
40
+ required: {
41
+ type: "boolean",
42
+ title: "Required",
43
+ },
44
+ },
45
+ required: ["title", "type", "required"],
46
+ },
47
+ },
48
+ },
49
+ required: ["title", "fields"],
50
+ };
51
+ const JsonFormSchema = zod_1.z.object({
52
+ jsonSchema: zod_1.z.string(),
53
+ uiSchema: zod_1.z.string(),
54
+ });
55
+ const Form = zod_1.z.object({
56
+ id: zod_1.z.string(),
57
+ schema: JsonFormSchema,
58
+ });
59
+ const EditFormAttachmentScreen = ({ form: [form, setForm] = useForm(useFormId()), }) => ((0, jsx_runtime_1.jsxs)(components_rnw_1.ScreenView, { children: [(0, jsx_runtime_1.jsx)(components_expo_1.StyledHeader, { title: "Edit Form" }), form == null || !form ? ((0, jsx_runtime_1.jsx)(components_rnw_1.CenterView, { children: (0, jsx_runtime_1.jsx)(components_rnw_1.StyledText, { children: form === null ? "The form does not exist." : "Loading..." }) })) : ((0, jsx_runtime_1.jsx)(components_rnw_1.ScrollView, { flex: true, gap: true, wide: true, pad: true, selfcenter: true, children: (0, jsx_runtime_1.jsx)(json_schema_form_rnw_1.JSONSchemaForm, { name: "FormSchema", schema: formSchema, value: form, onChange: setForm }) }))] }));
60
+ exports.EditFormAttachmentScreen = EditFormAttachmentScreen;
61
+ //# sourceMappingURL=EditFormAttachmentScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditFormAttachmentScreen.js","sourceRoot":"","sources":["../../../src/Form/EditFormAttachmentScreen.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,6DAAuD;AACvD,2DAKgC;AAChC,uEAA8D;AAE9D,iCAAiC;AACjC,6BAAwB;AAExB,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC;AAC9B,MAAM,OAAO,GAAG,CAAC,EAAW,EAAE,EAAE,CAC9B,IAAA,gBAAQ,EAA0B;IAChC,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,EAAE;CACX,CAAC,CAAC;AAaL,MAAM,UAAU,GAA6B;IAC3C,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;SACd;QACD,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,QAAQ;YACf,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,MAAM;qBACd;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC;wBACrC,KAAK,EAAE,MAAM;qBACd;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,SAAS;wBACf,KAAK,EAAE,UAAU;qBAClB;iBACF;gBACD,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC;aACxC;SACF;KACF;IACD,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;CAC9B,CAAC;AAEF,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;IACtB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,OAAC,CAAC,MAAM,CAAC;IACpB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC;AAEI,MAAM,wBAAwB,GAAG,CAAC,EACvC,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,GAC7C,EAAE,EAAE,CAAC,CACJ,wBAAC,2BAAU,eACT,uBAAC,8BAAY,IAAC,KAAK,EAAC,WAAW,GAAG,EACjC,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CACvB,uBAAC,2BAAU,cACT,uBAAC,2BAAU,cACR,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,YAAY,GAC/C,GACF,CACd,CAAC,CAAC,CAAC,CACF,uBAAC,2BAAU,IAAC,IAAI,QAAC,GAAG,QAAC,IAAI,QAAC,GAAG,QAAC,UAAU,kBACtC,uBAAC,qCAAc,IACb,IAAI,EAAC,YAAY,EACjB,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,OAAO,GACjB,GACS,CACd,IACU,CACd,CAAC;AAtBW,QAAA,wBAAwB,4BAsBnC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormCard = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const components_rnw_1 = require("@dwidge/components-rnw");
9
+ const FormApi_1 = require("../hooks/FormApi");
10
+ const FormCard = ({ form = FormApi_1.FormApi.useGetItem() }) => form ? ((0, jsx_runtime_1.jsx)(components_rnw_1.StyledView, { flex: true, card: true, row: true, children: (0, jsx_runtime_1.jsx)(components_rnw_1.StyledText, { children: form.name ?? "untitled" }) })) : ((0, jsx_runtime_1.jsx)(components_rnw_1.StyledLoader, {}));
11
+ exports.FormCard = FormCard;
12
+ //# sourceMappingURL=FormEdit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormEdit.js","sourceRoot":"","sources":["../../../src/Form/FormEdit.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,2DAA8E;AAC9E,8CAA2C;AAEpC,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,GAAG,iBAAO,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,CAC1D,IAAI,CAAC,CAAC,CAAC,CACL,uBAAC,2BAAU,IAAC,IAAI,QAAC,IAAI,QAAC,GAAG,kBACvB,uBAAC,2BAAU,cAAE,IAAI,CAAC,IAAI,IAAI,UAAU,GAAc,GACvC,CACd,CAAC,CAAC,CAAC,CACF,uBAAC,6BAAY,KAAG,CACjB,CAAC;AAPS,QAAA,QAAQ,YAOjB"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormEditScreen = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const components_expo_1 = require("@dwidge/components-expo");
9
+ const components_rnw_1 = require("@dwidge/components-rnw");
10
+ const json_forms_designer_1 = require("@dwidge/json-forms-designer");
11
+ const FormApi_1 = require("../hooks/FormApi");
12
+ const useParams_1 = require("../hooks/useParams");
13
+ const FormEditScreen = ({ form: [form, setForm] = FormApi_1.FormApi.useItem((0, useParams_1.useParams)().FormId), }) => ((0, jsx_runtime_1.jsxs)(components_rnw_1.ScreenView, { children: [(0, jsx_runtime_1.jsx)(components_expo_1.StyledHeader, { title: ["Form", form?.name].filter(Boolean).join(" - ") }), form == null || !form ? ((0, jsx_runtime_1.jsx)(components_rnw_1.CenterView, { children: (0, jsx_runtime_1.jsx)(components_rnw_1.StyledText, { children: form === null ? "The form does not exist." : "Loading..." }) })) : ((0, jsx_runtime_1.jsx)(components_rnw_1.ScrollView, { flex: true, gap: true, wide: true, pad: true, selfcenter: true, children: (0, jsx_runtime_1.jsx)(json_forms_designer_1.FormDesigner, { schemaString: [
14
+ form.schema ?? json_forms_designer_1.defaultFormSchemaString,
15
+ setForm &&
16
+ ((updater) => {
17
+ const next = typeof updater === "function"
18
+ ? updater(form.schema ?? json_forms_designer_1.defaultFormSchemaString)
19
+ : updater;
20
+ const parsed = json_forms_designer_1.FormSchema.parse(JSON.parse(next));
21
+ setForm?.((prev) => ({
22
+ ...prev,
23
+ name: parsed.schema.title,
24
+ schema: next,
25
+ }));
26
+ }),
27
+ ] }) }))] }));
28
+ exports.FormEditScreen = FormEditScreen;
29
+ //# sourceMappingURL=FormEditScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormEditScreen.js","sourceRoot":"","sources":["../../../src/Form/FormEditScreen.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,6DAAuD;AACvD,2DAKgC;AAChC,qEAIqC;AACrC,8CAA2C;AAC3C,kDAA+C;AAExC,MAAM,cAAc,GAAG,CAAC,EAC7B,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,iBAAO,CAAC,OAAO,CAAC,IAAA,qBAAS,GAAE,CAAC,MAAM,CAAC,GAC5D,EAAE,EAAE,CAAC,CACJ,wBAAC,2BAAU,eACT,uBAAC,8BAAY,IAAC,KAAK,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAI,EACxE,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CACvB,uBAAC,2BAAU,cACT,uBAAC,2BAAU,cACR,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,YAAY,GAC/C,GACF,CACd,CAAC,CAAC,CAAC,CACF,uBAAC,2BAAU,IAAC,IAAI,QAAC,GAAG,QAAC,IAAI,QAAC,GAAG,QAAC,UAAU,kBACtC,uBAAC,kCAAY,IACX,YAAY,EAAE;oBACZ,IAAI,CAAC,MAAM,IAAI,6CAAuB;oBACtC,OAAO;wBACL,CAAC,CAAC,OAAO,EAAE,EAAE;4BACX,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,UAAU;gCAC3B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,6CAAuB,CAAC;gCACjD,CAAC,CAAC,OAAO,CAAC;4BACd,MAAM,MAAM,GAAG,gCAAU,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;4BAClD,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gCACnB,GAAG,IAAI;gCACP,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK;gCACzB,MAAM,EAAE,IAAI;6BACb,CAAC,CAAC,CAAC;wBACN,CAAC,CAAC;iBACL,GACD,GACS,CACd,IACU,CACd,CAAC;AAlCW,QAAA,cAAc,kBAkCzB"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FormListEdit = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ // Copyright DWJ 2024.
9
+ // Distributed under the Boost Software License, Version 1.0.
10
+ // https://www.boost.org/LICENSE_1_0.txt
11
+ const components_rnw_1 = require("@dwidge/components-rnw");
12
+ const hooks_expo_1 = require("@dwidge/hooks-expo");
13
+ const assert_1 = __importDefault(require("assert"));
14
+ const react_1 = require("react");
15
+ const FormApi_1 = require("../hooks/FormApi");
16
+ const FormsContext_1 = require("../hooks/FormsContext");
17
+ const FormEdit_1 = require("./FormEdit");
18
+ const FormListEdit = ({ elements = FormApi_1.FormApi.useGetList(), selection: [selection, setSelection] = (0, react_1.useState)([]), onPress = (0, hooks_expo_1.useNavAction2)((0, FormsContext_1.useNavRoutes)().FORM_EDIT_SCREEN, async (id) => ({
19
+ FormId: id,
20
+ })), }) => ((0, jsx_runtime_1.jsx)(components_rnw_1.UnstyledList, { items: elements, keyExtractor: (item) => ((0, assert_1.default)(item.id), item.id), selection: [selection, setSelection], render: (item) => (0, jsx_runtime_1.jsx)(FormEdit_1.FormCard, { form: item }), selectStyle: components_rnw_1.viewStyles.select, style: components_rnw_1.viewStyles.unselect, onPress: onPress }));
21
+ exports.FormListEdit = FormListEdit;
22
+ //# sourceMappingURL=FormListEdit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormListEdit.js","sourceRoot":"","sources":["../../../src/Form/FormListEdit.tsx"],"names":[],"mappings":";;;;;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,2DAAkE;AAClE,mDAAmD;AACnD,oDAA4B;AAC5B,iCAAiC;AACjC,8CAA2C;AAC3C,wDAAqD;AACrD,yCAAsC;AAE/B,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,GAAG,iBAAO,CAAC,UAAU,EAAE,EAC/B,SAAS,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAW,EAAE,CAAC,EAC7D,OAAO,GAAG,IAAA,0BAAa,EACrB,IAAA,2BAAY,GAAE,CAAC,gBAAgB,EAC/B,KAAK,EAAE,EAAU,EAAE,EAAE,CAAC,CAAC;IACrB,MAAM,EAAE,EAAE;CACX,CAAC,CACH,GACF,EAAE,EAAE,CAAC,CACJ,uBAAC,6BAAY,IACX,KAAK,EAAE,QAAQ,EACf,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAA,gBAAM,EAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,EAClD,SAAS,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,EACpC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAC,mBAAQ,IAAC,IAAI,EAAE,IAAI,GAAI,EAC1C,WAAW,EAAE,2BAAU,CAAC,MAAM,EAC9B,KAAK,EAAE,2BAAU,CAAC,QAAQ,EAC1B,OAAO,EAAE,OAAO,GAChB,CACH,CAAC;AAnBW,QAAA,YAAY,gBAmBvB"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormListScreen = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const components_expo_1 = require("@dwidge/components-expo");
9
+ const components_rnw_1 = require("@dwidge/components-rnw");
10
+ const hooks_react_1 = require("@dwidge/hooks-react");
11
+ const react_native_1 = require("react-native");
12
+ const FormApi_1 = require("../hooks/FormApi");
13
+ const FormListEdit_1 = require("./FormListEdit");
14
+ const useCreateBlankForm_1 = require("../hooks/useCreateBlankForm");
15
+ const FormListScreen = ({ onCreate = (0, useCreateBlankForm_1.useCreateBlankForm)(), onDeleteList = FormApi_1.FormApi.useDeleteList(), selection = (0, hooks_react_1.useMemoState)([]), }) => ((0, jsx_runtime_1.jsxs)(components_rnw_1.ScreenView, { children: [(0, jsx_runtime_1.jsx)(components_expo_1.StyledHeader, { title: "Forms", actions: [
16
+ {
17
+ icon: "remove-circle",
18
+ onPress: onDeleteList && selection[0].length
19
+ ? () => onDeleteList(selection[0].map((id) => ({ id })))
20
+ : undefined,
21
+ },
22
+ {
23
+ icon: "add-circle",
24
+ onPress: onCreate,
25
+ },
26
+ ] }), (0, jsx_runtime_1.jsx)(components_rnw_1.ScrollView, { gap: true, pad: true, children: (0, jsx_runtime_1.jsxs)(components_rnw_1.StyledView, { flex: true, column: true, children: [(0, jsx_runtime_1.jsx)(components_rnw_1.StyledView, { children: (0, jsx_runtime_1.jsx)(FormListEdit_1.FormListEdit, { selection: selection }) }), (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: { flex: 1 }, onPress: onCreate, children: (0, jsx_runtime_1.jsx)(components_rnw_1.CenterView, { row: true, gap: true, children: (0, jsx_runtime_1.jsx)(components_rnw_1.StyledFontAwesome, { name: "plus", size: 30 }) }) })] }) })] }));
27
+ exports.FormListScreen = FormListScreen;
28
+ //# sourceMappingURL=FormListScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormListScreen.js","sourceRoot":"","sources":["../../../src/Form/FormListScreen.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,6DAAuD;AACvD,2DAMgC;AAChC,qDAAmD;AACnD,+CAAgD;AAChD,8CAA2C;AAC3C,iDAA8C;AAC9C,oEAAiE;AAE1D,MAAM,cAAc,GAAG,CAAC,EAC7B,QAAQ,GAAG,IAAA,uCAAkB,GAAE,EAC/B,YAAY,GAAG,iBAAO,CAAC,aAAa,EAAE,EACtC,SAAS,GAAG,IAAA,0BAAY,EAAW,EAAE,CAAC,GACvC,EAAE,EAAE,CAAC,CACJ,wBAAC,2BAAU,eACT,uBAAC,8BAAY,IACX,KAAK,EAAC,OAAO,EACb,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,eAAe;oBACrB,OAAO,EACL,YAAY,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM;wBACjC,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;wBACxD,CAAC,CAAC,SAAS;iBAChB;gBACD;oBACE,IAAI,EAAE,YAAY;oBAClB,OAAO,EAAE,QAAQ;iBAClB;aACF,GACD,EACF,uBAAC,2BAAU,IAAC,GAAG,QAAC,GAAG,kBACjB,wBAAC,2BAAU,IAAC,IAAI,QAAC,MAAM,mBACrB,uBAAC,2BAAU,cACT,uBAAC,2BAAY,IAAC,SAAS,EAAE,SAAS,GAAI,GAC3B,EACb,uBAAC,+BAAgB,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,YACrD,uBAAC,2BAAU,IAAC,GAAG,QAAC,GAAG,kBACjB,uBAAC,kCAAiB,IAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAE,EAAE,GAAI,GAChC,GACI,IACR,GACF,IACF,CACd,CAAC;AAnCW,QAAA,cAAc,kBAmCzB"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FormListView = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ // Copyright DWJ 2024.
9
+ // Distributed under the Boost Software License, Version 1.0.
10
+ // https://www.boost.org/LICENSE_1_0.txt
11
+ const components_rnw_1 = require("@dwidge/components-rnw");
12
+ const assert_1 = __importDefault(require("assert"));
13
+ const react_1 = require("react");
14
+ const FormApi_1 = require("../hooks/FormApi");
15
+ const FormView_1 = require("./FormView");
16
+ const FormListView = ({ elements = FormApi_1.FormApi.useGetList(), selection: [selection, setSelection] = (0, react_1.useState)([]), }) => ((0, jsx_runtime_1.jsx)(components_rnw_1.UnstyledList, { items: elements, keyExtractor: (item) => ((0, assert_1.default)(item.id), item.id), selection: [selection, setSelection], render: (item) => (0, jsx_runtime_1.jsx)(FormView_1.FormView, { form: item }), selectStyle: components_rnw_1.viewStyles.select, style: components_rnw_1.viewStyles.unselect }));
17
+ exports.FormListView = FormListView;
18
+ //# sourceMappingURL=FormListView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormListView.js","sourceRoot":"","sources":["../../../src/Form/FormListView.tsx"],"names":[],"mappings":";;;;;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,2DAAkE;AAClE,oDAA4B;AAC5B,iCAAiC;AACjC,8CAA2C;AAC3C,yCAAsC;AAE/B,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,GAAG,iBAAO,CAAC,UAAU,EAAE,EAC/B,SAAS,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAW,EAAE,CAAC,GAC9D,EAAE,EAAE,CAAC,CACJ,uBAAC,6BAAY,IACX,KAAK,EAAE,QAAQ,EACf,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAA,gBAAM,EAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,EAClD,SAAS,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,EACpC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAC,mBAAQ,IAAC,IAAI,EAAE,IAAI,GAAI,EAC1C,WAAW,EAAE,2BAAU,CAAC,MAAM,EAC9B,KAAK,EAAE,2BAAU,CAAC,QAAQ,GAC1B,CACH,CAAC;AAZW,QAAA,YAAY,gBAYvB"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormSelectScreen = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const react_1 = require("react");
9
+ const components_rnw_1 = require("@dwidge/components-rnw");
10
+ const hooks_expo_1 = require("@dwidge/hooks-expo");
11
+ const components_rnw_2 = require("@dwidge/components-rnw");
12
+ const FormSelectView_1 = require("./FormSelectView");
13
+ const FormsContext_1 = require("../hooks/FormsContext");
14
+ const components_expo_1 = require("@dwidge/components-expo");
15
+ const useCreateBlankFormAttachment_1 = require("../hooks/useCreateBlankFormAttachment");
16
+ const useOnSelectForm = () => (0, hooks_expo_1.useNavAction2)((0, FormsContext_1.useNavRoutes)().FORM_ATTACHMENT_EDIT_SCREEN, (0, useCreateBlankFormAttachment_1.useCreateBlankFormAttachment)({}));
17
+ const FormSelectScreen = ({ onSelectForm = useOnSelectForm(), selected: [selected, setSelected] = (0, react_1.useState)([]), }) => ((0, jsx_runtime_1.jsxs)(components_rnw_1.ScreenView, { children: [(0, jsx_runtime_1.jsx)(components_expo_1.StyledHeader, { title: "Select Form" }), (0, jsx_runtime_1.jsxs)(components_rnw_1.ScrollView, { gap: true, pad: true, children: [(0, jsx_runtime_1.jsx)(components_rnw_1.StyledView, { children: (0, jsx_runtime_1.jsx)(components_rnw_1.StyledText, { center: true, children: "Select from the list of forms below, or use the search option above." }) }), (0, jsx_runtime_1.jsx)(FormSelectView_1.FormSelectView, { selected: [selected, setSelected] }), (0, jsx_runtime_1.jsx)(components_rnw_2.StyledButton, { onPress: selected.length > 0 && onSelectForm
18
+ ? () => onSelectForm(selected.map((id) => ({ id })))
19
+ : undefined, children: "Select Form" })] })] }));
20
+ exports.FormSelectScreen = FormSelectScreen;
21
+ //# sourceMappingURL=FormSelectScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormSelectScreen.js","sourceRoot":"","sources":["../../../src/Form/FormSelectScreen.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,iCAAwC;AACxC,2DAKgC;AAChC,mDAAmD;AACnD,2DAAsD;AACtD,qDAAkD;AAClD,wDAAqD;AACrD,6DAAuD;AACvD,wFAAqF;AAErF,MAAM,eAAe,GAAG,GAAG,EAAE,CAC3B,IAAA,0BAAa,EACX,IAAA,2BAAY,GAAE,CAAC,2BAA2B,EAC1C,IAAA,2DAA4B,EAAC,EAAE,CAAC,CACjC,CAAC;AAEG,MAAM,gBAAgB,GAAG,CAAC,EAC/B,YAAY,GAAG,eAAe,EAAE,EAChC,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAW,EAAE,CAAC,GAC3D,EAAE,EAAE,CAAC,CACJ,wBAAC,2BAAU,eACT,uBAAC,8BAAY,IAAC,KAAK,EAAC,aAAa,GAAG,EACpC,wBAAC,2BAAU,IAAC,GAAG,QAAC,GAAG,mBACjB,uBAAC,2BAAU,cACT,uBAAC,2BAAU,IAAC,MAAM,2FAEL,GACF,EACb,uBAAC,+BAAc,IAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAI,EACrD,uBAAC,6BAAY,IACX,OAAO,EACL,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,YAAY;wBACjC,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;wBACpD,CAAC,CAAC,SAAS,4BAIF,IACJ,IACF,CACd,CAAC;AAxBW,QAAA,gBAAgB,oBAwB3B"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormSelectView = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const components_rnw_1 = require("@dwidge/components-rnw");
9
+ const react_1 = require("react");
10
+ const FormApi_1 = require("../hooks/FormApi");
11
+ const FormListView_1 = require("./FormListView");
12
+ const FormSelectView = ({ formList = FormApi_1.FormApi.useGetList(), selected: [selected, setSelected] = (0, react_1.useState)([]), searchValue: [searchValue, setSearchValue] = (0, react_1.useState)(""), createFormList = FormApi_1.FormApi.useCreateList(), }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FormListView_1.FormListView, { elements: searchValue
13
+ ? formList?.filter((form) => form.name?.toLowerCase().includes(searchValue.toLowerCase()))
14
+ : formList, selection: [selected, setSelected] }), (0, jsx_runtime_1.jsx)(components_rnw_1.StyledButton, { onPress: createFormList && (() => createFormList([{}])), children: "Create New Form" })] }));
15
+ exports.FormSelectView = FormSelectView;
16
+ //# sourceMappingURL=FormSelectView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormSelectView.js","sourceRoot":"","sources":["../../../src/Form/FormSelectView.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,2DAAsD;AACtD,iCAA4C;AAC5C,8CAA2C;AAC3C,iDAA8C;AAEvC,MAAM,cAAc,GAAG,CAAC,EAC7B,QAAQ,GAAG,iBAAO,CAAC,UAAU,EAAE,EAC/B,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAW,EAAE,CAAC,EAC1D,WAAW,EAAE,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,EACzD,cAAc,GAAG,iBAAO,CAAC,aAAa,EAAE,GACzC,EAAa,EAAE,CAAC,CACf,6DACE,uBAAC,2BAAY,IACX,QAAQ,EACN,WAAW;gBACT,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CACxB,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,CAC7D;gBACH,CAAC,CAAC,QAAQ,EAEd,SAAS,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,GAClC,EACF,uBAAC,6BAAY,IAAC,OAAO,EAAE,cAAc,IAAI,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gCAEtD,IACd,CACJ,CAAC;AArBW,QAAA,cAAc,kBAqBzB"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormView = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const components_rnw_1 = require("@dwidge/components-rnw");
9
+ const FormApi_1 = require("../hooks/FormApi");
10
+ const FormView = ({ form = FormApi_1.FormApi.useGetItem(), onPress = () => { }, }) => (0, jsx_runtime_1.jsx)(components_rnw_1.StyledText, { children: form?.name || "untitled" });
11
+ exports.FormView = FormView;
12
+ //# sourceMappingURL=FormView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormView.js","sourceRoot":"","sources":["../../../src/Form/FormView.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,2DAAoD;AACpD,8CAA2C;AAEpC,MAAM,QAAQ,GAAG,CAAC,EACvB,IAAI,GAAG,iBAAO,CAAC,UAAU,EAAE,EAC3B,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,GACnB,EAAE,EAAE,CAAC,uBAAC,2BAAU,cAAE,IAAI,EAAE,IAAI,IAAI,UAAU,GAAc,CAAC;AAH7C,QAAA,QAAQ,YAGqC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./EditFormAttachmentScreen"), exports);
18
+ __exportStar(require("./FormEdit"), exports);
19
+ __exportStar(require("./FormEditScreen"), exports);
20
+ __exportStar(require("./FormListEdit"), exports);
21
+ __exportStar(require("./FormListScreen"), exports);
22
+ __exportStar(require("./FormListView"), exports);
23
+ __exportStar(require("./FormSelectScreen"), exports);
24
+ __exportStar(require("./FormSelectView"), exports);
25
+ __exportStar(require("./FormView"), exports);
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Form/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,6CAA2B;AAC3B,mDAAiC;AACjC,iDAA+B;AAC/B,mDAAiC;AACjC,iDAA+B;AAC/B,qDAAmC;AACnC,mDAAiC;AACjC,6CAA2B"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormAttachmentEdit = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const components_rnw_1 = require("@dwidge/components-rnw");
9
+ const hooks_expo_1 = require("@dwidge/hooks-expo");
10
+ const json_forms_designer_1 = require("@dwidge/json-forms-designer");
11
+ const react_1 = require("react");
12
+ const AttachmentListEdit_1 = require("../FileAttachment/AttachmentListEdit");
13
+ const FormApi_1 = require("../hooks/FormApi");
14
+ const FormAttachmentApi_1 = require("../hooks/FormAttachmentApi");
15
+ const FormsContext_1 = require("../hooks/FormsContext");
16
+ const useParams_1 = require("../hooks/useParams");
17
+ const FormAttachmentEdit = ({ id = (0, useParams_1.useParams)().FormAttachmentId, formAttachment: [formAttachment, setFormAttachment,] = FormAttachmentApi_1.FormAttachmentApi.useItem(id), form = FormApi_1.FormApi.useGetItem(formAttachment?.FormId), onEditForm = (0, hooks_expo_1.useNavAction2)((0, react_1.useContext)(FormsContext_1.FormsContext).routes.FORM_EDIT_SCREEN, async (key) => ({
18
+ FormId: key,
19
+ })), onSaveForm = (0, hooks_expo_1.useNavAction2)((0, react_1.useContext)(FormsContext_1.FormsContext).routes.FORM_ATTACHMENT_LIST_SCREEN, async () => ({})), }) => formAttachment === undefined || form === undefined ? ((0, jsx_runtime_1.jsx)(components_rnw_1.StyledLoader, {})) : formAttachment === null || form === null ? ((0, jsx_runtime_1.jsx)(components_rnw_1.StyledText, { children: "No form" })) : form.schema ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(json_forms_designer_1.FormSubmit, { dataString: [
20
+ formAttachment.data ?? json_forms_designer_1.defaultJsonFormDataString,
21
+ setFormAttachment &&
22
+ ((data) => setFormAttachment((prev) => ({
23
+ ...prev,
24
+ data: typeof data === "function"
25
+ ? data(prev?.data ?? json_forms_designer_1.defaultJsonFormDataString)
26
+ : data,
27
+ }))),
28
+ ], schemaString: [form.schema ?? json_forms_designer_1.defaultFormSchemaString] }), (0, jsx_runtime_1.jsx)(AttachmentListEdit_1.AttachmentListEdit, { ids: { FormAttachmentId: formAttachment.id } }), (0, jsx_runtime_1.jsx)(components_rnw_1.StyledButton, { onPress: onSaveForm, children: "Save" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_rnw_1.StyledText, { children: "This form has not been created yet." }), onEditForm && ((0, jsx_runtime_1.jsx)(components_rnw_1.StyledButton, { onPress: () => onEditForm(form.id), children: "Edit Form" }))] }));
29
+ exports.FormAttachmentEdit = FormAttachmentEdit;
30
+ //# sourceMappingURL=FormAttachmentEdit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormAttachmentEdit.js","sourceRoot":"","sources":["../../../src/FormAttachment/FormAttachmentEdit.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,2DAAgF;AAChF,mDAAmD;AACnD,qEAIqC;AACrC,iCAAmC;AACnC,6EAA0E;AAC1E,8CAA2C;AAC3C,kEAA+D;AAC/D,wDAAqD;AACrD,kDAA+C;AAIxC,MAAM,kBAAkB,GAAG,CAAC,EACjC,EAAE,GAAG,IAAA,qBAAS,GAAE,CAAC,gBAAgB,EACjC,cAAc,EAAE,CACd,cAAc,EACd,iBAAiB,EAClB,GAAG,qCAAiB,CAAC,OAAO,CAAC,EAAE,CAAC,EACjC,IAAI,GAAG,iBAAO,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,CAAC,EACjD,UAAU,GAAG,IAAA,0BAAa,EACxB,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAC,MAAM,CAAC,gBAAgB,EAChD,KAAK,EAAE,GAAW,EAAE,EAAE,CAAC,CAAC;IACtB,MAAM,EAAE,GAAG;CACZ,CAAC,CACH,EACD,UAAU,GAAG,IAAA,0BAAa,EACxB,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAC,MAAM,CAAC,2BAA2B,EAC3D,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CACjB,GACF,EAAE,EAAE,CACH,cAAc,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CACnD,uBAAC,6BAAY,KAAG,CACjB,CAAC,CAAC,CAAC,cAAc,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAC7C,uBAAC,2BAAU,0BAAqB,CACjC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAChB,6DACE,uBAAC,gCAAU,IACT,UAAU,EAAE;gBACV,cAAc,CAAC,IAAI,IAAI,+CAAyB;gBAChD,iBAAiB;oBACf,CAAC,CAAC,IAAI,EAAE,EAAE,CACR,iBAAiB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;wBAC3B,GAAG,IAAI;wBACP,IAAI,EACF,OAAO,IAAI,KAAK,UAAU;4BACxB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,+CAAyB,CAAC;4BAC/C,CAAC,CAAC,IAAI;qBACX,CAAC,CAAC,CAAC;aACT,EACD,YAAY,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,6CAAuB,CAAC,GACtD,EACF,uBAAC,uCAAkB,IAAC,GAAG,EAAE,EAAE,gBAAgB,EAAE,cAAc,CAAC,EAAE,EAAE,GAAI,EACpE,uBAAC,6BAAY,IAAC,OAAO,EAAE,UAAU,qBAAqB,IACrD,CACJ,CAAC,CAAC,CAAC,CACF,6DACE,uBAAC,2BAAU,sDAAiD,EAC3D,UAAU,IAAI,CACb,uBAAC,6BAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAG,CAAC,0BAElC,CAChB,IACA,CACJ,CAAC;AAnDS,QAAA,kBAAkB,sBAmD3B"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormAttachmentEditScreen = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Copyright DWJ 2024.
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // https://www.boost.org/LICENSE_1_0.txt
8
+ const components_expo_1 = require("@dwidge/components-expo");
9
+ const components_rnw_1 = require("@dwidge/components-rnw");
10
+ const FormApi_1 = require("../hooks/FormApi");
11
+ const FormAttachmentApi_1 = require("../hooks/FormAttachmentApi");
12
+ const FormAttachmentEdit_1 = require("./FormAttachmentEdit");
13
+ const FormAttachmentEditScreen = ({ formAttachment = FormAttachmentApi_1.FormAttachmentApi.useGetItem(), form = FormApi_1.FormApi.useGetItem(formAttachment?.FormId), }) => ((0, jsx_runtime_1.jsxs)(components_rnw_1.ScreenView, { children: [(0, jsx_runtime_1.jsx)(components_expo_1.StyledHeader, { title: ["Form", form?.name].filter(Boolean).join(" - ") }), (0, jsx_runtime_1.jsx)(components_rnw_1.ScrollView, { flex: true, gap: true, pad: true, children: (0, jsx_runtime_1.jsx)(FormAttachmentEdit_1.FormAttachmentEdit, {}) })] }));
14
+ exports.FormAttachmentEditScreen = FormAttachmentEditScreen;
15
+ //# sourceMappingURL=FormAttachmentEditScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormAttachmentEditScreen.js","sourceRoot":"","sources":["../../../src/FormAttachment/FormAttachmentEditScreen.tsx"],"names":[],"mappings":";;;;AAAA,sBAAsB;AACtB,6DAA6D;AAC7D,wCAAwC;AAExC,6DAAuD;AACvD,2DAAgE;AAChE,8CAA2C;AAC3C,kEAA+D;AAC/D,6DAA0D;AAEnD,MAAM,wBAAwB,GAAG,CAAC,EACvC,cAAc,GAAG,qCAAiB,CAAC,UAAU,EAAE,EAC/C,IAAI,GAAG,iBAAO,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,CAAC,GAClD,EAAE,EAAE,CAAC,CACJ,wBAAC,2BAAU,eACT,uBAAC,8BAAY,IAAC,KAAK,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAI,EACzE,uBAAC,2BAAU,IAAC,IAAI,QAAC,GAAG,QAAC,GAAG,kBACtB,uBAAC,uCAAkB,KAAG,GACX,IACF,CACd,CAAC;AAVW,QAAA,wBAAwB,4BAUnC"}