@coolon/angular-ui-powerups 0.0.135 → 1.0.0-alpha.12

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 (419) hide show
  1. package/CHANGELOG.md +303 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js +1142 -6275
  3. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js +16 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/coolon-angular-ui-powerups.js +1 -5
  8. package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
  9. package/esm2015/index.js +1 -5
  10. package/esm2015/index.js.map +1 -1
  11. package/esm2015/lib/angular-ui-powerups.module.js +32 -32
  12. package/esm2015/lib/angular-ui-powerups.module.js.map +1 -1
  13. package/esm2015/lib/angular-ui-powerups.module.metadata.json +1 -1
  14. package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  15. package/esm2015/lib/animations/index.js +1 -5
  16. package/esm2015/lib/animations/index.js.map +1 -1
  17. package/esm2015/lib/animations/slide-animations.js +0 -8
  18. package/esm2015/lib/animations/slide-animations.js.map +1 -1
  19. package/esm2015/lib/components/components.module.js +39 -39
  20. package/esm2015/lib/components/components.module.js.map +1 -1
  21. package/esm2015/lib/components/components.module.metadata.json +1 -1
  22. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  23. package/esm2015/lib/components/disposable-component.js +8 -9
  24. package/esm2015/lib/components/disposable-component.js.map +1 -1
  25. package/esm2015/lib/components/disposable-component.metadata.json +1 -1
  26. package/esm2015/lib/components/forms/abstract-input.component.js +82 -114
  27. package/esm2015/lib/components/forms/abstract-input.component.js.map +1 -1
  28. package/esm2015/lib/components/forms/abstract-input.component.metadata.json +1 -1
  29. package/esm2015/lib/components/forms/number-input/number-input.component.js +12 -18
  30. package/esm2015/lib/components/forms/number-input/number-input.component.js.map +1 -1
  31. package/esm2015/lib/components/forms/password-input/password-input.component.js +12 -18
  32. package/esm2015/lib/components/forms/password-input/password-input.component.js.map +1 -1
  33. package/esm2015/lib/components/forms/select-input/select-input.component.js +38 -57
  34. package/esm2015/lib/components/forms/select-input/select-input.component.js.map +1 -1
  35. package/esm2015/lib/components/forms/select-input/select-input.component.metadata.json +1 -1
  36. package/esm2015/lib/components/forms/string-input/string-input.component.js +19 -41
  37. package/esm2015/lib/components/forms/string-input/string-input.component.js.map +1 -1
  38. package/esm2015/lib/components/index.js +13 -17
  39. package/esm2015/lib/components/index.js.map +1 -1
  40. package/esm2015/lib/components/noop/noop.component.js +12 -15
  41. package/esm2015/lib/components/noop/noop.component.js.map +1 -1
  42. package/esm2015/lib/components/resize-aware.component.js +17 -64
  43. package/esm2015/lib/components/resize-aware.component.js.map +1 -1
  44. package/esm2015/lib/components/resize-aware.component.metadata.json +1 -1
  45. package/esm2015/lib/components/scroll-container/scroll-container.component.js +12 -18
  46. package/esm2015/lib/components/scroll-container/scroll-container.component.js.map +1 -1
  47. package/esm2015/lib/components/types/bounds.class.js +0 -29
  48. package/esm2015/lib/components/types/bounds.class.js.map +1 -1
  49. package/esm2015/lib/components/types/dimension.class.js +0 -14
  50. package/esm2015/lib/components/types/dimension.class.js.map +1 -1
  51. package/esm2015/lib/components/types/point.class.js +0 -23
  52. package/esm2015/lib/components/types/point.class.js.map +1 -1
  53. package/esm2015/lib/directives/command.directive.js +31 -85
  54. package/esm2015/lib/directives/command.directive.js.map +1 -1
  55. package/esm2015/lib/directives/directives.module.js +28 -28
  56. package/esm2015/lib/directives/directives.module.js.map +1 -1
  57. package/esm2015/lib/directives/directives.module.metadata.json +1 -1
  58. package/esm2015/lib/directives/directives.module.ngfactory.js.map +1 -1
  59. package/esm2015/lib/directives/focus-binding.directive.js +41 -96
  60. package/esm2015/lib/directives/focus-binding.directive.js.map +1 -1
  61. package/esm2015/lib/directives/index.js +3 -7
  62. package/esm2015/lib/directives/index.js.map +1 -1
  63. package/esm2015/lib/interaction/abstract-interaction-context.js +4 -73
  64. package/esm2015/lib/interaction/abstract-interaction-context.js.map +1 -1
  65. package/esm2015/lib/interaction/activity-ref.js +2 -79
  66. package/esm2015/lib/interaction/activity-ref.js.map +1 -1
  67. package/esm2015/lib/interaction/activity.js +0 -72
  68. package/esm2015/lib/interaction/activity.js.map +1 -1
  69. package/esm2015/lib/interaction/alert.js +0 -22
  70. package/esm2015/lib/interaction/alert.js.map +1 -1
  71. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +41 -187
  72. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  73. package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js +24 -74
  74. package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -1
  75. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +13 -24
  76. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js.map +1 -1
  77. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +15 -62
  78. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js.map +1 -1
  79. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +13 -27
  80. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js.map +1 -1
  81. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js +16 -71
  82. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -1
  83. package/esm2015/lib/interaction/confirm.js +0 -16
  84. package/esm2015/lib/interaction/confirm.js.map +1 -1
  85. package/esm2015/lib/interaction/index.js +15 -24
  86. package/esm2015/lib/interaction/index.js.map +1 -1
  87. package/esm2015/lib/interaction/interaction-context.js +0 -50
  88. package/esm2015/lib/interaction/interaction-context.js.map +1 -1
  89. package/esm2015/lib/interaction/interaction.module.js +41 -41
  90. package/esm2015/lib/interaction/interaction.module.js.map +1 -1
  91. package/esm2015/lib/interaction/interaction.module.metadata.json +1 -1
  92. package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  93. package/esm2015/lib/interaction/result.js +2 -23
  94. package/esm2015/lib/interaction/result.js.map +1 -1
  95. package/esm2015/lib/interaction/route-synchronisation-adapter.js +0 -16
  96. package/esm2015/lib/interaction/route-synchronisation-adapter.js.map +1 -1
  97. package/esm2015/lib/interaction/services/interaction-service-routing-adapter.js +0 -43
  98. package/esm2015/lib/interaction/services/interaction-service-routing-adapter.js.map +1 -1
  99. package/esm2015/lib/interaction/services/interaction.service.js +22 -172
  100. package/esm2015/lib/interaction/services/interaction.service.js.map +1 -1
  101. package/esm2015/lib/interaction/services/interaction.service.metadata.json +1 -1
  102. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +17 -40
  103. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js.map +1 -1
  104. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.metadata.json +1 -1
  105. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +7 -86
  106. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js.map +1 -1
  107. package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.metadata.json +1 -1
  108. package/esm2015/lib/interaction/services/modal-interaction-context.factory.js +0 -16
  109. package/esm2015/lib/interaction/services/modal-interaction-context.factory.js.map +1 -1
  110. package/esm2015/lib/place/components/abstract-place-navigation.component.js +36 -105
  111. package/esm2015/lib/place/components/abstract-place-navigation.component.js.map +1 -1
  112. package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js +17 -34
  113. package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js.map +1 -1
  114. package/esm2015/lib/place/components/empty-state/empty-state.component.js +12 -18
  115. package/esm2015/lib/place/components/empty-state/empty-state.component.js.map +1 -1
  116. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +16 -33
  117. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
  118. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +52 -240
  119. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  120. package/esm2015/lib/place/components/place-outlet/route-animations.js +0 -12
  121. package/esm2015/lib/place/components/place-outlet/route-animations.js.map +1 -1
  122. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +12 -17
  123. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
  124. package/esm2015/lib/place/guards/consolidated-param-map.js +9 -92
  125. package/esm2015/lib/place/guards/consolidated-param-map.js.map +1 -1
  126. package/esm2015/lib/place/guards/noop-auth-guard.service.js +12 -21
  127. package/esm2015/lib/place/guards/noop-auth-guard.service.js.map +1 -1
  128. package/esm2015/lib/place/guards/noop-auth-guard.service.metadata.json +1 -1
  129. package/esm2015/lib/place/guards/place.guard.js +10 -119
  130. package/esm2015/lib/place/guards/place.guard.js.map +1 -1
  131. package/esm2015/lib/place/index.js +38 -46
  132. package/esm2015/lib/place/index.js.map +1 -1
  133. package/esm2015/lib/place/nav-item.js +0 -22
  134. package/esm2015/lib/place/nav-item.js.map +1 -1
  135. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js +3 -49
  136. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
  137. package/esm2015/lib/place/navigation/session/abstract-pop-state-navigation.js +0 -23
  138. package/esm2015/lib/place/navigation/session/abstract-pop-state-navigation.js.map +1 -1
  139. package/esm2015/lib/place/navigation/session/event-cleanup/event-clean-up-session.js +0 -11
  140. package/esm2015/lib/place/navigation/session/event-cleanup/event-clean-up-session.js.map +1 -1
  141. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js +2 -51
  142. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js.map +1 -1
  143. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js +2 -54
  144. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js.map +1 -1
  145. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js +2 -60
  146. package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js.map +1 -1
  147. package/esm2015/lib/place/navigation/session/interactions/navigating-during-interaction.js +0 -24
  148. package/esm2015/lib/place/navigation/session/interactions/navigating-during-interaction.js.map +1 -1
  149. package/esm2015/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js +1 -19
  150. package/esm2015/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js.map +1 -1
  151. package/esm2015/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js +0 -55
  152. package/esm2015/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js.map +1 -1
  153. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js +4 -60
  154. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -1
  155. package/esm2015/lib/place/navigation/session/navigating.js +0 -31
  156. package/esm2015/lib/place/navigation/session/navigating.js.map +1 -1
  157. package/esm2015/lib/place/navigation/session/navigation-context.js +0 -24
  158. package/esm2015/lib/place/navigation/session/navigation-context.js.map +1 -1
  159. package/esm2015/lib/place/navigation/session/navigation-session.js +12 -178
  160. package/esm2015/lib/place/navigation/session/navigation-session.js.map +1 -1
  161. package/esm2015/lib/place/navigation/session/pop-state-navigation.js +0 -16
  162. package/esm2015/lib/place/navigation/session/pop-state-navigation.js.map +1 -1
  163. package/esm2015/lib/place/place-component.js +22 -107
  164. package/esm2015/lib/place/place-component.js.map +1 -1
  165. package/esm2015/lib/place/place-component.metadata.json +1 -1
  166. package/esm2015/lib/place/place-config.js +0 -13
  167. package/esm2015/lib/place/place-config.js.map +1 -1
  168. package/esm2015/lib/place/place-definition.js +26 -163
  169. package/esm2015/lib/place/place-definition.js.map +1 -1
  170. package/esm2015/lib/place/place-history.js +11 -38
  171. package/esm2015/lib/place/place-history.js.map +1 -1
  172. package/esm2015/lib/place/place-history.metadata.json +1 -1
  173. package/esm2015/lib/place/place-router.js +38 -247
  174. package/esm2015/lib/place/place-router.js.map +1 -1
  175. package/esm2015/lib/place/place-router.metadata.json +1 -1
  176. package/esm2015/lib/place/place.decorator.js +3 -38
  177. package/esm2015/lib/place/place.decorator.js.map +1 -1
  178. package/esm2015/lib/place/place.module.js +40 -42
  179. package/esm2015/lib/place/place.module.js.map +1 -1
  180. package/esm2015/lib/place/place.module.metadata.json +1 -1
  181. package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
  182. package/esm2015/lib/place/route/formatter.js +0 -30
  183. package/esm2015/lib/place/route/formatter.js.map +1 -1
  184. package/esm2015/lib/place/route/json-types.js +0 -12
  185. package/esm2015/lib/place/route/json-types.js.map +1 -1
  186. package/esm2015/lib/place/route/parameter-decorators.js +14 -133
  187. package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
  188. package/esm2015/lib/place/route/parameter-definition.class.js +2 -147
  189. package/esm2015/lib/place/route/parameter-definition.class.js.map +1 -1
  190. package/esm2015/lib/place/route/parameter-sanitiser.js +0 -18
  191. package/esm2015/lib/place/route/parameter-sanitiser.js.map +1 -1
  192. package/esm2015/lib/place/route/parameter-snapshot.js +0 -19
  193. package/esm2015/lib/place/route/parameter-snapshot.js.map +1 -1
  194. package/esm2015/lib/place/route/visit-sanitiser.js +2 -47
  195. package/esm2015/lib/place/route/visit-sanitiser.js.map +1 -1
  196. package/esm2015/lib/place/url-service.js +13 -68
  197. package/esm2015/lib/place/url-service.js.map +1 -1
  198. package/esm2015/lib/place/url-service.metadata.json +1 -1
  199. package/esm2015/lib/place/url-snapshot.js +3 -86
  200. package/esm2015/lib/place/url-snapshot.js.map +1 -1
  201. package/esm2015/lib/place/visit.js +5 -73
  202. package/esm2015/lib/place/visit.js.map +1 -1
  203. package/esm2015/public_api.js +6 -10
  204. package/esm2015/public_api.js.map +1 -1
  205. package/esm5/coolon-angular-ui-powerups.js +1 -5
  206. package/esm5/coolon-angular-ui-powerups.js.map +1 -1
  207. package/esm5/index.js +1 -5
  208. package/esm5/index.js.map +1 -1
  209. package/esm5/lib/angular-ui-powerups.module.js +29 -30
  210. package/esm5/lib/angular-ui-powerups.module.js.map +1 -1
  211. package/esm5/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  212. package/esm5/lib/animations/index.js +1 -5
  213. package/esm5/lib/animations/index.js.map +1 -1
  214. package/esm5/lib/animations/slide-animations.js +0 -8
  215. package/esm5/lib/animations/slide-animations.js.map +1 -1
  216. package/esm5/lib/components/components.module.js +36 -37
  217. package/esm5/lib/components/components.module.js.map +1 -1
  218. package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
  219. package/esm5/lib/components/disposable-component.js +7 -13
  220. package/esm5/lib/components/disposable-component.js.map +1 -1
  221. package/esm5/lib/components/forms/abstract-input.component.js +95 -157
  222. package/esm5/lib/components/forms/abstract-input.component.js.map +1 -1
  223. package/esm5/lib/components/forms/number-input/number-input.component.js +11 -22
  224. package/esm5/lib/components/forms/number-input/number-input.component.js.map +1 -1
  225. package/esm5/lib/components/forms/password-input/password-input.component.js +11 -22
  226. package/esm5/lib/components/forms/password-input/password-input.component.js.map +1 -1
  227. package/esm5/lib/components/forms/select-input/select-input.component.js +38 -61
  228. package/esm5/lib/components/forms/select-input/select-input.component.js.map +1 -1
  229. package/esm5/lib/components/forms/string-input/string-input.component.js +19 -45
  230. package/esm5/lib/components/forms/string-input/string-input.component.js.map +1 -1
  231. package/esm5/lib/components/index.js +13 -17
  232. package/esm5/lib/components/index.js.map +1 -1
  233. package/esm5/lib/components/noop/noop.component.js +9 -13
  234. package/esm5/lib/components/noop/noop.component.js.map +1 -1
  235. package/esm5/lib/components/resize-aware.component.js +21 -80
  236. package/esm5/lib/components/resize-aware.component.js.map +1 -1
  237. package/esm5/lib/components/scroll-container/scroll-container.component.js +10 -20
  238. package/esm5/lib/components/scroll-container/scroll-container.component.js.map +1 -1
  239. package/esm5/lib/components/types/bounds.class.js +3 -30
  240. package/esm5/lib/components/types/bounds.class.js.map +1 -1
  241. package/esm5/lib/components/types/dimension.class.js +0 -10
  242. package/esm5/lib/components/types/dimension.class.js.map +1 -1
  243. package/esm5/lib/components/types/point.class.js +2 -30
  244. package/esm5/lib/components/types/point.class.js.map +1 -1
  245. package/esm5/lib/directives/command.directive.js +37 -103
  246. package/esm5/lib/directives/command.directive.js.map +1 -1
  247. package/esm5/lib/directives/directives.module.js +25 -26
  248. package/esm5/lib/directives/directives.module.js.map +1 -1
  249. package/esm5/lib/directives/directives.module.ngfactory.js.map +1 -1
  250. package/esm5/lib/directives/focus-binding.directive.js +50 -147
  251. package/esm5/lib/directives/focus-binding.directive.js.map +1 -1
  252. package/esm5/lib/directives/index.js +3 -7
  253. package/esm5/lib/directives/index.js.map +1 -1
  254. package/esm5/lib/interaction/abstract-interaction-context.js +7 -114
  255. package/esm5/lib/interaction/abstract-interaction-context.js.map +1 -1
  256. package/esm5/lib/interaction/activity-ref.js +12 -109
  257. package/esm5/lib/interaction/activity-ref.js.map +1 -1
  258. package/esm5/lib/interaction/activity.js +12 -121
  259. package/esm5/lib/interaction/activity.js.map +1 -1
  260. package/esm5/lib/interaction/alert.js +0 -22
  261. package/esm5/lib/interaction/alert.js.map +1 -1
  262. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +64 -330
  263. package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  264. package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js +26 -79
  265. package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -1
  266. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +12 -25
  267. package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js.map +1 -1
  268. package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +17 -72
  269. package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js.map +1 -1
  270. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +13 -32
  271. package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js.map +1 -1
  272. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js +24 -117
  273. package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -1
  274. package/esm5/lib/interaction/confirm.js +0 -16
  275. package/esm5/lib/interaction/confirm.js.map +1 -1
  276. package/esm5/lib/interaction/index.js +15 -24
  277. package/esm5/lib/interaction/index.js.map +1 -1
  278. package/esm5/lib/interaction/interaction-context.js +0 -50
  279. package/esm5/lib/interaction/interaction-context.js.map +1 -1
  280. package/esm5/lib/interaction/interaction.module.js +38 -39
  281. package/esm5/lib/interaction/interaction.module.js.map +1 -1
  282. package/esm5/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  283. package/esm5/lib/interaction/result.js +2 -23
  284. package/esm5/lib/interaction/result.js.map +1 -1
  285. package/esm5/lib/interaction/route-synchronisation-adapter.js +0 -16
  286. package/esm5/lib/interaction/route-synchronisation-adapter.js.map +1 -1
  287. package/esm5/lib/interaction/services/interaction-service-routing-adapter.js +6 -73
  288. package/esm5/lib/interaction/services/interaction-service-routing-adapter.js.map +1 -1
  289. package/esm5/lib/interaction/services/interaction.service.js +33 -290
  290. package/esm5/lib/interaction/services/interaction.service.js.map +1 -1
  291. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +16 -41
  292. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js.map +1 -1
  293. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +14 -109
  294. package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js.map +1 -1
  295. package/esm5/lib/interaction/services/modal-interaction-context.factory.js +1 -23
  296. package/esm5/lib/interaction/services/modal-interaction-context.factory.js.map +1 -1
  297. package/esm5/lib/place/components/abstract-place-navigation.component.js +37 -115
  298. package/esm5/lib/place/components/abstract-place-navigation.component.js.map +1 -1
  299. package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js +16 -37
  300. package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js.map +1 -1
  301. package/esm5/lib/place/components/empty-state/empty-state.component.js +10 -20
  302. package/esm5/lib/place/components/empty-state/empty-state.component.js.map +1 -1
  303. package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js +17 -42
  304. package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
  305. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +64 -314
  306. package/esm5/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  307. package/esm5/lib/place/components/place-outlet/route-animations.js +0 -12
  308. package/esm5/lib/place/components/place-outlet/route-animations.js.map +1 -1
  309. package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +10 -14
  310. package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
  311. package/esm5/lib/place/guards/consolidated-param-map.js +17 -117
  312. package/esm5/lib/place/guards/consolidated-param-map.js.map +1 -1
  313. package/esm5/lib/place/guards/noop-auth-guard.service.js +11 -26
  314. package/esm5/lib/place/guards/noop-auth-guard.service.js.map +1 -1
  315. package/esm5/lib/place/guards/place.guard.js +24 -172
  316. package/esm5/lib/place/guards/place.guard.js.map +1 -1
  317. package/esm5/lib/place/index.js +38 -46
  318. package/esm5/lib/place/index.js.map +1 -1
  319. package/esm5/lib/place/nav-item.js +0 -22
  320. package/esm5/lib/place/nav-item.js.map +1 -1
  321. package/esm5/lib/place/navigation/place-component-deactivation-handler.js +11 -86
  322. package/esm5/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
  323. package/esm5/lib/place/navigation/session/abstract-pop-state-navigation.js +4 -34
  324. package/esm5/lib/place/navigation/session/abstract-pop-state-navigation.js.map +1 -1
  325. package/esm5/lib/place/navigation/session/event-cleanup/event-clean-up-session.js +4 -25
  326. package/esm5/lib/place/navigation/session/event-cleanup/event-clean-up-session.js.map +1 -1
  327. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js +11 -110
  328. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js.map +1 -1
  329. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js +12 -147
  330. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js.map +1 -1
  331. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js +11 -126
  332. package/esm5/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js.map +1 -1
  333. package/esm5/lib/place/navigation/session/interactions/navigating-during-interaction.js +7 -71
  334. package/esm5/lib/place/navigation/session/interactions/navigating-during-interaction.js.map +1 -1
  335. package/esm5/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js +6 -49
  336. package/esm5/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js.map +1 -1
  337. package/esm5/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js +11 -120
  338. package/esm5/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js.map +1 -1
  339. package/esm5/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js +13 -106
  340. package/esm5/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -1
  341. package/esm5/lib/place/navigation/session/navigating.js +6 -53
  342. package/esm5/lib/place/navigation/session/navigating.js.map +1 -1
  343. package/esm5/lib/place/navigation/session/navigation-context.js +0 -17
  344. package/esm5/lib/place/navigation/session/navigation-context.js.map +1 -1
  345. package/esm5/lib/place/navigation/session/navigation-session.js +39 -306
  346. package/esm5/lib/place/navigation/session/navigation-session.js.map +1 -1
  347. package/esm5/lib/place/navigation/session/pop-state-navigation.js +5 -33
  348. package/esm5/lib/place/navigation/session/pop-state-navigation.js.map +1 -1
  349. package/esm5/lib/place/place-component.js +30 -142
  350. package/esm5/lib/place/place-component.js.map +1 -1
  351. package/esm5/lib/place/place-config.js +0 -13
  352. package/esm5/lib/place/place-config.js.map +1 -1
  353. package/esm5/lib/place/place-definition.js +37 -219
  354. package/esm5/lib/place/place-definition.js.map +1 -1
  355. package/esm5/lib/place/place-history.js +11 -56
  356. package/esm5/lib/place/place-history.js.map +1 -1
  357. package/esm5/lib/place/place-router.js +59 -372
  358. package/esm5/lib/place/place-router.js.map +1 -1
  359. package/esm5/lib/place/place.decorator.js +3 -38
  360. package/esm5/lib/place/place.decorator.js.map +1 -1
  361. package/esm5/lib/place/place.module.js +37 -40
  362. package/esm5/lib/place/place.module.js.map +1 -1
  363. package/esm5/lib/place/place.module.ngfactory.js.map +1 -1
  364. package/esm5/lib/place/route/formatter.js +6 -60
  365. package/esm5/lib/place/route/formatter.js.map +1 -1
  366. package/esm5/lib/place/route/json-types.js +0 -12
  367. package/esm5/lib/place/route/json-types.js.map +1 -1
  368. package/esm5/lib/place/route/parameter-decorators.js +14 -133
  369. package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
  370. package/esm5/lib/place/route/parameter-definition.class.js +21 -222
  371. package/esm5/lib/place/route/parameter-definition.class.js.map +1 -1
  372. package/esm5/lib/place/route/parameter-sanitiser.js +0 -18
  373. package/esm5/lib/place/route/parameter-sanitiser.js.map +1 -1
  374. package/esm5/lib/place/route/parameter-snapshot.js +0 -19
  375. package/esm5/lib/place/route/parameter-snapshot.js.map +1 -1
  376. package/esm5/lib/place/route/visit-sanitiser.js +4 -42
  377. package/esm5/lib/place/route/visit-sanitiser.js.map +1 -1
  378. package/esm5/lib/place/url-service.js +20 -119
  379. package/esm5/lib/place/url-service.js.map +1 -1
  380. package/esm5/lib/place/url-snapshot.js +15 -143
  381. package/esm5/lib/place/url-snapshot.js.map +1 -1
  382. package/esm5/lib/place/visit.js +14 -132
  383. package/esm5/lib/place/visit.js.map +1 -1
  384. package/esm5/public_api.js +6 -10
  385. package/esm5/public_api.js.map +1 -1
  386. package/fesm2015/coolon-angular-ui-powerups.js +861 -4526
  387. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  388. package/fesm5/coolon-angular-ui-powerups.js +1129 -6274
  389. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  390. package/lib/components/forms/abstract-input.component.d.ts +9 -9
  391. package/lib/components/resize-aware.component.d.ts +3 -3
  392. package/lib/directives/command.directive.d.ts +4 -2
  393. package/lib/directives/focus-binding.directive.d.ts +1 -1
  394. package/lib/interaction/activity-ref.d.ts +2 -2
  395. package/lib/interaction/activity.d.ts +2 -2
  396. package/lib/interaction/components/activity-container/activity-container.component.d.ts +2 -2
  397. package/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.d.ts +3 -2
  398. package/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.d.ts +1 -1
  399. package/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.d.ts +1 -1
  400. package/lib/interaction/services/interaction.service.d.ts +1 -1
  401. package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.d.ts +1 -1
  402. package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.d.ts +1 -1
  403. package/lib/place/components/place-outlet/place-outlet.component.d.ts +4 -4
  404. package/lib/place/guards/consolidated-param-map.d.ts +1 -1
  405. package/lib/place/navigation/place-component-deactivation-handler.d.ts +2 -2
  406. package/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.d.ts +1 -1
  407. package/lib/place/navigation/session/navigation-session.d.ts +4 -4
  408. package/lib/place/place-component.d.ts +2 -2
  409. package/lib/place/place-router.d.ts +3 -3
  410. package/lib/place/route/formatter.d.ts +4 -3
  411. package/lib/place/route/parameter-definition.class.d.ts +2 -2
  412. package/package.json +10 -10
  413. package/schematics/place-routes/place-builder.js +4 -2
  414. package/schematics/place-routes/place-builder.js.map +1 -1
  415. package/schematics/place-routes/place-class-scanner.d.ts +3 -3
  416. package/schematics/place-routes/place-class-scanner.js +1 -1
  417. package/schematics/place-routes/place-class-scanner.js.map +1 -1
  418. package/schematics/place-routes/place-def.d.ts +9 -9
  419. /package/{styles → assets}/styles.scss +0 -0
