@coolon/angular-ui-powerups 0.0.126 → 0.0.129

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 (350) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +3745 -3019
  2. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  5. package/coolon-angular-ui-powerups.d.ts +17 -18
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/coolon-angular-ui-powerups.js +16 -17
  8. package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
  9. package/esm2015/coolon-angular-ui-powerups.metadata.json +1 -1
  10. package/esm2015/index.js +1 -1
  11. package/esm2015/index.js.map +1 -1
  12. package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  13. package/esm2015/lib/interaction/abstract-interaction-context.js +104 -0
  14. package/esm2015/lib/interaction/abstract-interaction-context.js.map +1 -0
  15. package/esm2015/lib/interaction/abstract-interaction-context.metadata.json +1 -0
  16. package/esm2015/lib/interaction/activity-ref.js +123 -0
  17. package/esm2015/lib/interaction/activity-ref.js.map +1 -0
  18. package/esm2015/lib/interaction/activity-ref.metadata.json +1 -0
  19. package/esm2015/lib/interaction/activity.js +21 -1
  20. package/esm2015/lib/interaction/activity.js.map +1 -1
  21. package/esm2015/lib/interaction/activity.metadata.json +1 -1
  22. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +199 -230
  23. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  24. package/esm2015/lib/interaction/components/activity-container/activity-container.component.metadata.json +1 -1
  25. package/esm2015/lib/interaction/components/{activity-outlet → activity-container/activity-outlet}/activity-outlet.component.js +24 -31
  26. package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -0
  27. package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.metadata.json +1 -0
  28. package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.ngfactory.js.map +1 -0
  29. package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.scss.shim.ngstyle.js.map +1 -0
  30. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +2 -3
  31. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js.map +1 -1
  32. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.metadata.json +1 -1
  33. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +4 -11
  34. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js.map +1 -1
  35. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.metadata.json +1 -1
  36. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +2 -3
  37. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js.map +1 -1
  38. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.metadata.json +1 -1
  39. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js +113 -0
  40. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -0
  41. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.metadata.json +1 -0
  42. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.ngfactory.js.map +1 -0
  43. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
  44. package/esm2015/lib/interaction/index.js +7 -6
  45. package/esm2015/lib/interaction/index.js.map +1 -1
  46. package/esm2015/lib/interaction/index.metadata.json +1 -1
  47. package/esm2015/lib/interaction/interaction-context.js +12 -67
  48. package/esm2015/lib/interaction/interaction-context.js.map +1 -1
  49. package/esm2015/lib/interaction/interaction-context.metadata.json +1 -1
  50. package/esm2015/lib/interaction/interaction.module.js +4 -4
  51. package/esm2015/lib/interaction/interaction.module.js.map +1 -1
  52. package/esm2015/lib/interaction/interaction.module.metadata.json +1 -1
  53. package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  54. package/esm2015/lib/interaction/route-synchronisation-adapter.js +17 -0
  55. package/esm2015/lib/interaction/route-synchronisation-adapter.js.map +1 -0
  56. package/esm2015/lib/interaction/route-synchronisation-adapter.metadata.json +1 -0
  57. package/esm2015/lib/interaction/services/interaction-service-routing-adapter.js +72 -0
  58. package/esm2015/lib/interaction/services/interaction-service-routing-adapter.js.map +1 -0
  59. package/esm2015/lib/interaction/services/interaction-service-routing-adapter.metadata.json +1 -0
  60. package/esm2015/lib/interaction/services/interaction.service.js +174 -104
  61. package/esm2015/lib/interaction/services/interaction.service.js.map +1 -1
  62. package/esm2015/lib/interaction/services/interaction.service.metadata.json +1 -1
  63. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +4 -2
  64. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js.map +1 -1
  65. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.metadata.json +1 -1
  66. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +79 -87
  67. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js.map +1 -1
  68. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.metadata.json +1 -1
  69. package/esm2015/lib/interaction/services/modal-interaction-context.factory.js +3 -1
  70. package/esm2015/lib/interaction/services/modal-interaction-context.factory.js.map +1 -1
  71. package/esm2015/lib/place/components/abstract-place-navigation.component.js +27 -6
  72. package/esm2015/lib/place/components/abstract-place-navigation.component.js.map +1 -1
  73. package/esm2015/lib/place/components/abstract-place-navigation.component.metadata.json +1 -1
  74. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +9 -3
  75. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
  76. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.metadata.json +1 -1
  77. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +98 -110
  78. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  79. package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
  80. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +9 -3
  81. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
  82. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.metadata.json +1 -1
  83. package/esm2015/lib/place/guards/place.guard.js +14 -13
  84. package/esm2015/lib/place/guards/place.guard.js.map +1 -1
  85. package/esm2015/lib/place/guards/place.guard.metadata.json +1 -1
  86. package/esm2015/lib/place/index.js +15 -2
  87. package/esm2015/lib/place/index.js.map +1 -1
  88. package/esm2015/lib/place/index.metadata.json +1 -1
  89. package/esm2015/lib/place/{guards → navigation}/place-component-deactivation-handler.js +28 -22
  90. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -0
  91. package/esm2015/lib/place/navigation/place-component-deactivation-handler.metadata.json +1 -0
  92. package/esm2015/lib/place/navigation/session/abstract-pop-state-navigation.js +37 -0
  93. package/esm2015/lib/place/navigation/session/abstract-pop-state-navigation.js.map +1 -0
  94. package/esm2015/lib/place/navigation/session/abstract-pop-state-navigation.metadata.json +1 -0
  95. package/esm2015/lib/place/navigation/session/event-cleanup/event-clean-up-session.js +19 -0
  96. package/esm2015/lib/place/navigation/session/event-cleanup/event-clean-up-session.js.map +1 -0
  97. package/esm2015/lib/place/navigation/session/event-cleanup/event-clean-up-session.metadata.json +1 -0
  98. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js +95 -0
  99. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js.map +1 -0
  100. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.metadata.json +1 -0
  101. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js +132 -0
  102. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js.map +1 -0
  103. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.metadata.json +1 -0
  104. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js +123 -0
  105. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js.map +1 -0
  106. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.metadata.json +1 -0
  107. package/esm2015/lib/place/navigation/session/interactions/navigating-during-interaction.js +62 -0
  108. package/esm2015/lib/place/navigation/session/interactions/navigating-during-interaction.js.map +1 -0
  109. package/esm2015/lib/place/navigation/session/interactions/navigating-during-interaction.metadata.json +1 -0
  110. package/esm2015/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js +48 -0
  111. package/esm2015/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js.map +1 -0
  112. package/esm2015/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.metadata.json +1 -0
  113. package/esm2015/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js +104 -0
  114. package/esm2015/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js.map +1 -0
  115. package/esm2015/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.metadata.json +1 -0
  116. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js +141 -0
  117. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -0
  118. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.metadata.json +1 -0
  119. package/esm2015/lib/place/navigation/session/navigating.js +54 -0
  120. package/esm2015/lib/place/navigation/session/navigating.js.map +1 -0
  121. package/esm2015/lib/place/navigation/session/navigating.metadata.json +1 -0
  122. package/esm2015/lib/place/navigation/session/navigation-context.js +38 -0
  123. package/esm2015/lib/place/navigation/session/navigation-context.js.map +1 -0
  124. package/esm2015/lib/place/navigation/session/navigation-context.metadata.json +1 -0
  125. package/esm2015/lib/place/navigation/session/navigation-session.js +326 -0
  126. package/esm2015/lib/place/navigation/session/navigation-session.js.map +1 -0
  127. package/esm2015/lib/place/navigation/session/navigation-session.metadata.json +1 -0
  128. package/esm2015/lib/place/navigation/session/pop-state-navigation.js +31 -0
  129. package/esm2015/lib/place/navigation/session/pop-state-navigation.js.map +1 -0
  130. package/esm2015/lib/place/navigation/session/pop-state-navigation.metadata.json +1 -0
  131. package/esm2015/lib/place/place-component.js +46 -15
  132. package/esm2015/lib/place/place-component.js.map +1 -1
  133. package/esm2015/lib/place/place-component.metadata.json +1 -1
  134. package/esm2015/lib/place/place-router.js +307 -309
  135. package/esm2015/lib/place/place-router.js.map +1 -1
  136. package/esm2015/lib/place/place-router.metadata.json +1 -1
  137. package/esm2015/lib/place/place.module.js.map +1 -1
  138. package/esm2015/lib/place/place.module.metadata.json +1 -1
  139. package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
  140. package/esm2015/lib/place/route/parameter-decorators.js +1 -0
  141. package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
  142. package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
  143. package/esm2015/lib/place/url-service.js +126 -0
  144. package/esm2015/lib/place/url-service.js.map +1 -0
  145. package/esm2015/lib/place/url-service.metadata.json +1 -0
  146. package/esm2015/lib/place/url-service.ngfactory.js.map +1 -0
  147. package/esm2015/lib/place/url-snapshot.js +15 -1
  148. package/esm2015/lib/place/url-snapshot.js.map +1 -1
  149. package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
  150. package/esm2015/lib/place/visit.js +10 -0
  151. package/esm2015/lib/place/visit.js.map +1 -1
  152. package/esm2015/lib/place/visit.metadata.json +1 -1
  153. package/esm2015/public_api.js +2 -2
  154. package/esm2015/public_api.js.map +1 -1
  155. package/esm5/coolon-angular-ui-powerups.js +16 -17
  156. package/esm5/coolon-angular-ui-powerups.js.map +1 -1
  157. package/esm5/index.js +1 -1
  158. package/esm5/index.js.map +1 -1
  159. package/esm5/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  160. package/esm5/lib/interaction/abstract-interaction-context.js +146 -0
  161. package/esm5/lib/interaction/abstract-interaction-context.js.map +1 -0
  162. package/esm5/lib/interaction/activity-ref.js +153 -0
  163. package/esm5/lib/interaction/activity-ref.js.map +1 -0
  164. package/esm5/lib/interaction/activity.js +29 -1
  165. package/esm5/lib/interaction/activity.js.map +1 -1
  166. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +273 -265
  167. package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  168. package/esm5/lib/interaction/components/{activity-outlet → activity-container/activity-outlet}/activity-outlet.component.js +25 -32
  169. package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -0
  170. package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.ngfactory.js.map +1 -0
  171. package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.scss.shim.ngstyle.js.map +1 -0
  172. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +2 -3
  173. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js.map +1 -1
  174. package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +4 -10
  175. package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js.map +1 -1
  176. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +2 -3
  177. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js.map +1 -1
  178. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js +158 -0
  179. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -0
  180. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.ngfactory.js.map +1 -0
  181. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
  182. package/esm5/lib/interaction/index.js +7 -6
  183. package/esm5/lib/interaction/index.js.map +1 -1
  184. package/esm5/lib/interaction/interaction-context.js +12 -106
  185. package/esm5/lib/interaction/interaction-context.js.map +1 -1
  186. package/esm5/lib/interaction/interaction.module.js +4 -4
  187. package/esm5/lib/interaction/interaction.module.js.map +1 -1
  188. package/esm5/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  189. package/esm5/lib/interaction/route-synchronisation-adapter.js +17 -0
  190. package/esm5/lib/interaction/route-synchronisation-adapter.js.map +1 -0
  191. package/esm5/lib/interaction/services/interaction-service-routing-adapter.js +98 -0
  192. package/esm5/lib/interaction/services/interaction-service-routing-adapter.js.map +1 -0
  193. package/esm5/lib/interaction/services/interaction.service.js +243 -117
  194. package/esm5/lib/interaction/services/interaction.service.js.map +1 -1
  195. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +6 -2
  196. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js.map +1 -1
  197. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +96 -107
  198. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js.map +1 -1
  199. package/esm5/lib/interaction/services/modal-interaction-context.factory.js +3 -1
  200. package/esm5/lib/interaction/services/modal-interaction-context.factory.js.map +1 -1
  201. package/esm5/lib/place/components/abstract-place-navigation.component.js +24 -6
  202. package/esm5/lib/place/components/abstract-place-navigation.component.js.map +1 -1
  203. package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js +6 -3
  204. package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
  205. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +130 -129
  206. package/esm5/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  207. package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +6 -3
  208. package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
  209. package/esm5/lib/place/guards/place.guard.js +17 -13
  210. package/esm5/lib/place/guards/place.guard.js.map +1 -1
  211. package/esm5/lib/place/index.js +15 -2
  212. package/esm5/lib/place/index.js.map +1 -1
  213. package/esm5/lib/place/{guards → navigation}/place-component-deactivation-handler.js +45 -21
  214. package/esm5/lib/place/navigation/place-component-deactivation-handler.js.map +1 -0
  215. package/esm5/lib/place/navigation/session/abstract-pop-state-navigation.js +49 -0
  216. package/esm5/lib/place/navigation/session/abstract-pop-state-navigation.js.map +1 -0
  217. package/esm5/lib/place/navigation/session/event-cleanup/event-clean-up-session.js +36 -0
  218. package/esm5/lib/place/navigation/session/event-cleanup/event-clean-up-session.js.map +1 -0
  219. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js +151 -0
  220. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js.map +1 -0
  221. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js +221 -0
  222. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js.map +1 -0
  223. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js +186 -0
  224. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js.map +1 -0
  225. package/esm5/lib/place/navigation/session/interactions/navigating-during-interaction.js +107 -0
  226. package/esm5/lib/place/navigation/session/interactions/navigating-during-interaction.js.map +1 -0
  227. package/esm5/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js +77 -0
  228. package/esm5/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js.map +1 -0
  229. package/esm5/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js +167 -0
  230. package/esm5/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js.map +1 -0
  231. package/esm5/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js +185 -0
  232. package/esm5/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -0
  233. package/esm5/lib/place/navigation/session/navigating.js +75 -0
  234. package/esm5/lib/place/navigation/session/navigating.js.map +1 -0
  235. package/esm5/lib/place/navigation/session/navigation-context.js +32 -0
  236. package/esm5/lib/place/navigation/session/navigation-context.js.map +1 -0
  237. package/esm5/lib/place/navigation/session/navigation-session.js +450 -0
  238. package/esm5/lib/place/navigation/session/navigation-session.js.map +1 -0
  239. package/esm5/lib/place/navigation/session/pop-state-navigation.js +50 -0
  240. package/esm5/lib/place/navigation/session/pop-state-navigation.js.map +1 -0
  241. package/esm5/lib/place/place-component.js +61 -17
  242. package/esm5/lib/place/place-component.js.map +1 -1
  243. package/esm5/lib/place/place-router.js +407 -401
  244. package/esm5/lib/place/place-router.js.map +1 -1
  245. package/esm5/lib/place/place.module.js.map +1 -1
  246. package/esm5/lib/place/place.module.ngfactory.js.map +1 -1
  247. package/esm5/lib/place/route/parameter-decorators.js +1 -0
  248. package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
  249. package/esm5/lib/place/url-service.js +176 -0
  250. package/esm5/lib/place/url-service.js.map +1 -0
  251. package/esm5/lib/place/url-service.ngfactory.js.map +1 -0
  252. package/esm5/lib/place/url-snapshot.js +22 -1
  253. package/esm5/lib/place/url-snapshot.js.map +1 -1
  254. package/esm5/lib/place/visit.js +14 -0
  255. package/esm5/lib/place/visit.js.map +1 -1
  256. package/esm5/public_api.js +2 -2
  257. package/esm5/public_api.js.map +1 -1
  258. package/fesm2015/coolon-angular-ui-powerups.js +2637 -2266
  259. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  260. package/fesm5/coolon-angular-ui-powerups.js +3694 -2980
  261. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  262. package/lib/interaction/abstract-interaction-context.d.ts +24 -0
  263. package/lib/interaction/activity-ref.d.ts +19 -0
  264. package/lib/interaction/activity.d.ts +5 -1
  265. package/lib/interaction/components/activity-container/activity-container.component.d.ts +42 -43
  266. package/lib/interaction/components/{activity-outlet → activity-container/activity-outlet}/activity-outlet.component.d.ts +7 -10
  267. package/lib/interaction/components/alert-dialog/alert-dialog.component.d.ts +2 -2
  268. package/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.d.ts +2 -5
  269. package/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.d.ts +2 -2
  270. package/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.d.ts +24 -0
  271. package/lib/interaction/index.d.ts +6 -5
  272. package/lib/interaction/interaction-context.d.ts +8 -29
  273. package/lib/interaction/route-synchronisation-adapter.d.ts +5 -0
  274. package/lib/interaction/services/interaction-service-routing-adapter.d.ts +15 -0
  275. package/lib/interaction/services/interaction.service.d.ts +52 -24
  276. package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.d.ts +2 -1
  277. package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.d.ts +15 -12
  278. package/lib/interaction/services/modal-interaction-context.factory.d.ts +2 -1
  279. package/lib/place/components/abstract-place-navigation.component.d.ts +5 -3
  280. package/lib/place/components/list-place-nav/list-place-nav.component.d.ts +2 -1
  281. package/lib/place/components/place-outlet/place-outlet.component.d.ts +9 -10
  282. package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +2 -1
  283. package/lib/place/guards/place.guard.d.ts +4 -3
  284. package/lib/place/index.d.ts +15 -2
  285. package/lib/place/navigation/place-component-deactivation-handler.d.ts +22 -0
  286. package/lib/place/navigation/session/abstract-pop-state-navigation.d.ts +9 -0
  287. package/lib/place/navigation/session/event-cleanup/event-clean-up-session.d.ts +4 -0
  288. package/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.d.ts +27 -0
  289. package/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.d.ts +43 -0
  290. package/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.d.ts +33 -0
  291. package/lib/place/navigation/session/interactions/navigating-during-interaction.d.ts +15 -0
  292. package/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.d.ts +17 -0
  293. package/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.d.ts +24 -0
  294. package/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.d.ts +15 -0
  295. package/lib/place/navigation/session/navigating.d.ts +11 -0
  296. package/lib/place/navigation/session/navigation-context.d.ts +28 -0
  297. package/lib/place/navigation/session/navigation-session.d.ts +51 -0
  298. package/lib/place/navigation/session/pop-state-navigation.d.ts +7 -0
  299. package/lib/place/place-component.d.ts +6 -3
  300. package/lib/place/place-router.d.ts +39 -35
  301. package/lib/place/url-service.d.ts +30 -0
  302. package/lib/place/url-snapshot.d.ts +3 -1
  303. package/lib/place/visit.d.ts +1 -0
  304. package/package.json +1 -1
  305. package/schematics/place-routes/templates/place-routes.ts.template +4 -3
  306. package/esm2015/lib/interaction/abstract-activity.js +0 -13
  307. package/esm2015/lib/interaction/abstract-activity.js.map +0 -1
  308. package/esm2015/lib/interaction/abstract-activity.metadata.json +0 -1
  309. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -21
  310. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.js.map +0 -1
  311. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet-context.metadata.json +0 -1
  312. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.js.map +0 -1
  313. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.metadata.json +0 -1
  314. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.ngfactory.js.map +0 -1
  315. package/esm2015/lib/interaction/components/activity-outlet/activity-outlet.component.scss.shim.ngstyle.js.map +0 -1
  316. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +0 -102
  317. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js.map +0 -1
  318. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.metadata.json +0 -1
  319. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.ngfactory.js.map +0 -1
  320. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.scss.shim.ngstyle.js.map +0 -1
  321. package/esm2015/lib/interaction/interaction-context-base.js +0 -171
  322. package/esm2015/lib/interaction/interaction-context-base.js.map +0 -1
  323. package/esm2015/lib/interaction/interaction-context-base.metadata.json +0 -1
  324. package/esm2015/lib/place/guards/navigation-state.js +0 -1118
  325. package/esm2015/lib/place/guards/navigation-state.js.map +0 -1
  326. package/esm2015/lib/place/guards/navigation-state.metadata.json +0 -1
  327. package/esm2015/lib/place/guards/place-component-deactivation-handler.js.map +0 -1
  328. package/esm2015/lib/place/guards/place-component-deactivation-handler.metadata.json +0 -1
  329. package/esm5/lib/interaction/abstract-activity.js +0 -30
  330. package/esm5/lib/interaction/abstract-activity.js.map +0 -1
  331. package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js +0 -21
  332. package/esm5/lib/interaction/components/activity-outlet/activity-outlet-context.js.map +0 -1
  333. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.js.map +0 -1
  334. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.ngfactory.js.map +0 -1
  335. package/esm5/lib/interaction/components/activity-outlet/activity-outlet.component.scss.shim.ngstyle.js.map +0 -1
  336. package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +0 -119
  337. package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js.map +0 -1
  338. package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.ngfactory.js.map +0 -1
  339. package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.scss.shim.ngstyle.js.map +0 -1
  340. package/esm5/lib/interaction/interaction-context-base.js +0 -228
  341. package/esm5/lib/interaction/interaction-context-base.js.map +0 -1
  342. package/esm5/lib/place/guards/navigation-state.js +0 -1491
  343. package/esm5/lib/place/guards/navigation-state.js.map +0 -1
  344. package/esm5/lib/place/guards/place-component-deactivation-handler.js.map +0 -1
  345. package/lib/interaction/abstract-activity.d.ts +0 -6
  346. package/lib/interaction/components/activity-outlet/activity-outlet-context.d.ts +0 -7
  347. package/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.d.ts +0 -17
  348. package/lib/interaction/interaction-context-base.d.ts +0 -29
  349. package/lib/place/guards/navigation-state.d.ts +0 -228
  350. package/lib/place/guards/place-component-deactivation-handler.d.ts +0 -15
