@cngx/ui 0.1.0-rc.9 → 0.3.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/README.md +118 -59
- package/action-button/README.md +170 -53
- package/breadcrumb/README.md +5 -6
- package/collection/README.md +1 -1
- package/command-palette/README.md +4 -3
- package/data-grid-accordion/README.md +1 -1
- package/empty-state/README.md +2 -3
- package/feedback/README.md +1 -1
- package/fesm2022/cngx-ui-a11y.mjs +13 -23
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +44 -66
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +213 -335
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +60 -80
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +18 -31
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +28 -44
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +29 -51
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +78 -83
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +52 -74
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +17 -44
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +589 -467
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +17 -13
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +3 -5
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +5 -9
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +6 -9
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +71 -68
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-nav-rail.mjs +440 -0
- package/fesm2022/cngx-ui-nav-rail.mjs.map +1 -0
- package/fesm2022/cngx-ui-overlay.mjs +9 -10
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +149 -171
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +858 -721
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +17 -19
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +21 -74
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +39 -62
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +207 -90
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +71 -32
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +21 -27
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +27 -40
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +5 -5
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-tabs/README.md +28 -14
- package/mat-tabs/styles/mat-tabs.css +233 -258
- package/nav-rail/README.md +325 -0
- package/package.json +10 -5
- package/paginator/README.md +10 -0
- package/schematics/ng-add/index.js +7 -7
- package/schematics/ng-add/schema.json +5 -0
- package/sidenav/README.md +150 -55
- package/skeleton/README.md +1 -1
- package/speak/README.md +1 -2
- package/stepper/README.md +20 -5
- package/tabs/README.md +13 -0
- package/timeline/README.md +1 -1
- package/toc/README.md +1 -1
- package/types/cngx-ui-a11y.d.ts +20 -38
- package/types/cngx-ui-accordion.d.ts +45 -77
- package/types/cngx-ui-action-button.d.ts +113 -151
- package/types/cngx-ui-breadcrumb.d.ts +58 -94
- package/types/cngx-ui-chart-panel.d.ts +22 -40
- package/types/cngx-ui-collection.d.ts +30 -53
- package/types/cngx-ui-command-palette.d.ts +40 -64
- package/types/cngx-ui-context-menu.d.ts +67 -44
- package/types/cngx-ui-data-grid-accordion.d.ts +49 -77
- package/types/cngx-ui-empty-state.d.ts +18 -8
- package/types/cngx-ui-feedback.d.ts +264 -289
- package/types/cngx-ui-layout.d.ts +4 -12
- package/types/cngx-ui-mat-accordion.d.ts +2 -3
- package/types/cngx-ui-mat-paginator.d.ts +4 -10
- package/types/cngx-ui-mat-stepper.d.ts +5 -10
- package/types/cngx-ui-mat-tabs.d.ts +43 -69
- package/types/cngx-ui-nav-rail.d.ts +416 -0
- package/types/cngx-ui-overlay.d.ts +4 -13
- package/types/cngx-ui-paginator.d.ts +164 -154
- package/types/cngx-ui-sidenav.d.ts +557 -437
- package/types/cngx-ui-skeleton.d.ts +7 -13
- package/types/cngx-ui-speak.d.ts +40 -24
- package/types/cngx-ui-stat-card.d.ts +45 -36
- package/types/cngx-ui-stepper.d.ts +183 -62
- package/types/cngx-ui-tabs.d.ts +101 -27
- package/types/cngx-ui-timeline.d.ts +20 -48
- package/types/cngx-ui-toc.d.ts +30 -51
- package/types/cngx-ui.d.ts +1 -1
|
@@ -1,62 +1,184 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import * as i1 from '@cngx/common/
|
|
4
|
-
import
|
|
2
|
+
import { InjectionToken, ModelSignal, Signal, ElementRef, EnvironmentProviders, Provider } from '@angular/core';
|
|
3
|
+
import * as i1 from '@cngx/common/layout';
|
|
4
|
+
import { CngxDrawerModality, CngxSidebarDriver, CngxDrawerSurfaceDriver, CngxSidebarSide, CngxSidebar, CngxSidebarCollapsedAs, CngxPanelTarget } from '@cngx/common/layout';
|
|
5
5
|
import { CngxMessage } from '@cngx/core/i18n';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Contract a sidenav rail exposes to its collaborators: `CngxSidenavRouterSync`
|
|
9
|
+
* reads and writes `opened`, `CngxSidenavLayout` coordinates its rails through
|
|
10
|
+
* the rest. Injected via {@link CNGX_SIDENAV} + `useExisting`, never by
|
|
11
|
+
* injecting the concrete `CngxSidenav` class - that would create a cyclic type
|
|
12
|
+
* dependency and block the decompose brain/skin split.
|
|
9
13
|
*
|
|
10
|
-
* @
|
|
14
|
+
* @since 0.3.0
|
|
11
15
|
*/
|
|
12
|
-
|
|
16
|
+
interface CngxSidenavContract {
|
|
17
|
+
/** Two-way open state of the overlay; the router sync both reads and writes it. */
|
|
18
|
+
readonly opened: ModelSignal<boolean>;
|
|
19
|
+
/** Logical edge of the rail. */
|
|
20
|
+
readonly position: Signal<'start' | 'end'>;
|
|
21
|
+
/** Element id of the rail. */
|
|
22
|
+
readonly id: Signal<string>;
|
|
23
|
+
/** Whether `opened` shows the rail as an overlay at the current width. */
|
|
24
|
+
readonly isOverlay: Signal<boolean>;
|
|
25
|
+
/** Whether the rail is an open overlay right now. */
|
|
26
|
+
readonly overlayActive: Signal<boolean>;
|
|
27
|
+
/** How far an open overlay takes over the page. */
|
|
28
|
+
readonly modality: Signal<CngxDrawerModality>;
|
|
29
|
+
/** Hides the full nav: closes the overlay or collapses a docked rail. */
|
|
30
|
+
close(): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Contract token for a sidenav rail. `CngxSidenav` provides it via
|
|
34
|
+
* `{ provide: CNGX_SIDENAV, useExisting: CngxSidenav }`, so a collaborator
|
|
35
|
+
* injects the narrow {@link CngxSidenavContract} instead of the concrete class.
|
|
36
|
+
*
|
|
37
|
+
* @since 0.3.0
|
|
38
|
+
* @relatedTo CngxSidenav, CngxSidenavRouterSync
|
|
39
|
+
*/
|
|
40
|
+
declare const CNGX_SIDENAV: InjectionToken<CngxSidenavContract>;
|
|
41
|
+
/**
|
|
42
|
+
* @internal What a rail asks of the surrounding `CngxSidenavLayout` in its open
|
|
43
|
+
* path: at most one overlay is open per layout, so opening one closes the
|
|
44
|
+
* others.
|
|
45
|
+
*/
|
|
46
|
+
interface CngxSidenavLayoutCoordinator {
|
|
47
|
+
/** Closes every other open overlay of the layout before `rail` opens. */
|
|
48
|
+
overlayOpening(rail: CngxSidenavContract): void;
|
|
49
|
+
/**
|
|
50
|
+
* Whether `rail` is a direct rail of the layout. Only those get the width
|
|
51
|
+
* class; a rail nested deeper (inside the content) is no member.
|
|
52
|
+
*/
|
|
53
|
+
owns(rail: CngxSidenavContract): boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Container for one or two `CngxSidenav` panels and a `CngxSidenavContent`.
|
|
58
|
+
*
|
|
59
|
+
* Renders the shared backdrop behind a modal overlay. Focus trap, scroll lock,
|
|
60
|
+
* `inert` and dismissal on Escape or an outside press belong to each rail's
|
|
61
|
+
* composed `CngxDrawerSurface`. Supports up to two sidenavs: one
|
|
62
|
+
* `position="start"` and one `position="end"`.
|
|
63
|
+
*
|
|
64
|
+
* It is also the query container the rails resolve their `'auto'` mode
|
|
65
|
+
* against: the stylesheet declares and names the container
|
|
66
|
+
* (`cngx-sidenav-layout`) and carries the single docking threshold, the
|
|
67
|
+
* composed `CngxContainer` observes it and publishes the resolved value. A
|
|
68
|
+
* rail mounted without this layout has no container and falls back to
|
|
69
|
+
* `over`.
|
|
70
|
+
*
|
|
71
|
+
* ### Dual sidebar
|
|
72
|
+
* ```html
|
|
73
|
+
* <cngx-sidenav-layout>
|
|
74
|
+
* <cngx-sidenav position="start" [(opened)]="navOpen">
|
|
75
|
+
* Left nav
|
|
76
|
+
* </cngx-sidenav>
|
|
77
|
+
* <cngx-sidenav-content>
|
|
78
|
+
* Main content
|
|
79
|
+
* </cngx-sidenav-content>
|
|
80
|
+
* <cngx-sidenav position="end" [(opened)]="detailOpen">
|
|
81
|
+
* Right detail panel
|
|
82
|
+
* </cngx-sidenav>
|
|
83
|
+
* </cngx-sidenav-layout>
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* @wcag AA
|
|
87
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav-layout.ts
|
|
88
|
+
* @since 0.3.0
|
|
89
|
+
* @relatedTo CngxSidenav, CngxSidenavContent, CngxNavHeader, CngxNavFooter
|
|
90
|
+
*/
|
|
91
|
+
declare class CngxSidenavLayout implements CngxSidenavLayoutCoordinator {
|
|
92
|
+
private readonly container;
|
|
93
|
+
private readonly readyState;
|
|
94
|
+
/**
|
|
95
|
+
* @internal The settled layout has been painted once - gates transitions and
|
|
96
|
+
* the reveal.
|
|
97
|
+
*/
|
|
98
|
+
protected readonly ready: _angular_core.Signal<boolean>;
|
|
99
|
+
private readonly sidenavs;
|
|
100
|
+
/** @internal The start-positioned sidenav, if any. */
|
|
101
|
+
readonly startSidenav: _angular_core.Signal<CngxSidenavContract | null>;
|
|
102
|
+
/** @internal The end-positioned sidenav, if any. */
|
|
103
|
+
readonly endSidenav: _angular_core.Signal<CngxSidenavContract | null>;
|
|
104
|
+
/** @internal Whether any sidenav is open in overlay mode. */
|
|
105
|
+
readonly hasOverlay: _angular_core.Signal<boolean>;
|
|
106
|
+
/** Whether an open overlay takes over the page or the layout (backdrop shown). */
|
|
107
|
+
readonly hasModalOverlay: _angular_core.Signal<boolean>;
|
|
108
|
+
constructor();
|
|
109
|
+
/** @internal Closes all sidenavs that are currently in overlay mode. */
|
|
110
|
+
closeAllOverlays(): void;
|
|
111
|
+
/** @internal Whether `rail` is one of this layout's direct rails. */
|
|
112
|
+
owns(rail: CngxSidenavContract): boolean;
|
|
113
|
+
/** @internal One open overlay per layout: called from a rail's open path. */
|
|
114
|
+
overlayOpening(rail: CngxSidenavContract): void;
|
|
115
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenavLayout, never>;
|
|
116
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSidenavLayout, "cngx-sidenav-layout", ["cngxSidenavLayout"], {}, {}, ["sidenavs"], ["cngx-sidenav[position=start], cngx-sidenav:not([position])", "cngx-sidenav-content", "cngx-sidenav[position=end]"], true, [{ directive: typeof i1.CngxContainer; inputs: {}; outputs: {}; }]>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Logical position - flips in RTL. The same union as the composed sidebar's
|
|
121
|
+
* `side`, which `position` is forwarded to.
|
|
122
|
+
*/
|
|
123
|
+
type SidenavPosition = CngxSidebarSide;
|
|
13
124
|
/**
|
|
14
125
|
* How the sidenav interacts with the content area.
|
|
15
126
|
*
|
|
16
127
|
* - `'over'` - floats above content (overlay + backdrop)
|
|
17
|
-
* - `'
|
|
18
|
-
*
|
|
19
|
-
* - `'mini'` - collapsed icon rail (miniWidth), expands to full width on hover
|
|
20
|
-
*
|
|
21
|
-
* @category ui/sidenav
|
|
128
|
+
* - `'side'` - docked beside the content; `collapsed` rests it as a rail or
|
|
129
|
+
* hides it (`collapsedAs="hidden"`, the former push mode)
|
|
22
130
|
*/
|
|
23
|
-
type SidenavMode = 'auto' | 'over' | '
|
|
131
|
+
type SidenavMode = 'auto' | 'over' | 'side';
|
|
24
132
|
/**
|
|
25
133
|
* A resolved mode - what `'auto'` settles on plus every pinnable value.
|
|
26
|
-
*
|
|
27
|
-
* @category ui/sidenav
|
|
28
134
|
*/
|
|
29
135
|
type ResolvedSidenavMode = Exclude<SidenavMode, 'auto'>;
|
|
30
136
|
/**
|
|
31
|
-
*
|
|
32
|
-
* `
|
|
33
|
-
* `
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
137
|
+
* The width class of the surrounding `CngxSidenavLayout`, resolved by the
|
|
138
|
+
* `@container` rule block in `sidenav-layout.css`: `compact` below 48rem,
|
|
139
|
+
* `medium` from 48rem, `expanded` from 64rem.
|
|
140
|
+
*/
|
|
141
|
+
type SidenavWidthClass = 'compact' | 'medium' | 'expanded';
|
|
142
|
+
/**
|
|
143
|
+
* Declarative sidebar component for the drawer modes (`over`, `side`) plus an `auto` default, two-way `[(opened)]` and `[(collapsed)]`
|
|
144
|
+
* bindings, and content projection via header/footer slots.
|
|
145
|
+
*
|
|
146
|
+
* The rail is a composed `CngxSidebar`: docked, `[(collapsed)]` rests it as a
|
|
147
|
+
* rail (`collapsedAs="rail"`, `miniWidth` wide) or hides it
|
|
148
|
+
* (`collapsedAs="hidden"`), and a collapsed rail peeks at full width over the
|
|
149
|
+
* content on a hover dwell (`expandOnHover`, `expandDelay`, `collapseDelay`).
|
|
150
|
+
* `toggle()` follows the width class: `expanded` flips `collapsed`, `medium`
|
|
151
|
+
* keeps the rail and opens the full nav as an overlay over it, `compact` opens
|
|
152
|
+
* the drawer. `close()` collapses a docked rail.
|
|
153
|
+
*
|
|
154
|
+
* Responsive out of the box: `mode` defaults to `'auto'`, which follows the
|
|
155
|
+
* width class of the surrounding `CngxSidenavLayout` (`widthClass`): it
|
|
156
|
+
* overlays the content below `48rem` (`compact`) and docks beside it from
|
|
157
|
+
* `48rem` (`medium`, `expanded`). Nothing needs to be bound. The thresholds
|
|
158
|
+
* live in `sidenav-layout.css` and nowhere else - a `@container` rule block
|
|
159
|
+
* writes `--cngx-sidenav-width-class` on the rail and this component reads
|
|
160
|
+
* the resolved value, so ejecting the skin moves the thresholds with it. Any
|
|
161
|
+
* explicit `mode` pins that mode at every width.
|
|
162
|
+
*
|
|
163
|
+
* An open overlay runs on a composed `CngxDrawerSurface` (`@cngx/common/layout`)
|
|
164
|
+
* with the `modality` input (`'page'` by default): focus moves into the rail
|
|
165
|
+
* and is trapped, the page outside is `inert` and scroll-locked, Escape, the
|
|
166
|
+
* back gesture and a press outside close it, and focus returns to the opener.
|
|
167
|
+
* `CngxSidenavLayout` only draws the backdrop. It does not compose
|
|
168
|
+
* `CngxDrawer` and has no swipe-to-dismiss.
|
|
169
|
+
*
|
|
170
|
+
* Use inside `CngxSidenavLayout` for dual-sidebar support and the width
|
|
171
|
+
* class.
|
|
53
172
|
*
|
|
54
173
|
* ```html
|
|
55
174
|
* <cngx-sidenav-layout>
|
|
56
175
|
* <cngx-sidenav position="start" [(opened)]="navOpen">
|
|
57
|
-
* <cngx-
|
|
176
|
+
* <cngx-nav-header>
|
|
177
|
+
* <span cngxNavMark>A</span>
|
|
178
|
+
* <span cngxNavName>Acme</span>
|
|
179
|
+
* </cngx-nav-header>
|
|
58
180
|
* <a cngxNavLink [active]="true">Dashboard</a>
|
|
59
|
-
* <cngx-
|
|
181
|
+
* <cngx-nav-footer>v1.0</cngx-nav-footer>
|
|
60
182
|
* </cngx-sidenav>
|
|
61
183
|
* <cngx-sidenav-content>
|
|
62
184
|
* <router-outlet />
|
|
@@ -64,18 +186,16 @@ type ResolvedSidenavMode = Exclude<SidenavMode, 'auto'>;
|
|
|
64
186
|
* </cngx-sidenav-layout>
|
|
65
187
|
* ```
|
|
66
188
|
*
|
|
67
|
-
* @category ui/sidenav
|
|
68
|
-
* @docsKind primary
|
|
69
189
|
* @wcag AA
|
|
70
190
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav.ts
|
|
71
|
-
* @since 0.
|
|
72
|
-
* @relatedTo CngxSidenavLayout, CngxSidenavContent,
|
|
73
|
-
* <example-url
|
|
74
|
-
* <example-url
|
|
75
|
-
* <example-url
|
|
76
|
-
*
|
|
191
|
+
* @since 0.3.0
|
|
192
|
+
* @relatedTo CngxSidenavLayout, CngxSidenavContent, CngxNavHeader, CngxNavFooter
|
|
193
|
+
* <example-url>/#/ui/sidenav/auto-mode</example-url>
|
|
194
|
+
* <example-url>/#/ui/sidenav/dual-sidebar-master-detail</example-url>
|
|
195
|
+
* <example-url>/#/ui/sidenav/full-navigation-sidebar</example-url>
|
|
196
|
+
* @axis level organism
|
|
77
197
|
*/
|
|
78
|
-
declare class CngxSidenav {
|
|
198
|
+
declare class CngxSidenav implements CngxSidenavContract, CngxSidebarDriver, CngxDrawerSurfaceDriver {
|
|
79
199
|
/**
|
|
80
200
|
* Resolved sidenav configuration cascade. Seeds the dimension and
|
|
81
201
|
* `shortcut` input defaults below so a per-instance binding still wins
|
|
@@ -84,22 +204,57 @@ declare class CngxSidenav {
|
|
|
84
204
|
* Declared first so the input field initialisers can read it.
|
|
85
205
|
*/
|
|
86
206
|
private readonly cfg;
|
|
87
|
-
/** Logical position: `'start'` (default left in LTR) or `'end'` (right in LTR). */
|
|
88
|
-
readonly position: _angular_core.InputSignal<SidenavPosition>;
|
|
89
|
-
/** Accessible label for the complementary landmark. */
|
|
90
|
-
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
91
207
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
208
|
+
* Logical position: `'start'` (default left in LTR) or `'end'` (right in LTR).
|
|
209
|
+
* Layout projection and the persistence key read the static `position`
|
|
210
|
+
* attribute; a bound `[position]` moves the rail standalone only.
|
|
211
|
+
*/
|
|
212
|
+
readonly position: _angular_core.InputSignal<CngxSidebarSide>;
|
|
213
|
+
/**
|
|
214
|
+
* Accessible name of the rail: of the `navigation` landmark, or of the
|
|
215
|
+
* modal `dialog` while it is an open overlay. Unbound, the `startRegion` /
|
|
216
|
+
* `endRegion` label (`withSidenavLabels`, then the language pack) applies by
|
|
217
|
+
* `position`, so two rails never share one name. An empty or blank value
|
|
218
|
+
* counts as unbound, so the rail is never left without a name.
|
|
219
|
+
*/
|
|
220
|
+
readonly ariaLabel: _angular_core.InputSignalWithTransform<string | undefined, string | undefined>;
|
|
221
|
+
/** @internal The composed sidebar brain. */
|
|
222
|
+
protected readonly sidebar: CngxSidebar;
|
|
223
|
+
/**
|
|
224
|
+
* Element id of the rail: a static `id="..."` attribute on the host, else a
|
|
225
|
+
* generated one (the composed sidebar owns it).
|
|
226
|
+
*
|
|
227
|
+
* An external toggle names this id in its `aria-controls`
|
|
228
|
+
* (`[attr.aria-controls]="nav.id()"`). A press inside such a control is not
|
|
229
|
+
* outside the open overlay, so the toggle's own click can close the rail
|
|
230
|
+
* instead of reopening it.
|
|
231
|
+
*/
|
|
232
|
+
readonly id: _angular_core.Signal<string>;
|
|
233
|
+
/**
|
|
234
|
+
* Drawer mode. `'auto'` (the default) resolves from `widthClass`: `'over'`
|
|
235
|
+
* in `compact`, `'side'` in `medium` and `expanded`. Any other value pins
|
|
236
|
+
* that mode at every width.
|
|
95
237
|
*/
|
|
96
238
|
readonly mode: _angular_core.InputSignal<SidenavMode>;
|
|
97
|
-
/**
|
|
239
|
+
/**
|
|
240
|
+
* Width of the sidenav panel. Supports two-way `[(width)]` for resize. A px
|
|
241
|
+
* value renders clamped to `minWidth` / `maxWidth`; any other unit passes
|
|
242
|
+
* through unclamped.
|
|
243
|
+
*/
|
|
98
244
|
readonly width: _angular_core.ModelSignal<string>;
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
245
|
+
/**
|
|
246
|
+
* Width of the collapsed rail (`collapsed` with `collapsedAs="rail"`). Any CSS
|
|
247
|
+
* value. Unbound and unconfigured, the rail width derives from the nav row
|
|
248
|
+
* tokens (`2 * (row inset + row inline padding) + icon size + border width`),
|
|
249
|
+
* so the icon box sits centred, as on `cngx-nav-rail`.
|
|
250
|
+
*/
|
|
251
|
+
readonly miniWidth: _angular_core.InputSignal<string | undefined>;
|
|
252
|
+
/**
|
|
253
|
+
* Whether a row on the collapsed rail shows its label in a tooltip. Unbound,
|
|
254
|
+
* `withNavRailTooltip` of the nav rail config in scope applies, else `true`.
|
|
255
|
+
* Switching it off removes the tooltip element and its listeners.
|
|
256
|
+
*/
|
|
257
|
+
readonly tooltip: _angular_core.InputSignal<boolean | undefined>;
|
|
103
258
|
/** Whether the sidebar is user-resizable via a drag handle. */
|
|
104
259
|
readonly resizable: _angular_core.InputSignal<boolean>;
|
|
105
260
|
/**
|
|
@@ -111,132 +266,197 @@ declare class CngxSidenav {
|
|
|
111
266
|
private readonly labels;
|
|
112
267
|
private readonly locale;
|
|
113
268
|
/** @internal */
|
|
269
|
+
protected readonly resolvedAriaLabel: _angular_core.Signal<string>;
|
|
270
|
+
/** @internal */
|
|
114
271
|
protected readonly resolvedResizeLabel: _angular_core.Signal<string>;
|
|
115
272
|
/**
|
|
116
273
|
* Minimum width constraint during resize. Use a px value: drag and keyboard
|
|
117
274
|
* clamping (and `aria-valuemin`) resolve px only; a rem/ch constraint falls
|
|
118
|
-
* back to the 120px default
|
|
275
|
+
* back to the 120px default.
|
|
119
276
|
*/
|
|
120
277
|
readonly minWidth: _angular_core.InputSignal<string>;
|
|
121
278
|
/**
|
|
122
279
|
* Maximum width constraint during resize. Use a px value: drag and keyboard
|
|
123
280
|
* clamping (and `aria-valuemax`) resolve px only; a rem/ch constraint falls
|
|
124
|
-
* back to the 600px default
|
|
281
|
+
* back to the 600px default.
|
|
125
282
|
*/
|
|
126
283
|
readonly maxWidth: _angular_core.InputSignal<string>;
|
|
127
284
|
/**
|
|
128
285
|
* Keyboard shortcut to toggle the sidenav, e.g. `'ctrl+b'` or `'meta+b'`.
|
|
129
286
|
* Uses `ctrl` on Windows/Linux and `meta` (Cmd) on macOS automatically
|
|
130
|
-
* when `'mod+<key>'` syntax is used.
|
|
287
|
+
* when `'mod+<key>'` syntax is used. Unbound, a `start` rail takes the
|
|
288
|
+
* app-wide `withSidenavShortcut` default; an `end` rail registers only a
|
|
289
|
+
* combo bound here, so a dual layout never binds one press to both rails.
|
|
290
|
+
* Pass an empty string to turn the toggle shortcut off for this rail.
|
|
131
291
|
*/
|
|
132
292
|
readonly shortcut: _angular_core.InputSignal<string | undefined>;
|
|
293
|
+
/** The toggle combo: the bound `[shortcut]`, else the app default on a `start` rail. */
|
|
294
|
+
private readonly toggleCombo;
|
|
295
|
+
/** The resize handle, present while `resizable` and at full width. */
|
|
296
|
+
private readonly resizeHandle;
|
|
133
297
|
/** Whether a resize drag is in progress. */
|
|
134
|
-
private readonly resizingState;
|
|
135
298
|
readonly resizing: _angular_core.Signal<boolean>;
|
|
136
299
|
/** Two-way opened state. Supports `[(opened)]="signal"`. */
|
|
137
300
|
readonly opened: _angular_core.ModelSignal<boolean>;
|
|
138
|
-
/** Debounced mini expand-on-hover, composed as a hostDirective (its own pointer listeners drive it). */
|
|
139
|
-
private readonly hoverIntent;
|
|
140
|
-
/**
|
|
141
|
-
* Composed source for `expandedState`: the effective mode, the debounced
|
|
142
|
-
* hover-intent signal, and the on/off switch. Carries an explicit `equal` so
|
|
143
|
-
* the object literal never churns identity and re-runs the computation when
|
|
144
|
-
* none of the three fields actually changed.
|
|
145
|
-
*/
|
|
146
|
-
private readonly hoverSource;
|
|
147
301
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* - with `expandOnHover=true` the debounced hover is the source of truth, so a
|
|
154
|
-
* pointer edge overrides a prior `expand()`/`collapse()` (see `expand()`);
|
|
155
|
-
* - with `expandOnHover=false` hover is ignored and the prior value is kept, so
|
|
156
|
-
* `expand()`/`collapse()` retain full programmatic authority.
|
|
157
|
-
*
|
|
158
|
-
* It stays a writable `linkedSignal` so `expand()`/`collapse()` can `set()` it;
|
|
159
|
-
* the next source change re-derives from the debounced hover.
|
|
302
|
+
* How far an open overlay takes over the page: `'page'` (default, a modal
|
|
303
|
+
* dialog: focus trap, `aria-modal`, everything outside `inert`, scroll lock,
|
|
304
|
+
* backdrop), `'contained'` (inert and lock inside the layout only) or
|
|
305
|
+
* `'none'` (the page stays operable, no backdrop). Docked, the rail is a
|
|
306
|
+
* landmark (`navigation` unless `[role]` is bound) in every modality.
|
|
160
307
|
*/
|
|
161
|
-
|
|
162
|
-
readonly expanded: _angular_core.Signal<boolean>;
|
|
308
|
+
readonly modality: _angular_core.InputSignal<CngxDrawerModality>;
|
|
163
309
|
/** @internal Reference to host element for layout positioning. */
|
|
164
310
|
readonly elementRef: ElementRef<any>;
|
|
165
311
|
/** The layout's query container, absent when the rail is mounted standalone. */
|
|
166
312
|
private readonly container;
|
|
167
313
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
* itself would never match.
|
|
314
|
+
* The raw `--cngx-sidenav-width-class` the `@container` rule block in
|
|
315
|
+
* `sidenav-layout.css` writes on this rail. The rule styles the rail rather
|
|
316
|
+
* than the layout because a container query resolves against an *ancestor*
|
|
317
|
+
* container - a rule whose subject is the container itself would never match.
|
|
173
318
|
*
|
|
174
319
|
* Empty until the layout's first `ResizeObserver` entry arrives, so `auto`
|
|
175
|
-
* resolves to `
|
|
176
|
-
*
|
|
177
|
-
* with a constructor-time `getComputedStyle`, which would read
|
|
178
|
-
*
|
|
320
|
+
* resolves to `compact` for the first frames. `CngxSidenavLayout` stays
|
|
321
|
+
* hidden and transition-free until the settled class has been painted. Do
|
|
322
|
+
* NOT seed this with a constructor-time `getComputedStyle`, which would read
|
|
323
|
+
* before the first layout.
|
|
179
324
|
*/
|
|
180
|
-
private readonly
|
|
181
|
-
/**
|
|
325
|
+
private readonly rawWidthClass;
|
|
326
|
+
/**
|
|
327
|
+
* The width class of the surrounding layout: `compact` below 48rem, `medium`
|
|
328
|
+
* from 48rem, `expanded` from 64rem. Outside a layout, and for a value the
|
|
329
|
+
* rule block does not define, it is `compact`.
|
|
330
|
+
*/
|
|
331
|
+
readonly widthClass: _angular_core.Signal<SidenavWidthClass>;
|
|
332
|
+
/** Resolved mode - `'auto'` derives from the width class, anything else pins. */
|
|
182
333
|
readonly effectiveMode: _angular_core.Signal<ResolvedSidenavMode>;
|
|
183
|
-
/**
|
|
334
|
+
/**
|
|
335
|
+
* `auto` in the `medium` width class: the rail is the resting state and
|
|
336
|
+
* `toggle()` opens the full nav as an overlay over it (no reflow).
|
|
337
|
+
*/
|
|
338
|
+
private readonly railBase;
|
|
339
|
+
/**
|
|
340
|
+
* Whether `opened` shows the rail as an overlay: the `over` drawer, or the
|
|
341
|
+
* full nav over the `medium` rail.
|
|
342
|
+
*/
|
|
184
343
|
readonly isOverlay: _angular_core.Signal<boolean>;
|
|
185
|
-
/** Whether the sidenav is currently a modal overlay: overlay
|
|
344
|
+
/** Whether the sidenav is currently a modal overlay: overlay presentation and open. */
|
|
186
345
|
readonly overlayActive: _angular_core.Signal<boolean>;
|
|
187
|
-
/**
|
|
188
|
-
|
|
346
|
+
/**
|
|
347
|
+
* Whether the full nav is shown: the overlay while `opened`, a
|
|
348
|
+
* docked rail while not `collapsed` or while it peeks. A trigger's
|
|
349
|
+
* `aria-expanded` mirrors it outside a peek (`panelTarget.peeked`).
|
|
350
|
+
*/
|
|
351
|
+
readonly expanded: _angular_core.Signal<boolean>;
|
|
352
|
+
/** @internal Drives the composed `CngxSidebar`: the collapsed state per presentation. */
|
|
353
|
+
readonly sidebarCollapsed: _angular_core.Signal<boolean>;
|
|
354
|
+
/** @internal Drives the composed `CngxSidebar`: `medium` always rests as a rail. */
|
|
355
|
+
readonly sidebarCollapsedAs: _angular_core.Signal<CngxSidebarCollapsedAs>;
|
|
356
|
+
/** @internal Drives the composed `CngxSidebar`: the `medium` overlay shows over the rail. */
|
|
357
|
+
readonly sidebarPeek: _angular_core.Signal<boolean>;
|
|
358
|
+
/** @internal Drives the composed `CngxSidebar`: a closed drawer leaves the a11y tree. */
|
|
359
|
+
readonly sidebarConcealed: _angular_core.Signal<boolean>;
|
|
360
|
+
/** @internal Drives the composed `CngxSidebar`: the rail's accessible name. */
|
|
361
|
+
readonly sidebarLabel: _angular_core.Signal<string>;
|
|
362
|
+
/**
|
|
363
|
+
* @internal Drives the composed `CngxSidebar`: the body is nav rows, so an
|
|
364
|
+
* unbound `[role]` renders a `navigation` landmark on either edge.
|
|
365
|
+
*/
|
|
366
|
+
readonly sidebarRole: _angular_core.Signal<string | null>;
|
|
367
|
+
/**
|
|
368
|
+
* @internal Drives the composed `CngxDrawerSurface`: engaged while an open
|
|
369
|
+
* overlay. An `auto` rail inside a layout holds off until the container rule
|
|
370
|
+
* has resolved its width class: the layout stays hidden until then, and a
|
|
371
|
+
* surface engaged earlier would run its autofocus against a rail that is
|
|
372
|
+
* not shown yet, so an initially open overlay would go modal with focus left
|
|
373
|
+
* on the page. Engaging on the resolved frame gives the trap a real edge. A
|
|
374
|
+
* pinned mode or a standalone rail has nothing to wait for and engages at once.
|
|
375
|
+
*/
|
|
376
|
+
readonly surfaceActive: _angular_core.Signal<boolean>;
|
|
377
|
+
/**
|
|
378
|
+
* @internal Drives the composed `CngxDrawerSurface`: the sidebar's resolved
|
|
379
|
+
* role, so both host writers render one landmark; `dialog` wins while engaged.
|
|
380
|
+
*/
|
|
381
|
+
readonly surfaceLandmarkRole: _angular_core.Signal<string | null>;
|
|
382
|
+
/** @internal Drives the composed `CngxDrawerSurface`. */
|
|
383
|
+
readonly surfaceModality: _angular_core.InputSignal<CngxDrawerModality>;
|
|
384
|
+
/** @internal Drives the composed `CngxDrawerSurface`: one name in every state. */
|
|
385
|
+
readonly surfaceLabel: _angular_core.Signal<string>;
|
|
386
|
+
/** @internal Escape, the back gesture or an outside press closes the overlay. */
|
|
387
|
+
surfaceDismiss(): void;
|
|
388
|
+
/**
|
|
389
|
+
* The rail as a {@link CngxPanelTarget}, for `[cngxPanelTrigger]="nav.panelTarget"`
|
|
390
|
+
* (and `CNGX_PANEL_TARGET` inside the rail). One trigger works in every
|
|
391
|
+
* width class: `toggle()` flips `collapsed` on the docked rail and opens or
|
|
392
|
+
* closes the overlay over the `medium` rail and the `compact` drawer;
|
|
393
|
+
* `expanded` is "the full nav is shown", and a hover peek of the docked rail
|
|
394
|
+
* is reported through `peeked`, so the trigger's `aria-expanded` keeps the
|
|
395
|
+
* resting state. `mode` reads `over` while `opened` shows the rail as an
|
|
396
|
+
* overlay, else `inline`.
|
|
397
|
+
*/
|
|
398
|
+
readonly panelTarget: CngxPanelTarget;
|
|
399
|
+
/** Peeks a collapsed docked rail without changing `collapsed`; elsewhere it toggles. */
|
|
400
|
+
peek(): void;
|
|
189
401
|
private readonly doc;
|
|
190
|
-
private readonly
|
|
191
|
-
/**
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
private readonly
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
402
|
+
private readonly layoutAncestor;
|
|
403
|
+
/**
|
|
404
|
+
* The layout this rail is a direct rail of. Any ancestor layout is not
|
|
405
|
+
* enough: its width-class rule and its one-overlay rule cover its own rails
|
|
406
|
+
* only, so a rail nested in its content stands alone.
|
|
407
|
+
*/
|
|
408
|
+
private readonly layoutCoordinator;
|
|
409
|
+
/** An `auto` rail inside a layout whose container rule has not written the width class yet. */
|
|
410
|
+
private readonly widthClassPending;
|
|
411
|
+
private readonly announcer;
|
|
412
|
+
/**
|
|
413
|
+
* Current/previous presentation pair for the open-flag reset: the resolved
|
|
414
|
+
* mode plus whether `medium` rests as a rail. A pinned mode ignores the width
|
|
415
|
+
* class, so only its own flip is an edge; `auto` -> pinned `over` at compact
|
|
416
|
+
* keeps the presentation. `null` while an `auto` rail waits for the layout's
|
|
417
|
+
* first `ResizeObserver` entry, so settling from that frame is not a change.
|
|
418
|
+
*/
|
|
419
|
+
private readonly presentationTransition;
|
|
420
|
+
/**
|
|
421
|
+
* Whether the sidenav rests as a collapsed rail. Peek, expanded and hidden
|
|
422
|
+
* are not railed, so tooltip and flyout attach only to the narrow rest.
|
|
423
|
+
*/
|
|
424
|
+
protected readonly railed: _angular_core.Signal<boolean>;
|
|
425
|
+
private readonly navRailConfig;
|
|
426
|
+
/** Whether the rail tooltip is on: `[tooltip]`, then the nav rail config. */
|
|
427
|
+
private readonly resolvedTooltip;
|
|
428
|
+
private readonly navGroups;
|
|
429
|
+
private readonly navGroupElements;
|
|
430
|
+
private readonly navGroupContents;
|
|
431
|
+
private readonly navGroupContentElements;
|
|
211
432
|
constructor();
|
|
212
|
-
/**
|
|
433
|
+
/**
|
|
434
|
+
* Shows the full nav: opens the overlay, expands a docked
|
|
435
|
+
* rail (`collapsed = false`).
|
|
436
|
+
*/
|
|
213
437
|
open(): void;
|
|
214
|
-
/** Closes the sidenav (only in over/push mode). No-op in side/mini mode. */
|
|
215
|
-
close(): void;
|
|
216
|
-
/** Toggles the sidenav. */
|
|
217
|
-
toggle(): void;
|
|
218
|
-
/** @internal Close only if in overlay mode (for Escape key, click-outside). */
|
|
219
|
-
protected closeIfOverlay(): void;
|
|
220
438
|
/**
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* When `expandOnHover=true` (the default) the debounced hover is the source of
|
|
224
|
-
* truth for `expanded`, so a programmatic `expand()` is transient: the next
|
|
225
|
-
* pointer edge overrides it. For authoritative programmatic control set
|
|
226
|
-
* `expandOnHover=false`, which hands `expand()`/`collapse()` full authority.
|
|
439
|
+
* Hides the full nav: closes the overlay, collapses a docked
|
|
440
|
+
* rail (`collapsed = true`). On a collapsed docked rail it ends a peek.
|
|
227
441
|
*/
|
|
228
|
-
|
|
442
|
+
close(): void;
|
|
229
443
|
/**
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* authoritative while `expandOnHover=false`.
|
|
444
|
+
* Toggles the full nav per width class: flips `collapsed` on a docked rail
|
|
445
|
+
* (the content reflows), opens or closes the overlay over the `medium` rail
|
|
446
|
+
* or the `compact` drawer.
|
|
234
447
|
*/
|
|
235
|
-
|
|
236
|
-
|
|
448
|
+
toggle(): void;
|
|
449
|
+
private openOverlay;
|
|
450
|
+
private persistCollapsed;
|
|
451
|
+
/** Whether `collapsed` (not `opened`) is the state `toggle()` and `close()` change. */
|
|
452
|
+
private dockedRail;
|
|
453
|
+
/** @internal Numeric px of the current width clamped to min / max, or null for non-px units. */
|
|
237
454
|
protected readonly widthPx: _angular_core.Signal<number | null>;
|
|
238
|
-
|
|
239
|
-
protected readonly
|
|
455
|
+
/** @internal The rendered width: the clamped px width, else the bound value as is. */
|
|
456
|
+
protected readonly effectiveWidth: _angular_core.Signal<string>;
|
|
457
|
+
/** @internal Resize bounds in px; a non-px bound falls back to 120 / 600. */
|
|
458
|
+
protected readonly minPx: _angular_core.Signal<number>;
|
|
459
|
+
protected readonly maxPx: _angular_core.Signal<number>;
|
|
240
460
|
/**
|
|
241
461
|
* Rect-measured width for non-px rails: seeded after first render (a
|
|
242
462
|
* focusable separator must expose `aria-valuenow` before it is ever
|
|
@@ -244,115 +464,61 @@ declare class CngxSidenav {
|
|
|
244
464
|
* AT reads at interaction time is current.
|
|
245
465
|
*/
|
|
246
466
|
private readonly measuredWidthPx;
|
|
467
|
+
/** @internal The handle's `size`: the px width, else the measured one. */
|
|
468
|
+
protected readonly sizePx: _angular_core.Signal<number>;
|
|
247
469
|
/**
|
|
248
|
-
* @internal `aria-
|
|
249
|
-
*
|
|
250
|
-
*
|
|
470
|
+
* @internal `aria-valuetext` of the handle: its position as a percent of the
|
|
471
|
+
* min-max range, formatted in the locale, so AT speaks where the handle sits
|
|
472
|
+
* instead of a bare pixel count.
|
|
251
473
|
*/
|
|
252
|
-
protected readonly
|
|
253
|
-
/**
|
|
254
|
-
* @internal `aria-valuetext` of the separator: its position as a percent of
|
|
255
|
-
* the min-max range, formatted in the locale, so AT speaks where the handle
|
|
256
|
-
* sits instead of a bare pixel count. `null` (AT reads `aria-valuenow`) while
|
|
257
|
-
* the width or a bound is not in px.
|
|
258
|
-
*/
|
|
259
|
-
protected readonly widthValueText: _angular_core.Signal<string | null>;
|
|
260
|
-
private measureWidth;
|
|
474
|
+
protected readonly formatValueText: _angular_core.Signal<(size: number) => string>;
|
|
261
475
|
/** @internal Refresh the measurement the moment AT is about to read it. */
|
|
262
|
-
protected
|
|
263
|
-
/**
|
|
264
|
-
|
|
265
|
-
* without a pointer (WCAG 2.1.1): arrows step by 16px (direction-aware for
|
|
266
|
-
* `position="end"`), Home/End jump to the min/max constraint. Any modified
|
|
267
|
-
* key (shift included) passes through untouched - browser and AT shortcuts
|
|
268
|
-
* stay theirs.
|
|
269
|
-
*/
|
|
270
|
-
protected handleResizeKeydown(event: KeyboardEvent): void;
|
|
271
|
-
/** @internal */
|
|
272
|
-
protected handleResizeStart(e: PointerEvent): void;
|
|
476
|
+
protected measureWidth(): void;
|
|
477
|
+
/** @internal The handle resized: the model takes the px width. */
|
|
478
|
+
protected handleSizeChange(size: number): void;
|
|
273
479
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenav, never>;
|
|
274
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSidenav, "cngx-sidenav", ["cngxSidenav"], { "position": { "alias": "position"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "miniWidth": { "alias": "miniWidth"; "required": false; "isSignal": true; }; "
|
|
480
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSidenav, "cngx-sidenav", ["cngxSidenav"], { "position": { "alias": "position"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "miniWidth": { "alias": "miniWidth"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "resizeLabel": { "alias": "resizeLabel"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "shortcut": { "alias": "shortcut"; "required": false; "isSignal": true; }; "opened": { "alias": "opened"; "required": false; "isSignal": true; }; "modality": { "alias": "modality"; "required": false; "isSignal": true; }; }, { "width": "widthChange"; "opened": "openedChange"; }, ["navGroups", "navGroupElements", "navGroupContents", "navGroupContentElements"], ["cngx-nav-header, [cngxNavHeader]", "*", "cngx-nav-footer, [cngxNavFooter]"], true, [{ directive: typeof i1.CngxSidebar; inputs: { "collapsed": "collapsed"; "collapsedAs": "collapsedAs"; "expandOnHover": "expandOnHover"; "expandDelay": "expandDelay"; "collapseDelay": "collapseDelay"; "side": "position"; "role": "role"; }; outputs: { "collapsedChange": "collapsedChange"; }; }, { directive: typeof i1.CngxDrawerSurface; inputs: {}; outputs: {}; }]>;
|
|
275
481
|
}
|
|
276
482
|
|
|
277
483
|
/**
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
* Supports up to two sidenavs: one `position="start"` and one `position="end"`.
|
|
282
|
-
*
|
|
283
|
-
* It is also the query container the rails resolve their `'auto'` mode
|
|
284
|
-
* against: the stylesheet declares and names the container
|
|
285
|
-
* (`cngx-sidenav-layout`) and carries the single docking threshold, the
|
|
286
|
-
* composed `CngxContainer` observes it and publishes the resolved value. A
|
|
287
|
-
* rail mounted without this layout has no container and falls back to
|
|
288
|
-
* `over`.
|
|
289
|
-
*
|
|
290
|
-
* ### Dual sidebar
|
|
291
|
-
* ```html
|
|
292
|
-
* <cngx-sidenav-layout>
|
|
293
|
-
* <cngx-sidenav position="start" [(opened)]="navOpen">
|
|
294
|
-
* Left nav
|
|
295
|
-
* </cngx-sidenav>
|
|
296
|
-
* <cngx-sidenav-content>
|
|
297
|
-
* Main content
|
|
298
|
-
* </cngx-sidenav-content>
|
|
299
|
-
* <cngx-sidenav position="end" [(opened)]="detailOpen">
|
|
300
|
-
* Right detail panel
|
|
301
|
-
* </cngx-sidenav>
|
|
302
|
-
* </cngx-sidenav-layout>
|
|
303
|
-
* ```
|
|
484
|
+
* Speaks the state a toggle hotkey left the sidenav in. A hotkey has no
|
|
485
|
+
* focused trigger whose `aria-expanded` would convey the change, so the
|
|
486
|
+
* rail announces it.
|
|
304
487
|
*
|
|
305
|
-
* @
|
|
306
|
-
* @
|
|
307
|
-
* @
|
|
308
|
-
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav-layout.ts
|
|
309
|
-
* @since 0.1.0
|
|
310
|
-
* @relatedTo CngxSidenav, CngxSidenavContent, CngxSidenavHeader, CngxSidenavFooter
|
|
488
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav-announcer.ts
|
|
489
|
+
* @since 0.3.0
|
|
490
|
+
* @relatedTo CNGX_SIDENAV_ANNOUNCER_FACTORY, createSidenavAnnouncer
|
|
311
491
|
*/
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
protected readonly ready: _angular_core.Signal<boolean>;
|
|
316
|
-
private readonly sidenavs;
|
|
317
|
-
/** The start-positioned sidenav, if any. */
|
|
318
|
-
readonly startSidenav: _angular_core.Signal<CngxSidenav | null>;
|
|
319
|
-
/** The end-positioned sidenav, if any. */
|
|
320
|
-
readonly endSidenav: _angular_core.Signal<CngxSidenav | null>;
|
|
321
|
-
/** Whether any sidenav is open in overlay mode. */
|
|
322
|
-
readonly hasOverlay: _angular_core.Signal<boolean>;
|
|
323
|
-
constructor();
|
|
324
|
-
/** Closes all sidenavs that are currently in overlay mode. */
|
|
325
|
-
closeAllOverlays(): void;
|
|
326
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenavLayout, never>;
|
|
327
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSidenavLayout, "cngx-sidenav-layout", ["cngxSidenavLayout"], {}, {}, ["sidenavs"], ["cngx-sidenav[position=start], cngx-sidenav:not([position])", "cngx-sidenav-content", "cngx-sidenav[position=end]"], true, [{ directive: typeof i1$1.CngxContainer; inputs: {}; outputs: {}; }]>;
|
|
492
|
+
interface CngxSidenavAnnouncer {
|
|
493
|
+
/** Announces the full nav as shown (`true`) or hidden (`false`). */
|
|
494
|
+
announce(expanded: boolean): void;
|
|
328
495
|
}
|
|
329
|
-
|
|
330
496
|
/**
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
* @
|
|
340
|
-
* @since 0.1.0
|
|
497
|
+
* Default sidenav announcer: the `collapsedAnnouncement` /
|
|
498
|
+
* `expandedAnnouncement` copy (`withSidenavLabels`, then the language pack)
|
|
499
|
+
* through the root `CngxLiveAnnouncer`, scoped to the rail so an open modal
|
|
500
|
+
* overlay still reads it. The copy is read untracked at announce time, so a
|
|
501
|
+
* language switch never re-speaks a message. Injection context required.
|
|
502
|
+
*
|
|
503
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav-announcer.ts
|
|
504
|
+
* @since 0.3.0
|
|
505
|
+
* @relatedTo CNGX_SIDENAV_ANNOUNCER_FACTORY, CngxLiveAnnouncer
|
|
341
506
|
*/
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
507
|
+
declare function createSidenavAnnouncer(): CngxSidenavAnnouncer;
|
|
508
|
+
/** The shape an override of {@link CNGX_SIDENAV_ANNOUNCER_FACTORY} must match. */
|
|
509
|
+
type CngxSidenavAnnouncerFactory = () => CngxSidenavAnnouncer;
|
|
346
510
|
/**
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
* @
|
|
511
|
+
* Swap token for the hotkey announcement. The default resolves to
|
|
512
|
+
* {@link createSidenavAnnouncer}; the rail builds its announcer via
|
|
513
|
+
* `inject(CNGX_SIDENAV_ANNOUNCER_FACTORY)()` in its own injection context, so
|
|
514
|
+
* an override can still inject `CngxLiveAnnouncer` or the sidenav labels (a
|
|
515
|
+
* telemetry tap, assertive politeness, a silent variant).
|
|
516
|
+
*
|
|
517
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav-announcer.ts
|
|
518
|
+
* @since 0.3.0
|
|
519
|
+
* @relatedTo createSidenavAnnouncer, CngxSidenav
|
|
354
520
|
*/
|
|
355
|
-
declare const
|
|
521
|
+
declare const CNGX_SIDENAV_ANNOUNCER_FACTORY: InjectionToken<CngxSidenavAnnouncerFactory>;
|
|
356
522
|
|
|
357
523
|
/**
|
|
358
524
|
* Deep-links a sidenav's open state into a query param. Opt-in via
|
|
@@ -363,25 +529,30 @@ declare const CNGX_SIDENAV: InjectionToken<CngxSidenavContract>;
|
|
|
363
529
|
* contract token, never the concrete class.
|
|
364
530
|
*
|
|
365
531
|
* The `param` default cascades: per-instance `[param]` wins, then
|
|
366
|
-
* `withSidenavRouterSync({ param })` on `CNGX_SIDENAV_CONFIG`, then
|
|
367
|
-
*
|
|
532
|
+
* `withSidenavRouterSync({ param })` on `CNGX_SIDENAV_CONFIG`, then `'nav'` on a
|
|
533
|
+
* start rail and `'nav-end'` on an end rail, so two synced rails keep apart. Without `@angular/router` the kernel dev-warns once and no-ops.
|
|
368
534
|
*
|
|
369
|
-
* @category ui/sidenav
|
|
370
|
-
* @docsKind primary
|
|
371
535
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav-router-sync.directive.ts
|
|
372
|
-
* @since 0.
|
|
536
|
+
* @since 0.3.0
|
|
373
537
|
* @relatedTo CngxSidenav, CNGX_SIDENAV, injectQueryParamSync
|
|
374
|
-
* <example-url
|
|
538
|
+
* <example-url>/#/ui/sidenav/router-sync/deep-linkable-overlay</example-url>
|
|
539
|
+
* @axis level organism
|
|
375
540
|
*/
|
|
376
541
|
declare class CngxSidenavRouterSync {
|
|
377
542
|
private readonly sidenav;
|
|
378
543
|
private readonly cfg;
|
|
379
544
|
/**
|
|
380
|
-
*
|
|
381
|
-
*
|
|
545
|
+
* Query-param key that the sidenav `opened` state syncs to, set through `[param]`.
|
|
546
|
+
* Falls back to the config `routerSync.param`, then to `'nav'` (`'nav-end'` on a
|
|
547
|
+
* `position="end"` rail); the resolved key is
|
|
548
|
+
* the `param` computed. An empty string is a set value and is used as the key.
|
|
549
|
+
* A `[param]` set after construction renames the synced key: the current state is reflected under the
|
|
550
|
+
* new key and the old key is removed. The initial URL is read once under the resolved key, after
|
|
551
|
+
* `[param]` is bound, so a deep link to a static `param="menu"` opens the sidenav.
|
|
382
552
|
*/
|
|
383
553
|
readonly paramInput: _angular_core.InputSignal<string | undefined>;
|
|
384
|
-
|
|
554
|
+
private readonly defaultParam;
|
|
555
|
+
/** Resolved query-param key: `[param]` -> config `routerSync.param` -> `'nav'` / `'nav-end'`. */
|
|
385
556
|
readonly param: _angular_core.Signal<string>;
|
|
386
557
|
/** Emits when a `router.navigate` rejection is observed. Parity with the stepper sibling. */
|
|
387
558
|
readonly syncError: _angular_core.OutputEmitterRef<unknown>;
|
|
@@ -393,7 +564,7 @@ declare class CngxSidenavRouterSync {
|
|
|
393
564
|
/**
|
|
394
565
|
* Main content area within a `CngxSidenavLayout`.
|
|
395
566
|
*
|
|
396
|
-
*
|
|
567
|
+
* Sits in flex flow beside sibling sidenavs docked in `side`
|
|
397
568
|
* mode. Must be a direct child of `CngxSidenavLayout`.
|
|
398
569
|
*
|
|
399
570
|
* ```html
|
|
@@ -405,138 +576,42 @@ declare class CngxSidenavRouterSync {
|
|
|
405
576
|
* </cngx-sidenav-layout>
|
|
406
577
|
* ```
|
|
407
578
|
*
|
|
408
|
-
* @category ui/sidenav
|
|
409
|
-
* @docsKind primary
|
|
410
579
|
* @wcag AA
|
|
411
580
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav-content.ts
|
|
412
|
-
* @since 0.
|
|
581
|
+
* @since 0.3.0
|
|
413
582
|
* @relatedTo CngxSidenavLayout, CngxSidenav
|
|
414
583
|
*/
|
|
415
584
|
declare class CngxSidenavContent {
|
|
416
585
|
private readonly layout;
|
|
417
586
|
constructor();
|
|
418
|
-
/**
|
|
419
|
-
* Margin offset for the start sidenav.
|
|
420
|
-
*
|
|
421
|
-
* Push and side modes use `position: relative` - the sidenav sits in
|
|
422
|
-
* the flex flow and the content shrinks naturally via `flex: 1`.
|
|
423
|
-
* No margin needed. Over mode uses `position: absolute` - no margin needed
|
|
424
|
-
* either since the sidenav floats above content.
|
|
425
|
-
*
|
|
426
|
-
* Kept as a public computed so tests and consumers can still read it.
|
|
427
|
-
*/
|
|
428
|
-
readonly marginStart = "0";
|
|
429
|
-
/** Margin offset for the end sidenav - same rationale as start. */
|
|
430
|
-
readonly marginEnd = "0";
|
|
431
587
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenavContent, never>;
|
|
432
588
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSidenavContent, "cngx-sidenav-content", ["cngxSidenavContent"], {}, {}, never, ["*"], true, never>;
|
|
433
589
|
}
|
|
434
590
|
|
|
435
591
|
/**
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
* body scrolls. Not `position: sticky` - a non-shrinking flex sibling
|
|
439
|
-
* with `flex-shrink: 0`.
|
|
440
|
-
*
|
|
441
|
-
* Two selector forms:
|
|
442
|
-
* - `<cngx-sidenav-header>` element wrapper for arbitrary content.
|
|
443
|
-
* - `[cngxSidenavHeader]` attribute for native landmarks like
|
|
444
|
-
* `<header>` so the landmark a11y comes from the element itself.
|
|
445
|
-
*
|
|
446
|
-
* Adds the `cngx-sidenav-header` class for theming via
|
|
447
|
-
* `--cngx-sidenav-header-bg` and `--cngx-sidenav-header-font-size`.
|
|
448
|
-
*
|
|
449
|
-
* In `mini` mode (collapsed rail, not expanded) the region clips to
|
|
450
|
-
* `miniWidth` with `overflow: hidden`, centred text, and tight
|
|
451
|
-
* padding. Design the projected content to survive the rail width:
|
|
452
|
-
* an icon-sized logo works, a wordmark gets cropped.
|
|
453
|
-
*
|
|
454
|
-
* Typical content: logo, app name, close trigger.
|
|
455
|
-
*
|
|
456
|
-
* ```html
|
|
457
|
-
* <cngx-sidenav>
|
|
458
|
-
* <cngx-sidenav-header>Acme HR</cngx-sidenav-header>
|
|
459
|
-
* ...
|
|
460
|
-
* </cngx-sidenav>
|
|
461
|
-
* ```
|
|
462
|
-
*
|
|
463
|
-
* @category ui/sidenav
|
|
464
|
-
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav-header.ts
|
|
465
|
-
* @selector cngx-sidenav-header
|
|
466
|
-
* @since 0.1.0
|
|
467
|
-
* @relatedTo CngxSidenav, CngxSidenavFooter, CngxSidenavLayout
|
|
468
|
-
*/
|
|
469
|
-
declare class CngxSidenavHeader {
|
|
470
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenavHeader, never>;
|
|
471
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSidenavHeader, "cngx-sidenav-header, [cngxSidenavHeader]", never, {}, {}, never, never, true, never>;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* Bottom region of `<cngx-sidenav>`. Mirror of `CngxSidenavHeader`:
|
|
476
|
-
* a non-shrinking flex sibling after the scrolling body, so it stays
|
|
477
|
-
* pinned at the bottom while the body scrolls. Not `position:
|
|
478
|
-
* sticky`.
|
|
479
|
-
*
|
|
480
|
-
* Two selector forms:
|
|
481
|
-
* - `<cngx-sidenav-footer>` element wrapper for arbitrary content.
|
|
482
|
-
* - `[cngxSidenavFooter]` attribute for native landmarks like
|
|
483
|
-
* `<footer>` so the landmark a11y comes from the element itself.
|
|
484
|
-
*
|
|
485
|
-
* Adds the `cngx-sidenav-footer` class for theming via
|
|
486
|
-
* `--cngx-sidenav-footer-bg`, `--cngx-sidenav-footer-border-color`,
|
|
487
|
-
* and `--cngx-sidenav-footer-font-size`.
|
|
488
|
-
*
|
|
489
|
-
* In `mini` mode (collapsed rail, not expanded) the region clips to
|
|
490
|
-
* `miniWidth` with `overflow: hidden` and centred text - same
|
|
491
|
-
* caveat as the header. An icon + tooltip pattern survives the
|
|
492
|
-
* rail; a multi-line copyright line does not.
|
|
493
|
-
*
|
|
494
|
-
* Typical content: version badge, account menu trigger, secondary
|
|
495
|
-
* nav, sign-out button.
|
|
496
|
-
*
|
|
497
|
-
* ```html
|
|
498
|
-
* <cngx-sidenav>
|
|
499
|
-
* ...
|
|
500
|
-
* <cngx-sidenav-footer>v2.4.0</cngx-sidenav-footer>
|
|
501
|
-
* </cngx-sidenav>
|
|
502
|
-
* ```
|
|
503
|
-
*
|
|
504
|
-
* @category ui/sidenav
|
|
505
|
-
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav-footer.ts
|
|
506
|
-
* @selector cngx-sidenav-footer
|
|
507
|
-
* @since 0.1.0
|
|
508
|
-
* @relatedTo CngxSidenav, CngxSidenavHeader, CngxSidenavLayout
|
|
509
|
-
*/
|
|
510
|
-
declare class CngxSidenavFooter {
|
|
511
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenavFooter, never>;
|
|
512
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSidenavFooter, "cngx-sidenav-footer, [cngxSidenavFooter]", never, {}, {}, never, never, true, never>;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* App-wide cascade for the sidenav family's dimension defaults, the mini
|
|
517
|
-
* expand-on-hover dwell, and the `shortcut` behaviour knob.
|
|
592
|
+
* App-wide cascade for the sidenav family's dimension defaults, the rail
|
|
593
|
+
* peek hover dwell, and the `shortcut` behaviour knob.
|
|
518
594
|
*
|
|
519
595
|
* Resolution priority (high -> low):
|
|
520
596
|
* 1. Per-instance Input binding (e.g. `[width]="'320px'"`, `[shortcut]="'mod+b'"`).
|
|
521
597
|
* 2. `provideSidenavConfigAt(...)` in a parent component's `viewProviders`
|
|
522
598
|
* (component-scoped override).
|
|
523
599
|
* 3. `provideSidenavConfig(...)` at the application root.
|
|
524
|
-
* 4. Library defaults
|
|
600
|
+
* 4. Library defaults.
|
|
525
601
|
*
|
|
526
|
-
* Every key is optional
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
* (spread-merged per key); `shortcut` is a flat top-level scalar.
|
|
602
|
+
* Every key is optional, so consumers declare only the keys they want to
|
|
603
|
+
* override. `dimensions`, `hover`, `routerSync` and `labels` merge per key
|
|
604
|
+
* with the level above; `shortcut` and `persistence` replace it whole.
|
|
530
605
|
*
|
|
531
|
-
* The cascaded keys are the dimension inputs, the
|
|
532
|
-
* `shortcut` default,
|
|
606
|
+
* The cascaded keys are the dimension inputs, the rail hover dwell, the
|
|
607
|
+
* `shortcut` default, the router-sync `param`, the copy and the `collapsed`
|
|
608
|
+
* persistence. `ariaLabel`, `position`,
|
|
533
609
|
* and `mode` stay per-instance only, since they describe an individual rail
|
|
534
610
|
* rather than an app-wide default. The docking threshold behind `mode="auto"`
|
|
535
611
|
* is deliberately not here: it lives in `sidenav-layout.css` as a
|
|
536
612
|
* `@container` rule, so a consumer moves it by overriding that rule.
|
|
537
613
|
*
|
|
538
|
-
* @
|
|
539
|
-
* @since 0.1.0
|
|
614
|
+
* @since 0.3.0
|
|
540
615
|
*/
|
|
541
616
|
interface CngxSidenavConfig {
|
|
542
617
|
/**
|
|
@@ -547,7 +622,7 @@ interface CngxSidenavConfig {
|
|
|
547
622
|
readonly dimensions?: {
|
|
548
623
|
/** Width of the expanded panel. Seeds the two-way `[(width)]` model. */
|
|
549
624
|
readonly width?: string;
|
|
550
|
-
/** Width of the collapsed rail
|
|
625
|
+
/** Width of the collapsed rail (`collapsed` with `collapsedAs="rail"`). */
|
|
551
626
|
readonly miniWidth?: string;
|
|
552
627
|
/** Minimum width constraint during resize. */
|
|
553
628
|
readonly minWidth?: string;
|
|
@@ -555,27 +630,37 @@ interface CngxSidenavConfig {
|
|
|
555
630
|
readonly maxWidth?: string;
|
|
556
631
|
};
|
|
557
632
|
/**
|
|
558
|
-
*
|
|
559
|
-
*
|
|
633
|
+
* Hover dwell of the collapsed rail's peek, forwarded to the `CngxHoverIntent`
|
|
634
|
+
* of the composed `CngxSidebar`. A one-level nested sub-tree. Wired via
|
|
560
635
|
* `withSidenavHoverDwell(...)`.
|
|
561
636
|
*/
|
|
562
637
|
readonly hover?: {
|
|
563
|
-
/** Delay in ms before the
|
|
638
|
+
/** Delay in ms before the collapsed rail peeks on pointer enter. */
|
|
564
639
|
readonly enterDelay?: number;
|
|
565
|
-
/** Delay in ms before the
|
|
640
|
+
/** Delay in ms before the peek ends on pointer leave. */
|
|
566
641
|
readonly leaveDelay?: number;
|
|
567
642
|
};
|
|
568
643
|
/**
|
|
569
644
|
* URL query-param sync defaults for `[cngxSidenavRouterSync]`. A one-level
|
|
570
645
|
* nested sub-tree (spread-merged per key in the config reducer). Wired via
|
|
571
646
|
* `withSidenavRouterSync(...)`; the directive resolves `param` as
|
|
572
|
-
* `[param] ?? routerSync.param ?? 'nav'
|
|
573
|
-
* the
|
|
647
|
+
* `[param] ?? routerSync.param ?? 'nav'` (`'nav-end'` on a `position="end"`
|
|
648
|
+
* rail), so an un-configured consumer keeps the literals. A param set here
|
|
649
|
+
* applies to every rail; a two-rail layout binds `[param]` on one of them.
|
|
574
650
|
*/
|
|
575
651
|
readonly routerSync?: {
|
|
576
|
-
/** Query-param key the sidenav's `opened` state syncs to. Defaults to `'nav'
|
|
652
|
+
/** Query-param key the sidenav's `opened` state syncs to. Defaults to `'nav'`, `'nav-end'` on an end rail. */
|
|
577
653
|
readonly param?: string;
|
|
578
654
|
};
|
|
655
|
+
/**
|
|
656
|
+
* Persist each rail's `collapsed` under `storageKey` in
|
|
657
|
+
* `CNGX_SIDENAV_STORAGE`. Unset: nothing is persisted. Set through
|
|
658
|
+
* `withSidenavPersistence(...)`.
|
|
659
|
+
*/
|
|
660
|
+
readonly persistence?: {
|
|
661
|
+
/** Storage key prefix; the rail's `position` is appended. */
|
|
662
|
+
readonly storageKey: string;
|
|
663
|
+
};
|
|
579
664
|
/**
|
|
580
665
|
* Default keyboard shortcut to toggle the sidenav (e.g. `'mod+b'`).
|
|
581
666
|
* Per-instance `[shortcut]` still wins. A flat top-level scalar.
|
|
@@ -585,7 +670,7 @@ interface CngxSidenavConfig {
|
|
|
585
670
|
* App-wide sidenav copy overrides. Reactive from birth: pass a partial
|
|
586
671
|
* bundle or a `Signal` of one; unset keys read the `sidenav` section of the
|
|
587
672
|
* language pack (English without one). Override via `withSidenavLabels(...)`.
|
|
588
|
-
* A later feature
|
|
673
|
+
* A later feature merges per key over the earlier one.
|
|
589
674
|
*/
|
|
590
675
|
readonly labels?: Partial<CngxSidenavLabels> | Signal<Partial<CngxSidenavLabels>>;
|
|
591
676
|
}
|
|
@@ -593,10 +678,19 @@ interface CngxSidenavConfig {
|
|
|
593
678
|
* User-facing copy of the sidenav. The defaults come from the `sidenav` section
|
|
594
679
|
* of the language pack (English without one).
|
|
595
680
|
*
|
|
596
|
-
* @
|
|
597
|
-
* @since 0.1.0
|
|
681
|
+
* @since 0.3.0
|
|
598
682
|
*/
|
|
599
683
|
interface CngxSidenavLabels {
|
|
684
|
+
/**
|
|
685
|
+
* Default accessible name of a `position="start"` rail while `[ariaLabel]`
|
|
686
|
+
* is unbound.
|
|
687
|
+
*/
|
|
688
|
+
readonly startRegion: string;
|
|
689
|
+
/**
|
|
690
|
+
* Default accessible name of a `position="end"` rail while `[ariaLabel]` is
|
|
691
|
+
* unbound. Distinct from `startRegion` so two rails never share one name.
|
|
692
|
+
*/
|
|
693
|
+
readonly endRegion: string;
|
|
600
694
|
/**
|
|
601
695
|
* Default of `[resizeLabel]`, the accessible name of the resize separator.
|
|
602
696
|
*/
|
|
@@ -608,28 +702,17 @@ interface CngxSidenavLabels {
|
|
|
608
702
|
* formatted string. Same shape as the feedback `progressValueText`.
|
|
609
703
|
*/
|
|
610
704
|
readonly resizeValueText: (percent: number, formatted: string) => string;
|
|
705
|
+
/**
|
|
706
|
+
* Spoken when the toggle hotkey hides the full nav: a hotkey has no focused
|
|
707
|
+
* trigger whose `aria-expanded` would convey the change.
|
|
708
|
+
*/
|
|
709
|
+
readonly collapsedAnnouncement: string;
|
|
710
|
+
/** Spoken when the toggle hotkey shows the full nav. */
|
|
711
|
+
readonly expandedAnnouncement: string;
|
|
712
|
+
/** Description of the toggle shortcut in the hotkey help list. */
|
|
713
|
+
readonly toggleShortcut: string;
|
|
611
714
|
}
|
|
612
715
|
|
|
613
|
-
/**
|
|
614
|
-
* Library defaults for the sidenav configuration cascade. The values are
|
|
615
|
-
* byte-identical to the per-instance input defaults `CngxSidenav` shipped
|
|
616
|
-
* before the cascade (`width '280px'`, `miniWidth '56px'`, `minWidth '120px'`,
|
|
617
|
-
* `maxWidth '600px'`, `enterDelay 120`, `leaveDelay 0`; `shortcut` omitted =
|
|
618
|
-
* `undefined`), so an un-configured consumer sees no change.
|
|
619
|
-
*
|
|
620
|
-
* The `leaveDelay 0` default is kept deliberately (instant collapse, asymmetric
|
|
621
|
-
* with the 120ms enter): the dwell becomes tunable via `[leaveDelay]` /
|
|
622
|
-
* `withSidenavHoverDwell(...)`, not silently changed - the breadcrumb
|
|
623
|
-
* "un-configured consumer sees no change" principle.
|
|
624
|
-
*
|
|
625
|
-
* Exported for intra-lib consumers (`provideSidenavConfig` deep-merges with
|
|
626
|
-
* this base) but **NOT** re-exported from `public-api.ts` - downstream
|
|
627
|
-
* consumers reach the defaults via `inject(CNGX_SIDENAV_CONFIG)` so
|
|
628
|
-
* `provideSidenavConfig` / `provideSidenavConfigAt` overrides take precedence.
|
|
629
|
-
*
|
|
630
|
-
* @internal
|
|
631
|
-
*/
|
|
632
|
-
declare const CNGX_SIDENAV_DEFAULTS: CngxSidenavConfig;
|
|
633
716
|
/**
|
|
634
717
|
* App-wide configuration cascade for the sidenav family. Resolves in priority
|
|
635
718
|
* order:
|
|
@@ -645,24 +728,37 @@ declare const CNGX_SIDENAV_DEFAULTS: CngxSidenavConfig;
|
|
|
645
728
|
* `bootstrapApplication` providers (root cascade) or `provideSidenavConfigAt(...)`
|
|
646
729
|
* in a component's `viewProviders` (sub-tree cascade).
|
|
647
730
|
*
|
|
648
|
-
* @category ui/sidenav
|
|
649
731
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/config/sidenav.config.defaults.ts
|
|
650
|
-
* @since 0.
|
|
732
|
+
* @since 0.3.0
|
|
651
733
|
*/
|
|
652
734
|
declare const CNGX_SIDENAV_CONFIG: InjectionToken<CngxSidenavConfig>;
|
|
735
|
+
/**
|
|
736
|
+
* Storage backend of `withSidenavPersistence()`. Defaults to the browser
|
|
737
|
+
* `localStorage`, `null` on the server or where the browser blocks storage
|
|
738
|
+
* (nothing is persisted). Override it to
|
|
739
|
+
* persist elsewhere (`sessionStorage`, a server-backed `Storage` shim):
|
|
740
|
+
*
|
|
741
|
+
* ```ts
|
|
742
|
+
* providers: [{ provide: CNGX_SIDENAV_STORAGE, useFactory: () => sessionStorage }];
|
|
743
|
+
* ```
|
|
744
|
+
*
|
|
745
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/config/sidenav.config.defaults.ts
|
|
746
|
+
* @since 0.3.0
|
|
747
|
+
* @relatedTo withSidenavPersistence
|
|
748
|
+
*/
|
|
749
|
+
declare const CNGX_SIDENAV_STORAGE: InjectionToken<Storage | null>;
|
|
653
750
|
|
|
654
751
|
/**
|
|
655
|
-
* Discriminated-union shape returned by the sidenav config features -
|
|
656
|
-
* `withSidenavDimensions`, `withSidenavShortcut`, `withSidenavHoverDwell`,
|
|
657
|
-
* `withSidenavRouterSync
|
|
658
|
-
*
|
|
659
|
-
*
|
|
660
|
-
*
|
|
752
|
+
* Discriminated-union shape returned by the six sidenav config features -
|
|
753
|
+
* `withSidenavDimensions`, `withSidenavShortcut`, `withSidenavHoverDwell`,
|
|
754
|
+
* `withSidenavRouterSync`, `withSidenavLabels` and `withSidenavPersistence`.
|
|
755
|
+
* The reducer in `provideSidenavConfig` / `provideSidenavConfigAt` matches on
|
|
756
|
+
* `kind`: `dimensions`, `hover`, `routerSync` and `labels` merge per key,
|
|
757
|
+
* `shortcut` and `persistence` replace. Mirrors `CngxBreadcrumbConfigFeature` from
|
|
661
758
|
* `@cngx/ui/breadcrumb` (nested-sub-tree style; the stepper family uses flat
|
|
662
759
|
* scalar keys instead).
|
|
663
760
|
*
|
|
664
|
-
* @
|
|
665
|
-
* @since 0.1.0
|
|
761
|
+
* @since 0.3.0
|
|
666
762
|
*/
|
|
667
763
|
type CngxSidenavConfigFeature = {
|
|
668
764
|
readonly kind: 'dimensions';
|
|
@@ -678,6 +774,9 @@ type CngxSidenavConfigFeature = {
|
|
|
678
774
|
readonly payload: {
|
|
679
775
|
readonly shortcut: string;
|
|
680
776
|
};
|
|
777
|
+
} | {
|
|
778
|
+
readonly kind: 'persistence';
|
|
779
|
+
readonly payload: NonNullable<CngxSidenavConfig['persistence']>;
|
|
681
780
|
} | {
|
|
682
781
|
readonly kind: 'labels';
|
|
683
782
|
readonly payload: {
|
|
@@ -686,18 +785,17 @@ type CngxSidenavConfigFeature = {
|
|
|
686
785
|
};
|
|
687
786
|
/**
|
|
688
787
|
* Application-root configuration cascade for the sidenav family. Pass any
|
|
689
|
-
* combination of `
|
|
690
|
-
*
|
|
691
|
-
* features in `bootstrapApplication`'s providers array.
|
|
788
|
+
* combination of the `withSidenav*` features in `bootstrapApplication`'s
|
|
789
|
+
* providers array.
|
|
692
790
|
*
|
|
693
791
|
* Resolution priority (high -> low):
|
|
694
792
|
* 1. Per-instance Input binding.
|
|
695
793
|
* 2. `provideSidenavConfigAt(...)` in a parent component's `viewProviders`.
|
|
696
794
|
* 3. `provideSidenavConfig(...)` at the application root.
|
|
697
|
-
* 4. Library defaults
|
|
795
|
+
* 4. Library defaults.
|
|
698
796
|
*
|
|
699
|
-
*
|
|
700
|
-
*
|
|
797
|
+
* `dimensions`, `hover`, `routerSync` and `labels` merge per key with the
|
|
798
|
+
* library defaults; `shortcut` and `persistence` replace them.
|
|
701
799
|
*
|
|
702
800
|
* ```ts
|
|
703
801
|
* bootstrapApplication(AppComponent, {
|
|
@@ -710,8 +808,7 @@ type CngxSidenavConfigFeature = {
|
|
|
710
808
|
* });
|
|
711
809
|
* ```
|
|
712
810
|
*
|
|
713
|
-
* @
|
|
714
|
-
* @since 0.1.0
|
|
811
|
+
* @since 0.3.0
|
|
715
812
|
*/
|
|
716
813
|
declare function provideSidenavConfig(...features: CngxSidenavConfigFeature[]): EnvironmentProviders;
|
|
717
814
|
/**
|
|
@@ -722,9 +819,12 @@ declare function provideSidenavConfig(...features: CngxSidenavConfigFeature[]):
|
|
|
722
819
|
* Unlike `provideSidenavConfig` (root-only), `provideSidenavConfigAt` injects
|
|
723
820
|
* the parent injector's `CNGX_SIDENAV_CONFIG` value (resolves through the
|
|
724
821
|
* priority chain - root provider, library defaults, or another
|
|
725
|
-
* `provideSidenavConfigAt` further up) and
|
|
726
|
-
* top
|
|
727
|
-
*
|
|
822
|
+
* `provideSidenavConfigAt` further up) and applies the supplied features on
|
|
823
|
+
* top: `dimensions`, `hover`, `routerSync` and `labels` merge per key,
|
|
824
|
+
* `shortcut` and `persistence` replace. Descendant sidenav instances see the
|
|
825
|
+
* result; sibling sub-trees keep the inherited value untouched. Pass only the
|
|
826
|
+
* keys you set: an explicit `undefined` inside a merged sub-tree overrides
|
|
827
|
+
* the parent.
|
|
728
828
|
*
|
|
729
829
|
* ```ts
|
|
730
830
|
* @Component({
|
|
@@ -736,8 +836,7 @@ declare function provideSidenavConfig(...features: CngxSidenavConfigFeature[]):
|
|
|
736
836
|
* class Section {}
|
|
737
837
|
* ```
|
|
738
838
|
*
|
|
739
|
-
* @
|
|
740
|
-
* @since 0.1.0
|
|
839
|
+
* @since 0.3.0
|
|
741
840
|
*/
|
|
742
841
|
declare function provideSidenavConfigAt(...features: CngxSidenavConfigFeature[]): Provider[];
|
|
743
842
|
|
|
@@ -752,28 +851,28 @@ declare function provideSidenavConfigAt(...features: CngxSidenavConfigFeature[])
|
|
|
752
851
|
* provideSidenavConfig(withSidenavDimensions({ width: '320px', miniWidth: '64px' }));
|
|
753
852
|
* ```
|
|
754
853
|
*
|
|
755
|
-
* @
|
|
756
|
-
* @since 0.1.0
|
|
854
|
+
* @since 0.3.0
|
|
757
855
|
*/
|
|
758
856
|
declare function withSidenavDimensions(payload: NonNullable<CngxSidenavConfig['dimensions']>): CngxSidenavConfigFeature;
|
|
759
857
|
/**
|
|
760
858
|
* Set the app-wide default keyboard shortcut to toggle the sidenav (e.g.
|
|
761
859
|
* `'mod+b'`, which resolves to `ctrl` on Windows/Linux and `meta` on macOS).
|
|
762
|
-
*
|
|
860
|
+
* The default applies to `position="start"` rails only; an `end` rail toggles
|
|
861
|
+
* by key only with its own `[shortcut]`. Per-instance `[shortcut]` still wins.
|
|
763
862
|
*
|
|
764
863
|
* ```ts
|
|
765
864
|
* provideSidenavConfig(withSidenavShortcut('mod+b'));
|
|
766
865
|
* ```
|
|
767
866
|
*
|
|
768
|
-
* @
|
|
769
|
-
* @since 0.1.0
|
|
867
|
+
* @since 0.3.0
|
|
770
868
|
*/
|
|
771
869
|
declare function withSidenavShortcut(combo: string): CngxSidenavConfigFeature;
|
|
772
870
|
/**
|
|
773
|
-
* Set the app-wide default
|
|
774
|
-
* the rail
|
|
775
|
-
*
|
|
776
|
-
* `
|
|
871
|
+
* Set the app-wide default hover dwell of the collapsed rail's peek -
|
|
872
|
+
* `enterDelay` (ms of hover before the rail peeks) and `leaveDelay` (ms before
|
|
873
|
+
* the peek ends). Flows into the `CngxHoverIntent` of the composed
|
|
874
|
+
* `CngxSidebar` via `CNGX_HOVER_INTENT_DEFAULTS`. Per-instance
|
|
875
|
+
* `[expandDelay]` / `[collapseDelay]` still win; the shipped literals (120 / 0)
|
|
777
876
|
* apply when neither is set. Partial payloads deep-merge, so pass only the key
|
|
778
877
|
* you want to change.
|
|
779
878
|
*
|
|
@@ -781,37 +880,52 @@ declare function withSidenavShortcut(combo: string): CngxSidenavConfigFeature;
|
|
|
781
880
|
* provideSidenavConfig(withSidenavHoverDwell({ enterDelay: 200, leaveDelay: 150 }));
|
|
782
881
|
* ```
|
|
783
882
|
*
|
|
784
|
-
* @
|
|
785
|
-
* @since 0.1.0
|
|
883
|
+
* @since 0.3.0
|
|
786
884
|
*/
|
|
787
885
|
declare function withSidenavHoverDwell(payload: NonNullable<CngxSidenavConfig['hover']>): CngxSidenavConfigFeature;
|
|
788
886
|
/**
|
|
789
887
|
* Set the app-wide default query-param key for `[cngxSidenavRouterSync]` - the
|
|
790
888
|
* param the sidenav's `opened` state deep-links to. Per-instance `[param]`
|
|
791
|
-
* still wins;
|
|
889
|
+
* still wins; when neither is set, a start rail uses `'nav'` and an end rail
|
|
890
|
+
* `'nav-end'`.
|
|
792
891
|
*
|
|
793
892
|
* ```ts
|
|
794
893
|
* provideSidenavConfig(withSidenavRouterSync({ param: 'menu' }));
|
|
795
894
|
* ```
|
|
796
895
|
*
|
|
797
|
-
* @
|
|
798
|
-
* @since 0.1.0
|
|
896
|
+
* @since 0.3.0
|
|
799
897
|
*/
|
|
800
898
|
declare function withSidenavRouterSync(payload: NonNullable<CngxSidenavConfig['routerSync']>): CngxSidenavConfigFeature;
|
|
801
899
|
/**
|
|
802
900
|
* Override the app-wide sidenav copy. Unset keys read the `sidenav` section of
|
|
803
901
|
* the language pack (English without one); pass a `Signal` of a partial bundle
|
|
804
902
|
* to switch languages at runtime. A per-instance `[resizeLabel]` still wins
|
|
805
|
-
* over `resizeHandle`. A later call
|
|
903
|
+
* over `resizeHandle`. A later call merges per key over the earlier one.
|
|
806
904
|
*
|
|
807
905
|
* ```ts
|
|
808
906
|
* provideSidenavConfig(withSidenavLabels({ resizeHandle: 'Navigation anpassen' }));
|
|
809
907
|
* ```
|
|
810
908
|
*
|
|
811
|
-
* @
|
|
812
|
-
* @since 0.1.0
|
|
909
|
+
* @since 0.3.0
|
|
813
910
|
*/
|
|
814
911
|
declare function withSidenavLabels(labels: Partial<CngxSidenavLabels> | Signal<Partial<CngxSidenavLabels>>): CngxSidenavConfigFeature;
|
|
912
|
+
/**
|
|
913
|
+
* Persist each rail's `collapsed` across reloads, in `CNGX_SIDENAV_STORAGE`
|
|
914
|
+
* (the browser `localStorage` by default) under `<storageKey>:<position>`.
|
|
915
|
+
* `collapsed` only means something on the docked rail of the `expanded` width
|
|
916
|
+
* class, so one value per rail is stored, and it survives a pass through
|
|
917
|
+
* `medium` and `compact`. The stored value seeds an unbound `collapsed` at
|
|
918
|
+
* construction. A bound `[(collapsed)]` is persisted too; on load the bound
|
|
919
|
+
* value wins over the stored one. The position is read from the static
|
|
920
|
+
* `position` attribute (`start` when absent).
|
|
921
|
+
*
|
|
922
|
+
* ```ts
|
|
923
|
+
* provideSidenavConfig(withSidenavPersistence());
|
|
924
|
+
* ```
|
|
925
|
+
*
|
|
926
|
+
* @since 0.3.0
|
|
927
|
+
*/
|
|
928
|
+
declare function withSidenavPersistence(storageKey?: string): CngxSidenavConfigFeature;
|
|
815
929
|
|
|
816
930
|
/**
|
|
817
931
|
* Convenience accessor for the sidenav configuration cascade. Runs in injection
|
|
@@ -828,8 +942,7 @@ declare function withSidenavLabels(labels: Partial<CngxSidenavLabels> | Signal<P
|
|
|
828
942
|
* }
|
|
829
943
|
* ```
|
|
830
944
|
*
|
|
831
|
-
* @
|
|
832
|
-
* @since 0.1.0
|
|
945
|
+
* @since 0.3.0
|
|
833
946
|
*/
|
|
834
947
|
declare function injectSidenavConfig(): CngxSidenavConfig;
|
|
835
948
|
/**
|
|
@@ -840,8 +953,7 @@ declare function injectSidenavConfig(): CngxSidenavConfig;
|
|
|
840
953
|
* `undefined` reads the section. Runs in injection context; read it inside a
|
|
841
954
|
* `computed()`, a template or a handler.
|
|
842
955
|
*
|
|
843
|
-
* @
|
|
844
|
-
* @since 0.1.0
|
|
956
|
+
* @since 0.3.0
|
|
845
957
|
* @relatedTo withSidenavLabels
|
|
846
958
|
*/
|
|
847
959
|
declare function injectSidenavLabels(): Signal<CngxSidenavLabels>;
|
|
@@ -852,11 +964,14 @@ declare function injectSidenavLabels(): Signal<CngxSidenavLabels>;
|
|
|
852
964
|
* `withSidenavLabels` still wins. Messages use `{name}` placeholders, numbers
|
|
853
965
|
* are formatted for the locale.
|
|
854
966
|
*
|
|
855
|
-
* @
|
|
856
|
-
* @since 0.1.0
|
|
967
|
+
* @since 0.3.0
|
|
857
968
|
* @relatedTo CNGX_SIDENAV_CONFIG, withSidenavLabels
|
|
858
969
|
*/
|
|
859
970
|
interface CngxSidenavLanguageSection {
|
|
971
|
+
/** Accessible name of a `position="start"` rail while `[ariaLabel]` is unbound. */
|
|
972
|
+
readonly startRegion: string;
|
|
973
|
+
/** Accessible name of a `position="end"` rail while `[ariaLabel]` is unbound. */
|
|
974
|
+
readonly endRegion: string;
|
|
860
975
|
/** Accessible name of the resize separator while `[resizeLabel]` is unbound. */
|
|
861
976
|
readonly resizeHandle: string;
|
|
862
977
|
/**
|
|
@@ -865,13 +980,18 @@ interface CngxSidenavLanguageSection {
|
|
|
865
980
|
* separator's `aria-valuetext`.
|
|
866
981
|
*/
|
|
867
982
|
readonly resizeValueText: CngxMessage;
|
|
983
|
+
/** Spoken when the toggle hotkey hides the full nav. */
|
|
984
|
+
readonly collapsedAnnouncement: string;
|
|
985
|
+
/** Spoken when the toggle hotkey shows the full nav. */
|
|
986
|
+
readonly expandedAnnouncement: string;
|
|
987
|
+
/** Description of the toggle shortcut in the hotkey help list. */
|
|
988
|
+
readonly toggleShortcut: string;
|
|
868
989
|
}
|
|
869
990
|
/**
|
|
870
991
|
* The English sidenav section: the single source of the sidenav's English
|
|
871
992
|
* copy. The `CNGX_SIDENAV_CONFIG` labels default to it.
|
|
872
993
|
*
|
|
873
|
-
* @
|
|
874
|
-
* @since 0.1.0
|
|
994
|
+
* @since 0.3.0
|
|
875
995
|
* @relatedTo CNGX_SIDENAV_CONFIG
|
|
876
996
|
*/
|
|
877
997
|
declare const CNGX_SIDENAV_LANGUAGE_EN: CngxSidenavLanguageSection;
|
|
@@ -881,5 +1001,5 @@ declare module '@cngx/core/i18n' {
|
|
|
881
1001
|
}
|
|
882
1002
|
}
|
|
883
1003
|
|
|
884
|
-
export { CNGX_SIDENAV,
|
|
885
|
-
export type { CngxSidenavConfig, CngxSidenavConfigFeature, CngxSidenavContract, CngxSidenavLabels, CngxSidenavLanguageSection, SidenavMode, SidenavPosition };
|
|
1004
|
+
export { CNGX_SIDENAV, CNGX_SIDENAV_ANNOUNCER_FACTORY, CNGX_SIDENAV_CONFIG, CNGX_SIDENAV_LANGUAGE_EN, CNGX_SIDENAV_STORAGE, CngxSidenav, CngxSidenavContent, CngxSidenavLayout, CngxSidenavRouterSync, createSidenavAnnouncer, injectSidenavConfig, injectSidenavLabels, provideSidenavConfig, provideSidenavConfigAt, withSidenavDimensions, withSidenavHoverDwell, withSidenavLabels, withSidenavPersistence, withSidenavRouterSync, withSidenavShortcut };
|
|
1005
|
+
export type { CngxSidenavAnnouncer, CngxSidenavAnnouncerFactory, CngxSidenavConfig, CngxSidenavConfigFeature, CngxSidenavContract, CngxSidenavLabels, CngxSidenavLanguageSection, ResolvedSidenavMode, SidenavMode, SidenavPosition, SidenavWidthClass };
|