@formio/angular 5.2.2 → 5.3.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +54 -10
  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,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.1.1", ngImport: i0, type: FormioAuthConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
14
+ FormioAuthConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FormioAuthConfig });
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", 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.1.1", 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.1.1", ngImport: i0, type: FormioAuthService });
173
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", 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.1.1", ngImport: i0, type: FormioAuthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
180
+ FormioAuthComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", 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.1.1", 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.1.1", ngImport: i0, type: FormioAuthLoginComponent, deps: [{ token: FormioAuthService }], target: i0.ɵɵFactoryTarget.Component });
192
+ FormioAuthLoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", 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.1.1", 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.1.1", ngImport: i0, type: FormioAuthRegisterComponent, deps: [{ token: FormioAuthService }], target: i0.ɵɵFactoryTarget.Component });
204
+ FormioAuthRegisterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", 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.1.1", 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.1.1", ngImport: i0, type: FormioResetPassComponent, deps: [{ token: FormioAuthService }], target: i0.ɵɵFactoryTarget.Component });
216
+ FormioResetPassComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", 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.1.1", 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.1.1", ngImport: i0, type: FormioAuth, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
259
+ FormioAuth.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", 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.1.1", ngImport: i0, type: FormioAuth, imports: [[
266
+ CommonModule,
267
+ FormioModule,
268
+ RouterModule
269
+ ]] });
270
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", 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,gBAAgB;iHAAhB,gBAAgB;2FAAhB,gBAAgB;kBAD5B,UAAU;;AAgBX,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe;;MCxBd,iBAAiB;IA4B5B,YACS,SAA0B,EAC1B,MAAwB;QADxB,cAAS,GAAT,SAAS,CAAiB;QAC1B,WAAM,GAAN,MAAM,CAAkB;QA5B1B,kBAAa,GAAG,KAAK,CAAC;QAqBtB,eAAU,GAAQ,EAAE,CAAC;QACrB,qBAAgB,GAAQ,EAAE,CAAC;QAE3B,OAAE,GAAQ,EAAE,CAAC;QAMlB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;YAC3C,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAA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