@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,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
1
|
+
var PlaceComponent_1;
|
|
2
|
+
import { __decorate, __metadata } from "tslib";
|
|
3
|
+
import { Directive } from '@angular/core';
|
|
6
4
|
import { assert, Binding, DebugContext, Dsl, Guard, lang, MutableValueModel } from '@coolon/pectin';
|
|
7
5
|
import { Klass } from '@coolon/typescript-utilities';
|
|
8
6
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator';
|
|
@@ -10,90 +8,46 @@ import 'reflect-metadata';
|
|
|
10
8
|
import { DisposableComponent } from '../components/disposable-component';
|
|
11
9
|
import { PlaceDefinition } from './place-definition';
|
|
12
10
|
// RAKE: making this Symbol(...) broke things.
|
|
13
|
-
/** @type {?} */
|
|
14
11
|
export const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';
|
|
15
12
|
// this one seems ok.
|
|
16
|
-
/** @type {?} */
|
|
17
13
|
export const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');
|
|
18
|
-
|
|
14
|
+
let PlaceComponent = PlaceComponent_1 = class PlaceComponent extends DisposableComponent {
|
|
19
15
|
constructor() {
|
|
20
16
|
super();
|
|
21
17
|
this.visitModel = new MutableValueModel();
|
|
22
18
|
this._inVisitUpdate = new Guard();
|
|
23
19
|
}
|
|
24
20
|
// @Trace()
|
|
25
|
-
/**
|
|
26
|
-
* @param {?} visit
|
|
27
|
-
* @param {?} notifyVisitChanged
|
|
28
|
-
* @return {?}
|
|
29
|
-
*/
|
|
30
21
|
initialiseVisit(visit, notifyVisitChanged) {
|
|
31
22
|
assert.isNil(this.visitModel.value);
|
|
32
23
|
const { when } = Dsl.disposeWith(this);
|
|
33
24
|
this.visitModel.value = visit;
|
|
34
25
|
DebugContext.get(this.visitModel).tag(`${this.placeDefinition.component.name}.visitModel`);
|
|
35
|
-
this.placeDefinition.getVisitParameterDefs().forEach((
|
|
36
|
-
|
|
37
|
-
* @return {?}
|
|
38
|
-
*/
|
|
39
|
-
parameterDef => this.installBinding(parameterDef)));
|
|
40
|
-
when.valueOf(this.visitModel).changes((/**
|
|
41
|
-
* @param {?} current
|
|
42
|
-
* @param {?} previous
|
|
43
|
-
* @return {?}
|
|
44
|
-
*/
|
|
45
|
-
(current, previous) => {
|
|
26
|
+
this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => this.installBinding(parameterDef));
|
|
27
|
+
when.valueOf(this.visitModel).changes((current, previous) => {
|
|
46
28
|
notifyVisitChanged(current, previous);
|
|
47
|
-
}
|
|
29
|
+
}, { unless: this._inVisitUpdate });
|
|
48
30
|
}
|
|
49
|
-
/**
|
|
50
|
-
* @param {?} visit
|
|
51
|
-
* @return {?}
|
|
52
|
-
*/
|
|
53
31
|
updateVisit(visit) {
|
|
54
32
|
assert.isTruthy(this.isInitialised());
|
|
55
33
|
assert.notNil(visit);
|
|
56
|
-
this._inVisitUpdate.whileTrue((
|
|
57
|
-
* @return {?}
|
|
58
|
-
*/
|
|
59
|
-
() => {
|
|
34
|
+
this._inVisitUpdate.whileTrue(() => {
|
|
60
35
|
this.visitModel.value = visit;
|
|
61
|
-
})
|
|
36
|
+
});
|
|
62
37
|
}
|
|
63
|
-
/**
|
|
64
|
-
* @return {?}
|
|
65
|
-
*/
|
|
66
38
|
isInitialised() {
|
|
67
39
|
return !!this.visitModel.value;
|
|
68
40
|
}
|
|
69
41
|
// @Trace()
|
|
70
|
-
/**
|
|
71
|
-
* @private
|
|
72
|
-
* @template T, S
|
|
73
|
-
* @param {?} parameterDef
|
|
74
|
-
* @return {?}
|
|
75
|
-
*/
|
|
76
42
|
installBinding(parameterDef) {
|
|
77
|
-
|
|
78
|
-
const model = (/** @type {?} */ (this[parameterDef.propertyName]));
|
|
43
|
+
const model = this[parameterDef.propertyName];
|
|
79
44
|
DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);
|
|
80
|
-
/** @type {?} */
|
|
81
45
|
const binding = this.registerDisposable(new Binding(this.visitModel, model, {
|
|
82
|
-
/**
|
|
83
|
-
* @param {?} visit
|
|
84
|
-
* @return {?}
|
|
85
|
-
*/
|
|
86
46
|
toRight(visit) {
|
|
87
|
-
/** @type {?} */
|
|
88
47
|
const value = visit.getParameter(parameterDef.name);
|
|
89
48
|
console.log('push to component', { name: parameterDef.name, value, visit });
|
|
90
49
|
return value;
|
|
91
50
|
},
|
|
92
|
-
/**
|
|
93
|
-
* @param {?} value
|
|
94
|
-
* @param {?=} currentVisit
|
|
95
|
-
* @return {?}
|
|
96
|
-
*/
|
|
97
51
|
toLeft(value, currentVisit) {
|
|
98
52
|
console.log('push to route', { name: parameterDef.name, value, currentVisit });
|
|
99
53
|
return currentVisit.replace(parameterDef, value);
|
|
@@ -101,77 +55,38 @@ export class PlaceComponent extends DisposableComponent {
|
|
|
101
55
|
}));
|
|
102
56
|
binding.writeRight();
|
|
103
57
|
}
|
|
104
|
-
/**
|
|
105
|
-
* @return {?}
|
|
106
|
-
*/
|
|
107
58
|
get placeDefinition() {
|
|
108
|
-
return
|
|
59
|
+
return PlaceComponent_1.getDefinition(this.constructor);
|
|
109
60
|
}
|
|
110
|
-
/**
|
|
111
|
-
* @return {?}
|
|
112
|
-
*/
|
|
113
61
|
get childPlaces() {
|
|
114
|
-
return this.placeDefinition.children.map(
|
|
115
|
-
* @param {?} d
|
|
116
|
-
* @return {?}
|
|
117
|
-
*/
|
|
118
|
-
d => d.component));
|
|
62
|
+
return this.placeDefinition.children.map(d => d.component);
|
|
119
63
|
}
|
|
120
|
-
/**
|
|
121
|
-
* @return {?}
|
|
122
|
-
*/
|
|
123
64
|
onPlaceReady() {
|
|
124
65
|
}
|
|
125
|
-
}
|
|
126
|
-
|
|
66
|
+
};
|
|
67
|
+
__decorate([
|
|
127
68
|
Memoize(),
|
|
128
|
-
|
|
129
|
-
|
|
69
|
+
__metadata("design:type", PlaceDefinition),
|
|
70
|
+
__metadata("design:paramtypes", [])
|
|
130
71
|
], PlaceComponent.prototype, "placeDefinition", null);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
PlaceComponent.prototype.visitModel;
|
|
137
|
-
/**
|
|
138
|
-
* @type {?}
|
|
139
|
-
* @private
|
|
140
|
-
*/
|
|
141
|
-
PlaceComponent.prototype._inVisitUpdate;
|
|
142
|
-
/** @type {?} */
|
|
143
|
-
PlaceComponent.prototype.interactionContext;
|
|
144
|
-
}
|
|
72
|
+
PlaceComponent = PlaceComponent_1 = __decorate([
|
|
73
|
+
Directive(),
|
|
74
|
+
__metadata("design:paramtypes", [])
|
|
75
|
+
], PlaceComponent);
|
|
76
|
+
export { PlaceComponent };
|
|
145
77
|
(function (PlaceComponent) {
|
|
146
|
-
/**
|
|
147
|
-
* @param {?} target
|
|
148
|
-
* @return {?}
|
|
149
|
-
*/
|
|
150
78
|
function isPlaceComponentConstructor(target) {
|
|
151
|
-
return lang.constructorChain(
|
|
79
|
+
return lang.constructorChain(target).includes(PlaceComponent);
|
|
152
80
|
}
|
|
153
81
|
PlaceComponent.isPlaceComponentConstructor = isPlaceComponentConstructor;
|
|
154
|
-
/**
|
|
155
|
-
* @param {?} klass
|
|
156
|
-
* @return {?}
|
|
157
|
-
*/
|
|
158
82
|
function getRouteParameters(klass) {
|
|
159
83
|
return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);
|
|
160
84
|
}
|
|
161
85
|
PlaceComponent.getRouteParameters = getRouteParameters;
|
|
162
|
-
/**
|
|
163
|
-
* @param {?} klass
|
|
164
|
-
* @return {?}
|
|
165
|
-
*/
|
|
166
86
|
function getDefinition(klass) {
|
|
167
87
|
return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);
|
|
168
88
|
}
|
|
169
89
|
PlaceComponent.getDefinition = getDefinition;
|
|
170
|
-
/**
|
|
171
|
-
* @param {?} klass
|
|
172
|
-
* @param {?} definition
|
|
173
|
-
* @return {?}
|
|
174
|
-
*/
|
|
175
90
|
function injectDefinition(klass, definition) {
|
|
176
91
|
Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);
|
|
177
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"place-component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-component.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EACL,MAAM,EACN,OAAO,EAEP,YAAY,EACZ,GAAG,EACH,KAAK,EAEL,IAAI,EACJ,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,eAAe,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c,CAAC,aAAa,CAAC,IAAI,CAAC,WAAmD,CAAC,CAAC;IAChG,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;IAED,YAAY;IACZ,CAAC;CAEF,CAAA;AAXC;IADC,OAAO,EAAE;8BACa,eAAe;;qDAErC;AA7DU,cAAc;IAD1B,SAAS,EAAE;;GACC,cAAc,CAsE1B;SAtEY,cAAc;AAwE3B,WAAiB,cAAc;IAE7B,SAAgB,2BAA2B,CAAC,MAAW;QACrD,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAA4B,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACtF,CAAC;IAFe,0CAA2B,8BAE1C,CAAA;IAED,SAAgB,kBAAkB,CAAC,KAAoC;QACrE,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,wBAAwB,CAA+B,CAAC;IAClG,CAAC;IAFe,iCAAkB,qBAEjC,CAAA;IAED,SAAgB,aAAa,CAAC,KAAoC;QAChE,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;IAFe,4BAAa,gBAE5B,CAAA;IAED,SAAgB,gBAAgB,CAAC,KAAoC,EAAE,UAA2B;QAChG,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAFe,+BAAgB,mBAE/B,CAAA;AAEH,CAAC,EAlBgB,cAAc,KAAd,cAAc,QAkB9B","sourcesContent":["import { Directive } from '@angular/core';\nimport {\n assert,\n Binding,\n Constructable,\n DebugContext,\n Dsl,\n Guard,\n IMutableHasValue,\n lang,\n MutableValueModel\n} from '@coolon/pectin';\nimport { Klass } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator';\nimport 'reflect-metadata';\nimport { DisposableComponent } from '../components/disposable-component';\nimport { InteractionContext } from '../interaction/interaction-context';\nimport { PlaceDefinition } from './place-definition';\nimport { ParameterDefinition } from './route/parameter-definition.class';\nimport { Visit } from './visit';\n\n// RAKE: making this Symbol(...) broke things.\nexport const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';\n// this one seems ok.\nexport const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');\n\n@Directive()\nexport class PlaceComponent extends DisposableComponent {\n\n private visitModel = new MutableValueModel<Visit>();\n private _inVisitUpdate = new Guard();\n\n interactionContext?: InteractionContext;\n\n canDeactivate?(interactionContext: InteractionContext): boolean | Promise<boolean>;\n\n constructor() {\n super();\n }\n\n // @Trace()\n public initialiseVisit(visit: Visit, notifyVisitChanged: (current: Visit, previous:Visit) => void) {\n assert.isNil(this.visitModel.value);\n\n const { when } = Dsl.disposeWith(this);\n\n this.visitModel.value = visit;\n DebugContext.get(this.visitModel).tag(`${this.placeDefinition.component.name}.visitModel`);\n this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => this.installBinding(parameterDef));\n when.valueOf(this.visitModel).changes((current,previous) => {\n notifyVisitChanged(current, previous);\n }, {unless: this._inVisitUpdate});\n }\n\n public updateVisit(visit: Visit) {\n assert.isTruthy(this.isInitialised());\n assert.notNil(visit);\n this._inVisitUpdate.whileTrue(() => {\n this.visitModel.value = visit;\n });\n }\n\n isInitialised() {\n return !!this.visitModel.value;\n }\n\n // @Trace()\n private installBinding<T, S>(parameterDef: ParameterDefinition<T, S>) {\n const model = this[parameterDef.propertyName] as IMutableHasValue<S>;\n DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);\n const binding = this.registerDisposable(new Binding(this.visitModel, model, {\n toRight(visit: Visit): S {\n const value = visit.getParameter(parameterDef.name);\n console.log('push to component', { name: parameterDef.name, value, visit });\n return value;\n },\n toLeft(value: S, currentVisit?: Visit): Visit {\n console.log('push to route', { name: parameterDef.name, value, currentVisit });\n return currentVisit.replace(parameterDef, value);\n }\n }));\n\n binding.writeRight();\n }\n\n @Memoize()\n get placeDefinition(): PlaceDefinition {\n return PlaceComponent.getDefinition(this.constructor as any as Constructable<PlaceComponent>);\n }\n\n get childPlaces(): Constructable<PlaceComponent>[] {\n return this.placeDefinition.children.map(d => d.component);\n }\n\n onPlaceReady() {\n }\n\n}\n\nexport namespace PlaceComponent {\n\n export function isPlaceComponentConstructor(target: any): target is Constructable<PlaceComponent> {\n return lang.constructorChain(target as Constructable<any>).includes(PlaceComponent);\n }\n\n export function getRouteParameters(klass: Constructable<PlaceComponent>): ParameterDefinition<any>[] {\n return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY) as ParameterDefinition<any>[];\n }\n\n export function getDefinition(klass: Constructable<PlaceComponent>): PlaceDefinition {\n return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);\n }\n\n export function injectDefinition(klass: Constructable<PlaceComponent>, definition: PlaceDefinition) {\n Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"DEFINITION_META_DATA_KEY":"PLACE_DEFINITION_OPTIONS","ROUTE_PARAMETER_LIST_KEY":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"Symbol"},"arguments":["place:route:parameters"]},"PlaceComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../components/disposable-component","name":"DisposableComponent","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"DEFINITION_META_DATA_KEY":"PLACE_DEFINITION_OPTIONS","ROUTE_PARAMETER_LIST_KEY":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"Symbol"},"arguments":["place:route:parameters"]},"PlaceComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../components/disposable-component","name":"DisposableComponent","line":27,"character":36},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":26,"character":1}}],"members":{"canDeactivate":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}],"initialiseVisit":[{"__symbolic":"method"}],"updateVisit":[{"__symbolic":"method"}],"isInitialised":[{"__symbolic":"method"}],"installBinding":[{"__symbolic":"method"}],"placeDefinition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator","name":"Memoize","line":85,"character":3}}]}],"onPlaceReady":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
1
|
import { InjectionToken } from '@angular/core';
|
|
6
|
-
/** @type {?} */
|
|
7
2
|
export const AUP_PLACE_CONFIG = new InjectionToken('AUP_PLACE_CONFIG');
|
|
8
|
-
/**
|
|
9
|
-
* @record
|
|
10
|
-
*/
|
|
11
|
-
export function PlaceConfig() { }
|
|
12
|
-
if (false) {
|
|
13
|
-
/** @type {?} */
|
|
14
|
-
PlaceConfig.prototype.animationDuration;
|
|
15
|
-
}
|
|
16
3
|
//# sourceMappingURL=place-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-config.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"place-config.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,CAAC,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const AUP_PLACE_CONFIG = new InjectionToken<PlaceConfig>('AUP_PLACE_CONFIG');\n\nexport interface PlaceConfig {\n animationDuration: string;\n}\n"]}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
6
2
|
import { assert } from '@coolon/pectin';
|
|
7
3
|
import { Opts } from '@coolon/typescript-utilities';
|
|
8
4
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
9
5
|
import _ from 'lodash';
|
|
10
6
|
import { ParameterDefinition } from './route/parameter-definition.class';
|
|
11
7
|
export class PlaceDefinition {
|
|
12
|
-
/**
|
|
13
|
-
* @param {?} component
|
|
14
|
-
* @param {?} path
|
|
15
|
-
* @param {?} authenticate
|
|
16
|
-
* @param {?} data
|
|
17
|
-
* @param {?} routeParameters
|
|
18
|
-
* @param {?} children
|
|
19
|
-
*/
|
|
20
8
|
constructor(component, path, authenticate, data, routeParameters, children) {
|
|
21
9
|
this.component = component;
|
|
22
10
|
this.path = path;
|
|
@@ -25,97 +13,45 @@ export class PlaceDefinition {
|
|
|
25
13
|
this.routeParameters = routeParameters;
|
|
26
14
|
this.children = children;
|
|
27
15
|
}
|
|
28
|
-
/**
|
|
29
|
-
* @return {?}
|
|
30
|
-
*/
|
|
31
16
|
hasRouteId() {
|
|
32
17
|
return !!this.getRouteIdParameterDef();
|
|
33
18
|
}
|
|
34
|
-
/**
|
|
35
|
-
* @return {?}
|
|
36
|
-
*/
|
|
37
19
|
getRouteIdParameterDef() {
|
|
38
|
-
return this.routeParameters.find(
|
|
39
|
-
* @param {?} p
|
|
40
|
-
* @return {?}
|
|
41
|
-
*/
|
|
42
|
-
p => p.isRouteId));
|
|
20
|
+
return this.routeParameters.find(p => p.isRouteId);
|
|
43
21
|
}
|
|
44
|
-
/**
|
|
45
|
-
* @param {?=} includeRouteId
|
|
46
|
-
* @return {?}
|
|
47
|
-
*/
|
|
48
22
|
getRouteParameterDefs(includeRouteId = false) {
|
|
49
23
|
return this.getVisitParameterDefs({ includeRouteId, includeRouteParameters: true });
|
|
50
24
|
}
|
|
51
|
-
/**
|
|
52
|
-
* @param {?=} include
|
|
53
|
-
* @return {?}
|
|
54
|
-
*/
|
|
55
25
|
getVisitParameterDefs(include) {
|
|
56
|
-
/** @type {?} */
|
|
57
26
|
const opts = Opts.get(include);
|
|
58
27
|
// includes
|
|
59
|
-
/** @type {?} */
|
|
60
28
|
const includeRouteId = !include || opts.getOptional('includeRouteId', false);
|
|
61
|
-
/** @type {?} */
|
|
62
29
|
const includeRouteParameters = !include || opts.getOptional('includeRouteParameters', false);
|
|
63
|
-
/** @type {?} */
|
|
64
30
|
const includeNonRouteParameters = !include || opts.getOptional('includeNonRouteParameters', false);
|
|
65
|
-
return this.routeParameters.filter(
|
|
66
|
-
* @param {?} p
|
|
67
|
-
* @return {?}
|
|
68
|
-
*/
|
|
69
|
-
p => {
|
|
31
|
+
return this.routeParameters.filter(p => {
|
|
70
32
|
return (includeRouteId && p.isRouteId)
|
|
71
33
|
|| (includeRouteParameters && p.isRouteParameter && !p.isRouteId) // route id is included in the line above
|
|
72
34
|
|| (includeNonRouteParameters && !p.isRouteParameter);
|
|
73
|
-
})
|
|
35
|
+
});
|
|
74
36
|
}
|
|
75
|
-
/**
|
|
76
|
-
* @template T
|
|
77
|
-
* @param {?} key
|
|
78
|
-
* @param {?=} defaultValue
|
|
79
|
-
* @return {?}
|
|
80
|
-
*/
|
|
81
37
|
getPlaceData(key, defaultValue) {
|
|
82
38
|
return this.data ?
|
|
83
39
|
_.isNil(this.data[key]) ? defaultValue : this.data[key] :
|
|
84
40
|
defaultValue;
|
|
85
41
|
}
|
|
86
|
-
/**
|
|
87
|
-
* @template T
|
|
88
|
-
* @param {?} keys
|
|
89
|
-
* @param {?=} defaultValue
|
|
90
|
-
* @return {?}
|
|
91
|
-
*/
|
|
92
42
|
searchPlaceData(keys, defaultValue) {
|
|
93
43
|
if (this.data) {
|
|
94
|
-
|
|
95
|
-
const found = keys.find((/**
|
|
96
|
-
* @param {?} key
|
|
97
|
-
* @return {?}
|
|
98
|
-
*/
|
|
99
|
-
key => !_.isNil(this.data[key])));
|
|
44
|
+
const found = keys.find(key => !_.isNil(this.data[key]));
|
|
100
45
|
return found ? this.data[found] : defaultValue;
|
|
101
46
|
}
|
|
102
47
|
else {
|
|
103
48
|
return defaultValue;
|
|
104
49
|
}
|
|
105
50
|
}
|
|
106
|
-
/**
|
|
107
|
-
* @param {?} visit
|
|
108
|
-
* @return {?}
|
|
109
|
-
*/
|
|
110
51
|
getRouteIdFrom(visit) {
|
|
111
|
-
/** @type {?} */
|
|
112
52
|
const routeIdParameterDef = this.getRouteIdParameterDef();
|
|
113
53
|
return routeIdParameterDef ? visit.getParameter(routeIdParameterDef.name) : null;
|
|
114
54
|
}
|
|
115
|
-
/**
|
|
116
|
-
* @param {?} visit
|
|
117
|
-
* @return {?}
|
|
118
|
-
*/
|
|
119
55
|
getFormattedRouteId(visit) {
|
|
120
56
|
// Note: RouteIds are always present in the url and are just empty strings when not defined. This is
|
|
121
57
|
// mandated by the fact that redirects from <path> to <path>/:id always include the id parameter as
|
|
@@ -123,95 +59,51 @@ export class PlaceDefinition {
|
|
|
123
59
|
return visit.hasRouteId() ? this.getRouteIdParameterDef().urlFormat.format(visit.getRouteId()) : "";
|
|
124
60
|
}
|
|
125
61
|
// @Trace()
|
|
126
|
-
/**
|
|
127
|
-
* @param {?} visit
|
|
128
|
-
* @param {?=} includeRouteId
|
|
129
|
-
* @return {?}
|
|
130
|
-
*/
|
|
131
62
|
getFormattedRouteParameters(visit, includeRouteId = false) {
|
|
132
|
-
/** @type {?} */
|
|
133
63
|
const result = {};
|
|
134
64
|
this.getVisitParameterDefs({
|
|
135
65
|
includeRouteId, includeRouteParameters: true
|
|
136
|
-
}).forEach(
|
|
137
|
-
* @param {?} def
|
|
138
|
-
* @return {?}
|
|
139
|
-
*/
|
|
140
|
-
def => {
|
|
141
|
-
/** @type {?} */
|
|
66
|
+
}).forEach(def => {
|
|
142
67
|
const value = visit.getParameter(def.name);
|
|
143
68
|
if (!def.isEmptyValue(value)) {
|
|
144
69
|
if (def.isArray) {
|
|
145
70
|
assert.isArray(value);
|
|
146
|
-
result[def.name] = value.map((
|
|
147
|
-
* @param {?} v
|
|
148
|
-
* @return {?}
|
|
149
|
-
*/
|
|
150
|
-
v => def.urlFormat.format(v)));
|
|
71
|
+
result[def.name] = value.map(v => def.urlFormat.format(v));
|
|
151
72
|
}
|
|
152
73
|
else {
|
|
153
74
|
assert.isFalsey(Array.isArray(value));
|
|
154
75
|
result[def.name] = def.urlFormat.format(value);
|
|
155
76
|
}
|
|
156
77
|
}
|
|
157
|
-
})
|
|
78
|
+
});
|
|
158
79
|
return result;
|
|
159
80
|
}
|
|
160
|
-
/**
|
|
161
|
-
* @param {?} visit
|
|
162
|
-
* @return {?}
|
|
163
|
-
*/
|
|
164
81
|
getNonRouteParameters(visit) {
|
|
165
|
-
/** @type {?} */
|
|
166
82
|
const result = {};
|
|
167
|
-
this.getVisitParameterDefs({ includeNonRouteParameters: true }).forEach(
|
|
168
|
-
* @param {?} def
|
|
169
|
-
* @return {?}
|
|
170
|
-
*/
|
|
171
|
-
def => {
|
|
172
|
-
/** @type {?} */
|
|
83
|
+
this.getVisitParameterDefs({ includeNonRouteParameters: true }).forEach(def => {
|
|
173
84
|
const value = visit.getParameter(def.name);
|
|
174
85
|
if (!def.isEmptyValue(value)) {
|
|
175
86
|
result[def.name] = value;
|
|
176
87
|
}
|
|
177
|
-
})
|
|
88
|
+
});
|
|
178
89
|
return result;
|
|
179
90
|
}
|
|
180
91
|
// @Trace()
|
|
181
|
-
/**
|
|
182
|
-
* @param {?} params
|
|
183
|
-
* @return {?}
|
|
184
|
-
*/
|
|
185
92
|
parseRouteParams(params) {
|
|
186
|
-
/** @type {?} */
|
|
187
93
|
const result = {};
|
|
188
94
|
this.getVisitParameterDefs({
|
|
189
95
|
includeRouteId: true,
|
|
190
96
|
includeRouteParameters: true,
|
|
191
97
|
includeNonRouteParameters: false
|
|
192
|
-
}).forEach(
|
|
193
|
-
* @param {?} def
|
|
194
|
-
* @return {?}
|
|
195
|
-
*/
|
|
196
|
-
def => {
|
|
98
|
+
}).forEach(def => {
|
|
197
99
|
// params will return null for non existent names
|
|
198
100
|
if (params.has(def.name)) {
|
|
199
101
|
if (def.isArray) {
|
|
200
102
|
// const values = params.getAll(def.name); // TODO: EEEK getAll is returning ["1,2,3,4"] when we gave it ["1","2","3","4"].
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
* @param {?} s
|
|
204
|
-
* @return {?}
|
|
205
|
-
*/
|
|
206
|
-
s => s.trim()));
|
|
207
|
-
result[def.name] = values.map((/**
|
|
208
|
-
* @param {?} v
|
|
209
|
-
* @return {?}
|
|
210
|
-
*/
|
|
211
|
-
v => def.urlFormat.parse(v)));
|
|
103
|
+
const values = params.get(def.name).split(',').map(s => s.trim());
|
|
104
|
+
result[def.name] = values.map(v => def.urlFormat.parse(v));
|
|
212
105
|
}
|
|
213
106
|
else {
|
|
214
|
-
/** @type {?} */
|
|
215
107
|
const value = params.get(def.name);
|
|
216
108
|
if (def.isRouteId) { // TODO: Move this to parameter def so it's a strategy pattern
|
|
217
109
|
// because our id routes redirect if the id isn't present we always have a id
|
|
@@ -226,55 +118,26 @@ export class PlaceDefinition {
|
|
|
226
118
|
}
|
|
227
119
|
}
|
|
228
120
|
}
|
|
229
|
-
})
|
|
121
|
+
});
|
|
230
122
|
return result;
|
|
231
123
|
}
|
|
232
124
|
}
|
|
233
|
-
|
|
125
|
+
__decorate([
|
|
234
126
|
Memoize(),
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
127
|
+
__metadata("design:type", Function),
|
|
128
|
+
__metadata("design:paramtypes", []),
|
|
129
|
+
__metadata("design:returntype", ParameterDefinition)
|
|
238
130
|
], PlaceDefinition.prototype, "getRouteIdParameterDef", null);
|
|
239
|
-
|
|
131
|
+
__decorate([
|
|
240
132
|
Memoize(),
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
133
|
+
__metadata("design:type", Function),
|
|
134
|
+
__metadata("design:paramtypes", [Object]),
|
|
135
|
+
__metadata("design:returntype", Array)
|
|
244
136
|
], PlaceDefinition.prototype, "getRouteParameterDefs", null);
|
|
245
|
-
|
|
137
|
+
__decorate([
|
|
246
138
|
Memoize(),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
139
|
+
__metadata("design:type", Function),
|
|
140
|
+
__metadata("design:paramtypes", [Object]),
|
|
141
|
+
__metadata("design:returntype", Array)
|
|
250
142
|
], PlaceDefinition.prototype, "getVisitParameterDefs", null);
|
|
251
|
-
if (false) {
|
|
252
|
-
/** @type {?} */
|
|
253
|
-
PlaceDefinition.prototype.component;
|
|
254
|
-
/** @type {?} */
|
|
255
|
-
PlaceDefinition.prototype.path;
|
|
256
|
-
/** @type {?} */
|
|
257
|
-
PlaceDefinition.prototype.authenticate;
|
|
258
|
-
/** @type {?} */
|
|
259
|
-
PlaceDefinition.prototype.data;
|
|
260
|
-
/** @type {?} */
|
|
261
|
-
PlaceDefinition.prototype.routeParameters;
|
|
262
|
-
/** @type {?} */
|
|
263
|
-
PlaceDefinition.prototype.children;
|
|
264
|
-
}
|
|
265
|
-
(function (PlaceDefinition) {
|
|
266
|
-
/**
|
|
267
|
-
* @record
|
|
268
|
-
*/
|
|
269
|
-
function ParameterOptions() { }
|
|
270
|
-
PlaceDefinition.ParameterOptions = ParameterOptions;
|
|
271
|
-
if (false) {
|
|
272
|
-
/** @type {?|undefined} */
|
|
273
|
-
ParameterOptions.prototype.includeRouteId;
|
|
274
|
-
/** @type {?|undefined} */
|
|
275
|
-
ParameterOptions.prototype.includeRouteParameters;
|
|
276
|
-
/** @type {?|undefined} */
|
|
277
|
-
ParameterOptions.prototype.includeNonRouteParameters;
|
|
278
|
-
}
|
|
279
|
-
})(PlaceDefinition || (PlaceDefinition = {}));
|
|
280
143
|
//# sourceMappingURL=place-definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-definition.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-definition.ts"],"names":[],"mappings":";;;;;AACA,OAAO,EAAE,MAAM,EAAwB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAGzE,MAAM,OAAO,eAAe;;;;;;;;;IAE1B,YAAqB,SAAwC,EACxC,IAAY,EACZ,YAAqB,EACrB,IAA4B,EAC5B,eAA2C,EAC3C,QAA2B;QAL3B,cAAS,GAAT,SAAS,CAA+B;QACxC,SAAI,GAAJ,IAAI,CAAQ;QACZ,iBAAY,GAAZ,YAAY,CAAS;QACrB,SAAI,GAAJ,IAAI,CAAwB;QAC5B,oBAAe,GAAf,eAAe,CAA4B;QAC3C,aAAQ,GAAR,QAAQ,CAAmB;IAChD,CAAC;;;;IAED,UAAU;QACR,OAAO,CAAC,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;IACzC,CAAC;;;;IAGD,sBAAsB;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI;;;;QAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAC,CAAC;IACrD,CAAC;;;;;IAGD,qBAAqB,CAAC,cAAc,GAAG,KAAK;QAC1C,OAAO,IAAI,CAAC,qBAAqB,CAAC,EAAE,cAAc,EAAE,sBAAsB,EAAE,IAAI,EAAE,CAAC,CAAC;IACtF,CAAC;;;;;IAGD,qB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AAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAC,CAAC;iBAC5D;qBAAM;;0BACC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;oBAClC,IAAI,GAAG,CAAC,SAAS,EAAE,EAAE,8DAA8D;wBACjF,6EAA6E;wBAC7E,wFAAwF;wBACxF,0EAA0E;wBAC1E,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;4BACrB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;yBAC/C;qBACF;yBAAM;wBACL,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;qBAC/C;iBACF;aACF;QACH,CAAC,EAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CAEF;AAjHC;IADC,OAAO,EAAE;;;4CACgB,mBAAmB;6DAE5C;AAGD;IADC,OAAO,EAAE;;;;4DAGT;AAGD;IADC,OAAO,EAAE;;;;4DAYT;;;IAlCW,oCAAiD;;IACjD,+BAAqB;;IACrB,uCAA8B;;IAC9B,+BAAqC;;IACrC,0CAAoD;;IACpD,mCAAoC;;AA2HlD,WAAiB,eAAe;;;;IAC9B,+BAIC;;;;QAHC,0CAAyB;;QACzB,kDAAiC;;QACjC,qDAAoC;;AAExC,CAAC,EANgB,eAAe,KAAf,eAAe,QAM/B","sourcesContent":["import { ParamMap } from '@angular/router';\nimport { assert, Constructable, Trace } from '@coolon/pectin';\nimport { Opts } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport _ from 'lodash';\nimport { PlaceComponent } from './place-component';\nimport { ParameterDefinition } from './route/parameter-definition.class';\nimport { Visit } from './visit';\n\nexport class PlaceDefinition {\n\n constructor(readonly component: Constructable<PlaceComponent>,\n readonly path: string,\n readonly authenticate: boolean,\n readonly data: { [key: string]: any },\n readonly routeParameters: ParameterDefinition<any>[],\n readonly children: PlaceDefinition[]) {\n }\n\n hasRouteId() {\n return !!this.getRouteIdParameterDef();\n }\n\n @Memoize()\n getRouteIdParameterDef(): ParameterDefinition<any> {\n return this.routeParameters.find(p => p.isRouteId);\n }\n\n @Memoize()\n getRouteParameterDefs(includeRouteId = false): ParameterDefinition<any>[] {\n return this.getVisitParameterDefs({ includeRouteId, includeRouteParameters: true });\n }\n\n @Memoize()\n getVisitParameterDefs(include?: PlaceDefinition.ParameterOptions): ParameterDefinition<any>[] {\n const opts = Opts.get(include);\n // includes\n const includeRouteId = !include || opts.getOptional('includeRouteId', false);\n const includeRouteParameters = !include || opts.getOptional('includeRouteParameters', false);\n const includeNonRouteParameters = !include || opts.getOptional('includeNonRouteParameters', false);\n return this.routeParameters.filter(p => {\n return (includeRouteId && p.isRouteId)\n || (includeRouteParameters && p.isRouteParameter && !p.isRouteId) // route id is included in the line above\n || (includeNonRouteParameters && !p.isRouteParameter);\n });\n }\n\n getPlaceData<T>(key: string, defaultValue?: T): T {\n return this.data ?\n _.isNil(this.data[key]) ? defaultValue : this.data[key] :\n defaultValue;\n }\n\n searchPlaceData<T>(keys: string[], defaultValue?: T): T {\n if (this.data) {\n const found = keys.find(key => !_.isNil(this.data[key]));\n return found ? this.data[found] : defaultValue;\n } else {\n return defaultValue;\n }\n }\n\n getRouteIdFrom(visit: Visit) {\n const routeIdParameterDef = this.getRouteIdParameterDef();\n return routeIdParameterDef ? visit.getParameter(routeIdParameterDef.name) : null;\n }\n\n getFormattedRouteId(visit: Visit): any {\n // Note: RouteIds are always present in the url and are just empty strings when not defined. This is\n // mandated by the fact that redirects from <path> to <path>/:id always include the id parameter as\n // an empty string.\n return visit.hasRouteId() ? this.getRouteIdParameterDef().urlFormat.format(visit.getRouteId()) : \"\";\n }\n\n // @Trace()\n getFormattedRouteParameters(visit: Visit, includeRouteId = false): { [p: string]: string } {\n const result: { [p: string]: string } = {};\n this.getVisitParameterDefs({\n includeRouteId, includeRouteParameters: true\n }).forEach(def => {\n const value = visit.getParameter(def.name);\n if (!def.isEmptyValue(value)) {\n if (def.isArray) {\n assert.isArray(value);\n result[def.name] = value.map(v => def.urlFormat.format(v));\n } else {\n assert.isFalsey(Array.isArray(value));\n result[def.name] = def.urlFormat.format(value);\n }\n }\n });\n return result;\n }\n\n getNonRouteParameters(visit: Visit): { [p: string]: string } {\n const result: { [p: string]: string } = {};\n this.getVisitParameterDefs({ includeNonRouteParameters: true }).forEach(def => {\n const value = visit.getParameter(def.name);\n if (!def.isEmptyValue(value)) {\n result[def.name] = value;\n }\n });\n return result;\n }\n\n // @Trace()\n parseRouteParams(params: ParamMap): { [p: string]: any } {\n const result: { [p: string]: any } = {};\n this.getVisitParameterDefs({\n includeRouteId: true,\n includeRouteParameters: true,\n includeNonRouteParameters: false\n }).forEach(def => {\n // params will return null for non existent names\n if (params.has(def.name)) {\n if (def.isArray) {\n // const values = params.getAll(def.name); // TODO: EEEK getAll is returning [\"1,2,3,4\"] when we gave it [\"1\",\"2\",\"3\",\"4\"].\n const values = params.get(def.name).split(',').map(s => s.trim());\n result[def.name] = values.map(v => def.urlFormat.parse(v));\n } else {\n const value = params.get(def.name);\n if (def.isRouteId) { // TODO: Move this to parameter def so it's a strategy pattern\n // because our id routes redirect if the id isn't present we always have a id\n // parameter in our params. This will bugger our remember and defaultvalue sanitisation\n // as it'll see that the id is present (event thought its a blank string).\n if (!_.isEmpty(value)) {\n result[def.name] = def.urlFormat.parse(value);\n }\n } else {\n result[def.name] = def.urlFormat.parse(value);\n }\n }\n }\n });\n return result;\n }\n\n}\n\nexport namespace PlaceDefinition {\n export interface ParameterOptions {\n includeRouteId?: boolean;\n includeRouteParameters?: boolean;\n includeNonRouteParameters?: boolean;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"place-definition.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place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CAAC,SAAS,EAAE,EAAE,8DAA8D;wBACjF,6EAA6E;wBAC7E,wFAAwF;wBACxF,0EAA0E;wBAC1E,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;4BACrB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;yBAC/C;qBACF;yBAAM;wBACL,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;qBAC/C;iBACF;aACF;QACH,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CAEF;AAjHC;IADC,OAAO,EAAE;;;oCACgB,mBAAmB;6DAE5C;AAGD;IADC,OAAO,EAAE;;;;4DAGT;AAGD;IADC,OAAO,EAAE;;;;4DAYT","sourcesContent":["import { ParamMap } from '@angular/router';\nimport { assert, Constructable, Trace } from '@coolon/pectin';\nimport { Opts } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport _ from 'lodash';\nimport { PlaceComponent } from './place-component';\nimport { ParameterDefinition } from './route/parameter-definition.class';\nimport { Visit } from './visit';\n\nexport class PlaceDefinition {\n\n constructor(readonly component: Constructable<PlaceComponent>,\n readonly path: string,\n readonly authenticate: boolean,\n readonly data: { [key: string]: any },\n readonly routeParameters: ParameterDefinition<any>[],\n readonly children: PlaceDefinition[]) {\n }\n\n hasRouteId() {\n return !!this.getRouteIdParameterDef();\n }\n\n @Memoize()\n getRouteIdParameterDef(): ParameterDefinition<any> {\n return this.routeParameters.find(p => p.isRouteId);\n }\n\n @Memoize()\n getRouteParameterDefs(includeRouteId = false): ParameterDefinition<any>[] {\n return this.getVisitParameterDefs({ includeRouteId, includeRouteParameters: true });\n }\n\n @Memoize()\n getVisitParameterDefs(include?: PlaceDefinition.ParameterOptions): ParameterDefinition<any>[] {\n const opts = Opts.get(include);\n // includes\n const includeRouteId = !include || opts.getOptional('includeRouteId', false);\n const includeRouteParameters = !include || opts.getOptional('includeRouteParameters', false);\n const includeNonRouteParameters = !include || opts.getOptional('includeNonRouteParameters', false);\n return this.routeParameters.filter(p => {\n return (includeRouteId && p.isRouteId)\n || (includeRouteParameters && p.isRouteParameter && !p.isRouteId) // route id is included in the line above\n || (includeNonRouteParameters && !p.isRouteParameter);\n });\n }\n\n getPlaceData<T>(key: string, defaultValue?: T): T {\n return this.data ?\n _.isNil(this.data[key]) ? defaultValue : this.data[key] :\n defaultValue;\n }\n\n searchPlaceData<T>(keys: string[], defaultValue?: T): T {\n if (this.data) {\n const found = keys.find(key => !_.isNil(this.data[key]));\n return found ? this.data[found] : defaultValue;\n } else {\n return defaultValue;\n }\n }\n\n getRouteIdFrom(visit: Visit) {\n const routeIdParameterDef = this.getRouteIdParameterDef();\n return routeIdParameterDef ? visit.getParameter(routeIdParameterDef.name) : null;\n }\n\n getFormattedRouteId(visit: Visit): any {\n // Note: RouteIds are always present in the url and are just empty strings when not defined. This is\n // mandated by the fact that redirects from <path> to <path>/:id always include the id parameter as\n // an empty string.\n return visit.hasRouteId() ? this.getRouteIdParameterDef().urlFormat.format(visit.getRouteId()) : \"\";\n }\n\n // @Trace()\n getFormattedRouteParameters(visit: Visit, includeRouteId = false): { [p: string]: string } {\n const result: { [p: string]: string } = {};\n this.getVisitParameterDefs({\n includeRouteId, includeRouteParameters: true\n }).forEach(def => {\n const value = visit.getParameter(def.name);\n if (!def.isEmptyValue(value)) {\n if (def.isArray) {\n assert.isArray(value);\n result[def.name] = value.map(v => def.urlFormat.format(v));\n } else {\n assert.isFalsey(Array.isArray(value));\n result[def.name] = def.urlFormat.format(value);\n }\n }\n });\n return result;\n }\n\n getNonRouteParameters(visit: Visit): { [p: string]: string } {\n const result: { [p: string]: string } = {};\n this.getVisitParameterDefs({ includeNonRouteParameters: true }).forEach(def => {\n const value = visit.getParameter(def.name);\n if (!def.isEmptyValue(value)) {\n result[def.name] = value;\n }\n });\n return result;\n }\n\n // @Trace()\n parseRouteParams(params: ParamMap): { [p: string]: any } {\n const result: { [p: string]: any } = {};\n this.getVisitParameterDefs({\n includeRouteId: true,\n includeRouteParameters: true,\n includeNonRouteParameters: false\n }).forEach(def => {\n // params will return null for non existent names\n if (params.has(def.name)) {\n if (def.isArray) {\n // const values = params.getAll(def.name); // TODO: EEEK getAll is returning [\"1,2,3,4\"] when we gave it [\"1\",\"2\",\"3\",\"4\"].\n const values = params.get(def.name).split(',').map(s => s.trim());\n result[def.name] = values.map(v => def.urlFormat.parse(v));\n } else {\n const value = params.get(def.name);\n if (def.isRouteId) { // TODO: Move this to parameter def so it's a strategy pattern\n // because our id routes redirect if the id isn't present we always have a id\n // parameter in our params. This will bugger our remember and defaultvalue sanitisation\n // as it'll see that the id is present (event thought its a blank string).\n if (!_.isEmpty(value)) {\n result[def.name] = def.urlFormat.parse(value);\n }\n } else {\n result[def.name] = def.urlFormat.parse(value);\n }\n }\n }\n });\n return result;\n }\n\n}\n\nexport namespace PlaceDefinition {\n export interface ParameterOptions {\n includeRouteId?: boolean;\n includeRouteParameters?: boolean;\n includeNonRouteParameters?: boolean;\n }\n}\n"]}
|