@coolon/angular-ui-powerups 0.0.98 → 0.0.102
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 +2036 -1518
- 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.d.ts +19 -19
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +19 -19
- package/esm2015/index.js +2 -2
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +20 -5
- package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +13 -3
- package/esm2015/lib/interaction/index.js +5 -4
- package/esm2015/lib/interaction/interaction-context-base.js +21 -8
- package/esm2015/lib/interaction/interaction-context.js +53 -46
- package/esm2015/lib/interaction/interaction.module.js +3 -3
- package/esm2015/lib/interaction/services/interaction.service.js +232 -0
- package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +62 -0
- package/esm2015/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +145 -0
- package/esm2015/lib/interaction/services/modal-interaction-context.factory.js +17 -0
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +3 -3
- package/esm2015/lib/place/guards/navigation-state.js +406 -262
- package/esm2015/lib/place/guards/place-component-deactivation-handler.js +63 -28
- package/esm2015/lib/place/guards/place.guard.js +215 -0
- package/esm2015/lib/place/index.js +2 -3
- package/esm2015/lib/place/place-router.js +161 -118
- package/esm2015/lib/place/url-snapshot.js +124 -36
- package/esm2015/public_api.js +3 -3
- package/esm5/coolon-angular-ui-powerups.js +19 -19
- package/esm5/index.js +2 -2
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +24 -14
- package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +10 -3
- package/esm5/lib/interaction/index.js +5 -4
- package/esm5/lib/interaction/interaction-context-base.js +25 -8
- package/esm5/lib/interaction/interaction-context.js +81 -56
- package/esm5/lib/interaction/interaction.module.js +3 -3
- package/esm5/lib/interaction/services/interaction.service.js +280 -0
- package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.js +65 -0
- package/esm5/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.js +170 -0
- package/esm5/lib/interaction/services/modal-interaction-context.factory.js +27 -0
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +3 -3
- package/esm5/lib/place/guards/navigation-state.js +552 -304
- package/esm5/lib/place/guards/place-component-deactivation-handler.js +73 -27
- package/esm5/lib/place/guards/place.guard.js +300 -0
- package/esm5/lib/place/index.js +2 -3
- package/esm5/lib/place/place-router.js +199 -137
- package/esm5/lib/place/url-snapshot.js +153 -42
- package/esm5/public_api.js +3 -3
- package/fesm2015/coolon-angular-ui-powerups.js +1636 -1300
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +1985 -1466
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +1 -0
- package/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.d.ts +3 -1
- package/lib/interaction/index.d.ts +4 -3
- package/lib/interaction/interaction-context-base.d.ts +3 -1
- package/lib/interaction/interaction-context.d.ts +11 -13
- package/lib/interaction/services/interaction.service.d.ts +46 -0
- package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.d.ts +15 -0
- package/lib/interaction/services/{dialog-interaction-context.d.ts → mat-dialog-interaction/dialog-interaction-context.d.ts} +2 -2
- package/lib/interaction/services/modal-interaction-context.factory.d.ts +4 -0
- package/lib/place/guards/navigation-state.d.ts +83 -49
- package/lib/place/guards/place-component-deactivation-handler.d.ts +7 -4
- package/lib/place/guards/{abstract-place.guard.d.ts → place.guard.d.ts} +9 -4
- package/lib/place/index.d.ts +1 -2
- package/lib/place/place-router.d.ts +17 -22
- package/lib/place/url-snapshot.d.ts +23 -6
- package/package.json +1 -1
- package/schematics/place-routes/place-def.js +1 -0
- package/schematics/place-routes/place-def.js.map +1 -1
- package/schematics/place-routes/templates/place-routes.ts.template +10 -11
- package/styles/styles.scss +1 -1
- package/esm2015/lib/interaction/services/dialog-interaction-context.js +0 -163
- package/esm2015/lib/interaction/services/dialog-interaction.service.js +0 -151
- package/esm2015/lib/interaction/services/modal-interaction.service.js +0 -109
- package/esm2015/lib/place/guards/abstract-place.guard.js +0 -165
- package/esm2015/lib/place/guards/interaction.guard.js +0 -113
- package/esm5/lib/interaction/services/dialog-interaction-context.js +0 -188
- package/esm5/lib/interaction/services/dialog-interaction.service.js +0 -179
- package/esm5/lib/interaction/services/modal-interaction.service.js +0 -153
- package/esm5/lib/place/guards/abstract-place.guard.js +0 -212
- package/esm5/lib/place/guards/interaction.guard.js +0 -125
- package/lib/interaction/services/dialog-interaction.service.d.ts +0 -24
- package/lib/interaction/services/modal-interaction.service.d.ts +0 -15
- package/lib/place/guards/interaction.guard.d.ts +0 -17
|
@@ -25,6 +25,7 @@ declare class TabContext<D, R, E> implements ActivityOutletContext<D, R, E> {
|
|
|
25
25
|
readonly component: Activity<D, R, E>;
|
|
26
26
|
onDone(result: R): void;
|
|
27
27
|
onCancel(error: E): void;
|
|
28
|
+
dispose(): void;
|
|
28
29
|
}
|
|
29
30
|
export declare class ActivityContainerComponent<D, R, E> extends InteractionContextBase implements OnInit, AfterViewInit {
|
|
30
31
|
private readonly throttledNestedActivityFinishEvents;
|
|
@@ -2,13 +2,15 @@ import { AfterViewInit } from '@angular/core';
|
|
|
2
2
|
import { Constructable } from '@coolon/pectin';
|
|
3
3
|
import { Activity } from '../../activity';
|
|
4
4
|
import { InteractionContextBase } from '../../interaction-context-base';
|
|
5
|
+
import { InteractionService } from '../../services/interaction.service';
|
|
5
6
|
import { ActivityContainerComponent } from '../activity-container/activity-container.component';
|
|
6
7
|
import { ActivityOutletContext } from '../activity-outlet/activity-outlet-context';
|
|
7
8
|
export declare class InplaceInteractionContextComponent<D, R, E> extends InteractionContextBase implements AfterViewInit {
|
|
9
|
+
readonly interactionService: InteractionService;
|
|
8
10
|
interactionContext: ActivityContainerComponent<any, any, any>;
|
|
9
11
|
initialActivityContext: ActivityOutletContext<D, R, E>;
|
|
10
12
|
private _active;
|
|
11
|
-
constructor();
|
|
13
|
+
constructor(interactionService: InteractionService);
|
|
12
14
|
ngAfterViewInit(): void;
|
|
13
15
|
readonly active: import("@coolon/pectin").ValueModel<boolean>;
|
|
14
16
|
protected _startActivity<D1, R1, E1>(activityType: Constructable<Activity<D1, R1, E1>>, data?: D1): Promise<R1>;
|
|
@@ -17,6 +17,7 @@ export * from "./components/confirm-then-dialog/confirm-then-dialog.component";
|
|
|
17
17
|
export * from "./components/confirmation-dialog/confirmation-dialog.component";
|
|
18
18
|
export * from "./components/inplace-interaction-context/inplace-interaction-context.component";
|
|
19
19
|
export * from "./components/interaction-outlet/interaction-outlet.component";
|
|
20
|
-
export * from "./services/
|
|
21
|
-
export * from "./services/
|
|
22
|
-
export * from "./services/
|
|
20
|
+
export * from "./services/interaction.service";
|
|
21
|
+
export * from "./services/modal-interaction-context.factory";
|
|
22
|
+
export * from "./services/mat-dialog-interaction/dialog-interaction-context-factory";
|
|
23
|
+
export * from "./services/mat-dialog-interaction/dialog-interaction-context";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Constructable, ListModel } from '@coolon/pectin';
|
|
1
|
+
import { Constructable, ListModel, ValueModel } from '@coolon/pectin';
|
|
2
2
|
import { Activity } from './activity';
|
|
3
3
|
import { Alert } from './alert';
|
|
4
4
|
import { Confirm } from './confirm';
|
|
@@ -10,9 +10,11 @@ export declare abstract class InteractionContextBase extends InteractionContext
|
|
|
10
10
|
*/
|
|
11
11
|
private readonly _activityListDelegate;
|
|
12
12
|
private deferredGetCurrentActivity;
|
|
13
|
+
private _currentActivity;
|
|
13
14
|
protected constructor();
|
|
14
15
|
protected setActivityList(activityList: ListModel<Activity<any, any>>): void;
|
|
15
16
|
readonly activityList: ListModel<Activity<any, any, any>>;
|
|
17
|
+
readonly activeActivity: ValueModel<Activity<any, any, any>>;
|
|
16
18
|
/**
|
|
17
19
|
* Returns the activity that is currently active.
|
|
18
20
|
* This model is only updated in the next tick after the view has been updated.
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { Constructable,
|
|
1
|
+
import { Constructable, GarbageCollector, ListModel, ValueModel } from '@coolon/pectin';
|
|
2
2
|
import { Activity } from './activity';
|
|
3
3
|
import { Alert } from './alert';
|
|
4
4
|
import { Confirm } from './confirm';
|
|
5
5
|
export declare abstract class InteractionContext extends GarbageCollector {
|
|
6
|
-
private readonly activityListeners;
|
|
7
|
-
abstract readonly activityList: ListModel<Activity<any, any, any>>;
|
|
8
6
|
abstract readonly active: ValueModel<boolean>;
|
|
7
|
+
abstract readonly activityList: ListModel<Activity<any, any, any>>;
|
|
8
|
+
abstract readonly activeActivity: ValueModel<Activity<any, any, any>>;
|
|
9
9
|
/**
|
|
10
10
|
* Returns true if an activity is currently running.
|
|
11
11
|
*/
|
|
12
12
|
isActive(): boolean;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
dispose(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Cancels the current activity and returns true the context is no longer active, false if
|
|
16
|
+
* there is still another activity running.
|
|
17
|
+
*/
|
|
18
|
+
cancelCurrentActivity(): Promise<boolean>;
|
|
16
19
|
/**
|
|
17
20
|
* Returns the activity that is currently active.
|
|
18
21
|
* This model is only updated in the next tick after the view has been updated.
|
|
19
22
|
*/
|
|
20
|
-
abstract getCurrentActivity(): Promise<Activity<any, any>>;
|
|
23
|
+
protected abstract getCurrentActivity(): Promise<Activity<any, any>>;
|
|
21
24
|
abstract startActivity<D, R, E>(activityType: Constructable<Activity<D, R, E>>, data?: D): Promise<R>;
|
|
22
25
|
abstract alert(alert: Alert): Promise<void>;
|
|
23
26
|
abstract confirm(confirm: Confirm): Promise<boolean>;
|
|
@@ -29,10 +32,5 @@ export declare abstract class InteractionContext extends GarbageCollector {
|
|
|
29
32
|
* @param data the activity data.
|
|
30
33
|
*/
|
|
31
34
|
abstract confirmThen<D, R, E>(confirm: Confirm, activityType: Constructable<Activity<D, R, E>>, data?: D): Promise<R>;
|
|
32
|
-
|
|
33
|
-
export declare namespace InteractionContext {
|
|
34
|
-
interface Listener {
|
|
35
|
-
onActivityStarted(): void;
|
|
36
|
-
onActivityFinished(): void;
|
|
37
|
-
}
|
|
35
|
+
abort(): Promise<void>;
|
|
38
36
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { BooleanValueModelChain, Disposable, GarbageCollector, ListModelChain, MutableValueModel, ValueModel } from '@coolon/pectin';
|
|
2
|
+
import { InteractionContext } from '../interaction-context';
|
|
3
|
+
import { ModalInteractionContextFactory } from './modal-interaction-context.factory';
|
|
4
|
+
export declare class InteractionService {
|
|
5
|
+
readonly modelInteractionContextFactory: ModalInteractionContextFactory;
|
|
6
|
+
private readonly garbage;
|
|
7
|
+
readonly active: BooleanValueModelChain;
|
|
8
|
+
private readonly exclusiveContext;
|
|
9
|
+
private readonly _activeModalInteractionContextModel;
|
|
10
|
+
private readonly _activeInlineInteractionContextModel;
|
|
11
|
+
private readonly _activeInteractionContext;
|
|
12
|
+
readonly activeInteractionContextIds: ListModelChain<string>;
|
|
13
|
+
readonly modelInteractionActive: BooleanValueModelChain;
|
|
14
|
+
readonly inlineInteractionActive: BooleanValueModelChain;
|
|
15
|
+
constructor(modelInteractionContextFactory: ModalInteractionContextFactory);
|
|
16
|
+
isActive(): boolean;
|
|
17
|
+
isModalActive(): boolean;
|
|
18
|
+
createModalInteractionContextFor(disposable: Disposable.Collector): InteractionContext;
|
|
19
|
+
_registerInplaceInteractionContext(interactionContext: InteractionContext): void;
|
|
20
|
+
getActiveContext(): InteractionContext;
|
|
21
|
+
/**
|
|
22
|
+
* Creates an interaction context that will prevent any other contexts from starting an
|
|
23
|
+
* activity until it is disposed. This is intended for use by the router for passing
|
|
24
|
+
* to PlaceComponent.canDeactivate(interactionContext). This ensures components don't
|
|
25
|
+
* try and interact in a way that we can't track and synchronise with the browser back
|
|
26
|
+
* button.
|
|
27
|
+
*/
|
|
28
|
+
_createExclusiveModalInteractionContext(): InteractionContext;
|
|
29
|
+
}
|
|
30
|
+
export declare namespace InteractionService {
|
|
31
|
+
interface Callback {
|
|
32
|
+
onStarted(monitor: Monitor): any;
|
|
33
|
+
onFinished(monitor: Monitor): any;
|
|
34
|
+
}
|
|
35
|
+
class Monitor extends GarbageCollector {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly interactionContext: InteractionContext;
|
|
38
|
+
readonly currentActiveMonitor: MutableValueModel<Monitor>;
|
|
39
|
+
readonly exclusiveContext: ValueModel<InteractionContext>;
|
|
40
|
+
constructor(id: string, interactionContext: InteractionContext, currentActiveMonitor: MutableValueModel<Monitor>, exclusiveContext: ValueModel<InteractionContext>);
|
|
41
|
+
protected onStarted(): void;
|
|
42
|
+
private assertCanStart;
|
|
43
|
+
protected onFinished(): void;
|
|
44
|
+
private assertCurrentlyActive;
|
|
45
|
+
}
|
|
46
|
+
}
|
package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context-factory.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { MatDialog } from '@angular/material';
|
|
3
|
+
import { MatDialogConfig } from '@angular/material/dialog';
|
|
4
|
+
import { BooleanValueModelChain } from '@coolon/pectin';
|
|
5
|
+
import { InteractionContext } from '../../interaction-context';
|
|
6
|
+
import { ModalInteractionContextFactory } from '../modal-interaction-context.factory';
|
|
7
|
+
export declare const DIALOG_INTERACTION_SERVICE_DEFAULTS: InjectionToken<MatDialogConfig<any>>;
|
|
8
|
+
export declare class DialogInteractionContextFactory extends ModalInteractionContextFactory {
|
|
9
|
+
private readonly dialogService;
|
|
10
|
+
readonly dialogServiceDefaults: MatDialogConfig<any>;
|
|
11
|
+
readonly matDialogDefaultConfig: MatDialogConfig<any>;
|
|
12
|
+
readonly active: BooleanValueModelChain;
|
|
13
|
+
constructor(dialogService: MatDialog, dialogServiceDefaults: MatDialogConfig<any>, matDialogDefaultConfig: MatDialogConfig<any>);
|
|
14
|
+
createInteractionContext(): InteractionContext;
|
|
15
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MatDialog } from '@angular/material';
|
|
2
2
|
import { MatDialogConfig } from '@angular/material/dialog';
|
|
3
3
|
import { Constructable, ListModel, ValueModel } from '@coolon/pectin';
|
|
4
|
-
import { Activity } from '
|
|
5
|
-
import { InteractionContextBase } from '
|
|
4
|
+
import { Activity } from '../../activity';
|
|
5
|
+
import { InteractionContextBase } from '../../interaction-context-base';
|
|
6
6
|
export declare class DialogInteractionContext extends InteractionContextBase {
|
|
7
7
|
private readonly dialogService;
|
|
8
8
|
readonly config: MatDialogConfig<any>;
|
|
@@ -1,95 +1,129 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router, RouterEvent } from '@angular/router';
|
|
1
|
+
import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, RouterEvent } from '@angular/router';
|
|
3
2
|
import { GarbageCollector } from '@coolon/pectin';
|
|
4
3
|
import { InteractionContext } from '../../interaction/interaction-context';
|
|
5
|
-
import {
|
|
4
|
+
import { InteractionService } from '../../interaction/services/interaction.service';
|
|
6
5
|
import { PlaceComponent } from '../place-component';
|
|
7
6
|
import { PlaceDefinition } from '../place-definition';
|
|
7
|
+
import { PlaceRouter } from '../place-router';
|
|
8
8
|
import { UrlSnapshot } from '../url-snapshot';
|
|
9
9
|
import { Visit } from '../visit';
|
|
10
10
|
export declare abstract class NavigationState extends GarbageCollector {
|
|
11
11
|
protected readonly context: NavigationState.Context;
|
|
12
12
|
private _visits;
|
|
13
|
-
abstract readonly
|
|
14
|
-
abstract readonly active: boolean;
|
|
13
|
+
abstract readonly isTransitional: boolean;
|
|
15
14
|
abstract readonly startingUrl: string;
|
|
15
|
+
abstract readonly isPopState: boolean;
|
|
16
16
|
constructor(context: NavigationState.Context);
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly idle: boolean;
|
|
19
|
+
readonly placeRouter: PlaceRouter;
|
|
20
|
+
readonly interactionService: InteractionService;
|
|
17
21
|
readonly interactionContext: InteractionContext;
|
|
18
22
|
storeVisit(visit: Visit): void;
|
|
19
23
|
getVisitFor(placeDef: PlaceDefinition): Visit;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
onPlaceNavigationStart(visit: Visit, initialUrl: string): NavigationState;
|
|
25
|
+
onPopState(event: NavigationStart): NavigationState;
|
|
26
|
+
onRouterStarted(event: NavigationStart): NavigationState;
|
|
27
|
+
onRouterCancelled(event: NavigationCancel): NavigationState;
|
|
28
|
+
onRouterError(event: NavigationError): NavigationState;
|
|
29
|
+
onRouterEnd(event: NavigationEnd): NavigationState;
|
|
24
30
|
onBackClickedDuringNavigationInteraction(newUrl: string): NavigationState;
|
|
25
|
-
|
|
31
|
+
canDeactivatePlace(component: PlaceComponent, currentUrl: UrlSnapshot, nextUrl: UrlSnapshot): Promise<boolean | UrlSnapshot>;
|
|
26
32
|
getVisits(): Visit[];
|
|
27
33
|
protected illegalTransition<R>(message: string | RouterEvent): R;
|
|
28
34
|
protected currentRouterUrl(): string;
|
|
29
|
-
protected
|
|
30
|
-
protected
|
|
35
|
+
protected createTransitionStateFor(event: NavigationStart): any;
|
|
36
|
+
protected createIdleState(): any;
|
|
37
|
+
resetBrowserLocation(url: any): void;
|
|
31
38
|
toString(): string;
|
|
32
39
|
}
|
|
33
40
|
export declare namespace NavigationState {
|
|
34
41
|
class Context {
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly angularLocation: Location;
|
|
42
|
+
readonly placeRouter: PlaceRouter;
|
|
43
|
+
readonly interactionService: InteractionService;
|
|
38
44
|
readonly notifySuccess: (success: NavigationState) => void;
|
|
39
|
-
constructor(
|
|
45
|
+
constructor(placeRouter: PlaceRouter, interactionService: InteractionService, notifySuccess: (success: NavigationState) => void);
|
|
40
46
|
}
|
|
41
47
|
class Idle extends NavigationState {
|
|
42
|
-
readonly
|
|
43
|
-
readonly active = false;
|
|
48
|
+
readonly isTransitional = false;
|
|
44
49
|
readonly startingUrl: any;
|
|
50
|
+
readonly isPopState = false;
|
|
45
51
|
constructor(context: Context);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
onEnd(event: NavigationEnd): NavigationState;
|
|
50
|
-
onError(event: NavigationError): NavigationState;
|
|
52
|
+
onPlaceNavigationStart(visit: Visit, initialUrl: string): NavigationState;
|
|
53
|
+
onRouterStarted(event: NavigationStart): NavigationState;
|
|
54
|
+
onPopState(event: NavigationStart): NavigationState;
|
|
51
55
|
}
|
|
52
|
-
class
|
|
53
|
-
readonly isPopState: boolean;
|
|
56
|
+
abstract class AbstractNavigationTransition extends NavigationState {
|
|
54
57
|
readonly startingUrl: string;
|
|
55
|
-
readonly
|
|
58
|
+
readonly isTransitional = true;
|
|
56
59
|
private componentDeactivationHandlers;
|
|
57
60
|
private _interactionContext;
|
|
58
|
-
constructor(context: Context,
|
|
61
|
+
constructor(context: Context, startingUrl: string);
|
|
59
62
|
readonly interactionContext: InteractionContext;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
onCancel(event: NavigationCancel): NavigationState;
|
|
63
|
-
onError(event: NavigationError): NavigationState;
|
|
63
|
+
onRouterStarted(event: NavigationStart): NavigationState;
|
|
64
|
+
onRouterEnd(event: NavigationEnd): NavigationState;
|
|
64
65
|
onBackClickedDuringNavigationInteraction(locationTriggerUrl: string): NavigationState;
|
|
65
|
-
canDeactivatePlace(component: PlaceComponent,
|
|
66
|
+
canDeactivatePlace(component: PlaceComponent, currentUrl: UrlSnapshot, nextUrl: UrlSnapshot): Promise<boolean | UrlSnapshot>;
|
|
66
67
|
private detachInteractionContext;
|
|
68
|
+
}
|
|
69
|
+
class NavigationTransition extends AbstractNavigationTransition {
|
|
70
|
+
readonly isPopState = false;
|
|
71
|
+
onRouterCancelled(event: NavigationCancel): NavigationState;
|
|
72
|
+
onRouterError(event: NavigationError): NavigationState;
|
|
67
73
|
toString(): string;
|
|
68
74
|
}
|
|
69
|
-
class
|
|
75
|
+
class PopStateTransition extends AbstractNavigationTransition {
|
|
76
|
+
readonly isPopState = true;
|
|
77
|
+
onRouterCancelled(event: NavigationCancel): NavigationState;
|
|
78
|
+
onRouterError(event: NavigationError): NavigationState;
|
|
79
|
+
}
|
|
80
|
+
class IdleDuringInteraction extends NavigationState {
|
|
70
81
|
readonly startingUrl: string;
|
|
71
|
-
readonly
|
|
82
|
+
readonly isTransitional = false;
|
|
72
83
|
readonly isPopState = false;
|
|
73
|
-
static hasInteraction(url: string): boolean;
|
|
74
84
|
constructor(context: Context, startingUrl: string);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
onPlaceNavigationStart(visit: Visit, initialUrl: string): NavigationState;
|
|
86
|
+
onRouterStarted(event: NavigationStart): NavigationState;
|
|
87
|
+
onPopState(event: NavigationStart): NavigationState;
|
|
88
|
+
}
|
|
89
|
+
abstract class AbstractInteractionTransition extends AbstractNavigationTransition {
|
|
90
|
+
readonly startingUrl: string;
|
|
91
|
+
readonly isTransitional = true;
|
|
92
|
+
constructor(context: Context, startingUrl: string);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* This state exists to handle all events while any kind of navigation is in progress. That way all other states can
|
|
96
|
+
* happily ignore interaction contexts.
|
|
97
|
+
*/
|
|
98
|
+
class InteractionTransition extends AbstractInteractionTransition {
|
|
99
|
+
readonly isPopState = false;
|
|
100
|
+
onRouterCancelled(event: NavigationCancel): NavigationState;
|
|
101
|
+
onRouterError(event: NavigationError): NavigationState;
|
|
102
|
+
onRouterEnd(event: NavigationEnd): NavigationState;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* This state exists to handle all events while any kind of navigation is in progress. That way all other states can
|
|
106
|
+
* happily ignore interaction contexts.
|
|
107
|
+
*/
|
|
108
|
+
class InteractionPopStateTransition extends AbstractInteractionTransition {
|
|
109
|
+
readonly isPopState = true;
|
|
110
|
+
onRouterCancelled(event: NavigationCancel): NavigationState;
|
|
111
|
+
onRouterEnd(event: NavigationEnd): NavigationState;
|
|
80
112
|
}
|
|
81
113
|
class CancelledDuringNavigationInteraction extends NavigationState {
|
|
82
114
|
readonly startingUrl: string;
|
|
115
|
+
readonly startingEventWasAPopState: boolean;
|
|
83
116
|
readonly locationChangeTriggerUrl: string;
|
|
84
|
-
readonly
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
117
|
+
readonly isPopState = false;
|
|
118
|
+
private gotPopStateWithLeavingUrl;
|
|
119
|
+
constructor(context: Context, startingUrl: string, startingEventWasAPopState: boolean, locationChangeTriggerUrl: string);
|
|
120
|
+
readonly isTransitional: boolean;
|
|
121
|
+
onRouterStarted(event: NavigationStart): NavigationState;
|
|
122
|
+
onRouterCancelled(event: NavigationCancel): NavigationState;
|
|
123
|
+
onRouterEnd(event: NavigationEnd): NavigationState;
|
|
124
|
+
onRouterError(event: NavigationError): NavigationState;
|
|
125
|
+
onPopState(event: NavigationStart): NavigationState;
|
|
126
|
+
canDeactivatePlace(component: PlaceComponent, currentUrl: UrlSnapshot, nextUrl: UrlSnapshot): Promise<boolean | UrlSnapshot>;
|
|
93
127
|
ignore(event: RouterEvent, reason?: string): NavigationState;
|
|
94
128
|
toString(): string;
|
|
95
129
|
}
|
|
@@ -3,10 +3,13 @@ import { UrlSnapshot } from '../url-snapshot';
|
|
|
3
3
|
import { NavigationState } from './navigation-state';
|
|
4
4
|
export declare class PlaceComponentDeactivationHandler {
|
|
5
5
|
readonly component: PlaceComponent;
|
|
6
|
-
readonly
|
|
6
|
+
readonly navigationState: NavigationState;
|
|
7
|
+
readonly isPrimaryComponent: boolean;
|
|
7
8
|
private canDeactivatePromise;
|
|
8
|
-
constructor(component: PlaceComponent,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
constructor(component: PlaceComponent, navigationState: NavigationState, isPrimaryComponent: boolean);
|
|
10
|
+
readonly interactionService: import("../../interaction").InteractionService;
|
|
11
|
+
readonly placeRouter: import("..").PlaceRouter;
|
|
12
|
+
canDeactivate(currentUrl: UrlSnapshot, nextState: UrlSnapshot): Promise<boolean | UrlSnapshot>;
|
|
13
|
+
protected canDeactivateComponent(currentUrl: UrlSnapshot, nextState: UrlSnapshot): Promise<UrlSnapshot | boolean>;
|
|
11
14
|
protected isNotJustAChangeInRouteId(nextState: UrlSnapshot): boolean;
|
|
12
15
|
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { Injector } from '@angular/core';
|
|
2
2
|
import { ActivatedRouteSnapshot, CanActivate, CanDeactivate, Router, RouterStateSnapshot, UrlSerializer, UrlTree } from '@angular/router';
|
|
3
|
+
import { InteractionService } from '../../interaction/services/interaction.service';
|
|
3
4
|
import { PlaceComponent } from '../place-component';
|
|
4
5
|
import { PlaceDefinition } from '../place-definition';
|
|
5
6
|
import { PlaceHistory } from '../place-history';
|
|
6
7
|
import { PlaceRouter } from '../place-router';
|
|
7
|
-
|
|
8
|
+
import { UrlSnapshot } from '../url-snapshot';
|
|
9
|
+
export declare abstract class PlaceGuard implements CanActivate, CanDeactivate<PlaceComponent> {
|
|
8
10
|
private readonly router;
|
|
9
11
|
private urlSerializer;
|
|
10
12
|
private readonly placeRouter;
|
|
11
13
|
private readonly placeHistory;
|
|
14
|
+
private readonly interactionService;
|
|
12
15
|
private readonly injector;
|
|
13
|
-
constructor(router: Router, urlSerializer: UrlSerializer, placeRouter: PlaceRouter, placeHistory: PlaceHistory, injector: Injector);
|
|
16
|
+
constructor(router: Router, urlSerializer: UrlSerializer, placeRouter: PlaceRouter, placeHistory: PlaceHistory, interactionService: InteractionService, injector: Injector);
|
|
14
17
|
canActivate(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree>;
|
|
15
|
-
canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean>;
|
|
16
|
-
|
|
18
|
+
canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean | UrlTree>;
|
|
19
|
+
private handleGuardResult;
|
|
20
|
+
protected authorisePlaceThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, runPlaceGuards: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree>;
|
|
17
21
|
isAuthorised(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree>;
|
|
18
22
|
abstract getAuthGuard(injector: Injector): CanActivate;
|
|
23
|
+
cleanInteractionState(route: ActivatedRouteSnapshot, state: RouterStateSnapshot, then: () => Promise<boolean | UrlSnapshot>): Promise<boolean | UrlSnapshot>;
|
|
19
24
|
}
|
package/lib/place/index.d.ts
CHANGED
|
@@ -18,12 +18,11 @@ export * from "./components/list-place-nav/list-place-nav.component";
|
|
|
18
18
|
export * from "./components/place-outlet/place-outlet.component";
|
|
19
19
|
export * from "./components/place-outlet/route-animations";
|
|
20
20
|
export * from "./components/tabbed-place-navigation/tabbed-place-navigation.component";
|
|
21
|
-
export * from "./guards/abstract-place.guard";
|
|
22
21
|
export * from "./guards/consolidated-param-map";
|
|
23
|
-
export * from "./guards/interaction.guard";
|
|
24
22
|
export * from "./guards/navigation-state";
|
|
25
23
|
export * from "./guards/noop-auth-guard.service";
|
|
26
24
|
export * from "./guards/place-component-deactivation-handler";
|
|
25
|
+
export * from "./guards/place.guard";
|
|
27
26
|
export * from "./route/formatter";
|
|
28
27
|
export * from "./route/json-types";
|
|
29
28
|
export * from "./route/parameter-decorators";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Location } from '@angular/common';
|
|
2
|
-
import { ActivatedRoute, ActivatedRouteSnapshot, Router,
|
|
2
|
+
import { ActivatedRoute, ActivatedRouteSnapshot, Router, UrlSerializer } from '@angular/router';
|
|
3
3
|
import { GarbageCollector, HasOneIndexChain, ListModel, ValueModel } from '@coolon/pectin';
|
|
4
|
-
import {
|
|
5
|
-
import { ModalInteractionService } from '../interaction/services/modal-interaction.service';
|
|
4
|
+
import { InteractionService } from '../interaction/services/interaction.service';
|
|
6
5
|
import { NavigationState } from './guards/navigation-state';
|
|
7
6
|
import { PlaceHistory } from './place-history';
|
|
8
7
|
import { UrlSnapshot } from './url-snapshot';
|
|
@@ -12,17 +11,17 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
12
11
|
private readonly urlSerializer;
|
|
13
12
|
private readonly angularLocation;
|
|
14
13
|
private readonly placeHistory;
|
|
15
|
-
private readonly
|
|
16
|
-
private
|
|
17
|
-
private readonly _navigationSessionModel;
|
|
14
|
+
private readonly interactionService;
|
|
15
|
+
private readonly _navigationStateModel;
|
|
18
16
|
private readonly _activeVisits;
|
|
19
|
-
readonly
|
|
17
|
+
readonly navigationInProgress: ValueModel<boolean>;
|
|
20
18
|
readonly activeVisitIndex: HasOneIndexChain<'placeDefinition', Visit>;
|
|
21
19
|
private _navigationSessionContext;
|
|
22
|
-
|
|
20
|
+
private _navigationStateTypeModel;
|
|
21
|
+
constructor(router: Router, urlSerializer: UrlSerializer, angularLocation: Location, placeHistory: PlaceHistory, interactionService: InteractionService);
|
|
23
22
|
private processNavigationSuccess;
|
|
24
|
-
readonly
|
|
25
|
-
readonly
|
|
23
|
+
readonly navigationState: NavigationState;
|
|
24
|
+
readonly navigationStateModel: ValueModel<NavigationState>;
|
|
26
25
|
readonly activeVisits: ListModel<Visit>;
|
|
27
26
|
/**
|
|
28
27
|
* placeRouter.navigate(placeDestinations.somePlace.createVisit(routeId, ...visitParams));
|
|
@@ -36,16 +35,12 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
36
35
|
protected runStateTransition(transition: (navigationSession: NavigationState) => NavigationState): void;
|
|
37
36
|
private createRouteParameters;
|
|
38
37
|
extractChildPath(activatedRoute: ActivatedRouteSnapshot): any[];
|
|
39
|
-
parseUrl(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
readonly isNavigating: boolean;
|
|
48
|
-
onActivityStarted(): void;
|
|
49
|
-
onActivityFinished(): void;
|
|
50
|
-
}
|
|
38
|
+
parseUrl(url: string): UrlSnapshot;
|
|
39
|
+
resetBrowserLocation(url: string): void;
|
|
40
|
+
getCurrentRouterUrl(): string;
|
|
41
|
+
getCurrentRouteSnapshot(): UrlSnapshot;
|
|
42
|
+
getActiveInteractionIdsFromUrl(url: string): string[];
|
|
43
|
+
hasActiveInteractionIds(url: string): boolean;
|
|
44
|
+
navigateByUrl(urlSnapshot: UrlSnapshot): void;
|
|
45
|
+
syncInteractionIdsWithRouter(): void;
|
|
51
46
|
}
|
|
@@ -1,16 +1,33 @@
|
|
|
1
|
-
import { UrlSegment, UrlTree } from '@angular/router';
|
|
1
|
+
import { NavigationExtras, UrlSegment, UrlSerializer, UrlTree } from '@angular/router';
|
|
2
2
|
import { PlaceDefinition } from './place-definition';
|
|
3
3
|
import { Visit } from './visit';
|
|
4
4
|
export declare class UrlSnapshot {
|
|
5
|
+
readonly urlSerializer: UrlSerializer;
|
|
6
|
+
readonly url: string;
|
|
7
|
+
private readonly options;
|
|
5
8
|
readonly urlTree: UrlTree;
|
|
6
|
-
constructor(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
constructor(urlSerializer: UrlSerializer, url: string, options: NavigationExtras);
|
|
10
|
+
updateVisitSegments(visit: Visit): UrlSnapshot;
|
|
11
|
+
private getPrimarySegments;
|
|
9
12
|
/**
|
|
10
13
|
* Converts the visit into segments. Please not that these segments are not e
|
|
11
14
|
* @param visit
|
|
12
15
|
*/
|
|
13
|
-
|
|
14
|
-
createRedirectCommandsFor(visit: Visit): any[];
|
|
16
|
+
protected getSegmentsFor(visit: Visit): UrlSegment[];
|
|
15
17
|
includesPathOf(placeDef: PlaceDefinition): UrlSegment;
|
|
18
|
+
getInteractionIds(): string[];
|
|
19
|
+
hasInteractionIds(): boolean;
|
|
20
|
+
updateInteractionIds(ids: string[]): UrlSnapshot;
|
|
21
|
+
removeInteractionIds(): UrlSnapshot;
|
|
22
|
+
withOptions(options: NavigationExtras): UrlSnapshot;
|
|
23
|
+
getNavigationExtras(): NavigationExtras;
|
|
24
|
+
}
|
|
25
|
+
export declare namespace UrlSnapshot {
|
|
26
|
+
const INTERACTION_QUERY_PARAM = "aup-interactions";
|
|
27
|
+
const INTERACTION_ID_SEPARATOR = "--";
|
|
28
|
+
function parseInteractionIds(path: string): string[];
|
|
29
|
+
function createPathIdFor(interactionIds: string[]): string;
|
|
30
|
+
interface NavigationOptions {
|
|
31
|
+
replaceUrl?: boolean;
|
|
32
|
+
}
|
|
16
33
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-def.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/place-def.ts"],"names":[],"mappings":";;;;;;;;AACA,2CAAsC;AACtC,0EAA2E;AAE3E,+DAA0D;AAE1D,MAAa,QAAQ;IAInB,YACW,cAAsB,EACtB,UAAkB,EAClB,cAAsB,EACtB,UAA4B,EAC5B,QAA4B,EAC5B,eAAqC,EACrC,SAA8B,EAC9B,0BAAkC;QAPlC,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAQ;QAClB,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,C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AAkB;QACxB,OAAO,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;IACjE,CAAC;IAGD,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;IACxD,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,KAAK,MAAM,CAAC;IACjD,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED,gBAAgB;QACd,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,mBAAmB,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC;SACnE;QACD,IAAI,CAAC,IAAI,CAAC;aACD,IAAI,CAAC,QAAQ;iBACT,IAAI,CAAC,cAAc
|
|
1
|
+
{"version":3,"file":"place-def.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-routes/place-def.ts"],"names":[],"mappings":";;;;;;;;AACA,2CAAsC;AACtC,0EAA2E;AAE3E,+DAA0D;AAE1D,MAAa,QAAQ;IAInB,YACW,cAAsB,EACtB,UAAkB,EAClB,cAAsB,EACtB,UAA4B,EAC5B,QAA4B,EAC5B,eAAqC,EACrC,SAA8B,EAC9B,0BAAkC;QAPlC,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAQ;QAClB,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAkB;QAC5B,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,oBAAe,GAAf,eAAe,CAAsB;QACrC,cAAS,GA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;YACV,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;QAED,OAAO,CAAC,SAAqB;YAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,KAAK,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,cAAc,KAAK,IAAI,CAAC,cAAc,CAAC,CAAC;YACrH,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;KACF;IAdY,iBAAQ,WAcpB,CAAA;AAGH,CAAC,EAzCgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAyCxB"}
|
|
@@ -12,8 +12,13 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
import { Injectable, Injector } from '@angular/core';
|
|
15
|
-
import { Router, UrlSerializer } from '@angular/router';
|
|
16
|
-
import {
|
|
15
|
+
import { Routes, Router, UrlSerializer } from '@angular/router';
|
|
16
|
+
import {
|
|
17
|
+
InteractionService,
|
|
18
|
+
PlaceGuard as AbstractPlaceGuard,
|
|
19
|
+
PlaceHistory,
|
|
20
|
+
PlaceRouter
|
|
21
|
+
} from '@coolon/angular-ui-powerups';
|
|
17
22
|
import { <%= config.authGuard.className %> } from '<%= config.authGuard.importPath %>';
|
|
18
23
|
|
|
19
24
|
<% placeDefs.forEach(def => { %>import {<%= def.componentClass %>} from "<%= def.importPath %>";
|
|
@@ -28,8 +33,9 @@ export class PlaceGuard extends AbstractPlaceGuard {
|
|
|
28
33
|
urlSerializer: UrlSerializer,
|
|
29
34
|
placeRouter: PlaceRouter,
|
|
30
35
|
placeHistory: PlaceHistory,
|
|
36
|
+
interactionService:InteractionService,
|
|
31
37
|
injector: Injector) {
|
|
32
|
-
super(router, urlSerializer, placeRouter, placeHistory, injector);
|
|
38
|
+
super(router, urlSerializer, placeRouter, placeHistory,interactionService, injector);
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
getAuthGuard(injector:Injector) {
|
|
@@ -37,14 +43,7 @@ export class PlaceGuard extends AbstractPlaceGuard {
|
|
|
37
43
|
}
|
|
38
44
|
}
|
|
39
45
|
|
|
40
|
-
export const placeRoutes = [<% placeDefs.filter(def=> !def.isChild()).forEach(def => { %>
|
|
46
|
+
export const placeRoutes:Routes = [<% placeDefs.filter(def=> !def.isChild()).forEach(def => { %>
|
|
41
47
|
<%= def.getRouteTemplate() %>,
|
|
42
48
|
<% }) %>
|
|
43
|
-
{
|
|
44
|
-
path: "modal",
|
|
45
|
-
outlet:PlaceRouter.INTERACTION_ROUTER_OUTLET,
|
|
46
|
-
component: NoopComponent,
|
|
47
|
-
canDeactivate: [InteractionGuard],
|
|
48
|
-
canActivate: [InteractionGuard]
|
|
49
|
-
}
|
|
50
49
|
];
|