@coolon/angular-ui-powerups 0.0.125 → 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 +3743 -3012
  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 +47 -22
  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 +66 -25
  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 +2641 -2268
  259. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  260. package/fesm5/coolon-angular-ui-powerups.js +3703 -2984
  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
@@ -4,8 +4,9 @@
4
4
  */
5
5
  import * as tslib_1 from "tslib";
6
6
  import { Injectable } from '@angular/core';
7
- import { Dsl, GarbageCollector, lang, MutableListModel, MutableValueModel } from '@coolon/pectin';
7
+ import { DelegatingValueModel, Dsl, GarbageCollector, MutableListModel } from '@coolon/pectin';
8
8
  import { assert } from '@coolon/typescript-utilities';
9
+ import { InteractionServiceRoutingAdapter } from './interaction-service-routing-adapter';
9
10
  import { ModalInteractionContextFactory } from './modal-interaction-context.factory';
10
11
  import * as i0 from "@angular/core";
11
12
  import * as i1 from "./modal-interaction-context.factory";
@@ -15,22 +16,22 @@ var InteractionService = /** @class */ (function () {
15
16
  function InteractionService(modelInteractionContextFactory) {
16
17
  this.modelInteractionContextFactory = modelInteractionContextFactory;
17
18
  this.garbage = new GarbageCollector();
18
- this.exclusiveContext = new MutableValueModel();
19
- this._activeModalInteractionContextModel = new MutableValueModel();
20
- this._activeInlineInteractionContextModel = new MutableValueModel();
19
+ // private readonly _activeModalContext = new MutableValueModel<InteractionContext>();
20
+ // private readonly _activeInlineContext = new MutableValueModel<InteractionContext>();
21
+ // private readonly _activeContext: ValueModelChain<InteractionContext>;
22
+ this._navigationInProgress = new DelegatingValueModel().withDefault(false);
21
23
  var _a = Dsl.disposeWith(this.garbage), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
22
- this._activeInteractionContext = chain(this._activeModalInteractionContextModel)
23
- .otherwise(this._activeInlineInteractionContextModel)
24
- .pluck('interactionContext');
25
- this.active = chain(this._activeInteractionContext).isNotNil();
26
- this.modelInteractionActive = chain(this._activeModalInteractionContextModel).isNotNil();
27
- this.inlineInteractionActive = chain(this._activeInlineInteractionContextModel).isNotNil();
24
+ this.exclusiveInteractionRegistry = new InteractionService.ContextRegistry();
25
+ this.modalInteractionRegistry = new InteractionService.ContextRegistry();
26
+ this.inPlaceInteractionRegistry = new InteractionService.ContextRegistry();
27
+ this.modalInteractionRegistry.disableWhen(valueOf.any(this.exclusiveInteractionRegistry.active, this.modalInteractionRegistry.active).areTruthy());
28
+ this.inPlaceInteractionRegistry.disableWhen(valueOf.any(this.exclusiveInteractionRegistry.active, this.modalInteractionRegistry.active, this.inPlaceInteractionRegistry.active).areTruthy());
29
+ this.active = valueOf.any(this.inPlaceInteractionRegistry.active, this.modalInteractionRegistry.active).areTruthy();
28
30
  // TODO: chain.concat(listOrValueModels) would be nice.
29
- this.activeInteractionContextIds = chain(new MutableListModel())
30
- .append(this._activeInlineInteractionContextModel)
31
- .append(this._activeModalInteractionContextModel)
32
- .rejectNil()
33
- .pluck('id');
31
+ this.activeInteractionContextIds = chain(this.inPlaceInteractionRegistry.interactionContextIds)
32
+ .concat(this.modalInteractionRegistry.interactionContextIds);
33
+ this.activeModalContext = chain(this.modalInteractionRegistry.interactionContexts).first();
34
+ this.inModalInteraction = chain(this.activeModalContext).isNotNil();
34
35
  }
35
36
  /**
36
37
  * @return {?}
@@ -41,15 +42,6 @@ var InteractionService = /** @class */ (function () {
41
42
  function () {
42
43
  return this.active.value;
43
44
  };
44
- /**
45
- * @return {?}
46
- */
47
- InteractionService.prototype.isModalActive = /**
48
- * @return {?}
49
- */
50
- function () {
51
- return this.modelInteractionActive.value;
52
- };
53
45
  /**
54
46
  * @deprecated use #createModalInteractionContextDisposedWith instead.
55
47
  * @param disposable
@@ -82,36 +74,38 @@ var InteractionService = /** @class */ (function () {
82
74
  * @return {?}
83
75
  */
84
76
  function (disposable) {
85
- /** @type {?} */
86
- var context = this.modelInteractionContextFactory.createInteractionContext();
87
- disposable.registerDisposable(new InteractionService.Monitor('modal', context, this._activeModalInteractionContextModel, this.exclusiveContext));
88
- return context;
77
+ // TODO: look at making the registry the factory..
78
+ return this.modelInteractionContextFactory.createInteractionContext('modal', new InteractionService.ApiAdapter(this.placeRouter, this.modalInteractionRegistry));
89
79
  };
90
80
  /**
91
81
  * @param {?} interactionContext
92
82
  * @return {?}
93
83
  */
94
- InteractionService.prototype._registerInplaceInteractionContext = /**
84
+ InteractionService.prototype.registerInplaceInteractionContext = /**
95
85
  * @param {?} interactionContext
96
86
  * @return {?}
97
87
  */
98
88
  function (interactionContext) {
99
- interactionContext.registerDisposable(new InteractionService.Monitor("ip" + ++inplaceMonitorCount, interactionContext, this._activeInlineInteractionContextModel, this.exclusiveContext));
100
- };
101
- // @Trace()
102
- // @Trace()
103
- /**
104
- * @return {?}
105
- */
106
- InteractionService.prototype.getActiveContext =
107
- // @Trace()
108
- /**
109
- * @return {?}
110
- */
111
- function () {
112
- assert.isTruthy(this.isActive());
113
- return this._activeInteractionContext.value;
89
+ // TODO: look at making the registry the factory..
90
+ // Todo: check for double registration.
91
+ // Todo: allow multiple inplace interactions..
92
+ interactionContext.initialise("ip" + ++inplaceMonitorCount, new InteractionService.ApiAdapter(this.placeRouter, this.inPlaceInteractionRegistry));
114
93
  };
94
+ // private assertModalCanStart() {
95
+ // assert.isFalsey(this.inExclusiveInteraction.value);
96
+ // assert.isFalsey(this.modalActive.value);
97
+ // }
98
+ //
99
+ // private assertInPlaceCanStart() {
100
+ // assert.isFalsey(this.inExclusiveInteraction.value);
101
+ // assert.isFalsey(this.modalActive.value);
102
+ // assert.isFalsey(this._activeInlineContext.value);
103
+ // }
104
+ // // @Trace()
105
+ // getActiveContext(): InteractionContext {
106
+ // assert.isTruthy(this.isActive());
107
+ // return this._activeContext.value;
108
+ // }
115
109
  /**
116
110
  * Creates an interaction context that will prevent any other contexts from starting an
117
111
  * activity until it is disposed. This is intended for use by the router for passing
@@ -119,35 +113,68 @@ var InteractionService = /** @class */ (function () {
119
113
  * try and interact in a way that we can't track and synchronise with the browser back
120
114
  * button.
121
115
  */
116
+ // private assertModalCanStart() {
117
+ // assert.isFalsey(this.inExclusiveInteraction.value);
118
+ // assert.isFalsey(this.modalActive.value);
119
+ // }
120
+ //
121
+ // private assertInPlaceCanStart() {
122
+ // assert.isFalsey(this.inExclusiveInteraction.value);
123
+ // assert.isFalsey(this.modalActive.value);
124
+ // assert.isFalsey(this._activeInlineContext.value);
125
+ // }
126
+ // // @Trace()
127
+ // getActiveContext(): InteractionContext {
128
+ // assert.isTruthy(this.isActive());
129
+ // return this._activeContext.value;
130
+ // }
122
131
  /**
123
132
  * Creates an interaction context that will prevent any other contexts from starting an
124
133
  * activity until it is disposed. This is intended for use by the router for passing
125
134
  * to PlaceComponent.canDeactivate(interactionContext). This ensures components don't
126
135
  * try and interact in a way that we can't track and synchronise with the browser back
127
136
  * button.
137
+ * @param {?} router
128
138
  * @return {?}
129
139
  */
130
- InteractionService.prototype._createExclusiveModalInteractionContext = /**
140
+ InteractionService.prototype.registerPlaceRouter =
141
+ // private assertModalCanStart() {
142
+ // assert.isFalsey(this.inExclusiveInteraction.value);
143
+ // assert.isFalsey(this.modalActive.value);
144
+ // }
145
+ //
146
+ // private assertInPlaceCanStart() {
147
+ // assert.isFalsey(this.inExclusiveInteraction.value);
148
+ // assert.isFalsey(this.modalActive.value);
149
+ // assert.isFalsey(this._activeInlineContext.value);
150
+ // }
151
+ // // @Trace()
152
+ // getActiveContext(): InteractionContext {
153
+ // assert.isTruthy(this.isActive());
154
+ // return this._activeContext.value;
155
+ // }
156
+ /**
131
157
  * Creates an interaction context that will prevent any other contexts from starting an
132
158
  * activity until it is disposed. This is intended for use by the router for passing
133
159
  * to PlaceComponent.canDeactivate(interactionContext). This ensures components don't
134
160
  * try and interact in a way that we can't track and synchronise with the browser back
135
161
  * button.
162
+ * @param {?} router
136
163
  * @return {?}
137
164
  */
138
- function () {
139
- this.exclusiveContext.value = this.modelInteractionContextFactory.createInteractionContext();
165
+ function (router) {
166
+ var _this = this;
167
+ assert.isFalsey(this.placeRouter);
168
+ this.placeRouter = router;
169
+ this._navigationInProgress.setDelegate(this.placeRouter.navigationInProgress);
140
170
  /** @type {?} */
141
171
  var self = this;
142
- this.exclusiveContext.value.registerDisposable({
143
- dispose: /**
144
- * @return {?}
145
- */
146
- function () {
147
- self.exclusiveContext.value = null;
148
- }
149
- });
150
- return this.exclusiveContext.value;
172
+ return new InteractionServiceRoutingAdapter(this.activeInteractionContextIds, this.activeModalContext, (/**
173
+ * @return {?}
174
+ */
175
+ function () {
176
+ return self.modelInteractionContextFactory.createInteractionContext('exclusive', new InteractionService.ApiAdapter(_this.placeRouter, _this.exclusiveInteractionRegistry));
177
+ }));
151
178
  };
152
179
  InteractionService.decorators = [
153
180
  { type: Injectable, args: [{
@@ -174,28 +201,36 @@ if (false) {
174
201
  * @type {?}
175
202
  * @private
176
203
  */
177
- InteractionService.prototype.exclusiveContext;
204
+ InteractionService.prototype._navigationInProgress;
205
+ /**
206
+ * @type {?}
207
+ * @private
208
+ */
209
+ InteractionService.prototype.placeRouter;
210
+ /**
211
+ * @type {?}
212
+ * @private
213
+ */
214
+ InteractionService.prototype.exclusiveInteractionRegistry;
178
215
  /**
179
216
  * @type {?}
180
217
  * @private
181
218
  */
182
- InteractionService.prototype._activeModalInteractionContextModel;
219
+ InteractionService.prototype.modalInteractionRegistry;
183
220
  /**
184
221
  * @type {?}
185
222
  * @private
186
223
  */
187
- InteractionService.prototype._activeInlineInteractionContextModel;
224
+ InteractionService.prototype.inPlaceInteractionRegistry;
188
225
  /**
189
226
  * @type {?}
190
227
  * @private
191
228
  */
192
- InteractionService.prototype._activeInteractionContext;
229
+ InteractionService.prototype.activeModalContext;
193
230
  /** @type {?} */
194
231
  InteractionService.prototype.activeInteractionContextIds;
195
232
  /** @type {?} */
196
- InteractionService.prototype.modelInteractionActive;
197
- /** @type {?} */
198
- InteractionService.prototype.inlineInteractionActive;
233
+ InteractionService.prototype.inModalInteraction;
199
234
  /** @type {?} */
200
235
  InteractionService.prototype.modelInteractionContextFactory;
201
236
  }
@@ -203,101 +238,192 @@ if (false) {
203
238
  /**
204
239
  * @record
205
240
  */
206
- function Callback() { }
207
- InteractionService.Callback = Callback;
241
+ function Api() { }
242
+ InteractionService.Api = Api;
208
243
  if (false) {
209
244
  /**
210
- * @param {?} monitor
245
+ * Notifies the interaction service that a particular interactionContext has become active. The interaction
246
+ * services will then push changes to the router to track state. If the router is idle, the promise will
247
+ * resolve when the routing has finished updating. Otherwise it will return immediately.
248
+ * @param {?} interactionContext
211
249
  * @return {?}
212
250
  */
213
- Callback.prototype.onStarted = function (monitor) { };
251
+ Api.prototype.notifyActive = function (interactionContext) { };
214
252
  /**
215
- * @param {?} monitor
253
+ * Notifies the interaction service that a particular interactionContext has become idle. The interaction
254
+ * services will then push changes to the router to track state. If the router is idle, the promise will
255
+ * resolve when the routing has finished updating. Otherwise it will return immediately.
256
+ * @param {?} interactionContext
216
257
  * @return {?}
217
258
  */
218
- Callback.prototype.onFinished = function (monitor) { };
259
+ Api.prototype.notifyFinished = function (interactionContext) { };
219
260
  }
220
- var Monitor = /** @class */ (function (_super) {
221
- tslib_1.__extends(Monitor, _super);
222
- function Monitor(id, interactionContext, currentActiveMonitor, exclusiveContext) {
261
+ /**
262
+ * Provides a mechanism for the service to keep track of what the API adapters are doing to
263
+ * ensure the rules are followed, i.e. modal or in-place interaction aren't started while
264
+ * an exclusive routing interaction is active.
265
+ */
266
+ var /**
267
+ * Provides a mechanism for the service to keep track of what the API adapters are doing to
268
+ * ensure the rules are followed, i.e. modal or in-place interaction aren't started while
269
+ * an exclusive routing interaction is active.
270
+ */
271
+ ContextRegistry = /** @class */ (function (_super) {
272
+ tslib_1.__extends(ContextRegistry, _super);
273
+ function ContextRegistry() {
223
274
  var _this = _super.call(this) || this;
224
- _this.id = id;
225
- _this.interactionContext = interactionContext;
226
- _this.currentActiveMonitor = currentActiveMonitor;
227
- _this.exclusiveContext = exclusiveContext;
275
+ _this._interactions = new MutableListModel();
276
+ _this._disabledDelegate = new DelegatingValueModel().withDefault(false);
228
277
  var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
229
- when.valueOf(interactionContext.active).becomesTruthy((/**
230
- * @return {?}
231
- */
232
- function () { return _this.onStarted(); }));
233
- when.valueOf(interactionContext.active).becomesFalsey((/**
234
- * @return {?}
235
- */
236
- function () { return _this.onFinished(); }));
237
- interactionContext.registerDisposable(_this);
278
+ _this.active = chain(_this._interactions).isNotEmpty();
279
+ _this.interactionContextIds = chain(_this._interactions).pluck("identifier");
238
280
  return _this;
239
281
  }
282
+ Object.defineProperty(ContextRegistry.prototype, "interactionContexts", {
283
+ get: /**
284
+ * @return {?}
285
+ */
286
+ function () {
287
+ return this._interactions.readonly;
288
+ },
289
+ enumerable: true,
290
+ configurable: true
291
+ });
240
292
  /**
241
- * @protected
293
+ * @param {?} context
242
294
  * @return {?}
243
295
  */
244
- Monitor.prototype.onStarted = /**
245
- * @protected
296
+ ContextRegistry.prototype.start = /**
297
+ * @param {?} context
246
298
  * @return {?}
247
299
  */
248
- function () {
249
- this.assertCanStart();
250
- this.currentActiveMonitor.value = this;
300
+ function (context) {
301
+ this._interactions.push(context);
251
302
  };
252
303
  /**
253
- * @private
304
+ * @param {?} context
254
305
  * @return {?}
255
306
  */
256
- Monitor.prototype.assertCanStart = /**
257
- * @private
307
+ ContextRegistry.prototype.finish = /**
308
+ * @param {?} context
258
309
  * @return {?}
259
310
  */
260
- function () {
261
- assert.isFalsey(this.currentActiveMonitor.value);
262
- if (this.exclusiveContext.value && this.interactionContext !== this.exclusiveContext.value) {
263
- lang.illegalState('Interaction started while exclusive lock active. This is usually because you using a different context during place.canDeactivate(interactionContext)');
264
- }
311
+ function (context) {
312
+ this._interactions.remove(context);
265
313
  };
266
314
  /**
267
- * @protected
268
315
  * @return {?}
269
316
  */
270
- Monitor.prototype.onFinished = /**
271
- * @protected
317
+ ContextRegistry.prototype.isActive = /**
272
318
  * @return {?}
273
319
  */
274
320
  function () {
275
- this.assertCurrentlyActive();
276
- this.currentActiveMonitor.value = null;
321
+ return this.active.value;
277
322
  };
278
323
  /**
279
- * @private
324
+ * @param {?} disabled
280
325
  * @return {?}
281
326
  */
282
- Monitor.prototype.assertCurrentlyActive = /**
283
- * @private
327
+ ContextRegistry.prototype.disableWhen = /**
328
+ * @param {?} disabled
284
329
  * @return {?}
285
330
  */
286
- function () {
287
- assert.isTruthy(this.currentActiveMonitor.value === this);
331
+ function (disabled) {
332
+ this._disabledDelegate.setDelegate(disabled);
288
333
  };
289
- return Monitor;
334
+ return ContextRegistry;
290
335
  }(GarbageCollector));
291
- InteractionService.Monitor = Monitor;
336
+ InteractionService.ContextRegistry = ContextRegistry;
292
337
  if (false) {
338
+ /**
339
+ * @type {?}
340
+ * @private
341
+ */
342
+ ContextRegistry.prototype._interactions;
343
+ /**
344
+ * @type {?}
345
+ * @private
346
+ */
347
+ ContextRegistry.prototype._disabledDelegate;
293
348
  /** @type {?} */
294
- Monitor.prototype.id;
295
- /** @type {?} */
296
- Monitor.prototype.interactionContext;
297
- /** @type {?} */
298
- Monitor.prototype.currentActiveMonitor;
349
+ ContextRegistry.prototype.active;
299
350
  /** @type {?} */
300
- Monitor.prototype.exclusiveContext;
351
+ ContextRegistry.prototype.interactionContextIds;
352
+ }
353
+ var ApiAdapter = /** @class */ (function () {
354
+ function ApiAdapter(placeRouter, contextRegistry) {
355
+ this.placeRouter = placeRouter;
356
+ this.contextRegistry = contextRegistry;
357
+ }
358
+ // @Trace()
359
+ // @Trace()
360
+ /**
361
+ * @param {?} context
362
+ * @return {?}
363
+ */
364
+ ApiAdapter.prototype.notifyActive =
365
+ // @Trace()
366
+ /**
367
+ * @param {?} context
368
+ * @return {?}
369
+ */
370
+ function (context) {
371
+ assert.isTruthy(context.identifier);
372
+ this.contextRegistry.start(context);
373
+ return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();
374
+ };
375
+ // @Trace()
376
+ // @Trace()
377
+ /**
378
+ * @private
379
+ * @return {?}
380
+ */
381
+ ApiAdapter.prototype.isNavigationInProgress =
382
+ // @Trace()
383
+ /**
384
+ * @private
385
+ * @return {?}
386
+ */
387
+ function () {
388
+ return this.placeRouter.navigationInProgress.value;
389
+ };
390
+ // @Trace()
391
+ // @Trace()
392
+ /**
393
+ * @param {?} context
394
+ * @return {?}
395
+ */
396
+ ApiAdapter.prototype.notifyFinished =
397
+ // @Trace()
398
+ /**
399
+ * @param {?} context
400
+ * @return {?}
401
+ */
402
+ function (context) {
403
+ this.contextRegistry.finish(context);
404
+ // :: Important ::
405
+ // This method will be traversed by both the place router (during can canDeactivate guards) and user land code
406
+ // (both when routing is idle and while it is active in PlaceComponent.canDeactivate()).
407
+ // The result of pushInteractionIdsToRoute will not start until after the current route finishes, and the
408
+ // current route won't finish until after this promise returns... Deadlock.
409
+ // So in order to keep this logic out of the activities we perform the check here and ensure that
410
+ // any interactions with the context while routing is active returns immediately.
411
+ return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();
412
+ };
413
+ return ApiAdapter;
414
+ }());
415
+ InteractionService.ApiAdapter = ApiAdapter;
416
+ if (false) {
417
+ /**
418
+ * @type {?}
419
+ * @private
420
+ */
421
+ ApiAdapter.prototype.placeRouter;
422
+ /**
423
+ * @type {?}
424
+ * @private
425
+ */
426
+ ApiAdapter.prototype.contextRegistry;
301
427
  }
302
428
  })(InteractionService || (InteractionService = {}));
303
429
  //# sourceMappingURL=interaction.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interaction.service.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/services/interaction.service.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAGL,GAAG,EACH,gBAAgB,EAChB,IAAI,EAEJ,gBAAgB,EAChB,iBAAiB,EAGlB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;;;;IAEjF,mBAAmB,GAAG,CAAC;AAE3B;IAiBE,4BAAqB,8BAA8D;QAA9D,mCAA8B,GAA9B,8BAA8B,CAAgC;QAZlE,YAAO,GAAG,IAAI,gBAAgB,EAAE,CAAC;QAEjC,qBAAgB,GAAG,IAAI,iBAAiB,EAAsB,CAAC;QAE/D,wCAAmC,GAAG,IAAI,iBAAiB,EAA8B,CAAC;QAC1F,yCAAoC,GAAG,IAAI,iBAAiB,EAA8B,CAAC;QAQpG,IAAA,kCAA0F,EAAxF,gBAAK,EAAE,oBAAO,EAAE,kBAAM,EAAE,cAAI,EAAE,gBAAK,EAAE,oBAAO,EAAE,sBAA0C;QAEhG,IAAI,CAAC,yBAAyB,GAAG,KAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC;aAC7E,SAAS,CAAC,IAAI,CAAC,oCAAoC,CAAC;aACpD,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAE/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC/D,IAAI,CAAC,sBAAsB,GAAG,KAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,QA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AyD;;QACzD,mCAAyD;;AA6BzE,CAAC,EAzCgB,kBAAkB,KAAlB,kBAAkB,QAyClC","sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n BooleanValueModelChain,\n Disposable,\n Dsl,\n GarbageCollector,\n lang,\n ListModelChain,\n MutableListModel,\n MutableValueModel,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport { assert } from '@coolon/typescript-utilities';\nimport { InteractionContext } from '../interaction-context';\n\nimport { ModalInteractionContextFactory } from './modal-interaction-context.factory';\n\nlet inplaceMonitorCount = 0;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class InteractionService {\n\n private readonly garbage = new GarbageCollector();\n readonly active: BooleanValueModelChain;\n private readonly exclusiveContext = new MutableValueModel<InteractionContext>();\n\n private readonly _activeModalInteractionContextModel = new MutableValueModel<InteractionService.Monitor>();\n private readonly _activeInlineInteractionContextModel = new MutableValueModel<InteractionService.Monitor>();\n private readonly _activeInteractionContext: ValueModelChain<InteractionContext>;\n\n readonly activeInteractionContextIds: ListModelChain<string>;\n readonly modelInteractionActive: BooleanValueModelChain;\n readonly inlineInteractionActive: BooleanValueModelChain;\n\n constructor(readonly modelInteractionContextFactory: ModalInteractionContextFactory) {\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this.garbage);\n\n this._activeInteractionContext = chain(this._activeModalInteractionContextModel)\n .otherwise(this._activeInlineInteractionContextModel)\n .pluck('interactionContext');\n\n this.active = chain(this._activeInteractionContext).isNotNil();\n this.modelInteractionActive = chain(this._activeModalInteractionContextModel).isNotNil();\n this.inlineInteractionActive = chain(this._activeInlineInteractionContextModel).isNotNil();\n\n // TODO: chain.concat(listOrValueModels) would be nice.\n this.activeInteractionContextIds = chain(new MutableListModel<InteractionService.Monitor>())\n .append(this._activeInlineInteractionContextModel)\n .append(this._activeModalInteractionContextModel)\n .rejectNil()\n .pluck('id');\n\n }\n\n isActive(): boolean {\n return this.active.value;\n }\n\n isModalActive(): boolean {\n return this.modelInteractionActive.value;\n }\n\n /**\n * @deprecated use #createModalInteractionContextDisposedWith instead.\n * @param disposable\n */\n createModalInteractionContextFor(disposable: Disposable.Collector): InteractionContext {\n return this.createModalInteractionContextDisposedWith(disposable);\n }\n\n /**\n * Creates a new model interaction context that will be disposed along with the component.\n * @param disposable\n */\n createModalInteractionContextDisposedWith(disposable: Disposable.Collector): InteractionContext {\n const context = this.modelInteractionContextFactory.createInteractionContext();\n disposable.registerDisposable(new InteractionService.Monitor('modal', context, this._activeModalInteractionContextModel, this.exclusiveContext));\n return context;\n }\n\n _registerInplaceInteractionContext(interactionContext: InteractionContext) {\n interactionContext.registerDisposable(new InteractionService.Monitor(`ip${++inplaceMonitorCount}`, interactionContext, this._activeInlineInteractionContextModel, this.exclusiveContext));\n }\n\n // @Trace()\n getActiveContext(): InteractionContext {\n assert.isTruthy(this.isActive());\n return this._activeInteractionContext.value;\n }\n\n /**\n * Creates an interaction context that will prevent any other contexts from starting an\n * activity until it is disposed. This is intended for use by the router for passing\n * to PlaceComponent.canDeactivate(interactionContext). This ensures components don't\n * try and interact in a way that we can't track and synchronise with the browser back\n * button.\n */\n _createExclusiveModalInteractionContext(): InteractionContext {\n this.exclusiveContext.value = this.modelInteractionContextFactory.createInteractionContext();\n const self = this;\n this.exclusiveContext.value.registerDisposable({\n dispose(): void {\n self.exclusiveContext.value = null;\n }\n });\n return this.exclusiveContext.value;\n }\n}\n\nexport namespace InteractionService {\n\n export interface Callback {\n onStarted(monitor: Monitor);\n\n onFinished(monitor: Monitor);\n }\n\n export class Monitor extends GarbageCollector {\n constructor(readonly id: string,\n readonly interactionContext: InteractionContext,\n readonly currentActiveMonitor: MutableValueModel<Monitor>,\n readonly exclusiveContext: ValueModel<InteractionContext>) {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n when.valueOf(interactionContext.active).becomesTruthy(() => this.onStarted());\n when.valueOf(interactionContext.active).becomesFalsey(() => this.onFinished());\n interactionContext.registerDisposable(this);\n }\n\n protected onStarted() {\n this.assertCanStart();\n this.currentActiveMonitor.value = this;\n }\n\n private assertCanStart() {\n assert.isFalsey(this.currentActiveMonitor.value);\n if (this.exclusiveContext.value && this.interactionContext !== this.exclusiveContext.value) {\n lang.illegalState('Interaction started while exclusive lock active. This is usually because you using a different context during place.canDeactivate(interactionContext)');\n }\n }\n\n protected onFinished() {\n this.assertCurrentlyActive();\n this.currentActiveMonitor.value = null;\n }\n\n private assertCurrentlyActive() {\n assert.isTruthy(this.currentActiveMonitor.value === this);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"interaction.service.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/services/interaction.service.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAEL,oBAAoB,EAEpB,GAAG,EACH,gBAAgB,EAEhB,gBAAgB,EAIjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAItD,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAEzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;;;;IAEjF,mBAAmB,GAAG,CAAC;AAE3B;IAsBE,4BAAqB,8BAA8D;QAA9D,mCAA8B,GAA9B,8BAA8B,CAAgC;QAjBlE,YAAO,GAAG,IAAI,gBAAgB,EAAE,CAAC;;;;QAMjC,0BAAqB,GAAG,IAAI,oBAAoB,EAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAYxF,IAAA,kCAA0F,EAAxF,gBAAK,EAAE,oBAAO,EAAE,kBAAM,EAAE,cAAI,EAAE,gBAAK,EAAE,oBAAO,EAAE,sBAA0C;QAEhG,IAAI,CAAC,4BAA4B,GAAG,IAAI,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAC7E,IAAI,CAAC,wBAAwB,GAAG,IAAI,kBAAkB,CAAC,eAAe,E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GAAyG;YACzG,2EAA2E;YAC3E,iGAAiG;YACjG,iFAAiF;YACjF,OAAO,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,mCAAmC,EAAE,CAAC;QACpH,CAAC;QACH,iBAAC;IAAD,CAAC,AA7BD,IA6BC;IA7BY,6BAAU,aA6BtB,CAAA;;;;;;QA3Ba,iCAAyC;;;;;QAAE,qCAAiD;;AA6B5G,CAAC,EA5FgB,kBAAkB,KAAlB,kBAAkB,QA4FlC","sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n BooleanValueModelChain,\n DelegatingValueModel,\n Disposable,\n Dsl,\n GarbageCollector, ListModel,\n ListModelChain,\n MutableListModel,\n MutableValueModel, Trace,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport { assert } from '@coolon/typescript-utilities';\nimport { PlaceRouter } from '../../place/place-router';\nimport { InPlaceInteractionContextComponent } from '../components/inplace-interaction-context/in-place-interaction-context.component';\nimport { InteractionContext } from '../interaction-context';\nimport { InteractionServiceRoutingAdapter } from './interaction-service-routing-adapter';\n\nimport { ModalInteractionContextFactory } from './modal-interaction-context.factory';\n\nlet inplaceMonitorCount = 0;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class InteractionService {\n\n private readonly garbage = new GarbageCollector();\n readonly active: BooleanValueModelChain;\n\n // private readonly _activeModalContext = new MutableValueModel<InteractionContext>();\n // private readonly _activeInlineContext = new MutableValueModel<InteractionContext>();\n // private readonly _activeContext: ValueModelChain<InteractionContext>;\n private readonly _navigationInProgress = new DelegatingValueModel<boolean>().withDefault(false);\n\n private placeRouter: PlaceRouter;\n private exclusiveInteractionRegistry: InteractionService.ContextRegistry;\n private modalInteractionRegistry: InteractionService.ContextRegistry;\n private inPlaceInteractionRegistry: InteractionService.ContextRegistry;\n private activeModalContext: ValueModelChain<InteractionContext>;\n\n readonly activeInteractionContextIds: ListModelChain<string>;\n readonly inModalInteraction: BooleanValueModelChain;\n\n constructor(readonly modelInteractionContextFactory: ModalInteractionContextFactory) {\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this.garbage);\n\n this.exclusiveInteractionRegistry = new InteractionService.ContextRegistry();\n this.modalInteractionRegistry = new InteractionService.ContextRegistry();\n this.inPlaceInteractionRegistry = new InteractionService.ContextRegistry();\n\n this.modalInteractionRegistry.disableWhen(valueOf.any(\n this.exclusiveInteractionRegistry.active,\n this.modalInteractionRegistry.active\n ).areTruthy());\n\n this.inPlaceInteractionRegistry.disableWhen(valueOf.any(\n this.exclusiveInteractionRegistry.active,\n this.modalInteractionRegistry.active,\n this.inPlaceInteractionRegistry.active\n ).areTruthy());\n\n this.active = valueOf.any(\n this.inPlaceInteractionRegistry.active,\n this.modalInteractionRegistry.active\n ).areTruthy();\n\n\n // TODO: chain.concat(listOrValueModels) would be nice.\n this.activeInteractionContextIds = chain(this.inPlaceInteractionRegistry.interactionContextIds)\n .concat(this.modalInteractionRegistry.interactionContextIds);\n\n this.activeModalContext = chain(this.modalInteractionRegistry.interactionContexts).first();\n this.inModalInteraction = chain(this.activeModalContext).isNotNil();\n\n }\n\n isActive(): boolean {\n return this.active.value;\n }\n\n /**\n * @deprecated use #createModalInteractionContextDisposedWith instead.\n * @param disposable\n */\n createModalInteractionContextFor(disposable: Disposable.Collector): InteractionContext {\n return this.createModalInteractionContextDisposedWith(disposable);\n }\n\n /**\n * Creates a new model interaction context that will be disposed along with the component.\n * @param disposable\n */\n createModalInteractionContextDisposedWith(disposable: Disposable.Collector): InteractionContext {\n // TODO: look at making the registry the factory..\n return this.modelInteractionContextFactory.createInteractionContext('modal', new InteractionService.ApiAdapter(this.placeRouter, this.modalInteractionRegistry));\n }\n\n registerInplaceInteractionContext(interactionContext: InPlaceInteractionContextComponent<any, any, any>) {\n // TODO: look at making the registry the factory..\n // Todo: check for double registration.\n // Todo: allow multiple inplace interactions..\n interactionContext.initialise(`ip${++inplaceMonitorCount}`, new InteractionService.ApiAdapter(this.placeRouter, this.inPlaceInteractionRegistry));\n }\n\n\n // private assertModalCanStart() {\n // assert.isFalsey(this.inExclusiveInteraction.value);\n // assert.isFalsey(this.modalActive.value);\n // }\n //\n // private assertInPlaceCanStart() {\n // assert.isFalsey(this.inExclusiveInteraction.value);\n // assert.isFalsey(this.modalActive.value);\n // assert.isFalsey(this._activeInlineContext.value);\n // }\n\n\n // // @Trace()\n // getActiveContext(): InteractionContext {\n // assert.isTruthy(this.isActive());\n // return this._activeContext.value;\n // }\n\n /**\n * Creates an interaction context that will prevent any other contexts from starting an\n * activity until it is disposed. This is intended for use by the router for passing\n * to PlaceComponent.canDeactivate(interactionContext). This ensures components don't\n * try and interact in a way that we can't track and synchronise with the browser back\n * button.\n */\n registerPlaceRouter(router: PlaceRouter): InteractionServiceRoutingAdapter {\n assert.isFalsey(this.placeRouter);\n this.placeRouter = router;\n this._navigationInProgress.setDelegate(this.placeRouter.navigationInProgress);\n const self = this;\n return new InteractionServiceRoutingAdapter(\n this.activeInteractionContextIds,\n this.activeModalContext,\n () => {\n return self.modelInteractionContextFactory.createInteractionContext('exclusive', new InteractionService.ApiAdapter(this.placeRouter, this.exclusiveInteractionRegistry));\n });\n }\n\n}\n\nexport namespace InteractionService {\n\n export interface Api {\n\n /**\n * Notifies the interaction service that a particular interactionContext has become active. The interaction\n * services will then push changes to the router to track state. If the router is idle, the promise will\n * resolve when the routing has finished updating. Otherwise it will return immediately.\n * @param interactionContext\n */\n notifyActive(interactionContext: InteractionContext): Promise<unknown>;\n\n /**\n * Notifies the interaction service that a particular interactionContext has become idle. The interaction\n * services will then push changes to the router to track state. If the router is idle, the promise will\n * resolve when the routing has finished updating. Otherwise it will return immediately.\n * @param interactionContext\n */\n notifyFinished(interactionContext: InteractionContext): Promise<unknown>;\n }\n\n /**\n * Provides a mechanism for the service to keep track of what the API adapters are doing to\n * ensure the rules are followed, i.e. modal or in-place interaction aren't started while\n * an exclusive routing interaction is active.\n */\n export class ContextRegistry extends GarbageCollector {\n\n private _interactions = new MutableListModel<InteractionContext>();\n private _disabledDelegate = new DelegatingValueModel<boolean>().withDefault(false);\n readonly active: BooleanValueModelChain;\n readonly interactionContextIds: ListModelChain<string>;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.active = chain(this._interactions).isNotEmpty();\n this.interactionContextIds = chain(this._interactions).pluck(\"identifier\");\n }\n\n get interactionContexts():ListModel<InteractionContext> {\n return this._interactions.readonly;\n }\n\n start(context: InteractionContext) {\n this._interactions.push(context);\n }\n\n finish(context: InteractionContext) {\n this._interactions.remove(context);\n }\n\n isActive() {\n return this.active.value;\n }\n\n disableWhen(disabled: ValueModel<boolean>) {\n this._disabledDelegate.setDelegate(disabled);\n }\n }\n\n export class ApiAdapter implements Api {\n\n constructor(private readonly placeRouter: PlaceRouter, private readonly contextRegistry: ContextRegistry) {\n }\n\n // @Trace()\n notifyActive(context: InteractionContext): Promise<any> {\n assert.isTruthy(context.identifier);\n this.contextRegistry.start(context);\n return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();\n }\n\n // @Trace()\n private isNavigationInProgress() {\n return this.placeRouter.navigationInProgress.value;\n }\n\n // @Trace()\n notifyFinished(context: InteractionContext): Promise<any> {\n this.contextRegistry.finish(context);\n // :: Important ::\n // This method will be traversed by both the place router (during can canDeactivate guards) and user land code\n // (both when routing is idle and while it is active in PlaceComponent.canDeactivate()).\n // The result of pushInteractionIdsToRoute will not start until after the current route finishes, and the\n // current route won't finish until after this promise returns... Deadlock.\n // So in order to keep this logic out of the activities we perform the check here and ensure that\n // any interactions with the context while routing is active returns immediately.\n return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();\n }\n }\n\n}\n"]}
@@ -24,15 +24,19 @@ var DialogInteractionContextFactory = /** @class */ (function (_super) {
24
24
  return _this;
25
25
  }
26
26
  /**
27
+ * @param {?} identifier
28
+ * @param {?} api
27
29
  * @return {?}
28
30
  */
29
31
  DialogInteractionContextFactory.prototype.createInteractionContext = /**
32
+ * @param {?} identifier
33
+ * @param {?} api
30
34
  * @return {?}
31
35
  */
32
- function () {
36
+ function (identifier, api) {
33
37
  /** @type {?} */
34
38
  var config = tslib_1.__assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, this.matDialogDefaultConfig, this.dialogServiceDefaults);
35
- return new DialogInteractionContext(this.dialogService, config);
39
+ return new DialogInteractionContext(identifier, api, this.dialogService, config);
36
40
  };
37
41
  DialogInteractionContextFactory.decorators = [
38
42
  { type: Injectable, args: [{
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-interaction-context-factory.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEvF,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;;;;AAExE,MAAM,KAAO,mCAAmC,GAAG,IAAI,cAAc,CAAuB,qCAAqC,CAAC;AAElI;IAGqD,2DAA8B;IAIjF,yCAA6B,aAAwB,EACyB,qBAA2C,EACpD,sBAA4C;QAFjH,YAIE,iBAAO,SAER;QAN4B,mBAAa,GAAb,aAAa,CAAW;QACyB,2BAAqB,GAArB,qBAAqB,CAAsB;QACpD,4BAAsB,GAAtB,sBAAsB,CAAsB;QAG/G,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;;IAC/B,CAAC;;;;IAED,kEAAwB;;;IAAxB;;YACQ,MAAM,sBACV,SAAS,EAAE,KAAK,EAChB,WAAW,EAAE,IAAI,EACjB,iBAAiB,EAAE,KAAK,IACrB,IAAI,CAAC,sBAAsB,EAC3B,IAAI,CAAC,qBAAqB,CAC9B;QAED,OAAO,IAAI,wBAAwB,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;;gBAzBF,UAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;;gBAZQ,SAAS;gBACmB,eAAe,uBAiBrC,QAAQ,YAAI,MAAM,SAAC,mCAAmC;gBAjBhC,eAAe,uBAkBrC,QAAQ,YAAI,MAAM,SAAC,0BAA0B;;;0CApB5D;CAqCC,AA1BD,CAGqD,8BAA8B,GAuBlF;SAvBY,+BAA+B;;;IAE1C,iDAAwC;;;;;IAE5B,wDAAyC;;IACzC,gEAA6G;;IAC7G,iEAAqG","sourcesContent":["import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { MatDialog } from '@angular/material';\nimport { MAT_DIALOG_DEFAULT_OPTIONS, MatDialogConfig } from '@angular/material/dialog';\nimport { BooleanValueModelChain } from '@coolon/pectin';\nimport { assert } from '@coolon/typescript-utilities';\nimport { InteractionContext } from '../../interaction-context';\nimport { ModalInteractionContextFactory } from '../modal-interaction-context.factory';\nimport { DialogInteractionContext } from './dialog-interaction-context';\n\nexport const DIALOG_INTERACTION_SERVICE_DEFAULTS = new InjectionToken<MatDialogConfig<any>>('DIALOG_INTERACTION_SERVICE_DEFAULTS');\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DialogInteractionContextFactory extends ModalInteractionContextFactory {\n\n readonly active: BooleanValueModelChain;\n\n constructor(private readonly dialogService: MatDialog,\n @Optional() @Inject(DIALOG_INTERACTION_SERVICE_DEFAULTS) readonly dialogServiceDefaults: MatDialogConfig<any>,\n @Optional() @Inject(MAT_DIALOG_DEFAULT_OPTIONS) readonly matDialogDefaultConfig: MatDialogConfig<any>\n ) {\n super();\n assert.notNil(dialogService);\n }\n\n createInteractionContext(): InteractionContext {\n const config: MatDialogConfig = {\n autoFocus: false,\n hasBackdrop: true,\n closeOnNavigation: false,\n ...this.matDialogDefaultConfig,\n ...this.dialogServiceDefaults\n };\n\n return new DialogInteractionContext(this.dialogService, config);\n }\n}\n"]}
1
+ {"version":3,"file":"dialog-interaction-context-factory.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEvF,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAItD,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;;;;AAExE,MAAM,KAAO,mCAAmC,GAAG,IAAI,cAAc,CAAuB,qCAAqC,CAAC;AAElI;IAGqD,2DAA8B;IAIjF,yCAA6B,aAAwB,EACyB,qBAA2C,EACpD,sBAA4C;QAFjH,YAIE,iBAAO,SAER;QAN4B,mBAAa,GAAb,aAAa,CAAW;QACyB,2BAAqB,GAArB,qBAAqB,CAAsB;QACpD,4BAAsB,GAAtB,sBAAsB,CAAsB;QAG/G,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;;IAC/B,CAAC;;;;;;IAED,kEAAwB;;;;;IAAxB,UAAyB,UAAkB,EAAE,GAA2B;;YAChE,MAAM,sBACV,SAAS,EAAE,KAAK,EAChB,WAAW,EAAE,IAAI,EACjB,iBAAiB,EAAE,KAAK,IACrB,IAAI,CAAC,sBAAsB,EAC3B,IAAI,CAAC,qBAAqB,CAC9B;QAED,OAAO,IAAI,wBAAwB,CAAC,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACnF,CAAC;;gBAzBF,UAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;;gBAdQ,SAAS;gBACmB,eAAe,uBAmBrC,QAAQ,YAAI,MAAM,SAAC,mCAAmC;gBAnBhC,eAAe,uBAoBrC,QAAQ,YAAI,MAAM,SAAC,0BAA0B;;;0CAtB5D;CAuCC,AA1BD,CAGqD,8BAA8B,GAuBlF;SAvBY,+BAA+B;;;IAE1C,iDAAwC;;;;;IAE5B,wDAAyC;;IACzC,gEAA6G;;IAC7G,iEAAqG","sourcesContent":["import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { MatDialog } from '@angular/material';\nimport { MAT_DIALOG_DEFAULT_OPTIONS, MatDialogConfig } from '@angular/material/dialog';\nimport { BooleanValueModelChain } from '@coolon/pectin';\nimport { assert } from '@coolon/typescript-utilities';\n\nimport { InteractionContext } from '../../interaction-context';\nimport { InteractionService } from '../interaction.service';\nimport { ModalInteractionContextFactory } from '../modal-interaction-context.factory';\nimport { DialogInteractionContext } from './dialog-interaction-context';\n\nexport const DIALOG_INTERACTION_SERVICE_DEFAULTS = new InjectionToken<MatDialogConfig<any>>('DIALOG_INTERACTION_SERVICE_DEFAULTS');\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DialogInteractionContextFactory extends ModalInteractionContextFactory {\n\n readonly active: BooleanValueModelChain;\n\n constructor(private readonly dialogService: MatDialog,\n @Optional() @Inject(DIALOG_INTERACTION_SERVICE_DEFAULTS) readonly dialogServiceDefaults: MatDialogConfig<any>,\n @Optional() @Inject(MAT_DIALOG_DEFAULT_OPTIONS) readonly matDialogDefaultConfig: MatDialogConfig<any>\n ) {\n super();\n assert.notNil(dialogService);\n }\n\n createInteractionContext(identifier: string, api: InteractionService.Api): InteractionContext {\n const config: MatDialogConfig = {\n autoFocus: false,\n hasBackdrop: true,\n closeOnNavigation: false,\n ...this.matDialogDefaultConfig,\n ...this.dialogServiceDefaults\n };\n\n return new DialogInteractionContext(identifier, api, this.dialogService, config);\n }\n}\n"]}