@coolon/angular-ui-powerups 0.0.126 → 0.0.128

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 +3753 -3020
  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 +314 -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 +414 -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 +2644 -2266
  259. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  260. package/fesm5/coolon-angular-ui-powerups.js +3703 -2982
  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
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @fileoverview added by tsickle
3
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
+ */
5
+ // WARNING: interface has both a type and a value, skipping emit
6
+ export var NavigationContext;
7
+ (function (NavigationContext) {
8
+ class Impl {
9
+ /**
10
+ * @param {?} urlService
11
+ * @param {?} routerInteractionAdapter
12
+ * @param {?} navigateByUrl
13
+ * @param {?} transitionTo
14
+ * @param {?} finishRoutingSession
15
+ */
16
+ constructor(urlService, routerInteractionAdapter, navigateByUrl, transitionTo, finishRoutingSession) {
17
+ this.urlService = urlService;
18
+ this.routerInteractionAdapter = routerInteractionAdapter;
19
+ this.navigateByUrl = navigateByUrl;
20
+ this.transitionTo = transitionTo;
21
+ this.finishRoutingSession = finishRoutingSession;
22
+ }
23
+ }
24
+ NavigationContext.Impl = Impl;
25
+ if (false) {
26
+ /** @type {?} */
27
+ Impl.prototype.urlService;
28
+ /** @type {?} */
29
+ Impl.prototype.routerInteractionAdapter;
30
+ /** @type {?} */
31
+ Impl.prototype.navigateByUrl;
32
+ /** @type {?} */
33
+ Impl.prototype.transitionTo;
34
+ /** @type {?} */
35
+ Impl.prototype.finishRoutingSession;
36
+ }
37
+ })(NavigationContext || (NavigationContext = {}));
38
+ //# sourceMappingURL=navigation-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-context.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/navigation/session/navigation-context.ts"],"names":[],"mappings":";;;;;AAiBA,MAAM,KAAW,iBAAiB,CAWjC;AAXD,WAAiB,iBAAiB;IAChC,MAAa,IAAI;;;;;;;;QACf,YAAqB,UAAsB,EACtB,wBAA0D,EAC1D,aAA8F,EAC9F,YAAmD,EACnD,oBAAgD;YAJhD,eAAU,GAAV,UAAU,CAAY;YACtB,6BAAwB,GAAxB,wBAAwB,CAAkC;YAC1D,kBAAa,GAAb,aAAa,CAAiF;YAC9F,iBAAY,GAAZ,YAAY,CAAuC;YACnD,yBAAoB,GAApB,oBAAoB,CAA4B;QACrE,CAAC;KAEF;IARY,sBAAI,OAQhB,CAAA;;;QAPa,0BAA+B;;QAC/B,wCAAmE;;QACnE,6BAAuG;;QACvG,4BAA4D;;QAC5D,oCAAyD;;AAKzE,CAAC,EAXgB,iBAAiB,KAAjB,iBAAiB,QAWjC","sourcesContent":["import { InteractionServiceRoutingAdapter } from '../../../interaction/services/interaction-service-routing-adapter';\nimport { UrlService } from '../../url-service';\nimport { UrlSnapshot } from '../../url-snapshot';\nimport { Visit } from '../../visit';\nimport { NavigationSession } from './navigation-session';\n\nexport interface NavigationContext {\n readonly urlService: UrlService,\n readonly routerInteractionAdapter: InteractionServiceRoutingAdapter;\n\n finishRoutingSession(visits?: Visit[]);\n\n transitionTo(newState: NavigationSession);\n\n navigateByUrl(urlSnapshot: UrlSnapshot, options: { replaceUrl: boolean }): Promise<boolean>;\n}\n\nexport namespace NavigationContext {\n export class Impl implements NavigationContext {\n constructor(readonly urlService: UrlService,\n readonly routerInteractionAdapter: InteractionServiceRoutingAdapter,\n readonly navigateByUrl: (urlSnapshot: UrlSnapshot, options: { replaceUrl: boolean })=> Promise<boolean>,\n readonly transitionTo: (newState: NavigationSession) => void,\n readonly finishRoutingSession: (visits?: Visit[]) => void) {\n }\n\n }\n\n}\n"]}
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"NavigationContext":{"__symbolic":"interface"}}}]
@@ -0,0 +1,326 @@
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 { GarbageCollector, lang, Logger } from '@coolon/pectin';
7
+ import { PlaceComponentDeactivationHandler } from '../place-component-deactivation-handler';
8
+ /**
9
+ * Transient states
10
+ * @abstract
11
+ */
12
+ export class NavigationSession extends GarbageCollector {
13
+ /**
14
+ * @param {?} context
15
+ * @param {?} startingUrl
16
+ */
17
+ constructor(context, startingUrl) {
18
+ super();
19
+ this.context = context;
20
+ this.startingUrl = startingUrl;
21
+ this.debugPropertyKeys = [];
22
+ this._visits = new Map();
23
+ this.componentDeactivationHandlers = new Map();
24
+ // TODO: can I get away without creating one every time?
25
+ this._interactionContext = this.context.routerInteractionAdapter.createExclusiveInteractionContext();
26
+ this.onDispose((/**
27
+ * @return {?}
28
+ */
29
+ () => {
30
+ // the interaction context can be detached during the back button cancellation state transition
31
+ // as the transition is synchronous and activityCancellation isn't. Otherwise dispose will be
32
+ // called before the context has been cancelled. It might be work having the interaction context
33
+ // automatically cancel if the context is disposed so we don't have worry about detaching etc.
34
+ if (this._interactionContext) {
35
+ this._interactionContext.dispose(); // or do something like cancelAndDispose?
36
+ }
37
+ }));
38
+ }
39
+ /**
40
+ * @return {?}
41
+ */
42
+ get name() {
43
+ return this.constructor.name;
44
+ }
45
+ /**
46
+ * @return {?}
47
+ */
48
+ get urlService() {
49
+ return this.context.urlService;
50
+ }
51
+ /**
52
+ * @return {?}
53
+ */
54
+ get interactionServiceAdapter() {
55
+ return this.context.routerInteractionAdapter;
56
+ }
57
+ /**
58
+ * @param {?} visit
59
+ * @return {?}
60
+ */
61
+ storeVisit(visit) {
62
+ // console.log(`Storing visit for ${visit.placeDefinition.component.name}`, {visit});
63
+ this._visits.set(visit.placeDefinition, visit);
64
+ }
65
+ /**
66
+ * @param {?} placeDef
67
+ * @return {?}
68
+ */
69
+ getVisitFor(placeDef) {
70
+ /** @type {?} */
71
+ const visit = this._visits.get(placeDef);
72
+ // console.log(`Getting visit for ${placeDef.component.name}`, {visit});
73
+ return visit;
74
+ }
75
+ /**
76
+ * @return {?}
77
+ */
78
+ get canDeactivateInteractionContext() {
79
+ return this._interactionContext;
80
+ }
81
+ /**
82
+ * @return {?}
83
+ */
84
+ notifyActive() {
85
+ // noop.
86
+ }
87
+ /**
88
+ * @param {?} event
89
+ * @return {?}
90
+ */
91
+ onRouterStarted(event) {
92
+ // navigation sessions can have many cancel start cycles due to place guard redirects
93
+ this.ignore(event);
94
+ }
95
+ // @Trace()
96
+ /**
97
+ * @param {?} url
98
+ * @return {?}
99
+ */
100
+ onUrlChange(url) {
101
+ // Normally we just ignore these but they are the only way of detecting if the back button
102
+ // was clicked during a canDeactivate promise.
103
+ // 1. a route is in progress and awaiting a canDeactivateGuard
104
+ // 2. the user the clicks the back button.
105
+ // So to handle that scenario we need to check if we've got a can deactivate interaction in
106
+ // progress and the do the appropriate clean up.
107
+ if (this.canDeactivateInteractionContext && this.canDeactivateInteractionContext.isActive()) {
108
+ this.cancelCanDeactivateInteraction(url);
109
+ }
110
+ }
111
+ /**
112
+ * @param {?} event
113
+ * @return {?}
114
+ */
115
+ onPopState(event) {
116
+ return this.illegalTransition(event);
117
+ }
118
+ /**
119
+ * @param {?} event
120
+ * @return {?}
121
+ */
122
+ onRouterCancelled(event) {
123
+ return this.illegalTransition(event);
124
+ }
125
+ /**
126
+ * @param {?} event
127
+ * @return {?}
128
+ */
129
+ onRouterError(event) {
130
+ return this.illegalTransition(event);
131
+ }
132
+ /**
133
+ * @param {?} event
134
+ * @return {?}
135
+ */
136
+ onRouterEnd(event) {
137
+ return this.illegalTransition(event);
138
+ }
139
+ /**
140
+ * @return {?}
141
+ */
142
+ getVisits() {
143
+ return Array.from(this._visits.values());
144
+ }
145
+ /**
146
+ * @protected
147
+ * @template R
148
+ * @param {?} message
149
+ * @return {?}
150
+ */
151
+ illegalTransition(message) {
152
+ return lang.illegalState(`${message.toString()} not supported by ${this.toString()}`);
153
+ }
154
+ /**
155
+ * @protected
156
+ * @return {?}
157
+ */
158
+ currentRouterUrl() {
159
+ return this.urlService.getCurrentRouterUrl();
160
+ }
161
+ /**
162
+ * @param {?} url
163
+ * @param {?=} options
164
+ * @return {?}
165
+ */
166
+ resetBrowserLocation(url, options = { replaceCurrent: false }) {
167
+ // console.log(`---> resetting browser location to: ${url}`);
168
+ this.urlService.resetBrowserLocation(url, options);
169
+ }
170
+ // @Trace()
171
+ /**
172
+ * @protected
173
+ * @param {?} poppedHistoryToReplace
174
+ * @param {?} activeUrl
175
+ * @return {?}
176
+ */
177
+ repairBrowserHistoryAndUrlAfterGuardCancellation(poppedHistoryToReplace, activeUrl) {
178
+ // Important: I tried to perform this fix at a later point int he routing cycle but it created all kinds of
179
+ // strangeness.
180
+ Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');
181
+ console.log(`replacing ${this.urlService.getCurrentLocationUrlSnapshot().url} with ${poppedHistoryToReplace}`);
182
+ this.urlService.resetBrowserLocation(poppedHistoryToReplace, { replaceCurrent: true });
183
+ console.log(`pushing ${activeUrl} back onto the history.`);
184
+ this.urlService.resetBrowserLocation(activeUrl, { replaceCurrent: false });
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
+ }
195
+ /**
196
+ * @return {?}
197
+ */
198
+ toString() {
199
+ return `${this.constructor.name}(${this.debugState()})`;
200
+ }
201
+ /**
202
+ * @protected
203
+ * @param {?=} properties
204
+ * @return {?}
205
+ */
206
+ debugState(properties) {
207
+ return (properties || this.debugPropertyKeys).map((/**
208
+ * @param {?} p
209
+ * @return {?}
210
+ */
211
+ p => {
212
+ return `${p}: ${this[p]}`;
213
+ })).join(', ');
214
+ }
215
+ /**
216
+ * @param {?} component
217
+ * @param {?} currentUrl
218
+ * @param {?} nextUrl
219
+ * @return {?}
220
+ */
221
+ canDeactivatePlace(component, currentUrl, nextUrl) {
222
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
223
+ // console.log(`---> canDeactivatePlace(${component.placeDefinition.path}, ${currentUrl.url} -> ${nextUrl.url})`);
224
+ // lookup the handler and create it if we've not seen it yet
225
+ /** @type {?} */
226
+ let handler = this.componentDeactivationHandlers.get(component);
227
+ if (!handler) {
228
+ /** @type {?} */
229
+ const isPrimaryHandler = this.componentDeactivationHandlers.size === 0;
230
+ handler = new PlaceComponentDeactivationHandler(component, this, isPrimaryHandler);
231
+ this.componentDeactivationHandlers.set(component, handler);
232
+ }
233
+ return handler.canDeactivate(currentUrl, nextUrl).then((/**
234
+ * @param {?} result
235
+ * @return {?}
236
+ */
237
+ result => {
238
+ // console.log(`<--- canDeactivatePlace(${component.placeDefinition.path}): ${result}`);
239
+ return result;
240
+ })).catch((/**
241
+ * @param {?} error
242
+ * @return {?}
243
+ */
244
+ error => {
245
+ throw error;
246
+ }));
247
+ });
248
+ }
249
+ /**
250
+ * @param {?} newUrl
251
+ * @return {?}
252
+ */
253
+ cancelCanDeactivateInteraction(newUrl) {
254
+ Logger.get(this).info(`back button pressed during navigation session interaction promise`);
255
+ // detach the interaction from the session so it doesn't get disposed until the activity has finished
256
+ // all it's things.
257
+ /** @type {?} */
258
+ const canDeactivateInteractionContext = this.detachCanDeactivateInteractionContext();
259
+ // TODO: I need to make the exclusive interaction context disallow nested activities or
260
+ // that would mess things up entirely. Or, can I do a context.abortAll().then(..)
261
+ Logger.get(this).info('cancelling current navigation activity..');
262
+ canDeactivateInteractionContext.cancelActiveActivity().then((/**
263
+ * @return {?}
264
+ */
265
+ () => {
266
+ canDeactivateInteractionContext.dispose();
267
+ }));
268
+ this.handleCanDeactivateCancelledEventScenario(newUrl);
269
+ }
270
+ /**
271
+ * @protected
272
+ * @param {?} url
273
+ * @return {?}
274
+ */
275
+ reinstateUrlAfterAngularChangedItOnCancellation(url) {
276
+ // Angular calls _this.resetUrlToCurrentUrlTree() on cancelling and fucks our history.
277
+ // 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
278
+ // it before the cancel event fired.
279
+ // So we need to:
280
+ // - replace the just inserted url with the one that used to be there.
281
+ // - push our actual url back onto the top of the stack.
282
+ this.resetBrowserLocation(url, { replaceCurrent: true });
283
+ }
284
+ /**
285
+ * @protected
286
+ * @return {?}
287
+ */
288
+ detachCanDeactivateInteractionContext() {
289
+ /** @type {?} */
290
+ const context = this._interactionContext;
291
+ this._interactionContext = null;
292
+ return context;
293
+ }
294
+ }
295
+ if (false) {
296
+ /** @type {?} */
297
+ NavigationSession.prototype.debugPropertyKeys;
298
+ /**
299
+ * @type {?}
300
+ * @private
301
+ */
302
+ NavigationSession.prototype._visits;
303
+ /**
304
+ * @type {?}
305
+ * @private
306
+ */
307
+ NavigationSession.prototype.componentDeactivationHandlers;
308
+ /** @type {?} */
309
+ NavigationSession.prototype.isPopState;
310
+ /**
311
+ * @type {?}
312
+ * @private
313
+ */
314
+ NavigationSession.prototype._interactionContext;
315
+ /** @type {?} */
316
+ NavigationSession.prototype.context;
317
+ /** @type {?} */
318
+ NavigationSession.prototype.startingUrl;
319
+ /**
320
+ * @abstract
321
+ * @param {?} newUrl
322
+ * @return {?}
323
+ */
324
+ NavigationSession.prototype.handleCanDeactivateCancelledEventScenario = function (newUrl) { };
325
+ }
326
+ //# sourceMappingURL=navigation-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-session.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/navigation/session/navigation-session.ts"],"names":[],"mappings":";;;;;AACA,OAAO,EAAO,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAS,MAAM,gBAAgB,CAAC;AAQ5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;;;;;AAM5F,MAAM,OAAgB,iBAAkB,SAAQ,gBAAgB;;;;;IAU9D,YAAqB,OAA0B,EAAW,WAAmB;QAC3E,KAAK,EAAE,CAAC;QADW,YAAO,GAAP,OAAO,CAAmB;QAAW,gBAAW,GAAX,WAAW,CAAQ;QAR7E,sBAAiB,GAAa,EAAE,CAAC;QACzB,YAAO,GAAG,IAAI,GAAG,EAA0B,CAAC;QAE5C,kCAA6B,GAAG,IAAI,GAAG,EAAqD,CAAC;QAOnG,wDAAwD;QACxD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,iCAAiC,EAAE,CAAC;QACrG,IAAI,CAAC,SAAS;;;QAAC,GAAG,EAAE;YAClB,+FAA+F;YAC/F,8FAA8F;YAC9F,iGAAiG;YACjG,8FAA8F;YAC9F,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBAC5B,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAC,yCAAyC;aAC9E;QACH,CAAC,EAAC,CAAC;IACL,CAAC;;;;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;;;;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;IACjC,CAAC;;;;IAED,IAAI,yBAAyB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC;IAC/C,CAAC;;;;;IAED,UAAU,CAAC,KAAY;QACrB,qFAAqF;QACrF,IAAI,CAAC,OAAO,CAA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+BAA+B,GAAG,IAAI,CAAC,qCAAqC,EAAE;QACpF,uFAAuF;QACvF,uFAAuF;QACvF,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QAClE,+BAA+B,CAAC,oBAAoB,EAAE,CAAC,IAAI;;;QAAC,GAAG,EAAE;YAC/D,+BAA+B,CAAC,OAAO,EAAE,CAAC;QAC5C,CAAC,EAAC,CAAC;QAEH,IAAI,CAAC,yCAAyC,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;;;;;;IAIS,+CAA+C,CAAC,GAAW;QACnE,sFAAsF;QACtF,wGAAwG;QACxG,oCAAoC;QACpC,iBAAiB;QACjB,sEAAsE;QACtE,wDAAwD;QACxD,IAAI,CAAC,oBAAoB,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;;;;;IAES,qCAAqC;;cACvC,OAAO,GAAG,IAAI,CAAC,mBAAmB;QACxC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAChC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;;;IAtLC,8CAAiC;;;;;IACjC,oCAAoD;;;;;IAEpD,0DAAqG;;IACrG,uCAAsC;;;;;IAEtC,gDAAgD;;IAEpC,oCAAmC;;IAAE,wCAA4B;;;;;;IA6J7E,8FAAwE","sourcesContent":["import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, RouterEvent } from '@angular/router';\nimport { Dsl, GarbageCollector, lang, Logger, Trace } from '@coolon/pectin';\nimport { InteractionContext } from '../../../interaction/interaction-context';\nimport { InteractionServiceRoutingAdapter } from '../../../interaction/services/interaction-service-routing-adapter';\nimport { PlaceComponent } from '../../place-component';\nimport { PlaceDefinition } from '../../place-definition';\nimport { UrlService } from '../../url-service';\nimport { UrlSnapshot } from '../../url-snapshot';\nimport { Visit } from '../../visit';\nimport { PlaceComponentDeactivationHandler } from '../place-component-deactivation-handler';\nimport { NavigationContext } from './navigation-context';\n\n/**\n * Transient states\n */\nexport abstract class NavigationSession extends GarbageCollector {\n\n debugPropertyKeys: string[] = [];\n private _visits = new Map<PlaceDefinition, Visit>();\n\n private componentDeactivationHandlers = new Map<PlaceComponent, PlaceComponentDeactivationHandler>();\n abstract readonly isPopState: boolean;\n\n private _interactionContext: InteractionContext;\n\n constructor(readonly context: NavigationContext, readonly startingUrl: string) {\n super();\n // TODO: can I get away without creating one every time?\n this._interactionContext = this.context.routerInteractionAdapter.createExclusiveInteractionContext();\n this.onDispose(() => {\n // the interaction context can be detached during the back button cancellation state transition\n // as the transition is synchronous and activityCancellation isn't. Otherwise dispose will be\n // called before the context has been cancelled. It might be work having the interaction context\n // automatically cancel if the context is disposed so we don't have worry about detaching etc.\n if (this._interactionContext) {\n this._interactionContext.dispose(); // or do something like cancelAndDispose?\n }\n });\n }\n\n get name(): string {\n return this.constructor.name;\n }\n\n get urlService(): UrlService {\n return this.context.urlService;\n }\n\n get interactionServiceAdapter(): InteractionServiceRoutingAdapter {\n return this.context.routerInteractionAdapter;\n }\n\n storeVisit(visit: Visit) {\n // console.log(`Storing visit for ${visit.placeDefinition.component.name}`, {visit});\n this._visits.set(visit.placeDefinition, visit);\n }\n\n\n getVisitFor(placeDef: PlaceDefinition) {\n const visit = this._visits.get(placeDef);\n // console.log(`Getting visit for ${placeDef.component.name}`, {visit});\n return visit;\n }\n\n get canDeactivateInteractionContext(): InteractionContext {\n return this._interactionContext;\n }\n\n notifyActive() {\n // noop.\n }\n\n onRouterStarted(event: NavigationStart): void {\n // navigation sessions can have many cancel start cycles due to place guard redirects\n this.ignore(event);\n }\n\n // @Trace()\n onUrlChange(url: string) {\n // Normally we just ignore these but they are the only way of detecting if the back button\n // was clicked during a canDeactivate promise.\n // 1. a route is in progress and awaiting a canDeactivateGuard\n // 2. the user the clicks the back button.\n // So to handle that scenario we need to check if we've got a can deactivate interaction in\n // progress and the do the appropriate clean up.\n if (this.canDeactivateInteractionContext && this.canDeactivateInteractionContext.isActive()) {\n this.cancelCanDeactivateInteraction(url);\n }\n }\n\n onPopState(event: NavigationStart): void {\n return this.illegalTransition(event);\n }\n\n onRouterCancelled(event: NavigationCancel): void {\n return this.illegalTransition(event);\n }\n\n onRouterError(event: NavigationError): void {\n return this.illegalTransition(event);\n }\n\n onRouterEnd(event: NavigationEnd): void {\n return this.illegalTransition(event);\n }\n\n getVisits(): Visit[] {\n return Array.from(this._visits.values());\n }\n\n protected illegalTransition<R>(message: string | RouterEvent): R {\n return lang.illegalState(`${message.toString()} not supported by ${this.toString()}`);\n }\n\n protected currentRouterUrl(): string {\n return this.urlService.getCurrentRouterUrl();\n }\n\n resetBrowserLocation(url, options: { replaceCurrent: boolean } = { replaceCurrent: false }) {\n // console.log(`---> resetting browser location to: ${url}`);\n this.urlService.resetBrowserLocation(url, options);\n }\n\n // @Trace()\n protected repairBrowserHistoryAndUrlAfterGuardCancellation(poppedHistoryToReplace: string, activeUrl:string): void {\n // Important: I tried to perform this fix at a later point int he routing cycle but it created all kinds of\n // strangeness.\n Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');\n console.log(`replacing ${this.urlService.getCurrentLocationUrlSnapshot().url} with ${poppedHistoryToReplace}`);\n this.urlService.resetBrowserLocation(poppedHistoryToReplace, { replaceCurrent: true });\n console.log(`pushing ${activeUrl} back onto the history.`);\n this.urlService.resetBrowserLocation(activeUrl, { replaceCurrent: false });\n }\n\n\n ignore(event: RouterEvent, reason?: string): void {\n reason = reason ? ` -> ${reason}` : '';\n Logger.get(this).info(`Ignoring router event${reason}: ${event.constructor.name} -> ${event.url} :: ${this.toString()}`);\n }\n\n toString(): string {\n return `${this.constructor.name}(${this.debugState()})`;\n }\n\n protected debugState(properties?: string[]) {\n return (properties || this.debugPropertyKeys).map(p => {\n return `${p}: ${this[p]}`;\n }).join(', ');\n }\n\n async canDeactivatePlace(component: PlaceComponent, currentUrl: UrlSnapshot, nextUrl: UrlSnapshot): Promise<boolean | UrlSnapshot> {\n // console.log(`---> canDeactivatePlace(${component.placeDefinition.path}, ${currentUrl.url} -> ${nextUrl.url})`);\n // lookup the handler and create it if we've not seen it yet\n let handler = this.componentDeactivationHandlers.get(component);\n if (!handler) {\n const isPrimaryHandler = this.componentDeactivationHandlers.size === 0; // only primary handler cancels the app model interations\n handler = new PlaceComponentDeactivationHandler(component, this, isPrimaryHandler);\n this.componentDeactivationHandlers.set(component, handler);\n }\n return handler.canDeactivate(currentUrl, nextUrl).then(result => {\n // console.log(`<--- canDeactivatePlace(${component.placeDefinition.path}): ${result}`);\n return result;\n }).catch(error => {\n throw error;\n });\n }\n\n cancelCanDeactivateInteraction(newUrl: string): void {\n Logger.get(this).info(`back button pressed during navigation session interaction promise`);\n // detach the interaction from the session so it doesn't get disposed until the activity has finished\n // all it's things.\n const canDeactivateInteractionContext = this.detachCanDeactivateInteractionContext();\n // TODO: I need to make the exclusive interaction context disallow nested activities or\n // that would mess things up entirely. Or, can I do a context.abortAll().then(..)\n Logger.get(this).info('cancelling current navigation activity..');\n canDeactivateInteractionContext.cancelActiveActivity().then(() => {\n canDeactivateInteractionContext.dispose();\n });\n\n this.handleCanDeactivateCancelledEventScenario(newUrl);\n }\n\n abstract handleCanDeactivateCancelledEventScenario(newUrl: string): void\n\n protected reinstateUrlAfterAngularChangedItOnCancellation(url: string) {\n // Angular calls _this.resetUrlToCurrentUrlTree() on cancelling and fucks our history.\n // 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\n // it before the cancel event fired.\n // So we need to:\n // - replace the just inserted url with the one that used to be there.\n // - push our actual url back onto the top of the stack.\n this.resetBrowserLocation(url, { replaceCurrent: true });\n }\n\n protected detachCanDeactivateInteractionContext(): InteractionContext {\n const context = this._interactionContext;\n this._interactionContext = null;\n return context;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"NavigationSession":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"GarbageCollector","line":15,"character":48},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./navigation-context","name":"NavigationContext","line":25,"character":32},{"__symbolic":"reference","name":"string"}]}],"storeVisit":[{"__symbolic":"method"}],"getVisitFor":[{"__symbolic":"method"}],"notifyActive":[{"__symbolic":"method"}],"onRouterStarted":[{"__symbolic":"method"}],"onUrlChange":[{"__symbolic":"method"}],"onPopState":[{"__symbolic":"method"}],"onRouterCancelled":[{"__symbolic":"method"}],"onRouterError":[{"__symbolic":"method"}],"onRouterEnd":[{"__symbolic":"method"}],"getVisits":[{"__symbolic":"method"}],"illegalTransition":[{"__symbolic":"method"}],"currentRouterUrl":[{"__symbolic":"method"}],"resetBrowserLocation":[{"__symbolic":"method"}],"repairBrowserHistoryAndUrlAfterGuardCancellation":[{"__symbolic":"method"}],"ignore":[{"__symbolic":"method"}],"toString":[{"__symbolic":"method"}],"debugState":[{"__symbolic":"method"}],"canDeactivatePlace":[{"__symbolic":"method"}],"cancelCanDeactivateInteraction":[{"__symbolic":"method"}],"handleCanDeactivateCancelledEventScenario":[{"__symbolic":"method"}],"reinstateUrlAfterAngularChangedItOnCancellation":[{"__symbolic":"method"}],"detachCanDeactivateInteractionContext":[{"__symbolic":"method"}]}}}}]
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @fileoverview added by tsickle
3
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
+ */
5
+ import { AbstractPopStateNavigation } from './abstract-pop-state-navigation';
6
+ import { WaitUntilPopStateDuringCanDeactivateInteractionFinishes } from './event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes';
7
+ export class PopStateNavigation extends AbstractPopStateNavigation {
8
+ /**
9
+ * @param {?} event
10
+ * @return {?}
11
+ */
12
+ onRouterCancelled(event) {
13
+ this.repairBrowserHistoryAndUrlAfterGuardCancellation();
14
+ this.context.finishRoutingSession();
15
+ }
16
+ /**
17
+ * @param {?} event
18
+ * @return {?}
19
+ */
20
+ onRouterEnd(event) {
21
+ this.context.finishRoutingSession(this.getVisits());
22
+ }
23
+ /**
24
+ * @param {?} locationTriggerUrl
25
+ * @return {?}
26
+ */
27
+ handleCanDeactivateCancelledEventScenario(locationTriggerUrl) {
28
+ this.context.transitionTo(new WaitUntilPopStateDuringCanDeactivateInteractionFinishes(this.context, this.startingUrl, locationTriggerUrl, this.poppedHistoryUrl));
29
+ }
30
+ }
31
+ //# sourceMappingURL=pop-state-navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pop-state-navigation.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/navigation/session/pop-state-navigation.ts"],"names":[],"mappings":";;;;AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAG7E,OAAO,EAAE,uDAAuD,EAAE,MAAM,+EAA+E,CAAC;AAExJ,MAAM,OAAO,kBAAmB,SAAQ,0BAA0B;;;;;IAEhE,iBAAiB,CAAC,KAAuB;QACvC,IAAI,CAAC,gDAAgD,EAAE,CAAC;QACxD,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IACtC,CAAC;;;;;IAED,WAAW,CAAC,KAAoB;QAC9B,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACtD,CAAC;;;;;IAED,yCAAyC,CAAC,kBAA0B;QAClE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,uDAAuD,CAAC,IAAI,CAAC,OAAO,EAChG,IAAI,CAAC,WAAW,EAChB,kBAAkB,EAClB,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC5B,CAAC;CAEF","sourcesContent":["import { NavigationCancel, NavigationEnd, NavigationError } from '@angular/router';\nimport { Logger, Trace } from '@coolon/pectin';\nimport { AbstractPopStateNavigation } from './abstract-pop-state-navigation';\nimport { NavigationContext } from './navigation-context';\nimport { NavigationSession } from './navigation-session';\nimport { WaitUntilPopStateDuringCanDeactivateInteractionFinishes } from './event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes';\n\nexport class PopStateNavigation extends AbstractPopStateNavigation {\n\n onRouterCancelled(event: NavigationCancel): void {\n this.repairBrowserHistoryAndUrlAfterGuardCancellation();\n this.context.finishRoutingSession();\n }\n\n onRouterEnd(event: NavigationEnd): void {\n this.context.finishRoutingSession(this.getVisits());\n }\n\n handleCanDeactivateCancelledEventScenario(locationTriggerUrl: string): void {\n this.context.transitionTo(new WaitUntilPopStateDuringCanDeactivateInteractionFinishes(this.context,\n this.startingUrl,\n locationTriggerUrl,\n this.poppedHistoryUrl));\n }\n\n}\n"]}
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"PopStateNavigation":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./abstract-pop-state-navigation","name":"AbstractPopStateNavigation","line":7,"character":40},"members":{"onRouterCancelled":[{"__symbolic":"method"}],"onRouterEnd":[{"__symbolic":"method"}],"handleCanDeactivateCancelledEventScenario":[{"__symbolic":"method"}]}}}}]
@@ -3,7 +3,7 @@
3
3
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
4
  */