@@ -1,8 +1,6 @@
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";
1
+ var PlaceComponent_1;
2
+ import { __decorate, __metadata } from "tslib";
3
+ import { Directive } from '@angular/core';
6
4
  import { assert, Binding, DebugContext, Dsl, Guard, lang, MutableValueModel } from '@coolon/pectin';
7
5
  import { Klass } from '@coolon/typescript-utilities';
8
6
  import { Memoize } from '@typescript-plus/fast-memoize-decorator';
@@ -10,90 +8,46 @@ import 'reflect-metadata';
10
8
  import { DisposableComponent } from '../components/disposable-component';
11
9
  import { PlaceDefinition } from './place-definition';
12
10
  // RAKE: making this Symbol(...) broke things.
13
- /** @type {?} */
14
11
  export const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
15
12
  // this one seems ok.
16
- /** @type {?} */
17
13
  export const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
18
- export class PlaceComponent extends DisposableComponent {
14
+ let PlaceComponent = PlaceComponent_1 = class PlaceComponent extends DisposableComponent {
19
15
  constructor() {
20
16
  super();
21
17
  this.visitModel = new MutableValueModel();
22
18
  this._inVisitUpdate = new Guard();
23
19
  }
24
20
  // @Trace()
25
- /**
26
- * @param {?} visit
27
- * @param {?} notifyVisitChanged
28
- * @return {?}
29
- */
30
21
  initialiseVisit(visit, notifyVisitChanged) {
31
22
  assert.isNil(this.visitModel.value);
32
23
  const { when } = Dsl.disposeWith(this);
33
24
  this.visitModel.value = visit;
34
25
  DebugContext.get(this.visitModel).tag(`${this.placeDefinition.component.name}.visitModel`);
35
- this.placeDefinition.getVisitParameterDefs().forEach((/**
36
- * @param {?} parameterDef
37
- * @return {?}
38
- */
39
- parameterDef => this.installBinding(parameterDef)));
40
- when.valueOf(this.visitModel).changes((/**
41
- * @param {?} current
42
- * @param {?} previous
43
- * @return {?}
44
- */
45
- (current, previous) => {
26
+ this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => this.installBinding(parameterDef));
27
+ when.valueOf(this.visitModel).changes((current, previous) => {
46
28
  notifyVisitChanged(current, previous);
47
- }), { unless: this._inVisitUpdate });
29
+ }, { unless: this._inVisitUpdate });
48
30
  }
49
- /**
50
- * @param {?} visit
51
- * @return {?}
52
- */
53
31
  updateVisit(visit) {
54
32
  assert.isTruthy(this.isInitialised());
55
33
  assert.notNil(visit);
56
- this._inVisitUpdate.whileTrue((/**
57
- * @return {?}
58
- */
59
- () => {
34
+ this._inVisitUpdate.whileTrue(() => {
60
35
  this.visitModel.value = visit;
61
- }));
36
+ });
62
37
  }
63
- /**
64
- * @return {?}
65
- */
66
38
  isInitialised() {
67
39
  return !!this.visitModel.value;
68
40
  }
69
41
  // @Trace()
70
- /**
71
- * @private
72
- * @template T, S
73
- * @param {?} parameterDef
74
- * @return {?}
75
- */
76
42
  installBinding(parameterDef) {
77
- /** @type {?} */
78
- const model = (/** @type {?} */ (this[parameterDef.propertyName]));
43
+ const model = this[parameterDef.propertyName];
79
44
  DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);
80
- /** @type {?} */
81
45
  const binding = this.registerDisposable(new Binding(this.visitModel, model, {
82
- /**
83
- * @param {?} visit
84
- * @return {?}
85
- */
86
46
  toRight(visit) {
87
- /** @type {?} */
88
47
  const value = visit.getParameter(parameterDef.name);
89
48
  console.log('push to component', { name: parameterDef.name, value, visit });
90
49
  return value;
91
50
  },
92
- /**
93
- * @param {?} value
94
- * @param {?=} currentVisit
95
- * @return {?}
96
- */
97
51
  toLeft(value, currentVisit) {
98
52
  console.log('push to route', { name: parameterDef.name, value, currentVisit });
99
53
  return currentVisit.replace(parameterDef, value);
@@ -101,77 +55,38 @@ export class PlaceComponent extends DisposableComponent {
101
55
  }));
102
56
  binding.writeRight();
103
57
  }
104
- /**
105
- * @return {?}
106
- */
107
58
  get placeDefinition() {
108
- return PlaceComponent.getDefinition((/** @type {?} */ ((/** @type {?} */ (this.constructor)))));
59
+ return PlaceComponent_1.getDefinition(this.constructor);
109
60
  }
110
- /**
111
- * @return {?}
112
- */
113
61
  get childPlaces() {
114
- return this.placeDefinition.children.map((/**
115
- * @param {?} d
116
- * @return {?}
117
- */
118
- d => d.component));
62
+ return this.placeDefinition.children.map(d => d.component);
119
63
  }
120
- /**
121
- * @return {?}
122
- */
123
64
  onPlaceReady() {
124
65
  }
125
- }
126
- tslib_1.__decorate([
66
+ };
67
+ __decorate([
127
68
  Memoize(),
128
- tslib_1.__metadata("design:type", PlaceDefinition),
129
- tslib_1.__metadata("design:paramtypes", [])
69
+ __metadata("design:type", PlaceDefinition),
70
+ __metadata("design:paramtypes", [])
130
71
  ], PlaceComponent.prototype, "placeDefinition", null);
131
- if (false) {
132
- /**
133
- * @type {?}
134
- * @private
135
- */
136
- PlaceComponent.prototype.visitModel;
137
- /**
138
- * @type {?}
139
- * @private
140
- */
141
- PlaceComponent.prototype._inVisitUpdate;
142
- /** @type {?} */
143
- PlaceComponent.prototype.interactionContext;
144
- }
72
+ PlaceComponent = PlaceComponent_1 = __decorate([
73
+ Directive(),
74
+ __metadata("design:paramtypes", [])
75
+ ], PlaceComponent);
76
+ export { PlaceComponent };
145
77
  (function (PlaceComponent) {
146
- /**
147
- * @param {?} target
148
- * @return {?}
149
- */
150
78
  function isPlaceComponentConstructor(target) {
151
- return lang.constructorChain((/** @type {?} */ (target))).includes(PlaceComponent);
79
+ return lang.constructorChain(target).includes(PlaceComponent);
152
80
  }
153
81
  PlaceComponent.isPlaceComponentConstructor = isPlaceComponentConstructor;
154
- /**
155
- * @param {?} klass
156
- * @return {?}
157
- */
158
82
  function getRouteParameters(klass) {
159
83
  return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
160
84
  }
161
85
  PlaceComponent.getRouteParameters = getRouteParameters;
162
- /**
163
- * @param {?} klass
164
- * @return {?}
165
- */
166
86
  function getDefinition(klass) {
167
87
  return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
168
88
  }
169
89
  PlaceComponent.getDefinition = getDefinition;
170
- /**
171
- * @param {?} klass
172
- * @param {?} definition
173
- * @return {?}
174
- */
175
90
  function injectDefinition(klass, definition) {
176
91
  Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);
177
92
  }
@@ -1 +1 @@
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;;;;;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AmE1C,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 {\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
+ {"version":3,"file":"place-component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-component.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,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;AAIrD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AACnE,qBAAqB;AACrB,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAGzE,IAAa,cAAc,sBAA3B,MAAa,cAAe,SAAQ,mBAAmB;IASrD;QACE,KAAK,EAAE,CAAC;QARF,eAAU,GAAG,IAAI,iBAAiB,EAAS,CAAC;QAC5C,mBAAc,GAAG,IAAI,KAAK,EAAE,CAAC;IAQrC,CAAC;IAED,WAAW;IACJ,eAAe,CAAC,KAAY,EAAE,kBAA4D;QAC/F,MAAM,CAA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gBAAgB,CAAC,MAA4B,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,CAA+B,CAAC;IAClG,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 { Directive } from '@angular/core';\nimport {\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\n@Directive()\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) as ParameterDefinition<any>[];\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"}],"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"}]}}}}]
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":27,"character":36},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":26,"character":1}}],"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":85,"character":3}}]}],"onPlaceReady":[{"__symbolic":"method"}]}}}}]
@@ -1,16 +1,3 @@
1
- /**
2
- * @fileoverview added by tsickle
3
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
- */
5
1
  import { InjectionToken } from '@angular/core';
