@coolon/angular-ui-powerups 14.27.0 → 14.29.0
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/esm2020/lib/components/tables/abstract-table.component.mjs +2 -4
- package/esm2020/lib/place/components/abstract-place-navigation.component.mjs +14 -15
- package/esm2020/lib/place/components/place-outlet/place-outlet.component.mjs +27 -26
- package/esm2020/lib/place/exports.mjs +3 -2
- package/esm2020/lib/place/guards/place.guard.mjs +49 -30
- package/esm2020/lib/place/navigation/session/interactions/navigating-during-interaction.mjs +2 -2
- package/esm2020/lib/place/navigation/session/navigating.mjs +7 -3
- package/esm2020/lib/place/navigation/session/navigation-context.mjs +1 -1
- package/esm2020/lib/place/navigation/session/navigation-session.mjs +22 -9
- package/esm2020/lib/place/navigation/session/pop-state-navigation.mjs +2 -2
- package/esm2020/lib/place/place-component.mjs +2 -2
- package/esm2020/lib/place/place-definition.mjs +62 -3
- package/esm2020/lib/place/place-history.mjs +24 -17
- package/esm2020/lib/place/place-router.mjs +48 -60
- package/esm2020/lib/place/route/parameter-definition.mjs +2 -2
- package/esm2020/lib/place/route/parameter-sanitiser.mjs +1 -1
- package/esm2020/lib/place/route/visit-segment-sanitiser.mjs +41 -0
- package/esm2020/lib/place/url-service.mjs +3 -3
- package/esm2020/lib/place/url-snapshot.mjs +26 -23
- package/esm2020/lib/place/visit-segment.mjs +86 -0
- package/esm2020/lib/place/visit.mjs +78 -55
- package/fesm2015/coolon-angular-ui-powerups.mjs +2079 -1883
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +3317 -3123
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/place/components/abstract-place-navigation.component.d.ts +2 -0
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +3 -5
- package/lib/place/exports.d.ts +2 -1
- package/lib/place/guards/place.guard.d.ts +4 -1
- package/lib/place/navigation/session/navigation-context.d.ts +3 -3
- package/lib/place/navigation/session/navigation-session.d.ts +7 -4
- package/lib/place/place-component.d.ts +3 -3
- package/lib/place/place-definition.d.ts +20 -15
- package/lib/place/place-history.d.ts +17 -11
- package/lib/place/place-router.d.ts +12 -21
- package/lib/place/route/parameter-definition.d.ts +2 -2
- package/lib/place/route/parameter-sanitiser.d.ts +2 -2
- package/lib/place/route/{visit-sanitiser.d.ts → visit-segment-sanitiser.d.ts} +3 -3
- package/lib/place/url-service.d.ts +2 -2
- package/lib/place/url-snapshot.d.ts +8 -7
- package/lib/place/visit-segment.d.ts +24 -0
- package/lib/place/visit.d.ts +22 -25
- package/package.json +1 -1
- package/esm2020/lib/place/route/visit-sanitiser.mjs +0 -41
- package/schematics/place-routes/templates/place-destinations.ts.template +0 -19
- package/schematics/place-routes/templates/place-visits.ts.template +0 -16
|
@@ -22,10 +22,12 @@ export declare class AbstractPlaceNavigationComponent extends DisposableComponen
|
|
|
22
22
|
readonly commandFactory: Command.Factory<PlaceDefinition, void>;
|
|
23
23
|
readonly _activePlaceComponent: DelegatingValueModel<PlaceComponent>;
|
|
24
24
|
private activePlaceDefinition;
|
|
25
|
+
private placeFaces;
|
|
25
26
|
readonly trackByPlaceDef: TrackByFunction<MenuItem>;
|
|
26
27
|
constructor(placeRouter: PlaceRouter);
|
|
27
28
|
protected handlePlaceOutLetChanged(outlet: PlaceOutletComponent): void;
|
|
28
29
|
getNavigationFace(placeDef: PlaceDefinition): CommandFace;
|
|
30
|
+
private createCommandFaceFor;
|
|
29
31
|
ngOnInit(): void;
|
|
30
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractPlaceNavigationComponent, never>;
|
|
31
33
|
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractPlaceNavigationComponent, "ng-component", never, { "places": "places"; "placesModel": "placesModel"; "placeOutlet": "placeOutlet"; "placeOutletModel": "placeOutletModel"; }, {}, never, never, false>;
|
|
@@ -7,7 +7,6 @@ import { PlaceComponent } from '../../place-component';
|
|
|
7
7
|
import { PlaceConfig } from '../../place-config';
|
|
8
8
|
import { PlaceDefinition } from '../../place-definition';
|
|
9
9
|
import { PlaceRouter } from '../../place-router';
|
|
10
|
-
import { Visit } from '../../visit';
|
|
11
10
|
import * as i0 from "@angular/core";
|
|
12
11
|
export declare const AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT: InjectionToken<Constructable<any>>;
|
|
13
12
|
export declare class PlaceOutletComponent extends DisposableComponent implements OnInit {
|
|
@@ -29,8 +28,8 @@ export declare class PlaceOutletComponent extends DisposableComponent implements
|
|
|
29
28
|
private parentOutletModel;
|
|
30
29
|
readonly activePlaceAnimationPosition: ValueModelChain<number>;
|
|
31
30
|
private initialPlaceIndex;
|
|
32
|
-
private
|
|
33
|
-
private
|
|
31
|
+
private currentVisitSegment$;
|
|
32
|
+
private _isPushingVisitToRouter;
|
|
34
33
|
private navigationInProgress;
|
|
35
34
|
private isVeryFirstLoad;
|
|
36
35
|
private placesInAnimationOrder;
|
|
@@ -43,7 +42,6 @@ export declare class PlaceOutletComponent extends DisposableComponent implements
|
|
|
43
42
|
getAnimationOrder(): number;
|
|
44
43
|
get animationDuration(): string;
|
|
45
44
|
get isAuthorised(): boolean;
|
|
46
|
-
navigate(visit: Visit): void;
|
|
47
45
|
get parentOutlet(): PlaceOutletComponent;
|
|
48
46
|
get activePlaceModel(): ValueModel<PlaceComponent>;
|
|
49
47
|
get activatedRouteModel(): ValueModel<ActivatedRoute>;
|
|
@@ -53,7 +51,7 @@ export declare class PlaceOutletComponent extends DisposableComponent implements
|
|
|
53
51
|
private checkStateAndInitialise;
|
|
54
52
|
private initialisePlace;
|
|
55
53
|
private pushVisitChangeToComponent;
|
|
56
|
-
private
|
|
54
|
+
private notifyComponentVisitSegmentChanged;
|
|
57
55
|
animationStarted(): void;
|
|
58
56
|
animationDone(): void;
|
|
59
57
|
static ɵfac: i0.ɵɵFactoryDeclaration<PlaceOutletComponent, [null, null, { optional: true; }, { optional: true; }, { optional: true; skipSelf: true; }, null]>;
|
package/lib/place/exports.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from "./place.decorator";
|
|
|
12
12
|
export * from "./place.module";
|
|
13
13
|
export * from "./url-service";
|
|
14
14
|
export * from "./url-snapshot";
|
|
15
|
+
export * from "./visit-segment";
|
|
15
16
|
export * from "./visit";
|
|
16
17
|
export * from "./components/abstract-place-navigation.component";
|
|
17
18
|
export * from "./components/list-place-nav/list-place-nav.component";
|
|
@@ -43,4 +44,4 @@ export * from "./route/parameter-decorators";
|
|
|
43
44
|
export * from "./route/parameter-definition";
|
|
44
45
|
export * from "./route/parameter-sanitiser";
|
|
45
46
|
export * from "./route/parameter-snapshot";
|
|
46
|
-
export * from "./route/visit-sanitiser";
|
|
47
|
+
export * from "./route/visit-segment-sanitiser";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Injector } from '@angular/core';
|
|
2
2
|
import { ActivatedRouteSnapshot, CanActivate, CanDeactivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
|
3
3
|
import { InteractionService } from '../../interaction/services/interaction.service';
|
|
4
|
+
import { PlaceAccessGuard } from "../place-access-guard";
|
|
4
5
|
import { PlaceComponent } from '../place-component';
|
|
5
6
|
import { PlaceHistory } from '../place-history';
|
|
6
7
|
import { PlaceRouter } from '../place-router';
|
|
@@ -15,11 +16,13 @@ export declare class PlaceGuard implements CanActivate, CanDeactivate<PlaceCompo
|
|
|
15
16
|
private readonly interactionService;
|
|
16
17
|
private readonly injector;
|
|
17
18
|
constructor(router: Router, urlService: UrlService, placeRouter: PlaceRouter, placeHistory: PlaceHistory, interactionService: InteractionService, injector: Injector);
|
|
19
|
+
get accessGuard(): PlaceAccessGuard;
|
|
18
20
|
canActivate(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree>;
|
|
21
|
+
private findBestAuthenticatedAlternative;
|
|
19
22
|
canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean | UrlTree>;
|
|
20
23
|
private getPlaceDefinition;
|
|
21
24
|
private createUrlTree;
|
|
22
|
-
cleanInteractionState(route: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: () => Promise<boolean | UrlSnapshot>): Promise<boolean | UrlSnapshot>;
|
|
25
|
+
cleanInteractionState(route: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: () => Promise<boolean | UrlSnapshot | UrlTree>): Promise<boolean | UrlSnapshot | UrlTree>;
|
|
23
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<PlaceGuard, never>;
|
|
24
27
|
static ɵprov: i0.ɵɵInjectableDeclaration<PlaceGuard>;
|
|
25
28
|
}
|
|
@@ -6,7 +6,7 @@ import { NavigationSession } from './navigation-session';
|
|
|
6
6
|
export interface NavigationContext {
|
|
7
7
|
readonly urlService: UrlService;
|
|
8
8
|
readonly routerInteractionAdapter: InteractionServiceRoutingAdapter;
|
|
9
|
-
finishRoutingSession(
|
|
9
|
+
finishRoutingSession(visit?: Visit): any;
|
|
10
10
|
transitionTo(newState: NavigationSession): any;
|
|
11
11
|
navigateByUrl(urlSnapshot: UrlSnapshot, options: {
|
|
12
12
|
replaceUrl: boolean;
|
|
@@ -20,9 +20,9 @@ export declare namespace NavigationContext {
|
|
|
20
20
|
replaceUrl: boolean;
|
|
21
21
|
}) => Promise<boolean>;
|
|
22
22
|
readonly transitionTo: (newState: NavigationSession) => void;
|
|
23
|
-
readonly finishRoutingSession: (
|
|
23
|
+
readonly finishRoutingSession: (visit?: Visit) => void;
|
|
24
24
|
constructor(urlService: UrlService, routerInteractionAdapter: InteractionServiceRoutingAdapter, navigateByUrl: (urlSnapshot: UrlSnapshot, options: {
|
|
25
25
|
replaceUrl: boolean;
|
|
26
|
-
}) => Promise<boolean>, transitionTo: (newState: NavigationSession) => void, finishRoutingSession: (
|
|
26
|
+
}) => Promise<boolean>, transitionTo: (newState: NavigationSession) => void, finishRoutingSession: (visit?: Visit) => void);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -7,6 +7,7 @@ import { PlaceDefinition } from "../../place-definition";
|
|
|
7
7
|
import { UrlService } from "../../url-service";
|
|
8
8
|
import { UrlSnapshot } from "../../url-snapshot";
|
|
9
9
|
import { Visit } from "../../visit";
|
|
10
|
+
import { VisitSegment } from "../../visit-segment";
|
|
10
11
|
import { NavigationContext } from "./navigation-context";
|
|
11
12
|
/**
|
|
12
13
|
* Transient states
|
|
@@ -15,7 +16,7 @@ export declare abstract class NavigationSession extends GarbageCollector {
|
|
|
15
16
|
readonly context: NavigationContext;
|
|
16
17
|
readonly startingUrl: string;
|
|
17
18
|
debugPropertyKeys: string[];
|
|
18
|
-
private
|
|
19
|
+
private _visitSegments;
|
|
19
20
|
private componentDeactivationHandlers;
|
|
20
21
|
abstract readonly isPopState: boolean;
|
|
21
22
|
private _interactionContext;
|
|
@@ -24,8 +25,10 @@ export declare abstract class NavigationSession extends GarbageCollector {
|
|
|
24
25
|
get name(): string;
|
|
25
26
|
get urlService(): UrlService;
|
|
26
27
|
get interactionServiceAdapter(): InteractionServiceRoutingAdapter;
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
initialiseVisitSegments(visit: Visit): void;
|
|
29
|
+
updateVisitSegment(segment: VisitSegment): void;
|
|
30
|
+
getVisitSegmentFor(placeDef: PlaceDefinition): VisitSegment;
|
|
31
|
+
createUpdatedVisit(url: string): Visit;
|
|
29
32
|
get canDeactivateInteractionContext(): InteractionContext;
|
|
30
33
|
notifyActive(): void;
|
|
31
34
|
onRouterStarted(event: NavigationStart): void;
|
|
@@ -34,7 +37,7 @@ export declare abstract class NavigationSession extends GarbageCollector {
|
|
|
34
37
|
onRouterCancelled(event: NavigationCancel): void;
|
|
35
38
|
onRouterError(event: NavigationError): void;
|
|
36
39
|
onRouterEnd(event: NavigationEnd): void;
|
|
37
|
-
|
|
40
|
+
getVisitSegments(): VisitSegment[];
|
|
38
41
|
protected illegalTransition<R>(message: string | RouterEvent): R;
|
|
39
42
|
protected currentRouterUrl(): string;
|
|
40
43
|
resetBrowserLocation(url: any, options?: {
|
|
@@ -6,7 +6,7 @@ import { InteractionContext } from '../interaction/interaction-context';
|
|
|
6
6
|
import { PlaceDefinition } from './place-definition';
|
|
7
7
|
import { ParameterDefinition } from './route/parameter-definition';
|
|
8
8
|
import { UrlSnapshot } from './url-snapshot';
|
|
9
|
-
import {
|
|
9
|
+
import { VisitSegment } from './visit-segment';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
export declare const DEFINITION_META_DATA_KEY = "PLACE_DEFINITION_OPTIONS";
|
|
12
12
|
export declare const ROUTE_PARAMETER_LIST_KEY: unique symbol;
|
|
@@ -20,8 +20,8 @@ export declare class PlaceComponent extends DisposableComponent {
|
|
|
20
20
|
private readonly _parameterChangeInterceptors;
|
|
21
21
|
canDeactivate?(interactionContext: InteractionContext): boolean | Promise<boolean>;
|
|
22
22
|
constructor();
|
|
23
|
-
initialiseVisit(visit:
|
|
24
|
-
updateVisit(visit:
|
|
23
|
+
initialiseVisit(visit: VisitSegment, notifyVisitChanged: (current: VisitSegment, previous: VisitSegment) => void): void;
|
|
24
|
+
updateVisit(visit: VisitSegment): void;
|
|
25
25
|
isInitialised(): boolean;
|
|
26
26
|
/**
|
|
27
27
|
* Initialised the component bindings. If any binding has an initial model value (e.g. a selection model
|
|
@@ -1,39 +1,44 @@
|
|
|
1
1
|
import { ParamMap } from '@angular/router';
|
|
2
|
-
import { Constructable } from '@coolon/pectin';
|
|
2
|
+
import { Constructable, Predicate } from '@coolon/pectin';
|
|
3
3
|
import { PlaceComponent } from './place-component';
|
|
4
4
|
import { ParameterDefinition } from './route/parameter-definition';
|
|
5
|
-
import {
|
|
5
|
+
import { VisitSegment } from './visit-segment';
|
|
6
6
|
export declare class PlaceDefinition {
|
|
7
7
|
readonly component: Constructable<PlaceComponent>;
|
|
8
8
|
readonly path: string;
|
|
9
9
|
readonly authenticate: boolean;
|
|
10
10
|
readonly role: any;
|
|
11
|
-
readonly data:
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
};
|
|
11
|
+
readonly data: Record<string, any>;
|
|
14
12
|
readonly routeParameters: ParameterDefinition<any>[];
|
|
15
13
|
readonly children: PlaceDefinition[];
|
|
16
14
|
readonly redirectToFirstChild: boolean;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
private _parent;
|
|
16
|
+
constructor(component: Constructable<PlaceComponent>, path: string, authenticate: boolean, role: any, data: Record<string, any>, routeParameters: ParameterDefinition<any>[], children: PlaceDefinition[], redirectToFirstChild: boolean);
|
|
17
|
+
ancestors(): PlaceDefinition[];
|
|
18
|
+
ancestorsAndSelf(): PlaceDefinition[];
|
|
19
|
+
protected setParent(parent: PlaceDefinition): void;
|
|
20
|
+
get parent(): PlaceDefinition;
|
|
21
|
+
isRoot(): boolean;
|
|
22
|
+
hasParent(): boolean;
|
|
23
|
+
hasChildren(): boolean;
|
|
24
|
+
findChild(predicate: Predicate<PlaceDefinition>): PlaceDefinition | undefined;
|
|
20
25
|
hasRouteId(): boolean;
|
|
21
26
|
getRouteIdParameterDef(): ParameterDefinition<any>;
|
|
22
27
|
getRouteParameterDefs(includeRouteId?: boolean): ParameterDefinition<any>[];
|
|
23
28
|
getVisitParameterDefs(include?: PlaceDefinition.ParameterOptions): ParameterDefinition<any>[];
|
|
24
29
|
getPlaceData<T>(key: string, defaultValue?: T): T;
|
|
25
30
|
searchPlaceData<T>(keys: string[], defaultValue?: T): T;
|
|
26
|
-
getRouteIdFrom(visit:
|
|
27
|
-
getFormattedRouteId(visit:
|
|
28
|
-
getFormattedRouteParameters(visit:
|
|
31
|
+
getRouteIdFrom(visit: VisitSegment): any;
|
|
32
|
+
getFormattedRouteId(visit: VisitSegment): any;
|
|
33
|
+
getFormattedRouteParameters(visit: VisitSegment, includeRouteId?: boolean): {
|
|
29
34
|
[p: string]: string;
|
|
30
35
|
};
|
|
31
|
-
getNonRouteParameters(visit:
|
|
36
|
+
getNonRouteParameters(visit: VisitSegment): {
|
|
32
37
|
[p: string]: string;
|
|
33
38
|
};
|
|
34
|
-
parseRouteParams(params: ParamMap):
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
parseRouteParams(params: ParamMap): Record<string, any>;
|
|
40
|
+
validateRouteParameters(params: Record<string, any>): void;
|
|
41
|
+
hasAncestor(placeComponent: Constructable<PlaceComponent>): boolean;
|
|
37
42
|
}
|
|
38
43
|
export declare namespace PlaceDefinition {
|
|
39
44
|
interface ParameterOptions {
|
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
import { PlaceDefinition } from './place-definition';
|
|
2
|
-
import { Visit } from
|
|
2
|
+
import { Visit } from "./visit";
|
|
3
|
+
import { VisitSegment } from './visit-segment';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* TODO: this should be updated to store the last x visists rathern than a map of places to visit segments.
|
|
7
|
+
* This would allow it to return segments that are relevent to a particular parent path. Currently
|
|
8
|
+
* it just returns the last segment so it can return child ids that don't belong to the current parent.
|
|
9
|
+
*/
|
|
4
10
|
export declare class PlaceHistory {
|
|
5
|
-
private
|
|
11
|
+
private _activeSegments;
|
|
6
12
|
private _previousVisits;
|
|
7
13
|
private _archive;
|
|
8
14
|
private readonly placeHistoryDepth;
|
|
9
15
|
constructor();
|
|
10
16
|
notifyNavigationStarted(): void;
|
|
11
|
-
notifyNavigationFinished(visits: Visit
|
|
12
|
-
|
|
17
|
+
notifyNavigationFinished(visits: Visit): void;
|
|
18
|
+
updateVisitSegment(visit: VisitSegment): void;
|
|
13
19
|
lastVisitIncluded(placeDef: PlaceDefinition): boolean;
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
getMostRecentVisitSegmentFor(placeDef: PlaceDefinition): VisitSegment;
|
|
21
|
+
getSegmentHistoryFor(placeDef: PlaceDefinition): VisitSegment[];
|
|
16
22
|
private setHistory;
|
|
17
|
-
protected
|
|
23
|
+
protected archiveSegments(visits: VisitSegment[]): void;
|
|
18
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<PlaceHistory, never>;
|
|
19
25
|
static ɵprov: i0.ɵɵInjectableDeclaration<PlaceHistory>;
|
|
20
26
|
}
|
|
21
27
|
export declare namespace PlaceHistory {
|
|
22
28
|
class VisitRecord {
|
|
23
|
-
|
|
24
|
-
constructor(
|
|
25
|
-
update(visit:
|
|
26
|
-
getVisitFor(placeDef: PlaceDefinition):
|
|
29
|
+
visitSegments: VisitSegment[];
|
|
30
|
+
constructor(visitSegments: VisitSegment[]);
|
|
31
|
+
update(visit: VisitSegment): void;
|
|
32
|
+
getVisitFor(placeDef: PlaceDefinition): VisitSegment | undefined;
|
|
27
33
|
}
|
|
28
34
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Location } from "@angular/common";
|
|
2
|
-
import {
|
|
3
|
-
import { GarbageCollector,
|
|
2
|
+
import { ActivatedRouteSnapshot, NavigationCancel, NavigationEnd, NavigationError, NavigationExtras, NavigationStart, Router, RouterStateSnapshot } from "@angular/router";
|
|
3
|
+
import { GarbageCollector, MutableValueModel, ValueModel, ValueModelChain } from "@coolon/pectin";
|
|
4
4
|
import { Constructable } from "@coolon/typescript-utilities";
|
|
5
5
|
import { InteractionService } from "../interaction/services/interaction.service";
|
|
6
6
|
import { NavigationSession } from "./navigation/session/navigation-session";
|
|
7
7
|
import { PlaceAccessGuard } from "./place-access-guard";
|
|
8
8
|
import { PlaceComponent } from "./place-component";
|
|
9
|
-
import { PlaceDefinition } from "./place-definition";
|
|
10
9
|
import { PlaceHistory } from "./place-history";
|
|
11
10
|
import { UrlService } from "./url-service";
|
|
12
11
|
import { UrlSnapshot } from "./url-snapshot";
|
|
13
12
|
import { Visit } from "./visit";
|
|
13
|
+
import { VisitSegment } from "./visit-segment";
|
|
14
14
|
import * as i0 from "@angular/core";
|
|
15
15
|
export declare class PlaceRouter extends GarbageCollector {
|
|
16
16
|
private readonly angularRouter;
|
|
@@ -23,10 +23,9 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
23
23
|
readonly navigationSessionName$: ValueModelChain<string>;
|
|
24
24
|
readonly interactionSyncInProgress$: ValueModel<boolean>;
|
|
25
25
|
private readonly navigationContext;
|
|
26
|
-
private readonly
|
|
26
|
+
private readonly _activeVisit$;
|
|
27
27
|
private readonly routerInteractionAdapter;
|
|
28
28
|
private sessionFinishedJobs;
|
|
29
|
-
readonly state$: ValueModel<PlaceRouter.State>;
|
|
30
29
|
/**
|
|
31
30
|
* An observable model containing the authoriser function. This allows places to react to changes
|
|
32
31
|
* in permissions when any underlying auth logic changes, e.g. a role being removed from a user.
|
|
@@ -37,7 +36,7 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
37
36
|
get accessGuard$(): ValueModel<PlaceAccessGuard>;
|
|
38
37
|
configureAuth(accessGrant: ValueModel<PlaceAccessGuard>, redirections: PlaceRouter.Redirections): void;
|
|
39
38
|
getAuthenticationFailureRedirect(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Visit;
|
|
40
|
-
getAuthorisationFailureRedirectOptions(component: Constructable<PlaceComponent>):
|
|
39
|
+
getAuthorisationFailureRedirectOptions(component: Constructable<PlaceComponent>): Visit[];
|
|
41
40
|
get navigationSession(): NavigationSession;
|
|
42
41
|
get currentSession(): NavigationSession;
|
|
43
42
|
isNavigating(): boolean;
|
|
@@ -49,13 +48,12 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
49
48
|
onRouterCancelled(event: NavigationCancel): void;
|
|
50
49
|
onRouterError(event: NavigationError): void;
|
|
51
50
|
onRouterEnd(event: NavigationEnd): void;
|
|
52
|
-
navigate(visit: Visit
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
doNavigation(visit: Visit | Visit[], runNavigationCommands: (router: Router) => any): Promise<void>;
|
|
51
|
+
navigate(visit: Visit): any;
|
|
52
|
+
navigate(placeComponent: Constructable<PlaceComponent>, params?: Record<string, any>): any;
|
|
53
|
+
doNavigation(visit: Visit, runNavigationCommands: (router: Router) => any): Promise<void>;
|
|
56
54
|
navigateByUrl(urlSnapshot: UrlSnapshot, navigationExtras?: NavigationExtras): Promise<boolean>;
|
|
57
|
-
get
|
|
58
|
-
|
|
55
|
+
get activeVisit$(): ValueModel<Visit>;
|
|
56
|
+
notifyVisitSegmentChanged(is: VisitSegment, was: VisitSegment): Promise<void>;
|
|
59
57
|
private createNavigationSession;
|
|
60
58
|
protected transitionTo(next: NavigationSession): void;
|
|
61
59
|
private routingSessionFinished;
|
|
@@ -66,7 +64,7 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
66
64
|
* the app directly and we don't get to ask.
|
|
67
65
|
*/
|
|
68
66
|
syncInteractionContextIdsWithRouter(onSyncComplete?: () => void): Promise<void>;
|
|
69
|
-
private
|
|
67
|
+
private toVisit;
|
|
70
68
|
static ɵfac: i0.ɵɵFactoryDeclaration<PlaceRouter, never>;
|
|
71
69
|
static ɵprov: i0.ɵɵInjectableDeclaration<PlaceRouter>;
|
|
72
70
|
}
|
|
@@ -75,9 +73,8 @@ export declare namespace PlaceRouter {
|
|
|
75
73
|
/**
|
|
76
74
|
* NOTE: for now this only supports top level places. Support for child places will require a more fundamental
|
|
77
75
|
* change to visits to support nesting
|
|
78
|
-
* @param component
|
|
79
76
|
*/
|
|
80
|
-
onAuthenticationFailure(activatedRoute?: ActivatedRouteSnapshot, state?: RouterStateSnapshot): Visit
|
|
77
|
+
onAuthenticationFailure(activatedRoute?: ActivatedRouteSnapshot, state?: RouterStateSnapshot): Visit | Constructable<PlaceComponent>;
|
|
81
78
|
/**
|
|
82
79
|
* NOTE: for now this only supports top level places. Support for child places will require a more fundamental
|
|
83
80
|
* change to visits to support nesting
|
|
@@ -85,10 +82,4 @@ export declare namespace PlaceRouter {
|
|
|
85
82
|
*/
|
|
86
83
|
onAuthorisationFailure(component: Constructable<PlaceComponent>): (Constructable<PlaceComponent> | Visit)[];
|
|
87
84
|
}
|
|
88
|
-
class State {
|
|
89
|
-
private readonly activeVisits;
|
|
90
|
-
constructor(activeVisits: Visit[]);
|
|
91
|
-
isPlaceActive(placeDefinition: PlaceDefinition): boolean;
|
|
92
|
-
getVisitFor(placeDefinition: PlaceDefinition): Visit;
|
|
93
|
-
}
|
|
94
85
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Injector } from '@angular/core';
|
|
2
2
|
import { Constructable, HasValue, ListModel, MutableListModel, MutableValueModel, ValueModel } from '@coolon/pectin';
|
|
3
3
|
import { PlaceHistory } from '../place-history';
|
|
4
|
-
import {
|
|
4
|
+
import { VisitSegment } from '../visit-segment';
|
|
5
5
|
import { Formatter } from './formatter';
|
|
6
6
|
import { ParameterSanitiser } from './parameter-sanitiser';
|
|
7
7
|
export declare abstract class ParameterDefinition<T, E = T> {
|
|
@@ -20,7 +20,7 @@ export declare abstract class ParameterDefinition<T, E = T> {
|
|
|
20
20
|
abstract hasChanged(a: any, b: any): boolean;
|
|
21
21
|
createBackingModel(): HasValue<T>;
|
|
22
22
|
protected getOptionValue<K extends keyof ParameterDefinition.Options<T>>(key: K): ParameterDefinition.Options<T>[K];
|
|
23
|
-
sanitise(value: T, visit:
|
|
23
|
+
sanitise(value: T, visit: VisitSegment, placeHistory: PlaceHistory, injector: Injector, isPopState: boolean): Promise<T>;
|
|
24
24
|
private runCustomSanitiser;
|
|
25
25
|
private sanitiseMissing;
|
|
26
26
|
private prepareCustomSanitiser;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Injector } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { VisitSegment } from '../visit-segment';
|
|
3
3
|
export interface ParameterSanitiser<T> {
|
|
4
|
-
sanitise(parameterValue: T, visit?:
|
|
4
|
+
sanitise(parameterValue: T, visit?: VisitSegment, injector?: Injector): Promise<T> | T;
|
|
5
5
|
}
|
|
@@ -2,13 +2,13 @@ import { Injector } from '@angular/core';
|
|
|
2
2
|
import { ActivatedRouteSnapshot, Router } from '@angular/router';
|
|
3
3
|
import { NavigationSession } from '../navigation/session/navigation-session';
|
|
4
4
|
import { PlaceHistory } from '../place-history';
|
|
5
|
-
import {
|
|
6
|
-
export declare class
|
|
5
|
+
import { VisitSegment } from '../visit-segment';
|
|
6
|
+
export declare class VisitSegmentSanitiser {
|
|
7
7
|
private navigationSession;
|
|
8
8
|
private activatedRoute;
|
|
9
9
|
private router;
|
|
10
10
|
private placeHistory;
|
|
11
11
|
private injector;
|
|
12
12
|
constructor(navigationSession: NavigationSession, activatedRoute: ActivatedRouteSnapshot, router: Router, placeHistory: PlaceHistory, injector: Injector);
|
|
13
|
-
sanitise(
|
|
13
|
+
sanitise(segment: VisitSegment): Promise<VisitSegment>;
|
|
14
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Location } from '@angular/common';
|
|
2
2
|
import { Router, UrlSerializer } from '@angular/router';
|
|
3
3
|
import { UrlSnapshot } from './url-snapshot';
|
|
4
|
-
import {
|
|
4
|
+
import { VisitSegment } from './visit-segment';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class UrlService {
|
|
7
7
|
private readonly angularRouter;
|
|
@@ -9,7 +9,7 @@ export declare class UrlService {
|
|
|
9
9
|
readonly urlSerializer: UrlSerializer;
|
|
10
10
|
constructor(angularRouter: Router, angularLocation: Location, urlSerializer: UrlSerializer);
|
|
11
11
|
parseUrl(url: string): UrlSnapshot;
|
|
12
|
-
createUrlSnapshot(
|
|
12
|
+
createUrlSnapshot(visits: VisitSegment[]): UrlSnapshot;
|
|
13
13
|
getCurrentRouterUrl(): string;
|
|
14
14
|
getCurrentLocationUrl(): string;
|
|
15
15
|
/**
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { UrlSegment, UrlSerializer, UrlTree } from '@angular/router';
|
|
2
2
|
import { PlaceDefinition } from './place-definition';
|
|
3
|
-
import {
|
|
3
|
+
import { VisitSegment } from './visit-segment';
|
|
4
4
|
export declare class UrlSnapshot {
|
|
5
5
|
readonly urlSerializer: UrlSerializer;
|
|
6
6
|
readonly url: string;
|
|
7
7
|
readonly urlTree: UrlTree;
|
|
8
8
|
constructor(urlSerializer: UrlSerializer, url: string);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
private
|
|
9
|
+
updateVisitSegment(visitSegment: VisitSegment): UrlSnapshot;
|
|
10
|
+
appendSegment(visitSegment: VisitSegment): UrlSnapshot;
|
|
11
|
+
private getPrimaryUrlSegments;
|
|
12
12
|
/**
|
|
13
13
|
* Converts the visit into segments. Please not that these segments are not e
|
|
14
|
-
* @param
|
|
14
|
+
* @param visitSegment
|
|
15
15
|
*/
|
|
16
|
-
protected
|
|
16
|
+
protected getUrlSegmentsForVisitSegment(visitSegment: VisitSegment): UrlSegment[];
|
|
17
17
|
includesPathOf(placeDef: PlaceDefinition): UrlSegment;
|
|
18
18
|
isLastPlaceInUrl(placeDef: PlaceDefinition): boolean;
|
|
19
|
-
|
|
19
|
+
createVisitSegmentFor(placeDef: PlaceDefinition): VisitSegment;
|
|
20
20
|
getInteractionIds(): string[];
|
|
21
21
|
hasInteractions(): boolean;
|
|
22
22
|
hasInteractionIds(ids: string[]): boolean;
|
|
23
23
|
updateInteractionIds(ids: string[]): UrlSnapshot;
|
|
24
24
|
removeInteractionIds(): UrlSnapshot;
|
|
25
25
|
toString(): string;
|
|
26
|
+
containsVisitSegment(segment: VisitSegment): boolean;
|
|
26
27
|
}
|
|
27
28
|
export declare namespace UrlSnapshot {
|
|
28
29
|
const INTERACTION_QUERY_PARAM = "aup-interactions";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PlaceDefinition } from './place-definition';
|
|
2
|
+
import { ParameterDefinition } from './route/parameter-definition';
|
|
3
|
+
export declare class VisitSegment {
|
|
4
|
+
readonly placeDefinition: PlaceDefinition;
|
|
5
|
+
readonly visitParameters: Record<string, any>;
|
|
6
|
+
constructor(placeDefinition: PlaceDefinition, visitParameters?: Record<string, any>);
|
|
7
|
+
getRouteId(): any;
|
|
8
|
+
hasRouteId(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the value of the place parameter with the specified name. The parameter
|
|
11
|
+
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
12
|
+
* same as the ValueModel property name.
|
|
13
|
+
* @param parameter the visit parameter definition
|
|
14
|
+
*/
|
|
15
|
+
getParameterValue<T, S>(parameter: ParameterDefinition<T, S> | string): T;
|
|
16
|
+
hasParameter(parameterDef: ParameterDefinition<any>): boolean;
|
|
17
|
+
replace<T>(parameter: ParameterDefinition<T, any>, value: T): VisitSegment;
|
|
18
|
+
mergeRouteParameters<S>(routeParams: Record<string, any>): VisitSegment;
|
|
19
|
+
hasRoutingChangedFrom(other: VisitSegment): boolean;
|
|
20
|
+
hasChangedFrom(other: VisitSegment): boolean;
|
|
21
|
+
createRouterCommands(): string[];
|
|
22
|
+
copyMissingFrom(other: VisitSegment): VisitSegment;
|
|
23
|
+
toDebugString(): string;
|
|
24
|
+
}
|
package/lib/place/visit.d.ts
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
1
|
+
import { Constructable } from "@coolon/typescript-utilities";
|
|
2
|
+
import { PlaceAccessGuard } from "./place-access-guard";
|
|
3
|
+
import { PlaceComponent } from "./place-component";
|
|
4
|
+
import { PlaceDefinition } from "./place-definition";
|
|
5
|
+
import { VisitSegment } from "./visit-segment";
|
|
6
6
|
export declare class Visit {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
hasRoutingChangedFrom(other: Visit): boolean;
|
|
25
|
-
hasChangedFrom(other: Visit): boolean;
|
|
7
|
+
protected segmentsByPlaceComponent: Map<Constructable<PlaceComponent>, VisitSegment>;
|
|
8
|
+
protected readonly destinationSegment: VisitSegment;
|
|
9
|
+
protected readonly destinationPlaceDef: PlaceDefinition;
|
|
10
|
+
static goto(placeComponent: Constructable<PlaceComponent>, visitParameters?: Record<string, any>): Visit;
|
|
11
|
+
static fromSegments(segments: VisitSegment[]): Visit;
|
|
12
|
+
protected constructor(segments: VisitSegment[]);
|
|
13
|
+
protected get definedSegments(): Map<Constructable<PlaceComponent>, VisitSegment>;
|
|
14
|
+
withAncestorParameters(placeComponent: Constructable<PlaceComponent>, parameters: Record<string, any>): this;
|
|
15
|
+
get segments(): VisitSegment[];
|
|
16
|
+
private resolveSegments;
|
|
17
|
+
copyWithDefaultsFrom(other: Visit): Visit;
|
|
18
|
+
copyAndReplaceSegment(replace: VisitSegment): Visit;
|
|
19
|
+
isPlaceActive(placeDefinition: PlaceDefinition): boolean;
|
|
20
|
+
getSegmentFor(placeDefinition: PlaceDefinition): VisitSegment;
|
|
21
|
+
getRouterCommands(): string[];
|
|
22
|
+
isAuthorised(guard: PlaceAccessGuard): boolean;
|
|
23
|
+
requiresAuthentication(): boolean;
|
|
26
24
|
toDebugString(): string;
|
|
27
25
|
}
|
|
28
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export class VisitSanitiser {
|
|
2
|
-
constructor(navigationSession, activatedRoute, router, placeHistory, injector) {
|
|
3
|
-
this.navigationSession = navigationSession;
|
|
4
|
-
this.activatedRoute = activatedRoute;
|
|
5
|
-
this.router = router;
|
|
6
|
-
this.placeHistory = placeHistory;
|
|
7
|
-
this.injector = injector;
|
|
8
|
-
}
|
|
9
|
-
// @Trace()
|
|
10
|
-
async sanitise(visit) {
|
|
11
|
-
const placeDef = visit.placeDefinition;
|
|
12
|
-
if (placeDef.hasRouteId()) {
|
|
13
|
-
const routeIdDef = placeDef.getRouteIdParameterDef();
|
|
14
|
-
const routeId = visit.getRouteId();
|
|
15
|
-
const sanitisedValue = await routeIdDef.sanitise(routeId, visit, this.placeHistory, this.injector, this.navigationSession.isPopState);
|
|
16
|
-
// console.log({routeId, sanitisedValue});
|
|
17
|
-
// ###------- EARLY EXIT --------###
|
|
18
|
-
if (routeIdDef.hasChanged(routeId, sanitisedValue)) {
|
|
19
|
-
// if the route id has changed we redirect immediately as other
|
|
20
|
-
// parameter sanitisers might use it.
|
|
21
|
-
return visit.replace(routeIdDef, sanitisedValue);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
// if we didn't replace the routeId we continue the url present parameters.
|
|
25
|
-
const parameterDefs = placeDef.getVisitParameterDefs({
|
|
26
|
-
includeRouteParameters: true,
|
|
27
|
-
includeNonRouteParameters: true
|
|
28
|
-
});
|
|
29
|
-
let sanitisedVisit = visit;
|
|
30
|
-
for (let i = 0; i < parameterDefs.length; i++) {
|
|
31
|
-
const def = parameterDefs[i];
|
|
32
|
-
const value = visit.getParameterValue(def);
|
|
33
|
-
const sanitisedValue = await def.sanitise(value, sanitisedVisit, this.placeHistory, this.injector, this.navigationSession.isPopState);
|
|
34
|
-
if (def.hasChanged(value, sanitisedValue)) {
|
|
35
|
-
sanitisedVisit = sanitisedVisit.replace(def, sanitisedValue);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return sanitisedVisit.hasChangedFrom(visit) ? sanitisedVisit : visit;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmlzaXQtc2FuaXRpc2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyLXVpLXBvd2VydXBzL3NyYy9saWIvcGxhY2Uvcm91dGUvdmlzaXQtc2FuaXRpc2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9BLE1BQU0sT0FBTyxjQUFjO0lBQ3pCLFlBQW9C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vbnN0IHNhbml0aXNlZFZhbHVlID0gYXdhaXQgZGVmLnNhbml0aXNlKHZhbHVlLCBzYW5pdGlzZWRWaXNpdCwgdGhpcy5wbGFjZUhpc3RvcnksIHRoaXMuaW5qZWN0b3IsIHRoaXMubmF2aWdhdGlvblNlc3Npb24uaXNQb3BTdGF0ZSk7XG4gICAgICBpZiAoZGVmLmhhc0NoYW5nZWQodmFsdWUsIHNhbml0aXNlZFZhbHVlKSkge1xuICAgICAgICBzYW5pdGlzZWRWaXNpdCA9IHNhbml0aXNlZFZpc2l0LnJlcGxhY2UoZGVmLCBzYW5pdGlzZWRWYWx1ZSk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHNhbml0aXNlZFZpc2l0Lmhhc0NoYW5nZWRGcm9tKHZpc2l0KSA/IHNhbml0aXNlZFZpc2l0IDogdmlzaXQ7XG4gIH1cblxufVxuIl19
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// DO NOT EDIT!!!
|
|
2
|
-
// This file is automatically generated using:
|
|
3
|
-
// ng generate @coolon/angular-ui-powerups:place-routes --project=powerup-demo --dir=app/places
|
|
4
|
-
|
|
5
|
-
import { Visit } from '@coolon/angular-ui-powerups';
|
|
6
|
-
<% placeDefs.forEach(def => { %>import {<%= def.componentClass %>Visit} from "./place-visits";
|
|
7
|
-
<% }); %>
|
|
8
|
-
|
|
9
|
-
<% visitParameterImports.forEach(p => { %>import {<%= p.typeName %>} from "<%= p.importPath %>";
|
|
10
|
-
<% }) %>
|
|
11
|
-
|
|
12
|
-
export const placeDestinations = {
|
|
13
|
-
<% placeDefs.forEach(def => { %>
|
|
14
|
-
<%= def.placeName %>: {
|
|
15
|
-
pathSegment: "<%=def.path%>",
|
|
16
|
-
<%=def.getPlaceDestinationCreateVisitMethod()%>
|
|
17
|
-
},
|
|
18
|
-
<% }) %>
|
|
19
|
-
};
|