@coolon/angular-ui-powerups 16.1.0-alpha.273 → 16.1.0-alpha.275
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/place/components/abstract-place-navigation.component.mjs +31 -2
- package/esm2022/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.mjs +44 -5
- package/esm2022/lib/place/guards/place.guard.mjs +31 -2
- package/esm2022/lib/place/navigation/session/pop-state-navigation.mjs +2 -2
- package/fesm2022/coolon-angular-ui-powerups.mjs +101 -6
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/place/components/abstract-place-navigation.component.d.ts +11 -2
- package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +16 -0
- package/lib/place/guards/place.guard.d.ts +22 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TrackByFunction } from '@angular/core';
|
|
2
|
-
import { Command, Constructable, DelegatingValueModel, ListModel, ListModelChain, ValueModel } from '@coolon/pectin';
|
|
2
|
+
import { BooleanValueModelChain, Command, Constructable, DelegatingValueModel, ListModel, ListModelChain, ValueModel } from '@coolon/pectin';
|
|
3
3
|
import type { CommandFace } from '../../components/commands/command-face';
|
|
4
4
|
import { DisposableComponent } from '../../components/disposable-component';
|
|
5
5
|
import { PlaceComponent } from '../place-component';
|
|
@@ -17,8 +17,17 @@ export declare class AbstractPlaceNavigationComponent extends DisposableComponen
|
|
|
17
17
|
accessor places$: ListModel<Constructable<PlaceComponent>>;
|
|
18
18
|
accessor placeOutlet: PlaceOutletComponent;
|
|
19
19
|
accessor placeOutlet$: ValueModel<PlaceOutletComponent>;
|
|
20
|
+
accessor hideWhenSinglePlace$: ValueModel<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Hide the whole bar when it would render a single item: one tab is not a choice, so it reads as
|
|
23
|
+
* chrome rather than navigation. Off by default - a bar that has always shown one item keeps
|
|
24
|
+
* doing so until its consumer opts in.
|
|
25
|
+
*/
|
|
26
|
+
accessor hideWhenSinglePlace: boolean;
|
|
20
27
|
private readonly placeDefinitions;
|
|
21
28
|
readonly menuItems: ListModelChain<MenuItem>;
|
|
29
|
+
/** Whether the bar should render nothing at all - see {@link hideWhenSinglePlace}. */
|
|
30
|
+
readonly hidden$: BooleanValueModelChain;
|
|
22
31
|
readonly commandFactory: Command.Factory<PlaceDefinition, void>;
|
|
23
32
|
readonly _activePlaceComponent: DelegatingValueModel<PlaceComponent>;
|
|
24
33
|
private activePlaceDefinition;
|
|
@@ -30,6 +39,6 @@ export declare class AbstractPlaceNavigationComponent extends DisposableComponen
|
|
|
30
39
|
getNavigationFace(placeDef: PlaceDefinition): CommandFace;
|
|
31
40
|
private createCommandFaceFor;
|
|
32
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractPlaceNavigationComponent, never>;
|
|
33
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractPlaceNavigationComponent, "ng-component", never, { "places": { "alias": "places"; "required": false; }; "places$": { "alias": "places$"; "required": false; }; "placeOutlet": { "alias": "placeOutlet"; "required": false; }; "placeOutlet$": { "alias": "placeOutlet$"; "required": false; }; }, {}, never, never, false, never>;
|
|
42
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractPlaceNavigationComponent, "ng-component", never, { "places": { "alias": "places"; "required": false; }; "places$": { "alias": "places$"; "required": false; }; "placeOutlet": { "alias": "placeOutlet"; "required": false; }; "placeOutlet$": { "alias": "placeOutlet$"; "required": false; }; "hideWhenSinglePlace$": { "alias": "hideWhenSinglePlace$"; "required": false; }; "hideWhenSinglePlace": { "alias": "hideWhenSinglePlace"; "required": false; }; }, {}, never, never, false, never>;
|
|
34
43
|
}
|
|
35
44
|
export {};
|
|
@@ -2,6 +2,22 @@ import { PlaceRouter } from '../../place-router';
|
|
|
2
2
|
import { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class TabbedPlaceNavigationComponent extends AbstractPlaceNavigationComponent {
|
|
5
|
+
/**
|
|
6
|
+
* Animations are suppressed while a navigation is in flight, and for a frame after it settles.
|
|
7
|
+
*
|
|
8
|
+
* The bar is `*ngIf`d, so without this its `:enter` fires on the initial render of EVERY tabbed
|
|
9
|
+
* place — every bar visibly slid in on every page load, which is noise: nobody is watching a
|
|
10
|
+
* transition while a page is still arriving. What should animate is a bar appearing or collapsing
|
|
11
|
+
* because state CHANGED on a page the user is already looking at (a place being enabled, a role
|
|
12
|
+
* granted, the last sibling tab disappearing).
|
|
13
|
+
*
|
|
14
|
+
* Keyed on the router's own in-flight signal rather than a timer, so it scales with however long
|
|
15
|
+
* the navigation actually takes. The trailing frame matters: the bar is often rendered in the same
|
|
16
|
+
* turn the navigation completes, so re-enabling immediately would let that first render animate
|
|
17
|
+
* anyway. Same disable-then-reset-after-a-frame shape as TableBodyComponent.
|
|
18
|
+
*/
|
|
19
|
+
protected animationsDisabled: boolean;
|
|
20
|
+
private resetHandle;
|
|
5
21
|
constructor(router: PlaceRouter);
|
|
6
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<TabbedPlaceNavigationComponent, never>;
|
|
7
23
|
static ɵcmp: i0.ɵɵComponentDeclaration<TabbedPlaceNavigationComponent, "aup-tabbed-place-navigation", never, {}, {}, never, ["[nav-start]", "[nav-end]"], false, never>;
|
|
@@ -42,6 +42,28 @@ export declare class PlaceGuard {
|
|
|
42
42
|
*/
|
|
43
43
|
private selectRedirectChild;
|
|
44
44
|
private findBestAuthenticatedAlternative;
|
|
45
|
+
/**
|
|
46
|
+
* A visit to the alternative place, carrying its ancestors' RESOLVED route parameters.
|
|
47
|
+
*
|
|
48
|
+
* `Visit.goto` builds a single, parameterless segment, and the url is then assembled from the
|
|
49
|
+
* destination's ancestorsAndSelf — so an ancestor holding a route id contributes an EMPTY id
|
|
50
|
+
* slot. That url is not merely wrong, it is unrepresentable: `groups//devices` collapses, and
|
|
51
|
+
* `groups/devices` binds the child's path into the id slot, navigating to a "group" called
|
|
52
|
+
* `devices` and eventually failing in `UrlSnapshot.appendSegment`. The user lands on `#/` with
|
|
53
|
+
* nothing explaining why. (`Visit.getRouterCommands` guards this case explicitly; the
|
|
54
|
+
* `createUrlSnapshot` path used for redirects does not, which is why it surfaced here.)
|
|
55
|
+
*
|
|
56
|
+
* The ancestors' ids are already resolved by the time we need them: guards run parent-first, so
|
|
57
|
+
* each ancestor's own pass has already sanitised its segment into the navigation session. Any
|
|
58
|
+
* ancestor without a stored segment falls back to a bare one, which is the pre-existing
|
|
59
|
+
* behaviour for a parameterless chain.
|
|
60
|
+
*
|
|
61
|
+
* Reached whenever a place is refused while a parameterised ancestor stays authorised — most
|
|
62
|
+
* often a DISABLED (`enablePlace`) child of a route-id parent, e.g. a feature-flagged tab
|
|
63
|
+
* reached by a stale deep link. Pure role gating rarely hits it, because a role usually gates a
|
|
64
|
+
* whole subtree rather than one child of a parameterised parent.
|
|
65
|
+
*/
|
|
66
|
+
private visitToAlternative;
|
|
45
67
|
canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean | UrlTree>;
|
|
46
68
|
private getPlaceDefinition;
|
|
47
69
|
private createUrlTree;
|