codexly-ui 0.10.3 → 0.10.4
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/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -4,11 +4,11 @@ import { isPlatformBrowser, NgTemplateOutlet, DOCUMENT, NgStyle, CurrencyPipe, D
|
|
|
4
4
|
import * as i1$1 from '@angular/forms';
|
|
5
5
|
import { NG_VALUE_ACCESSOR, FormControl, NgControl, ReactiveFormsModule, FormGroup, Validators, FormsModule } from '@angular/forms';
|
|
6
6
|
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
|
-
import { startWith, map, debounceTime, distinctUntilChanged, switchMap, of, catchError } from 'rxjs';
|
|
7
|
+
import { startWith, map, debounceTime, distinctUntilChanged, switchMap, of, catchError, filter } from 'rxjs';
|
|
8
8
|
import * as i1 from '@angular/cdk/overlay';
|
|
9
9
|
import { ScrollStrategyOptions, OverlayModule } from '@angular/cdk/overlay';
|
|
10
10
|
import { ScrollingModule, CdkScrollable } from '@angular/cdk/scrolling';
|
|
11
|
-
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
11
|
+
import { Router, NavigationEnd, RouterLink, RouterLinkActive } from '@angular/router';
|
|
12
12
|
|
|
13
13
|
// ── Parse 'red' | 'red-500' → { color, shade } ───────────────────────────────
|
|
14
14
|
function parseColorInput(input) {
|
|
@@ -9442,6 +9442,14 @@ class ClxAppLayoutComponent {
|
|
|
9442
9442
|
const zone = inject(NgZone, { optional: true });
|
|
9443
9443
|
this._zone = zone ?? { run: (fn) => fn(), runOutsideAngular: (fn) => fn() };
|
|
9444
9444
|
this._document = inject(DOCUMENT);
|
|
9445
|
+
// On mobile the sidebar is an overlay drawer over the page content — leaving it open after
|
|
9446
|
+
// the user picks a menu item would hide the very page they just navigated to. Desktop is
|
|
9447
|
+
// unaffected: there the sidebar is a permanent rail, not an overlay, so it should stay as-is.
|
|
9448
|
+
const router = inject(Router, { optional: true });
|
|
9449
|
+
router?.events.pipe(filter((e) => e instanceof NavigationEnd), takeUntilDestroyed()).subscribe(() => {
|
|
9450
|
+
if (this._isMobile())
|
|
9451
|
+
this._sidebarOpen.set(false);
|
|
9452
|
+
});
|
|
9445
9453
|
}
|
|
9446
9454
|
_showBackdrop = computed(() => this._sidebarOpen() && this._isMobile(), ...(ngDevMode ? [{ debugName: "_showBackdrop" }] : /* istanbul ignore next */ []));
|
|
9447
9455
|
_isExpanded = computed(() => !this.collapsed() || this._hovered(), ...(ngDevMode ? [{ debugName: "_isExpanded" }] : /* istanbul ignore next */ []));
|