@coolon/angular-ui-powerups 16.1.0-alpha.285 → 16.1.0-alpha.288
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/components/tables/paginator/paginator.component.mjs +24 -5
- package/esm2022/lib/place/components/side-place-navigation/side-place-navigation.component.mjs +255 -23
- package/esm2022/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.mjs +9 -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 +284 -25
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/tables/paginator/paginator.component.d.ts +12 -0
- package/lib/place/components/side-place-navigation/side-place-navigation.component.d.ts +116 -13
- package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +6 -3
- package/lib/place/place-definition.d.ts +4 -1
- package/lib/place/place.decorator.d.ts +11 -0
- package/package.json +2 -2
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { PageController } from '@coolon/pectin';
|
|
2
2
|
import { DisposableComponent } from '../../disposable-component';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Page controls for a collection read a window at a time, showing which window is on screen and how
|
|
6
|
+
* big the whole collection is.
|
|
7
|
+
*
|
|
8
|
+
* It binds to any {@link PageController}, so it works over a client-side slice of an already-loaded
|
|
9
|
+
* list and over a server-paged data source alike — the difference between them is not the pager's
|
|
10
|
+
* business.
|
|
11
|
+
*/
|
|
4
12
|
export declare class PaginatorComponent extends DisposableComponent {
|
|
5
13
|
accessor pageController: PageController;
|
|
6
14
|
constructor();
|
|
7
15
|
get totalItems(): number;
|
|
8
16
|
get totalPages(): number;
|
|
9
17
|
get pageNumber(): number;
|
|
18
|
+
/** The position of the first row on screen, counting from one. Zero when there are no rows at all. */
|
|
19
|
+
get firstItem(): number;
|
|
20
|
+
/** The position of the last row on screen, which on a short final page is the end of the collection. */
|
|
21
|
+
get lastItem(): number;
|
|
10
22
|
get previousCommand(): import("@coolon/pectin").Command<void>;
|
|
11
23
|
get nextCommand(): import("@coolon/pectin").Command<void>;
|
|
12
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<PaginatorComponent, never>;
|
|
@@ -1,27 +1,54 @@
|
|
|
1
|
-
import { TemplateRef } from "@angular/core";
|
|
2
|
-
import { MutableValueModel } from "@coolon/pectin";
|
|
1
|
+
import { TemplateRef, TrackByFunction } from "@angular/core";
|
|
2
|
+
import { BooleanValueModelChain, ListModelChain, MutableValueModel } from "@coolon/pectin";
|
|
3
|
+
import type { CommandFace } from '../../../components/commands/command-face';
|
|
4
|
+
import type { PlaceDefinition } from '../../place-definition';
|
|
3
5
|
import { PlaceRouter } from '../../place-router';
|
|
4
6
|
import { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
8
|
/**
|
|
9
|
+
* A place with children is listed as a group header with its children beneath it, when:
|
|
10
|
+
* - it has `redirectToFirstChild` (it has no page of its own, so its header never navigates while
|
|
11
|
+
* the rail is open);
|
|
12
|
+
* - it hasn't opted out with `navDepth: 1` (see {@link Place.Options.navDepth});
|
|
13
|
+
* - at least two of its children are authorised: one child isn't a choice, so a parent with one
|
|
14
|
+
* authorised child is a single entry that navigates to it.
|
|
15
|
+
* Anything else is a leaf that navigates to its place. A `redirectToFirstChild` parent with no
|
|
16
|
+
* authorised child is dropped, as it has nowhere to land. Only two levels are shown; deeper places
|
|
17
|
+
* stay as tabs in their pages.
|
|
18
|
+
*
|
|
19
|
+
* The rail collapses to an icon strip from the Menu row, and expands over the content when the
|
|
20
|
+
* pointer rests on it. The pinned state is kept in localStorage under {@link persistKey}.
|
|
21
|
+
*
|
|
7
22
|
* @example
|
|
8
23
|
* // Usage
|
|
9
|
-
* <aup-
|
|
10
|
-
*
|
|
11
|
-
* </aup-
|
|
24
|
+
* <aup-side-place-navigation [places]="placeConstructorArray"
|
|
25
|
+
* [placeOutlet]="placeOutletComponent">
|
|
26
|
+
* </aup-side-place-navigation>
|
|
12
27
|
* <aup-place-outlet #placeOutletComponent></aup-place-outlet>
|
|
13
28
|
*
|
|
14
|
-
* //
|
|
29
|
+
* // Layout: the host is the rail's slot, so give it a height (it stretches in a flex row or a
|
|
30
|
+
* // grid) and put the content beside it. The content is offset by the pinned width; the
|
|
31
|
+
* // hover-expanded rail overlays it.
|
|
32
|
+
*
|
|
33
|
+
* // CSS overrides (set on the element or any ancestor; defaults shown):
|
|
15
34
|
* aup-side-place-navigation {
|
|
16
|
-
* --nav-width: 56px
|
|
17
|
-
* --nav-expanded-width:
|
|
18
|
-
* --nav-item-height: var(--nav-width)
|
|
35
|
+
* --nav-width: 56px; // the collapsed rail
|
|
36
|
+
* --nav-expanded-width: 232px;
|
|
19
37
|
* --nav-background-color: #555;
|
|
20
|
-
* --nav-color:
|
|
38
|
+
* --nav-color: #fff; // the Menu row, and the current place's labels
|
|
39
|
+
* --nav-item-color: #eee; // top-level labels
|
|
40
|
+
* --nav-child-color: #d0d0d0; // child labels
|
|
41
|
+
* --nav-current-background: #3a3a3a; // the current place's row
|
|
42
|
+
* --nav-hover-background: #4c4c4c;
|
|
43
|
+
* --nav-chevron-color: #bdbdbd;
|
|
44
|
+
* --nav-current-chevron-color: #757575; // the current group's chevron: it can't be collapsed
|
|
45
|
+
* --nav-focus-color: rgba(255, 255, 255, 0.6);
|
|
46
|
+
* --nav-overlay-shadow: 6px 0 18px rgba(0, 0, 0, 0.28); // the hover-expanded rail
|
|
47
|
+
* --nav-z-index: 100; // lifts the hover-expanded rail over the content
|
|
21
48
|
* }
|
|
22
49
|
*
|
|
23
50
|
* // Content Templates:
|
|
24
|
-
* #navEndTemplate
|
|
51
|
+
* #navEndTemplate, rendered below the items
|
|
25
52
|
* <ng-template #navEndTemplate>
|
|
26
53
|
* <a mat-list-item (click)="logout()" matTooltip="Logout">
|
|
27
54
|
* <mat-icon>exit_to_app</mat-icon>
|
|
@@ -47,12 +74,88 @@ import * as i0 from "@angular/core";
|
|
|
47
74
|
*/
|
|
48
75
|
export declare class SidePlaceNavigationComponent extends AbstractPlaceNavigationComponent {
|
|
49
76
|
accessor expanded$: MutableValueModel<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Whether the rail is pinned expanded (true) or collapsed to icons. The binding is the initial
|
|
79
|
+
* state: once the user has pinned the rail from the Menu row, the state they chose is restored
|
|
80
|
+
* from {@link persistKey} instead.
|
|
81
|
+
*/
|
|
50
82
|
accessor expanded: boolean;
|
|
83
|
+
/** Show the Menu row, so the user can pin the rail expanded or collapsed. */
|
|
84
|
+
collapsible: boolean;
|
|
85
|
+
/** How long, in ms, the pointer must rest on the collapsed rail before it expands. */
|
|
86
|
+
hoverExpandDelay: number;
|
|
87
|
+
/**
|
|
88
|
+
* The localStorage key the pinned state is kept under; `null` turns persistence off. The default
|
|
89
|
+
* is shared by everyone using the browser, so include the user in the key for a per-user state.
|
|
90
|
+
*/
|
|
91
|
+
persistKey: string | null;
|
|
51
92
|
navEndTemplate: TemplateRef<any>;
|
|
93
|
+
/** The pointer has rested on the collapsed rail, so it is expanded over the content. */
|
|
94
|
+
readonly hovering$: MutableValueModel<boolean>;
|
|
95
|
+
/** Labels and children are shown: pinned expanded, or hover-expanded. */
|
|
96
|
+
readonly open$: BooleanValueModelChain;
|
|
97
|
+
/** Hover-expanded over the content, as opposed to pinned expanded beside it. */
|
|
98
|
+
readonly overlay$: BooleanValueModelChain;
|
|
99
|
+
readonly navItems$: ListModelChain<SidePlaceNavigationComponent.Item>;
|
|
100
|
+
/** Groups the user has opened. The current place's group joins on arrival and stays. */
|
|
101
|
+
private readonly openGroups$;
|
|
102
|
+
readonly childListAnimation: {
|
|
103
|
+
value: string;
|
|
104
|
+
params: {
|
|
105
|
+
duration: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
readonly trackByNavItem: TrackByFunction<SidePlaceNavigationComponent.Item>;
|
|
109
|
+
readonly trackByNavChild: TrackByFunction<SidePlaceNavigationComponent.Child>;
|
|
110
|
+
/**
|
|
111
|
+
* Animations are suppressed while a navigation is in flight, and for a frame after it settles, so
|
|
112
|
+
* the current group doesn't visibly slide open on every page load. What should animate is a group
|
|
113
|
+
* the user opens or closes, and the children leaving as the rail collapses. Same arrangement as
|
|
114
|
+
* TabbedPlaceNavigationComponent.
|
|
115
|
+
*/
|
|
116
|
+
protected animationsDisabled: boolean;
|
|
117
|
+
private readonly idPrefix;
|
|
118
|
+
private hoverTimer;
|
|
119
|
+
private resetHandle;
|
|
52
120
|
constructor(router: PlaceRouter);
|
|
121
|
+
/** A group header toggles while the rail is open; anything else navigates. */
|
|
122
|
+
activate(item: SidePlaceNavigationComponent.Item): void;
|
|
123
|
+
navigateTo(place: PlaceDefinition): void;
|
|
124
|
+
toggleMenu(): void;
|
|
53
125
|
expandMenu(): void;
|
|
54
126
|
collapseMenu(): void;
|
|
55
|
-
|
|
127
|
+
onRailEnter(event?: PointerEvent): void;
|
|
128
|
+
onRailLeave(): void;
|
|
129
|
+
private toggleGroup;
|
|
130
|
+
private openGroup;
|
|
131
|
+
private pin;
|
|
132
|
+
private clearHoverTimer;
|
|
133
|
+
private restorePinnedState;
|
|
134
|
+
private writePinnedState;
|
|
135
|
+
private readStorage;
|
|
56
136
|
static ɵfac: i0.ɵɵFactoryDeclaration<SidePlaceNavigationComponent, never>;
|
|
57
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SidePlaceNavigationComponent, "aup-side-place-navigation", never, { "expanded$": { "alias": "expanded$"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; }, {}, ["navEndTemplate"], never, false, never>;
|
|
137
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SidePlaceNavigationComponent, "aup-side-place-navigation", never, { "expanded$": { "alias": "expanded$"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "collapsible": { "alias": "collapsible"; "required": false; }; "hoverExpandDelay": { "alias": "hoverExpandDelay"; "required": false; }; "persistKey": { "alias": "persistKey"; "required": false; }; }, {}, ["navEndTemplate"], never, false, never>;
|
|
138
|
+
}
|
|
139
|
+
export declare namespace SidePlaceNavigationComponent {
|
|
140
|
+
/** A top-level entry in the rail: a leaf, or a group header with its children. */
|
|
141
|
+
interface Item {
|
|
142
|
+
readonly place: PlaceDefinition;
|
|
143
|
+
readonly face: CommandFace;
|
|
144
|
+
/** Lists its children, and never navigates while the rail is open. */
|
|
145
|
+
readonly group: boolean;
|
|
146
|
+
/** Is the current place, or contains it. */
|
|
147
|
+
readonly current: boolean;
|
|
148
|
+
/** An open group on an open rail. */
|
|
149
|
+
readonly showChildren: boolean;
|
|
150
|
+
/** The current place's row, while nothing below it shows the current place instead. */
|
|
151
|
+
readonly highlighted: boolean;
|
|
152
|
+
readonly children: ReadonlyArray<Child>;
|
|
153
|
+
/** For the header's `aria-controls`. */
|
|
154
|
+
readonly childListId: string;
|
|
155
|
+
}
|
|
156
|
+
interface Child {
|
|
157
|
+
readonly place: PlaceDefinition;
|
|
158
|
+
readonly face: CommandFace;
|
|
159
|
+
readonly current: boolean;
|
|
160
|
+
}
|
|
58
161
|
}
|
|
@@ -28,13 +28,16 @@ export type TabbedPlaceNavigationAppearance = 'folder' | 'segmented' | 'tonal' |
|
|
|
28
28
|
* --aup-tab-nav-selected-color: <accent>; // selected label
|
|
29
29
|
* --aup-tab-nav-hover-color: #212121; // unselected label on hover
|
|
30
30
|
* --aup-tab-nav-hover-background: rgba(63, 81, 181, 0.07);
|
|
31
|
-
* --aup-tab-nav-bar-background: #
|
|
31
|
+
* --aup-tab-nav-bar-background: #fff; // folder: the strip behind the tabs
|
|
32
32
|
* --aup-tab-nav-inset: 8px; // folder: space before the first tab
|
|
33
33
|
* --aup-tab-nav-page-background: var(--aup-default-background, #fff); // folder: the page colour;
|
|
34
34
|
* // the selected tab takes it so the two join up
|
|
35
|
-
* --aup-tab-nav-edge-color:
|
|
35
|
+
* --aup-tab-nav-edge-color: <--pinstripe-border-color, else rgba(0,0,0,.2)>; // folder: selected
|
|
36
|
+
* // tab outline and join line
|
|
36
37
|
* --aup-tab-nav-top-line-width: 2px; // folder: accent line on the selected tab
|
|
37
|
-
* --aup-tab-nav-
|
|
38
|
+
* --aup-tab-nav-label-padding-bottom: 0 | 8px; // folder: room under the label (8px when the
|
|
39
|
+
* // tab has an icon, so it balances the top line)
|
|
40
|
+
* --aup-tab-nav-segment-track-background: <bar-background if set, else #f0f2f5>; // segmented: track
|
|
38
41
|
* --aup-tab-nav-segment-border-color: #d9dce2; // segmented: the track outline
|
|
39
42
|
* --aup-tab-nav-segment-selected-background: #fff; // segmented: the sliding highlight
|
|
40
43
|
* --aup-tab-nav-segmented-padding: 12px 12px 4px; // segmented: space around the control
|
|
@@ -13,9 +13,10 @@ export declare class PlaceDefinition {
|
|
|
13
13
|
readonly children: PlaceDefinition[];
|
|
14
14
|
readonly redirectToFirstChild: boolean;
|
|
15
15
|
readonly rememberLastChild: boolean;
|
|
16
|
+
readonly navDepth: PlaceDefinition.NavDepth;
|
|
16
17
|
private _parent;
|
|
17
18
|
readonly name: string;
|
|
18
|
-
constructor(component: Constructable<PlaceComponent>, path: string, authenticate: boolean, role: any, data: Record<string, any>, routeParameters: ParameterDefinition<any>[], children: PlaceDefinition[], redirectToFirstChild: boolean, rememberLastChild: boolean);
|
|
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);
|
|
19
20
|
ancestors(): PlaceDefinition[];
|
|
20
21
|
ancestorsAndSelf(): PlaceDefinition[];
|
|
21
22
|
get placeId(): string;
|
|
@@ -44,6 +45,8 @@ export declare class PlaceDefinition {
|
|
|
44
45
|
hasAncestor(placeComponent: Constructable<PlaceComponent>): boolean;
|
|
45
46
|
}
|
|
46
47
|
export declare namespace PlaceDefinition {
|
|
48
|
+
/** See {@link Place.Options.navDepth}. */
|
|
49
|
+
type NavDepth = 1 | 2;
|
|
47
50
|
interface ParameterOptions {
|
|
48
51
|
includeRouteId?: boolean;
|
|
49
52
|
includeRouteParameters?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Constructable } from '@coolon/pectin';
|
|
2
2
|
import { PlaceComponent } from './place-component';
|
|
3
|
+
import { PlaceDefinition } from './place-definition';
|
|
3
4
|
export declare function Place(options: Place.Options): (target: Constructable<any>) => void;
|
|
4
5
|
export declare namespace Place {
|
|
5
6
|
interface Options {
|
|
@@ -27,5 +28,15 @@ export declare namespace Place {
|
|
|
27
28
|
* Only meaningful alongside `redirectToFirstChild: true`. Defaults to `true`.
|
|
28
29
|
*/
|
|
29
30
|
rememberLastChild?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* How many levels of the place tree `aup-side-place-navigation` shows from this place. `2` (the
|
|
33
|
+
* default) lists the place's children beneath it as a group; `1` keeps them out of the side nav,
|
|
34
|
+
* so the place is a single entry that navigates via {@link redirectToFirstChild} and its children
|
|
35
|
+
* stay as tabs in the page.
|
|
36
|
+
*
|
|
37
|
+
* Only meaningful alongside `redirectToFirstChild: true`: a place without it has a page of its
|
|
38
|
+
* own, so it is always a single entry.
|
|
39
|
+
*/
|
|
40
|
+
navDepth?: PlaceDefinition.NavDepth;
|
|
30
41
|
}
|
|
31
42
|
}
|
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.288",
|
|
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.140",
|
|
16
16
|
"fast-typescript-memoize": "^1.1.1",
|
|
17
17
|
"lodash-es": "^4.17.21",
|
|
18
18
|
"marked": "4.0.10",
|