@coolon/angular-ui-powerups 16.1.0-alpha.291 → 16.1.0-alpha.293
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/tabbed-place-navigation/tabbed-place-navigation.component.mjs +5 -3
- package/esm2022/lib/place/guards/place.guard.mjs +14 -6
- package/esm2022/lib/place/place-definition.mjs +4 -2
- package/esm2022/lib/place/place.decorator.mjs +2 -2
- package/fesm2022/coolon-angular-ui-powerups.mjs +21 -9
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +2 -0
- package/lib/place/guards/place.guard.d.ts +5 -4
- package/lib/place/place-definition.d.ts +4 -1
- package/lib/place/place.decorator.d.ts +9 -0
- package/package.json +1 -1
|
@@ -46,6 +46,8 @@ export type TabbedPlaceNavigationAppearance = 'folder' | 'segmented' | 'tonal' |
|
|
|
46
46
|
* --aup-tab-nav-tonal-padding: 8px 12px; // tonal: space around the options
|
|
47
47
|
* --aup-tab-nav-tonal-tab-height: 30px; // tonal: each option's height
|
|
48
48
|
* --aup-tab-nav-tonal-tab-padding: 0 12px; // tonal: space inside each option
|
|
49
|
+
* --aup-tab-nav-tonal-leading-icon-inset: 4px; // tonal: taken off the icon side of an option
|
|
50
|
+
* // with a leading icon, for its glyph's blank edge
|
|
49
51
|
* --aup-tab-nav-tonal-gap: 2px; // tonal: space between the options
|
|
50
52
|
* --aup-tab-nav-tonal-font-size: 13px;
|
|
51
53
|
* --aup-tab-nav-tonal-selected-weight: 700; // tonal: the selected option's label
|
|
@@ -29,10 +29,11 @@ export declare class PlaceGuard {
|
|
|
29
29
|
*/
|
|
30
30
|
private shouldRedirectToChild;
|
|
31
31
|
/**
|
|
32
|
-
* Chooses the child to redirect to when {@link PlaceDefinition.redirectToFirstChild} is set
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* child (the
|
|
32
|
+
* Chooses the child to redirect to when {@link PlaceDefinition.redirectToFirstChild} is set, taking
|
|
33
|
+
* the first of these that is a valid, authorised child:
|
|
34
|
+
* 1. the place's own pick, when it declares {@link PlaceDefinition.redirectChild};
|
|
35
|
+
* 2. the last active child, when `rememberLastChild` is enabled (the default);
|
|
36
|
+
* 3. the first authorised child in declaration order (the legacy behaviour).
|
|
36
37
|
*
|
|
37
38
|
* Authorisation is read AFTER awaiting each candidate child's authorisation-readiness (its
|
|
38
39
|
* `enablePlace` postpone conditions). Without this, a child whose enablement is still settling —
|
|
@@ -14,9 +14,10 @@ export declare class PlaceDefinition {
|
|
|
14
14
|
readonly redirectToFirstChild: boolean;
|
|
15
15
|
readonly rememberLastChild: boolean;
|
|
16
16
|
readonly navDepth: PlaceDefinition.NavDepth;
|
|
17
|
+
readonly redirectChild?: PlaceDefinition.RedirectChild;
|
|
17
18
|
private _parent;
|
|
18
19
|
readonly name: string;
|
|
19
|
-
constructor(component: Constructable<PlaceComponent>, path: string, authenticate: boolean, role: any, data: Record<string, any>, routeParameters: ParameterDefinition<any>[], children: PlaceDefinition[], redirectToFirstChild: boolean, rememberLastChild: boolean, navDepth?: PlaceDefinition.NavDepth);
|
|
20
|
+
constructor(component: Constructable<PlaceComponent>, path: string, authenticate: boolean, role: any, data: Record<string, any>, routeParameters: ParameterDefinition<any>[], children: PlaceDefinition[], redirectToFirstChild: boolean, rememberLastChild: boolean, navDepth?: PlaceDefinition.NavDepth, redirectChild?: PlaceDefinition.RedirectChild);
|
|
20
21
|
ancestors(): PlaceDefinition[];
|
|
21
22
|
ancestorsAndSelf(): PlaceDefinition[];
|
|
22
23
|
get placeId(): string;
|
|
@@ -47,6 +48,8 @@ export declare class PlaceDefinition {
|
|
|
47
48
|
export declare namespace PlaceDefinition {
|
|
48
49
|
/** See {@link Place.Options.navDepth}. */
|
|
49
50
|
type NavDepth = 1 | 2;
|
|
51
|
+
/** See {@link Place.Options.redirectChild}. */
|
|
52
|
+
type RedirectChild = () => Constructable<PlaceComponent> | undefined | Promise<Constructable<PlaceComponent> | undefined>;
|
|
50
53
|
interface ParameterOptions {
|
|
51
54
|
includeRouteId?: boolean;
|
|
52
55
|
includeRouteParameters?: boolean;
|
|
@@ -38,5 +38,14 @@ export declare namespace Place {
|
|
|
38
38
|
* own, so it is always a single entry.
|
|
39
39
|
*/
|
|
40
40
|
navDepth?: PlaceDefinition.NavDepth;
|
|
41
|
+
/**
|
|
42
|
+
* Picks the child {@link redirectToFirstChild} lands on, ahead of {@link rememberLastChild} and
|
|
43
|
+
* declaration order — for a parent whose right landing depends on application state rather than
|
|
44
|
+
* on child order. Runs in the place guard's injection context, so it can `inject()`. Returning
|
|
45
|
+
* undefined, or a child the user can't reach, falls back to the default choice.
|
|
46
|
+
*
|
|
47
|
+
* Only meaningful alongside `redirectToFirstChild: true`.
|
|
48
|
+
*/
|
|
49
|
+
redirectChild?: PlaceDefinition.RedirectChild;
|
|
41
50
|
}
|
|
42
51
|
}
|