@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.
- package/CHANGELOG.md +303 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +1142 -6275
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +16 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +1 -5
- package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/esm2015/index.js +1 -5
- package/esm2015/index.js.map +1 -1
- package/esm2015/lib/angular-ui-powerups.module.js +32 -32
- package/esm2015/lib/angular-ui-powerups.module.js.map +1 -1
- package/esm2015/lib/angular-ui-powerups.module.metadata.json +1 -1
- package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
- package/esm2015/lib/animations/index.js +1 -5
- package/esm2015/lib/animations/index.js.map +1 -1
- package/esm2015/lib/animations/slide-animations.js +0 -8
- package/esm2015/lib/animations/slide-animations.js.map +1 -1
- package/esm2015/lib/components/components.module.js +39 -39
- package/esm2015/lib/components/components.module.js.map +1 -1
- package/esm2015/lib/components/components.module.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/disposable-component.js +8 -9
- package/esm2015/lib/components/disposable-component.js.map +1 -1
- package/esm2015/lib/components/disposable-component.metadata.json +1 -1
- package/esm2015/lib/components/forms/abstract-input.component.js +82 -114
- package/esm2015/lib/components/forms/abstract-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.js +12 -18
- package/esm2015/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.js +12 -18
- package/esm2015/lib/components/forms/password-input/password-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/select-input/select-input.component.js +38 -57
- package/esm2015/lib/components/forms/select-input/select-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/select-input/select-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/string-input/string-input.component.js +19 -41
- package/esm2015/lib/components/forms/string-input/string-input.component.js.map +1 -1
- package/esm2015/lib/components/index.js +13 -17
- package/esm2015/lib/components/index.js.map +1 -1
- package/esm2015/lib/components/noop/noop.component.js +12 -15
- package/esm2015/lib/components/noop/noop.component.js.map +1 -1
- package/esm2015/lib/components/resize-aware.component.js +17 -64
- package/esm2015/lib/components/resize-aware.component.js.map +1 -1
- package/esm2015/lib/components/resize-aware.component.metadata.json +1 -1
- package/esm2015/lib/components/scroll-container/scroll-container.component.js +12 -18
- package/esm2015/lib/components/scroll-container/scroll-container.component.js.map +1 -1
- package/esm2015/lib/components/types/bounds.class.js +0 -29
- package/esm2015/lib/components/types/bounds.class.js.map +1 -1
- package/esm2015/lib/components/types/dimension.class.js +0 -14
- package/esm2015/lib/components/types/dimension.class.js.map +1 -1
- package/esm2015/lib/components/types/point.class.js +0 -23
- package/esm2015/lib/components/types/point.class.js.map +1 -1
- package/esm2015/lib/directives/command.directive.js +31 -85
- package/esm2015/lib/directives/command.directive.js.map +1 -1
- package/esm2015/lib/directives/directives.module.js +28 -28
- package/esm2015/lib/directives/directives.module.js.map +1 -1
- package/esm2015/lib/directives/directives.module.metadata.json +1 -1
- package/esm2015/lib/directives/directives.module.ngfactory.js.map +1 -1
- package/esm2015/lib/directives/focus-binding.directive.js +41 -96
- package/esm2015/lib/directives/focus-binding.directive.js.map +1 -1
- package/esm2015/lib/directives/index.js +3 -7
- package/esm2015/lib/directives/index.js.map +1 -1
- package/esm2015/lib/interaction/abstract-interaction-context.js +4 -73
- package/esm2015/lib/interaction/abstract-interaction-context.js.map +1 -1
- package/esm2015/lib/interaction/activity-ref.js +2 -79
- package/esm2015/lib/interaction/activity-ref.js.map +1 -1
- package/esm2015/lib/interaction/activity.js +0 -72
- package/esm2015/lib/interaction/activity.js.map +1 -1
- package/esm2015/lib/interaction/alert.js +0 -22
- package/esm2015/lib/interaction/alert.js.map +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +41 -187
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js +24 -74
- package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -1
- package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +13 -24
- package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js.map +1 -1
- package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +15 -62
- package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js.map +1 -1
- package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +13 -27
- package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js.map +1 -1
- package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js +16 -71
- package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -1
- package/esm2015/lib/interaction/confirm.js +0 -16
- package/esm2015/lib/interaction/confirm.js.map +1 -1
- package/esm2015/lib/interaction/index.js +15 -24
- package/esm2015/lib/interaction/index.js.map +1 -1
- package/esm2015/lib/interaction/interaction-context.js +0 -50
- package/esm2015/lib/interaction/interaction-context.js.map +1 -1
- package/esm2015/lib/interaction/interaction.module.js +41 -41
- package/esm2015/lib/interaction/interaction.module.js.map +1 -1
- package/esm2015/lib/interaction/interaction.module.metadata.json +1 -1
- package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/esm2015/lib/interaction/result.js +2 -23
- package/esm2015/lib/interaction/result.js.map +1 -1
- package/esm2015/lib/interaction/route-synchronisation-adapter.js +0 -16
- package/esm2015/lib/interaction/route-synchronisation-adapter.js.map +1 -1
- package/esm2015/lib/interaction/services/interaction-service-routing-adapter.js +0 -43
- package/esm2015/lib/interaction/services/interaction-service-routing-adapter.js.map +1 -1
- package/esm2015/lib/interaction/services/interaction.service.js +22 -172
- package/esm2015/lib/interaction/services/interaction.service.js.map +1 -1
- package/esm2015/lib/interaction/services/interaction.service.metadata.json +1 -1
- package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +17 -40
- package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js.map +1 -1
- package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.metadata.json +1 -1
- package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +7 -86
- package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js.map +1 -1
- package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.metadata.json +1 -1
- package/esm2015/lib/interaction/services/modal-interaction-context.factory.js +0 -16
- package/esm2015/lib/interaction/services/modal-interaction-context.factory.js.map +1 -1
- package/esm2015/lib/place/components/abstract-place-navigation.component.js +36 -105
- package/esm2015/lib/place/components/abstract-place-navigation.component.js.map +1 -1
- package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js +17 -34
- package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js.map +1 -1
- package/esm2015/lib/place/components/empty-state/empty-state.component.js +12 -18
- package/esm2015/lib/place/components/empty-state/empty-state.component.js.map +1 -1
- package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +16 -33
- package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +52 -240
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
- package/esm2015/lib/place/components/place-outlet/route-animations.js +0 -12
- package/esm2015/lib/place/components/place-outlet/route-animations.js.map +1 -1
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +12 -17
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
- package/esm2015/lib/place/guards/consolidated-param-map.js +9 -92
- package/esm2015/lib/place/guards/consolidated-param-map.js.map +1 -1
- package/esm2015/lib/place/guards/noop-auth-guard.service.js +12 -21
- package/esm2015/lib/place/guards/noop-auth-guard.service.js.map +1 -1
- package/esm2015/lib/place/guards/noop-auth-guard.service.metadata.json +1 -1
- package/esm2015/lib/place/guards/place.guard.js +10 -119
- package/esm2015/lib/place/guards/place.guard.js.map +1 -1
- package/esm2015/lib/place/index.js +38 -46
- package/esm2015/lib/place/index.js.map +1 -1
- package/esm2015/lib/place/nav-item.js +0 -22
- package/esm2015/lib/place/nav-item.js.map +1 -1
- package/esm2015/lib/place/navigation/place-component-deactivation-handler.js +3 -49
- package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
- package/esm2015/lib/place/navigation/session/abstract-pop-state-navigation.js +0 -23
- package/esm2015/lib/place/navigation/session/abstract-pop-state-navigation.js.map +1 -1
- package/esm2015/lib/place/navigation/session/event-cleanup/event-clean-up-session.js +0 -11
- package/esm2015/lib/place/navigation/session/event-cleanup/event-clean-up-session.js.map +1 -1
- package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js +2 -51
- package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js.map +1 -1
- package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js +2 -54
- package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js.map +1 -1
- package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js +2 -60
- package/esm2015/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js.map +1 -1
- package/esm2015/lib/place/navigation/session/interactions/navigating-during-interaction.js +0 -24
- package/esm2015/lib/place/navigation/session/interactions/navigating-during-interaction.js.map +1 -1
- package/esm2015/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js +1 -19
- package/esm2015/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js.map +1 -1
- package/esm2015/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js +0 -55
- package/esm2015/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js.map +1 -1
- package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js +4 -60
- package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -1
- package/esm2015/lib/place/navigation/session/navigating.js +0 -31
- package/esm2015/lib/place/navigation/session/navigating.js.map +1 -1
- package/esm2015/lib/place/navigation/session/navigation-context.js +0 -24
- package/esm2015/lib/place/navigation/session/navigation-context.js.map +1 -1
- package/esm2015/lib/place/navigation/session/navigation-session.js +12 -178
- package/esm2015/lib/place/navigation/session/navigation-session.js.map +1 -1
- package/esm2015/lib/place/navigation/session/pop-state-navigation.js +0 -16
- package/esm2015/lib/place/navigation/session/pop-state-navigation.js.map +1 -1
- package/esm2015/lib/place/place-component.js +22 -107
- package/esm2015/lib/place/place-component.js.map +1 -1
- package/esm2015/lib/place/place-component.metadata.json +1 -1
- package/esm2015/lib/place/place-config.js +0 -13
- package/esm2015/lib/place/place-config.js.map +1 -1
- package/esm2015/lib/place/place-definition.js +26 -163
- package/esm2015/lib/place/place-definition.js.map +1 -1
- package/esm2015/lib/place/place-history.js +11 -38
- package/esm2015/lib/place/place-history.js.map +1 -1
- package/esm2015/lib/place/place-history.metadata.json +1 -1
- package/esm2015/lib/place/place-router.js +38 -247
- package/esm2015/lib/place/place-router.js.map +1 -1
- package/esm2015/lib/place/place-router.metadata.json +1 -1
- package/esm2015/lib/place/place.decorator.js +3 -38
- package/esm2015/lib/place/place.decorator.js.map +1 -1
- package/esm2015/lib/place/place.module.js +40 -42
- package/esm2015/lib/place/place.module.js.map +1 -1
- package/esm2015/lib/place/place.module.metadata.json +1 -1
- package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
- package/esm2015/lib/place/route/formatter.js +0 -30
- package/esm2015/lib/place/route/formatter.js.map +1 -1
- package/esm2015/lib/place/route/json-types.js +0 -12
- package/esm2015/lib/place/route/json-types.js.map +1 -1
- package/esm2015/lib/place/route/parameter-decorators.js +14 -133
- package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
- package/esm2015/lib/place/route/parameter-definition.class.js +2 -147
- package/esm2015/lib/place/route/parameter-definition.class.js.map +1 -1
- package/esm2015/lib/place/route/parameter-sanitiser.js +0 -18
- package/esm2015/lib/place/route/parameter-sanitiser.js.map +1 -1
- package/esm2015/lib/place/route/parameter-snapshot.js +0 -19
- package/esm2015/lib/place/route/parameter-snapshot.js.map +1 -1
- package/esm2015/lib/place/route/visit-sanitiser.js +2 -47
- package/esm2015/lib/place/route/visit-sanitiser.js.map +1 -1
- package/esm2015/lib/place/url-service.js +13 -68
- package/esm2015/lib/place/url-service.js.map +1 -1
- package/esm2015/lib/place/url-service.metadata.json +1 -1
- package/esm2015/lib/place/url-snapshot.js +3 -86
- package/esm2015/lib/place/url-snapshot.js.map +1 -1
- package/esm2015/lib/place/visit.js +5 -73
- package/esm2015/lib/place/visit.js.map +1 -1
- package/esm2015/public_api.js +6 -10
- package/esm2015/public_api.js.map +1 -1
- package/esm5/coolon-angular-ui-powerups.js +1 -5
- package/esm5/coolon-angular-ui-powerups.js.map +1 -1
- package/esm5/index.js +1 -5
- package/esm5/index.js.map +1 -1
- package/esm5/lib/angular-ui-powerups.module.js +29 -30
- package/esm5/lib/angular-ui-powerups.module.js.map +1 -1
- package/esm5/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
- package/esm5/lib/animations/index.js +1 -5
- package/esm5/lib/animations/index.js.map +1 -1
- package/esm5/lib/animations/slide-animations.js +0 -8
- package/esm5/lib/animations/slide-animations.js.map +1 -1
- package/esm5/lib/components/components.module.js +36 -37
- package/esm5/lib/components/components.module.js.map +1 -1
- package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/disposable-component.js +7 -13
- package/esm5/lib/components/disposable-component.js.map +1 -1
- package/esm5/lib/components/forms/abstract-input.component.js +95 -157
- package/esm5/lib/components/forms/abstract-input.component.js.map +1 -1
- package/esm5/lib/components/forms/number-input/number-input.component.js +11 -22
- package/esm5/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm5/lib/components/forms/password-input/password-input.component.js +11 -22
- package/esm5/lib/components/forms/password-input/password-input.component.js.map +1 -1
- package/esm5/lib/components/forms/select-input/select-input.component.js +38 -61
- package/esm5/lib/components/forms/select-input/select-input.component.js.map +1 -1
- package/esm5/lib/components/forms/string-input/string-input.component.js +19 -45
- package/esm5/lib/components/forms/string-input/string-input.component.js.map +1 -1
- package/esm5/lib/components/index.js +13 -17
- package/esm5/lib/components/index.js.map +1 -1
- package/esm5/lib/components/noop/noop.component.js +9 -13
- package/esm5/lib/components/noop/noop.component.js.map +1 -1
- package/esm5/lib/components/resize-aware.component.js +21 -80
- package/esm5/lib/components/resize-aware.component.js.map +1 -1
- package/esm5/lib/components/scroll-container/scroll-container.component.js +10 -20
- package/esm5/lib/components/scroll-container/scroll-container.component.js.map +1 -1
- package/esm5/lib/components/types/bounds.class.js +3 -30
- package/esm5/lib/components/types/bounds.class.js.map +1 -1
- package/esm5/lib/components/types/dimension.class.js +0 -10
- package/esm5/lib/components/types/dimension.class.js.map +1 -1
- package/esm5/lib/components/types/point.class.js +2 -30
- package/esm5/lib/components/types/point.class.js.map +1 -1
- package/esm5/lib/directives/command.directive.js +37 -103
- package/esm5/lib/directives/command.directive.js.map +1 -1
- package/esm5/lib/directives/directives.module.js +25 -26
- package/esm5/lib/directives/directives.module.js.map +1 -1
- package/esm5/lib/directives/directives.module.ngfactory.js.map +1 -1
- package/esm5/lib/directives/focus-binding.directive.js +50 -147
- package/esm5/lib/directives/focus-binding.directive.js.map +1 -1
- package/esm5/lib/directives/index.js +3 -7
- package/esm5/lib/directives/index.js.map +1 -1
- package/esm5/lib/interaction/abstract-interaction-context.js +7 -114
- package/esm5/lib/interaction/abstract-interaction-context.js.map +1 -1
- package/esm5/lib/interaction/activity-ref.js +12 -109
- package/esm5/lib/interaction/activity-ref.js.map +1 -1
- package/esm5/lib/interaction/activity.js +12 -121
- package/esm5/lib/interaction/activity.js.map +1 -1
- package/esm5/lib/interaction/alert.js +0 -22
- package/esm5/lib/interaction/alert.js.map +1 -1
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +64 -330
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
- package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js +26 -79
- package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -1
- package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js +12 -25
- package/esm5/lib/interaction/components/alert-dialog/alert-dialog.component.js.map +1 -1
- package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +17 -72
- package/esm5/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js.map +1 -1
- package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +13 -32
- package/esm5/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js.map +1 -1
- package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js +24 -117
- package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -1
- package/esm5/lib/interaction/confirm.js +0 -16
- package/esm5/lib/interaction/confirm.js.map +1 -1
- package/esm5/lib/interaction/index.js +15 -24
- package/esm5/lib/interaction/index.js.map +1 -1
- package/esm5/lib/interaction/interaction-context.js +0 -50
- package/esm5/lib/interaction/interaction-context.js.map +1 -1
- package/esm5/lib/interaction/interaction.module.js +38 -39
- package/esm5/lib/interaction/interaction.module.js.map +1 -1
- package/esm5/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/esm5/lib/interaction/result.js +2 -23
- package/esm5/lib/interaction/result.js.map +1 -1
- package/esm5/lib/interaction/route-synchronisation-adapter.js +0 -16
- package/esm5/lib/interaction/route-synchronisation-adapter.js.map +1 -1
- package/esm5/lib/interaction/services/interaction-service-routing-adapter.js +6 -73
- package/esm5/lib/interaction/services/interaction-service-routing-adapter.js.map +1 -1
- package/esm5/lib/interaction/services/interaction.service.js +33 -290
- package/esm5/lib/interaction/services/interaction.service.js.map +1 -1
- package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +16 -41
- package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js.map +1 -1
- package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +14 -109
- package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js.map +1 -1
- package/esm5/lib/interaction/services/modal-interaction-context.factory.js +1 -23
- package/esm5/lib/interaction/services/modal-interaction-context.factory.js.map +1 -1
- package/esm5/lib/place/components/abstract-place-navigation.component.js +37 -115
- package/esm5/lib/place/components/abstract-place-navigation.component.js.map +1 -1
- package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js +16 -37
- package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js.map +1 -1
- package/esm5/lib/place/components/empty-state/empty-state.component.js +10 -20
- package/esm5/lib/place/components/empty-state/empty-state.component.js.map +1 -1
- package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js +17 -42
- package/esm5/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +64 -314
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
- package/esm5/lib/place/components/place-outlet/route-animations.js +0 -12
- package/esm5/lib/place/components/place-outlet/route-animations.js.map +1 -1
- package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +10 -14
- package/esm5/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
- package/esm5/lib/place/guards/consolidated-param-map.js +17 -117
- package/esm5/lib/place/guards/consolidated-param-map.js.map +1 -1
- package/esm5/lib/place/guards/noop-auth-guard.service.js +11 -26
- package/esm5/lib/place/guards/noop-auth-guard.service.js.map +1 -1
- package/esm5/lib/place/guards/place.guard.js +24 -172
- package/esm5/lib/place/guards/place.guard.js.map +1 -1
- package/esm5/lib/place/index.js +38 -46
- package/esm5/lib/place/index.js.map +1 -1
- package/esm5/lib/place/nav-item.js +0 -22
- package/esm5/lib/place/nav-item.js.map +1 -1
- package/esm5/lib/place/navigation/place-component-deactivation-handler.js +11 -86
- package/esm5/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
- package/esm5/lib/place/navigation/session/abstract-pop-state-navigation.js +4 -34
- package/esm5/lib/place/navigation/session/abstract-pop-state-navigation.js.map +1 -1
- package/esm5/lib/place/navigation/session/event-cleanup/event-clean-up-session.js +4 -25
- package/esm5/lib/place/navigation/session/event-cleanup/event-clean-up-session.js.map +1 -1
- package/esm5/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js +11 -110
- package/esm5/lib/place/navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled.js.map +1 -1
- package/esm5/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js +12 -147
- package/esm5/lib/place/navigation/session/event-cleanup/wait-until-link-triggered-interaction-cancelation-finishes.js.map +1 -1
- package/esm5/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js +11 -126
- package/esm5/lib/place/navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes.js.map +1 -1
- package/esm5/lib/place/navigation/session/interactions/navigating-during-interaction.js +7 -71
- package/esm5/lib/place/navigation/session/interactions/navigating-during-interaction.js.map +1 -1
- package/esm5/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js +6 -49
- package/esm5/lib/place/navigation/session/interactions/pop-state-during-interaction-navigation.js.map +1 -1
- package/esm5/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js +11 -120
- package/esm5/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.js.map +1 -1
- package/esm5/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js +13 -106
- package/esm5/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -1
- package/esm5/lib/place/navigation/session/navigating.js +6 -53
- package/esm5/lib/place/navigation/session/navigating.js.map +1 -1
- package/esm5/lib/place/navigation/session/navigation-context.js +0 -17
- package/esm5/lib/place/navigation/session/navigation-context.js.map +1 -1
- package/esm5/lib/place/navigation/session/navigation-session.js +39 -306
- package/esm5/lib/place/navigation/session/navigation-session.js.map +1 -1
- package/esm5/lib/place/navigation/session/pop-state-navigation.js +5 -33
- package/esm5/lib/place/navigation/session/pop-state-navigation.js.map +1 -1
- package/esm5/lib/place/place-component.js +30 -142
- package/esm5/lib/place/place-component.js.map +1 -1
- package/esm5/lib/place/place-config.js +0 -13
- package/esm5/lib/place/place-config.js.map +1 -1
- package/esm5/lib/place/place-definition.js +37 -219
- package/esm5/lib/place/place-definition.js.map +1 -1
- package/esm5/lib/place/place-history.js +11 -56
- package/esm5/lib/place/place-history.js.map +1 -1
- package/esm5/lib/place/place-router.js +59 -372
- package/esm5/lib/place/place-router.js.map +1 -1
- package/esm5/lib/place/place.decorator.js +3 -38
- package/esm5/lib/place/place.decorator.js.map +1 -1
- package/esm5/lib/place/place.module.js +37 -40
- package/esm5/lib/place/place.module.js.map +1 -1
- package/esm5/lib/place/place.module.ngfactory.js.map +1 -1
- package/esm5/lib/place/route/formatter.js +6 -60
- package/esm5/lib/place/route/formatter.js.map +1 -1
- package/esm5/lib/place/route/json-types.js +0 -12
- package/esm5/lib/place/route/json-types.js.map +1 -1
- package/esm5/lib/place/route/parameter-decorators.js +14 -133
- package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
- package/esm5/lib/place/route/parameter-definition.class.js +21 -222
- package/esm5/lib/place/route/parameter-definition.class.js.map +1 -1
- package/esm5/lib/place/route/parameter-sanitiser.js +0 -18
- package/esm5/lib/place/route/parameter-sanitiser.js.map +1 -1
- package/esm5/lib/place/route/parameter-snapshot.js +0 -19
- package/esm5/lib/place/route/parameter-snapshot.js.map +1 -1
- package/esm5/lib/place/route/visit-sanitiser.js +4 -42
- package/esm5/lib/place/route/visit-sanitiser.js.map +1 -1
- package/esm5/lib/place/url-service.js +20 -119
- package/esm5/lib/place/url-service.js.map +1 -1
- package/esm5/lib/place/url-snapshot.js +15 -143
- package/esm5/lib/place/url-snapshot.js.map +1 -1
- package/esm5/lib/place/visit.js +14 -132
- package/esm5/lib/place/visit.js.map +1 -1
- package/esm5/public_api.js +6 -10
- package/esm5/public_api.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +861 -4526
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +1129 -6274
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/forms/abstract-input.component.d.ts +9 -9
- package/lib/components/resize-aware.component.d.ts +3 -3
- package/lib/directives/command.directive.d.ts +4 -2
- package/lib/directives/focus-binding.directive.d.ts +1 -1
- package/lib/interaction/activity-ref.d.ts +2 -2
- package/lib/interaction/activity.d.ts +2 -2
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +2 -2
- package/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.d.ts +3 -2
- package/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.d.ts +1 -1
- package/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.d.ts +1 -1
- package/lib/interaction/services/interaction.service.d.ts +1 -1
- package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.d.ts +1 -1
- package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.d.ts +1 -1
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +4 -4
- package/lib/place/guards/consolidated-param-map.d.ts +1 -1
- package/lib/place/navigation/place-component-deactivation-handler.d.ts +2 -2
- package/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.d.ts +1 -1
- package/lib/place/navigation/session/navigation-session.d.ts +4 -4
- package/lib/place/place-component.d.ts +2 -2
- package/lib/place/place-router.d.ts +3 -3
- package/lib/place/route/formatter.d.ts +4 -3
- package/lib/place/route/parameter-definition.class.d.ts +2 -2
- package/package.json +10 -10
- package/schematics/place-routes/place-builder.js +4 -2
- package/schematics/place-routes/place-builder.js.map +1 -1
- package/schematics/place-routes/place-class-scanner.d.ts +3 -3
- package/schematics/place-routes/place-class-scanner.js +1 -1
- package/schematics/place-routes/place-class-scanner.js.map +1 -1
- package/schematics/place-routes/place-def.d.ts +9 -9
- /package/{styles → assets}/styles.scss +0 -0
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
// WARNING: interface has both a type and a value, skipping emit
|
|
6
1
|
export var NavigationContext;
|
|
7
2
|
(function (NavigationContext) {
|
|
8
3
|
class Impl {
|
|
9
|
-
/**
|
|
10
|
-
* @param {?} urlService
|
|
11
|
-
* @param {?} routerInteractionAdapter
|
|
12
|
-
* @param {?} navigateByUrl
|
|
13
|
-
* @param {?} transitionTo
|
|
14
|
-
* @param {?} finishRoutingSession
|
|
15
|
-
*/
|
|
16
4
|
constructor(urlService, routerInteractionAdapter, navigateByUrl, transitionTo, finishRoutingSession) {
|
|
17
5
|
this.urlService = urlService;
|
|
18
6
|
this.routerInteractionAdapter = routerInteractionAdapter;
|
|
@@ -22,17 +10,5 @@ export var NavigationContext;
|
|
|
22
10
|
}
|
|
23
11
|
}
|
|
24
12
|
NavigationContext.Impl = Impl;
|
|
25
|
-
if (false) {
|
|
26
|
-
/** @type {?} */
|
|
27
|
-
Impl.prototype.urlService;
|
|
28
|
-
/** @type {?} */
|
|
29
|
-
Impl.prototype.routerInteractionAdapter;
|
|
30
|
-
/** @type {?} */
|
|
31
|
-
Impl.prototype.navigateByUrl;
|
|
32
|
-
/** @type {?} */
|
|
33
|
-
Impl.prototype.transitionTo;
|
|
34
|
-
/** @type {?} */
|
|
35
|
-
Impl.prototype.finishRoutingSession;
|
|
36
|
-
}
|
|
37
13
|
})(NavigationContext || (NavigationContext = {}));
|
|
38
14
|
//# sourceMappingURL=navigation-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-context.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/navigation/session/navigation-context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation-context.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/navigation/session/navigation-context.ts"],"names":[],"mappings":"AAiBA,MAAM,KAAW,iBAAiB,CAWjC;AAXD,WAAiB,iBAAiB;IAChC,MAAa,IAAI;QACf,YAAqB,UAAsB,EACtB,wBAA0D,EAC1D,aAA8F,EAC9F,YAAmD,EACnD,oBAAgD;YAJhD,eAAU,GAAV,UAAU,CAAY;YACtB,6BAAwB,GAAxB,wBAAwB,CAAkC;YAC1D,kBAAa,GAAb,aAAa,CAAiF;YAC9F,iBAAY,GAAZ,YAAY,CAAuC;YACnD,yBAAoB,GAApB,oBAAoB,CAA4B;QACrE,CAAC;KAEF;IARY,sBAAI,OAQhB,CAAA;AAEH,CAAC,EAXgB,iBAAiB,KAAjB,iBAAiB,QAWjC","sourcesContent":["import { InteractionServiceRoutingAdapter } from '../../../interaction/services/interaction-service-routing-adapter';\nimport { UrlService } from '../../url-service';\nimport { UrlSnapshot } from '../../url-snapshot';\nimport { Visit } from '../../visit';\nimport { NavigationSession } from './navigation-session';\n\nexport interface NavigationContext {\n readonly urlService: UrlService,\n readonly routerInteractionAdapter: InteractionServiceRoutingAdapter;\n\n finishRoutingSession(visits?: Visit[]);\n\n transitionTo(newState: NavigationSession);\n\n navigateByUrl(urlSnapshot: UrlSnapshot, options: { replaceUrl: boolean }): Promise<boolean>;\n}\n\nexport namespace NavigationContext {\n export class Impl implements NavigationContext {\n constructor(readonly urlService: UrlService,\n readonly routerInteractionAdapter: InteractionServiceRoutingAdapter,\n readonly navigateByUrl: (urlSnapshot: UrlSnapshot, options: { replaceUrl: boolean })=> Promise<boolean>,\n readonly transitionTo: (newState: NavigationSession) => void,\n readonly finishRoutingSession: (visits?: Visit[]) => void) {\n }\n\n }\n\n}\n"]}
|
|
@@ -1,19 +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 { __awaiter } from "tslib";
|
|
6
2
|
import { GarbageCollector, lang, Logger } from '@coolon/pectin';
|
|
7
3
|
import { PlaceComponentDeactivationHandler } from '../place-component-deactivation-handler';
|
|
8
4
|
/**
|
|
9
5
|
* Transient states
|
|
10
|
-
* @abstract
|
|
11
6
|
*/
|
|
12
7
|
export class NavigationSession extends GarbageCollector {
|
|
13
|
-
/**
|
|
14
|
-
* @param {?} context
|
|
15
|
-
* @param {?} startingUrl
|
|
16
|
-
*/
|
|
17
8
|
constructor(context, startingUrl) {
|
|
18
9
|
super();
|
|
19
10
|
this.context = context;
|
|
@@ -23,10 +14,7 @@ export class NavigationSession extends GarbageCollector {
|
|
|
23
14
|
this.componentDeactivationHandlers = new Map();
|
|
24
15
|
// TODO: can I get away without creating one every time?
|
|
25
16
|
this._interactionContext = this.context.routerInteractionAdapter.createExclusiveInteractionContext();
|
|
26
|
-
this.onDispose((
|
|
27
|
-
* @return {?}
|
|
28
|
-
*/
|
|
29
|
-
() => {
|
|
17
|
+
this.onDispose(() => {
|
|
30
18
|
// the interaction context can be detached during the back button cancellation state transition
|
|
31
19
|
// as the transition is synchronous and activityCancellation isn't. Otherwise dispose will be
|
|
32
20
|
// called before the context has been cancelled. It might be work having the interaction context
|
|
@@ -34,69 +22,37 @@ export class NavigationSession extends GarbageCollector {
|
|
|
34
22
|
if (this._interactionContext) {
|
|
35
23
|
this._interactionContext.dispose(); // or do something like cancelAndDispose?
|
|
36
24
|
}
|
|
37
|
-
})
|
|
25
|
+
});
|
|
38
26
|
}
|
|
39
|
-
/**
|
|
40
|
-
* @return {?}
|
|
41
|
-
*/
|
|
42
27
|
get name() {
|
|
43
28
|
return this.constructor.name;
|
|
44
29
|
}
|
|
45
|
-
/**
|
|
46
|
-
* @return {?}
|
|
47
|
-
*/
|
|
48
30
|
get urlService() {
|
|
49
31
|
return this.context.urlService;
|
|
50
32
|
}
|
|
51
|
-
/**
|
|
52
|
-
* @return {?}
|
|
53
|
-
*/
|
|
54
33
|
get interactionServiceAdapter() {
|
|
55
34
|
return this.context.routerInteractionAdapter;
|
|
56
35
|
}
|
|
57
|
-
/**
|
|
58
|
-
* @param {?} visit
|
|
59
|
-
* @return {?}
|
|
60
|
-
*/
|
|
61
36
|
storeVisit(visit) {
|
|
62
37
|
// console.log(`Storing visit for ${visit.placeDefinition.component.name}`, {visit});
|
|
63
38
|
this._visits.set(visit.placeDefinition, visit);
|
|
64
39
|
}
|
|
65
|
-
/**
|
|
66
|
-
* @param {?} placeDef
|
|
67
|
-
* @return {?}
|
|
68
|
-
*/
|
|
69
40
|
getVisitFor(placeDef) {
|
|
70
|
-
/** @type {?} */
|
|
71
41
|
const visit = this._visits.get(placeDef);
|
|
72
42
|
// console.log(`Getting visit for ${placeDef.component.name}`, {visit});
|
|
73
43
|
return visit;
|
|
74
44
|
}
|
|
75
|
-
/**
|
|
76
|
-
* @return {?}
|
|
77
|
-
*/
|
|
78
45
|
get canDeactivateInteractionContext() {
|
|
79
46
|
return this._interactionContext;
|
|
80
47
|
}
|
|
81
|
-
/**
|
|
82
|
-
* @return {?}
|
|
83
|
-
*/
|
|
84
48
|
notifyActive() {
|
|
85
49
|
// noop.
|
|
86
50
|
}
|
|
87
|
-
/**
|
|
88
|
-
* @param {?} event
|
|
89
|
-
* @return {?}
|
|
90
|
-
*/
|
|
91
51
|
onRouterStarted(event) {
|
|
92
52
|
// navigation sessions can have many cancel start cycles due to place guard redirects
|
|
93
53
|
this.ignore(event);
|
|
94
54
|
}
|
|
95
55
|
// @Trace()
|
|
96
|
-
/**
|
|
97
|
-
* @param {?} url
|
|
98
|
-
* @return {?}
|
|
99
|
-
*/
|
|
100
56
|
onUrlChange(url) {
|
|
101
57
|
// Normally we just ignore these but they are the only way of detecting if the back button
|
|
102
58
|
// was clicked during a canDeactivate promise.
|
|
@@ -108,72 +64,32 @@ export class NavigationSession extends GarbageCollector {
|
|
|
108
64
|
this.cancelCanDeactivateInteraction(url);
|
|
109
65
|
}
|
|
110
66
|
}
|
|
111
|
-
/**
|
|
112
|
-
* @param {?} event
|
|
113
|
-
* @return {?}
|
|
114
|
-
*/
|
|
115
67
|
onPopState(event) {
|
|
116
68
|
return this.illegalTransition(event);
|
|
117
69
|
}
|
|
118
|
-
/**
|
|
119
|
-
* @param {?} event
|
|
120
|
-
* @return {?}
|
|
121
|
-
*/
|
|
122
70
|
onRouterCancelled(event) {
|
|
123
71
|
return this.illegalTransition(event);
|
|
124
72
|
}
|
|
125
|
-
/**
|
|
126
|
-
* @param {?} event
|
|
127
|
-
* @return {?}
|
|
128
|
-
*/
|
|
129
73
|
onRouterError(event) {
|
|
130
74
|
return this.illegalTransition(event);
|
|
131
75
|
}
|
|
132
|
-
/**
|
|
133
|
-
* @param {?} event
|
|
134
|
-
* @return {?}
|
|
135
|
-
*/
|
|
136
76
|
onRouterEnd(event) {
|
|
137
77
|
return this.illegalTransition(event);
|
|
138
78
|
}
|
|
139
|
-
/**
|
|
140
|
-
* @return {?}
|
|
141
|
-
*/
|
|
142
79
|
getVisits() {
|
|
143
80
|
return Array.from(this._visits.values());
|
|
144
81
|
}
|
|
145
|
-
/**
|
|
146
|
-
* @protected
|
|
147
|
-
* @template R
|
|
148
|
-
* @param {?} message
|
|
149
|
-
* @return {?}
|
|
150
|
-
*/
|
|
151
82
|
illegalTransition(message) {
|
|
152
83
|
return lang.illegalState(`${message.toString()} not supported by ${this.toString()}`);
|
|
153
84
|
}
|
|
154
|
-
/**
|
|
155
|
-
* @protected
|
|
156
|
-
* @return {?}
|
|
157
|
-
*/
|
|
158
85
|
currentRouterUrl() {
|
|
159
86
|
return this.urlService.getCurrentRouterUrl();
|
|
160
87
|
}
|
|
161
|
-
/**
|
|
162
|
-
* @param {?} url
|
|
163
|
-
* @param {?=} options
|
|
164
|
-
* @return {?}
|
|
165
|
-
*/
|
|
166
88
|
resetBrowserLocation(url, options = { replaceCurrent: false }) {
|
|
167
89
|
// console.log(`---> resetting browser location to: ${url}`);
|
|
168
90
|
this.urlService.resetBrowserLocation(url, options);
|
|
169
91
|
}
|
|
170
92
|
// @Trace()
|
|
171
|
-
/**
|
|
172
|
-
* @protected
|
|
173
|
-
* @param {?} poppedHistoryToReplace
|
|
174
|
-
* @param {?} activeUrl
|
|
175
|
-
* @return {?}
|
|
176
|
-
*/
|
|
177
93
|
repairBrowserHistoryAndUrlAfterGuardCancellation(poppedHistoryToReplace, activeUrl) {
|
|
178
94
|
// Important: I tried to perform this fix at a later point int he routing cycle but it created all kinds of
|
|
179
95
|
// strangeness.
|
|
@@ -183,95 +99,49 @@ export class NavigationSession extends GarbageCollector {
|
|
|
183
99
|
console.log(`pushing ${activeUrl} back onto the history.`);
|
|
184
100
|
this.urlService.resetBrowserLocation(activeUrl, { replaceCurrent: false });
|
|
185
101
|
}
|
|
186
|
-
/**
|
|
187
|
-
* @param {?} event
|
|
188
|
-
* @param {?=} reason
|
|
189
|
-
* @return {?}
|
|
190
|
-
*/
|
|
191
102
|
ignore(event, reason) {
|
|
192
103
|
reason = reason ? ` -> ${reason}` : '';
|
|
193
104
|
Logger.get(this).info(`Ignoring router event${reason}: ${event.constructor.name} -> ${event.url} :: ${this.toString()}`);
|
|
194
105
|
}
|
|
195
|
-
/**
|
|
196
|
-
* @return {?}
|
|
197
|
-
*/
|
|
198
106
|
toString() {
|
|
199
107
|
return `${this.constructor.name}(${this.debugState()})`;
|
|
200
108
|
}
|
|
201
|
-
/**
|
|
202
|
-
* @protected
|
|
203
|
-
* @param {?=} properties
|
|
204
|
-
* @return {?}
|
|
205
|
-
*/
|
|
206
109
|
debugState(properties) {
|
|
207
|
-
return (properties || this.debugPropertyKeys).map(
|
|
208
|
-
* @param {?} p
|
|
209
|
-
* @return {?}
|
|
210
|
-
*/
|
|
211
|
-
p => {
|
|
110
|
+
return (properties || this.debugPropertyKeys).map(p => {
|
|
212
111
|
return `${p}: ${this[p]}`;
|
|
213
|
-
})
|
|
112
|
+
}).join(', ');
|
|
214
113
|
}
|
|
215
|
-
/**
|
|
216
|
-
* @param {?} component
|
|
217
|
-
* @param {?} currentUrl
|
|
218
|
-
* @param {?} nextUrl
|
|
219
|
-
* @return {?}
|
|
220
|
-
*/
|
|
221
114
|
canDeactivatePlace(component, currentUrl, nextUrl) {
|
|
222
|
-
return
|
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
223
116
|
// console.log(`---> canDeactivatePlace(${component.placeDefinition.path}, ${currentUrl.url} -> ${nextUrl.url})`);
|
|
224
117
|
// lookup the handler and create it if we've not seen it yet
|
|
225
|
-
/** @type {?} */
|
|
226
118
|
let handler = this.componentDeactivationHandlers.get(component);
|
|
227
119
|
if (!handler) {
|
|
228
|
-
|
|
229
|
-
const isPrimaryHandler = this.componentDeactivationHandlers.size === 0;
|
|
120
|
+
const isPrimaryHandler = this.componentDeactivationHandlers.size === 0; // only primary handler cancels the app model interations
|
|
230
121
|
handler = new PlaceComponentDeactivationHandler(component, this, isPrimaryHandler);
|
|
231
122
|
this.componentDeactivationHandlers.set(component, handler);
|
|
232
123
|
}
|
|
233
|
-
return handler.canDeactivate(currentUrl, nextUrl).then(
|
|
234
|
-
* @param {?} result
|
|
235
|
-
* @return {?}
|
|
236
|
-
*/
|
|
237
|
-
result => {
|
|
124
|
+
return handler.canDeactivate(currentUrl, nextUrl).then(result => {
|
|
238
125
|
// console.log(`<--- canDeactivatePlace(${component.placeDefinition.path}): ${result}`);
|
|
239
126
|
return result;
|
|
240
|
-
})
|
|
241
|
-
* @param {?} error
|
|
242
|
-
* @return {?}
|
|
243
|
-
*/
|
|
244
|
-
error => {
|
|
127
|
+
}).catch(error => {
|
|
245
128
|
throw error;
|
|
246
|
-
})
|
|
129
|
+
});
|
|
247
130
|
});
|
|
248
131
|
}
|
|
249
|
-
/**
|
|
250
|
-
* @param {?} newUrl
|
|
251
|
-
* @return {?}
|
|
252
|
-
*/
|
|
253
132
|
cancelCanDeactivateInteraction(newUrl) {
|
|
254
133
|
Logger.get(this).info(`back button pressed during navigation session interaction promise`);
|
|
255
134
|
// detach the interaction from the session so it doesn't get disposed until the activity has finished
|
|
256
135
|
// all it's things.
|
|
257
|
-
/** @type {?} */
|
|
258
136
|
const canDeactivateInteractionContext = this.detachCanDeactivateInteractionContext();
|
|
259
137
|
// TODO: I need to make the exclusive interaction context disallow nested activities or
|
|
260
138
|
// that would mess things up entirely. Or, can I do a context.abortAll().then(..)
|
|
261
139
|
Logger.get(this).info('cancelling current navigation activity..');
|
|
262
|
-
canDeactivateInteractionContext.cancelActiveActivity().then((
|
|
263
|
-
* @return {?}
|
|
264
|
-
*/
|
|
265
|
-
() => {
|
|
140
|
+
canDeactivateInteractionContext.cancelActiveActivity().then(() => {
|
|
266
141
|
canDeactivateInteractionContext.dispose();
|
|
267
|
-
})
|
|
142
|
+
});
|
|
268
143
|
this.handleCanDeactivateCancelledEventScenario(newUrl);
|
|
269
144
|
}
|
|
270
|
-
/**
|
|
271
|
-
* @protected
|
|
272
|
-
* @param {?} url
|
|
273
|
-
* @return {?}
|
|
274
|
-
*/
|
|
275
145
|
reinstateUrlAfterAngularChangedItOnCancellation(url) {
|
|
276
146
|
// Angular calls _this.resetUrlToCurrentUrlTree() on cancelling and fucks our history.
|
|
277
147
|
// So this means that the top of the stack is the url we want to go back to, and not the one that was on
|
|
@@ -281,46 +151,10 @@ export class NavigationSession extends GarbageCollector {
|
|
|
281
151
|
// - push our actual url back onto the top of the stack.
|
|
282
152
|
this.resetBrowserLocation(url, { replaceCurrent: true });
|
|
283
153
|
}
|
|
284
|
-
/**
|
|
285
|
-
* @protected
|
|
286
|
-
* @return {?}
|
|
287
|
-
*/
|
|
288
154
|
detachCanDeactivateInteractionContext() {
|
|
289
|
-
/** @type {?} */
|
|
290
155
|
const context = this._interactionContext;
|
|
291
156
|
this._interactionContext = null;
|
|
292
157
|
return context;
|
|
293
158
|
}
|
|
294
159
|
}
|
|
295
|
-
if (false) {
|
|
296
|
-
/** @type {?} */
|
|
297
|
-
NavigationSession.prototype.debugPropertyKeys;
|
|
298
|
-
/**
|
|
299
|
-
* @type {?}
|
|
300
|
-
* @private
|
|
301
|
-
*/
|
|
302
|
-
NavigationSession.prototype._visits;
|
|
303
|
-
/**
|
|
304
|
-
* @type {?}
|
|
305
|
-
* @private
|
|
306
|
-
*/
|
|
307
|
-
NavigationSession.prototype.componentDeactivationHandlers;
|
|
308
|
-
/** @type {?} */
|
|
309
|
-
NavigationSession.prototype.isPopState;
|
|
310
|
-
/**
|
|
311
|
-
* @type {?}
|
|
312
|
-
* @private
|
|
313
|
-
*/
|
|
314
|
-
NavigationSession.prototype._interactionContext;
|
|
315
|
-
/** @type {?} */
|
|
316
|
-
NavigationSession.prototype.context;
|
|
317
|
-
/** @type {?} */
|
|
318
|
-
NavigationSession.prototype.startingUrl;
|
|
319
|
-
/**
|
|
320
|
-
* @abstract
|
|
321
|
-
* @param {?} newUrl
|
|
322
|
-
* @return {?}
|
|
323
|
-
*/
|
|
324
|
-
NavigationSession.prototype.handleCanDeactivateCancelledEventScenario = function (newUrl) { };
|
|
325
|
-
}
|
|
326
160
|
//# sourceMappingURL=navigation-session.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-session.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/navigation/session/navigation-session.ts"],"names":[],"mappings":";;;;;AACA,OAAO,EAAO,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAS,MAAM,gBAAgB,CAAC;AAQ5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;;;;;AAM5F,MAAM,OAAgB,iBAAkB,SAAQ,gBAAgB;;;;;IAU9D,YAAqB,OAA0B,EAAW,WAAmB;QAC3E,KAAK,EAAE,CAAC;QADW,YAAO,GAAP,OAAO,CAAmB;QAAW,gBAAW,GAAX,WAAW,CAAQ;QAR7E,sBAAiB,GAAa,EAAE,CAAC;QACzB,YAAO,GAAG,IAAI,GAAG,EAA0B,CAAC;QAE5C,kCAA6B,GAAG,IAAI,GAAG,EAAqD,CAAC;QAOnG,wDAAwD;QACxD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,iCAAiC,EAAE,CAAC;QACrG,IAAI,CAAC,SAAS;;;QAAC,GAAG,EAAE;YAClB,+FAA+F;YAC/F,8FAA8F;YAC9F,iGAAiG;YACjG,8FAA8F;YAC9F,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBAC5B,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAC,yCAAyC;aAC9E;QACH,CAAC,EAAC,CAAC;IACL,CAAC;;;;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;;;;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;IACjC,CAAC;;;;IAED,IAAI,yBAAyB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC;IAC/C,CAAC;;;;;IAED,UAAU,CAAC,KAAY;QACrB,qFAAqF;QACrF,IAAI,CAAC,OAAO,CAAC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BAA+B,GAAG,IAAI,CAAC,qCAAqC,EAAE;QACpF,uFAAuF;QACvF,uFAAuF;QACvF,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QAClE,+BAA+B,CAAC,oBAAoB,EAAE,CAAC,IAAI;;;QAAC,GAAG,EAAE;YAC/D,+BAA+B,CAAC,OAAO,EAAE,CAAC;QAC5C,CAAC,EAAC,CAAC;QAEH,IAAI,CAAC,yCAAyC,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;;;;;;IAIS,+CAA+C,CAAC,GAAW;QACnE,sFAAsF;QACtF,wGAAwG;QACxG,oCAAoC;QACpC,iBAAiB;QACjB,sEAAsE;QACtE,wDAAwD;QACxD,IAAI,CAAC,oBAAoB,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;;;;;IAES,qCAAqC;;cACvC,OAAO,GAAG,IAAI,CAAC,mBAAmB;QACxC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAChC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;;;IAtLC,8CAAiC;;;;;IACjC,oCAAoD;;;;;IAEpD,0DAAqG;;IACrG,uCAAsC;;;;;IAEtC,gDAAgD;;IAEpC,oCAAmC;;IAAE,wCAA4B;;;;;;IA6J7E,8FAAwE","sourcesContent":["import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, RouterEvent } from '@angular/router';\nimport { Dsl, GarbageCollector, lang, Logger, Trace } from '@coolon/pectin';\nimport { InteractionContext } from '../../../interaction/interaction-context';\nimport { InteractionServiceRoutingAdapter } from '../../../interaction/services/interaction-service-routing-adapter';\nimport { PlaceComponent } from '../../place-component';\nimport { PlaceDefinition } from '../../place-definition';\nimport { UrlService } from '../../url-service';\nimport { UrlSnapshot } from '../../url-snapshot';\nimport { Visit } from '../../visit';\nimport { PlaceComponentDeactivationHandler } from '../place-component-deactivation-handler';\nimport { NavigationContext } from './navigation-context';\n\n/**\n * Transient states\n */\nexport abstract class NavigationSession extends GarbageCollector {\n\n debugPropertyKeys: string[] = [];\n private _visits = new Map<PlaceDefinition, Visit>();\n\n private componentDeactivationHandlers = new Map<PlaceComponent, PlaceComponentDeactivationHandler>();\n abstract readonly isPopState: boolean;\n\n private _interactionContext: InteractionContext;\n\n constructor(readonly context: NavigationContext, readonly startingUrl: string) {\n super();\n // TODO: can I get away without creating one every time?\n this._interactionContext = this.context.routerInteractionAdapter.createExclusiveInteractionContext();\n this.onDispose(() => {\n // the interaction context can be detached during the back button cancellation state transition\n // as the transition is synchronous and activityCancellation isn't. Otherwise dispose will be\n // called before the context has been cancelled. It might be work having the interaction context\n // automatically cancel if the context is disposed so we don't have worry about detaching etc.\n if (this._interactionContext) {\n this._interactionContext.dispose(); // or do something like cancelAndDispose?\n }\n });\n }\n\n get name(): string {\n return this.constructor.name;\n }\n\n get urlService(): UrlService {\n return this.context.urlService;\n }\n\n get interactionServiceAdapter(): InteractionServiceRoutingAdapter {\n return this.context.routerInteractionAdapter;\n }\n\n storeVisit(visit: Visit) {\n // console.log(`Storing visit for ${visit.placeDefinition.component.name}`, {visit});\n this._visits.set(visit.placeDefinition, visit);\n }\n\n\n getVisitFor(placeDef: PlaceDefinition) {\n const visit = this._visits.get(placeDef);\n // console.log(`Getting visit for ${placeDef.component.name}`, {visit});\n return visit;\n }\n\n get canDeactivateInteractionContext(): InteractionContext {\n return this._interactionContext;\n }\n\n notifyActive() {\n // noop.\n }\n\n onRouterStarted(event: NavigationStart): void {\n // navigation sessions can have many cancel start cycles due to place guard redirects\n this.ignore(event);\n }\n\n // @Trace()\n onUrlChange(url: string) {\n // Normally we just ignore these but they are the only way of detecting if the back button\n // was clicked during a canDeactivate promise.\n // 1. a route is in progress and awaiting a canDeactivateGuard\n // 2. the user the clicks the back button.\n // So to handle that scenario we need to check if we've got a can deactivate interaction in\n // progress and the do the appropriate clean up.\n if (this.canDeactivateInteractionContext && this.canDeactivateInteractionContext.isActive()) {\n this.cancelCanDeactivateInteraction(url);\n }\n }\n\n onPopState(event: NavigationStart): void {\n return this.illegalTransition(event);\n }\n\n onRouterCancelled(event: NavigationCancel): void {\n return this.illegalTransition(event);\n }\n\n onRouterError(event: NavigationError): void {\n return this.illegalTransition(event);\n }\n\n onRouterEnd(event: NavigationEnd): void {\n return this.illegalTransition(event);\n }\n\n getVisits(): Visit[] {\n return Array.from(this._visits.values());\n }\n\n protected illegalTransition<R>(message: string | RouterEvent): R {\n return lang.illegalState(`${message.toString()} not supported by ${this.toString()}`);\n }\n\n protected currentRouterUrl(): string {\n return this.urlService.getCurrentRouterUrl();\n }\n\n resetBrowserLocation(url, options: { replaceCurrent: boolean } = { replaceCurrent: false }) {\n // console.log(`---> resetting browser location to: ${url}`);\n this.urlService.resetBrowserLocation(url, options);\n }\n\n // @Trace()\n protected repairBrowserHistoryAndUrlAfterGuardCancellation(poppedHistoryToReplace: string, activeUrl:string): void {\n // Important: I tried to perform this fix at a later point int he routing cycle but it created all kinds of\n // strangeness.\n Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');\n console.log(`replacing ${this.urlService.getCurrentLocationUrlSnapshot().url} with ${poppedHistoryToReplace}`);\n this.urlService.resetBrowserLocation(poppedHistoryToReplace, { replaceCurrent: true });\n console.log(`pushing ${activeUrl} back onto the history.`);\n this.urlService.resetBrowserLocation(activeUrl, { replaceCurrent: false });\n }\n\n\n ignore(event: RouterEvent, reason?: string): void {\n reason = reason ? ` -> ${reason}` : '';\n Logger.get(this).info(`Ignoring router event${reason}: ${event.constructor.name} -> ${event.url} :: ${this.toString()}`);\n }\n\n toString(): string {\n return `${this.constructor.name}(${this.debugState()})`;\n }\n\n protected debugState(properties?: string[]) {\n return (properties || this.debugPropertyKeys).map(p => {\n return `${p}: ${this[p]}`;\n }).join(', ');\n }\n\n async canDeactivatePlace(component: PlaceComponent, currentUrl: UrlSnapshot, nextUrl: UrlSnapshot): Promise<boolean | UrlSnapshot> {\n // console.log(`---> canDeactivatePlace(${component.placeDefinition.path}, ${currentUrl.url} -> ${nextUrl.url})`);\n // lookup the handler and create it if we've not seen it yet\n let handler = this.componentDeactivationHandlers.get(component);\n if (!handler) {\n const isPrimaryHandler = this.componentDeactivationHandlers.size === 0; // only primary handler cancels the app model interations\n handler = new PlaceComponentDeactivationHandler(component, this, isPrimaryHandler);\n this.componentDeactivationHandlers.set(component, handler);\n }\n return handler.canDeactivate(currentUrl, nextUrl).then(result => {\n // console.log(`<--- canDeactivatePlace(${component.placeDefinition.path}): ${result}`);\n return result;\n }).catch(error => {\n throw error;\n });\n }\n\n cancelCanDeactivateInteraction(newUrl: string): void {\n Logger.get(this).info(`back button pressed during navigation session interaction promise`);\n // detach the interaction from the session so it doesn't get disposed until the activity has finished\n // all it's things.\n const canDeactivateInteractionContext = this.detachCanDeactivateInteractionContext();\n // TODO: I need to make the exclusive interaction context disallow nested activities or\n // that would mess things up entirely. Or, can I do a context.abortAll().then(..)\n Logger.get(this).info('cancelling current navigation activity..');\n canDeactivateInteractionContext.cancelActiveActivity().then(() => {\n canDeactivateInteractionContext.dispose();\n });\n\n this.handleCanDeactivateCancelledEventScenario(newUrl);\n }\n\n abstract handleCanDeactivateCancelledEventScenario(newUrl: string): void\n\n protected reinstateUrlAfterAngularChangedItOnCancellation(url: string) {\n // Angular calls _this.resetUrlToCurrentUrlTree() on cancelling and fucks our history.\n // So this means that the top of the stack is the url we want to go back to, and not the one that was on\n // it before the cancel event fired.\n // So we need to:\n // - replace the just inserted url with the one that used to be there.\n // - push our actual url back onto the top of the stack.\n this.resetBrowserLocation(url, { replaceCurrent: true });\n }\n\n protected detachCanDeactivateInteractionContext(): InteractionContext {\n const context = this._interactionContext;\n this._interactionContext = null;\n return context;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"navigation-session.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/navigation/session/navigation-session.ts"],"names":[],"mappings":";AACA,OAAO,EAAO,gBA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AAC,CAAC;QAClE,+BAA+B,CAAC,oBAAoB,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;YAC/D,+BAA+B,CAAC,OAAO,EAAE,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,yCAAyC,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;IAIS,+CAA+C,CAAC,GAAW;QACnE,sFAAsF;QACtF,wGAAwG;QACxG,oCAAoC;QACpC,iBAAiB;QACjB,sEAAsE;QACtE,wDAAwD;QACxD,IAAI,CAAC,oBAAoB,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IAES,qCAAqC;QAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACzC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAChC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, RouterEvent } from '@angular/router';\nimport { Dsl, GarbageCollector, lang, Logger, Trace } from '@coolon/pectin';\nimport { InteractionContext } from '../../../interaction/interaction-context';\nimport { InteractionServiceRoutingAdapter } from '../../../interaction/services/interaction-service-routing-adapter';\nimport { PlaceComponent } from '../../place-component';\nimport { PlaceDefinition } from '../../place-definition';\nimport { UrlService } from '../../url-service';\nimport { UrlSnapshot } from '../../url-snapshot';\nimport { Visit } from '../../visit';\nimport { PlaceComponentDeactivationHandler } from '../place-component-deactivation-handler';\nimport { NavigationContext } from './navigation-context';\n\n/**\n * Transient states\n */\nexport abstract class NavigationSession extends GarbageCollector {\n\n debugPropertyKeys: string[] = [];\n private _visits = new Map<PlaceDefinition, Visit>();\n\n private componentDeactivationHandlers = new Map<PlaceComponent, PlaceComponentDeactivationHandler>();\n abstract readonly isPopState: boolean;\n\n private _interactionContext: InteractionContext;\n\n constructor(readonly context: NavigationContext, readonly startingUrl: string) {\n super();\n // TODO: can I get away without creating one every time?\n this._interactionContext = this.context.routerInteractionAdapter.createExclusiveInteractionContext();\n this.onDispose(() => {\n // the interaction context can be detached during the back button cancellation state transition\n // as the transition is synchronous and activityCancellation isn't. Otherwise dispose will be\n // called before the context has been cancelled. It might be work having the interaction context\n // automatically cancel if the context is disposed so we don't have worry about detaching etc.\n if (this._interactionContext) {\n this._interactionContext.dispose(); // or do something like cancelAndDispose?\n }\n });\n }\n\n get name(): string {\n return this.constructor.name;\n }\n\n get urlService(): UrlService {\n return this.context.urlService;\n }\n\n get interactionServiceAdapter(): InteractionServiceRoutingAdapter {\n return this.context.routerInteractionAdapter;\n }\n\n storeVisit(visit: Visit) {\n // console.log(`Storing visit for ${visit.placeDefinition.component.name}`, {visit});\n this._visits.set(visit.placeDefinition, visit);\n }\n\n\n getVisitFor(placeDef: PlaceDefinition) {\n const visit = this._visits.get(placeDef);\n // console.log(`Getting visit for ${placeDef.component.name}`, {visit});\n return visit;\n }\n\n get canDeactivateInteractionContext(): InteractionContext {\n return this._interactionContext;\n }\n\n notifyActive() {\n // noop.\n }\n\n onRouterStarted(event: NavigationStart): void {\n // navigation sessions can have many cancel start cycles due to place guard redirects\n this.ignore(event);\n }\n\n // @Trace()\n onUrlChange(url: string) {\n // Normally we just ignore these but they are the only way of detecting if the back button\n // was clicked during a canDeactivate promise.\n // 1. a route is in progress and awaiting a canDeactivateGuard\n // 2. the user the clicks the back button.\n // So to handle that scenario we need to check if we've got a can deactivate interaction in\n // progress and the do the appropriate clean up.\n if (this.canDeactivateInteractionContext && this.canDeactivateInteractionContext.isActive()) {\n this.cancelCanDeactivateInteraction(url);\n }\n }\n\n onPopState(event: NavigationStart): void {\n return this.illegalTransition(event);\n }\n\n onRouterCancelled(event: NavigationCancel): void {\n return this.illegalTransition(event);\n }\n\n onRouterError(event: NavigationError): void {\n return this.illegalTransition(event);\n }\n\n onRouterEnd(event: NavigationEnd): void {\n return this.illegalTransition(event);\n }\n\n getVisits(): Visit[] {\n return Array.from(this._visits.values());\n }\n\n protected illegalTransition<R>(message: string | RouterEvent): R {\n return lang.illegalState(`${message.toString()} not supported by ${this.toString()}`);\n }\n\n protected currentRouterUrl(): string {\n return this.urlService.getCurrentRouterUrl();\n }\n\n resetBrowserLocation(url, options: { replaceCurrent: boolean } = { replaceCurrent: false }) {\n // console.log(`---> resetting browser location to: ${url}`);\n this.urlService.resetBrowserLocation(url, options);\n }\n\n // @Trace()\n protected repairBrowserHistoryAndUrlAfterGuardCancellation(poppedHistoryToReplace: string, activeUrl:string): void {\n // Important: I tried to perform this fix at a later point int he routing cycle but it created all kinds of\n // strangeness.\n Logger.get(this).info('WORK-AROUND: Updating browser location after pop state - see angular issue #13586');\n console.log(`replacing ${this.urlService.getCurrentLocationUrlSnapshot().url} with ${poppedHistoryToReplace}`);\n this.urlService.resetBrowserLocation(poppedHistoryToReplace, { replaceCurrent: true });\n console.log(`pushing ${activeUrl} back onto the history.`);\n this.urlService.resetBrowserLocation(activeUrl, { replaceCurrent: false });\n }\n\n\n ignore(event: RouterEvent, reason?: string): void {\n reason = reason ? ` -> ${reason}` : '';\n Logger.get(this).info(`Ignoring router event${reason}: ${event.constructor.name} -> ${event.url} :: ${this.toString()}`);\n }\n\n toString(): string {\n return `${this.constructor.name}(${this.debugState()})`;\n }\n\n protected debugState(properties?: string[]) {\n return (properties || this.debugPropertyKeys).map(p => {\n return `${p}: ${this[p]}`;\n }).join(', ');\n }\n\n async canDeactivatePlace(component: PlaceComponent, currentUrl: UrlSnapshot, nextUrl: UrlSnapshot): Promise<boolean | UrlSnapshot> {\n // console.log(`---> canDeactivatePlace(${component.placeDefinition.path}, ${currentUrl.url} -> ${nextUrl.url})`);\n // lookup the handler and create it if we've not seen it yet\n let handler = this.componentDeactivationHandlers.get(component);\n if (!handler) {\n const isPrimaryHandler = this.componentDeactivationHandlers.size === 0; // only primary handler cancels the app model interations\n handler = new PlaceComponentDeactivationHandler(component, this, isPrimaryHandler);\n this.componentDeactivationHandlers.set(component, handler);\n }\n return handler.canDeactivate(currentUrl, nextUrl).then(result => {\n // console.log(`<--- canDeactivatePlace(${component.placeDefinition.path}): ${result}`);\n return result;\n }).catch(error => {\n throw error;\n });\n }\n\n cancelCanDeactivateInteraction(newUrl: string): void {\n Logger.get(this).info(`back button pressed during navigation session interaction promise`);\n // detach the interaction from the session so it doesn't get disposed until the activity has finished\n // all it's things.\n const canDeactivateInteractionContext = this.detachCanDeactivateInteractionContext();\n // TODO: I need to make the exclusive interaction context disallow nested activities or\n // that would mess things up entirely. Or, can I do a context.abortAll().then(..)\n Logger.get(this).info('cancelling current navigation activity..');\n canDeactivateInteractionContext.cancelActiveActivity().then(() => {\n canDeactivateInteractionContext.dispose();\n });\n\n this.handleCanDeactivateCancelledEventScenario(newUrl);\n }\n\n abstract handleCanDeactivateCancelledEventScenario(newUrl: string): void\n\n protected reinstateUrlAfterAngularChangedItOnCancellation(url: string) {\n // Angular calls _this.resetUrlToCurrentUrlTree() on cancelling and fucks our history.\n // So this means that the top of the stack is the url we want to go back to, and not the one that was on\n // it before the cancel event fired.\n // So we need to:\n // - replace the just inserted url with the one that used to be there.\n // - push our actual url back onto the top of the stack.\n this.resetBrowserLocation(url, { replaceCurrent: true });\n }\n\n protected detachCanDeactivateInteractionContext(): InteractionContext {\n const context = this._interactionContext;\n this._interactionContext = null;\n return context;\n }\n}\n"]}
|
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
1
|
import { AbstractPopStateNavigation } from './abstract-pop-state-navigation';
|
|
6
2
|
import { WaitUntilPopStateDuringCanDeactivateInteractionFinishes } from './event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes';
|
|
7
3
|
export class PopStateNavigation extends AbstractPopStateNavigation {
|
|
8
|
-
/**
|
|
9
|
-
* @param {?} event
|
|
10
|
-
* @return {?}
|
|
11
|
-
*/
|
|
12
4
|
onRouterCancelled(event) {
|
|
13
5
|
this.repairBrowserHistoryAndUrlAfterGuardCancellation();
|
|
14
6
|
this.context.finishRoutingSession();
|
|
15
7
|
}
|
|
16
|
-
/**
|
|
17
|
-
* @param {?} event
|
|
18
|
-
* @return {?}
|
|
19
|
-
*/
|
|
20
8
|
onRouterEnd(event) {
|
|
21
9
|
this.context.finishRoutingSession(this.getVisits());
|
|
22
10
|
}
|
|
23
|
-
/**
|
|
24
|
-
* @param {?} locationTriggerUrl
|
|
25
|
-
* @return {?}
|
|
26
|
-
*/
|
|
27
11
|
handleCanDeactivateCancelledEventScenario(locationTriggerUrl) {
|
|
28
12
|
this.context.transitionTo(new WaitUntilPopStateDuringCanDeactivateInteractionFinishes(this.context, this.startingUrl, locationTriggerUrl, this.poppedHistoryUrl));
|
|
29
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pop-state-navigation.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/navigation/session/pop-state-navigation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pop-state-navigation.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/navigation/session/pop-state-navigation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAG7E,OAAO,EAAE,uDAAuD,EAAE,MAAM,+EAA+E,CAAC;AAExJ,MAAM,OAAO,kBAAmB,SAAQ,0BAA0B;IAEhE,iBAAiB,CAAC,KAAuB;QACvC,IAAI,CAAC,gDAAgD,EAAE,CAAC;QACxD,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IACtC,CAAC;IAED,WAAW,CAAC,KAAoB;QAC9B,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,yCAAyC,CAAC,kBAA0B;QAClE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,uDAAuD,CAAC,IAAI,CAAC,OAAO,EAChG,IAAI,CAAC,WAAW,EAChB,kBAAkB,EAClB,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC5B,CAAC;CAEF","sourcesContent":["import { NavigationCancel, NavigationEnd, NavigationError } from '@angular/router';\nimport { Logger, Trace } from '@coolon/pectin';\nimport { AbstractPopStateNavigation } from './abstract-pop-state-navigation';\nimport { NavigationContext } from './navigation-context';\nimport { NavigationSession } from './navigation-session';\nimport { WaitUntilPopStateDuringCanDeactivateInteractionFinishes } from './event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes';\n\nexport class PopStateNavigation extends AbstractPopStateNavigation {\n\n onRouterCancelled(event: NavigationCancel): void {\n this.repairBrowserHistoryAndUrlAfterGuardCancellation();\n this.context.finishRoutingSession();\n }\n\n onRouterEnd(event: NavigationEnd): void {\n this.context.finishRoutingSession(this.getVisits());\n }\n\n handleCanDeactivateCancelledEventScenario(locationTriggerUrl: string): void {\n this.context.transitionTo(new WaitUntilPopStateDuringCanDeactivateInteractionFinishes(this.context,\n this.startingUrl,\n locationTriggerUrl,\n this.poppedHistoryUrl));\n }\n\n}\n"]}
|