@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.9
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 +227 -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 +120 -36
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +121 -56
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +228 -108
- 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 +204 -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 +209 -40
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -101
- 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 +1074 -460
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +76 -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 +555 -204
- 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 +553 -198
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +344 -109
- 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 +234 -99
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +88 -25
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +98 -23
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +101 -33
- 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/README.md +30 -6
- package/mat-tabs/styles/mat-tabs.css +188 -42
- package/overlay/README.md +9 -4
- package/package.json +31 -7
- package/paginator/README.md +8 -4
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/sidenav/README.md +33 -11
- package/speak/README.md +3 -2
- package/stepper/README.md +14 -2
- 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 +100 -28
- package/types/cngx-ui-action-button.d.ts +44 -3
- package/types/cngx-ui-breadcrumb.d.ts +167 -60
- package/types/cngx-ui-chart-panel.d.ts +122 -18
- package/types/cngx-ui-collection.d.ts +157 -55
- package/types/cngx-ui-command-palette.d.ts +297 -183
- package/types/cngx-ui-context-menu.d.ts +140 -10
- package/types/cngx-ui-data-grid-accordion.d.ts +278 -39
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +605 -59
- package/types/cngx-ui-mat-accordion.d.ts +30 -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 +250 -34
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +425 -136
- 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 +88 -49
- package/types/cngx-ui-tabs.d.ts +6 -4
- package/types/cngx-ui-timeline.d.ts +35 -11
- package/types/cngx-ui-toc.d.ts +93 -16
- 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 { cngxDevWarn, clamp, CngxRuntimeError } 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
|
+
cngxDevWarn('CNGX3010', '[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,19 +388,32 @@ 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;
|
|
287
395
|
if (!viaAutoOpen) {
|
|
288
396
|
const activeEl = this.doc.activeElement;
|
|
289
397
|
this.restoreTarget = activeEl instanceof HTMLElement ? activeEl : null;
|
|
290
|
-
|
|
398
|
+
// preventScroll: the rail is still translated off-canvas when focus
|
|
399
|
+
// lands, and the layout (overflow: hidden) is script-scrollable, so a
|
|
400
|
+
// scrolling focus() shifts the whole layout by the rail width.
|
|
401
|
+
void this.focusTrap.focusFirstTabbableElementWhenReady({ preventScroll: true });
|
|
291
402
|
}
|
|
292
403
|
}
|
|
293
404
|
else if (!active && wasOverlayActive) {
|
|
294
405
|
const target = this.restoreTarget;
|
|
295
406
|
this.restoreTarget = null;
|
|
407
|
+
// Move focus out of the rail synchronously, before aria-hidden flips
|
|
408
|
+
// true in this same flush (host binding: !opened()). The queued restore
|
|
409
|
+
// alone would leave the trapped focus under aria-hidden for a microtask,
|
|
410
|
+
// which the browser blocks and warns about; the deferred restore still
|
|
411
|
+
// returns focus to the opener afterwards.
|
|
412
|
+
const activeEl = this.doc.activeElement;
|
|
413
|
+
const host = this.elementRef.nativeElement;
|
|
414
|
+
if (activeEl instanceof HTMLElement && host.contains(activeEl)) {
|
|
415
|
+
activeEl.blur();
|
|
416
|
+
}
|
|
296
417
|
queueMicrotask(() => target?.focus());
|
|
297
418
|
}
|
|
298
419
|
wasOverlayActive = active;
|
|
@@ -301,18 +422,6 @@ class CngxSidenav {
|
|
|
301
422
|
this.focusTrap.destroy();
|
|
302
423
|
this.resizeAbort?.abort();
|
|
303
424
|
});
|
|
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
425
|
// Global hotkey: document listener inside effect(onCleanup) so the combo
|
|
317
426
|
// signal can re-register at runtime. Host listeners cannot rebind.
|
|
318
427
|
const isMac = this.win?.navigator?.userAgent?.includes('Mac') ?? false;
|
|
@@ -325,7 +434,11 @@ class CngxSidenav {
|
|
|
325
434
|
const handler = (e) => {
|
|
326
435
|
if (matchesKeyCombo(e, combo, isMac)) {
|
|
327
436
|
e.preventDefault();
|
|
328
|
-
|
|
437
|
+
// Through toggle(), not a raw opened flip: close() no-ops in the
|
|
438
|
+
// always-visible modes, so the hotkey cannot desync the model (and
|
|
439
|
+
// a router sync would not write ?nav=closed on a rail that stays
|
|
440
|
+
// visually open).
|
|
441
|
+
this.toggle();
|
|
329
442
|
}
|
|
330
443
|
};
|
|
331
444
|
this.doc.addEventListener('keydown', handler);
|
|
@@ -336,8 +449,9 @@ class CngxSidenav {
|
|
|
336
449
|
// overlay mode auto-opens the rail once. Guarded by the current/previous
|
|
337
450
|
// compare so it fires only on the transition edge.
|
|
338
451
|
effect(() => {
|
|
339
|
-
const
|
|
340
|
-
|
|
452
|
+
const current = this.modeTransition.current();
|
|
453
|
+
const previous = this.modeTransition.previous();
|
|
454
|
+
if (current === previous) {
|
|
341
455
|
return;
|
|
342
456
|
}
|
|
343
457
|
const alwaysVisible = (m) => m === 'side' || m === 'mini';
|
|
@@ -396,13 +510,89 @@ class CngxSidenav {
|
|
|
396
510
|
collapse() {
|
|
397
511
|
this.expandedState.set(false);
|
|
398
512
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
513
|
+
// px-strict: a rem/ch width must not leak a lying aria-valuenow (parseInt
|
|
514
|
+
// on '17.5rem' is 17, below the min). Null omits the attribute instead.
|
|
515
|
+
/** @internal Numeric px of the current width, or null for non-px units. */
|
|
516
|
+
widthPx = computed(() => parsePx(this.width()), ...(ngDevMode ? [{ debugName: "widthPx" }] : /* istanbul ignore next */ []));
|
|
517
|
+
minWidthPx = computed(() => parsePx(this.minWidth()), ...(ngDevMode ? [{ debugName: "minWidthPx" }] : /* istanbul ignore next */ []));
|
|
518
|
+
maxWidthPx = computed(() => parsePx(this.maxWidth()), ...(ngDevMode ? [{ debugName: "maxWidthPx" }] : /* istanbul ignore next */ []));
|
|
519
|
+
/**
|
|
520
|
+
* Rect-measured width for non-px rails: seeded after first render (a
|
|
521
|
+
* focusable separator must expose `aria-valuenow` before it is ever
|
|
522
|
+
* focused) and refreshed each time the separator gains focus, so the value
|
|
523
|
+
* AT reads at interaction time is current.
|
|
524
|
+
*/
|
|
525
|
+
measuredWidthPx = signal(null, ...(ngDevMode ? [{ debugName: "measuredWidthPx" }] : /* istanbul ignore next */ []));
|
|
526
|
+
/**
|
|
527
|
+
* @internal `aria-valuenow` of the separator: the px width when parseable,
|
|
528
|
+
* else the rect measurement - the window-splitter pattern wants a valuenow
|
|
529
|
+
* on a focusable separator even for rem-sized rails.
|
|
530
|
+
*/
|
|
531
|
+
widthValueNow = computed(() => this.widthPx() ?? this.measuredWidthPx(), ...(ngDevMode ? [{ debugName: "widthValueNow" }] : /* istanbul ignore next */ []));
|
|
532
|
+
/**
|
|
533
|
+
* @internal `aria-valuetext` of the separator: its position as a percent of
|
|
534
|
+
* the min-max range, formatted in the locale, so AT speaks where the handle
|
|
535
|
+
* sits instead of a bare pixel count. `null` (AT reads `aria-valuenow`) while
|
|
536
|
+
* the width or a bound is not in px.
|
|
537
|
+
*/
|
|
538
|
+
widthValueText = computed(() => {
|
|
539
|
+
const width = this.widthValueNow();
|
|
540
|
+
const min = this.minWidthPx();
|
|
541
|
+
const max = this.maxWidthPx();
|
|
542
|
+
if (width === null || min === null || max === null || max <= min) {
|
|
543
|
+
return null;
|
|
544
|
+
}
|
|
545
|
+
const percent = Math.round(clamp((width - min) / (max - min), 0, 1) * 100);
|
|
546
|
+
const formatted = numberFormatterFor(this.locale(), PERCENT_FORMAT).format(percent / 100);
|
|
547
|
+
return this.labels().resizeValueText(percent, formatted);
|
|
548
|
+
}, ...(ngDevMode ? [{ debugName: "widthValueText" }] : /* istanbul ignore next */ []));
|
|
549
|
+
measureWidth() {
|
|
550
|
+
const el = this.elementRef.nativeElement;
|
|
551
|
+
this.measuredWidthPx.set(Math.round(el.getBoundingClientRect().width) || null);
|
|
552
|
+
}
|
|
553
|
+
/** @internal Refresh the measurement the moment AT is about to read it. */
|
|
554
|
+
handleResizeFocus() {
|
|
555
|
+
this.measureWidth();
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* @internal Arrow-key resize on the separator, so the handle is operable
|
|
559
|
+
* without a pointer (WCAG 2.1.1): arrows step by 16px (direction-aware for
|
|
560
|
+
* `position="end"`), Home/End jump to the min/max constraint. Any modified
|
|
561
|
+
* key (shift included) passes through untouched - browser and AT shortcuts
|
|
562
|
+
* stay theirs.
|
|
563
|
+
*/
|
|
564
|
+
handleResizeKeydown(event) {
|
|
565
|
+
if (!this.resizable() || event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) {
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
const el = this.elementRef.nativeElement;
|
|
569
|
+
const current = el.getBoundingClientRect().width;
|
|
570
|
+
const min = this.minWidthPx() ?? 120;
|
|
571
|
+
const max = this.maxWidthPx() ?? 600;
|
|
572
|
+
const isEnd = this.position() === 'end';
|
|
573
|
+
let target;
|
|
574
|
+
switch (event.key) {
|
|
575
|
+
case 'ArrowRight':
|
|
576
|
+
target = current + (isEnd ? -RESIZE_KEY_STEP : RESIZE_KEY_STEP);
|
|
577
|
+
break;
|
|
578
|
+
case 'ArrowLeft':
|
|
579
|
+
target = current + (isEnd ? RESIZE_KEY_STEP : -RESIZE_KEY_STEP);
|
|
580
|
+
break;
|
|
581
|
+
case 'Home':
|
|
582
|
+
target = min;
|
|
583
|
+
break;
|
|
584
|
+
case 'End':
|
|
585
|
+
target = max;
|
|
586
|
+
break;
|
|
587
|
+
default:
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
event.preventDefault();
|
|
591
|
+
this.width.set(`${Math.round(Math.max(min, Math.min(max, target)))}px`);
|
|
592
|
+
}
|
|
403
593
|
/** @internal */
|
|
404
594
|
handleResizeStart(e) {
|
|
405
|
-
if (!this.resizable()) {
|
|
595
|
+
if (!this.resizable() || this.effectiveMode() === 'mini') {
|
|
406
596
|
return;
|
|
407
597
|
}
|
|
408
598
|
e.preventDefault();
|
|
@@ -412,8 +602,8 @@ class CngxSidenav {
|
|
|
412
602
|
const el = this.elementRef.nativeElement;
|
|
413
603
|
const startWidth = el.getBoundingClientRect().width;
|
|
414
604
|
const isEnd = this.position() === 'end';
|
|
415
|
-
const min = this.minWidthPx();
|
|
416
|
-
const max = this.maxWidthPx();
|
|
605
|
+
const min = this.minWidthPx() ?? 120;
|
|
606
|
+
const max = this.maxWidthPx() ?? 600;
|
|
417
607
|
let currentWidth = startWidth;
|
|
418
608
|
let rafId = 0;
|
|
419
609
|
// One controller per drag removes both document listeners in a single abort:
|
|
@@ -444,7 +634,7 @@ class CngxSidenav {
|
|
|
444
634
|
this.doc.addEventListener('pointerup', onUp, { signal: controller.signal });
|
|
445
635
|
}
|
|
446
636
|
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 },
|
|
637
|
+
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
638
|
{ provide: CNGX_HOVER_INTENT_DEFAULTS, useFactory: () => injectSidenavConfig().hover ?? {} },
|
|
449
639
|
{ provide: CNGX_SIDENAV, useExisting: CngxSidenav },
|
|
450
640
|
], exportAs: ["cngxSidenav"], hostDirectives: [{ directive: i1.CngxHoverIntent, inputs: ["enterDelay", "expandDelay", "leaveDelay", "collapseDelay"] }], ngImport: i0, template: `
|
|
@@ -453,18 +643,25 @@ class CngxSidenav {
|
|
|
453
643
|
<ng-content />
|
|
454
644
|
</div>
|
|
455
645
|
<ng-content select="cngx-sidenav-footer, [cngxSidenavFooter]" />
|
|
456
|
-
|
|
646
|
+
<!-- No handle in mini mode: the collapsed rail has a fixed width, and a
|
|
647
|
+
drag there would leave a stale inline width var on the rail. -->
|
|
648
|
+
@if (resizable() && effectiveMode() !== 'mini') {
|
|
457
649
|
<div
|
|
458
650
|
class="cngx-sidenav__resize-handle"
|
|
459
651
|
(pointerdown)="handleResizeStart($event)"
|
|
652
|
+
(keydown)="handleResizeKeydown($event)"
|
|
653
|
+
(focus)="handleResizeFocus()"
|
|
460
654
|
role="separator"
|
|
655
|
+
tabindex="0"
|
|
656
|
+
[attr.aria-label]="resolvedResizeLabel()"
|
|
461
657
|
[attr.aria-orientation]="'vertical'"
|
|
462
|
-
[attr.aria-valuenow]="
|
|
658
|
+
[attr.aria-valuenow]="widthValueNow()"
|
|
659
|
+
[attr.aria-valuetext]="widthValueText()"
|
|
463
660
|
[attr.aria-valuemin]="minWidthPx()"
|
|
464
661
|
[attr.aria-valuemax]="maxWidthPx()"
|
|
465
662
|
></div>
|
|
466
663
|
}
|
|
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 });
|
|
664
|
+
`, 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
665
|
}
|
|
469
666
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxSidenav, decorators: [{
|
|
470
667
|
type: Component,
|
|
@@ -501,19 +698,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
501
698
|
<ng-content />
|
|
502
699
|
</div>
|
|
503
700
|
<ng-content select="cngx-sidenav-footer, [cngxSidenavFooter]" />
|
|
504
|
-
|
|
701
|
+
<!-- No handle in mini mode: the collapsed rail has a fixed width, and a
|
|
702
|
+
drag there would leave a stale inline width var on the rail. -->
|
|
703
|
+
@if (resizable() && effectiveMode() !== 'mini') {
|
|
505
704
|
<div
|
|
506
705
|
class="cngx-sidenav__resize-handle"
|
|
507
706
|
(pointerdown)="handleResizeStart($event)"
|
|
707
|
+
(keydown)="handleResizeKeydown($event)"
|
|
708
|
+
(focus)="handleResizeFocus()"
|
|
508
709
|
role="separator"
|
|
710
|
+
tabindex="0"
|
|
711
|
+
[attr.aria-label]="resolvedResizeLabel()"
|
|
509
712
|
[attr.aria-orientation]="'vertical'"
|
|
510
|
-
[attr.aria-valuenow]="
|
|
713
|
+
[attr.aria-valuenow]="widthValueNow()"
|
|
714
|
+
[attr.aria-valuetext]="widthValueText()"
|
|
511
715
|
[attr.aria-valuemin]="minWidthPx()"
|
|
512
716
|
[attr.aria-valuemax]="maxWidthPx()"
|
|
513
717
|
></div>
|
|
514
718
|
}
|
|
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 }] }],
|
|
719
|
+
`, 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"] }]
|
|
720
|
+
}], 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"] }] } });
|
|
721
|
+
/** Per-keypress width change of the arrow-key resize, in px. */
|
|
722
|
+
const RESIZE_KEY_STEP = 16;
|
|
723
|
+
/**
|
|
724
|
+
* Numeric value of a px-unit (or unitless) CSS length, `null` for any other
|
|
725
|
+
* unit. rem/ch widths cannot be resolved without layout, and a guessed number
|
|
726
|
+
* would surface as a lying `aria-valuenow`.
|
|
727
|
+
*/
|
|
728
|
+
function parsePx(value) {
|
|
729
|
+
const match = /^\s*(\d+(?:\.\d+)?)(?:px)?\s*$/.exec(value);
|
|
730
|
+
return match ? Number.parseFloat(match[1]) : null;
|
|
731
|
+
}
|
|
517
732
|
|
|
518
733
|
/**
|
|
519
734
|
* Container for one or two `CngxSidenav` panels and a `CngxSidenavContent`.
|
|
@@ -521,11 +736,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
521
736
|
* Manages shared backdrop, scroll lock, and click-outside coordination.
|
|
522
737
|
* Supports up to two sidenavs: one `position="start"` and one `position="end"`.
|
|
523
738
|
*
|
|
739
|
+
* It is also the query container the rails resolve their `'auto'` mode
|
|
740
|
+
* against: the stylesheet declares and names the container
|
|
741
|
+
* (`cngx-sidenav-layout`) and carries the single docking threshold, the
|
|
742
|
+
* composed `CngxContainer` observes it and publishes the resolved value. A
|
|
743
|
+
* rail mounted without this layout has no container and falls back to
|
|
744
|
+
* `over`.
|
|
745
|
+
*
|
|
524
746
|
* ### Dual sidebar
|
|
525
747
|
* ```html
|
|
526
748
|
* <cngx-sidenav-layout>
|
|
527
|
-
* <cngx-sidenav position="start" [(opened)]="navOpen"
|
|
528
|
-
* [responsive]="'(min-width: 1024px)'">
|
|
749
|
+
* <cngx-sidenav position="start" [(opened)]="navOpen">
|
|
529
750
|
* Left nav
|
|
530
751
|
* </cngx-sidenav>
|
|
531
752
|
* <cngx-sidenav-content>
|
|
@@ -545,8 +766,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
545
766
|
* @relatedTo CngxSidenav, CngxSidenavContent, CngxSidenavHeader, CngxSidenavFooter
|
|
546
767
|
*/
|
|
547
768
|
class CngxSidenavLayout {
|
|
548
|
-
|
|
549
|
-
|
|
769
|
+
readyState = signal(false, ...(ngDevMode ? [{ debugName: "readyState" }] : /* istanbul ignore next */ []));
|
|
770
|
+
/** @internal First render done - gates transitions against an open-on-load flash. */
|
|
771
|
+
ready = this.readyState.asReadonly();
|
|
550
772
|
sidenavs = contentChildren(CngxSidenav, ...(ngDevMode ? [{ debugName: "sidenavs" }] : /* istanbul ignore next */ []));
|
|
551
773
|
/** The start-positioned sidenav, if any. */
|
|
552
774
|
startSidenav = computed(() => this.sidenavs().find((s) => s.position() === 'start') ?? null, ...(ngDevMode ? [{ debugName: "startSidenav" }] : /* istanbul ignore next */ []));
|
|
@@ -557,31 +779,33 @@ class CngxSidenavLayout {
|
|
|
557
779
|
constructor() {
|
|
558
780
|
const doc = inject(DOCUMENT);
|
|
559
781
|
// Gate transitions until after first render - prevents open-on-load flash.
|
|
560
|
-
afterNextRender(() => this.
|
|
782
|
+
afterNextRender(() => this.readyState.set(true));
|
|
561
783
|
// Dataset ref-counting matches CngxScrollLock so concurrent lock sources
|
|
562
|
-
// do not clobber each other's restore values.
|
|
784
|
+
// do not clobber each other's restore values. `locked` is a plain
|
|
785
|
+
// variable, not a signal: the effect only needs to TRACK hasOverlay(),
|
|
786
|
+
// and a signal read+written in the same effect is the loop-risk shape.
|
|
563
787
|
const html = doc.documentElement;
|
|
564
|
-
|
|
788
|
+
let locked = false;
|
|
565
789
|
effect(() => {
|
|
566
|
-
if (this.hasOverlay() && !locked
|
|
790
|
+
if (this.hasOverlay() && !locked) {
|
|
567
791
|
if (!html.dataset['cngxPrevOverflow']) {
|
|
568
792
|
html.dataset['cngxPrevOverflow'] = html.style.overflow;
|
|
569
793
|
html.dataset['cngxPrevScrollbarGutter'] = html.style.scrollbarGutter;
|
|
570
794
|
}
|
|
571
795
|
html.style.overflow = 'hidden';
|
|
572
796
|
html.style.scrollbarGutter = 'stable';
|
|
573
|
-
locked
|
|
797
|
+
locked = true;
|
|
574
798
|
}
|
|
575
|
-
else if (!this.hasOverlay() && locked
|
|
799
|
+
else if (!this.hasOverlay() && locked) {
|
|
576
800
|
html.style.overflow = html.dataset['cngxPrevOverflow'] ?? '';
|
|
577
801
|
html.style.scrollbarGutter = html.dataset['cngxPrevScrollbarGutter'] ?? '';
|
|
578
802
|
delete html.dataset['cngxPrevOverflow'];
|
|
579
803
|
delete html.dataset['cngxPrevScrollbarGutter'];
|
|
580
|
-
locked
|
|
804
|
+
locked = false;
|
|
581
805
|
}
|
|
582
806
|
});
|
|
583
807
|
inject(DestroyRef).onDestroy(() => {
|
|
584
|
-
if (locked
|
|
808
|
+
if (locked) {
|
|
585
809
|
html.style.overflow = html.dataset['cngxPrevOverflow'] ?? '';
|
|
586
810
|
html.style.scrollbarGutter = html.dataset['cngxPrevScrollbarGutter'] ?? '';
|
|
587
811
|
delete html.dataset['cngxPrevOverflow'];
|
|
@@ -615,18 +839,18 @@ class CngxSidenavLayout {
|
|
|
615
839
|
}
|
|
616
840
|
}
|
|
617
841
|
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: `
|
|
842
|
+
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
843
|
<ng-content select="cngx-sidenav[position=start], cngx-sidenav:not([position])" />
|
|
620
844
|
<ng-content select="cngx-sidenav-content" />
|
|
621
845
|
<ng-content select="cngx-sidenav[position=end]" />
|
|
622
846
|
@if (hasOverlay()) {
|
|
623
847
|
<div class="cngx-sidenav-backdrop" (click)="closeAllOverlays()"></div>
|
|
624
848
|
}
|
|
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 });
|
|
849
|
+
`, 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
850
|
}
|
|
627
851
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxSidenavLayout, decorators: [{
|
|
628
852
|
type: Component,
|
|
629
|
-
args: [{ selector: 'cngx-sidenav-layout', exportAs: 'cngxSidenavLayout', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
853
|
+
args: [{ selector: 'cngx-sidenav-layout', exportAs: 'cngxSidenavLayout', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, hostDirectives: [CngxContainer], host: {
|
|
630
854
|
'[class.cngx-sidenav-layout]': 'true',
|
|
631
855
|
'[class.cngx-sidenav-layout--ready]': 'ready()',
|
|
632
856
|
'[class.cngx-sidenav-layout--has-overlay]': 'hasOverlay()',
|
|
@@ -637,7 +861,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
637
861
|
@if (hasOverlay()) {
|
|
638
862
|
<div class="cngx-sidenav-backdrop" (click)="closeAllOverlays()"></div>
|
|
639
863
|
}
|
|
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"] }]
|
|
864
|
+
`, 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
865
|
}], ctorParameters: () => [], propDecorators: { sidenavs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CngxSidenav), { isSignal: true }] }] } });
|
|
642
866
|
|
|
643
867
|
/**
|
|
@@ -660,7 +884,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
660
884
|
* <example-url>http://localhost:4200/#/ui/sidenav/router-sync/deep-linkable-overlay</example-url>
|
|
661
885
|
*/
|
|
662
886
|
class CngxSidenavRouterSync {
|
|
663
|
-
sidenav =
|
|
887
|
+
sidenav = injectRouterSyncSidenav();
|
|
664
888
|
cfg = injectSidenavConfig();
|
|
665
889
|
/**
|
|
666
890
|
* Raw `[param]` input. Read the resolved {@link param} computed instead.
|
|
@@ -690,6 +914,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
690
914
|
standalone: true,
|
|
691
915
|
}]
|
|
692
916
|
}], ctorParameters: () => [], propDecorators: { paramInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "param", required: false }] }], syncError: [{ type: i0.Output, args: ["syncError"] }] } });
|
|
917
|
+
function injectRouterSyncSidenav() {
|
|
918
|
+
const sidenav = inject(CNGX_SIDENAV, { host: true, optional: true });
|
|
919
|
+
if (!sidenav) {
|
|
920
|
+
throw new CngxRuntimeError('CNGX3021', typeof ngDevMode !== 'undefined' &&
|
|
921
|
+
ngDevMode &&
|
|
922
|
+
'[cngxSidenavRouterSync] must be placed on or inside <cngx-sidenav>.');
|
|
923
|
+
}
|
|
924
|
+
return sidenav;
|
|
925
|
+
}
|
|
693
926
|
|
|
694
927
|
/**
|
|
695
928
|
* Main content area within a `CngxSidenavLayout`.
|
|
@@ -717,7 +950,9 @@ class CngxSidenavContent {
|
|
|
717
950
|
layout = inject(CngxSidenavLayout, { optional: true });
|
|
718
951
|
constructor() {
|
|
719
952
|
if (!this.layout) {
|
|
720
|
-
throw new
|
|
953
|
+
throw new CngxRuntimeError('CNGX3014', typeof ngDevMode !== 'undefined' &&
|
|
954
|
+
ngDevMode &&
|
|
955
|
+
'[cngx-sidenav-content] must be placed inside <cngx-sidenav-layout>.');
|
|
721
956
|
}
|
|
722
957
|
}
|
|
723
958
|
/**
|
|
@@ -869,12 +1104,12 @@ function reduceFeatures(features) {
|
|
|
869
1104
|
case 'routerSync':
|
|
870
1105
|
out.routerSync = { ...out.routerSync, ...f.payload };
|
|
871
1106
|
break;
|
|
872
|
-
case 'responsive':
|
|
873
|
-
out.responsive = f.payload.responsive;
|
|
874
|
-
break;
|
|
875
1107
|
case 'shortcut':
|
|
876
1108
|
out.shortcut = f.payload.shortcut;
|
|
877
1109
|
break;
|
|
1110
|
+
case 'labels':
|
|
1111
|
+
out.labels = f.payload.labels;
|
|
1112
|
+
break;
|
|
878
1113
|
}
|
|
879
1114
|
}
|
|
880
1115
|
return out;
|
|
@@ -882,8 +1117,8 @@ function reduceFeatures(features) {
|
|
|
882
1117
|
/**
|
|
883
1118
|
* Two-level deep merge: the nested sub-tree keys (`dimensions` / `hover`) are
|
|
884
1119
|
* spread-merged so the partial fills in missing keys without nuking unrelated
|
|
885
|
-
* config sub-trees; the flat top-level
|
|
886
|
-
*
|
|
1120
|
+
* config sub-trees; the flat top-level scalar (`shortcut`) takes the partial
|
|
1121
|
+
* when present, else the base. Inner objects are flat (one level),
|
|
887
1122
|
* so a single spread per key suffices. Invariant: a config key nested more than
|
|
888
1123
|
* one level deep would shallow-merge silently here - if the config ever grows a
|
|
889
1124
|
* deeper sub-tree, add a dedicated spread for it rather than relying on this
|
|
@@ -896,13 +1131,13 @@ function mergeConfig(base, partial) {
|
|
|
896
1131
|
dimensions: { ...base.dimensions, ...partial.dimensions },
|
|
897
1132
|
hover: { ...base.hover, ...partial.hover },
|
|
898
1133
|
routerSync: { ...base.routerSync, ...partial.routerSync },
|
|
899
|
-
responsive: partial.responsive ?? base.responsive,
|
|
900
1134
|
shortcut: partial.shortcut ?? base.shortcut,
|
|
1135
|
+
labels: partial.labels ?? base.labels,
|
|
901
1136
|
};
|
|
902
1137
|
}
|
|
903
1138
|
/**
|
|
904
1139
|
* Application-root configuration cascade for the sidenav family. Pass any
|
|
905
|
-
* combination of `withSidenavDimensions`,
|
|
1140
|
+
* combination of `withSidenavDimensions`,
|
|
906
1141
|
* `withSidenavShortcut`, `withSidenavHoverDwell`, and `withSidenavRouterSync`
|
|
907
1142
|
* features in `bootstrapApplication`'s providers array.
|
|
908
1143
|
*
|
|
@@ -1005,22 +1240,6 @@ function provideSidenavConfigAt(...features) {
|
|
|
1005
1240
|
function withSidenavDimensions(payload) {
|
|
1006
1241
|
return { kind: 'dimensions', payload };
|
|
1007
1242
|
}
|
|
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
1243
|
/**
|
|
1025
1244
|
* Set the app-wide default keyboard shortcut to toggle the sidenav (e.g.
|
|
1026
1245
|
* `'mod+b'`, which resolves to `ctrl` on Windows/Linux and `meta` on macOS).
|
|
@@ -1069,6 +1288,22 @@ function withSidenavHoverDwell(payload) {
|
|
|
1069
1288
|
function withSidenavRouterSync(payload) {
|
|
1070
1289
|
return { kind: 'routerSync', payload };
|
|
1071
1290
|
}
|
|
1291
|
+
/**
|
|
1292
|
+
* Override the app-wide sidenav copy. Unset keys read the `sidenav` section of
|
|
1293
|
+
* the language pack (English without one); pass a `Signal` of a partial bundle
|
|
1294
|
+
* to switch languages at runtime. A per-instance `[resizeLabel]` still wins
|
|
1295
|
+
* over `resizeHandle`. A later call replaces the whole bundle.
|
|
1296
|
+
*
|
|
1297
|
+
* ```ts
|
|
1298
|
+
* provideSidenavConfig(withSidenavLabels({ resizeHandle: 'Navigation anpassen' }));
|
|
1299
|
+
* ```
|
|
1300
|
+
*
|
|
1301
|
+
* @category ui/sidenav
|
|
1302
|
+
* @since 0.1.0
|
|
1303
|
+
*/
|
|
1304
|
+
function withSidenavLabels(labels) {
|
|
1305
|
+
return { kind: 'labels', payload: { labels } };
|
|
1306
|
+
}
|
|
1072
1307
|
|
|
1073
1308
|
/**
|
|
1074
1309
|
* @module @cngx/ui/sidenav
|
|
@@ -1078,5 +1313,5 @@ function withSidenavRouterSync(payload) {
|
|
|
1078
1313
|
* Generated bundle index. Do not edit.
|
|
1079
1314
|
*/
|
|
1080
1315
|
|
|
1081
|
-
export { CNGX_SIDENAV, CNGX_SIDENAV_CONFIG, CngxSidenav, CngxSidenavContent, CngxSidenavFooter, CngxSidenavHeader, CngxSidenavLayout, CngxSidenavRouterSync, injectSidenavConfig, provideSidenavConfig, provideSidenavConfigAt, withSidenavDimensions, withSidenavHoverDwell,
|
|
1316
|
+
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
1317
|
//# sourceMappingURL=cngx-ui-sidenav.mjs.map
|