@coolon/angular-ui-powerups 0.0.135 → 1.0.0-alpha.11
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 +301 -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,8 +1,4 @@
|
|
|
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, __generator } from "tslib";
|
|
6
2
|
var VisitSanitiser = /** @class */ (function () {
|
|
7
3
|
function VisitSanitiser(activatedRoute, router, placeHistory, injector) {
|
|
8
4
|
this.activatedRoute = activatedRoute;
|
|
@@ -11,21 +7,10 @@ var VisitSanitiser = /** @class */ (function () {
|
|
|
11
7
|
this.injector = injector;
|
|
12
8
|
}
|
|
13
9
|
// @Trace()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* @param {?} visit
|
|
17
|
-
* @return {?}
|
|
18
|
-
*/
|
|
19
|
-
VisitSanitiser.prototype.sanitise =
|
|
20
|
-
// @Trace()
|
|
21
|
-
/**
|
|
22
|
-
* @param {?} visit
|
|
23
|
-
* @return {?}
|
|
24
|
-
*/
|
|
25
|
-
function (visit) {
|
|
26
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
10
|
+
VisitSanitiser.prototype.sanitise = function (visit) {
|
|
11
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27
12
|
var placeDef, routeIdDef, routeId, sanitisedValue, parameterDefs, sanitisedVisit, i, def, value, sanitisedValue;
|
|
28
|
-
return
|
|
13
|
+
return __generator(this, function (_a) {
|
|
29
14
|
switch (_a.label) {
|
|
30
15
|
case 0:
|
|
31
16
|
placeDef = visit.placeDefinition;
|
|
@@ -44,7 +29,6 @@ var VisitSanitiser = /** @class */ (function () {
|
|
|
44
29
|
}
|
|
45
30
|
_a.label = 2;
|
|
46
31
|
case 2:
|
|
47
|
-
// if we didn't replace the routeId we continue the url present parameters.
|
|
48
32
|
parameterDefs = placeDef.getVisitParameterDefs({
|
|
49
33
|
includeRouteParameters: true,
|
|
50
34
|
includeNonRouteParameters: true
|
|
@@ -74,26 +58,4 @@ var VisitSanitiser = /** @class */ (function () {
|
|
|
74
58
|
return VisitSanitiser;
|
|
75
59
|
}());
|
|
76
60
|
export { VisitSanitiser };
|
|
77
|
-
if (false) {
|
|
78
|
-
/**
|
|
79
|
-
* @type {?}
|
|
80
|
-
* @private
|
|
81
|
-
*/
|
|
82
|
-
VisitSanitiser.prototype.activatedRoute;
|
|
83
|
-
/**
|
|
84
|
-
* @type {?}
|
|
85
|
-
* @private
|
|
86
|
-
*/
|
|
87
|
-
VisitSanitiser.prototype.router;
|
|
88
|
-
/**
|
|
89
|
-
* @type {?}
|
|
90
|
-
* @private
|
|
91
|
-
*/
|
|
92
|
-
VisitSanitiser.prototype.placeHistory;
|
|
93
|
-
/**
|
|
94
|
-
* @type {?}
|
|
95
|
-
* @private
|
|
96
|
-
*/
|
|
97
|
-
VisitSanitiser.prototype.injector;
|
|
98
|
-
}
|
|
99
61
|
//# sourceMappingURL=visit-sanitiser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visit-sanitiser.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/route/visit-sanitiser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"visit-sanitiser.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/route/visit-sanitiser.ts"],"names":[],"mappings":";AAMA;IACE,wBAAoB,cAAsC,EAAU,MAAc,EAAU,YAA0B,EAAU,QAAkB;QAA9H,mBAAc,GAAd,cAAc,CAAwB;QAAU,WAAM,GAAN,MAAM,CAAQ;QAAU,iBAAY,GAAZ,YAAY,CAAc;QAAU,aAAQ,GAAR,QAAQ,CAAU;IAElJ,CAAC;IAED,WAAW;IACL,iCAAQ,GAAd,UAAe,KAAY;;;;;;wBACnB,QAAQ,GAAG,KAAK,CAAC,eAAe,CAAC;6BACnC,QAAQ,CAAC,UAAU,EAAE,EAArB,wBAAqB;wBACjB,UAAU,GAAG,QAAQ,CAAC,sBAAsB,EAAE,CAAC;wBAC/C,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;wBACZ,qBAAM,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAA;;wBAA5F,cAAc,GAAG,SAA2E;wBAClG,0CAA0C;wBAC1C,oCAAoC;wBACpC,IAAI,UAAU,CAAC,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE;4BAClD,+DAA+D;4BAC/D,qCAAqC;4BACrC,sBAAO,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,EAAC;yBAClD;;;wBAIG,aAAa,GAAG,QAAQ,CAAC,qBAAqB,CAAC;4BACnD,sBAAsB,EAAE,IAAI;4BAC5B,yBAAyB,EAAE,IAAI;yBAChC,CAAC,CAAC;wBACC,cAAc,GAAU,KAAK,CAAC;wBACzB,CAAC,GAAG,CAAC;;;6BAAE,CAAA,CAAC,GAAG,aAAa,CAAC,MAAM,CAAA;wBAChC,GAAG,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;wBACvB,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;wBACpB,qBAAM,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAA;;wBAA5F,cAAc,GAAG,SAA2E;wBAClG,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE;4BACzC,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;yBAC9D;;;wBANuC,CAAC,EAAE,CAAA;;4BAS7C,sBAAO,cAAc,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,EAAC;;;;KACtE;IAEH,qBAAC;AAAD,CAAC,AAvCD,IAuCC","sourcesContent":["import { Injector } from '@angular/core';\nimport { ActivatedRouteSnapshot, Router } from '@angular/router';\nimport { Trace } from '@coolon/pectin';\nimport { PlaceHistory } from '../place-history';\nimport { Visit } from '../visit';\n\nexport class VisitSanitiser {\n constructor(private activatedRoute: ActivatedRouteSnapshot, private router: Router, private placeHistory: PlaceHistory, private injector: Injector) {\n\n }\n\n // @Trace()\n async sanitise(visit: Visit): Promise<Visit> {\n const placeDef = visit.placeDefinition;\n if (placeDef.hasRouteId()) {\n const routeIdDef = placeDef.getRouteIdParameterDef();\n const routeId = visit.getRouteId();\n const sanitisedValue = await routeIdDef.sanitise(routeId, visit, this.placeHistory, this.injector);\n // console.log({routeId, sanitisedValue});\n // ###------- EARLY EXIT --------###\n if (routeIdDef.hasChanged(routeId, sanitisedValue)) {\n // if the route id has changed we redirect immediately as other\n // parameter sanitisers might use it.\n return visit.replace(routeIdDef, sanitisedValue);\n }\n }\n\n // if we didn't replace the routeId we continue the url present parameters.\n const parameterDefs = placeDef.getVisitParameterDefs({\n includeRouteParameters: true,\n includeNonRouteParameters: true\n });\n let sanitisedVisit: Visit = visit;\n for (let i = 0; i < parameterDefs.length; i++) {\n const def = parameterDefs[i];\n const value = visit.getParameter(def.name);\n const sanitisedValue = await def.sanitise(value, sanitisedVisit, this.placeHistory, this.injector);\n if (def.hasChanged(value, sanitisedValue)) {\n sanitisedVisit = sanitisedVisit.replace(def, sanitisedValue);\n }\n }\n\n return sanitisedVisit.hasChangedFrom(visit) ? sanitisedVisit : visit;\n }\n\n}\n"]}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
5
2
|
import { Location } from '@angular/common';
|
|
6
3
|
import { Injectable } from '@angular/core';
|
|
7
4
|
import { Router, UrlSerializer } from '@angular/router';
|
|
@@ -15,162 +12,66 @@ var UrlService = /** @class */ (function () {
|
|
|
15
12
|
this.angularLocation = angularLocation;
|
|
16
13
|
this.urlSerializer = urlSerializer;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
* @param {?} url
|
|
20
|
-
* @return {?}
|
|
21
|
-
*/
|
|
22
|
-
UrlService.prototype.parseUrl = /**
|
|
23
|
-
* @param {?} url
|
|
24
|
-
* @return {?}
|
|
25
|
-
*/
|
|
26
|
-
function (url) {
|
|
15
|
+
UrlService.prototype.parseUrl = function (url) {
|
|
27
16
|
return new UrlSnapshot(this.urlSerializer, url);
|
|
28
17
|
};
|
|
29
|
-
|
|
30
|
-
* @param {...?} visits
|
|
31
|
-
* @return {?}
|
|
32
|
-
*/
|
|
33
|
-
UrlService.prototype.createUrlSnapshot = /**
|
|
34
|
-
* @param {...?} visits
|
|
35
|
-
* @return {?}
|
|
36
|
-
*/
|
|
37
|
-
function () {
|
|
18
|
+
UrlService.prototype.createUrlSnapshot = function () {
|
|
38
19
|
var _this = this;
|
|
39
20
|
var visits = [];
|
|
40
21
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
41
22
|
visits[_i] = arguments[_i];
|
|
42
23
|
}
|
|
43
|
-
/** @type {?} */
|
|
44
24
|
var bits = [];
|
|
45
|
-
visits.forEach((
|
|
46
|
-
* @param {?} v
|
|
47
|
-
* @return {?}
|
|
48
|
-
*/
|
|
49
|
-
function (v) {
|
|
25
|
+
visits.forEach(function (v) {
|
|
50
26
|
bits.push(_this.parseUrl("" + v.placeDefinition.path).updateVisitSegments(v).url);
|
|
51
|
-
})
|
|
27
|
+
});
|
|
52
28
|
return this.parseUrl(bits.join(''));
|
|
53
29
|
};
|
|
54
|
-
|
|
55
|
-
* @return {?}
|
|
56
|
-
*/
|
|
57
|
-
UrlService.prototype.getCurrentRouterUrl = /**
|
|
58
|
-
* @return {?}
|
|
59
|
-
*/
|
|
60
|
-
function () {
|
|
30
|
+
UrlService.prototype.getCurrentRouterUrl = function () {
|
|
61
31
|
return this.angularRouter.routerState ? this.angularRouter.routerState.snapshot.url : null;
|
|
62
32
|
};
|
|
63
|
-
|
|
64
|
-
* @return {?}
|
|
65
|
-
*/
|
|
66
|
-
UrlService.prototype.getCurrentLocationUrl = /**
|
|
67
|
-
* @return {?}
|
|
68
|
-
*/
|
|
69
|
-
function () {
|
|
33
|
+
UrlService.prototype.getCurrentLocationUrl = function () {
|
|
70
34
|
return this.angularLocation.path();
|
|
71
35
|
};
|
|
72
36
|
/**
|
|
73
37
|
* Return the a UrlSnapshot using the browsers current location. Note this may not be the same
|
|
74
38
|
* as the routers current url.
|
|
75
39
|
*/
|
|
76
|
-
|
|
77
|
-
* Return the a UrlSnapshot using the browsers current location. Note this may not be the same
|
|
78
|
-
* as the routers current url.
|
|
79
|
-
* @return {?}
|
|
80
|
-
*/
|
|
81
|
-
UrlService.prototype.getCurrentLocationUrlSnapshot = /**
|
|
82
|
-
* Return the a UrlSnapshot using the browsers current location. Note this may not be the same
|
|
83
|
-
* as the routers current url.
|
|
84
|
-
* @return {?}
|
|
85
|
-
*/
|
|
86
|
-
function () {
|
|
40
|
+
UrlService.prototype.getCurrentLocationUrlSnapshot = function () {
|
|
87
41
|
return this.parseUrl(this.getCurrentLocationUrl());
|
|
88
42
|
};
|
|
89
43
|
/**
|
|
90
44
|
* Return the a UrlSnapshot using the routers current state. This may not be the same as
|
|
91
45
|
* the browsers actual url.
|
|
92
46
|
*/
|
|
93
|
-
|
|
94
|
-
* Return the a UrlSnapshot using the routers current state. This may not be the same as
|
|
95
|
-
* the browsers actual url.
|
|
96
|
-
* @return {?}
|
|
97
|
-
*/
|
|
98
|
-
UrlService.prototype.getCurrentRouterSnapshot = /**
|
|
99
|
-
* Return the a UrlSnapshot using the routers current state. This may not be the same as
|
|
100
|
-
* the browsers actual url.
|
|
101
|
-
* @return {?}
|
|
102
|
-
*/
|
|
103
|
-
function () {
|
|
47
|
+
UrlService.prototype.getCurrentRouterSnapshot = function () {
|
|
104
48
|
return this.parseUrl(this.getCurrentRouterUrl());
|
|
105
49
|
};
|
|
106
|
-
|
|
107
|
-
* @param {?} url
|
|
108
|
-
* @return {?}
|
|
109
|
-
*/
|
|
110
|
-
UrlService.prototype.getActiveInteractionIdsFromUrl = /**
|
|
111
|
-
* @param {?} url
|
|
112
|
-
* @return {?}
|
|
113
|
-
*/
|
|
114
|
-
function (url) {
|
|
50
|
+
UrlService.prototype.getActiveInteractionIdsFromUrl = function (url) {
|
|
115
51
|
return this.parseUrl(url).getInteractionIds();
|
|
116
52
|
};
|
|
117
|
-
|
|
118
|
-
* @param {?} url
|
|
119
|
-
* @return {?}
|
|
120
|
-
*/
|
|
121
|
-
UrlService.prototype.hasActiveInteractions = /**
|
|
122
|
-
* @param {?} url
|
|
123
|
-
* @return {?}
|
|
124
|
-
*/
|
|
125
|
-
function (url) {
|
|
53
|
+
UrlService.prototype.hasActiveInteractions = function (url) {
|
|
126
54
|
return this.getActiveInteractionIdsFromUrl(url).length > 0;
|
|
127
55
|
};
|
|
128
|
-
|
|
129
|
-
* @param {?} url
|
|
130
|
-
* @param {?} options
|
|
131
|
-
* @return {?}
|
|
132
|
-
*/
|
|
133
|
-
UrlService.prototype.resetBrowserLocation = /**
|
|
134
|
-
* @param {?} url
|
|
135
|
-
* @param {?} options
|
|
136
|
-
* @return {?}
|
|
137
|
-
*/
|
|
138
|
-
function (url, options) {
|
|
56
|
+
UrlService.prototype.resetBrowserLocation = function (url, options) {
|
|
139
57
|
options.replaceCurrent ? this.angularLocation.replaceState(url) : this.angularLocation.go(url);
|
|
140
58
|
};
|
|
141
|
-
|
|
142
|
-
* @return {?}
|
|
143
|
-
*/
|
|
144
|
-
UrlService.prototype.back = /**
|
|
145
|
-
* @return {?}
|
|
146
|
-
*/
|
|
147
|
-
function () {
|
|
59
|
+
UrlService.prototype.back = function () {
|
|
148
60
|
this.angularLocation.back();
|
|
149
61
|
};
|
|
150
|
-
UrlService.decorators = [
|
|
151
|
-
{ type: Injectable, args: [{
|
|
152
|
-
providedIn: 'root'
|
|
153
|
-
},] }
|
|
154
|
-
];
|
|
155
|
-
/** @nocollapse */
|
|
156
62
|
UrlService.ctorParameters = function () { return [
|
|
157
63
|
{ type: Router },
|
|
158
64
|
{ type: Location },
|
|
159
65
|
{ type: UrlSerializer }
|
|
160
66
|
]; };
|
|
161
|
-
|
|
67
|
+
UrlService.ɵprov = i0.ɵɵdefineInjectable({ factory: function UrlService_Factory() { return new UrlService(i0.ɵɵinject(i1.Router), i0.ɵɵinject(i2.Location), i0.ɵɵinject(i1.UrlSerializer)); }, token: UrlService, providedIn: "root" });
|
|
68
|
+
UrlService = __decorate([
|
|
69
|
+
Injectable({
|
|
70
|
+
providedIn: 'root'
|
|
71
|
+
}),
|
|
72
|
+
__metadata("design:paramtypes", [Router, Location, UrlSerializer])
|
|
73
|
+
], UrlService);
|
|
162
74
|
return UrlService;
|
|
163
75
|
}());
|
|
164
76
|
export { UrlService };
|
|
165
|
-
if (false) {
|
|
166
|
-
/**
|
|
167
|
-
* @type {?}
|
|
168
|
-
* @private
|
|
169
|
-
*/
|
|
170
|
-
UrlService.prototype.angularRouter;
|
|
171
|
-
/** @type {?} */
|
|
172
|
-
UrlService.prototype.angularLocation;
|
|
173
|
-
/** @type {?} */
|
|
174
|
-
UrlService.prototype.urlSerializer;
|
|
175
|
-
}
|
|
176
77
|
//# sourceMappingURL=url-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-service.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/url-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"url-service.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/url-service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;;;;AAM7C;IACE,oBAA6B,aAAqB,EAAW,eAAyB,EAAW,aAA4B;QAAhG,kBAAa,GAAb,aAAa,CAAQ;QAAW,oBAAe,GAAf,eAAe,CAAU;QAAW,kBAAa,GAAb,aAAa,CAAe;IAC7H,CAAC;IAED,6BAAQ,GAAR,UAAS,GAAW;QAClB,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC;IAED,sCAAiB,GAAjB;QAAA,iBAMC;QANiB,gBAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,2BAAkB;;QAClC,IAAM,IAAI,GAAG,EAAE,CAAC;QAChB,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC;YACd,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,QAAQ,CAAC,KAAG,CAAC,CAAC,eAAe,CAAC,IAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,wCAAmB,GAAnB;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7F,CAAC;IAED,0CAAqB,GAArB;QACE,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,kDAA6B,GAA7B;QACE,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACH,6CAAwB,GAAxB;QACE,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,mDAA8B,GAA9B,UAA+B,GAAW;QACxC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAChD,CAAC;IAED,0CAAqB,GAArB,UAAsB,GAAW;QAC/B,OAAO,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7D,CAAC;IAED,yCAAoB,GAApB,UAAqB,GAAW,EAAE,OAAoC;QACpE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACjG,CAAC;IAED,yBAAI,GAAJ;QACE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;;gBArD2C,MAAM;gBAA4B,QAAQ;gBAA0B,aAAa;;;IADlH,UAAU;QAHtB,UAAU,CAAC;YACV,UAAU,EAAE,MAAM;SACnB,CAAC;yCAE4C,MAAM,EAA4B,QAAQ,EAA0B,aAAa;OADlH,UAAU,CAyDtB;qBAlED;CAkEC,AAzDD,IAyDC;SAzDY,UAAU","sourcesContent":["import { Location } from '@angular/common';\nimport { Injectable } from '@angular/core';\nimport { Router, UrlSerializer } from '@angular/router';\nimport { UrlSnapshot } from './url-snapshot';\nimport { Visit } from './visit';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UrlService {\n constructor(private readonly angularRouter: Router, readonly angularLocation: Location, readonly urlSerializer: UrlSerializer) {\n }\n\n parseUrl(url: string): UrlSnapshot {\n return new UrlSnapshot(this.urlSerializer, url);\n }\n\n createUrlSnapshot(...visits: Visit[]): UrlSnapshot {\n const bits = [];\n visits.forEach(v => {\n bits.push(this.parseUrl(`${v.placeDefinition.path}`).updateVisitSegments(v).url);\n });\n return this.parseUrl(bits.join(''));\n }\n\n getCurrentRouterUrl(): string {\n return this.angularRouter.routerState ? this.angularRouter.routerState.snapshot.url : null;\n }\n\n getCurrentLocationUrl(): string {\n return this.angularLocation.path();\n }\n\n /**\n * Return the a UrlSnapshot using the browsers current location. Note this may not be the same\n * as the routers current url.\n */\n getCurrentLocationUrlSnapshot(): UrlSnapshot {\n return this.parseUrl(this.getCurrentLocationUrl());\n }\n\n /**\n * Return the a UrlSnapshot using the routers current state. This may not be the same as\n * the browsers actual url.\n */\n getCurrentRouterSnapshot(): UrlSnapshot {\n return this.parseUrl(this.getCurrentRouterUrl());\n }\n\n getActiveInteractionIdsFromUrl(url: string): string[] {\n return this.parseUrl(url).getInteractionIds();\n }\n\n hasActiveInteractions(url: string) {\n return this.getActiveInteractionIdsFromUrl(url).length > 0;\n }\n\n resetBrowserLocation(url: string, options: { replaceCurrent: boolean }) {\n options.replaceCurrent ? this.angularLocation.replaceState(url) : this.angularLocation.go(url);\n }\n\n back() {\n this.angularLocation.back();\n }\n\n\n}\n"]}
|
|
@@ -1,8 +1,4 @@
|
|
|
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 { __read, __spread } from "tslib";
|
|
6
2
|
import { UrlSegment } from '@angular/router';
|
|
7
3
|
import _ from 'lodash';
|
|
8
4
|
var UrlSnapshot = /** @class */ (function () {
|
|
@@ -12,63 +8,25 @@ var UrlSnapshot = /** @class */ (function () {
|
|
|
12
8
|
this.url = url;
|
|
13
9
|
this.urlTree = urlSerializer.parse(url);
|
|
14
10
|
}
|
|
15
|
-
|
|
16
|
-
* @param {?} visit
|
|
17
|
-
* @return {?}
|
|
18
|
-
*/
|
|
19
|
-
UrlSnapshot.prototype.updateVisitSegments = /**
|
|
20
|
-
* @param {?} visit
|
|
21
|
-
* @return {?}
|
|
22
|
-
*/
|
|
23
|
-
function (visit) {
|
|
24
|
-
/** @type {?} */
|
|
11
|
+
UrlSnapshot.prototype.updateVisitSegments = function (visit) {
|
|
25
12
|
var urlTree = this.urlSerializer.parse(this.url);
|
|
26
13
|
// Ugly, but it works for now.
|
|
27
|
-
|
|
28
|
-
var segments = tslib_1.__spread(this.getPrimarySegments(urlTree));
|
|
29
|
-
/** @type {?} */
|
|
14
|
+
var segments = __spread(this.getPrimarySegments(urlTree));
|
|
30
15
|
var visitSegments = this.getSegmentsFor(visit);
|
|
31
|
-
|
|
32
|
-
var replaceAt = segments.findIndex((/**
|
|
33
|
-
* @param {?} segment
|
|
34
|
-
* @return {?}
|
|
35
|
-
*/
|
|
36
|
-
function (segment) { return segment.path === visitSegments[0].path; }));
|
|
16
|
+
var replaceAt = segments.findIndex(function (segment) { return segment.path === visitSegments[0].path; });
|
|
37
17
|
// do not use the return value, it's the items that were removed!
|
|
38
|
-
segments.splice.apply(segments,
|
|
18
|
+
segments.splice.apply(segments, __spread([replaceAt, visitSegments.length], visitSegments));
|
|
39
19
|
urlTree.root.children.primary.segments = segments;
|
|
40
20
|
return new UrlSnapshot(this.urlSerializer, urlTree.toString());
|
|
41
21
|
};
|
|
42
|
-
|
|
43
|
-
* @private
|
|
44
|
-
* @param {?} urlTree
|
|
45
|
-
* @return {?}
|
|
46
|
-
*/
|
|
47
|
-
UrlSnapshot.prototype.getPrimarySegments = /**
|
|
48
|
-
* @private
|
|
49
|
-
* @param {?} urlTree
|
|
50
|
-
* @return {?}
|
|
51
|
-
*/
|
|
52
|
-
function (urlTree) {
|
|
22
|
+
UrlSnapshot.prototype.getPrimarySegments = function (urlTree) {
|
|
53
23
|
return this.urlTree.root.children.primary.segments;
|
|
54
24
|
};
|
|
55
25
|
/**
|
|
56
26
|
* Converts the visit into segments. Please not that these segments are not e
|
|
57
27
|
* @param visit
|
|
58
28
|
*/
|
|
59
|
-
|
|
60
|
-
* Converts the visit into segments. Please not that these segments are not e
|
|
61
|
-
* @protected
|
|
62
|
-
* @param {?} visit
|
|
63
|
-
* @return {?}
|
|
64
|
-
*/
|
|
65
|
-
UrlSnapshot.prototype.getSegmentsFor = /**
|
|
66
|
-
* Converts the visit into segments. Please not that these segments are not e
|
|
67
|
-
* @protected
|
|
68
|
-
* @param {?} visit
|
|
69
|
-
* @return {?}
|
|
70
|
-
*/
|
|
71
|
-
function (visit) {
|
|
29
|
+
UrlSnapshot.prototype.getSegmentsFor = function (visit) {
|
|
72
30
|
return visit.placeDefinition.hasRouteId() ?
|
|
73
31
|
[
|
|
74
32
|
// NOTE:
|
|
@@ -82,29 +40,10 @@ var UrlSnapshot = /** @class */ (function () {
|
|
|
82
40
|
new UrlSegment(visit.placeDefinition.path, visit.placeDefinition.getFormattedRouteParameters(visit))
|
|
83
41
|
];
|
|
84
42
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
* @return {?}
|
|
88
|
-
*/
|
|
89
|
-
UrlSnapshot.prototype.includesPathOf = /**
|
|
90
|
-
* @param {?} placeDef
|
|
91
|
-
* @return {?}
|
|
92
|
-
*/
|
|
93
|
-
function (placeDef) {
|
|
94
|
-
return this.getPrimarySegments(this.urlTree).find((/**
|
|
95
|
-
* @param {?} s
|
|
96
|
-
* @return {?}
|
|
97
|
-
*/
|
|
98
|
-
function (s) { return s.path === placeDef.path; }));
|
|
43
|
+
UrlSnapshot.prototype.includesPathOf = function (placeDef) {
|
|
44
|
+
return this.getPrimarySegments(this.urlTree).find(function (s) { return s.path === placeDef.path; });
|
|
99
45
|
};
|
|
100
|
-
|
|
101
|
-
* @return {?}
|
|
102
|
-
*/
|
|
103
|
-
UrlSnapshot.prototype.getInteractionIds = /**
|
|
104
|
-
* @return {?}
|
|
105
|
-
*/
|
|
106
|
-
function () {
|
|
107
|
-
/** @type {?} */
|
|
46
|
+
UrlSnapshot.prototype.getInteractionIds = function () {
|
|
108
47
|
var queryParam = this.urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM];
|
|
109
48
|
if (queryParam) {
|
|
110
49
|
return UrlSnapshot.parseInteractionIds(queryParam);
|
|
@@ -113,114 +52,47 @@ var UrlSnapshot = /** @class */ (function () {
|
|
|
113
52
|
return [];
|
|
114
53
|
}
|
|
115
54
|
};
|
|
116
|
-
|
|
117
|
-
* @return {?}
|
|
118
|
-
*/
|
|
119
|
-
UrlSnapshot.prototype.hasInteractions = /**
|
|
120
|
-
* @return {?}
|
|
121
|
-
*/
|
|
122
|
-
function () {
|
|
55
|
+
UrlSnapshot.prototype.hasInteractions = function () {
|
|
123
56
|
return this.getInteractionIds().length > 0;
|
|
124
57
|
};
|
|
125
|
-
|
|
126
|
-
* @param {?} ids
|
|
127
|
-
* @return {?}
|
|
128
|
-
*/
|
|
129
|
-
UrlSnapshot.prototype.hasInteractionIds = /**
|
|
130
|
-
* @param {?} ids
|
|
131
|
-
* @return {?}
|
|
132
|
-
*/
|
|
133
|
-
function (ids) {
|
|
58
|
+
UrlSnapshot.prototype.hasInteractionIds = function (ids) {
|
|
134
59
|
return _.isEqual(this.getInteractionIds(), ids);
|
|
135
60
|
};
|
|
136
61
|
// @Trace()
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* @param {?} ids
|
|
140
|
-
* @return {?}
|
|
141
|
-
*/
|
|
142
|
-
UrlSnapshot.prototype.updateInteractionIds =
|
|
143
|
-
// @Trace()
|
|
144
|
-
/**
|
|
145
|
-
* @param {?} ids
|
|
146
|
-
* @return {?}
|
|
147
|
-
*/
|
|
148
|
-
function (ids) {
|
|
62
|
+
UrlSnapshot.prototype.updateInteractionIds = function (ids) {
|
|
149
63
|
if (ids.length === 0) {
|
|
150
64
|
return this.removeInteractionIds();
|
|
151
65
|
}
|
|
152
66
|
else {
|
|
153
|
-
/** @type {?} */
|
|
154
67
|
var urlTree = this.urlSerializer.parse(this.url);
|
|
155
68
|
urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM] = UrlSnapshot.createPathIdFor(ids);
|
|
156
69
|
return new UrlSnapshot(this.urlSerializer, urlTree.toString());
|
|
157
70
|
}
|
|
158
71
|
};
|
|
159
72
|
// @Trace()
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* @return {?}
|
|
163
|
-
*/
|
|
164
|
-
UrlSnapshot.prototype.removeInteractionIds =
|
|
165
|
-
// @Trace()
|
|
166
|
-
/**
|
|
167
|
-
* @return {?}
|
|
168
|
-
*/
|
|
169
|
-
function () {
|
|
170
|
-
/** @type {?} */
|
|
73
|
+
UrlSnapshot.prototype.removeInteractionIds = function () {
|
|
171
74
|
var urlTree = this.urlSerializer.parse(this.url);
|
|
172
75
|
if (urlTree.queryParams && urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM]) {
|
|
173
76
|
urlTree.queryParams = {}; //[UrlSnapshot.INTERACTION_ROUTER_OUTLET]
|
|
174
77
|
}
|
|
175
78
|
return new UrlSnapshot(this.urlSerializer, urlTree.toString());
|
|
176
79
|
};
|
|
177
|
-
|
|
178
|
-
* @return {?}
|
|
179
|
-
*/
|
|
180
|
-
UrlSnapshot.prototype.toString = /**
|
|
181
|
-
* @return {?}
|
|
182
|
-
*/
|
|
183
|
-
function () {
|
|
80
|
+
UrlSnapshot.prototype.toString = function () {
|
|
184
81
|
return "UrlSnapshot(" + this.url + ")";
|
|
185
82
|
};
|
|
186
83
|
return UrlSnapshot;
|
|
187
84
|
}());
|
|
188
85
|
export { UrlSnapshot };
|
|
189
|
-
if (false) {
|
|
190
|
-
/** @type {?} */
|
|
191
|
-
UrlSnapshot.prototype.urlTree;
|
|
192
|
-
/** @type {?} */
|
|
193
|
-
UrlSnapshot.prototype.urlSerializer;
|
|
194
|
-
/** @type {?} */
|
|
195
|
-
UrlSnapshot.prototype.url;
|
|
196
|
-
}
|
|
197
86
|
(function (UrlSnapshot) {
|
|
198
87
|
UrlSnapshot.INTERACTION_QUERY_PARAM = 'aup-interactions';
|
|
199
88
|
UrlSnapshot.INTERACTION_ID_SEPARATOR = '--';
|
|
200
|
-
/**
|
|
201
|
-
* @param {?} path
|
|
202
|
-
* @return {?}
|
|
203
|
-
*/
|
|
204
89
|
function parseInteractionIds(path) {
|
|
205
90
|
return path.split(UrlSnapshot.INTERACTION_ID_SEPARATOR);
|
|
206
91
|
}
|
|
207
92
|
UrlSnapshot.parseInteractionIds = parseInteractionIds;
|
|
208
|
-
/**
|
|
209
|
-
* @param {?} interactionIds
|
|
210
|
-
* @return {?}
|
|
211
|
-
*/
|
|
212
93
|
function createPathIdFor(interactionIds) {
|
|
213
94
|
return interactionIds.join(UrlSnapshot.INTERACTION_ID_SEPARATOR);
|
|
214
95
|
}
|
|
215
96
|
UrlSnapshot.createPathIdFor = createPathIdFor;
|
|
216
|
-
/**
|
|
217
|
-
* @record
|
|
218
|
-
*/
|
|
219
|
-
function NavigationOptions() { }
|
|
220
|
-
UrlSnapshot.NavigationOptions = NavigationOptions;
|
|
221
|
-
if (false) {
|
|
222
|
-
/** @type {?|undefined} */
|
|
223
|
-
NavigationOptions.prototype.replaceUrl;
|
|
224
|
-
}
|
|
225
97
|
})(UrlSnapshot || (UrlSnapshot = {}));
|
|
226
98
|
//# sourceMappingURL=url-snapshot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-snapshot.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/url-snapshot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"url-snapshot.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/url-snapshot.ts"],"names":[],"mappings":"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","sourcesContent":["import { UrlSegment, UrlSerializer, UrlTree } from '@angular/router';\nimport _ from 'lodash';\nimport { PlaceDefinition } from './place-definition';\nimport { Visit } from './visit';\n\nexport class UrlSnapshot {\n\n readonly urlTree: UrlTree;\n\n // TODO: Update this accept a url Parser so it can be immutable and generate new trees on mutation using toString() are parseUrl.\n constructor(readonly urlSerializer: UrlSerializer, readonly url: string) {\n this.urlTree = urlSerializer.parse(url);\n }\n\n public updateVisitSegments(visit: Visit): UrlSnapshot {\n const urlTree = this.urlSerializer.parse(this.url);\n // Ugly, but it works for now.\n const segments = [...this.getPrimarySegments(urlTree)];\n const visitSegments = this.getSegmentsFor(visit);\n const replaceAt = segments.findIndex(segment => segment.path === visitSegments[0].path);\n // do not use the return value, it's the items that were removed!\n segments.splice(replaceAt, visitSegments.length, ...visitSegments);\n urlTree.root.children.primary.segments = segments;\n return new UrlSnapshot(this.urlSerializer, urlTree.toString());\n }\n\n private getPrimarySegments(urlTree: UrlTree) {\n return this.urlTree.root.children.primary.segments;\n }\n\n /**\n * Converts the visit into segments. Please not that these segments are not e\n * @param visit\n */\n protected getSegmentsFor(visit: Visit): UrlSegment[] {\n return visit.placeDefinition.hasRouteId() ?\n [\n // NOTE:\n // It's important to attach the params to the root path and not the id. If we attach them\n // to an empty id then the angular router won't match the pattern.\n new UrlSegment(visit.placeDefinition.path, visit.placeDefinition.getFormattedRouteParameters(visit)),\n new UrlSegment(visit.placeDefinition.getFormattedRouteId(visit), {})]\n :\n [\n new UrlSegment(visit.placeDefinition.path, visit.placeDefinition.getFormattedRouteParameters(visit))\n ];\n }\n\n includesPathOf(placeDef: PlaceDefinition) {\n return this.getPrimarySegments(this.urlTree).find(s => s.path === placeDef.path);\n }\n\n getInteractionIds() {\n const queryParam = this.urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM];\n if (queryParam) {\n return UrlSnapshot.parseInteractionIds(queryParam);\n } else {\n return [];\n }\n }\n\n hasInteractions() {\n return this.getInteractionIds().length > 0;\n }\n\n hasInteractionIds(ids: string[]): boolean {\n return _.isEqual(this.getInteractionIds(), ids);\n }\n\n // @Trace()\n updateInteractionIds(ids: string[]): UrlSnapshot {\n if (ids.length === 0) {\n return this.removeInteractionIds();\n } else {\n const urlTree = this.urlSerializer.parse(this.url);\n urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM] = UrlSnapshot.createPathIdFor(ids);\n return new UrlSnapshot(this.urlSerializer, urlTree.toString());\n }\n }\n\n // @Trace()\n removeInteractionIds(): UrlSnapshot {\n const urlTree = this.urlSerializer.parse(this.url);\n if (urlTree.queryParams && urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM]) {\n urlTree.queryParams = {};//[UrlSnapshot.INTERACTION_ROUTER_OUTLET]\n }\n return new UrlSnapshot(this.urlSerializer, urlTree.toString());\n }\n\n toString(): string {\n return `UrlSnapshot(${this.url})`;\n }\n\n // withOptions(options: NavigationExtras) {\n // return new UrlSnapshot(this.urlSerializer, this.url, options);\n // }\n //\n // @Trace()\n // getNavigationExtras(): NavigationExtras {\n // return this.options;\n // }\n\n}\n\nexport namespace UrlSnapshot {\n\n export const INTERACTION_QUERY_PARAM = 'aup-interactions';\n export const INTERACTION_ID_SEPARATOR = '--';\n\n export function parseInteractionIds(path: string) {\n return path.split(INTERACTION_ID_SEPARATOR);\n }\n\n export function createPathIdFor(interactionIds: string[]) {\n return interactionIds.join(INTERACTION_ID_SEPARATOR);\n }\n\n export interface NavigationOptions {\n replaceUrl?: boolean;\n }\n}\n"]}
|