@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.8
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 +0 -1
- package/a11y/README.md +11 -5
- package/accordion/README.md +4 -2
- package/breadcrumb/README.md +262 -0
- package/collection/README.md +6 -0
- package/command-palette/README.md +224 -0
- package/data-grid-accordion/README.md +76 -2
- package/feedback/README.md +40 -0
- package/fesm2022/cngx-ui-a11y.mjs +189 -57
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +102 -35
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +112 -50
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +176 -96
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +194 -62
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +395 -119
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +149 -34
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +415 -98
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +16 -6
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +1022 -439
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +75 -7
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +314 -141
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-overlay.mjs +69 -13
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +487 -178
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +327 -106
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +4 -16
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +107 -8
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +146 -46
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +191 -68
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +10 -6
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +74 -21
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +70 -26
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +15 -20
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-paginator/README.md +9 -2
- package/mat-tabs/styles/mat-tabs.css +9 -10
- package/overlay/README.md +9 -4
- package/package.json +4 -4
- package/paginator/README.md +8 -4
- package/sidenav/README.md +33 -11
- package/speak/README.md +3 -2
- package/stepper/README.md +13 -1
- package/timeline/README.md +1 -1
- package/toc/README.md +4 -1
- package/types/cngx-ui-a11y.d.ts +121 -30
- package/types/cngx-ui-accordion.d.ts +91 -26
- package/types/cngx-ui-action-button.d.ts +44 -3
- package/types/cngx-ui-breadcrumb.d.ts +154 -58
- package/types/cngx-ui-chart-panel.d.ts +122 -18
- package/types/cngx-ui-collection.d.ts +147 -55
- package/types/cngx-ui-command-palette.d.ts +297 -183
- package/types/cngx-ui-context-menu.d.ts +98 -6
- package/types/cngx-ui-data-grid-accordion.d.ts +274 -38
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +594 -56
- package/types/cngx-ui-mat-accordion.d.ts +29 -1
- package/types/cngx-ui-mat-paginator.d.ts +37 -8
- package/types/cngx-ui-mat-stepper.d.ts +23 -11
- package/types/cngx-ui-mat-tabs.d.ts +207 -14
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +403 -129
- package/types/cngx-ui-sidenav.d.ts +248 -74
- package/types/cngx-ui-skeleton.d.ts +6 -7
- package/types/cngx-ui-speak.d.ts +118 -5
- package/types/cngx-ui-stat-card.d.ts +117 -33
- package/types/cngx-ui-stepper.d.ts +66 -27
- package/types/cngx-ui-tabs.d.ts +2 -2
- package/types/cngx-ui-timeline.d.ts +23 -7
- package/types/cngx-ui-toc.d.ts +80 -13
- package/types/cngx-ui.d.ts +7 -4
|
@@ -1,21 +1,64 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, inject, input, model,
|
|
3
|
+
import { InjectionToken, inject, input, model, computed, signal, linkedSignal, ElementRef, afterNextRender, effect, DestroyRef, ViewEncapsulation, ChangeDetectionStrategy, Component, contentChildren, output, Directive, makeEnvironmentProviders } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
+
import * as i1$1 from '@cngx/common/layout';
|
|
6
|
+
import { CNGX_CONTAINER_SIZE, CngxContainer, injectQueryParamSync } from '@cngx/common/layout';
|
|
5
7
|
import { fromEvent } from 'rxjs';
|
|
6
8
|
import { FocusTrapFactory } from '@angular/cdk/a11y';
|
|
7
|
-
import { parseKeyCombo, matchesKeyCombo } from '@cngx/core/utils';
|
|
9
|
+
import { createFilledOverrideMerge, injectLocale, createTransitionTracker, parseKeyCombo, matchesKeyCombo, numberFormatterFor } from '@cngx/core/utils';
|
|
8
10
|
import * as i1 from '@cngx/common/interactive';
|
|
9
11
|
import { CngxHoverIntent, CNGX_HOVER_INTENT_DEFAULTS } from '@cngx/common/interactive';
|
|
10
|
-
import {
|
|
12
|
+
import { clamp } from '@cngx/utils';
|
|
13
|
+
import { formatMessage, createLanguageSection, createSectionBundle } from '@cngx/core/i18n';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The English sidenav section: the single source of the sidenav's English
|
|
17
|
+
* copy. The `CNGX_SIDENAV_CONFIG` labels default to it.
|
|
18
|
+
*
|
|
19
|
+
* @category ui/sidenav/i18n
|
|
20
|
+
* @since 0.1.0
|
|
21
|
+
* @relatedTo CNGX_SIDENAV_CONFIG
|
|
22
|
+
*/
|
|
23
|
+
const CNGX_SIDENAV_LANGUAGE_EN = {
|
|
24
|
+
resizeHandle: 'Resize navigation',
|
|
25
|
+
resizeValueText: '{value}',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal Turns a sidenav section into the config labels for a locale. Pure. */
|
|
29
|
+
function sidenavLabelsFrom(section, locale) {
|
|
30
|
+
return {
|
|
31
|
+
resizeHandle: section.resizeHandle,
|
|
32
|
+
resizeValueText: (percent, value) => formatMessage(section.resizeValueText, { percent, value }, locale),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** @internal The sidenav section of the active pack over the English section. */
|
|
36
|
+
const injectSidenavLanguage = createLanguageSection('sidenav', CNGX_SIDENAV_LANGUAGE_EN);
|
|
37
|
+
/** @internal Builds and reads the section labels, formatted for the reading locale. */
|
|
38
|
+
const sidenavBundle = createSectionBundle({
|
|
39
|
+
section: injectSidenavLanguage,
|
|
40
|
+
toBundle: sidenavLabelsFrom,
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* @internal The sidenav labels of the active pack, formatted for the app
|
|
44
|
+
* locale. Private: consumers override copy through `withSidenavLabels`.
|
|
45
|
+
*/
|
|
46
|
+
const SIDENAV_SECTION_LABELS = new InjectionToken('CngxSidenavSectionLabels', { providedIn: 'root', factory: () => sidenavBundle.build() });
|
|
47
|
+
/**
|
|
48
|
+
* @internal The sidenav labels at the reading site: the active pack's section
|
|
49
|
+
* formatted for the locale of the reading injector. Injection context
|
|
50
|
+
* required.
|
|
51
|
+
*/
|
|
52
|
+
function injectSidenavSiteLabels() {
|
|
53
|
+
return sidenavBundle.resolve(inject(SIDENAV_SECTION_LABELS));
|
|
54
|
+
}
|
|
11
55
|
|
|
12
56
|
/**
|
|
13
57
|
* Library defaults for the sidenav configuration cascade. The values are
|
|
14
58
|
* byte-identical to the per-instance input defaults `CngxSidenav` shipped
|
|
15
59
|
* before the cascade (`width '280px'`, `miniWidth '56px'`, `minWidth '120px'`,
|
|
16
|
-
* `maxWidth '600px'`, `enterDelay 120`, `leaveDelay 0`; `
|
|
17
|
-
* `
|
|
18
|
-
* change.
|
|
60
|
+
* `maxWidth '600px'`, `enterDelay 120`, `leaveDelay 0`; `shortcut` omitted =
|
|
61
|
+
* `undefined`), so an un-configured consumer sees no change.
|
|
19
62
|
*
|
|
20
63
|
* The `leaveDelay 0` default is kept deliberately (instant collapse, asymmetric
|
|
21
64
|
* with the 120ms enter): the dwell becomes tunable via `[leaveDelay]` /
|
|
@@ -89,6 +132,21 @@ const CNGX_SIDENAV_CONFIG = new InjectionToken('CNGX_SIDENAV_CONFIG', {
|
|
|
89
132
|
function injectSidenavConfig() {
|
|
90
133
|
return inject(CNGX_SIDENAV_CONFIG);
|
|
91
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* The resolved sidenav labels in scope, as a Signal that follows a runtime
|
|
137
|
+
* language switch: the `sidenav` section of the active pack formatted for the
|
|
138
|
+
* locale of the reading injector, with the `CNGX_SIDENAV_CONFIG` labels on
|
|
139
|
+
* top. A key the config sets wins; a key it leaves unset, `null` or
|
|
140
|
+
* `undefined` reads the section. Runs in injection context; read it inside a
|
|
141
|
+
* `computed()`, a template or a handler.
|
|
142
|
+
*
|
|
143
|
+
* @category ui/sidenav
|
|
144
|
+
* @since 0.1.0
|
|
145
|
+
* @relatedTo withSidenavLabels
|
|
146
|
+
*/
|
|
147
|
+
function injectSidenavLabels() {
|
|
148
|
+
return createFilledOverrideMerge(injectSidenavSiteLabels(), injectSidenavConfig().labels);
|
|
149
|
+
}
|
|
92
150
|
|
|
93
151
|
/**
|
|
94
152
|
* Contract token for a sidenav rail. `CngxSidenav` provides it via
|
|
@@ -101,17 +159,25 @@ function injectSidenavConfig() {
|
|
|
101
159
|
*/
|
|
102
160
|
const CNGX_SIDENAV = new InjectionToken('CNGX_SIDENAV');
|
|
103
161
|
|
|
162
|
+
const PERCENT_FORMAT = { style: 'percent' };
|
|
104
163
|
/**
|
|
105
164
|
* Declarative sidebar component for the four drawer modes (`over`,
|
|
106
|
-
* `push`, `side`, `mini`)
|
|
165
|
+
* `push`, `side`, `mini`) plus an `auto` default, two-way
|
|
107
166
|
* `[(opened)]` binding, and content projection via header/footer
|
|
108
167
|
* slots.
|
|
109
168
|
*
|
|
169
|
+
* Responsive out of the box: `mode` defaults to `'auto'`, which docks the
|
|
170
|
+
* rail beside the content once the surrounding `CngxSidenavLayout` is
|
|
171
|
+
* `64rem` or wider and overlays it below that. Nothing needs to be bound.
|
|
172
|
+
* The threshold lives in `sidenav-layout.css` and nowhere else - a
|
|
173
|
+
* `@container` rule writes `--cngx-sidenav-layout-wide` on the rail and
|
|
174
|
+
* this component reads the resolved value, so ejecting the skin moves the
|
|
175
|
+
* breakpoint with it. Any explicit `mode` pins that mode at every width.
|
|
176
|
+
*
|
|
110
177
|
* In overlay (`over`) mode it drives a CDK focus trap directly via
|
|
111
178
|
* `FocusTrapFactory` (the same primitive `CngxFocusTrap` wraps): focus
|
|
112
179
|
* moves into the rail on open and is restored to the opener on close.
|
|
113
|
-
*
|
|
114
|
-
* shared backdrop and document scroll lock are coordinated by
|
|
180
|
+
* The shared backdrop and document scroll lock are coordinated by
|
|
115
181
|
* `CngxSidenavLayout`. It does not compose `CngxDrawer` and has no
|
|
116
182
|
* swipe-to-dismiss.
|
|
117
183
|
*
|
|
@@ -120,8 +186,7 @@ const CNGX_SIDENAV = new InjectionToken('CNGX_SIDENAV');
|
|
|
120
186
|
*
|
|
121
187
|
* ```html
|
|
122
188
|
* <cngx-sidenav-layout>
|
|
123
|
-
* <cngx-sidenav position="start" [(opened)]="navOpen"
|
|
124
|
-
* [responsive]="'(min-width: 1024px)'">
|
|
189
|
+
* <cngx-sidenav position="start" [(opened)]="navOpen">
|
|
125
190
|
* <cngx-sidenav-header>Logo</cngx-sidenav-header>
|
|
126
191
|
* <a cngxNavLink [active]="true">Dashboard</a>
|
|
127
192
|
* <cngx-sidenav-footer>v1.0</cngx-sidenav-footer>
|
|
@@ -138,14 +203,15 @@ const CNGX_SIDENAV = new InjectionToken('CNGX_SIDENAV');
|
|
|
138
203
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav.ts
|
|
139
204
|
* @since 0.1.0
|
|
140
205
|
* @relatedTo CngxSidenavLayout, CngxSidenavContent, CngxSidenavHeader, CngxSidenavFooter
|
|
206
|
+
* <example-url>http://localhost:4200/#/ui/sidenav/auto-mode</example-url>
|
|
141
207
|
* <example-url>http://localhost:4200/#/ui/sidenav/dual-sidebar-master-detail</example-url>
|
|
142
208
|
* <example-url>http://localhost:4200/#/ui/sidenav/full-navigation-sidebar</example-url>
|
|
143
209
|
* <example-url>http://localhost:4200/#/ui/sidenav/material-theming-light-vs-dark</example-url>
|
|
144
210
|
*/
|
|
145
211
|
class CngxSidenav {
|
|
146
212
|
/**
|
|
147
|
-
* Resolved sidenav configuration cascade. Seeds the dimension
|
|
148
|
-
*
|
|
213
|
+
* Resolved sidenav configuration cascade. Seeds the dimension and
|
|
214
|
+
* `shortcut` input defaults below so a per-instance binding still wins
|
|
149
215
|
* (Controlled+Uncontrolled), an app-wide `provideSidenavConfig(...)` moves the
|
|
150
216
|
* default, and an un-configured consumer keeps the byte-identical literals.
|
|
151
217
|
* Declared first so the input field initialisers can read it.
|
|
@@ -155,14 +221,12 @@ class CngxSidenav {
|
|
|
155
221
|
position = input('start', ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
156
222
|
/** Accessible label for the complementary landmark. */
|
|
157
223
|
ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
158
|
-
/** Drawer mode. Overridden by `responsive` when set. */
|
|
159
|
-
mode = input('over', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
160
224
|
/**
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
225
|
+
* Drawer mode. `'auto'` (the default) resolves to `'side'` once the
|
|
226
|
+
* surrounding layout is `64rem` or wider and to `'over'` below that; any
|
|
227
|
+
* other value pins that mode at every width.
|
|
164
228
|
*/
|
|
165
|
-
|
|
229
|
+
mode = input('auto', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
166
230
|
/** Width of the sidenav panel. Supports two-way `[(width)]` for resize. */
|
|
167
231
|
width = model(this.cfg.dimensions?.width ?? '280px', ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
168
232
|
/** Width of the collapsed rail in `mini` mode. Any CSS value. */
|
|
@@ -171,9 +235,27 @@ class CngxSidenav {
|
|
|
171
235
|
expandOnHover = input(true, ...(ngDevMode ? [{ debugName: "expandOnHover" }] : /* istanbul ignore next */ []));
|
|
172
236
|
/** Whether the sidebar is user-resizable via a drag handle. */
|
|
173
237
|
resizable = input(false, ...(ngDevMode ? [{ debugName: "resizable" }] : /* istanbul ignore next */ []));
|
|
174
|
-
/**
|
|
238
|
+
/**
|
|
239
|
+
* Accessible name of the resize separator. Unbound, the `resizeHandle` label
|
|
240
|
+
* (`withSidenavLabels`) applies; per-instance like `ariaLabel`, since it
|
|
241
|
+
* names this rail's handle.
|
|
242
|
+
*/
|
|
243
|
+
resizeLabel = input(undefined, ...(ngDevMode ? [{ debugName: "resizeLabel" }] : /* istanbul ignore next */ []));
|
|
244
|
+
labels = injectSidenavLabels();
|
|
245
|
+
locale = injectLocale();
|
|
246
|
+
/** @internal */
|
|
247
|
+
resolvedResizeLabel = computed(() => this.resizeLabel() ?? this.labels().resizeHandle, ...(ngDevMode ? [{ debugName: "resolvedResizeLabel" }] : /* istanbul ignore next */ []));
|
|
248
|
+
/**
|
|
249
|
+
* Minimum width constraint during resize. Use a px value: drag and keyboard
|
|
250
|
+
* clamping (and `aria-valuemin`) resolve px only; a rem/ch constraint falls
|
|
251
|
+
* back to the 120px default for clamping and omits the ARIA value.
|
|
252
|
+
*/
|
|
175
253
|
minWidth = input(this.cfg.dimensions?.minWidth ?? '120px', ...(ngDevMode ? [{ debugName: "minWidth" }] : /* istanbul ignore next */ []));
|
|
176
|
-
/**
|
|
254
|
+
/**
|
|
255
|
+
* Maximum width constraint during resize. Use a px value: drag and keyboard
|
|
256
|
+
* clamping (and `aria-valuemax`) resolve px only; a rem/ch constraint falls
|
|
257
|
+
* back to the 600px default for clamping and omits the ARIA value.
|
|
258
|
+
*/
|
|
177
259
|
maxWidth = input(this.cfg.dimensions?.maxWidth ?? '600px', ...(ngDevMode ? [{ debugName: "maxWidth" }] : /* istanbul ignore next */ []));
|
|
178
260
|
/**
|
|
179
261
|
* Keyboard shortcut to toggle the sidenav, e.g. `'ctrl+b'` or `'meta+b'`.
|
|
@@ -223,14 +305,29 @@ class CngxSidenav {
|
|
|
223
305
|
expanded = this.expandedState.asReadonly();
|
|
224
306
|
/** @internal Reference to host element for layout positioning. */
|
|
225
307
|
elementRef = inject((ElementRef));
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
/**
|
|
308
|
+
/** The layout's query container, absent when the rail is mounted standalone. */
|
|
309
|
+
container = inject(CNGX_CONTAINER_SIZE, { optional: true });
|
|
310
|
+
/**
|
|
311
|
+
* `'1'` while the layout is at or above the docking threshold, set by the
|
|
312
|
+
* `@container` rule in `sidenav-layout.css` on this rail. The rule styles
|
|
313
|
+
* the rail rather than the layout because a container query resolves
|
|
314
|
+
* against an *ancestor* container - a rule whose subject is the container
|
|
315
|
+
* itself would never match.
|
|
316
|
+
*
|
|
317
|
+
* Empty until the layout's first `ResizeObserver` entry arrives, so `auto`
|
|
318
|
+
* resolves to `over` for that first frame. The observer's initial callback
|
|
319
|
+
* runs after layout and before paint, so nothing flashes; do NOT seed this
|
|
320
|
+
* with a constructor-time `getComputedStyle`, which would read before the
|
|
321
|
+
* first layout and report `'0'` regardless of the real width.
|
|
322
|
+
*/
|
|
323
|
+
layoutWide = this.container?.property('--cngx-sidenav-layout-wide', this.elementRef.nativeElement) ?? signal('').asReadonly();
|
|
324
|
+
/** Resolved mode - `'auto'` derives from the layout width, anything else pins. */
|
|
229
325
|
effectiveMode = computed(() => {
|
|
230
|
-
|
|
231
|
-
|
|
326
|
+
const mode = this.mode();
|
|
327
|
+
if (mode !== 'auto') {
|
|
328
|
+
return mode;
|
|
232
329
|
}
|
|
233
|
-
return this.
|
|
330
|
+
return this.layoutWide() === '1' ? 'side' : 'over';
|
|
234
331
|
}, ...(ngDevMode ? [{ debugName: "effectiveMode" }] : /* istanbul ignore next */ []));
|
|
235
332
|
/** Whether this sidenav is in overlay mode (over). */
|
|
236
333
|
isOverlay = computed(() => this.effectiveMode() === 'over', ...(ngDevMode ? [{ debugName: "isOverlay" }] : /* istanbul ignore next */ []));
|
|
@@ -246,15 +343,13 @@ class CngxSidenav {
|
|
|
246
343
|
doc = inject(DOCUMENT);
|
|
247
344
|
win = this.doc.defaultView;
|
|
248
345
|
/**
|
|
249
|
-
* Current/previous effective-mode pair for transition detection.
|
|
250
|
-
* `createTransitionTracker`
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
346
|
+
* Current/previous effective-mode pair for transition detection. The shared
|
|
347
|
+
* `createTransitionTracker` is generic since it stopped being `AsyncStatus`-
|
|
348
|
+
* typed, so the hand-rolled `linkedSignal` twin this class used to carry is
|
|
349
|
+
* gone. `previous` seeds to `current` on the first run, which the consumer
|
|
350
|
+
* effect's equality guard already treats as "no transition".
|
|
254
351
|
*/
|
|
255
|
-
modeTransition =
|
|
256
|
-
computation: (current, prev) => ({ current, previous: prev?.value.current }),
|
|
257
|
-
equal: (a, b) => a.current === b.current && a.previous === b.previous });
|
|
352
|
+
modeTransition = createTransitionTracker(() => this.effectiveMode());
|
|
258
353
|
/** CDK focus trap over the host; enabled only while a modal overlay is open. */
|
|
259
354
|
focusTrap;
|
|
260
355
|
/** Element that held focus when the overlay opened, restored to it on close. */
|
|
@@ -269,6 +364,19 @@ class CngxSidenav {
|
|
|
269
364
|
resizeAbort = null;
|
|
270
365
|
constructor() {
|
|
271
366
|
this.focusTrap = inject(FocusTrapFactory).create(this.elementRef.nativeElement);
|
|
367
|
+
// Seed the separator's aria-valuenow for non-px rails: the attribute must
|
|
368
|
+
// exist before the first focus, and only layout can resolve a rem width.
|
|
369
|
+
afterNextRender(() => {
|
|
370
|
+
if (this.widthPx() === null) {
|
|
371
|
+
this.measureWidth();
|
|
372
|
+
}
|
|
373
|
+
if (typeof ngDevMode !== 'undefined' &&
|
|
374
|
+
ngDevMode &&
|
|
375
|
+
this.mode() === 'auto' &&
|
|
376
|
+
!this.container) {
|
|
377
|
+
console.warn('[cngx-sidenav] auto mode needs a <cngx-sidenav-layout> (or [cngxContainer]) ancestor; rendering as over.');
|
|
378
|
+
}
|
|
379
|
+
});
|
|
272
380
|
// Modal-overlay focus contract: on the open edge move focus into the rail
|
|
273
381
|
// and trap it; on the close edge restore focus to whatever opened it, after
|
|
274
382
|
// the DOM settles. overlayActive is the single tracked trigger; restoreTarget
|
|
@@ -280,7 +388,7 @@ class CngxSidenav {
|
|
|
280
388
|
this.focusTrap.enabled = active;
|
|
281
389
|
if (active && !wasOverlayActive) {
|
|
282
390
|
// Only pull focus into the rail when the open was user-initiated. An
|
|
283
|
-
// auto-open driven by
|
|
391
|
+
// auto-open driven by an auto-mode switch (container resize) engages
|
|
284
392
|
// the trap - the rail is now modal - but must not steal focus.
|
|
285
393
|
const viaAutoOpen = this.autoOpenInFlight;
|
|
286
394
|
this.autoOpenInFlight = false;
|
|
@@ -293,6 +401,16 @@ class CngxSidenav {
|
|
|
293
401
|
else if (!active && wasOverlayActive) {
|
|
294
402
|
const target = this.restoreTarget;
|
|
295
403
|
this.restoreTarget = null;
|
|
404
|
+
// Move focus out of the rail synchronously, before aria-hidden flips
|
|
405
|
+
// true in this same flush (host binding: !opened()). The queued restore
|
|
406
|
+
// alone would leave the trapped focus under aria-hidden for a microtask,
|
|
407
|
+
// which the browser blocks and warns about; the deferred restore still
|
|
408
|
+
// returns focus to the opener afterwards.
|
|
409
|
+
const activeEl = this.doc.activeElement;
|
|
410
|
+
const host = this.elementRef.nativeElement;
|
|
411
|
+
if (activeEl instanceof HTMLElement && host.contains(activeEl)) {
|
|
412
|
+
activeEl.blur();
|
|
413
|
+
}
|
|
296
414
|
queueMicrotask(() => target?.focus());
|
|
297
415
|
}
|
|
298
416
|
wasOverlayActive = active;
|
|
@@ -301,18 +419,6 @@ class CngxSidenav {
|
|
|
301
419
|
this.focusTrap.destroy();
|
|
302
420
|
this.resizeAbort?.abort();
|
|
303
421
|
});
|
|
304
|
-
effect((onCleanup) => {
|
|
305
|
-
const query = this.responsive();
|
|
306
|
-
const win = this.win;
|
|
307
|
-
if (!query || !win) {
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
const mql = win.matchMedia(query);
|
|
311
|
-
this.mediaMatches.set(mql.matches);
|
|
312
|
-
const handler = (e) => this.mediaMatches.set(e.matches);
|
|
313
|
-
mql.addEventListener('change', handler);
|
|
314
|
-
onCleanup(() => mql.removeEventListener('change', handler));
|
|
315
|
-
});
|
|
316
422
|
// Global hotkey: document listener inside effect(onCleanup) so the combo
|
|
317
423
|
// signal can re-register at runtime. Host listeners cannot rebind.
|
|
318
424
|
const isMac = this.win?.navigator?.userAgent?.includes('Mac') ?? false;
|
|
@@ -325,7 +431,11 @@ class CngxSidenav {
|
|
|
325
431
|
const handler = (e) => {
|
|
326
432
|
if (matchesKeyCombo(e, combo, isMac)) {
|
|
327
433
|
e.preventDefault();
|
|
328
|
-
|
|
434
|
+
// Through toggle(), not a raw opened flip: close() no-ops in the
|
|
435
|
+
// always-visible modes, so the hotkey cannot desync the model (and
|
|
436
|
+
// a router sync would not write ?nav=closed on a rail that stays
|
|
437
|
+
// visually open).
|
|
438
|
+
this.toggle();
|
|
329
439
|
}
|
|
330
440
|
};
|
|
331
441
|
this.doc.addEventListener('keydown', handler);
|
|
@@ -336,8 +446,9 @@ class CngxSidenav {
|
|
|
336
446
|
// overlay mode auto-opens the rail once. Guarded by the current/previous
|
|
337
447
|
// compare so it fires only on the transition edge.
|
|
338
448
|
effect(() => {
|
|
339
|
-
const
|
|
340
|
-
|
|
449
|
+
const current = this.modeTransition.current();
|
|
450
|
+
const previous = this.modeTransition.previous();
|
|
451
|
+
if (current === previous) {
|
|
341
452
|
return;
|
|
342
453
|
}
|
|
343
454
|
const alwaysVisible = (m) => m === 'side' || m === 'mini';
|
|
@@ -396,13 +507,89 @@ class CngxSidenav {
|
|
|
396
507
|
collapse() {
|
|
397
508
|
this.expandedState.set(false);
|
|
398
509
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
510
|
+
// px-strict: a rem/ch width must not leak a lying aria-valuenow (parseInt
|
|
511
|
+
// on '17.5rem' is 17, below the min). Null omits the attribute instead.
|
|
512
|
+
/** @internal Numeric px of the current width, or null for non-px units. */
|
|
513
|
+
widthPx = computed(() => parsePx(this.width()), ...(ngDevMode ? [{ debugName: "widthPx" }] : /* istanbul ignore next */ []));
|
|
514
|
+
minWidthPx = computed(() => parsePx(this.minWidth()), ...(ngDevMode ? [{ debugName: "minWidthPx" }] : /* istanbul ignore next */ []));
|
|
515
|
+
maxWidthPx = computed(() => parsePx(this.maxWidth()), ...(ngDevMode ? [{ debugName: "maxWidthPx" }] : /* istanbul ignore next */ []));
|
|
516
|
+
/**
|
|
517
|
+
* Rect-measured width for non-px rails: seeded after first render (a
|
|
518
|
+
* focusable separator must expose `aria-valuenow` before it is ever
|
|
519
|
+
* focused) and refreshed each time the separator gains focus, so the value
|
|
520
|
+
* AT reads at interaction time is current.
|
|
521
|
+
*/
|
|
522
|
+
measuredWidthPx = signal(null, ...(ngDevMode ? [{ debugName: "measuredWidthPx" }] : /* istanbul ignore next */ []));
|
|
523
|
+
/**
|
|
524
|
+
* @internal `aria-valuenow` of the separator: the px width when parseable,
|
|
525
|
+
* else the rect measurement - the window-splitter pattern wants a valuenow
|
|
526
|
+
* on a focusable separator even for rem-sized rails.
|
|
527
|
+
*/
|
|
528
|
+
widthValueNow = computed(() => this.widthPx() ?? this.measuredWidthPx(), ...(ngDevMode ? [{ debugName: "widthValueNow" }] : /* istanbul ignore next */ []));
|
|
529
|
+
/**
|
|
530
|
+
* @internal `aria-valuetext` of the separator: its position as a percent of
|
|
531
|
+
* the min-max range, formatted in the locale, so AT speaks where the handle
|
|
532
|
+
* sits instead of a bare pixel count. `null` (AT reads `aria-valuenow`) while
|
|
533
|
+
* the width or a bound is not in px.
|
|
534
|
+
*/
|
|
535
|
+
widthValueText = computed(() => {
|
|
536
|
+
const width = this.widthValueNow();
|
|
537
|
+
const min = this.minWidthPx();
|
|
538
|
+
const max = this.maxWidthPx();
|
|
539
|
+
if (width === null || min === null || max === null || max <= min) {
|
|
540
|
+
return null;
|
|
541
|
+
}
|
|
542
|
+
const percent = Math.round(clamp((width - min) / (max - min), 0, 1) * 100);
|
|
543
|
+
const formatted = numberFormatterFor(this.locale(), PERCENT_FORMAT).format(percent / 100);
|
|
544
|
+
return this.labels().resizeValueText(percent, formatted);
|
|
545
|
+
}, ...(ngDevMode ? [{ debugName: "widthValueText" }] : /* istanbul ignore next */ []));
|
|
546
|
+
measureWidth() {
|
|
547
|
+
const el = this.elementRef.nativeElement;
|
|
548
|
+
this.measuredWidthPx.set(Math.round(el.getBoundingClientRect().width) || null);
|
|
549
|
+
}
|
|
550
|
+
/** @internal Refresh the measurement the moment AT is about to read it. */
|
|
551
|
+
handleResizeFocus() {
|
|
552
|
+
this.measureWidth();
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* @internal Arrow-key resize on the separator, so the handle is operable
|
|
556
|
+
* without a pointer (WCAG 2.1.1): arrows step by 16px (direction-aware for
|
|
557
|
+
* `position="end"`), Home/End jump to the min/max constraint. Any modified
|
|
558
|
+
* key (shift included) passes through untouched - browser and AT shortcuts
|
|
559
|
+
* stay theirs.
|
|
560
|
+
*/
|
|
561
|
+
handleResizeKeydown(event) {
|
|
562
|
+
if (!this.resizable() || event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) {
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
const el = this.elementRef.nativeElement;
|
|
566
|
+
const current = el.getBoundingClientRect().width;
|
|
567
|
+
const min = this.minWidthPx() ?? 120;
|
|
568
|
+
const max = this.maxWidthPx() ?? 600;
|
|
569
|
+
const isEnd = this.position() === 'end';
|
|
570
|
+
let target;
|
|
571
|
+
switch (event.key) {
|
|
572
|
+
case 'ArrowRight':
|
|
573
|
+
target = current + (isEnd ? -RESIZE_KEY_STEP : RESIZE_KEY_STEP);
|
|
574
|
+
break;
|
|
575
|
+
case 'ArrowLeft':
|
|
576
|
+
target = current + (isEnd ? RESIZE_KEY_STEP : -RESIZE_KEY_STEP);
|
|
577
|
+
break;
|
|
578
|
+
case 'Home':
|
|
579
|
+
target = min;
|
|
580
|
+
break;
|
|
581
|
+
case 'End':
|
|
582
|
+
target = max;
|
|
583
|
+
break;
|
|
584
|
+
default:
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
event.preventDefault();
|
|
588
|
+
this.width.set(`${Math.round(Math.max(min, Math.min(max, target)))}px`);
|
|
589
|
+
}
|
|
403
590
|
/** @internal */
|
|
404
591
|
handleResizeStart(e) {
|
|
405
|
-
if (!this.resizable()) {
|
|
592
|
+
if (!this.resizable() || this.effectiveMode() === 'mini') {
|
|
406
593
|
return;
|
|
407
594
|
}
|
|
408
595
|
e.preventDefault();
|
|
@@ -412,8 +599,8 @@ class CngxSidenav {
|
|
|
412
599
|
const el = this.elementRef.nativeElement;
|
|
413
600
|
const startWidth = el.getBoundingClientRect().width;
|
|
414
601
|
const isEnd = this.position() === 'end';
|
|
415
|
-
const min = this.minWidthPx();
|
|
416
|
-
const max = this.maxWidthPx();
|
|
602
|
+
const min = this.minWidthPx() ?? 120;
|
|
603
|
+
const max = this.maxWidthPx() ?? 600;
|
|
417
604
|
let currentWidth = startWidth;
|
|
418
605
|
let rafId = 0;
|
|
419
606
|
// One controller per drag removes both document listeners in a single abort:
|
|
@@ -444,7 +631,7 @@ class CngxSidenav {
|
|
|
444
631
|
this.doc.addEventListener('pointerup', onUp, { signal: controller.signal });
|
|
445
632
|
}
|
|
446
633
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxSidenav, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
447
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxSidenav, isStandalone: true, selector: "cngx-sidenav", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null },
|
|
634
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxSidenav, isStandalone: true, selector: "cngx-sidenav", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, miniWidth: { classPropertyName: "miniWidth", publicName: "miniWidth", isSignal: true, isRequired: false, transformFunction: null }, expandOnHover: { classPropertyName: "expandOnHover", publicName: "expandOnHover", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, resizeLabel: { classPropertyName: "resizeLabel", publicName: "resizeLabel", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, shortcut: { classPropertyName: "shortcut", publicName: "shortcut", isSignal: true, isRequired: false, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { width: "widthChange", opened: "openedChange" }, host: { attributes: { "role": "complementary" }, listeners: { "keydown.escape": "closeIfOverlay()" }, properties: { "class.cngx-sidenav": "true", "class.cngx-sidenav--start": "position() === 'start'", "class.cngx-sidenav--end": "position() === 'end'", "class.cngx-sidenav--open": "opened()", "class.cngx-sidenav--over": "effectiveMode() === 'over'", "class.cngx-sidenav--push": "effectiveMode() === 'push'", "class.cngx-sidenav--side": "effectiveMode() === 'side'", "class.cngx-sidenav--mini": "effectiveMode() === 'mini'", "class.cngx-sidenav--expanded": "expanded()", "class.cngx-sidenav--resizable": "resizable()", "class.cngx-sidenav--resizing": "resizing()", "attr.aria-hidden": "effectiveMode() === 'side' || effectiveMode() === 'mini' ? null : !opened()", "attr.aria-modal": "overlayActive() ? 'true' : null", "style.--cngx-sidenav-width": "effectiveWidth()", "style.--cngx-sidenav-mini-width": "miniWidth()", "attr.aria-label": "ariaLabel() || null" } }, providers: [
|
|
448
635
|
{ provide: CNGX_HOVER_INTENT_DEFAULTS, useFactory: () => injectSidenavConfig().hover ?? {} },
|
|
449
636
|
{ provide: CNGX_SIDENAV, useExisting: CngxSidenav },
|
|
450
637
|
], exportAs: ["cngxSidenav"], hostDirectives: [{ directive: i1.CngxHoverIntent, inputs: ["enterDelay", "expandDelay", "leaveDelay", "collapseDelay"] }], ngImport: i0, template: `
|
|
@@ -453,18 +640,25 @@ class CngxSidenav {
|
|
|
453
640
|
<ng-content />
|
|
454
641
|
</div>
|
|
455
642
|
<ng-content select="cngx-sidenav-footer, [cngxSidenavFooter]" />
|
|
456
|
-
|
|
643
|
+
<!-- No handle in mini mode: the collapsed rail has a fixed width, and a
|
|
644
|
+
drag there would leave a stale inline width var on the rail. -->
|
|
645
|
+
@if (resizable() && effectiveMode() !== 'mini') {
|
|
457
646
|
<div
|
|
458
647
|
class="cngx-sidenav__resize-handle"
|
|
459
648
|
(pointerdown)="handleResizeStart($event)"
|
|
649
|
+
(keydown)="handleResizeKeydown($event)"
|
|
650
|
+
(focus)="handleResizeFocus()"
|
|
460
651
|
role="separator"
|
|
652
|
+
tabindex="0"
|
|
653
|
+
[attr.aria-label]="resolvedResizeLabel()"
|
|
461
654
|
[attr.aria-orientation]="'vertical'"
|
|
462
|
-
[attr.aria-valuenow]="
|
|
655
|
+
[attr.aria-valuenow]="widthValueNow()"
|
|
656
|
+
[attr.aria-valuetext]="widthValueText()"
|
|
463
657
|
[attr.aria-valuemin]="minWidthPx()"
|
|
464
658
|
[attr.aria-valuemax]="maxWidthPx()"
|
|
465
659
|
></div>
|
|
466
660
|
}
|
|
467
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-sidenav-width{syntax: \"<length>\"; inherits: true; initial-value: 280px;}@property --cngx-sidenav-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .005 250);}@property --cngx-sidenav-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-sidenav-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .25s;}@property --cngx-sidenav-transition-easing{syntax: \"*\"; inherits: false; initial-value: ease;}@property --cngx-sidenav-mini-width{syntax: \"<length>\"; inherits: true; initial-value: 56px;}@property --cngx-sidenav-expanded-shadow{syntax: \"*\"; inherits: true; initial-value: 4px 0 12px oklch(0 0 0 / .1);}@property --cngx-sidenav-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --cngx-sidenav-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.89 0 0);}@property --cngx-sidenav-padding{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-sidenav-header-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-sidenav-header-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-sidenav-footer-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-sidenav-footer-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.89 0 0);}@property --cngx-sidenav-footer-font-size{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-sidenav-resize-handle-width{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-sidenav-resize-handle-color{syntax: \"<color>\"; inherits: false; initial-value: oklch(.66 .19 50);}@property --cngx-sidenav-backdrop-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(0 0 0);}@property --cngx-sidenav-backdrop-opacity{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --cngx-nav-link-padding{syntax: \"*\"; inherits: true; initial-value: 10px 16px;}@property --cngx-nav-link-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-nav-link-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-nav-link-hover-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-hover-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(0 0 0 / .04);}@property --cngx-nav-link-active-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-active-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(0 0 0 / .08);}@property --cngx-nav-link-active-font-weight{syntax: \"<number>\"; inherits: false; initial-value: 600;}@property --cngx-nav-link-focus-outline-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-nav-link-focus-outline-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-nav-link-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: -2px;}@property --cngx-nav-link-initial-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}:root{--cngx-sidenav-bg: var(--cngx-color-surface, oklch(.97 .005 250));--cngx-sidenav-border-color: var(--cngx-color-border, oklch(.89 0 0));--cngx-sidenav-footer-border-color: var(--cngx-color-border, oklch(.89 0 0));--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .1);--cngx-nav-link-hover-bg: oklch(0 0 0 / .04);--cngx-nav-link-active-bg: oklch(0 0 0 / .08);--cngx-nav-link-focus-outline-color: var(--cngx-color-primary, oklch(.66 .19 50))}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .45);--cngx-nav-link-hover-bg: oklch(1 0 0 / .06);--cngx-nav-link-active-bg: oklch(1 0 0 / .1)}}:root[data-color-scheme=dark],:root.dark{--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .45);--cngx-nav-link-hover-bg: oklch(1 0 0 / .06);--cngx-nav-link-active-bg: oklch(1 0 0 / .1)}:root[data-color-scheme=light],:root.light{--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .1);--cngx-nav-link-hover-bg: oklch(0 0 0 / .04);--cngx-nav-link-active-bg: oklch(0 0 0 / .08)}}@layer cngx.components{cngx-sidenav{--cngx-sidenav-padding: var(--cngx-space-md);--cngx-nav-link-padding: var(--cngx-space-sm) var(--cngx-space-md);display:flex;flex-direction:column;flex-shrink:0;overflow:hidden;z-index:2;width:var(--cngx-sidenav-width, 280px);background:var(--cngx-sidenav-bg, oklch(.97 .005 250));color:var(--cngx-sidenav-color, inherit);transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s var(--cngx-sidenav-transition-duration, .25s)}cngx-sidenav:not(.cngx-sidenav--open):not(.cngx-sidenav--side):not(.cngx-sidenav--mini):not(.cngx-sidenav--over){width:0;visibility:hidden}cngx-sidenav.cngx-sidenav--open{visibility:visible;transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s 0s}cngx-sidenav.cngx-sidenav--side.cngx-sidenav--open{visibility:visible}cngx-sidenav.cngx-sidenav--over{position:absolute;top:0;bottom:0;width:var(--cngx-sidenav-width, 280px);visibility:hidden;transition:transform var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s var(--cngx-sidenav-transition-duration, .25s)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--start{inset-inline-start:0;transform:translate(-100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--end{inset-inline-end:0;transform:translate(100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--start:not(.cngx-sidenav--open):dir(rtl){transform:translate(100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--end:not(.cngx-sidenav--open):dir(rtl){transform:translate(-100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--open{transform:translate(0);visibility:visible;transition:transform var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s 0s}cngx-sidenav.cngx-sidenav--push,cngx-sidenav.cngx-sidenav--side,cngx-sidenav.cngx-sidenav--mini{position:relative}cngx-sidenav.cngx-sidenav--mini{width:var(--cngx-sidenav-mini-width, 56px);visibility:visible;transition:none}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded{width:var(--cngx-sidenav-width, 280px);z-index:3;box-shadow:var(--cngx-sidenav-expanded-shadow, 4px 0 12px oklch(0 0 0 / .1));transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),margin var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease)}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded.cngx-sidenav--start{margin-inline-end:calc(var(--cngx-sidenav-mini-width, 56px) - var(--cngx-sidenav-width, 280px))}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded.cngx-sidenav--end{margin-inline-start:calc(var(--cngx-sidenav-mini-width, 56px) - var(--cngx-sidenav-width, 280px))}cngx-sidenav.cngx-sidenav--start{border-inline-end:var(--cngx-sidenav-border-width, 1px) solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)))}cngx-sidenav.cngx-sidenav--end{border-inline-start:var(--cngx-sidenav-border-width, 1px) solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)));order:2}.cngx-sidenav__body{flex:1;overflow-y:auto;overflow-x:hidden;min-width:var(--cngx-sidenav-width, 280px);scrollbar-gutter:stable}.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav__body{min-width:var(--cngx-sidenav-mini-width, 56px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav-header,cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav-footer{overflow:hidden;white-space:nowrap;text-overflow:clip;text-align:center;padding:8px 4px}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavLabel],cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavGroup]{display:none!important}.cngx-sidenav-header{flex-shrink:0;padding:var(--cngx-sidenav-padding, 16px);background:var(--cngx-sidenav-header-bg, transparent);border-bottom:1px solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)));font-weight:600;font-size:var(--cngx-sidenav-header-font-size, .875rem)}.cngx-sidenav-footer{flex-shrink:0;margin-top:auto;padding:var(--cngx-sidenav-padding, 16px);background:var(--cngx-sidenav-footer-bg, transparent);border-top:1px solid var( --cngx-sidenav-footer-border-color, var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0))) );font-size:var(--cngx-sidenav-footer-font-size, .75rem);opacity:.7}cngx-sidenav .cngx-nav-link{display:block;padding:var(--cngx-nav-link-padding, 10px 16px);text-decoration:none;font-size:var(--cngx-nav-link-font-size, .875rem);color:var(--cngx-nav-link-color, currentColor);border-radius:var(--cngx-nav-link-radius, 4px);transition:background .15s,color .15s}cngx-sidenav .cngx-nav-link:hover{color:var(--cngx-nav-link-hover-color, currentColor);background:var(--cngx-nav-link-hover-bg, oklch(0 0 0 / .04))}cngx-sidenav .cngx-nav-link--active{color:var(--cngx-nav-link-active-color, currentColor);background:var(--cngx-nav-link-active-bg, oklch(0 0 0 / .08));font-weight:var(--cngx-nav-link-active-font-weight, 600)}cngx-sidenav .cngx-nav-link:focus-visible{outline:var(--cngx-nav-link-focus-outline-width, 2px) solid var(--cngx-nav-link-focus-outline-color, oklch(.66 .19 50));outline-offset:var(--cngx-nav-link-focus-outline-offset, -2px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-nav-link{overflow:hidden;text-align:center;font-size:0!important;line-height:1;padding:var(--cngx-nav-link-padding, 10px 8px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-nav-link[data-initial]:before{content:attr(data-initial);font-size:var(--cngx-nav-link-initial-size, .875rem);font-weight:600;display:inline-block;width:var(--cngx-nav-link-initial-size, .875rem);text-align:center;line-height:1.6}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavBadge]{display:none}.cngx-nav-group-content{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--cngx-sidenav-transition-duration, .2s) ease}.cngx-nav-group-content>*{overflow:hidden;min-height:0}.cngx-nav-group-content--open{grid-template-rows:1fr}.cngx-sidenav__resize-handle{position:absolute;top:0;bottom:0;width:var(--cngx-sidenav-resize-handle-width, 4px);cursor:col-resize;z-index:4;background:transparent;transition:background .15s;touch-action:none}.cngx-sidenav--start .cngx-sidenav__resize-handle{inset-inline-end:0;transform:translate(50%)}.cngx-sidenav--end .cngx-sidenav__resize-handle{inset-inline-start:0;transform:translate(-50%)}.cngx-sidenav--start:dir(rtl) .cngx-sidenav__resize-handle{transform:translate(-50%)}.cngx-sidenav--end:dir(rtl) .cngx-sidenav__resize-handle{transform:translate(50%)}.cngx-sidenav__resize-handle:hover,.cngx-sidenav--resizing .cngx-sidenav__resize-handle{background:var( --cngx-sidenav-resize-handle-color, var(--cngx-color-primary, oklch(.66 .19 50)) )}cngx-sidenav.cngx-sidenav--resizing{transition:none!important;-webkit-user-select:none;user-select:none}}@media(forced-colors:active){cngx-sidenav .cngx-nav-link--active{forced-color-adjust:none;background:Highlight;color:HighlightText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
661
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-sidenav-width{syntax: \"<length>\"; inherits: true; initial-value: 280px;}@property --cngx-sidenav-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .005 250);}@property --cngx-sidenav-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-sidenav-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .25s;}:where(cngx-sidenav,cngx-sidenav *){--cngx-sidenav-transition-duration: var(--cngx-duration-base)}@property --cngx-sidenav-transition-easing{syntax: \"*\"; inherits: false; initial-value: ease;}@property --cngx-sidenav-mini-width{syntax: \"<length>\"; inherits: true; initial-value: 56px;}@property --cngx-sidenav-expanded-shadow{syntax: \"*\"; inherits: true; initial-value: 4px 0 12px oklch(0 0 0 / .1);}@property --cngx-sidenav-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --cngx-sidenav-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.89 0 0);}@property --cngx-sidenav-padding{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-sidenav-header-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-sidenav-header-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-sidenav-footer-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-sidenav-footer-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.89 0 0);}@property --cngx-sidenav-footer-font-size{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-sidenav-resize-handle-width{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-sidenav-resize-handle-color{syntax: \"<color>\"; inherits: false; initial-value: oklch(.66 .19 50);}@property --cngx-sidenav-resize-handle-focus-outline-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-sidenav-resize-handle-focus-outline-color{syntax: \"<color>\"; inherits: false; initial-value: oklch(.66 .19 50);}@property --cngx-sidenav-resize-handle-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-sidenav-backdrop-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(0 0 0);}@property --cngx-sidenav-backdrop-opacity{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --cngx-nav-link-padding{syntax: \"*\"; inherits: true; initial-value: 10px 16px;}@property --cngx-nav-link-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-nav-link-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-nav-link-hover-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-hover-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(0 0 0 / .04);}@property --cngx-nav-link-active-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-active-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(0 0 0 / .08);}@property --cngx-nav-link-active-font-weight{syntax: \"<number>\"; inherits: false; initial-value: 600;}@property --cngx-nav-link-focus-outline-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-nav-link-focus-outline-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-nav-link-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: -2px;}@property --cngx-nav-link-initial-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}:root{--cngx-sidenav-bg: var(--cngx-color-surface, oklch(.97 .005 250));--cngx-sidenav-border-color: var(--cngx-color-border, oklch(.89 0 0));--cngx-sidenav-footer-border-color: var(--cngx-color-border, oklch(.89 0 0));--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .1);--cngx-nav-link-hover-bg: oklch(0 0 0 / .04);--cngx-nav-link-active-bg: oklch(0 0 0 / .08);--cngx-nav-link-focus-outline-color: var(--cngx-color-primary, oklch(.66 .19 50))}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .45);--cngx-nav-link-hover-bg: oklch(1 0 0 / .06);--cngx-nav-link-active-bg: oklch(1 0 0 / .1)}}:root[data-color-scheme=dark],:root.dark{--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .45);--cngx-nav-link-hover-bg: oklch(1 0 0 / .06);--cngx-nav-link-active-bg: oklch(1 0 0 / .1)}:root[data-color-scheme=light],:root.light{--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .1);--cngx-nav-link-hover-bg: oklch(0 0 0 / .04);--cngx-nav-link-active-bg: oklch(0 0 0 / .08)}}@layer cngx.components{cngx-sidenav{--cngx-sidenav-padding: var(--cngx-space-md);--cngx-nav-link-padding: var(--cngx-space-sm) var(--cngx-space-md);display:flex;flex-direction:column;flex-shrink:0;overflow:hidden;z-index:2;width:var(--cngx-sidenav-width, 280px);background:var(--cngx-sidenav-bg, oklch(.97 .005 250));color:var(--cngx-sidenav-color, inherit);transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s var(--cngx-sidenav-transition-duration, .25s)}cngx-sidenav:not(.cngx-sidenav--open):not(.cngx-sidenav--side):not(.cngx-sidenav--mini):not(.cngx-sidenav--over){width:0;visibility:hidden}cngx-sidenav.cngx-sidenav--open{visibility:visible;transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s 0s}cngx-sidenav.cngx-sidenav--side.cngx-sidenav--open{visibility:visible}cngx-sidenav.cngx-sidenav--over{position:absolute;top:0;bottom:0;width:var(--cngx-sidenav-width, 280px);visibility:hidden;transition:transform var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s var(--cngx-sidenav-transition-duration, .25s)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--start{inset-inline-start:0;transform:translate(-100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--end{inset-inline-end:0;transform:translate(100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--start:not(.cngx-sidenav--open):dir(rtl){transform:translate(100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--end:not(.cngx-sidenav--open):dir(rtl){transform:translate(-100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--open{transform:translate(0);visibility:visible;transition:transform var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s 0s}cngx-sidenav.cngx-sidenav--push,cngx-sidenav.cngx-sidenav--side,cngx-sidenav.cngx-sidenav--mini{position:relative}cngx-sidenav.cngx-sidenav--mini{width:var(--cngx-sidenav-mini-width, 56px);visibility:visible;transition:none}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded{width:var(--cngx-sidenav-width, 280px);z-index:3;box-shadow:var(--cngx-sidenav-expanded-shadow, 4px 0 12px oklch(0 0 0 / .1));transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),margin var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease)}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded.cngx-sidenav--start{margin-inline-end:calc(var(--cngx-sidenav-mini-width, 56px) - var(--cngx-sidenav-width, 280px))}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded.cngx-sidenav--end{margin-inline-start:calc(var(--cngx-sidenav-mini-width, 56px) - var(--cngx-sidenav-width, 280px))}cngx-sidenav.cngx-sidenav--start{border-inline-end:var(--cngx-sidenav-border-width, 1px) solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)))}cngx-sidenav.cngx-sidenav--end{border-inline-start:var(--cngx-sidenav-border-width, 1px) solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)));order:2}.cngx-sidenav__body{flex:1;overflow-y:auto;overflow-x:hidden;min-width:var(--cngx-sidenav-width, 280px);scrollbar-gutter:stable}.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav__body{min-width:var(--cngx-sidenav-mini-width, 56px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav-header,cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav-footer{overflow:hidden;white-space:nowrap;text-overflow:clip;text-align:center;padding:8px 4px}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavLabel],cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavGroup]{display:none!important}.cngx-sidenav-header{flex-shrink:0;padding:var(--cngx-sidenav-padding, 16px);background:var(--cngx-sidenav-header-bg, transparent);border-bottom:1px solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)));font-weight:600;font-size:var(--cngx-sidenav-header-font-size, .875rem)}.cngx-sidenav-footer{flex-shrink:0;margin-top:auto;padding:var(--cngx-sidenav-padding, 16px);background:var(--cngx-sidenav-footer-bg, transparent);border-top:1px solid var( --cngx-sidenav-footer-border-color, var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0))) );font-size:var(--cngx-sidenav-footer-font-size, .75rem);color:var(--cngx-color-text-muted, oklch(.5 .01 250))}cngx-sidenav .cngx-nav-link{display:block;padding:var(--cngx-nav-link-padding, 10px 16px);text-decoration:none;font-size:var(--cngx-nav-link-font-size, .875rem);color:var(--cngx-nav-link-color, currentColor);border-radius:var(--cngx-nav-link-radius, 4px);transition:background var(--cngx-duration-fast, .15s),color var(--cngx-duration-fast, .15s)}cngx-sidenav .cngx-nav-link:hover{color:var(--cngx-nav-link-hover-color, currentColor);background:var(--cngx-nav-link-hover-bg, oklch(0 0 0 / .04))}cngx-sidenav .cngx-nav-link--active{color:var(--cngx-nav-link-active-color, currentColor);background:var(--cngx-nav-link-active-bg, oklch(0 0 0 / .08));font-weight:var(--cngx-nav-link-active-font-weight, 600)}cngx-sidenav .cngx-nav-link:focus-visible{outline:var(--cngx-nav-link-focus-outline-width, 2px) solid var(--cngx-nav-link-focus-outline-color, oklch(.66 .19 50));outline-offset:var(--cngx-nav-link-focus-outline-offset, -2px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-nav-link{overflow:hidden;text-align:center;font-size:0!important;line-height:1;padding:var(--cngx-nav-link-padding, 10px 8px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-nav-link[data-initial]:before{content:attr(data-initial) / \"\";font-size:var(--cngx-nav-link-initial-size, .875rem);font-weight:600;display:inline-block;width:var(--cngx-nav-link-initial-size, .875rem);text-align:center;line-height:1.6}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavBadge]{display:none}.cngx-nav-group-content{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--cngx-sidenav-transition-duration, .2s) ease}.cngx-nav-group-content>*{overflow:hidden;min-height:0}.cngx-nav-group-content--open{grid-template-rows:1fr}.cngx-sidenav__resize-handle{--cngx-sidenav-resize-handle-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-sidenav-resize-handle-focus-outline-color: var( --cngx-color-primary, oklch(.66 .19 50) );position:absolute;top:0;bottom:0;width:var(--cngx-sidenav-resize-handle-width, 4px);cursor:col-resize;z-index:4;background:transparent;transition:background var(--cngx-duration-fast, .15s);touch-action:none}.cngx-sidenav__resize-handle:before{content:\"\";position:absolute;top:0;bottom:0;left:50%;transform:translate(-50%);width:max(var(--cngx-sidenav-resize-handle-width, 4px),var(--cngx-target-min, 0px))}.cngx-sidenav--start .cngx-sidenav__resize-handle{inset-inline-end:0;transform:translate(50%)}.cngx-sidenav--end .cngx-sidenav__resize-handle{inset-inline-start:0;transform:translate(-50%)}.cngx-sidenav--start:dir(rtl) .cngx-sidenav__resize-handle{transform:translate(-50%)}.cngx-sidenav--end:dir(rtl) .cngx-sidenav__resize-handle{transform:translate(50%)}.cngx-sidenav__resize-handle:hover,.cngx-sidenav--resizing .cngx-sidenav__resize-handle{background:var( --cngx-sidenav-resize-handle-color, var(--cngx-color-primary, oklch(.66 .19 50)) )}.cngx-sidenav__resize-handle:focus-visible{background:var( --cngx-sidenav-resize-handle-color, var(--cngx-color-primary, oklch(.66 .19 50)) );outline:var(--cngx-sidenav-resize-handle-focus-outline-width, 2px) solid var( --cngx-sidenav-resize-handle-focus-outline-color, var(--cngx-color-primary, oklch(.66 .19 50)) );outline-offset:var(--cngx-sidenav-resize-handle-focus-outline-offset, 2px)}cngx-sidenav.cngx-sidenav--resizing{transition:none!important;-webkit-user-select:none;user-select:none}}@media(forced-colors:active){cngx-sidenav .cngx-nav-link--active{forced-color-adjust:none;background:Highlight;color:HighlightText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
468
662
|
}
|
|
469
663
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxSidenav, decorators: [{
|
|
470
664
|
type: Component,
|
|
@@ -501,19 +695,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
501
695
|
<ng-content />
|
|
502
696
|
</div>
|
|
503
697
|
<ng-content select="cngx-sidenav-footer, [cngxSidenavFooter]" />
|
|
504
|
-
|
|
698
|
+
<!-- No handle in mini mode: the collapsed rail has a fixed width, and a
|
|
699
|
+
drag there would leave a stale inline width var on the rail. -->
|
|
700
|
+
@if (resizable() && effectiveMode() !== 'mini') {
|
|
505
701
|
<div
|
|
506
702
|
class="cngx-sidenav__resize-handle"
|
|
507
703
|
(pointerdown)="handleResizeStart($event)"
|
|
704
|
+
(keydown)="handleResizeKeydown($event)"
|
|
705
|
+
(focus)="handleResizeFocus()"
|
|
508
706
|
role="separator"
|
|
707
|
+
tabindex="0"
|
|
708
|
+
[attr.aria-label]="resolvedResizeLabel()"
|
|
509
709
|
[attr.aria-orientation]="'vertical'"
|
|
510
|
-
[attr.aria-valuenow]="
|
|
710
|
+
[attr.aria-valuenow]="widthValueNow()"
|
|
711
|
+
[attr.aria-valuetext]="widthValueText()"
|
|
511
712
|
[attr.aria-valuemin]="minWidthPx()"
|
|
512
713
|
[attr.aria-valuemax]="maxWidthPx()"
|
|
513
714
|
></div>
|
|
514
715
|
}
|
|
515
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-sidenav-width{syntax: \"<length>\"; inherits: true; initial-value: 280px;}@property --cngx-sidenav-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .005 250);}@property --cngx-sidenav-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-sidenav-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .25s;}@property --cngx-sidenav-transition-easing{syntax: \"*\"; inherits: false; initial-value: ease;}@property --cngx-sidenav-mini-width{syntax: \"<length>\"; inherits: true; initial-value: 56px;}@property --cngx-sidenav-expanded-shadow{syntax: \"*\"; inherits: true; initial-value: 4px 0 12px oklch(0 0 0 / .1);}@property --cngx-sidenav-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --cngx-sidenav-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.89 0 0);}@property --cngx-sidenav-padding{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-sidenav-header-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-sidenav-header-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-sidenav-footer-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-sidenav-footer-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.89 0 0);}@property --cngx-sidenav-footer-font-size{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-sidenav-resize-handle-width{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-sidenav-resize-handle-color{syntax: \"<color>\"; inherits: false; initial-value: oklch(.66 .19 50);}@property --cngx-sidenav-backdrop-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(0 0 0);}@property --cngx-sidenav-backdrop-opacity{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --cngx-nav-link-padding{syntax: \"*\"; inherits: true; initial-value: 10px 16px;}@property --cngx-nav-link-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-nav-link-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-nav-link-hover-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-hover-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(0 0 0 / .04);}@property --cngx-nav-link-active-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-active-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(0 0 0 / .08);}@property --cngx-nav-link-active-font-weight{syntax: \"<number>\"; inherits: false; initial-value: 600;}@property --cngx-nav-link-focus-outline-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-nav-link-focus-outline-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-nav-link-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: -2px;}@property --cngx-nav-link-initial-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}:root{--cngx-sidenav-bg: var(--cngx-color-surface, oklch(.97 .005 250));--cngx-sidenav-border-color: var(--cngx-color-border, oklch(.89 0 0));--cngx-sidenav-footer-border-color: var(--cngx-color-border, oklch(.89 0 0));--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .1);--cngx-nav-link-hover-bg: oklch(0 0 0 / .04);--cngx-nav-link-active-bg: oklch(0 0 0 / .08);--cngx-nav-link-focus-outline-color: var(--cngx-color-primary, oklch(.66 .19 50))}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .45);--cngx-nav-link-hover-bg: oklch(1 0 0 / .06);--cngx-nav-link-active-bg: oklch(1 0 0 / .1)}}:root[data-color-scheme=dark],:root.dark{--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .45);--cngx-nav-link-hover-bg: oklch(1 0 0 / .06);--cngx-nav-link-active-bg: oklch(1 0 0 / .1)}:root[data-color-scheme=light],:root.light{--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .1);--cngx-nav-link-hover-bg: oklch(0 0 0 / .04);--cngx-nav-link-active-bg: oklch(0 0 0 / .08)}}@layer cngx.components{cngx-sidenav{--cngx-sidenav-padding: var(--cngx-space-md);--cngx-nav-link-padding: var(--cngx-space-sm) var(--cngx-space-md);display:flex;flex-direction:column;flex-shrink:0;overflow:hidden;z-index:2;width:var(--cngx-sidenav-width, 280px);background:var(--cngx-sidenav-bg, oklch(.97 .005 250));color:var(--cngx-sidenav-color, inherit);transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s var(--cngx-sidenav-transition-duration, .25s)}cngx-sidenav:not(.cngx-sidenav--open):not(.cngx-sidenav--side):not(.cngx-sidenav--mini):not(.cngx-sidenav--over){width:0;visibility:hidden}cngx-sidenav.cngx-sidenav--open{visibility:visible;transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s 0s}cngx-sidenav.cngx-sidenav--side.cngx-sidenav--open{visibility:visible}cngx-sidenav.cngx-sidenav--over{position:absolute;top:0;bottom:0;width:var(--cngx-sidenav-width, 280px);visibility:hidden;transition:transform var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s var(--cngx-sidenav-transition-duration, .25s)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--start{inset-inline-start:0;transform:translate(-100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--end{inset-inline-end:0;transform:translate(100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--start:not(.cngx-sidenav--open):dir(rtl){transform:translate(100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--end:not(.cngx-sidenav--open):dir(rtl){transform:translate(-100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--open{transform:translate(0);visibility:visible;transition:transform var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s 0s}cngx-sidenav.cngx-sidenav--push,cngx-sidenav.cngx-sidenav--side,cngx-sidenav.cngx-sidenav--mini{position:relative}cngx-sidenav.cngx-sidenav--mini{width:var(--cngx-sidenav-mini-width, 56px);visibility:visible;transition:none}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded{width:var(--cngx-sidenav-width, 280px);z-index:3;box-shadow:var(--cngx-sidenav-expanded-shadow, 4px 0 12px oklch(0 0 0 / .1));transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),margin var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease)}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded.cngx-sidenav--start{margin-inline-end:calc(var(--cngx-sidenav-mini-width, 56px) - var(--cngx-sidenav-width, 280px))}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded.cngx-sidenav--end{margin-inline-start:calc(var(--cngx-sidenav-mini-width, 56px) - var(--cngx-sidenav-width, 280px))}cngx-sidenav.cngx-sidenav--start{border-inline-end:var(--cngx-sidenav-border-width, 1px) solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)))}cngx-sidenav.cngx-sidenav--end{border-inline-start:var(--cngx-sidenav-border-width, 1px) solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)));order:2}.cngx-sidenav__body{flex:1;overflow-y:auto;overflow-x:hidden;min-width:var(--cngx-sidenav-width, 280px);scrollbar-gutter:stable}.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav__body{min-width:var(--cngx-sidenav-mini-width, 56px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav-header,cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav-footer{overflow:hidden;white-space:nowrap;text-overflow:clip;text-align:center;padding:8px 4px}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavLabel],cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavGroup]{display:none!important}.cngx-sidenav-header{flex-shrink:0;padding:var(--cngx-sidenav-padding, 16px);background:var(--cngx-sidenav-header-bg, transparent);border-bottom:1px solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)));font-weight:600;font-size:var(--cngx-sidenav-header-font-size, .875rem)}.cngx-sidenav-footer{flex-shrink:0;margin-top:auto;padding:var(--cngx-sidenav-padding, 16px);background:var(--cngx-sidenav-footer-bg, transparent);border-top:1px solid var( --cngx-sidenav-footer-border-color, var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0))) );font-size:var(--cngx-sidenav-footer-font-size, .75rem);opacity:.7}cngx-sidenav .cngx-nav-link{display:block;padding:var(--cngx-nav-link-padding, 10px 16px);text-decoration:none;font-size:var(--cngx-nav-link-font-size, .875rem);color:var(--cngx-nav-link-color, currentColor);border-radius:var(--cngx-nav-link-radius, 4px);transition:background .15s,color .15s}cngx-sidenav .cngx-nav-link:hover{color:var(--cngx-nav-link-hover-color, currentColor);background:var(--cngx-nav-link-hover-bg, oklch(0 0 0 / .04))}cngx-sidenav .cngx-nav-link--active{color:var(--cngx-nav-link-active-color, currentColor);background:var(--cngx-nav-link-active-bg, oklch(0 0 0 / .08));font-weight:var(--cngx-nav-link-active-font-weight, 600)}cngx-sidenav .cngx-nav-link:focus-visible{outline:var(--cngx-nav-link-focus-outline-width, 2px) solid var(--cngx-nav-link-focus-outline-color, oklch(.66 .19 50));outline-offset:var(--cngx-nav-link-focus-outline-offset, -2px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-nav-link{overflow:hidden;text-align:center;font-size:0!important;line-height:1;padding:var(--cngx-nav-link-padding, 10px 8px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-nav-link[data-initial]:before{content:attr(data-initial);font-size:var(--cngx-nav-link-initial-size, .875rem);font-weight:600;display:inline-block;width:var(--cngx-nav-link-initial-size, .875rem);text-align:center;line-height:1.6}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavBadge]{display:none}.cngx-nav-group-content{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--cngx-sidenav-transition-duration, .2s) ease}.cngx-nav-group-content>*{overflow:hidden;min-height:0}.cngx-nav-group-content--open{grid-template-rows:1fr}.cngx-sidenav__resize-handle{position:absolute;top:0;bottom:0;width:var(--cngx-sidenav-resize-handle-width, 4px);cursor:col-resize;z-index:4;background:transparent;transition:background .15s;touch-action:none}.cngx-sidenav--start .cngx-sidenav__resize-handle{inset-inline-end:0;transform:translate(50%)}.cngx-sidenav--end .cngx-sidenav__resize-handle{inset-inline-start:0;transform:translate(-50%)}.cngx-sidenav--start:dir(rtl) .cngx-sidenav__resize-handle{transform:translate(-50%)}.cngx-sidenav--end:dir(rtl) .cngx-sidenav__resize-handle{transform:translate(50%)}.cngx-sidenav__resize-handle:hover,.cngx-sidenav--resizing .cngx-sidenav__resize-handle{background:var( --cngx-sidenav-resize-handle-color, var(--cngx-color-primary, oklch(.66 .19 50)) )}cngx-sidenav.cngx-sidenav--resizing{transition:none!important;-webkit-user-select:none;user-select:none}}@media(forced-colors:active){cngx-sidenav .cngx-nav-link--active{forced-color-adjust:none;background:Highlight;color:HighlightText}}\n"] }]
|
|
516
|
-
}], ctorParameters: () => [], propDecorators: { position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }],
|
|
716
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-sidenav-width{syntax: \"<length>\"; inherits: true; initial-value: 280px;}@property --cngx-sidenav-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .005 250);}@property --cngx-sidenav-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-sidenav-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .25s;}:where(cngx-sidenav,cngx-sidenav *){--cngx-sidenav-transition-duration: var(--cngx-duration-base)}@property --cngx-sidenav-transition-easing{syntax: \"*\"; inherits: false; initial-value: ease;}@property --cngx-sidenav-mini-width{syntax: \"<length>\"; inherits: true; initial-value: 56px;}@property --cngx-sidenav-expanded-shadow{syntax: \"*\"; inherits: true; initial-value: 4px 0 12px oklch(0 0 0 / .1);}@property --cngx-sidenav-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --cngx-sidenav-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.89 0 0);}@property --cngx-sidenav-padding{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-sidenav-header-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-sidenav-header-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-sidenav-footer-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-sidenav-footer-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.89 0 0);}@property --cngx-sidenav-footer-font-size{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-sidenav-resize-handle-width{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-sidenav-resize-handle-color{syntax: \"<color>\"; inherits: false; initial-value: oklch(.66 .19 50);}@property --cngx-sidenav-resize-handle-focus-outline-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-sidenav-resize-handle-focus-outline-color{syntax: \"<color>\"; inherits: false; initial-value: oklch(.66 .19 50);}@property --cngx-sidenav-resize-handle-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-sidenav-backdrop-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(0 0 0);}@property --cngx-sidenav-backdrop-opacity{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --cngx-nav-link-padding{syntax: \"*\"; inherits: true; initial-value: 10px 16px;}@property --cngx-nav-link-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-nav-link-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-nav-link-hover-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-hover-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(0 0 0 / .04);}@property --cngx-nav-link-active-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-nav-link-active-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(0 0 0 / .08);}@property --cngx-nav-link-active-font-weight{syntax: \"<number>\"; inherits: false; initial-value: 600;}@property --cngx-nav-link-focus-outline-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-nav-link-focus-outline-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-nav-link-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: -2px;}@property --cngx-nav-link-initial-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}:root{--cngx-sidenav-bg: var(--cngx-color-surface, oklch(.97 .005 250));--cngx-sidenav-border-color: var(--cngx-color-border, oklch(.89 0 0));--cngx-sidenav-footer-border-color: var(--cngx-color-border, oklch(.89 0 0));--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .1);--cngx-nav-link-hover-bg: oklch(0 0 0 / .04);--cngx-nav-link-active-bg: oklch(0 0 0 / .08);--cngx-nav-link-focus-outline-color: var(--cngx-color-primary, oklch(.66 .19 50))}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .45);--cngx-nav-link-hover-bg: oklch(1 0 0 / .06);--cngx-nav-link-active-bg: oklch(1 0 0 / .1)}}:root[data-color-scheme=dark],:root.dark{--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .45);--cngx-nav-link-hover-bg: oklch(1 0 0 / .06);--cngx-nav-link-active-bg: oklch(1 0 0 / .1)}:root[data-color-scheme=light],:root.light{--cngx-sidenav-expanded-shadow: 4px 0 12px oklch(0 0 0 / .1);--cngx-nav-link-hover-bg: oklch(0 0 0 / .04);--cngx-nav-link-active-bg: oklch(0 0 0 / .08)}}@layer cngx.components{cngx-sidenav{--cngx-sidenav-padding: var(--cngx-space-md);--cngx-nav-link-padding: var(--cngx-space-sm) var(--cngx-space-md);display:flex;flex-direction:column;flex-shrink:0;overflow:hidden;z-index:2;width:var(--cngx-sidenav-width, 280px);background:var(--cngx-sidenav-bg, oklch(.97 .005 250));color:var(--cngx-sidenav-color, inherit);transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s var(--cngx-sidenav-transition-duration, .25s)}cngx-sidenav:not(.cngx-sidenav--open):not(.cngx-sidenav--side):not(.cngx-sidenav--mini):not(.cngx-sidenav--over){width:0;visibility:hidden}cngx-sidenav.cngx-sidenav--open{visibility:visible;transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s 0s}cngx-sidenav.cngx-sidenav--side.cngx-sidenav--open{visibility:visible}cngx-sidenav.cngx-sidenav--over{position:absolute;top:0;bottom:0;width:var(--cngx-sidenav-width, 280px);visibility:hidden;transition:transform var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s var(--cngx-sidenav-transition-duration, .25s)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--start{inset-inline-start:0;transform:translate(-100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--end{inset-inline-end:0;transform:translate(100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--start:not(.cngx-sidenav--open):dir(rtl){transform:translate(100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--end:not(.cngx-sidenav--open):dir(rtl){transform:translate(-100%)}cngx-sidenav.cngx-sidenav--over.cngx-sidenav--open{transform:translate(0);visibility:visible;transition:transform var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),visibility 0s 0s}cngx-sidenav.cngx-sidenav--push,cngx-sidenav.cngx-sidenav--side,cngx-sidenav.cngx-sidenav--mini{position:relative}cngx-sidenav.cngx-sidenav--mini{width:var(--cngx-sidenav-mini-width, 56px);visibility:visible;transition:none}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded{width:var(--cngx-sidenav-width, 280px);z-index:3;box-shadow:var(--cngx-sidenav-expanded-shadow, 4px 0 12px oklch(0 0 0 / .1));transition:width var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),margin var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease)}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded.cngx-sidenav--start{margin-inline-end:calc(var(--cngx-sidenav-mini-width, 56px) - var(--cngx-sidenav-width, 280px))}cngx-sidenav.cngx-sidenav--mini.cngx-sidenav--expanded.cngx-sidenav--end{margin-inline-start:calc(var(--cngx-sidenav-mini-width, 56px) - var(--cngx-sidenav-width, 280px))}cngx-sidenav.cngx-sidenav--start{border-inline-end:var(--cngx-sidenav-border-width, 1px) solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)))}cngx-sidenav.cngx-sidenav--end{border-inline-start:var(--cngx-sidenav-border-width, 1px) solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)));order:2}.cngx-sidenav__body{flex:1;overflow-y:auto;overflow-x:hidden;min-width:var(--cngx-sidenav-width, 280px);scrollbar-gutter:stable}.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav__body{min-width:var(--cngx-sidenav-mini-width, 56px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav-header,cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-sidenav-footer{overflow:hidden;white-space:nowrap;text-overflow:clip;text-align:center;padding:8px 4px}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavLabel],cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavGroup]{display:none!important}.cngx-sidenav-header{flex-shrink:0;padding:var(--cngx-sidenav-padding, 16px);background:var(--cngx-sidenav-header-bg, transparent);border-bottom:1px solid var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0)));font-weight:600;font-size:var(--cngx-sidenav-header-font-size, .875rem)}.cngx-sidenav-footer{flex-shrink:0;margin-top:auto;padding:var(--cngx-sidenav-padding, 16px);background:var(--cngx-sidenav-footer-bg, transparent);border-top:1px solid var( --cngx-sidenav-footer-border-color, var(--cngx-sidenav-border-color, var(--cngx-color-border, oklch(.89 0 0))) );font-size:var(--cngx-sidenav-footer-font-size, .75rem);color:var(--cngx-color-text-muted, oklch(.5 .01 250))}cngx-sidenav .cngx-nav-link{display:block;padding:var(--cngx-nav-link-padding, 10px 16px);text-decoration:none;font-size:var(--cngx-nav-link-font-size, .875rem);color:var(--cngx-nav-link-color, currentColor);border-radius:var(--cngx-nav-link-radius, 4px);transition:background var(--cngx-duration-fast, .15s),color var(--cngx-duration-fast, .15s)}cngx-sidenav .cngx-nav-link:hover{color:var(--cngx-nav-link-hover-color, currentColor);background:var(--cngx-nav-link-hover-bg, oklch(0 0 0 / .04))}cngx-sidenav .cngx-nav-link--active{color:var(--cngx-nav-link-active-color, currentColor);background:var(--cngx-nav-link-active-bg, oklch(0 0 0 / .08));font-weight:var(--cngx-nav-link-active-font-weight, 600)}cngx-sidenav .cngx-nav-link:focus-visible{outline:var(--cngx-nav-link-focus-outline-width, 2px) solid var(--cngx-nav-link-focus-outline-color, oklch(.66 .19 50));outline-offset:var(--cngx-nav-link-focus-outline-offset, -2px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-nav-link{overflow:hidden;text-align:center;font-size:0!important;line-height:1;padding:var(--cngx-nav-link-padding, 10px 8px)}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) .cngx-nav-link[data-initial]:before{content:attr(data-initial) / \"\";font-size:var(--cngx-nav-link-initial-size, .875rem);font-weight:600;display:inline-block;width:var(--cngx-nav-link-initial-size, .875rem);text-align:center;line-height:1.6}cngx-sidenav.cngx-sidenav--mini:not(.cngx-sidenav--expanded) [cngxNavBadge]{display:none}.cngx-nav-group-content{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--cngx-sidenav-transition-duration, .2s) ease}.cngx-nav-group-content>*{overflow:hidden;min-height:0}.cngx-nav-group-content--open{grid-template-rows:1fr}.cngx-sidenav__resize-handle{--cngx-sidenav-resize-handle-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-sidenav-resize-handle-focus-outline-color: var( --cngx-color-primary, oklch(.66 .19 50) );position:absolute;top:0;bottom:0;width:var(--cngx-sidenav-resize-handle-width, 4px);cursor:col-resize;z-index:4;background:transparent;transition:background var(--cngx-duration-fast, .15s);touch-action:none}.cngx-sidenav__resize-handle:before{content:\"\";position:absolute;top:0;bottom:0;left:50%;transform:translate(-50%);width:max(var(--cngx-sidenav-resize-handle-width, 4px),var(--cngx-target-min, 0px))}.cngx-sidenav--start .cngx-sidenav__resize-handle{inset-inline-end:0;transform:translate(50%)}.cngx-sidenav--end .cngx-sidenav__resize-handle{inset-inline-start:0;transform:translate(-50%)}.cngx-sidenav--start:dir(rtl) .cngx-sidenav__resize-handle{transform:translate(-50%)}.cngx-sidenav--end:dir(rtl) .cngx-sidenav__resize-handle{transform:translate(50%)}.cngx-sidenav__resize-handle:hover,.cngx-sidenav--resizing .cngx-sidenav__resize-handle{background:var( --cngx-sidenav-resize-handle-color, var(--cngx-color-primary, oklch(.66 .19 50)) )}.cngx-sidenav__resize-handle:focus-visible{background:var( --cngx-sidenav-resize-handle-color, var(--cngx-color-primary, oklch(.66 .19 50)) );outline:var(--cngx-sidenav-resize-handle-focus-outline-width, 2px) solid var( --cngx-sidenav-resize-handle-focus-outline-color, var(--cngx-color-primary, oklch(.66 .19 50)) );outline-offset:var(--cngx-sidenav-resize-handle-focus-outline-offset, 2px)}cngx-sidenav.cngx-sidenav--resizing{transition:none!important;-webkit-user-select:none;user-select:none}}@media(forced-colors:active){cngx-sidenav .cngx-nav-link--active{forced-color-adjust:none;background:Highlight;color:HighlightText}}\n"] }]
|
|
717
|
+
}], ctorParameters: () => [], propDecorators: { position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }, { type: i0.Output, args: ["widthChange"] }], miniWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "miniWidth", required: false }] }], expandOnHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandOnHover", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], resizeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizeLabel", required: false }] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }], shortcut: [{ type: i0.Input, args: [{ isSignal: true, alias: "shortcut", required: false }] }], opened: [{ type: i0.Input, args: [{ isSignal: true, alias: "opened", required: false }] }, { type: i0.Output, args: ["openedChange"] }] } });
|
|
718
|
+
/** Per-keypress width change of the arrow-key resize, in px. */
|
|
719
|
+
const RESIZE_KEY_STEP = 16;
|
|
720
|
+
/**
|
|
721
|
+
* Numeric value of a px-unit (or unitless) CSS length, `null` for any other
|
|
722
|
+
* unit. rem/ch widths cannot be resolved without layout, and a guessed number
|
|
723
|
+
* would surface as a lying `aria-valuenow`.
|
|
724
|
+
*/
|
|
725
|
+
function parsePx(value) {
|
|
726
|
+
const match = /^\s*(\d+(?:\.\d+)?)(?:px)?\s*$/.exec(value);
|
|
727
|
+
return match ? Number.parseFloat(match[1]) : null;
|
|
728
|
+
}
|
|
517
729
|
|
|
518
730
|
/**
|
|
519
731
|
* Container for one or two `CngxSidenav` panels and a `CngxSidenavContent`.
|
|
@@ -521,11 +733,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
521
733
|
* Manages shared backdrop, scroll lock, and click-outside coordination.
|
|
522
734
|
* Supports up to two sidenavs: one `position="start"` and one `position="end"`.
|
|
523
735
|
*
|
|
736
|
+
* It is also the query container the rails resolve their `'auto'` mode
|
|
737
|
+
* against: the stylesheet declares and names the container
|
|
738
|
+
* (`cngx-sidenav-layout`) and carries the single docking threshold, the
|
|
739
|
+
* composed `CngxContainer` observes it and publishes the resolved value. A
|
|
740
|
+
* rail mounted without this layout has no container and falls back to
|
|
741
|
+
* `over`.
|
|
742
|
+
*
|
|
524
743
|
* ### Dual sidebar
|
|
525
744
|
* ```html
|
|
526
745
|
* <cngx-sidenav-layout>
|
|
527
|
-
* <cngx-sidenav position="start" [(opened)]="navOpen"
|
|
528
|
-
* [responsive]="'(min-width: 1024px)'">
|
|
746
|
+
* <cngx-sidenav position="start" [(opened)]="navOpen">
|
|
529
747
|
* Left nav
|
|
530
748
|
* </cngx-sidenav>
|
|
531
749
|
* <cngx-sidenav-content>
|
|
@@ -545,8 +763,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
545
763
|
* @relatedTo CngxSidenav, CngxSidenavContent, CngxSidenavHeader, CngxSidenavFooter
|
|
546
764
|
*/
|
|
547
765
|
class CngxSidenavLayout {
|
|
548
|
-
|
|
549
|
-
|
|
766
|
+
readyState = signal(false, ...(ngDevMode ? [{ debugName: "readyState" }] : /* istanbul ignore next */ []));
|
|
767
|
+
/** @internal First render done - gates transitions against an open-on-load flash. */
|
|
768
|
+
ready = this.readyState.asReadonly();
|
|
550
769
|
sidenavs = contentChildren(CngxSidenav, ...(ngDevMode ? [{ debugName: "sidenavs" }] : /* istanbul ignore next */ []));
|
|
551
770
|
/** The start-positioned sidenav, if any. */
|
|
552
771
|
startSidenav = computed(() => this.sidenavs().find((s) => s.position() === 'start') ?? null, ...(ngDevMode ? [{ debugName: "startSidenav" }] : /* istanbul ignore next */ []));
|
|
@@ -557,31 +776,33 @@ class CngxSidenavLayout {
|
|
|
557
776
|
constructor() {
|
|
558
777
|
const doc = inject(DOCUMENT);
|
|
559
778
|
// Gate transitions until after first render - prevents open-on-load flash.
|
|
560
|
-
afterNextRender(() => this.
|
|
779
|
+
afterNextRender(() => this.readyState.set(true));
|
|
561
780
|
// Dataset ref-counting matches CngxScrollLock so concurrent lock sources
|
|
562
|
-
// do not clobber each other's restore values.
|
|
781
|
+
// do not clobber each other's restore values. `locked` is a plain
|
|
782
|
+
// variable, not a signal: the effect only needs to TRACK hasOverlay(),
|
|
783
|
+
// and a signal read+written in the same effect is the loop-risk shape.
|
|
563
784
|
const html = doc.documentElement;
|
|
564
|
-
|
|
785
|
+
let locked = false;
|
|
565
786
|
effect(() => {
|
|
566
|
-
if (this.hasOverlay() && !locked
|
|
787
|
+
if (this.hasOverlay() && !locked) {
|
|
567
788
|
if (!html.dataset['cngxPrevOverflow']) {
|
|
568
789
|
html.dataset['cngxPrevOverflow'] = html.style.overflow;
|
|
569
790
|
html.dataset['cngxPrevScrollbarGutter'] = html.style.scrollbarGutter;
|
|
570
791
|
}
|
|
571
792
|
html.style.overflow = 'hidden';
|
|
572
793
|
html.style.scrollbarGutter = 'stable';
|
|
573
|
-
locked
|
|
794
|
+
locked = true;
|
|
574
795
|
}
|
|
575
|
-
else if (!this.hasOverlay() && locked
|
|
796
|
+
else if (!this.hasOverlay() && locked) {
|
|
576
797
|
html.style.overflow = html.dataset['cngxPrevOverflow'] ?? '';
|
|
577
798
|
html.style.scrollbarGutter = html.dataset['cngxPrevScrollbarGutter'] ?? '';
|
|
578
799
|
delete html.dataset['cngxPrevOverflow'];
|
|
579
800
|
delete html.dataset['cngxPrevScrollbarGutter'];
|
|
580
|
-
locked
|
|
801
|
+
locked = false;
|
|
581
802
|
}
|
|
582
803
|
});
|
|
583
804
|
inject(DestroyRef).onDestroy(() => {
|
|
584
|
-
if (locked
|
|
805
|
+
if (locked) {
|
|
585
806
|
html.style.overflow = html.dataset['cngxPrevOverflow'] ?? '';
|
|
586
807
|
html.style.scrollbarGutter = html.dataset['cngxPrevScrollbarGutter'] ?? '';
|
|
587
808
|
delete html.dataset['cngxPrevOverflow'];
|
|
@@ -615,18 +836,18 @@ class CngxSidenavLayout {
|
|
|
615
836
|
}
|
|
616
837
|
}
|
|
617
838
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxSidenavLayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
618
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxSidenavLayout, isStandalone: true, selector: "cngx-sidenav-layout", host: { properties: { "class.cngx-sidenav-layout": "true", "class.cngx-sidenav-layout--ready": "ready()", "class.cngx-sidenav-layout--has-overlay": "hasOverlay()" } }, queries: [{ propertyName: "sidenavs", predicate: CngxSidenav, isSignal: true }], exportAs: ["cngxSidenavLayout"], ngImport: i0, template: `
|
|
839
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxSidenavLayout, isStandalone: true, selector: "cngx-sidenav-layout", host: { properties: { "class.cngx-sidenav-layout": "true", "class.cngx-sidenav-layout--ready": "ready()", "class.cngx-sidenav-layout--has-overlay": "hasOverlay()" } }, queries: [{ propertyName: "sidenavs", predicate: CngxSidenav, isSignal: true }], exportAs: ["cngxSidenavLayout"], hostDirectives: [{ directive: i1$1.CngxContainer }], ngImport: i0, template: `
|
|
619
840
|
<ng-content select="cngx-sidenav[position=start], cngx-sidenav:not([position])" />
|
|
620
841
|
<ng-content select="cngx-sidenav-content" />
|
|
621
842
|
<ng-content select="cngx-sidenav[position=end]" />
|
|
622
843
|
@if (hasOverlay()) {
|
|
623
844
|
<div class="cngx-sidenav-backdrop" (click)="closeAllOverlays()"></div>
|
|
624
845
|
}
|
|
625
|
-
`, isInline: true, styles: ["@layer cngx.components{cngx-sidenav-layout{display:flex;position:relative;width:100%;min-height:inherit;overflow:hidden}cngx-sidenav-layout:not(.cngx-sidenav-layout--ready) cngx-sidenav,cngx-sidenav-layout:not(.cngx-sidenav-layout--ready) cngx-sidenav-content{transition:none!important}cngx-sidenav.cngx-sidenav--resizing~cngx-sidenav-content{transition:none!important;-webkit-user-select:none;user-select:none}cngx-sidenav-content{display:block;flex:1;min-width:0;overflow:auto;order:1;transition:margin-inline-start var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),margin-inline-end var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease)}.cngx-sidenav-backdrop{position:absolute;inset:0;z-index:1;background:var(--cngx-sidenav-backdrop-bg, oklch(0 0 0));opacity:var(--cngx-sidenav-backdrop-opacity, .5);cursor:pointer}@media(prefers-reduced-motion:reduce){cngx-sidenav,cngx-sidenav-content,.cngx-sidenav-backdrop{transition:none!important}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
846
|
+
`, isInline: true, styles: ["@layer cngx.components{cngx-sidenav-layout{display:flex;position:relative;width:100%;min-height:inherit;overflow:hidden;container-type:inline-size;container-name:cngx-sidenav-layout}cngx-sidenav-layout>cngx-sidenav{--cngx-sidenav-layout-wide: 0}@container cngx-sidenav-layout (min-inline-size: 64rem){cngx-sidenav-layout>cngx-sidenav{--cngx-sidenav-layout-wide: 1}}cngx-sidenav-layout:not(.cngx-sidenav-layout--ready) cngx-sidenav,cngx-sidenav-layout:not(.cngx-sidenav-layout--ready) cngx-sidenav-content{transition:none!important}cngx-sidenav.cngx-sidenav--resizing~cngx-sidenav-content{transition:none!important;-webkit-user-select:none;user-select:none}cngx-sidenav-content{display:block;flex:1;min-width:0;overflow:auto;order:1;transition:margin-inline-start var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),margin-inline-end var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease)}.cngx-sidenav-backdrop{position:absolute;inset:0;z-index:1;background:var(--cngx-sidenav-backdrop-bg, oklch(0 0 0));opacity:var(--cngx-sidenav-backdrop-opacity, .5);cursor:pointer}@media(prefers-reduced-motion:reduce){cngx-sidenav,cngx-sidenav-content,.cngx-sidenav-backdrop{transition:none!important}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
626
847
|
}
|
|
627
848
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxSidenavLayout, decorators: [{
|
|
628
849
|
type: Component,
|
|
629
|
-
args: [{ selector: 'cngx-sidenav-layout', exportAs: 'cngxSidenavLayout', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
850
|
+
args: [{ selector: 'cngx-sidenav-layout', exportAs: 'cngxSidenavLayout', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, hostDirectives: [CngxContainer], host: {
|
|
630
851
|
'[class.cngx-sidenav-layout]': 'true',
|
|
631
852
|
'[class.cngx-sidenav-layout--ready]': 'ready()',
|
|
632
853
|
'[class.cngx-sidenav-layout--has-overlay]': 'hasOverlay()',
|
|
@@ -637,7 +858,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
637
858
|
@if (hasOverlay()) {
|
|
638
859
|
<div class="cngx-sidenav-backdrop" (click)="closeAllOverlays()"></div>
|
|
639
860
|
}
|
|
640
|
-
`, styles: ["@layer cngx.components{cngx-sidenav-layout{display:flex;position:relative;width:100%;min-height:inherit;overflow:hidden}cngx-sidenav-layout:not(.cngx-sidenav-layout--ready) cngx-sidenav,cngx-sidenav-layout:not(.cngx-sidenav-layout--ready) cngx-sidenav-content{transition:none!important}cngx-sidenav.cngx-sidenav--resizing~cngx-sidenav-content{transition:none!important;-webkit-user-select:none;user-select:none}cngx-sidenav-content{display:block;flex:1;min-width:0;overflow:auto;order:1;transition:margin-inline-start var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),margin-inline-end var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease)}.cngx-sidenav-backdrop{position:absolute;inset:0;z-index:1;background:var(--cngx-sidenav-backdrop-bg, oklch(0 0 0));opacity:var(--cngx-sidenav-backdrop-opacity, .5);cursor:pointer}@media(prefers-reduced-motion:reduce){cngx-sidenav,cngx-sidenav-content,.cngx-sidenav-backdrop{transition:none!important}}}\n"] }]
|
|
861
|
+
`, styles: ["@layer cngx.components{cngx-sidenav-layout{display:flex;position:relative;width:100%;min-height:inherit;overflow:hidden;container-type:inline-size;container-name:cngx-sidenav-layout}cngx-sidenav-layout>cngx-sidenav{--cngx-sidenav-layout-wide: 0}@container cngx-sidenav-layout (min-inline-size: 64rem){cngx-sidenav-layout>cngx-sidenav{--cngx-sidenav-layout-wide: 1}}cngx-sidenav-layout:not(.cngx-sidenav-layout--ready) cngx-sidenav,cngx-sidenav-layout:not(.cngx-sidenav-layout--ready) cngx-sidenav-content{transition:none!important}cngx-sidenav.cngx-sidenav--resizing~cngx-sidenav-content{transition:none!important;-webkit-user-select:none;user-select:none}cngx-sidenav-content{display:block;flex:1;min-width:0;overflow:auto;order:1;transition:margin-inline-start var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease),margin-inline-end var(--cngx-sidenav-transition-duration, .25s) var(--cngx-sidenav-transition-easing, ease)}.cngx-sidenav-backdrop{position:absolute;inset:0;z-index:1;background:var(--cngx-sidenav-backdrop-bg, oklch(0 0 0));opacity:var(--cngx-sidenav-backdrop-opacity, .5);cursor:pointer}@media(prefers-reduced-motion:reduce){cngx-sidenav,cngx-sidenav-content,.cngx-sidenav-backdrop{transition:none!important}}}\n"] }]
|
|
641
862
|
}], ctorParameters: () => [], propDecorators: { sidenavs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CngxSidenav), { isSignal: true }] }] } });
|
|
642
863
|
|
|
643
864
|
/**
|
|
@@ -869,12 +1090,12 @@ function reduceFeatures(features) {
|
|
|
869
1090
|
case 'routerSync':
|
|
870
1091
|
out.routerSync = { ...out.routerSync, ...f.payload };
|
|
871
1092
|
break;
|
|
872
|
-
case 'responsive':
|
|
873
|
-
out.responsive = f.payload.responsive;
|
|
874
|
-
break;
|
|
875
1093
|
case 'shortcut':
|
|
876
1094
|
out.shortcut = f.payload.shortcut;
|
|
877
1095
|
break;
|
|
1096
|
+
case 'labels':
|
|
1097
|
+
out.labels = f.payload.labels;
|
|
1098
|
+
break;
|
|
878
1099
|
}
|
|
879
1100
|
}
|
|
880
1101
|
return out;
|
|
@@ -882,8 +1103,8 @@ function reduceFeatures(features) {
|
|
|
882
1103
|
/**
|
|
883
1104
|
* Two-level deep merge: the nested sub-tree keys (`dimensions` / `hover`) are
|
|
884
1105
|
* spread-merged so the partial fills in missing keys without nuking unrelated
|
|
885
|
-
* config sub-trees; the flat top-level
|
|
886
|
-
*
|
|
1106
|
+
* config sub-trees; the flat top-level scalar (`shortcut`) takes the partial
|
|
1107
|
+
* when present, else the base. Inner objects are flat (one level),
|
|
887
1108
|
* so a single spread per key suffices. Invariant: a config key nested more than
|
|
888
1109
|
* one level deep would shallow-merge silently here - if the config ever grows a
|
|
889
1110
|
* deeper sub-tree, add a dedicated spread for it rather than relying on this
|
|
@@ -896,13 +1117,13 @@ function mergeConfig(base, partial) {
|
|
|
896
1117
|
dimensions: { ...base.dimensions, ...partial.dimensions },
|
|
897
1118
|
hover: { ...base.hover, ...partial.hover },
|
|
898
1119
|
routerSync: { ...base.routerSync, ...partial.routerSync },
|
|
899
|
-
responsive: partial.responsive ?? base.responsive,
|
|
900
1120
|
shortcut: partial.shortcut ?? base.shortcut,
|
|
1121
|
+
labels: partial.labels ?? base.labels,
|
|
901
1122
|
};
|
|
902
1123
|
}
|
|
903
1124
|
/**
|
|
904
1125
|
* Application-root configuration cascade for the sidenav family. Pass any
|
|
905
|
-
* combination of `withSidenavDimensions`,
|
|
1126
|
+
* combination of `withSidenavDimensions`,
|
|
906
1127
|
* `withSidenavShortcut`, `withSidenavHoverDwell`, and `withSidenavRouterSync`
|
|
907
1128
|
* features in `bootstrapApplication`'s providers array.
|
|
908
1129
|
*
|
|
@@ -1005,22 +1226,6 @@ function provideSidenavConfigAt(...features) {
|
|
|
1005
1226
|
function withSidenavDimensions(payload) {
|
|
1006
1227
|
return { kind: 'dimensions', payload };
|
|
1007
1228
|
}
|
|
1008
|
-
/**
|
|
1009
|
-
* Set the app-wide default CSS media-query string for responsive mode
|
|
1010
|
-
* switching. When the query matches, the sidenav resolves to `'side'`;
|
|
1011
|
-
* otherwise it falls back to its `mode`. Per-instance `[responsive]` still
|
|
1012
|
-
* wins.
|
|
1013
|
-
*
|
|
1014
|
-
* ```ts
|
|
1015
|
-
* provideSidenavConfig(withSidenavResponsive('(min-width: 1024px)'));
|
|
1016
|
-
* ```
|
|
1017
|
-
*
|
|
1018
|
-
* @category ui/sidenav
|
|
1019
|
-
* @since 0.1.0
|
|
1020
|
-
*/
|
|
1021
|
-
function withSidenavResponsive(query) {
|
|
1022
|
-
return { kind: 'responsive', payload: { responsive: query } };
|
|
1023
|
-
}
|
|
1024
1229
|
/**
|
|
1025
1230
|
* Set the app-wide default keyboard shortcut to toggle the sidenav (e.g.
|
|
1026
1231
|
* `'mod+b'`, which resolves to `ctrl` on Windows/Linux and `meta` on macOS).
|
|
@@ -1069,6 +1274,22 @@ function withSidenavHoverDwell(payload) {
|
|
|
1069
1274
|
function withSidenavRouterSync(payload) {
|
|
1070
1275
|
return { kind: 'routerSync', payload };
|
|
1071
1276
|
}
|
|
1277
|
+
/**
|
|
1278
|
+
* Override the app-wide sidenav copy. Unset keys read the `sidenav` section of
|
|
1279
|
+
* the language pack (English without one); pass a `Signal` of a partial bundle
|
|
1280
|
+
* to switch languages at runtime. A per-instance `[resizeLabel]` still wins
|
|
1281
|
+
* over `resizeHandle`. A later call replaces the whole bundle.
|
|
1282
|
+
*
|
|
1283
|
+
* ```ts
|
|
1284
|
+
* provideSidenavConfig(withSidenavLabels({ resizeHandle: 'Navigation anpassen' }));
|
|
1285
|
+
* ```
|
|
1286
|
+
*
|
|
1287
|
+
* @category ui/sidenav
|
|
1288
|
+
* @since 0.1.0
|
|
1289
|
+
*/
|
|
1290
|
+
function withSidenavLabels(labels) {
|
|
1291
|
+
return { kind: 'labels', payload: { labels } };
|
|
1292
|
+
}
|
|
1072
1293
|
|
|
1073
1294
|
/**
|
|
1074
1295
|
* @module @cngx/ui/sidenav
|
|
@@ -1078,5 +1299,5 @@ function withSidenavRouterSync(payload) {
|
|
|
1078
1299
|
* Generated bundle index. Do not edit.
|
|
1079
1300
|
*/
|
|
1080
1301
|
|
|
1081
|
-
export { CNGX_SIDENAV, CNGX_SIDENAV_CONFIG, CngxSidenav, CngxSidenavContent, CngxSidenavFooter, CngxSidenavHeader, CngxSidenavLayout, CngxSidenavRouterSync, injectSidenavConfig, provideSidenavConfig, provideSidenavConfigAt, withSidenavDimensions, withSidenavHoverDwell,
|
|
1302
|
+
export { CNGX_SIDENAV, CNGX_SIDENAV_CONFIG, CNGX_SIDENAV_DEFAULTS, CNGX_SIDENAV_LANGUAGE_EN, CngxSidenav, CngxSidenavContent, CngxSidenavFooter, CngxSidenavHeader, CngxSidenavLayout, CngxSidenavRouterSync, injectSidenavConfig, injectSidenavLabels, provideSidenavConfig, provideSidenavConfigAt, withSidenavDimensions, withSidenavHoverDwell, withSidenavLabels, withSidenavRouterSync, withSidenavShortcut };
|
|
1082
1303
|
//# sourceMappingURL=cngx-ui-sidenav.mjs.map
|