@formio/angular 5.2.1-rc.3 → 5.3.0-rc.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 (336) hide show
  1. package/FormioBaseComponent.d.ts +3 -0
  2. package/FormioBaseComponent.d.ts.map +1 -1
  3. package/auth/auth.component.d.ts +3 -0
  4. package/auth/auth.component.d.ts.map +1 -1
  5. package/auth/auth.config.d.ts +3 -0
  6. package/auth/auth.config.d.ts.map +1 -1
  7. package/auth/auth.module.d.ts +11 -0
  8. package/auth/auth.module.d.ts.map +1 -1
  9. package/auth/auth.service.d.ts +3 -0
  10. package/auth/auth.service.d.ts.map +1 -1
  11. package/auth/formio-angular-auth.d.ts +1 -0
  12. package/auth/formio-angular-auth.d.ts.map +1 -1
  13. package/auth/login/login.component.d.ts +3 -0
  14. package/auth/login/login.component.d.ts.map +1 -1
  15. package/auth/package.json +5 -6
  16. package/auth/register/register.component.d.ts +3 -0
  17. package/auth/register/register.component.d.ts.map +1 -1
  18. package/auth/resetpass/resetpass.component.d.ts +3 -0
  19. package/auth/resetpass/resetpass.component.d.ts.map +1 -1
  20. package/components/alerts/formio.alerts.component.d.ts +3 -0
  21. package/components/alerts/formio.alerts.component.d.ts.map +1 -1
  22. package/components/alerts/parse-html-content.pipe.d.ts +3 -0
  23. package/components/alerts/parse-html-content.pipe.d.ts.map +1 -1
  24. package/components/formbuilder/formbuilder.component.d.ts +3 -0
  25. package/components/formbuilder/formbuilder.component.d.ts.map +1 -1
  26. package/components/formio/formio.component.d.ts +3 -0
  27. package/components/formio/formio.component.d.ts.map +1 -1
  28. package/components/loader/formio.loader.component.d.ts +3 -0
  29. package/components/loader/formio.loader.component.d.ts.map +1 -1
  30. package/custom-component/custom-tags.service.d.ts +3 -0
  31. package/custom-component/custom-tags.service.d.ts.map +1 -1
  32. package/esm2020/FormioBaseComponent.mjs +491 -0
  33. package/esm2020/auth/auth.component.mjs +12 -0
  34. package/esm2020/auth/auth.config.mjs +15 -0
  35. package/esm2020/auth/auth.module.mjs +48 -0
  36. package/{esm2015/auth/auth.routes.js → esm2020/auth/auth.routes.mjs} +0 -0
  37. package/esm2020/auth/auth.service.mjs +159 -0
  38. package/{esm2015/auth/formio-angular-auth.js → esm2020/auth/formio-angular-auth.mjs} +0 -0
  39. package/{esm2015/auth/index.js → esm2020/auth/index.mjs} +0 -0
  40. package/esm2020/auth/login/login.component.mjs +16 -0
  41. package/{esm2015/auth/public_api.js → esm2020/auth/public_api.mjs} +0 -0
  42. package/esm2020/auth/register/register.component.mjs +16 -0
  43. package/esm2020/auth/resetpass/resetpass.component.mjs +16 -0
  44. package/esm2020/components/alerts/formio.alerts.component.mjs +29 -0
  45. package/{esm2015/components/alerts/formio.alerts.js → esm2020/components/alerts/formio.alerts.mjs} +0 -0
  46. package/esm2020/components/alerts/parse-html-content.pipe.mjs +19 -0
  47. package/esm2020/components/formbuilder/formbuilder.component.mjs +190 -0
  48. package/esm2020/components/formio/formio.component.mjs +40 -0
  49. package/esm2020/components/loader/formio.loader.component.mjs +14 -0
  50. package/{esm2015/core.js → esm2020/core.mjs} +0 -0
  51. package/esm2020/custom-component/create-custom-component.mjs +144 -0
  52. package/esm2020/custom-component/custom-tags.service.mjs +16 -0
  53. package/{esm2015/custom-component/register-custom-component.js → esm2020/custom-component/register-custom-component.mjs} +0 -0
  54. package/{esm2015/elements.common.js → esm2020/elements.common.mjs} +0 -0
  55. package/esm2020/formio-angular.mjs +5 -0
  56. package/{esm2015/formio-promise.service.js → esm2020/formio-promise.service.mjs} +0 -0
  57. package/{esm2015/formio.common.js → esm2020/formio.common.mjs} +0 -0
  58. package/esm2020/formio.config.mjs +14 -0
  59. package/esm2020/formio.module.mjs +60 -0
  60. package/{esm2015/formio.service.js → esm2020/formio.service.mjs} +0 -0
  61. package/{esm2015/formio.utils.js → esm2020/formio.utils.mjs} +0 -0
  62. package/esm2020/grid/GridBodyComponent.mjs +81 -0
  63. package/esm2020/grid/GridFooterComponent.mjs +36 -0
  64. package/esm2020/grid/GridHeaderComponent.mjs +30 -0
  65. package/esm2020/grid/form/FormGridBody.component.mjs +19 -0
  66. package/esm2020/grid/form/FormGridFooter.component.mjs +26 -0
  67. package/esm2020/grid/form/FormGridHeader.component.mjs +26 -0
  68. package/{esm2015/grid/form/index.js → esm2020/grid/form/index.mjs} +0 -0
  69. package/esm2020/grid/form/time-since.pipe.mjs +37 -0
  70. package/esm2020/grid/formio-angular-grid.mjs +5 -0
  71. package/esm2020/grid/grid.component.mjs +230 -0
  72. package/esm2020/grid/grid.module.mjs +89 -0
  73. package/esm2020/grid/grid.service.mjs +17 -0
  74. package/{esm2015/grid/index.js → esm2020/grid/index.mjs} +0 -0
  75. package/{esm2015/grid/public_api.js → esm2020/grid/public_api.mjs} +0 -0
  76. package/esm2020/grid/submission/SubmissionGridBody.component.mjs +43 -0
  77. package/esm2020/grid/submission/SubmissionGridFooter.component.mjs +23 -0
  78. package/esm2020/grid/submission/SubmissionGridHeader.component.mjs +61 -0
  79. package/{esm2015/grid/submission/index.js → esm2020/grid/submission/index.mjs} +0 -0
  80. package/{esm2015/grid/types/grid-column.js → esm2020/grid/types/grid-column.mjs} +0 -0
  81. package/{esm2015/grid/types/grid-footer-positions.js → esm2020/grid/types/grid-footer-positions.mjs} +0 -0
  82. package/{esm2015/grid/types/grid-header.js → esm2020/grid/types/grid-header.mjs} +0 -0
  83. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  84. package/esm2020/manager/create/create.component.mjs +18 -0
  85. package/esm2020/manager/delete/delete.component.mjs +37 -0
  86. package/esm2020/manager/edit/edit.component.mjs +109 -0
  87. package/esm2020/manager/form/form.component.mjs +70 -0
  88. package/esm2020/manager/form-manager.config.mjs +15 -0
  89. package/esm2020/manager/form-manager.module.mjs +85 -0
  90. package/{esm2015/manager/form-manager.routes.js → esm2020/manager/form-manager.routes.mjs} +0 -0
  91. package/esm2020/manager/form-manager.service.mjs +178 -0
  92. package/{esm2015/manager/formio-angular-manager.js → esm2020/manager/formio-angular-manager.mjs} +0 -0
  93. package/esm2020/manager/index/index.component.mjs +84 -0
  94. package/{esm2015/manager/index.js → esm2020/manager/index.mjs} +0 -0
  95. package/{esm2015/manager/public_api.js → esm2020/manager/public_api.mjs} +0 -0
  96. package/esm2020/manager/submission/delete/delete.component.mjs +28 -0
  97. package/esm2020/manager/submission/edit/edit.component.mjs +22 -0
  98. package/esm2020/manager/submission/index/index.component.mjs +22 -0
  99. package/esm2020/manager/submission/submission/submission.component.mjs +26 -0
  100. package/esm2020/manager/submission/view/view.component.mjs +16 -0
  101. package/esm2020/manager/view/view.component.mjs +42 -0
  102. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  103. package/esm2020/resource/create/create.component.mjs +37 -0
  104. package/esm2020/resource/delete/delete.component.mjs +26 -0
  105. package/esm2020/resource/edit/edit.component.mjs +36 -0
  106. package/{esm2015/resource/formio-angular-resource.js → esm2020/resource/formio-angular-resource.mjs} +0 -0
  107. package/esm2020/resource/index/index.component.mjs +61 -0
  108. package/{esm2015/resource/index.js → esm2020/resource/index.mjs} +0 -0
  109. package/{esm2015/resource/public_api.js → esm2020/resource/public_api.mjs} +0 -0
  110. package/esm2020/resource/resource.component.mjs +46 -0
  111. package/esm2020/resource/resource.config.mjs +15 -0
  112. package/esm2020/resource/resource.module.mjs +64 -0
  113. package/{esm2015/resource/resource.routes.js → esm2020/resource/resource.routes.mjs} +0 -0
  114. package/esm2020/resource/resource.service.mjs +186 -0
  115. package/esm2020/resource/resources.service.mjs +22 -0
  116. package/esm2020/resource/view/view.component.mjs +23 -0
  117. package/{esm2015/types/alerts-position.js → esm2020/types/alerts-position.mjs} +0 -0
  118. package/{esm2015/types/formio-metadata.js → esm2020/types/formio-metadata.mjs} +0 -0
  119. package/{esm2015/types/formio-submission.js → esm2020/types/formio-submission.mjs} +0 -0
  120. package/fesm2015/formio-angular-auth.mjs +296 -0
  121. package/fesm2015/formio-angular-auth.mjs.map +1 -0
  122. package/fesm2015/formio-angular-grid.mjs +691 -0
  123. package/fesm2015/formio-angular-grid.mjs.map +1 -0
  124. package/fesm2015/formio-angular-manager.mjs +739 -0
  125. package/fesm2015/formio-angular-manager.mjs.map +1 -0
  126. package/fesm2015/formio-angular-resource.mjs +511 -0
  127. package/fesm2015/formio-angular-resource.mjs.map +1 -0
  128. package/fesm2015/formio-angular.mjs +1138 -0
  129. package/fesm2015/formio-angular.mjs.map +1 -0
  130. package/fesm2020/formio-angular-auth.mjs +296 -0
  131. package/fesm2020/formio-angular-auth.mjs.map +1 -0
  132. package/fesm2020/formio-angular-grid.mjs +690 -0
  133. package/fesm2020/formio-angular-grid.mjs.map +1 -0
  134. package/fesm2020/formio-angular-manager.mjs +739 -0
  135. package/fesm2020/formio-angular-manager.mjs.map +1 -0
  136. package/fesm2020/formio-angular-resource.mjs +509 -0
  137. package/fesm2020/formio-angular-resource.mjs.map +1 -0
  138. package/fesm2020/formio-angular.mjs +1146 -0
  139. package/fesm2020/formio-angular.mjs.map +1 -0
  140. package/formio-angular.d.ts +1 -2
  141. package/formio-angular.d.ts.map +1 -1
  142. package/formio.config.d.ts +3 -0
  143. package/formio.config.d.ts.map +1 -1
  144. package/formio.module.d.ts +11 -0
  145. package/formio.module.d.ts.map +1 -1
  146. package/grid/GridBodyComponent.d.ts +3 -0
  147. package/grid/GridBodyComponent.d.ts.map +1 -1
  148. package/grid/GridFooterComponent.d.ts +3 -0
  149. package/grid/GridFooterComponent.d.ts.map +1 -1
  150. package/grid/GridHeaderComponent.d.ts +3 -0
  151. package/grid/GridHeaderComponent.d.ts.map +1 -1
  152. package/grid/form/FormGridBody.component.d.ts +3 -0
  153. package/grid/form/FormGridBody.component.d.ts.map +1 -1
  154. package/grid/form/FormGridFooter.component.d.ts +3 -0
  155. package/grid/form/FormGridFooter.component.d.ts.map +1 -1
  156. package/grid/form/FormGridHeader.component.d.ts +3 -0
  157. package/grid/form/FormGridHeader.component.d.ts.map +1 -1
  158. package/grid/form/time-since.pipe.d.ts +3 -0
  159. package/grid/form/time-since.pipe.d.ts.map +1 -1
  160. package/grid/formio-angular-grid.d.ts +1 -1
  161. package/grid/formio-angular-grid.d.ts.map +1 -1
  162. package/grid/grid.component.d.ts +3 -0
  163. package/grid/grid.component.d.ts.map +1 -1
  164. package/grid/grid.module.d.ts +20 -0
  165. package/grid/grid.module.d.ts.map +1 -1
  166. package/grid/grid.service.d.ts +3 -0
  167. package/grid/grid.service.d.ts.map +1 -1
  168. package/grid/package.json +5 -6
  169. package/grid/submission/SubmissionGridBody.component.d.ts +3 -0
  170. package/grid/submission/SubmissionGridBody.component.d.ts.map +1 -1
  171. package/grid/submission/SubmissionGridFooter.component.d.ts +3 -0
  172. package/grid/submission/SubmissionGridFooter.component.d.ts.map +1 -1
  173. package/grid/submission/SubmissionGridHeader.component.d.ts +3 -0
  174. package/grid/submission/SubmissionGridHeader.component.d.ts.map +1 -1
  175. package/manager/create/create.component.d.ts +3 -0
  176. package/manager/create/create.component.d.ts.map +1 -1
  177. package/manager/delete/delete.component.d.ts +3 -0
  178. package/manager/delete/delete.component.d.ts.map +1 -1
  179. package/manager/edit/edit.component.d.ts +3 -0
  180. package/manager/edit/edit.component.d.ts.map +1 -1
  181. package/manager/form/form.component.d.ts +3 -0
  182. package/manager/form/form.component.d.ts.map +1 -1
  183. package/manager/form-manager.config.d.ts +3 -0
  184. package/manager/form-manager.config.d.ts.map +1 -1
  185. package/manager/form-manager.module.d.ts +22 -0
  186. package/manager/form-manager.module.d.ts.map +1 -1
  187. package/manager/form-manager.service.d.ts +3 -0
  188. package/manager/form-manager.service.d.ts.map +1 -1
  189. package/manager/formio-angular-manager.d.ts +1 -0
  190. package/manager/formio-angular-manager.d.ts.map +1 -1
  191. package/manager/index/index.component.d.ts +3 -0
  192. package/manager/index/index.component.d.ts.map +1 -1
  193. package/manager/package.json +5 -6
  194. package/manager/submission/delete/delete.component.d.ts +3 -0
  195. package/manager/submission/delete/delete.component.d.ts.map +1 -1
  196. package/manager/submission/edit/edit.component.d.ts +3 -0
  197. package/manager/submission/edit/edit.component.d.ts.map +1 -1
  198. package/manager/submission/index/index.component.d.ts +3 -0
  199. package/manager/submission/index/index.component.d.ts.map +1 -1
  200. package/manager/submission/submission/submission.component.d.ts +3 -0
  201. package/manager/submission/submission/submission.component.d.ts.map +1 -1
  202. package/manager/submission/view/view.component.d.ts +3 -0
  203. package/manager/submission/view/view.component.d.ts.map +1 -1
  204. package/manager/view/view.component.d.ts +3 -0
  205. package/manager/view/view.component.d.ts.map +1 -1
  206. package/package.json +55 -11
  207. package/resource/create/create.component.d.ts +3 -0
  208. package/resource/create/create.component.d.ts.map +1 -1
  209. package/resource/delete/delete.component.d.ts +3 -0
  210. package/resource/delete/delete.component.d.ts.map +1 -1
  211. package/resource/edit/edit.component.d.ts +3 -0
  212. package/resource/edit/edit.component.d.ts.map +1 -1
  213. package/resource/formio-angular-resource.d.ts +1 -0
  214. package/resource/formio-angular-resource.d.ts.map +1 -1
  215. package/resource/index/index.component.d.ts +3 -0
  216. package/resource/index/index.component.d.ts.map +1 -1
  217. package/resource/package.json +5 -6
  218. package/resource/resource.component.d.ts +3 -0
  219. package/resource/resource.component.d.ts.map +1 -1
  220. package/resource/resource.config.d.ts +3 -0
  221. package/resource/resource.config.d.ts.map +1 -1
  222. package/resource/resource.module.d.ts +14 -0
  223. package/resource/resource.module.d.ts.map +1 -1
  224. package/resource/resource.service.d.ts +3 -0
  225. package/resource/resource.service.d.ts.map +1 -1
  226. package/resource/resources.service.d.ts +3 -0
  227. package/resource/resources.service.d.ts.map +1 -1
  228. package/resource/view/view.component.d.ts +3 -0
  229. package/resource/view/view.component.d.ts.map +1 -1
  230. package/FormioBaseComponent.ngfactory.d.ts.map +0 -1
  231. package/auth/formio-angular-auth.metadata.json +0 -1
  232. package/bundles/formio-angular-auth.umd.js +0 -312
  233. package/bundles/formio-angular-auth.umd.js.map +0 -1
  234. package/bundles/formio-angular-grid.umd.js +0 -1010
  235. package/bundles/formio-angular-grid.umd.js.map +0 -1
  236. package/bundles/formio-angular-manager.umd.js +0 -1122
  237. package/bundles/formio-angular-manager.umd.js.map +0 -1
  238. package/bundles/formio-angular-resource.umd.js +0 -556
  239. package/bundles/formio-angular-resource.umd.js.map +0 -1
  240. package/bundles/formio-angular.umd.js +0 -1497
  241. package/bundles/formio-angular.umd.js.map +0 -1
  242. package/components/alerts/formio.alerts.component.ngfactory.d.ts.map +0 -1
  243. package/components/alerts/parse-html-content.pipe.ngfactory.d.ts.map +0 -1
  244. package/components/formbuilder/formbuilder.component.ngfactory.d.ts.map +0 -1
  245. package/components/formio/formio.component.ngfactory.d.ts.map +0 -1
  246. package/components/loader/formio.loader.component.ngfactory.d.ts.map +0 -1
  247. package/components/loader/formio.loader.component.scss.shim.ngstyle.d.ts.map +0 -1
  248. package/custom-component/custom-tags.service.ngfactory.d.ts.map +0 -1
  249. package/esm2015/FormioBaseComponent.js +0 -456
  250. package/esm2015/auth/auth.component.js +0 -9
  251. package/esm2015/auth/auth.config.js +0 -12
  252. package/esm2015/auth/auth.module.js +0 -34
  253. package/esm2015/auth/auth.service.js +0 -160
  254. package/esm2015/auth/login/login.component.js +0 -16
  255. package/esm2015/auth/register/register.component.js +0 -16
  256. package/esm2015/auth/resetpass/resetpass.component.js +0 -16
  257. package/esm2015/components/alerts/formio.alerts.component.js +0 -26
  258. package/esm2015/components/alerts/parse-html-content.pipe.js +0 -15
  259. package/esm2015/components/formbuilder/formbuilder.component.js +0 -185
  260. package/esm2015/components/formio/formio.component.js +0 -39
  261. package/esm2015/components/loader/formio.loader.component.js +0 -14
  262. package/esm2015/custom-component/create-custom-component.js +0 -130
  263. package/esm2015/custom-component/custom-tags.service.js +0 -13
  264. package/esm2015/formio-angular.js +0 -7
  265. package/esm2015/formio.config.js +0 -11
  266. package/esm2015/formio.module.js +0 -42
  267. package/esm2015/grid/GridBodyComponent.js +0 -76
  268. package/esm2015/grid/GridFooterComponent.js +0 -26
  269. package/esm2015/grid/GridHeaderComponent.js +0 -25
  270. package/esm2015/grid/form/FormGridBody.component.js +0 -16
  271. package/esm2015/grid/form/FormGridFooter.component.js +0 -24
  272. package/esm2015/grid/form/FormGridHeader.component.js +0 -24
  273. package/esm2015/grid/form/time-since.pipe.js +0 -33
  274. package/esm2015/grid/formio-angular-grid.js +0 -6
  275. package/esm2015/grid/grid.component.js +0 -211
  276. package/esm2015/grid/grid.module.js +0 -61
  277. package/esm2015/grid/grid.service.js +0 -16
  278. package/esm2015/grid/submission/SubmissionGridBody.component.js +0 -40
  279. package/esm2015/grid/submission/SubmissionGridFooter.component.js +0 -21
  280. package/esm2015/grid/submission/SubmissionGridHeader.component.js +0 -58
  281. package/esm2015/manager/create/create.component.js +0 -13
  282. package/esm2015/manager/delete/delete.component.js +0 -42
  283. package/esm2015/manager/edit/edit.component.js +0 -109
  284. package/esm2015/manager/form/form.component.js +0 -73
  285. package/esm2015/manager/form-manager.config.js +0 -12
  286. package/esm2015/manager/form-manager.module.js +0 -56
  287. package/esm2015/manager/form-manager.service.js +0 -180
  288. package/esm2015/manager/index/index.component.js +0 -86
  289. package/esm2015/manager/submission/delete/delete.component.js +0 -32
  290. package/esm2015/manager/submission/edit/edit.component.js +0 -24
  291. package/esm2015/manager/submission/index/index.component.js +0 -24
  292. package/esm2015/manager/submission/submission/submission.component.js +0 -27
  293. package/esm2015/manager/submission/view/view.component.js +0 -16
  294. package/esm2015/manager/view/view.component.js +0 -45
  295. package/esm2015/resource/create/create.component.js +0 -40
  296. package/esm2015/resource/delete/delete.component.js +0 -29
  297. package/esm2015/resource/edit/edit.component.js +0 -39
  298. package/esm2015/resource/index/index.component.js +0 -65
  299. package/esm2015/resource/resource.component.js +0 -48
  300. package/esm2015/resource/resource.config.js +0 -12
  301. package/esm2015/resource/resource.module.js +0 -44
  302. package/esm2015/resource/resource.service.js +0 -187
  303. package/esm2015/resource/resources.service.js +0 -22
  304. package/esm2015/resource/view/view.component.js +0 -24
  305. package/fesm2015/formio-angular-auth.js +0 -285
  306. package/fesm2015/formio-angular-auth.js.map +0 -1
  307. package/fesm2015/formio-angular-grid.js +0 -624
  308. package/fesm2015/formio-angular-grid.js.map +0 -1
  309. package/fesm2015/formio-angular-manager.js +0 -750
  310. package/fesm2015/formio-angular-manager.js.map +0 -1
  311. package/fesm2015/formio-angular-resource.js +0 -515
  312. package/fesm2015/formio-angular-resource.js.map +0 -1
  313. package/fesm2015/formio-angular.js +0 -1073
  314. package/fesm2015/formio-angular.js.map +0 -1
  315. package/formio-angular.metadata.json +0 -1
  316. package/formio.config.ngfactory.d.ts.map +0 -1
  317. package/formio.module.ngfactory.d.ts.map +0 -1
  318. package/grid/GridBodyComponent.ngfactory.d.ts.map +0 -1
  319. package/grid/GridFooterComponent.ngfactory.d.ts.map +0 -1
  320. package/grid/GridHeaderComponent.ngfactory.d.ts.map +0 -1
  321. package/grid/form/FormGridBody.component.ngfactory.d.ts.map +0 -1
  322. package/grid/form/FormGridBody.component.scss.shim.ngstyle.d.ts.map +0 -1
  323. package/grid/form/FormGridFooter.component.ngfactory.d.ts.map +0 -1
  324. package/grid/form/FormGridHeader.component.ngfactory.d.ts.map +0 -1
  325. package/grid/form/time-since.pipe.ngfactory.d.ts.map +0 -1
  326. package/grid/formio-angular-grid.metadata.json +0 -1
  327. package/grid/grid.component.ngfactory.d.ts.map +0 -1
  328. package/grid/grid.component.scss.shim.ngstyle.d.ts.map +0 -1
  329. package/grid/grid.footer.scss.ngstyle.d.ts.map +0 -1
  330. package/grid/grid.module.ngfactory.d.ts.map +0 -1
  331. package/grid/grid.service.ngfactory.d.ts.map +0 -1
  332. package/grid/submission/SubmissionGridBody.component.ngfactory.d.ts.map +0 -1
  333. package/grid/submission/SubmissionGridFooter.component.ngfactory.d.ts.map +0 -1
  334. package/grid/submission/SubmissionGridHeader.component.ngfactory.d.ts.map +0 -1
  335. package/manager/formio-angular-manager.metadata.json +0 -1
  336. package/resource/formio-angular-resource.metadata.json +0 -1