@@ -1,1118 +0,0 @@
1
- /**
2
- * @fileoverview added by tsickle
3
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
- */
5
- import * as tslib_1 from "tslib";
6
- import { Dsl, GarbageCollector, lang, Logger } from '@coolon/pectin';
7
- import { PlaceComponentDeactivationHandler } from './place-component-deactivation-handler';
8
- /**
9
- * @abstract
10
- */
11
- export class NavigationState extends GarbageCollector {
12
- /**
13
- * @param {?} context
14
- */
15
- constructor(context) {
16
- super();
17
- this.context = context;
18
- this._visits = new Map();
19
- this.debugPropertyKeys = [];
20
- }
21
- /**
22
- * @return {?}
23
- */
24
- get name() {
25
- return this.constructor.name;
26
- }
27
- /**
28
- * @return {?}
29
- */
30
- get idle() {
31
- return !this.isTransitional;
32
- }
33
- /**
34
- * @return {?}
35
- */
36
- get placeRouter() {
37
- return this.context.placeRouter;
38
- }
39
- /**
40
- * @return {?}
41
- */
42
- get interactionService() {
43
- return this.context.interactionService;
44
- }
45
- /**
46
- * @return {?}
47
- */
48
- get interactionContext() {
49
- return null;
50
- }
51
- /**
52
- * @param {?} visit
53
- * @return {?}
54
- */
55
- storeVisit(visit) {
56
- this._visits.set(visit.placeDefinition, visit);
57
- }
58
- /**
59
- * @param {?} placeDef
60
- * @return {?}
61
- */
62
- getVisitFor(placeDef) {
63
- return this._visits.get(placeDef);
64
- }
65
- /**
66
- * @param {?} visit
67
- * @param {?} initialUrl
68
- * @return {?}
69
- */
70
- onPlaceNavigationStart(visit, initialUrl) {
71
- return this.illegalTransition('onPlaceNavigationStart');
72
- }
73
- /**
74
- * @param {?} event
75
- * @return {?}
76
- */
77
- onPopState(event) {
78
- return this.illegalTransition(event);
79
- }
80
- /**
81
- * @param {?} event
82
- * @return {?}
83
- */
84
- onRouterStarted(event) {
85
- return this.illegalTransition(event);
86
- }
87
- /**
88
- * @param {?} event
89
- * @return {?}
90
- */
91
- onRouterCancelled(event) {
92
- return this.illegalTransition(event);
93
- }
94
- /**
95
- * @param {?} event
96
- * @return {?}
97
- */
98
- onRouterError(event) {
99
- return this.illegalTransition(event);
100
- }
101
- /**
102
- * @param {?} event
103
- * @return {?}
104
- */
105
- onRouterEnd(event) {
106
- return this.illegalTransition(event);
107
- }
108
- /**
109
- * @param {?} newUrl
110
- * @return {?}
111
- */
112
- onBackClickedDuringNavigationInteraction(newUrl) {
113
- return this.illegalTransition('onBackClickedDuringNavigationInteraction');
114
- }
115
- /**
116
- * @param {?} component
117
- * @param {?} currentUrl
118
- * @param {?} nextUrl
119
- * @return {?}
120
- */
121
- canDeactivatePlace(component, currentUrl, nextUrl) {
122
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
123
- return this.illegalTransition('canDeactivatePlace');
124
- });
125
- }
126
- /**
127
- * @return {?}
128
- */
129
- getVisits() {
130
- return Array.from(this._visits.values());
131
- }
132
- /**
133
- * @protected
134
- * @template R
135
- * @param {?} message
136
- * @return {?}
137
- */
138
- illegalTransition(message) {
139
- return lang.illegalState(`${message.toString()} not supported by ${this.toString()}`);
140
- }
141
- /**
142
- * @protected
143
- * @return {?}
144
- */
145
- currentRouterUrl() {
146
- return this.placeRouter.getCurrentRouterUrl();
147
- }
148
- /**
149
- * @protected
150
- * @param {?} event
151
- * @return {?}
152
- */
153
- createTransitionStateFor(event) {
154
- /** @type {?} */
155
- const popstate = event.navigationTrigger === 'popstate';
156
- /** @type {?} */
157
- const inInteraction = this.interactionService.isActive();
158
- if (popstate) {
159
- return inInteraction ?
160
- new NavigationState.LeavingInteractionAfterPopStateTransition(this.context, this.currentRouterUrl(), event.url) :
161
- new NavigationState.PopStateTransition(this.context, this.currentRouterUrl(), event.url);
162
- }
163
- else {
164
- return inInteraction ?
165
- new NavigationState.StartingInteractionTransition(this.context, this.currentRouterUrl()) :
166
- new NavigationState.NavigationTransition(this.context, this.currentRouterUrl());
167
- }
168
- }
169
- /**
170
- * @protected
171
- * @return {?}
172
- */
173
- createIdleState() {
174
- return this.interactionService.isActive() ?
175
- new NavigationState.IdleDuringInteraction(this.context, this.currentRouterUrl()) :
176
- new NavigationState.Idle(this.context);
177
- }
178
- /**
179
- * @param {?} url
180
- * @param {?=} options
181
- * @return {?}
182
- */
183
- resetBrowserLocation(url, options = { replaceCurrent: false }) {
184
- this.placeRouter.resetBrowserLocation(url, options);
185
- }
186
- /**
187
- * @param {?} event
188
- * @param {?=} reason
189
- * @return {?}
190
- */
191
- ignore(event, reason) {
192
- reason = reason ? ` -> ${reason}` : '';
193
- Logger.get(this).info(`Ignoring router event${reason}: ${event.constructor.name} -> ${event.url} :: ${this.toString()}`);
194
- return this;
195
- }
196
- /**
197
- * @return {?}
198
- */
199
- toString() {
200
- return `${this.constructor.name}(${this.debugState()})`;
201
- }
202
- /**
203
- * @protected
204
- * @param {?=} properties
205
- * @return {?}
206
- */
207
- debugState(properties) {
208
- return (properties || this.debugPropertyKeys).map((/**
209
- * @param {?} p
210
- * @return {?}
211
- */
212
- p => {
213
- return `${p}: ${this[p]}`;
214
- })).join(', ');
215
- }
216
- /**
217
- * @protected
218
- * @param {?} url
219
- * @return {?}
220
- */
221
- replaceBuggeredUrlAfterAngularRouterCancelled(url) {
222
- // Angular calls _this.resetUrlToCurrentUrlTree() on cancelling and fucks our history.
223
- // So this means that the top of the stack is the url we want to go back to, and not the one that was on
224
- // it before the cancel event fired.
225
- // So we need to:
226
- // - replace the just inserted url with the one that used to be there.
227
- // - push our actual url back onto the top of the stack.
228
- this.resetBrowserLocation(url, { replaceCurrent: true });
229
- }
230
- }
231
- if (false) {
232
- /**
233
- * @type {?}
234
- * @private
235
- */
236
- NavigationState.prototype._visits;
237
- /** @type {?} */
238
- NavigationState.prototype.isTransitional;
239
- /** @type {?} */
240
- NavigationState.prototype.startingUrl;
241
- /** @type {?} */
242
- NavigationState.prototype.isPopState;
243
- /** @type {?} */
244
- NavigationState.prototype.debugPropertyKeys;
245
- /**
246
- * @type {?}
247
- * @protected
248
- */
249
- NavigationState.prototype.context;
250
- }
251
- (function (NavigationState) {
252
- class Context {
253
- /**
254
- * @param {?} placeRouter
255
- * @param {?} interactionService
256
- * @param {?} notifySuccess
257
- */
258
- constructor(placeRouter, interactionService, notifySuccess) {
259
- this.placeRouter = placeRouter;
260
- this.interactionService = interactionService;
261
- this.notifySuccess = notifySuccess;
262
- }
263
- }
264
- NavigationState.Context = Context;
265
- if (false) {
266
- /** @type {?} */
267
- Context.prototype.placeRouter;
268
- /** @type {?} */
269
- Context.prototype.interactionService;
270
- /** @type {?} */
271
- Context.prototype.notifySuccess;
272
- }
273
- class Idle extends NavigationState {
274
- /**
275
- * @param {?} context
276
- */
277
- constructor(context) {
278
- super(context);
279
- this.isTransitional = false;
280
- this.startingUrl = null;
281
- this.isPopState = false;
282
- }
283
- /**
284
- * @param {?} visit
285
- * @param {?} initialUrl
286
- * @return {?}
287
- */
288
- onPlaceNavigationStart(visit, initialUrl) {
289
- /** @type {?} */
290
- const navigationTransition = new NavigationTransition(this.context, initialUrl);
291
- navigationTransition.storeVisit(visit);
292
- return navigationTransition;
293
- }
294
- /**
295
- * @param {?} event
296
- * @return {?}
297
- */
298
- onRouterStarted(event) {
299
- // calling angularLocation.go() to clear back state can trigger router cycles to the current url if we don't ignore them
300
- if (event.url === this.currentRouterUrl()) {
301
- Logger.get(this).info(`navigation started to same url -> ${event.url}`);
302
- return this;
303
- }
304
- if (this.placeRouter.hasActiveInteractionIds(event.url)) {
305
- Logger.get(this).info(`navigation started with interaction outlet -> ${event.url}`);
306
- return new StartingInteractionTransition(this.context, event.url);
307
- }
308
- else {
309
- return this.createTransitionStateFor(event);
310
- }
311
- }
312
- /**
313
- * @param {?} event
314
- * @return {?}
315
- */
316
- onPopState(event) {
317
- return this.createTransitionStateFor(event);
318
- }
319
- }
320
- NavigationState.Idle = Idle;
321
- if (false) {
322
- /** @type {?} */
323
- Idle.prototype.isTransitional;
324
- /** @type {?} */
325
- Idle.prototype.startingUrl;
326
- /** @type {?} */
327
- Idle.prototype.isPopState;
328
- }
329
- /**
330
- * @abstract
331
- */
332
- class AbstractNavigationTransition extends NavigationState {
333
- /**
334
- * @param {?} context
335
- * @param {?} startingUrl
336
- */
337
- constructor(context, startingUrl) {
338
- super(context);
339
- this.startingUrl = startingUrl;
340
- this.isTransitional = true;
341
- this.componentDeactivationHandlers = new Map();
342
- this._interactionContext = this.interactionService._createExclusiveModalInteractionContext();
343
- this.onDispose((/**
344
- * @return {?}
345
- */
346
- () => {
347
- // the interaction context can be detached during the back button cancellation state transition
348
- // as the transition is synchronous and activityCancellation isn't. Otherwise dispose will be
349
- // called before the context has been cancelled. It might be work having the interaction context
350
- // automatically cancel if the context is disposed so we don't have worry about detaching etc.
351
- if (this._interactionContext) {
352
- this._interactionContext.dispose(); // or do something like cancelAndDispose?
353
- }
354
- }));
355
- }
356
- /**
357
- * @return {?}
358
- */
359
- get interactionContext() {
360
- return this._interactionContext;
361
- }
362
- /**
363
- * @param {?} event
364
- * @return {?}
365
- */
366
- onRouterStarted(event) {
367
- // active sessions can have many cancel start cycles due
368
- // to place guard redirects
369
- return this;
370
- }
371
- /**
372
- * @param {?} event
373
- * @return {?}
374
- */
375
- onRouterEnd(event) {
376
- // navigation succeeded
377
- this.context.notifySuccess(this);
378
- return new Idle(this.context);
379
- }
380
- /**
381
- * @param {?} newUrl
382
- * @return {?}
383
- */
384
- onBackClickedDuringNavigationInteraction(newUrl) {
385
- Logger.get(this).info(`back button pressed during navigation session interaction promise`);
386
- // detach the interaction from the session so it doesn't get disposed until the activity has completed.
387
- /** @type {?} */
388
- const navigationInteraction = this.detachInteractionContext();
389
- const { when } = Dsl.disposeWith(navigationInteraction);
390
- // TODO: I need to make the exclusive interaction context disallow nested activities or
391
- // that would mess things up entirely. Or, can I do a context.abortAll().then(..)
392
- Logger.get(this).info('cancelling current navigation activity..');
393
- navigationInteraction.cancelActiveActivity().then((/**
394
- * @return {?}
395
- */
396
- () => {
397
- navigationInteraction.dispose();
398
- }));
399
- return this.createNavigationInteractionCancelledState(newUrl);
400
- }
401
- /**
402
- * @param {?} component
403
- * @param {?} currentUrl
404
- * @param {?} nextUrl
405
- * @return {?}
406
- */
407
- canDeactivatePlace(component, currentUrl, nextUrl) {
408
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
409
- // lookup the handler and create it if we've not seen it yet
410
- /** @type {?} */
411
- let handler = this.componentDeactivationHandlers.get(component);
412
- if (!handler) {
413
- /** @type {?} */
414
- const isPrimaryHandler = this.componentDeactivationHandlers.size === 0;
415
- handler = new PlaceComponentDeactivationHandler(component, this, isPrimaryHandler);
416
- this.componentDeactivationHandlers.set(component, handler);
417
- }
418
- return handler.canDeactivate(currentUrl, nextUrl);
419
- });
420
- }
421
- /**
422
- * @protected
423
- * @return {?}
424
- */
425
- detachInteractionContext() {
426
- /** @type {?} */
427
- const context = this._interactionContext;
428
- this._interactionContext = null;
429
- return context;
430
- }
431
- }
432
- NavigationState.AbstractNavigationTransition = AbstractNavigationTransition;
433
- if (false) {
434
- /** @type {?} */
435
- AbstractNavigationTransition.prototype.isTransitional;
436
- /**
437
- * @type {?}
438
- * @private
439
- */
440
- AbstractNavigationTransition.prototype.componentDeactivationHandlers;
441
- /**
442
- * @type {?}
443
- * @private
444
- */
445
- AbstractNavigationTransition.prototype._interactionContext;
446
- /** @type {?} */
447
- AbstractNavigationTransition.prototype.startingUrl;
448
- /**
449
- * @abstract
450
- * @param {?} newUrl
451
- * @return {?}
452
- */
453
- AbstractNavigationTransition.prototype.createNavigationInteractionCancelledState = function (newUrl) { };
454
- }
455
- class NavigationTransition extends AbstractNavigationTransition {
456
- constructor() {
457
- super(...arguments);
458
- this.isPopState = false;
459
- this.debugPropertyKeys = ['startingUrl'];
460
- }
461
- /**
462
- * @param {?} event
463
- * @return {?}
464
- */
465
- onRouterCancelled(event) {
466
- return this;
467
- }
468
- /**
469
- * @param {?} event
470
- * @return {?}
471
- */
472
- onRouterError(event) {
473
- // navigation was aborted.
474
- return new Idle(this.context);
475
- }
476
- /**
477
- * @param {?} newUrl
478
- * @return {?}
479
- */
480
- createNavigationInteractionCancelledState(newUrl) {
481
- return new LinkTriggeredNavigationInteractionCancelled(this.context, this.startingUrl, newUrl);
482
- }
483
- }
484
- NavigationState.NavigationTransition = NavigationTransition;
485
- if (false) {
486
- /** @type {?} */
487
- NavigationTransition.prototype.isPopState;
488
- /** @type {?} */
489
- NavigationTransition.prototype.debugPropertyKeys;
490
- }
491
- class PopStateTransition extends AbstractNavigationTransition {
492
- /**
493
- * @param {?} context
494
- * @param {?} startingUrl
495
- * @param {?} poppedHistoryUrl
496
- */
497
- constructor(context, startingUrl, poppedHistoryUrl) {
498
- super(context, startingUrl);
499
- this.poppedHistoryUrl = poppedHistoryUrl;
500
- this.isPopState = true;
501
- this.debugPropertyKeys = ['startingUrl', 'poppedHistoryUrl'];
502
- }
503
- /**
504
- * @param {?} event
505
- * @return {?}
506
- */
507
- onRouterCancelled(event) {
508
- this.replaceBuggeredUrlAfterAngularRouterCancelled(this.poppedHistoryUrl);
509
- // Angular doesn't preserve the url when a guard cancels the back button.
510
- // See https://github.com/angular/angular/issues/13586#issuecomment-432795720
511
- Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');
512
- this.resetBrowserLocation(this.startingUrl);
513
- return new Idle(this.context);
514
- }
515
- /**
516
- * @param {?} event
517
- * @return {?}
518
- */
519
- onRouterError(event) {
520
- // // navigation was aborted.
521
- // if (this.currentRouterUrl() !== this.startingUrl) {
522
- // // Angular doesn't preserve the url when a guard cancels the back button.
523
- // // See https://github.com/angular/angular/issues/13586#issuecomment-432795720
524
- // Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');
525
- // this.restoreHistory([
526
- // this.poppedHistoryUrl,
527
- // this.startingUrl
528
- // ]);
529
- // }
530
- // return new Idle(this.context);
531
- return this.illegalTransition("when do I get this???");
532
- }
533
- /**
534
- * @param {?} locationTriggerUrl
535
- * @return {?}
536
- */
537
- createNavigationInteractionCancelledState(locationTriggerUrl) {
538
- return new PopStateTriggeredNavigationInteractionCancelled(this.context, this.startingUrl, locationTriggerUrl, this.poppedHistoryUrl);
539
- }
540
- }
541
- NavigationState.PopStateTransition = PopStateTransition;
542
- if (false) {
543
- /** @type {?} */
544
- PopStateTransition.prototype.isPopState;
545
- /** @type {?} */
546
- PopStateTransition.prototype.debugPropertyKeys;
547
- /** @type {?} */
548
- PopStateTransition.prototype.poppedHistoryUrl;
549
- }
550
- /**
551
- * @abstract
552
- */
553
- class AbstractInteractionTransition extends AbstractNavigationTransition {
554
- /**
555
- * @param {?} context
556
- * @param {?} startingUrl
557
- */
558
- constructor(context, startingUrl) {
559
- super(context, startingUrl);
560
- this.startingUrl = startingUrl;
561
- this.isTransitional = true;
562
- }
563
- }
564
- NavigationState.AbstractInteractionTransition = AbstractInteractionTransition;
565
- if (false) {
566
- /** @type {?} */
567
- AbstractInteractionTransition.prototype.isTransitional;
568
- /** @type {?} */
569
- AbstractInteractionTransition.prototype.startingUrl;
570
- }
571
- // The following states exist to handle all events while any kind of navigation is in progress. That way all other states can
572
- // happily ignore interaction contexts.
573
- /**
574
- * This is the non transitional (i.e. rest) state that is used whenever an interaction context is active.
575
- */
576
- class IdleDuringInteraction extends NavigationState {
577
- /**
578
- * @param {?} context
579
- * @param {?} startingUrl
580
- */
581
- constructor(context, startingUrl) {
582
- super(context);
583
- this.startingUrl = startingUrl;
584
- this.isTransitional = false;
585
- this.isPopState = false;
586
- this.debugPropertyKeys = ['startingUrl'];
587
- }
588
- /**
589
- * @param {?} visit
590
- * @param {?} initialUrl
591
- * @return {?}
592
- */
593
- onPlaceNavigationStart(visit, initialUrl) {
594
- // we're in an interaction and the user clicked back
595
- /** @type {?} */
596
- const navigationTransition = new StartingInteractionTransition(this.context, initialUrl);
597
- navigationTransition.storeVisit(visit);
598
- return navigationTransition;
599
- }
600
- /**
601
- * @param {?} event
602
- * @return {?}
603
- */
604
- onRouterStarted(event) {
605
- return new StartingInteractionTransition(this.context, event.url);
606
- }
607
- /**
608
- * @param {?} event
609
- * @return {?}
610
- */
611
- onPopState(event) {
612
- // we're in an interaction and the user clicked back
613
- return new LeavingInteractionAfterPopStateTransition(this.context, event.url, event.url);
614
- }
615
- }
616
- NavigationState.IdleDuringInteraction = IdleDuringInteraction;
617
- if (false) {
618
- /** @type {?} */
619
- IdleDuringInteraction.prototype.isTransitional;
620
- /** @type {?} */
621
- IdleDuringInteraction.prototype.isPopState;
622
- /** @type {?} */
623
- IdleDuringInteraction.prototype.debugPropertyKeys;
624
- /** @type {?} */
625
- IdleDuringInteraction.prototype.startingUrl;
626
- }
627
- /**
628
- * This state exists to handle all events while any kind of navigation is in progress. That way all other states can
629
- * happily ignore interaction contexts.
630
- * NOTE: This state is activated when ever an interaction is started. It might be better to split it into
631
- * different states for different scenarios, e.g. starting model, starting model during route guard etc.
632
- */
633
- class StartingInteractionTransition extends AbstractInteractionTransition {
634
- constructor() {
635
- super(...arguments);
636
- this.isPopState = false;
637
- }
638
- /**
639
- * @param {?} event
640
- * @return {?}
641
- */
642
- onRouterCancelled(event) {
643
- // TODO: this.replaceBuggeredUrlAfterAngularRouterCancells(...);???
644
- if (this.context.interactionService.isActive()) {
645
- /** @type {?} */
646
- const interactionIds = this.interactionService.activeInteractionContextIds.value;
647
- this.resetBrowserLocation(this.placeRouter.parseUrl(this.startingUrl).updateInteractionIds(interactionIds).url);
648
- return new IdleDuringInteraction(this.context, this.startingUrl);
649
- }
650
- else {
651
- return new Idle(this.context);
652
- }
653
- }
654
- /**
655
- * @param {?} event
656
- * @return {?}
657
- */
658
- onRouterError(event) {
659
- // navigation was aborted.
660
- return new IdleDuringInteraction(this.context, this.startingUrl);
661
- }
662
- /**
663
- * @param {?} event
664
- * @return {?}
665
- */
666
- onRouterEnd(event) {
667
- if (this.context.interactionService.isActive()) {
668
- return new IdleDuringInteraction(this.context, this.startingUrl);
669
- }
670
- else {
671
- return new Idle(this.context);
672
- }
673
- }
674
- /**
675
- * @param {?} locationTriggerUrl
676
- * @return {?}
677
- */
678
- createNavigationInteractionCancelledState(locationTriggerUrl) {
679
- return new LeavingInteractionTransitionCancelled(this.context, this.startingUrl, locationTriggerUrl);
680
- }
681
- }
682
- NavigationState.StartingInteractionTransition = StartingInteractionTransition;
683
- if (false) {
684
- /** @type {?} */
685
- StartingInteractionTransition.prototype.isPopState;
686
- }
687
- /**
688
- * The sequence of router events are:
689
- * Error -> url = url of navigation link
690
- * End
691
- * onPopState url = current intereaction url sans the query params
692
- * Cancel url == same as above.
693
- */
694
- class LeavingInteractionTransitionCancelled extends NavigationState {
695
- /**
696
- * @param {?} context
697
- * @param {?} startingUrl
698
- * @param {?} locationChangeTriggerUrl
699
- */
700
- constructor(context, startingUrl, locationChangeTriggerUrl) {
701
- super(context);
702
- this.startingUrl = startingUrl;
703
- this.locationChangeTriggerUrl = locationChangeTriggerUrl;
704
- this.isPopState = false;
705
- this.firstCancelHandled = false;
706
- this.popStateHandled = false;
707
- this.debugPropertyKeys = ['idle', 'startingUrl', 'poppedHistoryUrl', 'locationChangeTriggerUrl', 'popStateEventUrl', 'firstCancelHandled', 'popStateHandled'];
708
- }
709
- /**
710
- * @return {?}
711
- */
712
- get isTransitional() {
713
- return true;
714
- }
715
- /**
716
- * @param {?} event
717
- * @return {?}
718
- */
719
- onRouterStarted(event) {
720
- return this.ignore(event);
721
- }
722
- /**
723
- * @param {?} event
724
- * @return {?}
725
- */
726
- onRouterCancelled(event) {
727
- // Angular doesn't preserve the url when a guard cancels the back button.
728
- // See https://github.com/angular/angular/issues/13586#issuecomment-432795720
729
- Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');
730
- if (this.interactionService.isActive()) {
731
- /** @type {?} */
732
- const interactionIds = this.interactionService.activeInteractionContextIds.value;
733
- this.resetBrowserLocation(this.placeRouter.parseUrl(this.startingUrl).updateInteractionIds(interactionIds).url);
734
- }
735
- else {
736
- // this.replaceBuggeredUrlAfterAngularRouterCancells(this.start)
737
- this.resetBrowserLocation(this.startingUrl); // and now put our own url back in.
738
- }
739
- return this.createIdleState();
740
- }
741
- /**
742
- * @param {?} event
743
- * @return {?}
744
- */
745
- onRouterEnd(event) {
746
- return this.ignore(event);
747
- }
748
- /**
749
- * @param {?} event
750
- * @return {?}
751
- */
752
- onRouterError(event) {
753
- return this.ignore(event);
754
- }
755
- /**
756
- * @param {?} event
757
- * @return {?}
758
- */
759
- onPopState(event) {
760
- return this.ignore(event);
761
- }
762
- /**
763
- * @param {?} component
764
- * @param {?} currentUrl
765
- * @param {?} nextUrl
766
- * @return {?}
767
- */
768
- canDeactivatePlace(component, currentUrl, nextUrl) {
769
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
770
- return false;
771
- });
772
- }
773
- }
774
- NavigationState.LeavingInteractionTransitionCancelled = LeavingInteractionTransitionCancelled;
775
- if (false) {
776
- /** @type {?} */
777
- LeavingInteractionTransitionCancelled.prototype.isPopState;
778
- /** @type {?} */
779
- LeavingInteractionTransitionCancelled.prototype.firstCancelHandled;
780
- /** @type {?} */
781
- LeavingInteractionTransitionCancelled.prototype.popStateHandled;
782
- /** @type {?} */
783
- LeavingInteractionTransitionCancelled.prototype.popStateEventUrl;
784
- /** @type {?} */
785
- LeavingInteractionTransitionCancelled.prototype.debugPropertyKeys;
786
- /** @type {?} */
787
- LeavingInteractionTransitionCancelled.prototype.startingUrl;
788
- /** @type {?} */
789
- LeavingInteractionTransitionCancelled.prototype.locationChangeTriggerUrl;
790
- }
791
- /**
792
- * This state exists to handle all events while any kind of navigation is in progress. That way all other states can
793
- * happily ignore interaction contexts.
794
- */
795
- class LeavingInteractionAfterPopStateTransition extends AbstractInteractionTransition {
796
- /**
797
- * @param {?} context
798
- * @param {?} startingUrl
799
- * @param {?} poppedHistoryUrl
800
- */
801
- constructor(context, startingUrl, poppedHistoryUrl) {
802
- super(context, startingUrl);
803
- this.poppedHistoryUrl = poppedHistoryUrl;
804
- this.isPopState = true;
805
- }
806
- /**
807
- * @param {?} event
808
- * @return {?}
809
- */
810
- onRouterCancelled(event) {
811
- // TODO: this.replaceBuggeredUrlAfterAngularRouterCancells(...);???
812
- if (this.interactionService.isActive()) {
813
- /** @type {?} */
814
- const interactionIds = this.interactionService.activeInteractionContextIds.value;
815
- this.resetBrowserLocation(this.placeRouter.parseUrl(this.startingUrl).updateInteractionIds(interactionIds).url);
816
- return new IdleDuringInteraction(this.context, this.startingUrl);
817
- }
818
- else {
819
- return new Idle(this.context);
820
- }
821
- }
822
- /**
823
- * @param {?} event
824
- * @return {?}
825
- */
826
- onRouterEnd(event) {
827
- if (this.context.interactionService.isActive()) {
828
- return new IdleDuringInteraction(this.context, this.startingUrl);
829
- }
830
- else {
831
- return new Idle(this.context);
832
- }
833
- }
834
- /**
835
- * @param {?} newUrl
836
- * @return {?}
837
- */
838
- createNavigationInteractionCancelledState(newUrl) {
839
- return this.illegalTransition('Leaving interaction after pop-state should\'t block so should never see a back button click');
840
- }
841
- }
842
- NavigationState.LeavingInteractionAfterPopStateTransition = LeavingInteractionAfterPopStateTransition;
843
- if (false) {
844
- /** @type {?} */
845
- LeavingInteractionAfterPopStateTransition.prototype.isPopState;
846
- /** @type {?} */
847
- LeavingInteractionAfterPopStateTransition.prototype.poppedHistoryUrl;
848
- }
849
- /**
850
- * This state handles the scenario where a link navigation triggered an interaction and the user clicked back a to cancel it.
851
- * The routing event sequence is different depending on the link that was clicked.
852
- *
853
- * If the link was the same as the previous history location (i.e. they've gone back via a link rather than clicking back) then the sequence is:
854
- *
855
- * -> Idle -> NavigationTransition
856
- * -> confirm dialog shown.
857
- * -> click back
858
- * -> NavigationCancel -> clickedLinkUrl === cancel.url
859
- * -> NavigationEnd
860
- *
861
- * Otherwise if the link is different from teh history location then the sequence is:
862
- *
863
- * -> Idle -> NavigationTransition
864
- * -> confirm dialog shown.
865
- * -> click back
866
- * -> NavigationCancel -> clickedLinkUrl !== cancel.url
867
- * -> NavigationEnd
868
- * -> PopState
869
- * -> NavigationCancel
870
- */
871
- class LinkTriggeredNavigationInteractionCancelled extends NavigationState {
872
- /**
873
- * @param {?} context
874
- * @param {?} startingUrl
875
- * @param {?} clickedLinkUrl
876
- */
877
- constructor(context, startingUrl, clickedLinkUrl) {
878
- super(context);
879
- this.startingUrl = startingUrl;
880
- this.clickedLinkUrl = clickedLinkUrl;
881
- this.isPopState = false;
882
- this.clickedLinkMatchedBackButtonUrl = false;
883
- this.debugPropertyKeys = ['idle', 'startingUrl', 'clickedLinkUrl', 'firstCancelEventUrl', 'clickedLinkMatchedBackButtonUrl', 'popStateEventUrl'];
884
- }
885
- /**
886
- * @return {?}
887
- */
888
- get isTransitional() {
889
- return true;
890
- }
891
- /**
892
- * @param {?} event
893
- * @return {?}
894
- */
895
- onRouterStarted(event) {
896
- return this.ignore(event);
897
- }
898
- /**
899
- * @param {?} event
900
- * @return {?}
901
- */
902
- onRouterCancelled(event) {
903
- // TODO: should really split this into two sub states in the first cancel event.
904
- if (!this.firstCancelEventUrl) {
905
- this.firstCancelEventUrl = event.url;
906
- this.clickedLinkMatchedBackButtonUrl = event.url === this.clickedLinkUrl;
907
- return this.ignore(event);
908
- }
909
- else {
910
- // we wait for our popped state to come in.
911
- if (!this.clickedLinkMatchedBackButtonUrl && this.popStateEventUrl) {
912
- return this.finaliseRouting();
913
- }
914
- }
915
- }
916
- /**
917
- * @param {?} event
918
- * @return {?}
919
- */
920
- onRouterEnd(event) {
921
- if (this.clickedLinkMatchedBackButtonUrl) {
922
- return this.finaliseRouting();
923
- }
924
- else {
925
- return this.ignore(event);
926
- }
927
- }
928
- /**
929
- * @param {?} event
930
- * @return {?}
931
- */
932
- onRouterError(event) {
933
- return this.ignore(event);
934
- }
935
- /**
936
- * @param {?} event
937
- * @return {?}
938
- */
939
- onPopState(event) {
940
- this.popStateEventUrl = event.url;
941
- return this.ignore(event);
942
- }
943
- /**
944
- * @return {?}
945
- */
946
- finaliseRouting() {
947
- Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');
948
- this.replaceBuggeredUrlAfterAngularRouterCancelled(this.clickedLinkUrl); // put the back click one back in.
949
- if (this.interactionService.isActive()) {
950
- /** @type {?} */
951
- const interactionIds = this.interactionService.activeInteractionContextIds.value;
952
- // Angular doesn't preserve the url when a guard cancels the back button.
953
- // See https://github.com/angular/angular/issues/13586#issuecomment-432795720
954
- this.resetBrowserLocation(this.placeRouter.parseUrl(this.startingUrl).updateInteractionIds(interactionIds).url);
955
- }
956
- else {
957
- this.resetBrowserLocation(this.startingUrl); // and now put our own url back in.
958
- }
959
- return this.createIdleState();
960
- }
961
- /**
962
- * @param {?} component
963
- * @param {?} currentUrl
964
- * @param {?} nextUrl
965
- * @return {?}
966
- */
967
- canDeactivatePlace(component, currentUrl, nextUrl) {
968
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
969
- return false;
970
- });
971
- }
972
- }
973
- NavigationState.LinkTriggeredNavigationInteractionCancelled = LinkTriggeredNavigationInteractionCancelled;
974
- if (false) {
975
- /** @type {?} */
976
- LinkTriggeredNavigationInteractionCancelled.prototype.isPopState;
977
- /** @type {?} */
978
- LinkTriggeredNavigationInteractionCancelled.prototype.firstCancelEventUrl;
979
- /** @type {?} */
980
- LinkTriggeredNavigationInteractionCancelled.prototype.popStateEventUrl;
981
- /** @type {?} */
982
- LinkTriggeredNavigationInteractionCancelled.prototype.clickedLinkMatchedBackButtonUrl;
983
- /** @type {?} */
984
- LinkTriggeredNavigationInteractionCancelled.prototype.debugPropertyKeys;
985
- /** @type {?} */
986
- LinkTriggeredNavigationInteractionCancelled.prototype.startingUrl;
987
- /** @type {?} */
988
- LinkTriggeredNavigationInteractionCancelled.prototype.clickedLinkUrl;
989
- }
990
- /**
991
- * This state handles the scenario where a pop state triggered and interaction and the user clickeb back a second time to cancel it.
992
- * The sequence of routing events/state transitions is as follows.
993
- * -> Idle -> PopStateTransition (poppedHistoryUrl == page to go to, startingUrl = page to stay on )
994
- * -> confirm dialog shown.
995
- * -> click back
996
- * -> PopStateTransition -> CancelledDuringBackButtonNavigationInteraction(trigger url is the page before the popped history url)
997
- * -> NavigationCancel (for the previous back)
998
- * -> PopState
999
- * -> NavigationCancel
1000
- */
1001
- class PopStateTriggeredNavigationInteractionCancelled extends NavigationState {
1002
- /**
1003
- * @param {?} context
1004
- * @param {?} startingUrl
1005
- * @param {?} locationChangeTriggerUrl
1006
- * @param {?} poppedHistoryUrl
1007
- */
1008
- constructor(context, startingUrl, locationChangeTriggerUrl, poppedHistoryUrl) {
1009
- super(context);
1010
- this.startingUrl = startingUrl;
1011
- this.locationChangeTriggerUrl = locationChangeTriggerUrl;
1012
- this.poppedHistoryUrl = poppedHistoryUrl;
1013
- this.isPopState = false;
1014
- this.firstCancelHandled = false;
1015
- this.popStateHandled = false;
1016
- this.debugPropertyKeys = ['idle', 'startingUrl', 'poppedHistoryUrl', 'locationChangeTriggerUrl', 'popStateEventUrl', 'firstCancelHandled', 'popStateHandled'];
1017
- }
1018
- /**
1019
- * @return {?}
1020
- */
1021
- get isTransitional() {
1022
- return true;
1023
- }
1024
- /**
1025
- * @param {?} event
1026
- * @return {?}
1027
- */
1028
- onRouterStarted(event) {
1029
- return this.ignore(event);
1030
- }
1031
- /**
1032
- * @param {?} event
1033
- * @return {?}
1034
- */
1035
- onRouterCancelled(event) {
1036
- if (this.firstCancelHandled && this.popStateHandled) {
1037
- // Angular doesn't preserve the url when a guard cancels the back button.
1038
- // See https://github.com/angular/angular/issues/13586#issuecomment-432795720
1039
- Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');
1040
- // Angular calls _this.resetUrlToCurrentUrlTree() on cancelling and fucks our history.
1041
- // So this means that the top of the stack is the url we want to go back to, and not the one that was on
1042
- // it before the cancel event fired.
1043
- // So we need to:
1044
- // - replace the just inserted url with the one that used to be there.
1045
- // - push our actual url back onto the top of the stack.
1046
- this.replaceBuggeredUrlAfterAngularRouterCancelled(this.locationChangeTriggerUrl);
1047
- this.resetBrowserLocation(this.poppedHistoryUrl); // put the first back click one back in.
1048
- if (this.interactionService.isActive()) {
1049
- /** @type {?} */
1050
- const interactionIds = this.interactionService.activeInteractionContextIds.value;
1051
- this.resetBrowserLocation(this.placeRouter.parseUrl(this.startingUrl).updateInteractionIds(interactionIds).url);
1052
- }
1053
- else {
1054
- this.resetBrowserLocation(this.startingUrl); // and now put our own url back in.
1055
- }
1056
- return this.createIdleState();
1057
- }
1058
- else {
1059
- this.firstCancelHandled = true;
1060
- return this.ignore(event);
1061
- }
1062
- }
1063
- /**
1064
- * @param {?} event
1065
- * @return {?}
1066
- */
1067
- onRouterEnd(event) {
1068
- return this.ignore(event);
1069
- }
1070
- /**
1071
- * @param {?} event
1072
- * @return {?}
1073
- */
1074
- onRouterError(event) {
1075
- return this.ignore(event);
1076
- }
1077
- /**
1078
- * @param {?} event
1079
- * @return {?}
1080
- */
1081
- onPopState(event) {
1082
- this.popStateHandled = true;
1083
- this.popStateEventUrl = event.url;
1084
- return this.ignore(event);
1085
- }
1086
- /**
1087
- * @param {?} component
1088
- * @param {?} currentUrl
1089
- * @param {?} nextUrl
1090
- * @return {?}
1091
- */
1092
- canDeactivatePlace(component, currentUrl, nextUrl) {
1093
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
1094
- return false;
1095
- });
1096
- }
1097
- }
1098
- NavigationState.PopStateTriggeredNavigationInteractionCancelled = PopStateTriggeredNavigationInteractionCancelled;
1099
- if (false) {
1100
- /** @type {?} */
1101
- PopStateTriggeredNavigationInteractionCancelled.prototype.isPopState;
1102
- /** @type {?} */
1103
- PopStateTriggeredNavigationInteractionCancelled.prototype.firstCancelHandled;
1104
- /** @type {?} */
1105
- PopStateTriggeredNavigationInteractionCancelled.prototype.popStateHandled;
1106
- /** @type {?} */
1107
- PopStateTriggeredNavigationInteractionCancelled.prototype.popStateEventUrl;
1108
- /** @type {?} */
1109
- PopStateTriggeredNavigationInteractionCancelled.prototype.debugPropertyKeys;
1110
- /** @type {?} */
1111
- PopStateTriggeredNavigationInteractionCancelled.prototype.startingUrl;
1112
- /** @type {?} */
1113
- PopStateTriggeredNavigationInteractionCancelled.prototype.locationChangeTriggerUrl;
1114
- /** @type {?} */
1115
- PopStateTriggeredNavigationInteractionCancelled.prototype.poppedHistoryUrl;
1116
- }
1117
- })(NavigationState || (NavigationState = {}));
1118
- //# sourceMappingURL=navigation-state.js.map