@coolon/angular-ui-powerups 0.0.97 → 0.0.98
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/bundles/coolon-angular-ui-powerups.umd.js +99 -241
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -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 +2 -2
- package/esm2015/index.js +2 -2
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +2 -2
- package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +6 -5
- package/esm2015/lib/place/guards/navigation-state.js +613 -0
- package/esm2015/lib/place/guards/place-component-deactivation-handler.js +14 -37
- package/esm2015/lib/place/index.js +2 -2
- package/esm2015/lib/place/place-router.js +11 -54
- package/esm2015/public_api.js +2 -2
- package/esm5/coolon-angular-ui-powerups.js +2 -2
- package/esm5/index.js +2 -2
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +2 -2
- package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +6 -5
- package/esm5/lib/place/guards/navigation-state.js +764 -0
- package/esm5/lib/place/guards/place-component-deactivation-handler.js +21 -55
- package/esm5/lib/place/index.js +2 -2
- package/esm5/lib/place/place-router.js +12 -144
- package/esm5/public_api.js +2 -2
- package/fesm2015/coolon-angular-ui-powerups.js +80 -122
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +101 -243
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +1 -1
- package/lib/place/guards/{navigation-session.d.ts → navigation-state.d.ts} +34 -34
- package/lib/place/guards/place-component-deactivation-handler.d.ts +3 -5
- package/lib/place/index.d.ts +1 -1
- package/lib/place/place-router.d.ts +4 -4
- package/package.json +1 -1
- package/esm2015/lib/place/guards/navigation-session.js +0 -590
- package/esm5/lib/place/guards/navigation-session.js +0 -741
|
@@ -28,7 +28,7 @@ declare class TabContext<D, R, E> implements ActivityOutletContext<D, R, E> {
|
|
|
28
28
|
}
|
|
29
29
|
export declare class ActivityContainerComponent<D, R, E> extends InteractionContextBase implements OnInit, AfterViewInit {
|
|
30
30
|
private readonly throttledNestedActivityFinishEvents;
|
|
31
|
-
private _initialActivityOutletContext;
|
|
31
|
+
private readonly _initialActivityOutletContext;
|
|
32
32
|
initialActivityOutletContext: ActivityOutletContext<D, R, E>;
|
|
33
33
|
initialActivityOutletContextEvent: EventEmitter<ActivityOutletContext<D, R, E>>;
|
|
34
34
|
dynamicHeight: boolean;
|
|
@@ -7,49 +7,49 @@ import { PlaceComponent } from '../place-component';
|
|
|
7
7
|
import { PlaceDefinition } from '../place-definition';
|
|
8
8
|
import { UrlSnapshot } from '../url-snapshot';
|
|
9
9
|
import { Visit } from '../visit';
|
|
10
|
-
export declare abstract class
|
|
11
|
-
protected readonly context:
|
|
10
|
+
export declare abstract class NavigationState extends GarbageCollector {
|
|
11
|
+
protected readonly context: NavigationState.Context;
|
|
12
12
|
private _visits;
|
|
13
13
|
abstract readonly isPopState: boolean;
|
|
14
14
|
abstract readonly active: boolean;
|
|
15
15
|
abstract readonly startingUrl: string;
|
|
16
|
-
constructor(context:
|
|
16
|
+
constructor(context: NavigationState.Context);
|
|
17
17
|
readonly interactionContext: InteractionContext;
|
|
18
18
|
storeVisit(visit: Visit): void;
|
|
19
19
|
getVisitFor(placeDef: PlaceDefinition): Visit;
|
|
20
|
-
abstract onStart(event: NavigationStart):
|
|
21
|
-
abstract onCancel(event: NavigationCancel):
|
|
22
|
-
abstract onError(event: NavigationError):
|
|
23
|
-
abstract onEnd(event: NavigationEnd):
|
|
24
|
-
onBackClickedDuringNavigationInteraction(newUrl: string):
|
|
20
|
+
abstract onStart(event: NavigationStart): NavigationState;
|
|
21
|
+
abstract onCancel(event: NavigationCancel): NavigationState;
|
|
22
|
+
abstract onError(event: NavigationError): NavigationState;
|
|
23
|
+
abstract onEnd(event: NavigationEnd): NavigationState;
|
|
24
|
+
onBackClickedDuringNavigationInteraction(newUrl: string): NavigationState;
|
|
25
25
|
abstract canDeactivatePlace(component: PlaceComponent, nextState: UrlSnapshot): Promise<boolean>;
|
|
26
26
|
getVisits(): Visit[];
|
|
27
27
|
protected illegalTransition<R>(message: string | RouterEvent): R;
|
|
28
28
|
protected currentRouterUrl(): string;
|
|
29
|
-
protected createActiveSession(event: NavigationStart):
|
|
29
|
+
protected createActiveSession(event: NavigationStart): NavigationState.Active;
|
|
30
30
|
protected updateLocation(url: any): void;
|
|
31
31
|
toString(): string;
|
|
32
32
|
}
|
|
33
|
-
export declare namespace
|
|
33
|
+
export declare namespace NavigationState {
|
|
34
34
|
class Context {
|
|
35
35
|
readonly router: Router;
|
|
36
36
|
readonly modalInteractionService: ModalInteractionService;
|
|
37
37
|
readonly angularLocation: Location;
|
|
38
|
-
readonly notifySuccess: (success:
|
|
39
|
-
constructor(router: Router, modalInteractionService: ModalInteractionService, angularLocation: Location, notifySuccess: (success:
|
|
38
|
+
readonly notifySuccess: (success: NavigationState) => void;
|
|
39
|
+
constructor(router: Router, modalInteractionService: ModalInteractionService, angularLocation: Location, notifySuccess: (success: NavigationState) => void);
|
|
40
40
|
}
|
|
41
|
-
class Idle extends
|
|
41
|
+
class Idle extends NavigationState {
|
|
42
42
|
readonly isPopState: boolean;
|
|
43
43
|
readonly active = false;
|
|
44
44
|
readonly startingUrl: any;
|
|
45
45
|
constructor(context: Context);
|
|
46
46
|
canDeactivatePlace(component: PlaceComponent, nextState: UrlSnapshot): Promise<boolean>;
|
|
47
|
-
onStart(event: NavigationStart):
|
|
48
|
-
onCancel(event: NavigationCancel):
|
|
49
|
-
onEnd(event: NavigationEnd):
|
|
50
|
-
onError(event: NavigationError):
|
|
47
|
+
onStart(event: NavigationStart): NavigationState;
|
|
48
|
+
onCancel(event: NavigationCancel): NavigationState;
|
|
49
|
+
onEnd(event: NavigationEnd): NavigationState;
|
|
50
|
+
onError(event: NavigationError): NavigationState;
|
|
51
51
|
}
|
|
52
|
-
class Active extends
|
|
52
|
+
class Active extends NavigationState {
|
|
53
53
|
readonly isPopState: boolean;
|
|
54
54
|
readonly startingUrl: string;
|
|
55
55
|
readonly active = true;
|
|
@@ -57,28 +57,28 @@ export declare namespace NavigationSession {
|
|
|
57
57
|
private _interactionContext;
|
|
58
58
|
constructor(context: Context, isPopState: boolean, startingUrl: string);
|
|
59
59
|
readonly interactionContext: InteractionContext;
|
|
60
|
-
onStart(event: NavigationStart):
|
|
61
|
-
onEnd(event: NavigationEnd):
|
|
62
|
-
onCancel(event: NavigationCancel):
|
|
63
|
-
onError(event: NavigationError):
|
|
64
|
-
onBackClickedDuringNavigationInteraction(locationTriggerUrl: string):
|
|
60
|
+
onStart(event: NavigationStart): NavigationState;
|
|
61
|
+
onEnd(event: NavigationEnd): NavigationState;
|
|
62
|
+
onCancel(event: NavigationCancel): NavigationState;
|
|
63
|
+
onError(event: NavigationError): NavigationState;
|
|
64
|
+
onBackClickedDuringNavigationInteraction(locationTriggerUrl: string): NavigationState;
|
|
65
65
|
canDeactivatePlace(component: PlaceComponent, nextState: UrlSnapshot): Promise<boolean>;
|
|
66
66
|
private detachInteractionContext;
|
|
67
67
|
toString(): string;
|
|
68
68
|
}
|
|
69
|
-
class ModalInteractionSession extends
|
|
69
|
+
class ModalInteractionSession extends NavigationState {
|
|
70
70
|
readonly startingUrl: string;
|
|
71
71
|
readonly active = false;
|
|
72
72
|
readonly isPopState = false;
|
|
73
73
|
static hasInteraction(url: string): boolean;
|
|
74
74
|
constructor(context: Context, startingUrl: string);
|
|
75
|
-
onStart(event: NavigationStart):
|
|
76
|
-
onCancel(event: NavigationCancel):
|
|
77
|
-
onEnd(event: NavigationEnd):
|
|
78
|
-
onError(event: NavigationError):
|
|
75
|
+
onStart(event: NavigationStart): NavigationState;
|
|
76
|
+
onCancel(event: NavigationCancel): NavigationState;
|
|
77
|
+
onEnd(event: NavigationEnd): NavigationState;
|
|
78
|
+
onError(event: NavigationError): NavigationState;
|
|
79
79
|
canDeactivatePlace(component: PlaceComponent, nextState: UrlSnapshot): Promise<boolean>;
|
|
80
80
|
}
|
|
81
|
-
class CancelledDuringNavigationInteraction extends
|
|
81
|
+
class CancelledDuringNavigationInteraction extends NavigationState {
|
|
82
82
|
readonly startingUrl: string;
|
|
83
83
|
readonly locationChangeTriggerUrl: string;
|
|
84
84
|
readonly active = false;
|
|
@@ -86,11 +86,11 @@ export declare namespace NavigationSession {
|
|
|
86
86
|
private capturedFauxRouterStart;
|
|
87
87
|
constructor(context: Context, startingUrl: string, locationChangeTriggerUrl: string);
|
|
88
88
|
canDeactivatePlace(component: PlaceComponent, nextState: UrlSnapshot): Promise<boolean>;
|
|
89
|
-
onCancel(event: NavigationCancel):
|
|
90
|
-
onEnd(event: NavigationEnd):
|
|
91
|
-
onError(event: NavigationError):
|
|
92
|
-
onStart(event: NavigationStart):
|
|
93
|
-
ignore(event: RouterEvent, reason?: string):
|
|
89
|
+
onCancel(event: NavigationCancel): NavigationState;
|
|
90
|
+
onEnd(event: NavigationEnd): NavigationState;
|
|
91
|
+
onError(event: NavigationError): NavigationState;
|
|
92
|
+
onStart(event: NavigationStart): NavigationState;
|
|
93
|
+
ignore(event: RouterEvent, reason?: string): NavigationState;
|
|
94
94
|
toString(): string;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { InteractionContext } from '../../interaction/interaction-context';
|
|
2
1
|
import { PlaceComponent } from '../place-component';
|
|
3
2
|
import { UrlSnapshot } from '../url-snapshot';
|
|
4
|
-
import {
|
|
3
|
+
import { NavigationState } from './navigation-state';
|
|
5
4
|
export declare class PlaceComponentDeactivationHandler {
|
|
6
5
|
readonly component: PlaceComponent;
|
|
7
|
-
readonly navigationSession:
|
|
6
|
+
readonly navigationSession: NavigationState;
|
|
8
7
|
private canDeactivatePromise;
|
|
9
|
-
constructor(component: PlaceComponent, navigationSession:
|
|
8
|
+
constructor(component: PlaceComponent, navigationSession: NavigationState);
|
|
10
9
|
canDeactivate(nextState: UrlSnapshot): Promise<boolean>;
|
|
11
10
|
protected canDeactivateComponent(nextState: UrlSnapshot): Promise<boolean>;
|
|
12
|
-
protected cancelCurrentActivityOf(interactionContext: InteractionContext): Promise<void>;
|
|
13
11
|
protected isNotJustAChangeInRouteId(nextState: UrlSnapshot): boolean;
|
|
14
12
|
}
|
package/lib/place/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export * from "./components/tabbed-place-navigation/tabbed-place-navigation.comp
|
|
|
21
21
|
export * from "./guards/abstract-place.guard";
|
|
22
22
|
export * from "./guards/consolidated-param-map";
|
|
23
23
|
export * from "./guards/interaction.guard";
|
|
24
|
-
export * from "./guards/navigation-
|
|
24
|
+
export * from "./guards/navigation-state";
|
|
25
25
|
export * from "./guards/noop-auth-guard.service";
|
|
26
26
|
export * from "./guards/place-component-deactivation-handler";
|
|
27
27
|
export * from "./route/formatter";
|
|
@@ -3,7 +3,7 @@ import { ActivatedRoute, ActivatedRouteSnapshot, Router, RouterStateSnapshot, Ur
|
|
|
3
3
|
import { GarbageCollector, HasOneIndexChain, ListModel, ValueModel } from '@coolon/pectin';
|
|
4
4
|
import { InteractionContext } from '../interaction/interaction-context';
|
|
5
5
|
import { ModalInteractionService } from '../interaction/services/modal-interaction.service';
|
|
6
|
-
import {
|
|
6
|
+
import { NavigationState } from './guards/navigation-state';
|
|
7
7
|
import { PlaceHistory } from './place-history';
|
|
8
8
|
import { UrlSnapshot } from './url-snapshot';
|
|
9
9
|
import { Visit } from './visit';
|
|
@@ -21,8 +21,8 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
21
21
|
private _navigationSessionContext;
|
|
22
22
|
constructor(router: Router, urlSerializer: UrlSerializer, angularLocation: Location, placeHistory: PlaceHistory, modalInteractionService: ModalInteractionService);
|
|
23
23
|
private processNavigationSuccess;
|
|
24
|
-
readonly navigationSession:
|
|
25
|
-
readonly navigationSessionModel: ValueModel<
|
|
24
|
+
readonly navigationSession: NavigationState;
|
|
25
|
+
readonly navigationSessionModel: ValueModel<NavigationState>;
|
|
26
26
|
readonly activeVisits: ListModel<Visit>;
|
|
27
27
|
/**
|
|
28
28
|
* placeRouter.navigate(placeDestinations.somePlace.createVisit(routeId, ...visitParams));
|
|
@@ -33,7 +33,7 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
33
33
|
}): Promise<void>;
|
|
34
34
|
pushVisitChangesToRoute(activatedRoute: ActivatedRoute, previous: Visit, next: Visit): Promise<void>;
|
|
35
35
|
doNavigation(visit: Visit, runNavigationCommands: (router: Router) => any): Promise<void>;
|
|
36
|
-
protected runStateTransition(transition: (navigationSession:
|
|
36
|
+
protected runStateTransition(transition: (navigationSession: NavigationState) => NavigationState): void;
|
|
37
37
|
private createRouteParameters;
|
|
38
38
|
extractChildPath(activatedRoute: ActivatedRouteSnapshot): any[];
|
|
39
39
|
parseUrl(snapshot: RouterStateSnapshot): UrlSnapshot;
|