6
- /** @type {?} */
7
2
  export const AUP_PLACE_CONFIG = new InjectionToken('AUP_PLACE_CONFIG');
8
- /**
9
- * @record
10
- */
11
- export function PlaceConfig() { }
12
- if (false) {
13
- /** @type {?} */
14
- PlaceConfig.prototype.animationDuration;
15
- }
16
3
  //# sourceMappingURL=place-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"place-config.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-config.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;;AAE/C,MAAM,OAAO,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,CAAC;;;;AAEnF,iCAEC;;;IADC,wCAA0B","sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const AUP_PLACE_CONFIG = new InjectionToken<PlaceConfig>('AUP_PLACE_CONFIG');\n\nexport interface PlaceConfig {\n animationDuration: string;\n}\n"]}
1
+ {"version":3,"file":"place-config.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,CAAC,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const AUP_PLACE_CONFIG = new InjectionToken<PlaceConfig>('AUP_PLACE_CONFIG');\n\nexport interface PlaceConfig {\n animationDuration: string;\n}\n"]}
@@ -1,22 +1,10 @@
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";
1
+ import { __decorate, __metadata } from "tslib";
6
2
  import { assert } from '@coolon/pectin';
7
3
  import { Opts } from '@coolon/typescript-utilities';
8
4
  import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