@@ -0,0 +1,186 @@
1
+ import { EventEmitter, Injectable, Optional } from '@angular/core';
2
+ import { FormioPromiseService } from '@formio/angular';
3
+ import { FormioAlerts } from '@formio/angular';
4
+ import Promise from 'native-promise-only';
5
+ import { Formio, Utils } from 'formiojs';
6
+ import _ from 'lodash';
7
+ import * as i0 from "@angular/core";
8
+ import * as i1 from "@formio/angular";
9
+ import * as i2 from "./resource.config";
10
+ import * as i3 from "./resources.service";
11
+ export class FormioResourceService {
12
+ constructor(appConfig, config, resourcesService, appRef) {
13
+ this.appConfig = appConfig;
14
+ this.config = config;
15
+ this.resourcesService = resourcesService;
16
+ this.appRef = appRef;
17
+ this.initialized = false;
18
+ this.isLoading = true;
19
+ this.alerts = new FormioAlerts();
20
+ this.refresh = new EventEmitter();
21
+ this.formLoaded = new Promise((resolve, reject) => {
22
+ this.formResolve = resolve;
23
+ this.formReject = reject;
24
+ });
25
+ this.init();
26
+ }
27
+ initialize() {
28
+ console.warn('FormioResourceService.initialize() has been deprecated.');
29
+ }
30
+ init() {
31
+ if (this.initialized) {
32
+ return;
33
+ }
34
+ this.initialized = true;
35
+ if (this.appConfig && this.appConfig.appUrl) {
36
+ Formio.setBaseUrl(this.appConfig.apiUrl);
37
+ Formio.setProjectUrl(this.appConfig.appUrl);
38
+ Formio.formOnly = this.appConfig.formOnly;
39
+ }
40
+ else {
41
+ console.error('You must provide an AppConfig within your application!');
42
+ }
43
+ // Create the form url and load the resources.
44
+ this.formUrl = this.appConfig.appUrl + '/' + this.config.form;
45
+ this.resource = { data: {} };
46
+ // Add this resource service to the list of all resources in context.
47
+ if (this.resourcesService) {
48
+ this.resources = this.resourcesService.resources;
49
+ this.resources[this.config.name] = this;
50
+ }
51
+ return this.loadForm();
52
+ }
53
+ onError(error) {
54
+ this.alerts.setAlert({
55
+ type: 'danger',
56
+ message: error.message || error
57
+ });
58
+ if (this.resourcesService) {
59
+ this.resourcesService.error.emit(error);
60
+ }
61
+ throw error;
62
+ }
63
+ onFormError(err) {
64
+ this.formReject(err);
65
+ this.onError(err);
66
+ }
67
+ setContext(route) {
68
+ this.resourceId = route.snapshot.params['id'];
69
+ this.resource = { data: {} };
70
+ this.resourceUrl = this.appConfig.appUrl + '/' + this.config.form;
71
+ if (this.resourceId) {
72
+ this.resourceUrl += '/submission/' + this.resourceId;
73
+ }
74
+ this.formio = new FormioPromiseService(this.resourceUrl);
75
+ if (this.resourcesService) {
76
+ this.resources[this.config.name] = this;
77
+ }
78
+ this.loadParents();
79
+ }
80
+ loadForm() {
81
+ this.formFormio = new FormioPromiseService(this.formUrl);
82
+ this.isLoading = true;
83
+ this.formLoading = this.formFormio
84
+ .loadForm()
85
+ .then((form) => {
86
+ this.form = form;
87
+ this.formResolve(form);
88
+ this.isLoading = false;
89
+ this.loadParents();
90
+ return form;
91
+ }, (err) => this.onFormError(err))
92
+ .catch((err) => this.onFormError(err));
93
+ return this.formLoading;
94
+ }
95
+ loadParents() {
96
+ if (!this.config.parents || !this.config.parents.length) {
97
+ return Promise.resolve([]);
98
+ }
99
+ if (!this.resourcesService) {
100
+ console.warn('You must provide the FormioResources within your application to use nested resources.');
101
+ return Promise.resolve([]);
102
+ }
103
+ return this.formLoading.then((form) => {
104
+ // Iterate through the list of parents.
105
+ const _parentsLoaded = [];
106
+ this.config.parents.forEach((parent) => {
107
+ const resourceName = parent.resource || parent;
108
+ const resourceField = parent.field || parent;
109
+ const filterResource = parent.hasOwnProperty('filter') ? parent.filter : true;
110
+ if (this.resources.hasOwnProperty(resourceName) && this.resources[resourceName].resourceLoaded) {
111
+ _parentsLoaded.push(this.resources[resourceName].resourceLoaded.then((resource) => {
112
+ let parentPath = '';
113
+ Utils.eachComponent(form.components, (component, path) => {
114
+ if (component.key === resourceField) {
115
+ component.hidden = true;
116
+ component.clearOnHide = false;
117
+ _.set(this.resource.data, path, resource);
118
+ parentPath = path;
119
+ return true;
120
+ }
121
+ });
122
+ return {
123
+ name: parentPath,
124
+ filter: filterResource,
125
+ resource
126
+ };
127
+ }));
128
+ }
129
+ });
130
+ // When all the parents have loaded, emit that to the onParents emitter.
131
+ return Promise.all(_parentsLoaded).then((parents) => {
132
+ this.refresh.emit({
133
+ form: form,
134
+ submission: this.resource
135
+ });
136
+ return parents;
137
+ });
138
+ });
139
+ }
140
+ onSubmissionError(err) {
141
+ this.onError(err);
142
+ }
143
+ loadResource(route) {
144
+ this.setContext(route);
145
+ this.isLoading = true;
146
+ this.resourceLoading = this.resourceLoaded = this.formio
147
+ .loadSubmission(null, { ignoreCache: true })
148
+ .then((resource) => {
149
+ this.resource = resource;
150
+ this.isLoading = false;
151
+ this.refresh.emit({
152
+ property: 'submission',
153
+ value: this.resource
154
+ });
155
+ return resource;
156
+ }, (err) => this.onSubmissionError(err))
157
+ .catch((err) => this.onSubmissionError(err));
158
+ return this.resourceLoading;
159
+ }
160
+ save(resource) {
161
+ const formio = resource._id ? this.formio : this.formFormio;
162
+ return formio
163
+ .saveSubmission(resource)
164
+ .then((saved) => {
165
+ this.resource = saved;
166
+ return saved;
167
+ }, (err) => this.onError(err))
168
+ .catch((err) => this.onError(err));
169
+ }
170
+ remove() {
171
+ return this.formio
172
+ .deleteSubmission()
173
+ .then(() => {
174
+ this.resource = null;
175
+ }, (err) => this.onError(err))
176
+ .catch((err) => this.onError(err));
177
+ }
178
+ }
179
+ FormioResourceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioResourceService, deps: [{ token: i1.FormioAppConfig }, { token: i2.FormioResourceConfig }, { token: i3.FormioResources, optional: true }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable });
180
+ FormioResourceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioResourceService });
181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioResourceService, decorators: [{
182
+ type: Injectable
183
+ }], ctorParameters: function () { return [{ type: i1.FormioAppConfig }, { type: i2.FormioResourceConfig }, { type: i3.FormioResources, decorators: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XNPd25Qcm9wZXJ0eSgnZmlsdGVyJykgPyBwYXJlbnQuZmlsdGVyIDogdHJ1ZTtcbiAgICAgICAgaWYgKHRoaXMucmVzb3VyY2VzLmhhc093blByb3BlcnR5KHJlc291cmNlTmFtZSkgJiYgdGhpcy5yZXNvdXJjZXNbcmVzb3VyY2VOYW1lXS5yZXNvdXJjZUxvYWRlZCkge1xuICAgICAgICAgIF9wYXJlbnRzTG9hZGVkLnB1c2goXG4gICAgICAgICAgICB0aGlzLnJlc291cmNlc1tyZXNvdXJjZU5hbWVdLnJlc291cmNlTG9hZGVkLnRoZW4oKHJlc291cmNlOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgbGV0IHBhcmVudFBhdGggPSAnJztcbiAgICAgICAgICAgICAgVXRpbHMuZWFjaENvbXBvbmVudChmb3JtLmNvbXBvbmVudHMsIChjb21wb25lbnQsIHBhdGgpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoY29tcG9uZW50LmtleSA9PT0gcmVzb3VyY2VGaWVsZCkge1xuICAgICAgICAgICAgICAgICAgY29tcG9uZW50LmhpZGRlbiA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBjb21wb25lbnQuY2xlYXJPbkhpZGUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIF8uc2V0KHRoaXMucmVzb3VyY2UuZGF0YSwgcGF0aCwgcmVzb3VyY2UpO1xuICAgICAgICAgICAgICAgICAgcGFyZW50UGF0aCA9IHBhdGg7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIG5hbWU6IHBhcmVudFBhdGgsXG4gICAgICAgICAgICAgICAgZmlsdGVyOiBmaWx0ZXJSZXNvdXJjZSxcbiAgICAgICAgICAgICAgICByZXNvdXJjZVxuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSlcbiAg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ICB9KTtcbiAgICAgICAgICByZXR1cm4gcmVzb3VyY2U7XG4gICAgICAgIH0sXG4gICAgICAgIChlcnI6IGFueSkgPT4gdGhpcy5vblN1Ym1pc3Npb25FcnJvcihlcnIpXG4gICAgICApXG4gICAgICAuY2F0Y2goKGVycjogYW55KSA9PiB0aGlzLm9uU3VibWlzc2lvbkVycm9yKGVycikpO1xuICAgIHJldHVybiB0aGlzLnJlc291cmNlTG9hZGluZztcbiAgfVxuXG4gIHNhdmUocmVzb3VyY2U6IGFueSkge1xuICAgIGNvbnN0IGZvcm1pbyA9IHJlc291cmNlLl9pZCA/IHRoaXMuZm9ybWlvIDogdGhpcy5mb3JtRm9ybWlvO1xuICAgIHJldHVybiBmb3JtaW9cbiAgICAgIC5zYXZlU3VibWlzc2lvbihyZXNvdXJjZSlcbiAgICAgIC50aGVuKFxuICAgICAgICAoc2F2ZWQ6IGFueSkgPT4ge1xuICAgICAgICAgIHRoaXMucmVzb3VyY2UgPSBzYXZlZDtcbiAgICAgICAgICByZXR1cm4gc2F2ZWQ7XG4gICAgICAgIH0sXG4gICAgICAgIChlcnI6IGFueSkgPT4gdGhpcy5vbkVycm9yKGVycilcbiAgICAgIClcbiAgICAgIC5jYXRjaCgoZXJyOiBhbnkpID0+IHRoaXMub25FcnJvcihlcnIpKTtcbiAgfVxuXG4gIHJlbW92ZSgpIHtcbiAgICByZXR1cm4gdGhpcy5mb3JtaW9cbiAgICAgIC5kZWxldGVTdWJtaXNzaW9uKClcbiAgICAgIC50aGVuKFxuICAgICAgICAoKSA9PiB7XG4gICAgICAgICAgdGhpcy5yZXNvdXJjZSA9IG51bGw7XG4gICAgICAgIH0sXG4gICAgICAgIChlcnI6IGFueSkgPT4gdGhpcy5vbkVycm9yKGVycilcbiAgICAgIClcbiAgICAgIC5jYXRjaCgoZXJyOiBhbnkpID0+IHRoaXMub25FcnJvcihlcnIpKTtcbiAgfVxufVxuIl19
@@ -0,0 +1,22 @@
1
+ import { Injectable, EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@formio/angular/auth";
4
+ export class FormioResources {
5
+ constructor(auth) {
6
+ this.auth = auth;
7
+ this.resources = {};
8
+ this.error = new EventEmitter();
9
+ this.onError = this.error;
10
+ this.resources = {
11
+ currentUser: {
12
+ resourceLoaded: this.auth.userReady
13
+ }
14
+ };
15
+ }
16
+ }
17
+ FormioResources.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioResources, deps: [{ token: i1.FormioAuthService }], target: i0.ɵɵFactoryTarget.Injectable });
18
+ FormioResources.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioResources });
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioResources, decorators: [{
20
+ type: Injectable
21
+ }], ctorParameters: function () { return [{ type: i1.FormioAuthService }]; } });
22
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb3VyY2VzLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyLWZvcm1pby9yZXNvdXJjZS9zcmMvcmVzb3VyY2VzLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxZQUFZLEVBQUUsTUFBTSxlQUFlLENBQUM7OztBQVF6RCxNQUFNLE9BQU8sZUFBZTtJQUkxQixZQUNTLElBQXdCO1FBQXhCLFNBQUksR0FBSixJQUFJLENBQW9CO1FBSmpDLGNBQVMsR0FBc0IsRUFBRSxDQUFDO1FBTWhDLElBQUksQ0FBQyxLQUFLLEdBQUcsSUFBSSxZQUFZLEVBQUUsQ0FBQztRQUNoQyxJQUFJLENBQUMsT0FBTyxHQUFHLElBQUksQ0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 'formiojs';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "../resource.service";
5
+ import * as i2 from "../resource.config";
6
+ import * as i3 from "@formio/angular";
7
+ export class FormioResourceViewComponent {
8
+ constructor(service, config) {
9
+ this.service = service;
10
+ this.config = config;
11
+ this.submission = { data: {} };
12
+ }
13
+ ngOnDestroy() {
14
+ Formio.clearCache();
15
+ }
16
+ }
17
+ FormioResourceViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioResourceViewComponent, deps: [{ token: i1.FormioResourceService }, { token: i2.FormioResourceConfig }], target: i0.ɵɵFactoryTarget.Component });
18
+ FormioResourceViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: FormioResourceViewComponent, selector: "ng-component", ngImport: i0, template: "<formio\n [form]=\"service.form\"\n [submission]=\"service.resource\"\n [hideComponents]=\"config.parents\"\n [readOnly]=\"true\"\n></formio>\n", components: [{ type: i3.FormioComponent, selector: "formio" }] });
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioResourceViewComponent, decorators: [{
20
+ type: Component,
21
+ args: [{ template: "<formio\n [form]=\"service.form\"\n [submission]=\"service.resource\"\n [hideComponents]=\"config.parents\"\n [readOnly]=\"true\"\n></formio>\n" }]
22
+ }], ctorParameters: function () { return [{ type: i1.FormioResourceService }, { type: i2.FormioResourceConfig }]; } });
23
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmlldy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyLWZvcm1pby9yZXNvdXJjZS9zcmMvdmlldy92aWV3LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2FuZ3VsYXItZm9ybWlvL3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yKFxuICAgIHB1YmxpYyBzZXJ2aWNlOiBGb3JtaW9SZXNvdXJjZVNlcnZpY2UsXG4gICAgcHVibGljIGNvbmZpZzogRm9ybWlvUmVzb3VyY2VDb25maWdcbiAgKSB7fVxuICBwdWJsaWMgc3VibWlzc2lvbiA9IHtkYXRhOiB7fX07XG5cbiAgbmdPbkRlc3Ryb3koKSB7XG4gICAgRm9ybWlvLmNsZWFyQ2FjaGUoKTtcbiAgfVxufVxuIiwiPGZvcm1pb1xuICBbZm9ybV09XCJzZXJ2aWNlLmZvcm1cIlxuICBbc3VibWlzc2lvbl09XCJzZXJ2aWNlLnJlc291cmNlXCJcbiAgW2hpZGVDb21wb25lbnRzXT1cImNvbmZpZy5wYXJlbnRzXCJcbiAgW3JlYWRPbmx5XT1cInRydWVcIlxuPjwvZm9ybWlvPlxuIl19
@@ -0,0 +1,296 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, NgModule } from '@angular/core';
3
+ import { get, each } from 'lodash';
4
+ import { Formio } from 'formiojs';
5
+ import * as i2 from '@formio/angular';
6
+ import { extendRouter, FormioModule } from '@formio/angular';
7
+ import * as i1 from '@angular/router';
8
+ import { RouterModule } from '@angular/router';
9
+ import { CommonModule } from '@angular/common';
10
+
11
+ class FormioAuthConfig {
12
+ }
13
+ FormioAuthConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
14
+ FormioAuthConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthConfig });
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthConfig, decorators: [{
16
+ type: Injectable
17
+ }] });
18
+ var FormioOauthType;
19
+ (function (FormioOauthType) {
20
+ FormioOauthType["okta"] = "okta";
21
+ FormioOauthType["saml"] = "saml";
22
+ })(FormioOauthType || (FormioOauthType = {}));
23
+
24
+ class FormioAuthService {
25
+ constructor(appConfig, config) {
26
+ this.appConfig = appConfig;
27
+ this.config = config;
28
+ this.authenticated = false;
29
+ this.formAccess = {};
30
+ this.submissionAccess = {};
31
+ this.is = {};
32
+ this.user = null;
33
+ if (this.appConfig && this.appConfig.appUrl) {
34
+ Formio.setBaseUrl(this.appConfig.apiUrl);
35
+ Formio.setProjectUrl(this.appConfig.appUrl);
36
+ Formio.formOnly = !!this.appConfig.formOnly;
37
+ }
38
+ else {
39
+ console.error('You must provide an AppConfig within your application!');
40
+ }
41
+ this.loginForm =
42
+ this.appConfig.appUrl +
43
+ '/' +
44
+ get(this.config, 'login.form', 'user/login');
45
+ this.registerForm =
46
+ this.appConfig.appUrl +
47
+ '/' +
48
+ get(this.config, 'register.form', 'user/register');
49
+ this.resetPassForm =
50
+ this.appConfig.appUrl +
51
+ '/' +
52
+ get(this.config, 'register.form', 'resetpass');
53
+ this.onLogin = new EventEmitter();
54
+ this.onLogout = new EventEmitter();
55
+ this.onRegister = new EventEmitter();
56
+ this.onUser = new EventEmitter();
57
+ this.onError = new EventEmitter();
58
+ this.ready = new Promise((resolve, reject) => {
59
+ this.readyResolve = resolve;
60
+ this.readyReject = reject;
61
+ });
62
+ // Register for the core events.
63
+ Formio.events.on('formio.badToken', () => this.logoutError());
64
+ Formio.events.on('formio.sessionExpired', () => this.logoutError());
65
+ if (!this.config.delayAuth) {
66
+ this.init();
67
+ }
68
+ }
69
+ onLoginSubmit(submission) {
70
+ this.setUser(submission);
71
+ this.onLogin.emit(submission);
72
+ }
73
+ onRegisterSubmit(submission) {
74
+ this.setUser(submission);
75
+ this.onRegister.emit(submission);
76
+ }
77
+ onResetPassSubmit(submission) {
78
+ this.onResetPass.emit(submission);
79
+ }
80
+ init() {
81
+ this.projectReady = Formio.makeStaticRequest(this.appConfig.appUrl).then((project) => {
82
+ each(project.access, (access) => {
83
+ this.formAccess[access.type] = access.roles;
84
+ });
85
+ }, () => {
86
+ this.formAccess = {};
87
+ return null;
88
+ });
89
+ // Get the access for this project.
90
+ this.accessReady = Formio.makeStaticRequest(this.appConfig.appUrl + '/access').then((access) => {
91
+ each(access.forms, (form) => {
92
+ this.submissionAccess[form.name] = {};
93
+ form.submissionAccess.forEach((subAccess) => {
94
+ this.submissionAccess[form.name][subAccess.type] = subAccess.roles;
95
+ });
96
+ });
97
+ this.roles = access.roles;
98
+ return access;
99
+ }, () => {
100
+ this.roles = {};
101
+ return null;
102
+ });
103
+ let currentUserPromise;
104
+ if (this.config.oauth) {
105
+ // Make a fix to the hash to remove starting "/" that angular might put there.
106
+ if (window.location.hash && window.location.hash.match(/^#\/access_token/)) {
107
+ history.pushState(null, null, window.location.hash.replace(/^#\/access_token/, '#access_token'));
108
+ }
109
+ // Initiate the SSO if they provide oauth settings.
110
+ currentUserPromise = Formio.ssoInit(this.config.oauth.type, this.config.oauth.options);
111
+ }
112
+ else {
113
+ currentUserPromise = Formio.currentUser();
114
+ }
115
+ this.userReady = currentUserPromise.then((user) => {
116
+ this.setUser(user);
117
+ return user;
118
+ });
119
+ // Trigger we are redy when all promises have resolved.
120
+ if (this.accessReady) {
121
+ this.accessReady
122
+ .then(() => this.projectReady)
123
+ .then(() => this.userReady)
124
+ .then(() => this.readyResolve(true))
125
+ .catch((err) => this.readyReject(err));
126
+ }
127
+ }
128
+ setUser(user) {
129
+ const namespace = Formio.namespace || 'formio';
130
+ if (user) {
131
+ this.user = user;
132
+ localStorage.setItem(`${namespace}AppUser`, JSON.stringify(user));
133
+ this.setUserRoles();
134
+ }
135
+ else {
136
+ this.user = null;
137
+ this.is = {};
138
+ localStorage.removeItem(`${namespace}AppUser`);
139
+ Formio.clearCache();
140
+ Formio.setUser(null);
141
+ }
142
+ this.authenticated = !!Formio.getToken();
143
+ this.onUser.emit(this.user);
144
+ }
145
+ setUserRoles() {
146
+ if (this.accessReady) {
147
+ this.accessReady.then(() => {
148
+ each(this.roles, (role, roleName) => {
149
+ if (this.user.roles.indexOf(role._id) !== -1) {
150
+ this.is[roleName] = true;
151
+ }
152
+ });
153
+ });
154
+ }
155
+ }
156
+ logoutError() {
157
+ this.setUser(null);
158
+ const namespace = Formio.namespace || 'formio';
159
+ localStorage.removeItem(`${namespace}Token`);
160
+ this.onError.emit();
161
+ }
162
+ logout() {
163
+ this.setUser(null);
164
+ const namespace = Formio.namespace || 'formio';
165
+ localStorage.removeItem(`${namespace}Token`);
166
+ Formio.logout()
167
+ .then(() => this.onLogout.emit())
168
+ .catch(() => this.logoutError());
169
+ }
170
+ }
171
+ FormioAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthService, deps: [{ token: i2.FormioAppConfig }, { token: FormioAuthConfig }], target: i0.ɵɵFactoryTarget.Injectable });
172
+ FormioAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthService });
173
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthService, decorators: [{
174
+ type: Injectable
175
+ }], ctorParameters: function () { return [{ type: i2.FormioAppConfig }, { type: FormioAuthConfig }]; } });
176
+
177
+ class FormioAuthComponent {
178
+ }
179
+ FormioAuthComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
180
+ FormioAuthComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: FormioAuthComponent, selector: "ng-component", ngImport: i0, template: "<div class=\"card card-primary panel panel-default\">\n <div class=\"card-header panel-heading\">\n <ul class=\"nav nav-tabs card-header-tabs\">\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"login\" routerLinkActive=\"active\">Login</a></li>\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"register\" routerLinkActive=\"active\">Register</a></li>\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"resetpass\" routerLinkActive=\"active\">Reset Password</a></li>\n </ul>\n </div>\n <div class=\"card-body panel-body\">\n <router-outlet></router-outlet>\n </div>\n</div>\n", directives: [{ type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthComponent, decorators: [{
182
+ type: Component,
183
+ args: [{ template: "<div class=\"card card-primary panel panel-default\">\n <div class=\"card-header panel-heading\">\n <ul class=\"nav nav-tabs card-header-tabs\">\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"login\" routerLinkActive=\"active\">Login</a></li>\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"register\" routerLinkActive=\"active\">Register</a></li>\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"resetpass\" routerLinkActive=\"active\">Reset Password</a></li>\n </ul>\n </div>\n <div class=\"card-body panel-body\">\n <router-outlet></router-outlet>\n </div>\n</div>\n" }]
184
+ }] });
185
+
186
+ class FormioAuthLoginComponent {
187
+ constructor(service) {
188
+ this.service = service;
189
+ }
190
+ }
191
+ FormioAuthLoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthLoginComponent, deps: [{ token: FormioAuthService }], target: i0.ɵɵFactoryTarget.Component });
192
+ FormioAuthLoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: FormioAuthLoginComponent, selector: "ng-component", ngImport: i0, template: "<formio [src]=\"service.loginForm\" (submit)=\"service.onLoginSubmit($event)\"></formio>\n", components: [{ type: i2.FormioComponent, selector: "formio" }] });
193
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthLoginComponent, decorators: [{
194
+ type: Component,
195
+ args: [{ template: "<formio [src]=\"service.loginForm\" (submit)=\"service.onLoginSubmit($event)\"></formio>\n" }]
196
+ }], ctorParameters: function () { return [{ type: FormioAuthService }]; } });
197
+
198
+ class FormioAuthRegisterComponent {
199
+ constructor(service) {
200
+ this.service = service;
201
+ }
202
+ }
203
+ FormioAuthRegisterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthRegisterComponent, deps: [{ token: FormioAuthService }], target: i0.ɵɵFactoryTarget.Component });
204
+ FormioAuthRegisterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: FormioAuthRegisterComponent, selector: "ng-component", ngImport: i0, template: "<formio [src]=\"service.registerForm\" (submit)=\"service.onRegisterSubmit($event)\"></formio>\n", components: [{ type: i2.FormioComponent, selector: "formio" }] });
205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuthRegisterComponent, decorators: [{
206
+ type: Component,
207
+ args: [{ template: "<formio [src]=\"service.registerForm\" (submit)=\"service.onRegisterSubmit($event)\"></formio>\n" }]
208
+ }], ctorParameters: function () { return [{ type: FormioAuthService }]; } });
209
+
210
+ class FormioResetPassComponent {
211
+ constructor(service) {
212
+ this.service = service;
213
+ }
214
+ }
215
+ FormioResetPassComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioResetPassComponent, deps: [{ token: FormioAuthService }], target: i0.ɵɵFactoryTarget.Component });
216
+ FormioResetPassComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: FormioResetPassComponent, selector: "ng-component", ngImport: i0, template: "<formio [src]=\"service.resetPassForm\" (submit)=\"service.onResetPassSubmit($event)\"></formio>\n", components: [{ type: i2.FormioComponent, selector: "formio" }] });
217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioResetPassComponent, decorators: [{
218
+ type: Component,
219
+ args: [{ template: "<formio [src]=\"service.resetPassForm\" (submit)=\"service.onResetPassSubmit($event)\"></formio>\n" }]
220
+ }], ctorParameters: function () { return [{ type: FormioAuthService }]; } });
221
+
222
+ function FormioAuthRoutes(config) {
223
+ return [
224
+ {
225
+ path: '',
226
+ component: config && config.auth ? config.auth : FormioAuthComponent,
227
+ children: [
228
+ {
229
+ path: '',
230
+ redirectTo: 'login',
231
+ pathMatch: 'full'
232
+ },
233
+ {
234
+ path: 'login',
235
+ component: config && config.login ? config.login : FormioAuthLoginComponent
236
+ },
237
+ {
238
+ path: 'register',
239
+ component: config && config.register ? config.register : FormioAuthRegisterComponent
240
+ },
241
+ {
242
+ path: 'resetpass',
243
+ component: config && config.resetpass ? config.resetpass : FormioResetPassComponent
244
+ }
245
+ ]
246
+ }
247
+ ];
248
+ }
249
+
250
+ class FormioAuth {
251
+ static forRoot(config) {
252
+ return extendRouter(FormioAuth, config, FormioAuthRoutes);
253
+ }
254
+ static forChild(config) {
255
+ return extendRouter(FormioAuth, config, FormioAuthRoutes);
256
+ }
257
+ }
258
+ FormioAuth.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuth, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
259
+ FormioAuth.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuth, declarations: [FormioAuthComponent,
260
+ FormioAuthLoginComponent,
261
+ FormioAuthRegisterComponent,
262
+ FormioResetPassComponent], imports: [CommonModule,
263
+ FormioModule,
264
+ RouterModule] });
265
+ FormioAuth.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuth, imports: [[
266
+ CommonModule,
267
+ FormioModule,
268
+ RouterModule
269
+ ]] });
270
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FormioAuth, decorators: [{
271
+ type: NgModule,
272
+ args: [{
273
+ imports: [
274
+ CommonModule,
275
+ FormioModule,
276
+ RouterModule
277
+ ],
278
+ declarations: [
279
+ FormioAuthComponent,
280
+ FormioAuthLoginComponent,
281
+ FormioAuthRegisterComponent,
282
+ FormioResetPassComponent
283
+ ]
284
+ }]
285
+ }] });
286
+
287
+ /*
288
+ * Public API Surface of angular-formio
289
+ */
290
+
291
+ /**
292
+ * Generated bundle index. Do not edit.
293
+ */
294
+
295
+ export { FormioAuth, FormioAuthComponent, FormioAuthConfig, FormioAuthLoginComponent, FormioAuthRegisterComponent, FormioAuthRoutes, FormioAuthService, FormioResetPassComponent };
296
+ //# sourceMappingURL=formio-angular-auth.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formio-angular-auth.mjs","sources":["../../../projects/angular-formio/auth/src/auth.config.ts","../../../projects/angular-formio/auth/src/auth.service.ts","../../../projects/angular-formio/auth/src/auth.component.ts","../../../projects/angular-formio/auth/src/auth.component.html","../../../projects/angular-formio/auth/src/login/login.component.ts","../../../projects/angular-formio/auth/src/login/login.component.html","../../../projects/angular-formio/auth/src/register/register.component.ts","../../../projects/angular-formio/auth/src/register/register.component.html","../../../projects/angular-formio/auth/src/resetpass/resetpass.component.ts","../../../projects/angular-formio/auth/src/resetpass/resetpass.component.html","../../../projects/angular-formio/auth/src/auth.routes.ts","../../../projects/angular-formio/auth/src/auth.module.ts","../../../projects/angular-formio/auth/src/public_api.ts","../../../projects/angular-formio/auth/src/formio-angular-auth.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nexport interface FormioAuthFormConfig {\n path?: string;\n form?: string;\n component?: any;\n}\n\nexport interface FormioAuthRouteConfig {\n auth?: any;\n login?: any;\n register?: any;\n resetpass?: any;\n}\n\n@Injectable()\nexport class FormioAuthConfig {\n component?: any;\n delayAuth?: any;\n login?: FormioAuthFormConfig;\n register?: FormioAuthFormConfig;\n resetpass?: FormioAuthFormConfig;\n oauth?: FormioOAuthConfig;\n}\n\n\nexport interface FormioOAuthConfig {\n type: FormioOauthType;\n options: FormioOktaConfig | FormioSamlConfig;\n}\n\nexport enum FormioOauthType {\n okta = 'okta',\n saml = 'saml',\n}\n\nexport interface FormioOktaConfig extends OktaConfig {\n formio?: any;\n}\n\nexport interface FormioSamlConfig {\n relay: string;\n}\n\n// for more details about Okta configuration options see https://github.com/okta/okta-auth-js#configuration-reference\nexport interface OktaConfig {\n url?: string;\n tokenManager?: OktaTokenManagerConfig;\n issuer?: string;\n clientId?: string;\n redirectUri?: string;\n postLogoutRedirectUri?: string;\n pkce?: boolean;\n authorizeUrl?: string;\n userinfoUrl?: string;\n tokenUrl?: string;\n ignoreSignature?: boolean;\n maxClockSkew?: number;\n scopes?: string[];\n httpRequestClient?: Function;\n}\n\nexport interface OktaTokenManagerConfig {\n storage?: string | {\n getItem?: Function;\n setItem?: Function;\n };\n secure?: boolean;\n autoRenew?: boolean;\n expireEarlySeconds?: number;\n storageKey?: string;\n}\n","import { EventEmitter, Injectable, Inject } from '@angular/core';\nimport { FormioAuthConfig } from './auth.config';\nimport { FormioAppConfig } from '@formio/angular';\nimport { get, each } from 'lodash';\nimport { Formio } from 'formiojs';\n\n@Injectable()\nexport class FormioAuthService {\n public user: any;\n public authenticated = false;\n\n public loginForm: string;\n public onLogin: EventEmitter<object>;\n public onLogout: EventEmitter<object>;\n\n public registerForm: string;\n public onRegister: EventEmitter<object>;\n public onUser: EventEmitter<object>;\n public onError: EventEmitter<any>;\n\n public resetPassForm: string;\n public onResetPass: EventEmitter<object>;\n\n public ready: Promise<boolean>;\n public readyResolve: any;\n public readyReject: any;\n\n public projectReady?: Promise<any>;\n public accessReady?: Promise<any>;\n public userReady?: Promise<any>;\n public formAccess: any = {};\n public submissionAccess: any = {};\n public roles: any;\n public is: any = {};\n\n constructor(\n public appConfig: FormioAppConfig,\n public config: FormioAuthConfig\n ) {\n this.user = null;\n\n if (this.appConfig && this.appConfig.appUrl) {\n Formio.setBaseUrl(this.appConfig.apiUrl);\n Formio.setProjectUrl(this.appConfig.appUrl);\n Formio.formOnly = !!this.appConfig.formOnly;\n } else {\n console.error('You must provide an AppConfig within your application!');\n }\n\n this.loginForm =\n this.appConfig.appUrl +\n '/' +\n get(this.config, 'login.form', 'user/login');\n this.registerForm =\n this.appConfig.appUrl +\n '/' +\n get(this.config, 'register.form', 'user/register');\n this.resetPassForm =\n this.appConfig.appUrl +\n '/' +\n get(this.config, 'register.form', 'resetpass');\n this.onLogin = new EventEmitter();\n this.onLogout = new EventEmitter();\n this.onRegister = new EventEmitter();\n this.onUser = new EventEmitter();\n this.onError = new EventEmitter();\n\n this.ready = new Promise((resolve: any, reject: any) => {\n this.readyResolve = resolve;\n this.readyReject = reject;\n });\n\n // Register for the core events.\n Formio.events.on('formio.badToken', () => this.logoutError());\n Formio.events.on('formio.sessionExpired', () => this.logoutError());\n if (!this.config.delayAuth) {\n this.init();\n }\n }\n\n onLoginSubmit(submission: object) {\n this.setUser(submission);\n this.onLogin.emit(submission);\n }\n\n onRegisterSubmit(submission: object) {\n this.setUser(submission);\n this.onRegister.emit(submission);\n }\n\n onResetPassSubmit(submission: object) {\n this.onResetPass.emit(submission);\n }\n\n init() {\n this.projectReady = Formio.makeStaticRequest(this.appConfig.appUrl).then(\n (project: any) => {\n each(project.access, (access: any) => {\n this.formAccess[access.type] = access.roles;\n });\n },\n (): any => {\n this.formAccess = {};\n return null;\n }\n );\n\n // Get the access for this project.\n this.accessReady = Formio.makeStaticRequest(\n this.appConfig.appUrl + '/access'\n ).then(\n (access: any) => {\n each(access.forms, (form: any) => {\n this.submissionAccess[form.name] = {};\n form.submissionAccess.forEach((subAccess: any) => {\n this.submissionAccess[form.name][subAccess.type] = subAccess.roles;\n });\n });\n this.roles = access.roles;\n return access;\n },\n (): any => {\n this.roles = {};\n return null;\n }\n );\n\n let currentUserPromise: Promise<any>;\n if (this.config.oauth) {\n // Make a fix to the hash to remove starting \"/\" that angular might put there.\n if (window.location.hash && window.location.hash.match(/^#\\/access_token/)) {\n history.pushState(null, null, window.location.hash.replace(/^#\\/access_token/, '#access_token'));\n }\n\n // Initiate the SSO if they provide oauth settings.\n currentUserPromise = Formio.ssoInit(this.config.oauth.type, this.config.oauth.options);\n } else {\n currentUserPromise = Formio.currentUser();\n }\n\n this.userReady = currentUserPromise.then((user: any) => {\n this.setUser(user);\n return user;\n });\n\n // Trigger we are redy when all promises have resolved.\n if (this.accessReady) {\n this.accessReady\n .then(() => this.projectReady)\n .then(() => this.userReady)\n .then(() => this.readyResolve(true))\n .catch((err: any) => this.readyReject(err));\n }\n }\n\n setUser(user: any) {\n const namespace = Formio.namespace || 'formio';\n if (user) {\n this.user = user;\n localStorage.setItem(`${namespace}AppUser`, JSON.stringify(user));\n this.setUserRoles();\n } else {\n this.user = null;\n this.is = {};\n localStorage.removeItem(`${namespace}AppUser`);\n Formio.clearCache();\n Formio.setUser(null);\n }\n\n this.authenticated = !!Formio.getToken();\n this.onUser.emit(this.user);\n }\n\n setUserRoles() {\n if (this.accessReady) {\n this.accessReady.then(() => {\n each(this.roles, (role: any, roleName: string) => {\n if (this.user.roles.indexOf(role._id) !== -1) {\n this.is[roleName] = true;\n }\n });\n });\n }\n }\n\n logoutError() {\n this.setUser(null);\n const namespace = Formio.namespace || 'formio';\n localStorage.removeItem(`${namespace}Token`);\n this.onError.emit();\n }\n\n logout() {\n this.setUser(null);\n const namespace = Formio.namespace || 'formio';\n localStorage.removeItem(`${namespace}Token`);\n Formio.logout()\n .then(() => this.onLogout.emit())\n .catch(() => this.logoutError());\n }\n}\n","import { Component } from '@angular/core';\n@Component({\n templateUrl: './auth.component.html'\n})\nexport class FormioAuthComponent {}\n","<div class=\"card card-primary panel panel-default\">\n <div class=\"card-header panel-heading\">\n <ul class=\"nav nav-tabs card-header-tabs\">\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"login\" routerLinkActive=\"active\">Login</a></li>\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"register\" routerLinkActive=\"active\">Register</a></li>\n <li class=\"nav-item\" role=\"presentation\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"resetpass\" routerLinkActive=\"active\">Reset Password</a></li>\n </ul>\n </div>\n <div class=\"card-body panel-body\">\n <router-outlet></router-outlet>\n </div>\n</div>\n","import { Component } from '@angular/core';\nimport { FormioAuthService } from '../auth.service';\n@Component({\n templateUrl: './login.component.html'\n})\nexport class FormioAuthLoginComponent {\n constructor(public service: FormioAuthService) {}\n}\n","<formio [src]=\"service.loginForm\" (submit)=\"service.onLoginSubmit($event)\"></formio>\n","import { Component } from '@angular/core';\nimport { FormioAuthService } from '../auth.service';\n@Component({\n templateUrl: './register.component.html'\n})\nexport class FormioAuthRegisterComponent {\n constructor(public service: FormioAuthService) {}\n}\n","<formio [src]=\"service.registerForm\" (submit)=\"service.onRegisterSubmit($event)\"></formio>\n","import { Component } from '@angular/core';\nimport { FormioAuthService } from '../auth.service';\n@Component({\n templateUrl: './resetpass.component.html'\n})\nexport class FormioResetPassComponent {\n constructor(public service: FormioAuthService) {}\n}\n","<formio [src]=\"service.resetPassForm\" (submit)=\"service.onResetPassSubmit($event)\"></formio>\n","import { Routes } from '@angular/router';\nimport { FormioAuthRouteConfig } from './auth.config';\nimport { FormioAuthComponent } from './auth.component';\nimport { FormioAuthLoginComponent } from './login/login.component';\nimport { FormioAuthRegisterComponent } from './register/register.component';\nimport { FormioResetPassComponent } from './resetpass/resetpass.component';\n\nexport function FormioAuthRoutes(config?: FormioAuthRouteConfig): Routes {\n return [\n {\n path: '',\n component: config && config.auth ? config.auth : FormioAuthComponent,\n children: [\n {\n path: '',\n redirectTo: 'login',\n pathMatch: 'full'\n },\n {\n path: 'login',\n component: config && config.login ? config.login : FormioAuthLoginComponent\n },\n {\n path: 'register',\n component: config && config.register ? config.register : FormioAuthRegisterComponent\n },\n {\n path: 'resetpass',\n component: config && config.resetpass ? config.resetpass : FormioResetPassComponent\n }\n ]\n }\n ];\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { RouterModule } from '@angular/router';\nimport { FormioModule } from '@formio/angular';\nimport { FormioAuthComponent } from './auth.component';\nimport { FormioAuthLoginComponent } from './login/login.component';\nimport { FormioAuthRegisterComponent } from './register/register.component';\nimport { FormioResetPassComponent } from './resetpass/resetpass.component';\nimport { FormioAuthRouteConfig } from './auth.config';\nimport { FormioAuthRoutes } from './auth.routes';\nimport { extendRouter } from '@formio/angular';\n\n@NgModule({\n imports: [\n CommonModule,\n FormioModule,\n RouterModule\n ],\n declarations: [\n FormioAuthComponent,\n FormioAuthLoginComponent,\n FormioAuthRegisterComponent,\n FormioResetPassComponent\n ]\n})\nexport class FormioAuth {\n static forRoot(config?: FormioAuthRouteConfig): any {\n return extendRouter(FormioAuth, config, FormioAuthRoutes);\n }\n static forChild(config?: FormioAuthRouteConfig): any {\n return extendRouter(FormioAuth, config, FormioAuthRoutes);\n }\n}\n","/*\n * Public API Surface of angular-formio\n */\n\nexport * from './index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;MAgBa,gBAAgB;;6GAAhB,gB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