5
5
  import * as tslib_1 from "tslib";
6
- import { assert, Binding, DebugContext, lang } from '@coolon/pectin';
6
+ import { assert, Binding, DebugContext, Dsl, Guard, lang, MutableValueModel } from '@coolon/pectin';
7
7
  import { Klass } from '@coolon/typescript-utilities';
8
8
  import { Memoize } from '@typescript-plus/fast-memoize-decorator';
9
9
  import 'reflect-metadata';
@@ -18,23 +18,54 @@ export const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
18
18
  export class PlaceComponent extends DisposableComponent {
19
19
  constructor() {
20
20
  super();
21
+ this.visitModel = new MutableValueModel();
22
+ this._inVisitUpdate = new Guard();
21
23
  }
24
+ // @Trace()
22
25
  /**
23
26
  * @param {?} visit
27
+ * @param {?} notifyVisitChanged
24
28
  * @return {?}
25
29
  */
26
- initialiseVisit(visit) {
27
- assert.isNil(this.visit);
28
- this.visit = visit;
29
- DebugContext.get(this.visit).tag(`${this.placeDefinition.component.name}.visit`);
30
+ initialiseVisit(visit, notifyVisitChanged) {
31
+ assert.isNil(this.visitModel.value);
32
+ const { when } = Dsl.disposeWith(this);
33
+ this.visitModel.value = visit;
34
+ DebugContext.get(this.visitModel).tag(`${this.placeDefinition.component.name}.visitModel`);
30
35
  this.placeDefinition.getVisitParameterDefs().forEach((/**
31
36
  * @param {?} parameterDef
32
37
  * @return {?}
33
38
  */
34
- parameterDef => {
35
- this.installBinding(parameterDef);
39
+ parameterDef => this.installBinding(parameterDef)));
40
+ when.valueOf(this.visitModel).changes((/**
41
+ * @param {?} current
42
+ * @param {?} previous
43
+ * @return {?}
44
+ */
45
+ (current, previous) => {
46
+ notifyVisitChanged(current, previous);
47
+ }), { unless: this._inVisitUpdate });
48
+ }
49
+ /**
50
+ * @param {?} visit
51
+ * @return {?}
52
+ */
53
+ updateVisit(visit) {
54
+ assert.isTruthy(this.isInitialised());
55
+ assert.notNil(visit);
56
+ this._inVisitUpdate.whileTrue((/**
57
+ * @return {?}
58
+ */
59
+ () => {
60
+ this.visitModel.value = visit;
36
61
  }));
37
62
  }
63
+ /**
64
+ * @return {?}
65
+ */
66
+ isInitialised() {
67
+ return !!this.visitModel.value;
68
+ }
38
69
  // @Trace()
39
70
  /**
40
71
  * @private
@@ -47,7 +78,7 @@ export class PlaceComponent extends DisposableComponent {
47
78
  const model = (/** @type {?} */ (this[parameterDef.propertyName]));
48
79
  DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);
49
80
  /** @type {?} */
50
- const binding = this.registerDisposable(new Binding(this.visit, model, {
81
+ const binding = this.registerDisposable(new Binding(this.visitModel, model, {
51
82
  /**
52
83
  * @param {?} visit
53
84
  * @return {?}
@@ -68,12 +99,7 @@ export class PlaceComponent extends DisposableComponent {
68
99
  return currentVisit.replace(parameterDef, value);
69
100
  }
70
101
  }));
71
- setTimeout((/**
72
- * @return {?}
73
- */
74
- () => {
75
- binding.writeRight();
76
- }));
102
+ binding.writeRight();
77
103
  }
78
104
  /**
79
105
  * @return {?}
@@ -107,7 +133,12 @@ if (false) {
107
133
  * @type {?}
108
134
  * @private
109
135
  */
110
- PlaceComponent.prototype.visit;
136
+ PlaceComponent.prototype.visitModel;
137
+ /**
138
+ * @type {?}
139
+ * @private
140
+ */
141
+ PlaceComponent.prototype._inVisitUpdate;
111
142
  /** @type {?} */
112
143
  PlaceComponent.prototype.interactionContext;
113
144
  }
@@ -1 +1 @@
1
- {"version":3,"file":"place-component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-component.ts"],"names":[],"mappings":";;;;;AACA,OAAO,EACL,MAAM,EACN,OAAO,EAEP,YAAY,EAEZ,IAAI,EAGL,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;;;AAKrD,MAAM,OAAO,wBAAwB,GAAG,0BAA0B;;;AAElE,MAAM,OAAO,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAExE,MAAM,OAAO,cAAe,SAAQ,mBAAmB;IASrD;QACE,KAAK,EAAE,CAAC;IACV,CAAC;;;;;IAEM,eAAe,CAAC,KAAwB;QAC7C,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,QAAQ,C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,EAAiC,CAAC,CAAC;IAChG,CAAC;;;;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG;;;;QAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAC,CAAC;IAC7D,CAAC;;;;IAED,YAAY;IACZ,CAAC;CAEF;AAXC;IADC,OAAO,EAAE;sCACa,eAAe;;qDAErC;;;;;;IA3CD,+BAAiC;;IAGjC,4CAAwC;;AAmD1C,WAAiB,cAAc;;;;;IAE7B,SAAgB,2BAA2B,CAAC,MAAW;QACrD,OAAO,IAAI,CAAC,gBAAgB,CAAC,mBAAA,MAAM,EAAsB,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACtF,CAAC;IAFe,0CAA2B,8BAE1C,CAAA;;;;;IAED,SAAgB,kBAAkB,CAAC,KAAoC;QACrE,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;IACpE,CAAC;IAFe,iCAAkB,qBAEjC,CAAA;;;;;IAED,SAAgB,aAAa,CAAC,KAAoC;QAChE,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;IAFe,4BAAa,gBAE5B,CAAA;;;;;;IAED,SAAgB,gBAAgB,CAAC,KAAoC,EAAE,UAA2B;QAChG,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAFe,+BAAgB,mBAE/B,CAAA;AAEH,CAAC,EAlBgB,cAAc,KAAd,cAAc,QAkB9B","sourcesContent":["import { AfterViewInit } from '@angular/core';\nimport {\n assert,\n Binding,\n Constructable,\n DebugContext,\n IMutableHasValue,\n lang, Trace,\n TransactionObserver,\n ValueModel\n} from '@coolon/pectin';\nimport { Klass } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator';\nimport 'reflect-metadata';\nimport { DisposableComponent } from '../components/disposable-component';\nimport { InteractionContext } from '../interaction/interaction-context';\nimport { PlaceDefinition } from './place-definition';\nimport { ParameterDefinition } from './route/parameter-definition.class';\nimport { Visit } from './visit';\n\n// RAKE: making this Symbol(...) broke things.\nexport const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';\n// this one seems ok.\nexport const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');\n\nexport class PlaceComponent extends DisposableComponent {\n\n private visit: ValueModel<Visit>;\n // private _inDeactivationGuard = new MutableValueModel<boolean>(false);\n\n interactionContext?: InteractionContext;\n\n canDeactivate?(interactionContext: InteractionContext): boolean | Promise<boolean>;\n\n constructor() {\n super();\n }\n\n public initialiseVisit(visit: ValueModel<Visit>) {\n assert.isNil(this.visit);\n this.visit = visit;\n DebugContext.get(this.visit).tag(`${this.placeDefinition.component.name}.visit`);\n this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => {\n this.installBinding(parameterDef);\n });\n }\n\n // @Trace()\n private installBinding<T, S>(parameterDef: ParameterDefinition<T, S>) {\n const model = this[parameterDef.propertyName] as IMutableHasValue<S>;\n DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);\n const binding = this.registerDisposable(new Binding(this.visit, model, {\n toRight(visit: Visit): S {\n const value = visit.getParameter(parameterDef.name);\n console.log('push to component', {name:parameterDef.name, value, visit});\n return value;\n },\n toLeft(value: S, currentVisit?: Visit): Visit {\n console.log('push to route', { name: parameterDef.name, value, currentVisit });\n return currentVisit.replace(parameterDef, value);\n }\n }));\n setTimeout(() => {\n binding.writeRight();\n })\n }\n\n @Memoize()\n get placeDefinition(): PlaceDefinition {\n return PlaceComponent.getDefinition(this.constructor as any as Constructable<PlaceComponent>);\n }\n\n get childPlaces(): Constructable<PlaceComponent>[] {\n return this.placeDefinition.children.map(d => d.component);\n }\n\n onPlaceReady() {\n }\n\n}\n\nexport namespace PlaceComponent {\n\n export function isPlaceComponentConstructor(target: any): target is Constructable<PlaceComponent> {\n return lang.constructorChain(target as Constructable<any>).includes(PlaceComponent);\n }\n\n export function getRouteParameters(klass: Constructable<PlaceComponent>): ParameterDefinition<any>[] {\n return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);\n }\n\n export function getDefinition(klass: Constructable<PlaceComponent>): PlaceDefinition {\n return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);\n }\n\n export function injectDefinition(klass: Constructable<PlaceComponent>, definition: PlaceDefinition) {\n Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);\n }\n\n}\n"]}
1
+ {"version":3,"file":"place-component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-component.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EACL,MAAM,EACN,OAAO,EAEP,YAAY,EACZ,GAAG,EACH,KAAK,EAEL,IAAI,EACJ,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;;;AAKrD,MAAM,OAAO,wBAAwB,GAAG,0BAA0B;;;AAElE,MAAM,OAAO,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAExE,MAAM,OAAO,cAAe,SAAQ,mBAAmB;IASrD;QACE,KAAK,EAAE,CAAC;QARF,eAAU,GAAG,IAAI,iBAAiB,EAAS,CAAC;QAC5C,mBAAc,GAAG,IAAI,KAAK,EAAE,CAAC;IAQrC,CAAC;;;;;;;IAGM,eAAe,CAAC,KAAY,EAAE,kBAA4D;QAC/F,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;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AsB,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACtF,CAAC;IAFe,0CAA2B,8BAE1C,CAAA;;;;;IAED,SAAgB,kBAAkB,CAAC,KAAoC;QACrE,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;IACpE,CAAC;IAFe,iCAAkB,qBAEjC,CAAA;;;;;IAED,SAAgB,aAAa,CAAC,KAAoC;QAChE,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;IAFe,4BAAa,gBAE5B,CAAA;;;;;;IAED,SAAgB,gBAAgB,CAAC,KAAoC,EAAE,UAA2B;QAChG,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAFe,+BAAgB,mBAE/B,CAAA;AAEH,CAAC,EAlBgB,cAAc,KAAd,cAAc,QAkB9B","sourcesContent":["import {\n assert,\n Binding,\n Constructable,\n DebugContext,\n Dsl,\n Guard,\n IMutableHasValue,\n lang,\n MutableValueModel\n} from '@coolon/pectin';\nimport { Klass } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator';\nimport 'reflect-metadata';\nimport { DisposableComponent } from '../components/disposable-component';\nimport { InteractionContext } from '../interaction/interaction-context';\nimport { PlaceDefinition } from './place-definition';\nimport { ParameterDefinition } from './route/parameter-definition.class';\nimport { Visit } from './visit';\n\n// RAKE: making this Symbol(...) broke things.\nexport const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';\n// this one seems ok.\nexport const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');\n\nexport class PlaceComponent extends DisposableComponent {\n\n private visitModel = new MutableValueModel<Visit>();\n private _inVisitUpdate = new Guard();\n\n interactionContext?: InteractionContext;\n\n canDeactivate?(interactionContext: InteractionContext): boolean | Promise<boolean>;\n\n constructor() {\n super();\n }\n\n // @Trace()\n public initialiseVisit(visit: Visit, notifyVisitChanged: (current: Visit, previous:Visit) => void) {\n assert.isNil(this.visitModel.value);\n\n const { when } = Dsl.disposeWith(this);\n\n this.visitModel.value = visit;\n DebugContext.get(this.visitModel).tag(`${this.placeDefinition.component.name}.visitModel`);\n this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => this.installBinding(parameterDef));\n when.valueOf(this.visitModel).changes((current,previous) => {\n notifyVisitChanged(current, previous);\n }, {unless: this._inVisitUpdate});\n }\n\n public updateVisit(visit: Visit) {\n assert.isTruthy(this.isInitialised());\n assert.notNil(visit);\n this._inVisitUpdate.whileTrue(() => {\n this.visitModel.value = visit;\n });\n }\n\n isInitialised() {\n return !!this.visitModel.value;\n }\n\n // @Trace()\n private installBinding<T, S>(parameterDef: ParameterDefinition<T, S>) {\n const model = this[parameterDef.propertyName] as IMutableHasValue<S>;\n DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);\n const binding = this.registerDisposable(new Binding(this.visitModel, model, {\n toRight(visit: Visit): S {\n const value = visit.getParameter(parameterDef.name);\n console.log('push to component', { name: parameterDef.name, value, visit });\n return value;\n },\n toLeft(value: S, currentVisit?: Visit): Visit {\n console.log('push to route', { name: parameterDef.name, value, currentVisit });\n return currentVisit.replace(parameterDef, value);\n }\n }));\n\n binding.writeRight();\n }\n\n @Memoize()\n get placeDefinition(): PlaceDefinition {\n return PlaceComponent.getDefinition(this.constructor as any as Constructable<PlaceComponent>);\n }\n\n get childPlaces(): Constructable<PlaceComponent>[] {\n return this.placeDefinition.children.map(d => d.component);\n }\n\n onPlaceReady() {\n }\n\n}\n\nexport namespace PlaceComponent {\n\n export function isPlaceComponentConstructor(target: any): target is Constructable<PlaceComponent> {\n return lang.constructorChain(target as Constructable<any>).includes(PlaceComponent);\n }\n\n export function getRouteParameters(klass: Constructable<PlaceComponent>): ParameterDefinition<any>[] {\n return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);\n }\n\n export function getDefinition(klass: Constructable<PlaceComponent>): PlaceDefinition {\n return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);\n }\n\n export function injectDefinition(klass: Constructable<PlaceComponent>, definition: PlaceDefinition) {\n Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"DEFINITION_META_DATA_KEY":"PLACE_DEFINITION_OPTIONS","ROUTE_PARAMETER_LIST_KEY":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"Symbol"},"arguments":["place:route:parameters"]},"PlaceComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../components/disposable-component","name":"DisposableComponent","line":25,"character":36},"members":{"canDeactivate":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}],"initialiseVisit":[{"__symbolic":"method"}],"installBinding":[{"__symbolic":"method"}],"placeDefinition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator","name":"Memoize","line":67,"character":3}}]}],"onPlaceReady":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"DEFINITION_META_DATA_KEY":"PLACE_DEFINITION_OPTIONS","ROUTE_PARAMETER_LIST_KEY":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"Symbol"},"arguments":["place:route:parameters"]},"PlaceComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../components/disposable-component","name":"DisposableComponent","line":25,"character":36},"members":{"canDeactivate":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}],"initialiseVisit":[{"__symbolic":"method"}],"updateVisit":[{"__symbolic":"method"}],"isInitialised":[{"__symbolic":"method"}],"installBinding":[{"__symbolic":"method"}],"placeDefinition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator","name":"Memoize","line":83,"character":3}}]}],"onPlaceReady":[{"__symbolic":"method"}]}}}}]