9
5
  import _ from 'lodash';
10
6
  import { ParameterDefinition } from './route/parameter-definition.class';
11
7
  export class PlaceDefinition {
12
- /**
13
- * @param {?} component
14
- * @param {?} path
15
- * @param {?} authenticate
16
- * @param {?} data
17
- * @param {?} routeParameters
18
- * @param {?} children
19
- */
20
8
  constructor(component, path, authenticate, data, routeParameters, children) {
21
9
  this.component = component;
22
10
  this.path = path;
@@ -25,97 +13,45 @@ export class PlaceDefinition {
25
13
  this.routeParameters = routeParameters;
26
14
  this.children = children;
27
15
  }
28
- /**
29
- * @return {?}
30
- */
31
16
  hasRouteId() {
32
17
  return !!this.getRouteIdParameterDef();
33
18
  }
34
- /**
35
- * @return {?}
36
- */
37
19
  getRouteIdParameterDef() {
38
- return this.routeParameters.find((/**
39
- * @param {?} p
40
- * @return {?}
41
- */
42
- p => p.isRouteId));
20
+ return this.routeParameters.find(p => p.isRouteId);
43
21
  }
44
- /**
45
- * @param {?=} includeRouteId
46
- * @return {?}
47
- */
48
22
  getRouteParameterDefs(includeRouteId = false) {
49
23
  return this.getVisitParameterDefs({ includeRouteId, includeRouteParameters: true });
50
24
  }
51
- /**
52
- * @param {?=} include
53
- * @return {?}
54
- */
55
25
  getVisitParameterDefs(include) {
56
- /** @type {?} */
57
26
  const opts = Opts.get(include);
58
27
  // includes
59
- /** @type {?} */
60
28
  const includeRouteId = !include || opts.getOptional('includeRouteId', false);
61
- /** @type {?} */
62
29
  const includeRouteParameters = !include || opts.getOptional('includeRouteParameters', false);
63
- /** @type {?} */
64
30
  const includeNonRouteParameters = !include || opts.getOptional('includeNonRouteParameters', false);
65
- return this.routeParameters.filter((/**
66
- * @param {?} p
67
- * @return {?}
68
- */
69
- p => {
31
+ return this.routeParameters.filter(p => {
70
32
  return (includeRouteId && p.isRouteId)
71
33
  || (includeRouteParameters && p.isRouteParameter && !p.isRouteId) // route id is included in the line above
72
34
  || (includeNonRouteParameters && !p.isRouteParameter);
73
- }));
35
+ });
74
36
  }
75
- /**
76
- * @template T
77
- * @param {?} key
78
- * @param {?=} defaultValue
79
- * @return {?}
80
- */
81
37
  getPlaceData(key, defaultValue) {
82
38
  return this.data ?
83
39
  _.isNil(this.data[key]) ? defaultValue : this.data[key] :
84
40
  defaultValue;
85
41
  }
86
- /**
87
- * @template T
88
- * @param {?} keys
89
- * @param {?=} defaultValue
90
- * @return {?}
91
- */
92
42
  searchPlaceData(keys, defaultValue) {
93
43
  if (this.data) {
94
- /** @type {?} */
95
- const found = keys.find((/**
96
- * @param {?} key
97
- * @return {?}
98
- */
99
- key => !_.isNil(this.data[key])));
44
+ const found = keys.find(key => !_.isNil(this.data[key]));
100
45
  return found ? this.data[found] : defaultValue;
101
46
  }
102
47
  else {
103
48
  return defaultValue;
104
49
  }
105
50
  }
106
- /**
107
- * @param {?} visit
108
- * @return {?}
109
- */
110
51
  getRouteIdFrom(visit) {
111
- /** @type {?} */
112
52
  const routeIdParameterDef = this.getRouteIdParameterDef();
113
53
  return routeIdParameterDef ? visit.getParameter(routeIdParameterDef.name) : null;
114
54
  }
115
- /**
116
- * @param {?} visit
117
- * @return {?}
118
- */
119
55
  getFormattedRouteId(visit) {
120
56
  // Note: RouteIds are always present in the url and are just empty strings when not defined. This is
121
57
  // mandated by the fact that redirects from <path> to <path>/:id always include the id parameter as
@@ -123,95 +59,51 @@ export class PlaceDefinition {
123
59
  return visit.hasRouteId() ? this.getRouteIdParameterDef().urlFormat.format(visit.getRouteId()) : "";
124
60
  }
125
61
  // @Trace()
126
- /**
127
- * @param {?} visit
128
- * @param {?=} includeRouteId
129
- * @return {?}
130
- */
131
62
  getFormattedRouteParameters(visit, includeRouteId = false) {
132
- /** @type {?} */
133
63
  const result = {};
134
64
  this.getVisitParameterDefs({
135
65
  includeRouteId, includeRouteParameters: true
136
- }).forEach((/**
137
- * @param {?} def
138
- * @return {?}
139
- */
140
- def => {
141
- /** @type {?} */
66
+ }).forEach(def => {
142
67
  const value = visit.getParameter(def.name);
143
68
  if (!def.isEmptyValue(value)) {
144
69
  if (def.isArray) {
145
70
  assert.isArray(value);
146
- result[def.name] = value.map((/**
147
- * @param {?} v
148
- * @return {?}
149
- */
150
- v => def.urlFormat.format(v)));
71
+ result[def.name] = value.map(v => def.urlFormat.format(v));
151
72
  }
152
73
  else {
153
74
  assert.isFalsey(Array.isArray(value));
154
75
  result[def.name] = def.urlFormat.format(value);
155
76
  }
156
77
  }
157
- }));
78
+ });
158
79
  return result;
159
80
  }
160
- /**
161
- * @param {?} visit
162
- * @return {?}
163
- */
164
81
  getNonRouteParameters(visit) {
165
- /** @type {?} */
166
82
  const result = {};
167
- this.getVisitParameterDefs({ includeNonRouteParameters: true }).forEach((/**
168
- * @param {?} def
169
- * @return {?}
170
- */
171
- def => {
172
- /** @type {?} */
83
+ this.getVisitParameterDefs({ includeNonRouteParameters: true }).forEach(def => {
173
84
  const value = visit.getParameter(def.name);
174
85
  if (!def.isEmptyValue(value)) {
175
86
  result[def.name] = value;
176
87
  }
177
- }));
88
+ });
178
89
  return result;
179
90
  }
180
91
  // @Trace()
181
- /**
182
- * @param {?} params
183
- * @return {?}
184
- */
185
92
  parseRouteParams(params) {
186
- /** @type {?} */
187
93
  const result = {};
188
94
  this.getVisitParameterDefs({
189
95
  includeRouteId: true,
190
96
  includeRouteParameters: true,
191
97
  includeNonRouteParameters: false
192
- }).forEach((/**
193
- * @param {?} def
194
- * @return {?}
195
- */
196
- def => {
98
+ }).forEach(def => {
197
99
  // params will return null for non existent names
198
100
  if (params.has(def.name)) {
199
101
  if (def.isArray) {
200
102
  // const values = params.getAll(def.name); // TODO: EEEK getAll is returning ["1,2,3,4"] when we gave it ["1","2","3","4"].
201
- /** @type {?} */
202
- const values = params.get(def.name).split(',').map((/**
203
- * @param {?} s
204
- * @return {?}
205
- */
206
- s => s.trim()));
207
- result[def.name] = values.map((/**
208
- * @param {?} v
209
- * @return {?}
210
- */
211
- v => def.urlFormat.parse(v)));
103
+ const values = params.get(def.name).split(',').map(s => s.trim());
104
+ result[def.name] = values.map(v => def.urlFormat.parse(v));
212
105
  }
213
106
  else {
214
- /** @type {?} */
215
107
  const value = params.get(def.name);
216
108
  if (def.isRouteId) { // TODO: Move this to parameter def so it's a strategy pattern
217
109
  // because our id routes redirect if the id isn't present we always have a id
@@ -226,55 +118,26 @@ export class PlaceDefinition {
226
118
  }
227
119
  }
228
120
  }
229
- }));
121
+ });
230
122
  return result;
231
123
  }
