@coolon/angular-ui-powerups 16.1.0-alpha.230 → 16.1.0-alpha.231
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/esm2022/lib/interaction/components/activity-container/activity-container.component.mjs +49 -3
- package/esm2022/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.mjs +7 -1
- package/esm2022/lib/place/guards/place.guard.mjs +22 -7
- package/esm2022/lib/place/place-definition.mjs +4 -2
- package/esm2022/lib/place/place-history.mjs +12 -1
- package/esm2022/lib/place/place.decorator.mjs +2 -2
- package/fesm2022/coolon-angular-ui-powerups.mjs +90 -10
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +11 -0
- package/lib/place/guards/place.guard.d.ts +7 -0
- package/lib/place/place-definition.d.ts +2 -1
- package/lib/place/place-history.d.ts +2 -0
- package/lib/place/place.decorator.d.ts +8 -0
- package/package.json +2 -2
|
@@ -16,8 +16,10 @@ export declare class ActivityContainerComponent<D, R, E> extends AbstractInterac
|
|
|
16
16
|
activityOutlets: QueryList<ActivityOutletComponent<unknown, unknown, unknown>>;
|
|
17
17
|
activityRefs: ActivityRef<unknown, unknown, unknown>[];
|
|
18
18
|
animationDuration: string;
|
|
19
|
+
private static readonly ROUTE_SYNC_TIMEOUT_MS;
|
|
19
20
|
private _identifier;
|
|
20
21
|
private _deferredCleanUp;
|
|
22
|
+
private inactiveListeners;
|
|
21
23
|
private interactionServiceApi;
|
|
22
24
|
private garbage;
|
|
23
25
|
private syncSelectedTabTimeout;
|
|
@@ -51,6 +53,7 @@ export declare class ActivityContainerComponent<D, R, E> extends AbstractInterac
|
|
|
51
53
|
*/
|
|
52
54
|
cancelActiveActivity(): Promise<boolean>;
|
|
53
55
|
protected createAndLaunchActivity<D1, R1, E1>(activityType: Constructable<Activity<D1, R1, E1>>, data: D1, options?: InteractionContext.Options): Promise<R1>;
|
|
56
|
+
private waitForActivitiesSynchronisedOrTimeout;
|
|
54
57
|
private getActiveActivityCount;
|
|
55
58
|
/**
|
|
56
59
|
* Checks if this interaction context has finished an is in the process of waiting
|
|
@@ -58,6 +61,14 @@ export declare class ActivityContainerComponent<D, R, E> extends AbstractInterac
|
|
|
58
61
|
*/
|
|
59
62
|
isCleaningUp(): boolean;
|
|
60
63
|
waitForInteractionContextCleanupToFinish(): Promise<any>;
|
|
64
|
+
/**
|
|
65
|
+
* Register a one-shot callback invoked the moment the container has no active activity left
|
|
66
|
+
* (the last activity completed via done()/cancel()). It fires BEFORE route synchronisation, so
|
|
67
|
+
* an owner (e.g. the dialog interaction context) can tear its overlay down immediately rather
|
|
68
|
+
* than waiting on the route sync — which can wedge and otherwise strand the backdrop.
|
|
69
|
+
*/
|
|
70
|
+
onceInactive(listener: () => void): void;
|
|
71
|
+
private notifyInactive;
|
|
61
72
|
private finishAndStartCleanup;
|
|
62
73
|
launchActivity<D1, R1, E1>(activityRef: ActivityRef<D1, R1, E1>): void;
|
|
63
74
|
activityIndex(index: number, activityRef: ActivityRef<unknown, unknown, unknown>): number;
|
|
@@ -18,6 +18,13 @@ export declare class PlaceGuard {
|
|
|
18
18
|
constructor(router: Router, urlService: UrlService, placeRouter: PlaceRouter, placeHistory: PlaceHistory, interactionService: InteractionService, injector: Injector);
|
|
19
19
|
get authService(): PlaceAuthService;
|
|
20
20
|
canActivate(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree>;
|
|
21
|
+
/**
|
|
22
|
+
* Chooses the child to redirect to when {@link PlaceDefinition.redirectToFirstChild} is set. When
|
|
23
|
+
* `rememberLastChild` is enabled (the default) and we have a record of the last active child that is
|
|
24
|
+
* still a valid, authorised child, we return to it. Otherwise we fall back to the first authorised
|
|
25
|
+
* child (the legacy behaviour).
|
|
26
|
+
*/
|
|
27
|
+
private selectRedirectChild;
|
|
21
28
|
private findBestAuthenticatedAlternative;
|
|
22
29
|
canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean | UrlTree>;
|
|
23
30
|
private getPlaceDefinition;
|
|
@@ -12,9 +12,10 @@ export declare class PlaceDefinition {
|
|
|
12
12
|
readonly routeParameters: ParameterDefinition<any>[];
|
|
13
13
|
readonly children: PlaceDefinition[];
|
|
14
14
|
readonly redirectToFirstChild: boolean;
|
|
15
|
+
readonly rememberLastChild: boolean;
|
|
15
16
|
private _parent;
|
|
16
17
|
readonly name: string;
|
|
17
|
-
constructor(component: Constructable<PlaceComponent>, path: string, authenticate: boolean, role: any, data: Record<string, any>, routeParameters: ParameterDefinition<any>[], children: PlaceDefinition[], redirectToFirstChild: boolean);
|
|
18
|
+
constructor(component: Constructable<PlaceComponent>, path: string, authenticate: boolean, role: any, data: Record<string, any>, routeParameters: ParameterDefinition<any>[], children: PlaceDefinition[], redirectToFirstChild: boolean, rememberLastChild: boolean);
|
|
18
19
|
ancestors(): PlaceDefinition[];
|
|
19
20
|
ancestorsAndSelf(): PlaceDefinition[];
|
|
20
21
|
get placeId(): string;
|
|
@@ -11,9 +11,11 @@ export declare class PlaceHistory {
|
|
|
11
11
|
private _activeSegments;
|
|
12
12
|
private _previousVisits;
|
|
13
13
|
private _archive;
|
|
14
|
+
private _lastActiveChild;
|
|
14
15
|
private readonly placeHistoryDepth;
|
|
15
16
|
notifyNavigationStarted(): void;
|
|
16
17
|
notifyNavigationFinished(visits: Visit): void;
|
|
18
|
+
getLastActiveChild(parent: PlaceDefinition): PlaceDefinition | undefined;
|
|
17
19
|
updateVisitSegment(visit: VisitSegment): void;
|
|
18
20
|
lastVisitIncluded(placeDef: PlaceDefinition): boolean;
|
|
19
21
|
getMostRecentVisitSegmentFor(placeDef: PlaceDefinition): VisitSegment;
|
|
@@ -19,5 +19,13 @@ export declare namespace Place {
|
|
|
19
19
|
*/
|
|
20
20
|
defaultChild?: Constructable<PlaceComponent>;
|
|
21
21
|
redirectToFirstChild?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* When redirecting to a child (see {@link redirectToFirstChild}), return to the child that was
|
|
24
|
+
* active on the last visit rather than always the first child. Falls back to the first
|
|
25
|
+
* authorised child when there is no history (e.g. the first visit or after a page reload).
|
|
26
|
+
*
|
|
27
|
+
* Only meaningful alongside `redirectToFirstChild: true`. Defaults to `true`.
|
|
28
|
+
*/
|
|
29
|
+
rememberLastChild?: boolean;
|
|
22
30
|
}
|
|
23
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coolon/angular-ui-powerups",
|
|
3
|
-
"version": "16.1.0-alpha.
|
|
3
|
+
"version": "16.1.0-alpha.231",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/animations": "^16.2.9",
|
|
6
6
|
"@angular/common": "^16.2.9",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@angular/platform-browser-dynamic": "^16.2.9",
|
|
13
13
|
"@angular/material-moment-adapter": "^16.2.10",
|
|
14
14
|
"@angular/router": "^16.2.9",
|
|
15
|
-
"@coolon/pectin": "^5.0.0-alpha.
|
|
15
|
+
"@coolon/pectin": "^5.0.0-alpha.123",
|
|
16
16
|
"fast-typescript-memoize": "^1.1.1",
|
|
17
17
|
"lodash-es": "^4.17.21",
|
|
18
18
|
"marked": "4.0.10",
|