232
124
  }
233
- tslib_1.__decorate([
125
+ __decorate([
234
126
  Memoize(),
235
- tslib_1.__metadata("design:type", Function),
236
- tslib_1.__metadata("design:paramtypes", []),
237
- tslib_1.__metadata("design:returntype", ParameterDefinition)
127
+ __metadata("design:type", Function),
128
+ __metadata("design:paramtypes", []),
129
+ __metadata("design:returntype", ParameterDefinition)
238
130
  ], PlaceDefinition.prototype, "getRouteIdParameterDef", null);
239
- tslib_1.__decorate([
131
+ __decorate([
240
132
  Memoize(),
241
- tslib_1.__metadata("design:type", Function),
242
- tslib_1.__metadata("design:paramtypes", [Object]),
243
- tslib_1.__metadata("design:returntype", Array)
133
+ __metadata("design:type", Function),
134
+ __metadata("design:paramtypes", [Object]),
135
+ __metadata("design:returntype", Array)
244
136
  ], PlaceDefinition.prototype, "getRouteParameterDefs", null);
245
- tslib_1.__decorate([
137
+ __decorate([
246
138
  Memoize(),
247
- tslib_1.__metadata("design:type", Function),
248
- tslib_1.__metadata("design:paramtypes", [Object]),
249
- tslib_1.__metadata("design:returntype", Array)
139
+ __metadata("design:type", Function),
140
+ __metadata("design:paramtypes", [Object]),
141
+ __metadata("design:returntype", Array)
250
142
  ], PlaceDefinition.prototype, "getVisitParameterDefs", null);
251
- if (false) {
252
- /** @type {?} */
253
- PlaceDefinition.prototype.component;
254
- /** @type {?} */
255
- PlaceDefinition.prototype.path;
256
- /** @type {?} */
257
- PlaceDefinition.prototype.authenticate;
258
- /** @type {?} */
259
- PlaceDefinition.prototype.data;
260
- /** @type {?} */
261
- PlaceDefinition.prototype.routeParameters;
262
- /** @type {?} */
263
- PlaceDefinition.prototype.children;
264
- }
265
- (function (PlaceDefinition) {
266
- /**
267
- * @record
268
- */
269
- function ParameterOptions() { }
270
- PlaceDefinition.ParameterOptions = ParameterOptions;
271
- if (false) {
272
- /** @type {?|undefined} */
273
- ParameterOptions.prototype.includeRouteId;
274
- /** @type {?|undefined} */
275
- ParameterOptions.prototype.includeRouteParameters;
276
- /** @type {?|undefined} */
277
- ParameterOptions.prototype.includeNonRouteParameters;
278
- }
279
- })(PlaceDefinition || (PlaceDefinition = {}));
280
143
  //# sourceMappingURL=place-definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"place-definition.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-definition.ts"],"names":[],"mappings":";;;;;AACA,OAAO,EAAE,MAAM,EAAwB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAGzE,MAAM,OAAO,eAAe;;;;;;;;;IAE1B,YAAqB,SAAwC,EACxC,IAAY,EACZ,YAAqB,EACrB,IAA4B,EAC5B,eAA2C,EAC3C,QAA2B;QAL3B,cAAS,GAAT,SAAS,CAA+B;QACxC,SAAI,GAAJ,IAAI,C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;AAGD;IADC,OAAO,EAAE;;;;4DAYT;;;IAlCW,oCAAiD;;IACjD,+BAAqB;;IACrB,uCAA8B;;IAC9B,+BAAqC;;IACrC,0CAAoD;;IACpD,mCAAoC;;AA2HlD,WAAiB,eAAe;;;;IAC9B,+BAIC;;;;QAHC,0CAAyB;;QACzB,kDAAiC;;QACjC,qDAAoC;;AAExC,CAAC,EANgB,eAAe,KAAf,eAAe,QAM/B","sourcesContent":["import { ParamMap } from '@angular/router';\nimport { assert, Constructable, Trace } from '@coolon/pectin';\nimport { Opts } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport _ from 'lodash';\nimport { PlaceComponent } from './place-component';\nimport { ParameterDefinition } from './route/parameter-definition.class';\nimport { Visit } from './visit';\n\nexport class PlaceDefinition {\n\n constructor(readonly component: Constructable<PlaceComponent>,\n readonly path: string,\n readonly authenticate: boolean,\n readonly data: { [key: string]: any },\n readonly routeParameters: ParameterDefinition<any>[],\n readonly children: PlaceDefinition[]) {\n }\n\n hasRouteId() {\n return !!this.getRouteIdParameterDef();\n }\n\n @Memoize()\n getRouteIdParameterDef(): ParameterDefinition<any> {\n return this.routeParameters.find(p => p.isRouteId);\n }\n\n @Memoize()\n getRouteParameterDefs(includeRouteId = false): ParameterDefinition<any>[] {\n return this.getVisitParameterDefs({ includeRouteId, includeRouteParameters: true });\n }\n\n @Memoize()\n getVisitParameterDefs(include?: PlaceDefinition.ParameterOptions): ParameterDefinition<any>[] {\n const opts = Opts.get(include);\n // includes\n const includeRouteId = !include || opts.getOptional('includeRouteId', false);\n const includeRouteParameters = !include || opts.getOptional('includeRouteParameters', false);\n const includeNonRouteParameters = !include || opts.getOptional('includeNonRouteParameters', false);\n return this.routeParameters.filter(p => {\n return (includeRouteId && p.isRouteId)\n || (includeRouteParameters && p.isRouteParameter && !p.isRouteId) // route id is included in the line above\n || (includeNonRouteParameters && !p.isRouteParameter);\n });\n }\n\n getPlaceData<T>(key: string, defaultValue?: T): T {\n return this.data ?\n _.isNil(this.data[key]) ? defaultValue : this.data[key] :\n defaultValue;\n }\n\n searchPlaceData<T>(keys: string[], defaultValue?: T): T {\n if (this.data) {\n const found = keys.find(key => !_.isNil(this.data[key]));\n return found ? this.data[found] : defaultValue;\n } else {\n return defaultValue;\n }\n }\n\n getRouteIdFrom(visit: Visit) {\n const routeIdParameterDef = this.getRouteIdParameterDef();\n return routeIdParameterDef ? visit.getParameter(routeIdParameterDef.name) : null;\n }\n\n getFormattedRouteId(visit: Visit): any {\n // Note: RouteIds are always present in the url and are just empty strings when not defined. This is\n // mandated by the fact that redirects from <path> to <path>/:id always include the id parameter as\n // an empty string.\n return visit.hasRouteId() ? this.getRouteIdParameterDef().urlFormat.format(visit.getRouteId()) : \"\";\n }\n\n // @Trace()\n getFormattedRouteParameters(visit: Visit, includeRouteId = false): { [p: string]: string } {\n const result: { [p: string]: string } = {};\n this.getVisitParameterDefs({\n includeRouteId, includeRouteParameters: true\n }).forEach(def => {\n const value = visit.getParameter(def.name);\n if (!def.isEmptyValue(value)) {\n if (def.isArray) {\n assert.isArray(value);\n result[def.name] = value.map(v => def.urlFormat.format(v));\n } else {\n assert.isFalsey(Array.isArray(value));\n result[def.name] = def.urlFormat.format(value);\n }\n }\n });\n return result;\n }\n\n getNonRouteParameters(visit: Visit): { [p: string]: string } {\n const result: { [p: string]: string } = {};\n this.getVisitParameterDefs({ includeNonRouteParameters: true }).forEach(def => {\n const value = visit.getParameter(def.name);\n if (!def.isEmptyValue(value)) {\n result[def.name] = value;\n }\n });\n return result;\n }\n\n // @Trace()\n parseRouteParams(params: ParamMap): { [p: string]: any } {\n const result: { [p: string]: any } = {};\n this.getVisitParameterDefs({\n includeRouteId: true,\n includeRouteParameters: true,\n includeNonRouteParameters: false\n }).forEach(def => {\n // params will return null for non existent names\n if (params.has(def.name)) {\n if (def.isArray) {\n // const values = params.getAll(def.name); // TODO: EEEK getAll is returning [\"1,2,3,4\"] when we gave it [\"1\",\"2\",\"3\",\"4\"].\n const values = params.get(def.name).split(',').map(s => s.trim());\n result[def.name] = values.map(v => def.urlFormat.parse(v));\n } else {\n const value = params.get(def.name);\n if (def.isRouteId) { // TODO: Move this to parameter def so it's a strategy pattern\n // because our id routes redirect if the id isn't present we always have a id\n // parameter in our params. This will bugger our remember and defaultvalue sanitisation\n // as it'll see that the id is present (event thought its a blank string).\n if (!_.isEmpty(value)) {\n result[def.name] = def.urlFormat.parse(value);\n }\n } else {\n result[def.name] = def.urlFormat.parse(value);\n }\n }\n }\n });\n return result;\n }\n\n}\n\nexport namespace PlaceDefinition {\n export interface ParameterOptions {\n includeRouteId?: boolean;\n includeRouteParameters?: boolean;\n includeNonRouteParameters?: boolean;\n }\n}\n"]}
1
+ {"version":3,"file":"place-definition.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-definition.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAwB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAGzE,MAAM,OAAO,eAAe;IAE1B,YAAqB,SAAwC,EACxC,IAAY,EACZ,YAAqB,EACrB,IAA4B,EAC5B,eAA2C,EAC3C,QAA2B;QAL3B,cAAS,GAAT,SAAS,CAA+B;QACxC,SAAI,GAAJ,IAAI,CAAQ;QACZ,iBAAY,GAAZ,YAAY,CAAS;QACrB,SAAI,GAAJ,IAAI,CAAwB;QAC5B,oBAAe,GAAf,eAAe,CAA4B;QAC3C,aAAQ,GAAR,QAAQ,CAAmB;IAChD,CAAC;IAED,UAAU;QACR,OAAO,CAAC,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;IACzC,CAAC;IAGD,sBAAsB;QACpB,OAAO,IAAI,C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AC,IAAI,CAAC,EAAE;gBACxB,IAAI,GAAG,CAAC,OAAO,EAAE;oBACf,2HAA2H;oBAC3H,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;oBAClE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC5D;qBAAM;oBACL,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBACnC,IAAI,GAAG,CAAC,SAAS,EAAE,EAAE,8DAA8D;wBACjF,6EAA6E;wBAC7E,wFAAwF;wBACxF,0EAA0E;wBAC1E,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;4BACrB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;yBAC/C;qBACF;yBAAM;wBACL,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;qBAC/C;iBACF;aACF;QACH,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CAEF;AAjHC;IADC,OAAO,EAAE;;;oCACgB,mBAAmB;6DAE5C;AAGD;IADC,OAAO,EAAE;;;;4DAGT;AAGD;IADC,OAAO,EAAE;;;;4DAYT","sourcesContent":["import { ParamMap } from '@angular/router';\nimport { assert, Constructable, Trace } from '@coolon/pectin';\nimport { Opts } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport _ from 'lodash';\nimport { PlaceComponent } from './place-component';\nimport { ParameterDefinition } from './route/parameter-definition.class';\nimport { Visit } from './visit';\n\nexport class PlaceDefinition {\n\n constructor(readonly component: Constructable<PlaceComponent>,\n readonly path: string,\n readonly authenticate: boolean,\n readonly data: { [key: string]: any },\n readonly routeParameters: ParameterDefinition<any>[],\n readonly children: PlaceDefinition[]) {\n }\n\n hasRouteId() {\n return !!this.getRouteIdParameterDef();\n }\n\n @Memoize()\n getRouteIdParameterDef(): ParameterDefinition<any> {\n return this.routeParameters.find(p => p.isRouteId);\n }\n\n @Memoize()\n getRouteParameterDefs(includeRouteId = false): ParameterDefinition<any>[] {\n return this.getVisitParameterDefs({ includeRouteId, includeRouteParameters: true });\n }\n\n @Memoize()\n getVisitParameterDefs(include?: PlaceDefinition.ParameterOptions): ParameterDefinition<any>[] {\n const opts = Opts.get(include);\n // includes\n const includeRouteId = !include || opts.getOptional('includeRouteId', false);\n const includeRouteParameters = !include || opts.getOptional('includeRouteParameters', false);\n const includeNonRouteParameters = !include || opts.getOptional('includeNonRouteParameters', false);\n return this.routeParameters.filter(p => {\n return (includeRouteId && p.isRouteId)\n || (includeRouteParameters && p.isRouteParameter && !p.isRouteId) // route id is included in the line above\n || (includeNonRouteParameters && !p.isRouteParameter);\n });\n }\n\n getPlaceData<T>(key: string, defaultValue?: T): T {\n return this.data ?\n _.isNil(this.data[key]) ? defaultValue : this.data[key] :\n defaultValue;\n }\n\n searchPlaceData<T>(keys: string[], defaultValue?: T): T {\n if (this.data) {\n const found = keys.find(key => !_.isNil(this.data[key]));\n return found ? this.data[found] : defaultValue;\n } else {\n return defaultValue;\n }\n }\n\n getRouteIdFrom(visit: Visit) {\n const routeIdParameterDef = this.getRouteIdParameterDef();\n return routeIdParameterDef ? visit.getParameter(routeIdParameterDef.name) : null;\n }\n\n getFormattedRouteId(visit: Visit): any {\n // Note: RouteIds are always present in the url and are just empty strings when not defined. This is\n // mandated by the fact that redirects from <path> to <path>/:id always include the id parameter as\n // an empty string.\n return visit.hasRouteId() ? this.getRouteIdParameterDef().urlFormat.format(visit.getRouteId()) : \"\";\n }\n\n // @Trace()\n getFormattedRouteParameters(visit: Visit, includeRouteId = false): { [p: string]: string } {\n const result: { [p: string]: string } = {};\n this.getVisitParameterDefs({\n includeRouteId, includeRouteParameters: true\n }).forEach(def => {\n const value = visit.getParameter(def.name);\n if (!def.isEmptyValue(value)) {\n if (def.isArray) {\n assert.isArray(value);\n result[def.name] = value.map(v => def.urlFormat.format(v));\n } else {\n assert.isFalsey(Array.isArray(value));\n result[def.name] = def.urlFormat.format(value);\n }\n }\n });\n return result;\n }\n\n getNonRouteParameters(visit: Visit): { [p: string]: string } {\n const result: { [p: string]: string } = {};\n this.getVisitParameterDefs({ includeNonRouteParameters: true }).forEach(def => {\n const value = visit.getParameter(def.name);\n if (!def.isEmptyValue(value)) {\n result[def.name] = value;\n }\n });\n return result;\n }\n\n // @Trace()\n parseRouteParams(params: ParamMap): { [p: string]: any } {\n const result: { [p: string]: any } = {};\n this.getVisitParameterDefs({\n includeRouteId: true,\n includeRouteParameters: true,\n includeNonRouteParameters: false\n }).forEach(def => {\n // params will return null for non existent names\n if (params.has(def.name)) {\n if (def.isArray) {\n // const values = params.getAll(def.name); // TODO: EEEK getAll is returning [\"1,2,3,4\"] when we gave it [\"1\",\"2\",\"3\",\"4\"].\n const values = params.get(def.name).split(',').map(s => s.trim());\n result[def.name] = values.map(v => def.urlFormat.parse(v));\n } else {\n const value = params.get(def.name);\n if (def.isRouteId) { // TODO: Move this to parameter def so it's a strategy pattern\n // because our id routes redirect if the id isn't present we always have a id\n // parameter in our params. This will bugger our remember and defaultvalue sanitisation\n // as it'll see that the id is present (event thought its a blank string).\n if (!_.isEmpty(value)) {\n result[def.name] = def.urlFormat.parse(value);\n }\n } else {\n result[def.name] = def.urlFormat.parse(value);\n }\n }\n }\n });\n return result;\n }\n\n}\n\nexport namespace PlaceDefinition {\n export interface ParameterOptions {\n includeRouteId?: boolean;\n includeRouteParameters?: boolean;\n includeNonRouteParameters?: boolean;\n }\n}\n"]}