@lifecorner/angular-ui-kit 3.30.2 → 3.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/lifecorner-angular-ui-kit-bottom-nav.mjs +20 -3
- package/fesm2022/lifecorner-angular-ui-kit-bottom-nav.mjs.map +1 -1
- package/fesm2022/lifecorner-angular-ui-kit-combobox.mjs +25 -2
- package/fesm2022/lifecorner-angular-ui-kit-combobox.mjs.map +1 -1
- package/fesm2022/lifecorner-angular-ui-kit-select.mjs +6 -3
- package/fesm2022/lifecorner-angular-ui-kit-select.mjs.map +1 -1
- package/fesm2022/lifecorner-angular-ui-kit-sidenav.mjs +23 -2
- package/fesm2022/lifecorner-angular-ui-kit-sidenav.mjs.map +1 -1
- package/fesm2022/lifecorner-angular-ui-kit-tooltip.mjs +50 -9
- package/fesm2022/lifecorner-angular-ui-kit-tooltip.mjs.map +1 -1
- package/package.json +1 -1
- package/src/styles/_theme-dark.scss +9 -0
- package/src/styles/_theme-light.scss +9 -0
- package/src/styles/theme-modes.spec.ts +44 -0
- package/types/lifecorner-angular-ui-kit-bottom-nav.d.ts +30 -8
- package/types/lifecorner-angular-ui-kit-combobox.d.ts +22 -1
- package/types/lifecorner-angular-ui-kit-select.d.ts +9 -0
- package/types/lifecorner-angular-ui-kit-sidenav.d.ts +20 -1
- package/types/lifecorner-angular-ui-kit-tooltip.d.ts +28 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecorner-angular-ui-kit-sidenav.mjs","names":[],"sources":["../../../../libs/angular-ui-kit/src/lib/sidenav/sidenav.component.ts","../../../../libs/angular-ui-kit/src/lib/sidenav/sidenav.component.html"],"sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n signal,\n computed,\n input,\n output,\n model,\n effect,\n untracked,\n HostListener,\n OnDestroy,\n inject,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgTemplateOutlet, NgStyle } from '@angular/common';\nimport { NavigationEnd, Router, RouterLink } from '@angular/router';\nimport { filter } from 'rxjs';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { NavigationItem } from '@lifecorner/angular-ui-kit/models';\nimport {\n currentItemParents,\n currentNavigationItem,\n navigationLinks,\n navigationPath,\n sortNavigationItems,\n} from '@lifecorner/angular-ui-kit/internal/navigation';\nimport { IconComponent, ɵprovideKitIcons } from '@lifecorner/angular-ui-kit/icon';\nimport { ICON_CHEVRON_DOWN, ICON_CHEVRON_LEFT, ICON_CHEVRON_RIGHT } from '@lifecorner/angular-ui-kit/icons';\nimport { BadgeComponent } from '@lifecorner/angular-ui-kit/badge';\nimport { LogoComponent } from '@lifecorner/angular-ui-kit/logo';\n\nexport type SidenavPosition = 'left' | 'right';\nexport type SidenavMode = 'drawer' | 'docked';\n\n/**\n * Surface of the docked sidenav: `default` is the rail on `--color-sidebar`\n * with a border; `transparent` has no background and no border and draws the\n * items as 48 px pills (the side navigation on the page, \"Weite\"). A drawer\n * keeps its surface in both.\n */\nexport type SidenavVariant = 'default' | 'transparent';\n\n/**\n * Sidenav component for application navigation sidebar.\n *\n * Features:\n * - Drawer (overlay) and docked (persistent) modes\n * - Responsive mobile mode — docked automatically switches to drawer below a configurable breakpoint\n * - Collapsed icon-rail mode (narrow 56px sidebar with icons only and hover tooltips)\n * - Integrated logo area with collapse-toggle (sidebar-first layouts)\n * - Text brand (`brandName`, `brandIcon`): an icon tile and the product name,\n * one link to home (`brandHref`, else `routerLink=\"/\"`), as high as the\n * `lc-header` next to it; the rail shows only the tile. It never toggles:\n * `showCollapseToggle` adds a collapse button at the bottom of the rail\n * - Hierarchical navigation with collapsible groups (up to 3 levels)\n * - Section headlines for item grouping with optional action buttons\n * - Action buttons on any item (hover-reveal)\n * - Badge support on items (count / status indicator)\n * - One current item, announced and painted alike: the link for `activeRoute`\n * (or, without it, the one the router's URL matches) gets\n * `aria-current=\"page\"` and the current look, every other link neither\n * (AS-16). No hover color change on the current item\n * - Keyboard navigation support (Escape closes drawer)\n * - Configurable width and position (left/right)\n * - Optional backdrop overlay\n * - Theme variants: auto, light, dark (with teal accent for dark mode). The\n * theming hooks (`--lc-sidenav-bg`, `-fg`, `-fg-active`, `-border`,\n * `-hover-bg`, `-section-fg`, `-active-bg`, `-active-fg`, `-active-icon`,\n * `-badge-ring`) can be set on `lc-sidenav` or any ancestor (3.15); a value\n * on the element wins over an ancestor's, and both win over `theme` (3.14).\n * Set the same ones for `lc-sidenav-placeholder`, e.g. on a shared ancestor;\n * `--lc-sidenav-active-indicator`\n * (the current item's 2 px bar, default `--color-primary-500`; on a\n * `theme=\"light\"` rail #208497 on any page, like its focus rings),\n * `--lc-sidenav-brand-tile-bg` (default `--color-primary-fill`) and\n * `--lc-sidenav-brand-tile-fg` (default `--color-on-primary`) can be set on\n * any ancestor\n * - `variant=\"transparent\"`: no rail background or border, items as 48 px\n * pills with 16 px labels, the current one on `--color-surface-selected`\n * - Items are at least 44 px high in every density; the current item's ink is\n * `--color-on-surface-selected` (AA on the selected tint)\n * - Accessible: the inner `<nav>` is the navigation landmark; in drawer mode\n * the panel is a modal dialog (`role=\"dialog\"`, focus moved to the close\n * button on open, trapped while open, restored on close)\n *\n * @example\n * ```html\n * <lc-sidenav\n * [isOpen]=\"isOpen\"\n * mode=\"docked\"\n * [(collapsed)]=\"isCollapsed\"\n * [showLogo]=\"true\"\n * logoSize=\"md\"\n * [mobileBreakpoint]=\"768\"\n * [items]=\"navItems\"\n * activeRoute=\"/dashboard\"\n * theme=\"dark\"\n * (closed)=\"isOpen = false\"\n * (itemClicked)=\"navigate($event)\"\n * (itemAction)=\"onAction($event)\" />\n * ```\n */\n@Component({\n selector: 'lc-sidenav',\n standalone: true,\n imports: [NgTemplateOutlet, NgStyle, RouterLink, A11yModule, IconComponent, BadgeComponent, LogoComponent],\n viewProviders: [ɵprovideKitIcons([ICON_CHEVRON_DOWN, ICON_CHEVRON_LEFT, ICON_CHEVRON_RIGHT])],\n templateUrl: './sidenav.component.html',\n styleUrl: './sidenav.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.lc-sidenav-container]': 'true',\n '[class.lc-sidenav-container--docked]': \"effectiveMode() === 'docked'\",\n '[class.lc-sidenav-container--open]': 'isOpen()',\n // `theme` on the host (019): the themed values are private host variables\n // that the public `--lc-sidenav-*` hooks fall back to, so an app's hooks\n // on `lc-sidenav` win over `theme=\"dark\"` / `\"light\"`.\n '[class.lc-sidenav-container--light]': \"theme() === 'light'\",\n '[class.lc-sidenav-container--dark]': \"theme() === 'dark'\",\n },\n})\nexport class SidenavComponent implements OnDestroy {\n private readonly router = inject(Router);\n\n /**\n * The router's URL, updated on every `NavigationEnd`. Before the first\n * navigation it is the router's initial URL (`/`). Read only when\n * `activeRoute` is empty.\n */\n private readonly routerUrl = signal(this.router.url);\n\n /** Whether the sidenav is collapsed to icon-only rail (two-way bindable) */\n readonly collapsed = model(false);\n\n /** Whether to show the logo at the top of the sidenav */\n readonly showLogo = input(false);\n\n /** Custom URL for the full brand logo (forwarded to inner `<lc-logo>`). */\n readonly logoSrc = input('');\n /** Custom URL for the emblem-only brand logo. */\n readonly logoEmblemSrc = input('');\n /** Optional dark-theme URL for the full brand logo. */\n readonly logoDarkSrc = input('');\n /** Optional dark-theme URL for the emblem-only brand logo. */\n readonly logoDarkEmblemSrc = input('');\n /** Alt text for the brand logo. */\n readonly logoAlt = input('');\n\n /** Size of the brand logo (forwarded to inner `<lc-logo>`). Defaults to `md` for a prominent brand block aligned with `<lc-header size=\"md\">` (both 64px). Also sets the height of the text brand (`brandName`). */\n readonly logoSize = input<'xs' | 'sm' | 'md' | 'lg' | 'xl'>('md');\n\n /**\n * Product name shown as a text brand at the top: an icon tile and the name,\n * one link to home. Replaces the image logo (`showLogo`). The block is as\n * high as the image logo (`logoSize`: 64 px for `md`, matching\n * `lc-header size=\"md\"`); the name wraps to two lines at most, and the full\n * name stays the link's accessible name. Collapsed, only the tile shows.\n * The brand never toggles the rail (see `showCollapseToggle`). Under\n * `@defer`, give the `lc-sidenav-placeholder` `[showLogo]=\"true\"` and the\n * same `logoSize` to reserve the block. Empty: no text brand.\n * @default ''\n */\n readonly brandName = input('');\n\n /**\n * `lc-icon` name in the brand tile (decorative). Empty: the tile shows the\n * name's first letter. Renders nothing without `brandName`.\n * @default ''\n */\n readonly brandIcon = input('');\n\n /**\n * Plain URL of the brand link (a native `<a href>`, works without the\n * router). Empty: `routerLink=\"/\"`, as `lc-header`'s `homeHref`.\n * @default ''\n */\n readonly brandHref = input('');\n\n /**\n * Accessible name of the brand link. Empty: the brand name. Start it with\n * the visible name, e.g. `'Finance Intelligence – home'`.\n * @default ''\n */\n readonly brandAriaLabel = input('');\n\n /**\n * Docked mode: a button at the bottom of the rail collapses and expands it\n * (`collapsed`). Independent of the brand. With `showLogo` the image logo\n * toggles already, so use one of the two.\n * @default false\n */\n readonly showCollapseToggle = input(false);\n\n /**\n * Accessible name of the collapse button (`showCollapseToggle`) while the\n * rail is collapsed. Expanded, it uses `collapseAriaLabel`.\n * @default 'Expand navigation'\n */\n readonly expandAriaLabel = input('Expand navigation');\n\n /** Whether the sidenav is open */\n readonly isOpen = input(false);\n\n /** Display mode: 'drawer' (overlay) or 'docked' (persistent sidebar) */\n readonly mode = input<SidenavMode>('drawer');\n\n /** Mobile breakpoint in pixels. Below this width, docked mode switches to drawer. */\n readonly mobileBreakpoint = input(768);\n\n /** Whether the viewport is below the mobile breakpoint */\n readonly isMobile = signal(false);\n\n /** Effective mode: switches docked → drawer on mobile */\n readonly effectiveMode = computed(() => {\n if (this.isMobile() && this.mode() === 'docked') {\n return 'drawer' as SidenavMode;\n }\n return this.mode();\n });\n\n private mediaQuery: MediaQueryList | null = null;\n private mediaHandler = (e: MediaQueryListEvent) => this.isMobile.set(e.matches);\n\n /** Position of the sidenav (left or right) */\n readonly position = input<SidenavPosition>('left');\n\n /** Width of the sidenav drawer */\n readonly width = input('320px');\n\n /**\n * ARIA label of the navigation landmark (the inner `<nav>`) and, in drawer\n * mode, of the dialog panel.\n */\n readonly ariaLabel = input('Side navigation');\n\n /** Whether to show the overlay backdrop */\n readonly hasOverlay = input(true);\n\n /**\n * Navigation items (`NavigationItem[]`): `id`, `icon`, `label`, `route`,\n * `displayOrder` (sort order, 1 = first); optional `children`\n * (`NavigationItem[]`, a collapsible group, up to 3 levels), `isSection`\n * (renders `label` as a section headline over its `children`), `badge`\n * (`{ value: string | number; variant?: 'default' | 'primary' | 'success' |\n * 'warning' | 'error' | 'info' }`), `action` (`{ icon: string; ariaLabel?:\n * string }`, a button that emits `itemAction`), `requiredRole` (for the\n * app's own filtering; not evaluated here). Items link with `routerLink`;\n * exactly one link, the current item (see `activeRoute`), gets\n * `aria-current=\"page\"`.\n * @default []\n */\n readonly items = input<NavigationItem[]>([]);\n\n /**\n * The current route. When set, the first link (in display order) whose\n * `route` equals it is the current item: it alone gets `aria-current=\"page\"`\n * and the current look, whatever the router matches. When empty, the\n * sidenav follows the router: the link whose route equals the URL's path is\n * current, otherwise the one with the longest route the path starts with\n * (`/household` on `/household/members`; `/` only on `/`). Routes are\n * compared as written, so give them as absolute paths (`'/household'`).\n * @default ''\n */\n readonly activeRoute = input('');\n\n /** Theme variant for the sidenav */\n readonly theme = input<'light' | 'dark' | 'auto'>('auto');\n\n /**\n * Surface of the docked sidenav: `default` (the rail with background and\n * border) or `transparent` (no background, no border, items as 48 px pills\n * with radius full and 16 px labels; the current one on\n * `--color-surface-selected`). A drawer keeps its surface.\n */\n readonly variant = input<SidenavVariant>('default');\n\n /** Accessible name of the logo button that collapses/expands the sidebar. */\n readonly toggleAriaLabel = input('Toggle sidebar');\n\n /** Accessible name of the collapse button. Empty: \"Collapse navigation to the left/right\" by `position`. */\n readonly collapseAriaLabel = input('');\n\n /** Tooltip of the collapse button. */\n readonly collapseTitle = input('Collapse sidebar');\n\n /** Accessible name of the close button (drawer mode). */\n readonly closeAriaLabel = input('Close navigation');\n\n /**\n * Ids of the expanded parent items — the single source of truth for\n * `isExpanded`. Seeded with the current item's parent whenever it changes\n * (see constructor), so a group opens on navigation but can still\n * be collapsed by the user. (It used to be OR-ed with `hasActiveChild` at\n * read time, so toggling such a group flipped the set without ever closing\n * it — the set drifted out of sync with what was on screen.)\n */\n readonly expandedItems = signal<Set<string>>(new Set());\n\n /** Ids of the collapsible parents (top-level groups, section sub-groups) that contain the current item. */\n private readonly activeChildParents = computed(() => currentItemParents(this.items(), this.currentItem()));\n\n /**\n * Computed sorted navigation items by displayOrder\n */\n readonly sortedItems = computed(() => sortNavigationItems(this.items()));\n\n /**\n * Every item rendered as a link, in display order (depth first): simple\n * items, the children of a group, the children of a section, and the\n * children of a section's sub-group.\n */\n private readonly linkItems = computed(() => navigationLinks(this.sortedItems()));\n\n /** The router URL's path: primary outlet only, no query, fragment or matrix parameters. */\n private readonly routerPath = computed(() => navigationPath(this.router, this.routerUrl()));\n\n /**\n * The one current link (or none). The single source of both the current\n * look (`lc-sidenav__nav-item--active`) and `aria-current=\"page\"` (AS-16).\n * With `activeRoute` set: the first link whose route equals it. Without:\n * the router's path — the exact match wins, otherwise the longest link\n * route the path continues with a `/` (`/` matches only `/`); ties go to\n * the first link in display order. The rules live in\n * `internal/navigation` since 3.6, shared with `lc-sidenav-placeholder`.\n */\n private readonly currentItem = computed<NavigationItem | null>(() =>\n currentNavigationItem(this.linkItems(), this.activeRoute(), this.activeRoute() === '' ? this.routerPath() : ''),\n );\n\n /**\n * Event emitted when the sidenav should close\n */\n readonly closed = output<void>();\n\n /**\n * Event emitted when a navigation item is clicked\n */\n readonly itemClicked = output<NavigationItem>();\n\n /**\n * Event emitted when an item's action button is clicked\n */\n readonly itemAction = output<NavigationItem>();\n\n constructor() {\n this.router.events\n .pipe(\n filter((event): event is NavigationEnd => event instanceof NavigationEnd),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.routerUrl.set(this.router.url));\n\n // React to mobileBreakpoint changes\n effect(() => {\n this.mobileBreakpoint(); // track dependency\n this.setupMediaQuery();\n });\n\n // Navigating into a group opens it: add the active child's parent(s) to\n // the expanded set. Only additive — the user's own collapses/expands of\n // other groups survive a route change.\n effect(() => {\n const parents = this.activeChildParents();\n if (parents.length === 0) return;\n const expanded = untracked(this.expandedItems);\n if (parents.every((id) => expanded.has(id))) return;\n this.expandedItems.set(new Set([...expanded, ...parents]));\n });\n }\n\n ngOnDestroy(): void {\n this.teardownMediaQuery();\n }\n\n private setupMediaQuery(): void {\n if (typeof window === 'undefined') return;\n this.teardownMediaQuery();\n this.mediaQuery = window.matchMedia(`(max-width: ${this.mobileBreakpoint()}px)`);\n this.isMobile.set(this.mediaQuery.matches);\n this.mediaQuery.addEventListener('change', this.mediaHandler);\n }\n\n private teardownMediaQuery(): void {\n this.mediaQuery?.removeEventListener('change', this.mediaHandler);\n this.mediaQuery = null;\n }\n\n /**\n * Computed CSS classes for the sidenav\n */\n sidenavClasses = computed(() => {\n const classes = ['lc-sidenav'];\n classes.push(`lc-sidenav--${this.position()}`);\n classes.push(`lc-sidenav--${this.effectiveMode()}`);\n if (this.isOpen()) {\n classes.push('lc-sidenav--open');\n }\n if (this.collapsed() && !this.isMobile()) {\n classes.push('lc-sidenav--collapsed');\n }\n if (this.theme() !== 'auto') {\n classes.push(`lc-sidenav--${this.theme()}`);\n }\n if (this.variant() === 'transparent') {\n classes.push('lc-sidenav--transparent');\n }\n return classes.join(' ');\n });\n\n /**\n * Computed inline styles for the sidenav\n */\n sidenavStyles = computed(() => ({\n width: this.isMobile() ? this.width() : (this.collapsed() ? '56px' : this.width()),\n }));\n\n /** The brand tile's letter when there is no `brandIcon`: the name's first character, upper-cased. */\n protected readonly brandInitial = computed(() => ([...this.brandName().trim()][0] ?? '').toUpperCase());\n\n /** Whether the rail shows only icons (as `lc-sidenav--collapsed`). */\n protected readonly isRail = computed(() => this.collapsed() && !this.isMobile());\n\n /** The collapse button's accessible name: what a press does. */\n protected readonly collapseToggleLabel = computed(() =>\n this.collapsed()\n ? this.expandAriaLabel()\n : this.collapseAriaLabel() ||\n (this.position() === 'right' ? 'Collapse navigation to the right' : 'Collapse navigation to the left'),\n );\n\n /** The collapse button's chevron points where the rail moves: ⟨ to collapse a left rail, ⟩ to expand it (mirrored on the right). */\n protected readonly collapseToggleIcon = computed(() => {\n const towardsLeft = this.position() === 'right' ? this.collapsed() : !this.collapsed();\n return towardsLeft ? 'chevron-left' : 'chevron-right';\n });\n\n /**\n * Toggle collapsed state\n */\n toggleCollapsed(): void {\n this.collapsed.set(!this.collapsed());\n }\n\n /** The brand link closes the drawer on a phone, as the items do. */\n handleBrandClick(): void {\n if (this.isMobile()) {\n this.handleClose();\n }\n }\n\n /**\n * Handle close action\n */\n handleClose(): void {\n this.closed.emit();\n }\n\n /**\n * Handle navigation item click\n */\n handleItemClick(item: NavigationItem): void {\n this.itemClicked.emit(item);\n // Auto-close drawer on mobile after navigation\n if (this.isMobile()) {\n this.handleClose();\n }\n }\n\n /**\n * Handle action button click on a navigation item\n */\n handleItemAction(event: Event, item: NavigationItem): void {\n event.stopPropagation();\n this.itemAction.emit(item);\n }\n\n /**\n * Whether the item is the current link (see `currentItem`): it alone is\n * painted current and carries `aria-current=\"page\"`.\n */\n isItemActive(item: NavigationItem): boolean {\n return this.currentItem() === item;\n }\n\n /**\n * Check if a parent item contains the current link\n */\n hasActiveChild(item: NavigationItem): boolean {\n const current = this.currentItem();\n return !!current && !!item.children?.includes(current);\n }\n\n /**\n * Toggle expansion of a parent item.\n * If the sidenav is collapsed, expand it first.\n */\n toggleExpanded(item: NavigationItem): void {\n if (this.collapsed()) {\n this.collapsed.set(false);\n // Expand the clicked item after uncollapsing\n const expanded = new Set(this.expandedItems());\n expanded.add(item.id);\n this.expandedItems.set(expanded);\n return;\n }\n const expanded = new Set(this.expandedItems());\n if (expanded.has(item.id)) {\n expanded.delete(item.id);\n } else {\n expanded.add(item.id);\n }\n this.expandedItems.set(expanded);\n }\n\n /**\n * Check if an item is expanded\n */\n isExpanded(item: NavigationItem): boolean {\n return this.expandedItems().has(item.id);\n }\n\n /**\n * Handle keyboard navigation. Keyed on the EFFECTIVE mode: a docked sidenav\n * that has become a drawer below the mobile breakpoint must close on Escape\n * like any drawer.\n */\n @HostListener('document:keydown', ['$event'])\n handleKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.isOpen() && this.effectiveMode() === 'drawer') {\n this.handleClose();\n }\n }\n}\n","<!-- Drawer mode: render with overlay and conditional visibility -->\n@if (effectiveMode() === 'drawer') {\n @if (isOpen()) {\n <!-- Overlay backdrop -->\n @if (hasOverlay()) {\n <div\n class=\"lc-sidenav__overlay\"\n (click)=\"handleClose()\"\n aria-hidden=\"true\">\n </div>\n }\n\n <ng-container *ngTemplateOutlet=\"sidenavPanel\" />\n }\n}\n\n<!-- Docked mode: always render, visibility controlled by CSS -->\n@if (effectiveMode() === 'docked') {\n <ng-container *ngTemplateOutlet=\"sidenavPanel\" />\n}\n\n<!-- Shared sidenav panel template.\n The <aside> is a plain complementary region; the navigation landmark is\n the inner <nav> (nesting a role=\"navigation\" wrapper around a <nav> gave\n two navigation landmarks). In drawer mode the panel is a modal dialog:\n focus is captured (close button first, see cdkFocusInitial), trapped\n while open and restored to the opener when the panel is destroyed. -->\n<ng-template #sidenavPanel>\n <aside\n [class]=\"sidenavClasses()\"\n [ngStyle]=\"sidenavStyles()\"\n [attr.role]=\"effectiveMode() === 'drawer' ? 'dialog' : null\"\n [attr.aria-modal]=\"effectiveMode() === 'drawer' ? 'true' : null\"\n [attr.aria-label]=\"effectiveMode() === 'drawer' ? ariaLabel() : null\"\n [cdkTrapFocus]=\"effectiveMode() === 'drawer'\"\n [cdkTrapFocusAutoCapture]=\"effectiveMode() === 'drawer'\">\n\n <!-- Text brand (019): one link to home, never a toggle. Replaces the image logo. -->\n @if (brandName()) {\n <div\n class=\"lc-sidenav__logo lc-sidenav__logo--brand\"\n [class.lc-sidenav__logo--size-xs]=\"logoSize() === 'xs'\"\n [class.lc-sidenav__logo--size-sm]=\"logoSize() === 'sm'\"\n [class.lc-sidenav__logo--size-md]=\"logoSize() === 'md'\"\n [class.lc-sidenav__logo--size-lg]=\"logoSize() === 'lg'\"\n [class.lc-sidenav__logo--size-xl]=\"logoSize() === 'xl'\"\n >\n @if (brandHref()) {\n <!-- Plain link: works without the router and without JavaScript. -->\n <a\n [href]=\"brandHref()\"\n class=\"lc-sidenav__brand\"\n [attr.aria-label]=\"brandAriaLabel() || null\"\n [attr.data-tooltip]=\"brandName()\"\n (click)=\"handleBrandClick()\">\n <ng-container [ngTemplateOutlet]=\"brandContent\" />\n </a>\n } @else {\n <a\n routerLink=\"/\"\n class=\"lc-sidenav__brand\"\n [attr.aria-label]=\"brandAriaLabel() || null\"\n [attr.data-tooltip]=\"brandName()\"\n (click)=\"handleBrandClick()\">\n <ng-container [ngTemplateOutlet]=\"brandContent\" />\n </a>\n }\n </div>\n } @else if (showLogo()) {\n <!-- Logo area (sidebar-first layout) -->\n <div\n class=\"lc-sidenav__logo\"\n [class.lc-sidenav__logo--size-xs]=\"logoSize() === 'xs'\"\n [class.lc-sidenav__logo--size-sm]=\"logoSize() === 'sm'\"\n [class.lc-sidenav__logo--size-md]=\"logoSize() === 'md'\"\n [class.lc-sidenav__logo--size-lg]=\"logoSize() === 'lg'\"\n [class.lc-sidenav__logo--size-xl]=\"logoSize() === 'xl'\"\n >\n <button type=\"button\" class=\"lc-sidenav__logo-link\" [attr.aria-label]=\"toggleAriaLabel()\" (click)=\"toggleCollapsed()\">\n <lc-logo\n [variant]=\"collapsed() ? 'emblem' : 'full'\"\n [size]=\"collapsed() ? 'sm' : logoSize()\"\n [clickable]=\"false\"\n [colorMode]=\"theme() === 'dark' ? 'dark' : theme() === 'light' ? 'light' : 'auto'\"\n [src]=\"logoSrc()\"\n [emblemSrc]=\"logoEmblemSrc()\"\n [darkSrc]=\"logoDarkSrc()\"\n [darkEmblemSrc]=\"logoDarkEmblemSrc()\"\n [alt]=\"logoAlt() || 'Logo'\"\n />\n </button>\n @if (!collapsed() && effectiveMode() === 'docked') {\n <button\n type=\"button\"\n class=\"lc-sidenav__logo-toggle\"\n (click)=\"toggleCollapsed()\"\n [attr.aria-label]=\"collapseAriaLabel() || (position() === 'right' ? 'Collapse navigation to the right' : 'Collapse navigation to the left')\"\n [attr.title]=\"collapseTitle()\">\n <lc-icon\n [name]=\"position() === 'right' ? 'chevron-right' : 'chevron-left'\"\n size=\"sm\"\n [decorative]=\"true\" />\n </button>\n }\n </div>\n }\n\n <!-- Close button (drawer mode only) -->\n @if (effectiveMode() === 'drawer') {\n <button\n type=\"button\"\n class=\"lc-sidenav__close\"\n cdkFocusInitial\n (click)=\"handleClose()\"\n [attr.aria-label]=\"closeAriaLabel()\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n }\n\n <!-- Navigation items (if provided) -->\n @if (items().length > 0) {\n <nav\n class=\"lc-sidenav__nav\"\n [class.lc-sidenav__nav--docked]=\"effectiveMode() === 'docked'\"\n [attr.aria-label]=\"ariaLabel()\">\n @for (item of sortedItems(); track item.id) {\n <!-- Section headline -->\n @if (item.isSection) {\n <div class=\"lc-sidenav__section\">\n <div class=\"lc-sidenav__section-header\">\n <h2 class=\"lc-sidenav__section-title\">{{ item.label }}</h2>\n @if (item.action) {\n <button\n type=\"button\"\n class=\"lc-sidenav__action-btn\"\n [attr.aria-label]=\"item.action.ariaLabel || item.label + ' action'\"\n (click)=\"handleItemAction($event, item)\">\n <lc-icon [name]=\"item.action.icon\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </div>\n @if (item.children?.length) {\n <ul class=\"lc-sidenav__section-items\">\n @for (child of item.children; track child.id) {\n <li>\n @if (child.children?.length) {\n <!-- Section child with nested children (collapsible) -->\n <div class=\"lc-sidenav__nav-item-row\">\n <button\n type=\"button\"\n class=\"lc-sidenav__nav-item lc-sidenav__nav-item--parent\"\n [class.lc-sidenav__nav-item--expanded]=\"isExpanded(child)\"\n [class.lc-sidenav__nav-item--has-active-child]=\"hasActiveChild(child)\"\n (click)=\"toggleExpanded(child)\"\n [attr.aria-expanded]=\"isExpanded(child)\"\n [title]=\"collapsed() ? child.label : ''\">\n @if (child.icon) {\n <lc-icon [name]=\"child.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n }\n <span class=\"lc-sidenav__nav-label\">{{ child.label }}</span>\n @if (child.badge) {\n <lc-badge [variant]=\"child.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ child.badge.value }}</lc-badge>\n }\n <lc-icon name=\"chevron-down\" size=\"xs\" [decorative]=\"true\" class=\"lc-sidenav__nav-chevron\" />\n </button>\n @if (child.action) {\n <button\n type=\"button\"\n class=\"lc-sidenav__action-btn\"\n [attr.aria-label]=\"child.action.ariaLabel || child.label + ' action'\"\n (click)=\"handleItemAction($event, child)\">\n <lc-icon [name]=\"child.action.icon\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </div>\n @if (isExpanded(child)) {\n <div class=\"lc-sidenav__nav-children\">\n @for (grandchild of child.children; track grandchild.id) {\n <a\n [routerLink]=\"grandchild.route\"\n class=\"lc-sidenav__nav-item lc-sidenav__nav-item--child\"\n (click)=\"handleItemClick(grandchild)\"\n [class.lc-sidenav__nav-item--active]=\"isItemActive(grandchild)\"\n [attr.aria-current]=\"isItemActive(grandchild) ? 'page' : null\">\n @if (grandchild.icon) {\n <lc-icon [name]=\"grandchild.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n }\n <span class=\"lc-sidenav__nav-label\">{{ grandchild.label }}</span>\n @if (grandchild.badge) {\n <lc-badge [variant]=\"grandchild.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ grandchild.badge.value }}</lc-badge>\n }\n </a>\n }\n </div>\n }\n } @else {\n <!-- Section child (simple link) -->\n <div class=\"lc-sidenav__nav-item-row\">\n <a\n [routerLink]=\"child.route\"\n class=\"lc-sidenav__nav-item lc-sidenav__nav-item--child\"\n (click)=\"handleItemClick(child)\"\n [class.lc-sidenav__nav-item--active]=\"isItemActive(child)\"\n [attr.aria-current]=\"isItemActive(child) ? 'page' : null\"\n [title]=\"collapsed() ? child.label : ''\">\n @if (child.icon) {\n <lc-icon [name]=\"child.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n }\n <span class=\"lc-sidenav__nav-label\">{{ child.label }}</span>\n @if (child.badge) {\n <lc-badge [variant]=\"child.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ child.badge.value }}</lc-badge>\n }\n </a>\n @if (child.action) {\n <button\n type=\"button\"\n class=\"lc-sidenav__action-btn\"\n [attr.aria-label]=\"child.action.ariaLabel || child.label + ' action'\"\n (click)=\"handleItemAction($event, child)\">\n <lc-icon [name]=\"child.action.icon\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </div>\n }\n </li>\n }\n </ul>\n }\n </div>\n } @else if (item.children?.length) {\n <!-- Parent item with children (collapsible group) -->\n <div class=\"lc-sidenav__nav-item-row\">\n <button\n type=\"button\"\n class=\"lc-sidenav__nav-item lc-sidenav__nav-item--parent\"\n [class.lc-sidenav__nav-item--expanded]=\"isExpanded(item)\"\n [class.lc-sidenav__nav-item--has-active-child]=\"hasActiveChild(item)\"\n (click)=\"toggleExpanded(item)\"\n [attr.aria-expanded]=\"isExpanded(item)\"\n [title]=\"collapsed() ? item.label : ''\">\n <lc-icon [name]=\"item.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n <span class=\"lc-sidenav__nav-label\">{{ item.label }}</span>\n @if (item.badge) {\n <lc-badge [variant]=\"item.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ item.badge.value }}</lc-badge>\n }\n <lc-icon name=\"chevron-down\" size=\"xs\" [decorative]=\"true\" class=\"lc-sidenav__nav-chevron\" />\n </button>\n @if (item.action) {\n <button\n type=\"button\"\n class=\"lc-sidenav__action-btn\"\n [attr.aria-label]=\"item.action.ariaLabel || item.label + ' action'\"\n (click)=\"handleItemAction($event, item)\">\n <lc-icon [name]=\"item.action.icon\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </div>\n @if (isExpanded(item)) {\n <div class=\"lc-sidenav__nav-children\">\n @for (child of item.children; track child.id) {\n <a\n [routerLink]=\"child.route\"\n class=\"lc-sidenav__nav-item lc-sidenav__nav-item--child\"\n (click)=\"handleItemClick(child)\"\n [class.lc-sidenav__nav-item--active]=\"isItemActive(child)\"\n [attr.aria-current]=\"isItemActive(child) ? 'page' : null\">\n <lc-icon [name]=\"child.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n <span class=\"lc-sidenav__nav-label\">{{ child.label }}</span>\n @if (child.badge) {\n <lc-badge [variant]=\"child.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ child.badge.value }}</lc-badge>\n }\n </a>\n }\n </div>\n }\n } @else {\n <!-- Simple item without children -->\n <div class=\"lc-sidenav__nav-item-row\">\n <a\n [routerLink]=\"item.route\"\n class=\"lc-sidenav__nav-item\"\n (click)=\"handleItemClick(item)\"\n [class.lc-sidenav__nav-item--active]=\"isItemActive(item)\"\n [attr.aria-current]=\"isItemActive(item) ? 'page' : null\"\n [title]=\"collapsed() ? item.label : ''\">\n <lc-icon [name]=\"item.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n <span class=\"lc-sidenav__nav-label\">{{ item.label }}</span>\n @if (item.badge) {\n <lc-badge [variant]=\"item.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ item.badge.value }}</lc-badge>\n }\n </a>\n @if (item.action) {\n <button\n type=\"button\"\n class=\"lc-sidenav__action-btn\"\n [attr.aria-label]=\"item.action.ariaLabel || item.label + ' action'\"\n (click)=\"handleItemAction($event, item)\">\n <lc-icon [name]=\"item.action.icon\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </div>\n }\n }\n </nav>\n }\n\n <!-- Content projection (for custom content) -->\n <div class=\"lc-sidenav__content\" [class.lc-sidenav__content--docked]=\"effectiveMode() === 'docked'\">\n <ng-content></ng-content>\n </div>\n\n <!-- Collapse button at the bottom of the rail (019, docked only): on the icon column in both states. -->\n @if (showCollapseToggle() && effectiveMode() === 'docked') {\n <div class=\"lc-sidenav__collapse-row\">\n <button\n type=\"button\"\n class=\"lc-sidenav__collapse-toggle\"\n (click)=\"toggleCollapsed()\"\n [attr.aria-label]=\"collapseToggleLabel()\">\n <lc-icon\n [name]=\"collapseToggleIcon()\"\n size=\"sm\"\n [decorative]=\"true\" />\n </button>\n </div>\n }\n </aside>\n</ng-template>\n\n<!-- The brand link's content: the tile (decorative) and the name. -->\n<ng-template #brandContent>\n <span class=\"lc-sidenav__brand-tile\" aria-hidden=\"true\">\n @if (brandIcon()) {\n <lc-icon [name]=\"brandIcon()\" size=\"sm\" [decorative]=\"true\" />\n } @else {\n {{ brandInitial() }}\n }\n </span>\n <span class=\"lc-sidenav__brand-name\" [class.lc-sidenav__sr-only]=\"isRail()\">{{ brandName() }}</span>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;AA0HA,IAAa,mBAAb,MAAa,iBAAgB;CACV,SAAS,OAAO,MAAM;CAOtB,YAAY,OAAO,KAAK,OAAO,KAAI,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAG3C,YAAY,MAAM,OAAM,GAAA,YAAA,CAA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C;IAChC,wCAAwC;IACxC,sCAAsC;IAItC,uCAAuC;IACvC,sCAAsC;GACvC;GAAA,UAAA;GAAA,QAAA,CAAA,gojBAAA;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuZA,MAAA;GAAa,MAAA,CAAA,oBAAoB,CAAC,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"lifecorner-angular-ui-kit-sidenav.mjs","names":[],"sources":["../../../../libs/angular-ui-kit/src/lib/sidenav/sidenav.component.ts","../../../../libs/angular-ui-kit/src/lib/sidenav/sidenav.component.html"],"sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n signal,\n computed,\n input,\n output,\n model,\n effect,\n untracked,\n HostListener,\n OnDestroy,\n inject,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgTemplateOutlet, NgStyle } from '@angular/common';\nimport { NavigationEnd, Router, RouterLink } from '@angular/router';\nimport { filter } from 'rxjs';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { NavigationItem } from '@lifecorner/angular-ui-kit/models';\nimport {\n currentItemParents,\n currentNavigationItem,\n navigationLinks,\n navigationPath,\n sortNavigationItems,\n} from '@lifecorner/angular-ui-kit/internal/navigation';\nimport { IconComponent, ɵprovideKitIcons } from '@lifecorner/angular-ui-kit/icon';\nimport { ICON_CHEVRON_DOWN, ICON_CHEVRON_LEFT, ICON_CHEVRON_RIGHT } from '@lifecorner/angular-ui-kit/icons';\nimport { BadgeComponent } from '@lifecorner/angular-ui-kit/badge';\nimport { LogoComponent } from '@lifecorner/angular-ui-kit/logo';\n\nexport type SidenavPosition = 'left' | 'right';\nexport type SidenavMode = 'drawer' | 'docked';\n\n/**\n * Surface of the docked sidenav: `default` is the rail on `--color-sidebar`\n * with a border; `transparent` has no background and no border and draws the\n * items as 48 px pills (the side navigation on the page, \"Weite\"). A drawer\n * keeps its surface in both.\n */\nexport type SidenavVariant = 'default' | 'transparent';\n\n/**\n * Sidenav component for application navigation sidebar.\n *\n * Features:\n * - Drawer (overlay) and docked (persistent) modes\n * - Responsive mobile mode — docked automatically switches to drawer below a configurable breakpoint\n * - Collapsed icon-rail mode (narrow 56px sidebar with icons only and hover tooltips)\n * - Integrated logo area with collapse-toggle (sidebar-first layouts)\n * - Text brand (`brandName`, `brandIcon`): an icon tile and the product name,\n * one link to home (`brandHref`, else `routerLink=\"/\"`), as high as the\n * `lc-header` next to it; the rail shows only the tile. It never toggles:\n * `showCollapseToggle` adds a collapse button at the bottom of the rail\n * - Hierarchical navigation with collapsible groups (up to 3 levels)\n * - Section headlines for item grouping with optional action buttons\n * - Action buttons on any item (hover-reveal)\n * - Badge support on items (count / status indicator), read after the label\n * through `badgeAriaLabel` (3.31); on the collapsed rail the label and the\n * badge text name the item\n * - One current item, announced and painted alike: the link for `activeRoute`\n * (or, without it, the one the router's URL matches) gets\n * `aria-current=\"page\"` and the current look, every other link neither\n * (AS-16). No hover color change on the current item\n * - Keyboard navigation support (Escape closes drawer)\n * - Configurable width and position (left/right)\n * - Optional backdrop overlay\n * - Theme variants: auto, light, dark (with teal accent for dark mode). The\n * theming hooks (`--lc-sidenav-bg`, `-fg`, `-fg-active`, `-border`,\n * `-hover-bg`, `-section-fg`, `-active-bg`, `-active-fg`, `-active-icon`,\n * `-badge-ring`) can be set on `lc-sidenav` or any ancestor (3.15); a value\n * on the element wins over an ancestor's, and both win over `theme` (3.14).\n * Set the same ones for `lc-sidenav-placeholder`, e.g. on a shared ancestor;\n * `--lc-sidenav-active-indicator`\n * (the current item's 2 px bar, default `--color-primary-500`; on a\n * `theme=\"light\"` rail #208497 on any page, like its focus rings),\n * `--lc-sidenav-brand-tile-bg` (default `--color-primary-fill`) and\n * `--lc-sidenav-brand-tile-fg` (default `--color-on-primary`) can be set on\n * any ancestor\n * - `variant=\"transparent\"`: no rail background or border, items as 48 px\n * pills with 16 px labels, the current one on `--color-surface-selected`\n * - Items are at least 44 px high in every density; the current item's ink is\n * `--color-on-surface-selected` (AA on the selected tint)\n * - Accessible: the inner `<nav>` is the navigation landmark; in drawer mode\n * the panel is a modal dialog (`role=\"dialog\"`, focus moved to the close\n * button on open, trapped while open, restored on close)\n *\n * @example\n * ```html\n * <lc-sidenav\n * [isOpen]=\"isOpen\"\n * mode=\"docked\"\n * [(collapsed)]=\"isCollapsed\"\n * [showLogo]=\"true\"\n * logoSize=\"md\"\n * [mobileBreakpoint]=\"768\"\n * [items]=\"navItems\"\n * activeRoute=\"/dashboard\"\n * theme=\"dark\"\n * (closed)=\"isOpen = false\"\n * (itemClicked)=\"navigate($event)\"\n * (itemAction)=\"onAction($event)\" />\n * ```\n */\n@Component({\n selector: 'lc-sidenav',\n standalone: true,\n imports: [NgTemplateOutlet, NgStyle, RouterLink, A11yModule, IconComponent, BadgeComponent, LogoComponent],\n viewProviders: [ɵprovideKitIcons([ICON_CHEVRON_DOWN, ICON_CHEVRON_LEFT, ICON_CHEVRON_RIGHT])],\n templateUrl: './sidenav.component.html',\n styleUrl: './sidenav.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.lc-sidenav-container]': 'true',\n '[class.lc-sidenav-container--docked]': \"effectiveMode() === 'docked'\",\n '[class.lc-sidenav-container--open]': 'isOpen()',\n // `theme` on the host (019): the themed values are private host variables\n // that the public `--lc-sidenav-*` hooks fall back to, so an app's hooks\n // on `lc-sidenav` win over `theme=\"dark\"` / `\"light\"`.\n '[class.lc-sidenav-container--light]': \"theme() === 'light'\",\n '[class.lc-sidenav-container--dark]': \"theme() === 'dark'\",\n },\n})\nexport class SidenavComponent implements OnDestroy {\n private readonly router = inject(Router);\n\n /**\n * The router's URL, updated on every `NavigationEnd`. Before the first\n * navigation it is the router's initial URL (`/`). Read only when\n * `activeRoute` is empty.\n */\n private readonly routerUrl = signal(this.router.url);\n\n /** Whether the sidenav is collapsed to icon-only rail (two-way bindable) */\n readonly collapsed = model(false);\n\n /** Whether to show the logo at the top of the sidenav */\n readonly showLogo = input(false);\n\n /** Custom URL for the full brand logo (forwarded to inner `<lc-logo>`). */\n readonly logoSrc = input('');\n /** Custom URL for the emblem-only brand logo. */\n readonly logoEmblemSrc = input('');\n /** Optional dark-theme URL for the full brand logo. */\n readonly logoDarkSrc = input('');\n /** Optional dark-theme URL for the emblem-only brand logo. */\n readonly logoDarkEmblemSrc = input('');\n /** Alt text for the brand logo. */\n readonly logoAlt = input('');\n\n /** Size of the brand logo (forwarded to inner `<lc-logo>`). Defaults to `md` for a prominent brand block aligned with `<lc-header size=\"md\">` (both 64px). Also sets the height of the text brand (`brandName`). */\n readonly logoSize = input<'xs' | 'sm' | 'md' | 'lg' | 'xl'>('md');\n\n /**\n * Product name shown as a text brand at the top: an icon tile and the name,\n * one link to home. Replaces the image logo (`showLogo`). The block is as\n * high as the image logo (`logoSize`: 64 px for `md`, matching\n * `lc-header size=\"md\"`); the name wraps to two lines at most, and the full\n * name stays the link's accessible name. Collapsed, only the tile shows.\n * The brand never toggles the rail (see `showCollapseToggle`). Under\n * `@defer`, give the `lc-sidenav-placeholder` `[showLogo]=\"true\"` and the\n * same `logoSize` to reserve the block. Empty: no text brand.\n * @default ''\n */\n readonly brandName = input('');\n\n /**\n * `lc-icon` name in the brand tile (decorative). Empty: the tile shows the\n * name's first letter. Renders nothing without `brandName`.\n * @default ''\n */\n readonly brandIcon = input('');\n\n /**\n * Plain URL of the brand link (a native `<a href>`, works without the\n * router). Empty: `routerLink=\"/\"`, as `lc-header`'s `homeHref`.\n * @default ''\n */\n readonly brandHref = input('');\n\n /**\n * Accessible name of the brand link. Empty: the brand name. Start it with\n * the visible name, e.g. `'Finance Intelligence – home'`.\n * @default ''\n */\n readonly brandAriaLabel = input('');\n\n /**\n * Docked mode: a button at the bottom of the rail collapses and expands it\n * (`collapsed`). Independent of the brand. With `showLogo` the image logo\n * toggles already, so use one of the two.\n * @default false\n */\n readonly showCollapseToggle = input(false);\n\n /**\n * Accessible name of the collapse button (`showCollapseToggle`) while the\n * rail is collapsed. Expanded, it uses `collapseAriaLabel`.\n * @default 'Expand navigation'\n */\n readonly expandAriaLabel = input('Expand navigation');\n\n /** Whether the sidenav is open */\n readonly isOpen = input(false);\n\n /** Display mode: 'drawer' (overlay) or 'docked' (persistent sidebar) */\n readonly mode = input<SidenavMode>('drawer');\n\n /** Mobile breakpoint in pixels. Below this width, docked mode switches to drawer. */\n readonly mobileBreakpoint = input(768);\n\n /** Whether the viewport is below the mobile breakpoint */\n readonly isMobile = signal(false);\n\n /** Effective mode: switches docked → drawer on mobile */\n readonly effectiveMode = computed(() => {\n if (this.isMobile() && this.mode() === 'docked') {\n return 'drawer' as SidenavMode;\n }\n return this.mode();\n });\n\n private mediaQuery: MediaQueryList | null = null;\n private mediaHandler = (e: MediaQueryListEvent) => this.isMobile.set(e.matches);\n\n /** Position of the sidenav (left or right) */\n readonly position = input<SidenavPosition>('left');\n\n /** Width of the sidenav drawer */\n readonly width = input('320px');\n\n /**\n * ARIA label of the navigation landmark (the inner `<nav>`) and, in drawer\n * mode, of the dialog panel.\n */\n readonly ariaLabel = input('Side navigation');\n\n /** Whether to show the overlay backdrop */\n readonly hasOverlay = input(true);\n\n /**\n * Navigation items (`NavigationItem[]`): `id`, `icon`, `label`, `route`,\n * `displayOrder` (sort order, 1 = first); optional `children`\n * (`NavigationItem[]`, a collapsible group, up to 3 levels), `isSection`\n * (renders `label` as a section headline over its `children`), `badge`\n * (`{ value: string | number; variant?: 'default' | 'primary' | 'success' |\n * 'warning' | 'error' | 'info' }`), `action` (`{ icon: string; ariaLabel?:\n * string }`, a button that emits `itemAction`), `requiredRole` (for the\n * app's own filtering; not evaluated here). Items link with `routerLink`;\n * exactly one link, the current item (see `activeRoute`), gets\n * `aria-current=\"page\"`.\n * @default []\n */\n readonly items = input<NavigationItem[]>([]);\n\n /**\n * The current route. When set, the first link (in display order) whose\n * `route` equals it is the current item: it alone gets `aria-current=\"page\"`\n * and the current look, whatever the router matches. When empty, the\n * sidenav follows the router: the link whose route equals the URL's path is\n * current, otherwise the one with the longest route the path starts with\n * (`/household` on `/household/members`; `/` only on `/`). Routes are\n * compared as written, so give them as absolute paths (`'/household'`).\n * @default ''\n */\n readonly activeRoute = input('');\n\n /** Theme variant for the sidenav */\n readonly theme = input<'light' | 'dark' | 'auto'>('auto');\n\n /**\n * Surface of the docked sidenav: `default` (the rail with background and\n * border) or `transparent` (no background, no border, items as 48 px pills\n * with radius full and 16 px labels; the current one on\n * `--color-surface-selected`). A drawer keeps its surface.\n */\n readonly variant = input<SidenavVariant>('default');\n\n /** Accessible name of the logo button that collapses/expands the sidebar. */\n readonly toggleAriaLabel = input('Toggle sidebar');\n\n /** Accessible name of the collapse button. Empty: \"Collapse navigation to the left/right\" by `position`. */\n readonly collapseAriaLabel = input('');\n\n /** Tooltip of the collapse button. */\n readonly collapseTitle = input('Collapse sidebar');\n\n /** Accessible name of the close button (drawer mode). */\n readonly closeAriaLabel = input('Close navigation');\n\n /**\n * Text read after an item's label when it has a badge, at every level. On\n * the collapsed rail, where labels are hidden, the label and this text name\n * the item. `{value}` is replaced with the badge value, e.g.\n * `'{value} offen'` → \"Stammdaten 1 offen\". The badge itself is hidden from\n * screen readers. Empty: the badge isn't read.\n *\n * @default '{value}'\n */\n readonly badgeAriaLabel = input('{value}');\n\n /**\n * Ids of the expanded parent items — the single source of truth for\n * `isExpanded`. Seeded with the current item's parent whenever it changes\n * (see constructor), so a group opens on navigation but can still\n * be collapsed by the user. (It used to be OR-ed with `hasActiveChild` at\n * read time, so toggling such a group flipped the set without ever closing\n * it — the set drifted out of sync with what was on screen.)\n */\n readonly expandedItems = signal<Set<string>>(new Set());\n\n /** Ids of the collapsible parents (top-level groups, section sub-groups) that contain the current item. */\n private readonly activeChildParents = computed(() => currentItemParents(this.items(), this.currentItem()));\n\n /**\n * Computed sorted navigation items by displayOrder\n */\n readonly sortedItems = computed(() => sortNavigationItems(this.items()));\n\n /**\n * Every item rendered as a link, in display order (depth first): simple\n * items, the children of a group, the children of a section, and the\n * children of a section's sub-group.\n */\n private readonly linkItems = computed(() => navigationLinks(this.sortedItems()));\n\n /** The router URL's path: primary outlet only, no query, fragment or matrix parameters. */\n private readonly routerPath = computed(() => navigationPath(this.router, this.routerUrl()));\n\n /**\n * The one current link (or none). The single source of both the current\n * look (`lc-sidenav__nav-item--active`) and `aria-current=\"page\"` (AS-16).\n * With `activeRoute` set: the first link whose route equals it. Without:\n * the router's path — the exact match wins, otherwise the longest link\n * route the path continues with a `/` (`/` matches only `/`); ties go to\n * the first link in display order. The rules live in\n * `internal/navigation` since 3.6, shared with `lc-sidenav-placeholder`.\n */\n private readonly currentItem = computed<NavigationItem | null>(() =>\n currentNavigationItem(this.linkItems(), this.activeRoute(), this.activeRoute() === '' ? this.routerPath() : ''),\n );\n\n /**\n * Event emitted when the sidenav should close\n */\n readonly closed = output<void>();\n\n /**\n * Event emitted when a navigation item is clicked\n */\n readonly itemClicked = output<NavigationItem>();\n\n /**\n * Event emitted when an item's action button is clicked\n */\n readonly itemAction = output<NavigationItem>();\n\n constructor() {\n this.router.events\n .pipe(\n filter((event): event is NavigationEnd => event instanceof NavigationEnd),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.routerUrl.set(this.router.url));\n\n // React to mobileBreakpoint changes\n effect(() => {\n this.mobileBreakpoint(); // track dependency\n this.setupMediaQuery();\n });\n\n // Navigating into a group opens it: add the active child's parent(s) to\n // the expanded set. Only additive — the user's own collapses/expands of\n // other groups survive a route change.\n effect(() => {\n const parents = this.activeChildParents();\n if (parents.length === 0) return;\n const expanded = untracked(this.expandedItems);\n if (parents.every((id) => expanded.has(id))) return;\n this.expandedItems.set(new Set([...expanded, ...parents]));\n });\n }\n\n ngOnDestroy(): void {\n this.teardownMediaQuery();\n }\n\n private setupMediaQuery(): void {\n if (typeof window === 'undefined') return;\n this.teardownMediaQuery();\n this.mediaQuery = window.matchMedia(`(max-width: ${this.mobileBreakpoint()}px)`);\n this.isMobile.set(this.mediaQuery.matches);\n this.mediaQuery.addEventListener('change', this.mediaHandler);\n }\n\n private teardownMediaQuery(): void {\n this.mediaQuery?.removeEventListener('change', this.mediaHandler);\n this.mediaQuery = null;\n }\n\n /**\n * Computed CSS classes for the sidenav\n */\n sidenavClasses = computed(() => {\n const classes = ['lc-sidenav'];\n classes.push(`lc-sidenav--${this.position()}`);\n classes.push(`lc-sidenav--${this.effectiveMode()}`);\n if (this.isOpen()) {\n classes.push('lc-sidenav--open');\n }\n if (this.collapsed() && !this.isMobile()) {\n classes.push('lc-sidenav--collapsed');\n }\n if (this.theme() !== 'auto') {\n classes.push(`lc-sidenav--${this.theme()}`);\n }\n if (this.variant() === 'transparent') {\n classes.push('lc-sidenav--transparent');\n }\n return classes.join(' ');\n });\n\n /**\n * Computed inline styles for the sidenav\n */\n sidenavStyles = computed(() => ({\n width: this.isMobile() ? this.width() : (this.collapsed() ? '56px' : this.width()),\n }));\n\n /** The brand tile's letter when there is no `brandIcon`: the name's first character, upper-cased. */\n protected readonly brandInitial = computed(() => ([...this.brandName().trim()][0] ?? '').toUpperCase());\n\n /** Whether the rail shows only icons (as `lc-sidenav--collapsed`). */\n protected readonly isRail = computed(() => this.collapsed() && !this.isMobile());\n\n /** Visually hidden badge text: `badgeAriaLabel` with `{value}`; on the rail, where labels are hidden, after the label. */\n protected badgeText(item: NavigationItem): string {\n if (!item.badge) return '';\n const text = this.badgeAriaLabel().replace('{value}', String(item.badge.value));\n return this.isRail() ? `${item.label} ${text}` : text;\n }\n\n /** The collapse button's accessible name: what a press does. */\n protected readonly collapseToggleLabel = computed(() =>\n this.collapsed()\n ? this.expandAriaLabel()\n : this.collapseAriaLabel() ||\n (this.position() === 'right' ? 'Collapse navigation to the right' : 'Collapse navigation to the left'),\n );\n\n /** The collapse button's chevron points where the rail moves: ⟨ to collapse a left rail, ⟩ to expand it (mirrored on the right). */\n protected readonly collapseToggleIcon = computed(() => {\n const towardsLeft = this.position() === 'right' ? this.collapsed() : !this.collapsed();\n return towardsLeft ? 'chevron-left' : 'chevron-right';\n });\n\n /**\n * Toggle collapsed state\n */\n toggleCollapsed(): void {\n this.collapsed.set(!this.collapsed());\n }\n\n /** The brand link closes the drawer on a phone, as the items do. */\n handleBrandClick(): void {\n if (this.isMobile()) {\n this.handleClose();\n }\n }\n\n /**\n * Handle close action\n */\n handleClose(): void {\n this.closed.emit();\n }\n\n /**\n * Handle navigation item click\n */\n handleItemClick(item: NavigationItem): void {\n this.itemClicked.emit(item);\n // Auto-close drawer on mobile after navigation\n if (this.isMobile()) {\n this.handleClose();\n }\n }\n\n /**\n * Handle action button click on a navigation item\n */\n handleItemAction(event: Event, item: NavigationItem): void {\n event.stopPropagation();\n this.itemAction.emit(item);\n }\n\n /**\n * Whether the item is the current link (see `currentItem`): it alone is\n * painted current and carries `aria-current=\"page\"`.\n */\n isItemActive(item: NavigationItem): boolean {\n return this.currentItem() === item;\n }\n\n /**\n * Check if a parent item contains the current link\n */\n hasActiveChild(item: NavigationItem): boolean {\n const current = this.currentItem();\n return !!current && !!item.children?.includes(current);\n }\n\n /**\n * Toggle expansion of a parent item.\n * If the sidenav is collapsed, expand it first.\n */\n toggleExpanded(item: NavigationItem): void {\n if (this.collapsed()) {\n this.collapsed.set(false);\n // Expand the clicked item after uncollapsing\n const expanded = new Set(this.expandedItems());\n expanded.add(item.id);\n this.expandedItems.set(expanded);\n return;\n }\n const expanded = new Set(this.expandedItems());\n if (expanded.has(item.id)) {\n expanded.delete(item.id);\n } else {\n expanded.add(item.id);\n }\n this.expandedItems.set(expanded);\n }\n\n /**\n * Check if an item is expanded\n */\n isExpanded(item: NavigationItem): boolean {\n return this.expandedItems().has(item.id);\n }\n\n /**\n * Handle keyboard navigation. Keyed on the EFFECTIVE mode: a docked sidenav\n * that has become a drawer below the mobile breakpoint must close on Escape\n * like any drawer.\n */\n @HostListener('document:keydown', ['$event'])\n handleKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.isOpen() && this.effectiveMode() === 'drawer') {\n this.handleClose();\n }\n }\n}\n","<!-- Drawer mode: render with overlay and conditional visibility -->\n@if (effectiveMode() === 'drawer') {\n @if (isOpen()) {\n <!-- Overlay backdrop -->\n @if (hasOverlay()) {\n <div\n class=\"lc-sidenav__overlay\"\n (click)=\"handleClose()\"\n aria-hidden=\"true\">\n </div>\n }\n\n <ng-container *ngTemplateOutlet=\"sidenavPanel\" />\n }\n}\n\n<!-- Docked mode: always render, visibility controlled by CSS -->\n@if (effectiveMode() === 'docked') {\n <ng-container *ngTemplateOutlet=\"sidenavPanel\" />\n}\n\n<!-- Shared sidenav panel template.\n The <aside> is a plain complementary region; the navigation landmark is\n the inner <nav> (nesting a role=\"navigation\" wrapper around a <nav> gave\n two navigation landmarks). In drawer mode the panel is a modal dialog:\n focus is captured (close button first, see cdkFocusInitial), trapped\n while open and restored to the opener when the panel is destroyed. -->\n<ng-template #sidenavPanel>\n <aside\n [class]=\"sidenavClasses()\"\n [ngStyle]=\"sidenavStyles()\"\n [attr.role]=\"effectiveMode() === 'drawer' ? 'dialog' : null\"\n [attr.aria-modal]=\"effectiveMode() === 'drawer' ? 'true' : null\"\n [attr.aria-label]=\"effectiveMode() === 'drawer' ? ariaLabel() : null\"\n [cdkTrapFocus]=\"effectiveMode() === 'drawer'\"\n [cdkTrapFocusAutoCapture]=\"effectiveMode() === 'drawer'\">\n\n <!-- Text brand (019): one link to home, never a toggle. Replaces the image logo. -->\n @if (brandName()) {\n <div\n class=\"lc-sidenav__logo lc-sidenav__logo--brand\"\n [class.lc-sidenav__logo--size-xs]=\"logoSize() === 'xs'\"\n [class.lc-sidenav__logo--size-sm]=\"logoSize() === 'sm'\"\n [class.lc-sidenav__logo--size-md]=\"logoSize() === 'md'\"\n [class.lc-sidenav__logo--size-lg]=\"logoSize() === 'lg'\"\n [class.lc-sidenav__logo--size-xl]=\"logoSize() === 'xl'\"\n >\n @if (brandHref()) {\n <!-- Plain link: works without the router and without JavaScript. -->\n <a\n [href]=\"brandHref()\"\n class=\"lc-sidenav__brand\"\n [attr.aria-label]=\"brandAriaLabel() || null\"\n [attr.data-tooltip]=\"brandName()\"\n (click)=\"handleBrandClick()\">\n <ng-container [ngTemplateOutlet]=\"brandContent\" />\n </a>\n } @else {\n <a\n routerLink=\"/\"\n class=\"lc-sidenav__brand\"\n [attr.aria-label]=\"brandAriaLabel() || null\"\n [attr.data-tooltip]=\"brandName()\"\n (click)=\"handleBrandClick()\">\n <ng-container [ngTemplateOutlet]=\"brandContent\" />\n </a>\n }\n </div>\n } @else if (showLogo()) {\n <!-- Logo area (sidebar-first layout) -->\n <div\n class=\"lc-sidenav__logo\"\n [class.lc-sidenav__logo--size-xs]=\"logoSize() === 'xs'\"\n [class.lc-sidenav__logo--size-sm]=\"logoSize() === 'sm'\"\n [class.lc-sidenav__logo--size-md]=\"logoSize() === 'md'\"\n [class.lc-sidenav__logo--size-lg]=\"logoSize() === 'lg'\"\n [class.lc-sidenav__logo--size-xl]=\"logoSize() === 'xl'\"\n >\n <button type=\"button\" class=\"lc-sidenav__logo-link\" [attr.aria-label]=\"toggleAriaLabel()\" (click)=\"toggleCollapsed()\">\n <lc-logo\n [variant]=\"collapsed() ? 'emblem' : 'full'\"\n [size]=\"collapsed() ? 'sm' : logoSize()\"\n [clickable]=\"false\"\n [colorMode]=\"theme() === 'dark' ? 'dark' : theme() === 'light' ? 'light' : 'auto'\"\n [src]=\"logoSrc()\"\n [emblemSrc]=\"logoEmblemSrc()\"\n [darkSrc]=\"logoDarkSrc()\"\n [darkEmblemSrc]=\"logoDarkEmblemSrc()\"\n [alt]=\"logoAlt() || 'Logo'\"\n />\n </button>\n @if (!collapsed() && effectiveMode() === 'docked') {\n <button\n type=\"button\"\n class=\"lc-sidenav__logo-toggle\"\n (click)=\"toggleCollapsed()\"\n [attr.aria-label]=\"collapseAriaLabel() || (position() === 'right' ? 'Collapse navigation to the right' : 'Collapse navigation to the left')\"\n [attr.title]=\"collapseTitle()\">\n <lc-icon\n [name]=\"position() === 'right' ? 'chevron-right' : 'chevron-left'\"\n size=\"sm\"\n [decorative]=\"true\" />\n </button>\n }\n </div>\n }\n\n <!-- Close button (drawer mode only) -->\n @if (effectiveMode() === 'drawer') {\n <button\n type=\"button\"\n class=\"lc-sidenav__close\"\n cdkFocusInitial\n (click)=\"handleClose()\"\n [attr.aria-label]=\"closeAriaLabel()\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n </button>\n }\n\n <!-- Navigation items (if provided) -->\n @if (items().length > 0) {\n <nav\n class=\"lc-sidenav__nav\"\n [class.lc-sidenav__nav--docked]=\"effectiveMode() === 'docked'\"\n [attr.aria-label]=\"ariaLabel()\">\n @for (item of sortedItems(); track item.id) {\n <!-- Section headline -->\n @if (item.isSection) {\n <div class=\"lc-sidenav__section\">\n <div class=\"lc-sidenav__section-header\">\n <h2 class=\"lc-sidenav__section-title\">{{ item.label }}</h2>\n @if (item.action) {\n <button\n type=\"button\"\n class=\"lc-sidenav__action-btn\"\n [attr.aria-label]=\"item.action.ariaLabel || item.label + ' action'\"\n (click)=\"handleItemAction($event, item)\">\n <lc-icon [name]=\"item.action.icon\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </div>\n @if (item.children?.length) {\n <ul class=\"lc-sidenav__section-items\">\n @for (child of item.children; track child.id) {\n <li>\n @if (child.children?.length) {\n <!-- Section child with nested children (collapsible) -->\n <div class=\"lc-sidenav__nav-item-row\">\n <button\n type=\"button\"\n class=\"lc-sidenav__nav-item lc-sidenav__nav-item--parent\"\n [class.lc-sidenav__nav-item--expanded]=\"isExpanded(child)\"\n [class.lc-sidenav__nav-item--has-active-child]=\"hasActiveChild(child)\"\n (click)=\"toggleExpanded(child)\"\n [attr.aria-expanded]=\"isExpanded(child)\"\n [title]=\"collapsed() ? child.label : ''\">\n @if (child.icon) {\n <lc-icon [name]=\"child.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n }\n <span class=\"lc-sidenav__nav-label\">{{ child.label }}</span>\n @if (child.badge) {\n <lc-badge aria-hidden=\"true\" [variant]=\"child.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ child.badge.value }}</lc-badge>&ngsp;<span class=\"lc-sidenav__sr-only\">{{ badgeText(child) }}</span>\n }\n <lc-icon name=\"chevron-down\" size=\"xs\" [decorative]=\"true\" class=\"lc-sidenav__nav-chevron\" />\n </button>\n @if (child.action) {\n <button\n type=\"button\"\n class=\"lc-sidenav__action-btn\"\n [attr.aria-label]=\"child.action.ariaLabel || child.label + ' action'\"\n (click)=\"handleItemAction($event, child)\">\n <lc-icon [name]=\"child.action.icon\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </div>\n @if (isExpanded(child)) {\n <div class=\"lc-sidenav__nav-children\">\n @for (grandchild of child.children; track grandchild.id) {\n <a\n [routerLink]=\"grandchild.route\"\n class=\"lc-sidenav__nav-item lc-sidenav__nav-item--child\"\n (click)=\"handleItemClick(grandchild)\"\n [class.lc-sidenav__nav-item--active]=\"isItemActive(grandchild)\"\n [attr.aria-current]=\"isItemActive(grandchild) ? 'page' : null\">\n @if (grandchild.icon) {\n <lc-icon [name]=\"grandchild.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n }\n <span class=\"lc-sidenav__nav-label\">{{ grandchild.label }}</span>\n @if (grandchild.badge) {\n <lc-badge aria-hidden=\"true\" [variant]=\"grandchild.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ grandchild.badge.value }}</lc-badge>&ngsp;<span class=\"lc-sidenav__sr-only\">{{ badgeText(grandchild) }}</span>\n }\n </a>\n }\n </div>\n }\n } @else {\n <!-- Section child (simple link) -->\n <div class=\"lc-sidenav__nav-item-row\">\n <a\n [routerLink]=\"child.route\"\n class=\"lc-sidenav__nav-item lc-sidenav__nav-item--child\"\n (click)=\"handleItemClick(child)\"\n [class.lc-sidenav__nav-item--active]=\"isItemActive(child)\"\n [attr.aria-current]=\"isItemActive(child) ? 'page' : null\"\n [title]=\"collapsed() ? child.label : ''\">\n @if (child.icon) {\n <lc-icon [name]=\"child.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n }\n <span class=\"lc-sidenav__nav-label\">{{ child.label }}</span>\n @if (child.badge) {\n <lc-badge aria-hidden=\"true\" [variant]=\"child.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ child.badge.value }}</lc-badge>&ngsp;<span class=\"lc-sidenav__sr-only\">{{ badgeText(child) }}</span>\n }\n </a>\n @if (child.action) {\n <button\n type=\"button\"\n class=\"lc-sidenav__action-btn\"\n [attr.aria-label]=\"child.action.ariaLabel || child.label + ' action'\"\n (click)=\"handleItemAction($event, child)\">\n <lc-icon [name]=\"child.action.icon\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </div>\n }\n </li>\n }\n </ul>\n }\n </div>\n } @else if (item.children?.length) {\n <!-- Parent item with children (collapsible group) -->\n <div class=\"lc-sidenav__nav-item-row\">\n <button\n type=\"button\"\n class=\"lc-sidenav__nav-item lc-sidenav__nav-item--parent\"\n [class.lc-sidenav__nav-item--expanded]=\"isExpanded(item)\"\n [class.lc-sidenav__nav-item--has-active-child]=\"hasActiveChild(item)\"\n (click)=\"toggleExpanded(item)\"\n [attr.aria-expanded]=\"isExpanded(item)\"\n [title]=\"collapsed() ? item.label : ''\">\n <lc-icon [name]=\"item.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n <span class=\"lc-sidenav__nav-label\">{{ item.label }}</span>\n @if (item.badge) {\n <lc-badge aria-hidden=\"true\" [variant]=\"item.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ item.badge.value }}</lc-badge>&ngsp;<span class=\"lc-sidenav__sr-only\">{{ badgeText(item) }}</span>\n }\n <lc-icon name=\"chevron-down\" size=\"xs\" [decorative]=\"true\" class=\"lc-sidenav__nav-chevron\" />\n </button>\n @if (item.action) {\n <button\n type=\"button\"\n class=\"lc-sidenav__action-btn\"\n [attr.aria-label]=\"item.action.ariaLabel || item.label + ' action'\"\n (click)=\"handleItemAction($event, item)\">\n <lc-icon [name]=\"item.action.icon\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </div>\n @if (isExpanded(item)) {\n <div class=\"lc-sidenav__nav-children\">\n @for (child of item.children; track child.id) {\n <a\n [routerLink]=\"child.route\"\n class=\"lc-sidenav__nav-item lc-sidenav__nav-item--child\"\n (click)=\"handleItemClick(child)\"\n [class.lc-sidenav__nav-item--active]=\"isItemActive(child)\"\n [attr.aria-current]=\"isItemActive(child) ? 'page' : null\">\n <lc-icon [name]=\"child.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n <span class=\"lc-sidenav__nav-label\">{{ child.label }}</span>\n @if (child.badge) {\n <lc-badge aria-hidden=\"true\" [variant]=\"child.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ child.badge.value }}</lc-badge>&ngsp;<span class=\"lc-sidenav__sr-only\">{{ badgeText(child) }}</span>\n }\n </a>\n }\n </div>\n }\n } @else {\n <!-- Simple item without children -->\n <div class=\"lc-sidenav__nav-item-row\">\n <a\n [routerLink]=\"item.route\"\n class=\"lc-sidenav__nav-item\"\n (click)=\"handleItemClick(item)\"\n [class.lc-sidenav__nav-item--active]=\"isItemActive(item)\"\n [attr.aria-current]=\"isItemActive(item) ? 'page' : null\"\n [title]=\"collapsed() ? item.label : ''\">\n <lc-icon [name]=\"item.icon\" size=\"sm\" [decorative]=\"true\" class=\"lc-sidenav__nav-icon\" />\n <span class=\"lc-sidenav__nav-label\">{{ item.label }}</span>\n @if (item.badge) {\n <lc-badge aria-hidden=\"true\" [variant]=\"item.badge.variant || 'default'\" size=\"xs\" [rounded]=\"true\" class=\"lc-sidenav__nav-badge\">{{ item.badge.value }}</lc-badge>&ngsp;<span class=\"lc-sidenav__sr-only\">{{ badgeText(item) }}</span>\n }\n </a>\n @if (item.action) {\n <button\n type=\"button\"\n class=\"lc-sidenav__action-btn\"\n [attr.aria-label]=\"item.action.ariaLabel || item.label + ' action'\"\n (click)=\"handleItemAction($event, item)\">\n <lc-icon [name]=\"item.action.icon\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </div>\n }\n }\n </nav>\n }\n\n <!-- Content projection (for custom content) -->\n <div class=\"lc-sidenav__content\" [class.lc-sidenav__content--docked]=\"effectiveMode() === 'docked'\">\n <ng-content></ng-content>\n </div>\n\n <!-- Collapse button at the bottom of the rail (019, docked only): on the icon column in both states. -->\n @if (showCollapseToggle() && effectiveMode() === 'docked') {\n <div class=\"lc-sidenav__collapse-row\">\n <button\n type=\"button\"\n class=\"lc-sidenav__collapse-toggle\"\n (click)=\"toggleCollapsed()\"\n [attr.aria-label]=\"collapseToggleLabel()\">\n <lc-icon\n [name]=\"collapseToggleIcon()\"\n size=\"sm\"\n [decorative]=\"true\" />\n </button>\n </div>\n }\n </aside>\n</ng-template>\n\n<!-- The brand link's content: the tile (decorative) and the name. -->\n<ng-template #brandContent>\n <span class=\"lc-sidenav__brand-tile\" aria-hidden=\"true\">\n @if (brandIcon()) {\n <lc-icon [name]=\"brandIcon()\" size=\"sm\" [decorative]=\"true\" />\n } @else {\n {{ brandInitial() }}\n }\n </span>\n <span class=\"lc-sidenav__brand-name\" [class.lc-sidenav__sr-only]=\"isRail()\">{{ brandName() }}</span>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;AA4HA,IAAa,mBAAb,MAAa,iBAAgB;CACV,SAAS,OAAO,MAAM;CAOtB,YAAY,OAAO,KAAK,OAAO,KAAI,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAG3C,YAAY,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAGxB,WAAW,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAGvB,UAAU,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEnB,gBAAgB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;CAEzB,cAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAEvB,oBAAoB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,oBAAA,CAAA,+BAAA,CAAA,CAAA;CAE7B,UAAU,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAGnB,WAAW,MAAwC,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAaxD,YAAY,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAOrB,YAAY,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CA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AA,oBAAoB,CAAC,QAAQ,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { ChangeDetectionStrategy, Component, Directive, ElementRef, HostListener
|
|
|
3
3
|
import { Overlay } from "@angular/cdk/overlay";
|
|
4
4
|
import { ComponentPortal } from "@angular/cdk/portal";
|
|
5
5
|
import { OverlayStackService } from "@lifecorner/angular-ui-kit/internal/overlay";
|
|
6
|
+
import { closestLang } from "@lifecorner/angular-ui-kit/internal/a11y";
|
|
6
7
|
var TooltipContentComponent = class TooltipContentComponent {
|
|
7
8
|
content = "";
|
|
8
9
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
@@ -108,6 +109,7 @@ const FALLBACKS = {
|
|
|
108
109
|
"bottom"
|
|
109
110
|
]
|
|
110
111
|
};
|
|
112
|
+
const CONTROL = "a[href], button, input:not([type=hidden]), select, textarea, [tabindex]:not([tabindex=\"-1\"])";
|
|
111
113
|
var TooltipDirective = class TooltipDirective {
|
|
112
114
|
static nextId = 0;
|
|
113
115
|
lcTooltip = input.required(...ngDevMode ? [{ debugName: "lcTooltip" }] : /* istanbul ignore next */ []);
|
|
@@ -118,6 +120,8 @@ var TooltipDirective = class TooltipDirective {
|
|
|
118
120
|
tooltipId = `lc-tooltip-${++TooltipDirective.nextId}`;
|
|
119
121
|
overlayRef;
|
|
120
122
|
tooltipRef;
|
|
123
|
+
positionStrategy;
|
|
124
|
+
describedEl;
|
|
121
125
|
positionSubscription;
|
|
122
126
|
showTimeout;
|
|
123
127
|
hideTimeout;
|
|
@@ -143,17 +147,32 @@ var TooltipDirective = class TooltipDirective {
|
|
|
143
147
|
onBlur() {
|
|
144
148
|
this.hideWithDelay();
|
|
145
149
|
}
|
|
150
|
+
onFocusIn(event) {
|
|
151
|
+
if (event.target === this.elementRef.nativeElement) return;
|
|
152
|
+
this.showWithDelay();
|
|
153
|
+
}
|
|
154
|
+
onFocusOut(event) {
|
|
155
|
+
const host = this.elementRef.nativeElement;
|
|
156
|
+
if (event.target === host) return;
|
|
157
|
+
const next = event.relatedTarget;
|
|
158
|
+
if (next && host.contains(next)) return;
|
|
159
|
+
this.hideWithDelay();
|
|
160
|
+
}
|
|
146
161
|
show() {
|
|
147
162
|
if (this.tooltipDisabled() || !this.lcTooltip()) return;
|
|
148
163
|
this.clearTimeouts();
|
|
149
164
|
if (!this.overlayRef) this.createOverlay();
|
|
150
165
|
if (!this.tooltipRef && this.overlayRef) {
|
|
166
|
+
const control = this.resolveControl();
|
|
167
|
+
this.positionStrategy?.setOrigin(this.resolveAnchor(control));
|
|
151
168
|
const portal = new ComponentPortal(TooltipContentComponent, this.viewContainerRef);
|
|
152
169
|
this.tooltipRef = this.overlayRef.attach(portal);
|
|
153
170
|
this.tooltipRef.instance.content = this.lcTooltip();
|
|
154
171
|
const tooltipEl = this.tooltipRef.location.nativeElement;
|
|
155
172
|
this.renderer.setAttribute(tooltipEl, "id", this.tooltipId);
|
|
156
|
-
this.
|
|
173
|
+
const lang = closestLang(this.elementRef.nativeElement);
|
|
174
|
+
if (lang !== null) this.renderer.setAttribute(tooltipEl, "lang", lang);
|
|
175
|
+
this.addDescribedBy(control);
|
|
157
176
|
this.setPositionClass(this.tooltipPosition());
|
|
158
177
|
this.overlayStack.push(this.tooltipId);
|
|
159
178
|
if (typeof document !== "undefined") {
|
|
@@ -198,6 +217,7 @@ var TooltipDirective = class TooltipDirective {
|
|
|
198
217
|
}
|
|
199
218
|
createOverlay() {
|
|
200
219
|
const positionStrategy = this.overlay.position().flexibleConnectedTo(this.elementRef).withPositions(this.getPositions());
|
|
220
|
+
this.positionStrategy = positionStrategy;
|
|
201
221
|
this.positionSubscription = positionStrategy.positionChanges.subscribe((change) => {
|
|
202
222
|
const applied = POSITION_NAMES.find((p) => POSITIONS[p] === change.connectionPair);
|
|
203
223
|
if (applied) this.setPositionClass(applied);
|
|
@@ -217,19 +237,29 @@ var TooltipDirective = class TooltipDirective {
|
|
|
217
237
|
for (const p of POSITION_NAMES) this.renderer.removeClass(tooltipEl, `lc-tooltip--${p}`);
|
|
218
238
|
this.renderer.addClass(tooltipEl, `lc-tooltip--${position}`);
|
|
219
239
|
}
|
|
220
|
-
|
|
240
|
+
resolveControl() {
|
|
241
|
+
const host = this.elementRef.nativeElement;
|
|
242
|
+
if (host.matches(CONTROL)) return host;
|
|
243
|
+
return host.querySelector(CONTROL) ?? host;
|
|
244
|
+
}
|
|
245
|
+
resolveAnchor(control) {
|
|
221
246
|
const host = this.elementRef.nativeElement;
|
|
222
|
-
|
|
247
|
+
return control !== host && host.childElementCount === 1 && host.firstElementChild === control ? control : host;
|
|
248
|
+
}
|
|
249
|
+
addDescribedBy(el) {
|
|
250
|
+
this.describedEl = el;
|
|
251
|
+
const ids = (el.getAttribute("aria-describedby") ?? "").split(/\s+/).filter(Boolean);
|
|
223
252
|
if (!ids.includes(this.tooltipId)) ids.push(this.tooltipId);
|
|
224
|
-
this.renderer.setAttribute(
|
|
253
|
+
this.renderer.setAttribute(el, "aria-describedby", ids.join(" "));
|
|
225
254
|
}
|
|
226
255
|
removeDescribedBy() {
|
|
227
|
-
const
|
|
228
|
-
|
|
256
|
+
const el = this.describedEl ?? this.elementRef.nativeElement;
|
|
257
|
+
this.describedEl = void 0;
|
|
258
|
+
const ids = (el.getAttribute("aria-describedby") ?? "").split(/\s+/).filter(Boolean);
|
|
229
259
|
if (!ids.includes(this.tooltipId)) return;
|
|
230
260
|
const rest = ids.filter((id) => id !== this.tooltipId);
|
|
231
|
-
if (rest.length) this.renderer.setAttribute(
|
|
232
|
-
else this.renderer.removeAttribute(
|
|
261
|
+
if (rest.length) this.renderer.setAttribute(el, "aria-describedby", rest.join(" "));
|
|
262
|
+
else this.renderer.removeAttribute(el, "aria-describedby");
|
|
233
263
|
}
|
|
234
264
|
clearTimeouts() {
|
|
235
265
|
if (this.showTimeout) {
|
|
@@ -245,6 +275,7 @@ var TooltipDirective = class TooltipDirective {
|
|
|
245
275
|
this.clearTimeouts();
|
|
246
276
|
this.positionSubscription?.unsubscribe();
|
|
247
277
|
this.positionSubscription = void 0;
|
|
278
|
+
this.positionStrategy = void 0;
|
|
248
279
|
if (this.overlayRef) {
|
|
249
280
|
this.overlayRef.dispose();
|
|
250
281
|
this.overlayRef = void 0;
|
|
@@ -305,7 +336,9 @@ var TooltipDirective = class TooltipDirective {
|
|
|
305
336
|
"mouseenter": "onMouseEnter()",
|
|
306
337
|
"mouseleave": "onMouseLeave()",
|
|
307
338
|
"focus": "onFocus()",
|
|
308
|
-
"blur": "onBlur()"
|
|
339
|
+
"blur": "onBlur()",
|
|
340
|
+
"focusin": "onFocusIn($event)",
|
|
341
|
+
"focusout": "onFocusOut($event)"
|
|
309
342
|
} },
|
|
310
343
|
ngImport: i0
|
|
311
344
|
});
|
|
@@ -378,6 +411,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
378
411
|
onBlur: [{
|
|
379
412
|
type: HostListener,
|
|
380
413
|
args: ["blur"]
|
|
414
|
+
}],
|
|
415
|
+
onFocusIn: [{
|
|
416
|
+
type: HostListener,
|
|
417
|
+
args: ["focusin", ["$event"]]
|
|
418
|
+
}],
|
|
419
|
+
onFocusOut: [{
|
|
420
|
+
type: HostListener,
|
|
421
|
+
args: ["focusout", ["$event"]]
|
|
381
422
|
}]
|
|
382
423
|
}
|
|
383
424
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecorner-angular-ui-kit-tooltip.mjs","names":[],"sources":["../../../../libs/angular-ui-kit/src/lib/tooltip/tooltip.directive.ts"],"sourcesContent":["import {\n Directive,\n input,\n ElementRef,\n OnDestroy,\n Renderer2,\n ViewContainerRef,\n ComponentRef,\n HostListener,\n Component,\n ChangeDetectionStrategy,\n inject,\n} from '@angular/core';\nimport { Overlay, OverlayRef, ConnectedPosition } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { Subscription } from 'rxjs';\nimport { OverlayStackService } from '@lifecorner/angular-ui-kit/internal/overlay';\n\nexport type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';\n\n/**\n * Internal tooltip content component\n */\n@Component({\n selector: 'lc-tooltip-content',\n standalone: true,\n imports: [],\n template: `<div class=\"lc-tooltip-inner\">{{ content }}</div>`,\n styles: [\n `\n :host {\n display: block;\n /* Inverted surface: reads as a tooltip in both themes and keeps AAA\n contrast — near-white on the dark theme, near-black on the light one. */\n background-color: var(--color-text-primary);\n color: var(--color-surface);\n padding: 0.5rem 0.75rem;\n border-radius: var(--border-radius-md, 0.375rem);\n font-size: var(--font-size-sm, 0.875rem);\n line-height: 1.25rem;\n max-width: 300px;\n word-wrap: break-word;\n box-shadow: var(--elevation-2);\n }\n\n .lc-tooltip-inner {\n position: relative;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'lc-tooltip',\n role: 'tooltip',\n },\n})\nexport class TooltipContentComponent {\n content = '';\n}\n\nconst POSITIONS: Record<TooltipPosition, ConnectedPosition> = {\n top: {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -8,\n panelClass: 'lc-tooltip--top',\n },\n bottom: {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: 8,\n panelClass: 'lc-tooltip--bottom',\n },\n left: {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -8,\n panelClass: 'lc-tooltip--left',\n },\n right: {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: 8,\n panelClass: 'lc-tooltip--right',\n },\n};\n\nconst POSITION_NAMES = Object.keys(POSITIONS) as TooltipPosition[];\n\n/** Fallback order when the preferred side does not fit the viewport. */\nconst FALLBACKS: Record<TooltipPosition, TooltipPosition[]> = {\n top: ['bottom', 'right', 'left'],\n bottom: ['top', 'right', 'left'],\n left: ['right', 'top', 'bottom'],\n right: ['left', 'top', 'bottom'],\n};\n\n/**\n * Tooltip directive for displaying contextual information.\n * Uses Angular CDK Overlay for positioning; flips to the opposite side when\n * the preferred one does not fit the viewport, and can be dismissed with\n * Escape (WCAG 1.4.13).\n *\n * @example\n * ```html\n * <button lcTooltip=\"Click me!\" tooltipPosition=\"top\">\n * Hover or focus\n * </button>\n * ```\n */\n@Directive({\n selector: '[lcTooltip]',\n standalone: true,\n})\nexport class TooltipDirective implements OnDestroy {\n private static nextId = 0;\n\n /**\n * Tooltip content text\n */\n lcTooltip = input.required<string>();\n\n /**\n * Tooltip position\n * @default 'top'\n */\n tooltipPosition = input<TooltipPosition>('top');\n\n /**\n * Show delay in milliseconds\n * @default 0\n */\n tooltipShowDelay = input<number>(0);\n\n /**\n * Hide delay in milliseconds\n * @default 0\n */\n tooltipHideDelay = input<number>(0);\n\n /**\n * Whether tooltip is disabled\n * @default false\n */\n tooltipDisabled = input<boolean>(false);\n\n /** Id of the tooltip element; the host's `aria-describedby` points at it while shown. */\n readonly tooltipId = `lc-tooltip-${++TooltipDirective.nextId}`;\n\n private overlayRef?: OverlayRef;\n private tooltipRef?: ComponentRef<TooltipContentComponent>;\n private positionSubscription?: Subscription;\n private showTimeout?: number;\n private hideTimeout?: number;\n private escapeListener?: (event: KeyboardEvent) => void;\n\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(Overlay);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly renderer = inject(Renderer2);\n private readonly overlayStack = inject(OverlayStackService);\n\n ngOnDestroy(): void {\n this.hide();\n this.cleanup();\n }\n\n @HostListener('mouseenter')\n onMouseEnter(): void {\n this.showWithDelay();\n }\n\n @HostListener('mouseleave')\n onMouseLeave(): void {\n this.hideWithDelay();\n }\n\n @HostListener('focus')\n onFocus(): void {\n this.showWithDelay();\n }\n\n @HostListener('blur')\n onBlur(): void {\n this.hideWithDelay();\n }\n\n /**\n * Show tooltip programmatically\n */\n show(): void {\n if (this.tooltipDisabled() || !this.lcTooltip()) {\n return;\n }\n\n this.clearTimeouts();\n\n if (!this.overlayRef) {\n this.createOverlay();\n }\n\n if (!this.tooltipRef && this.overlayRef) {\n const portal = new ComponentPortal(TooltipContentComponent, this.viewContainerRef);\n this.tooltipRef = this.overlayRef.attach(portal) as ComponentRef<TooltipContentComponent>;\n this.tooltipRef.instance.content = this.lcTooltip();\n\n const tooltipEl = this.tooltipRef.location.nativeElement as HTMLElement;\n // The id is what the host's aria-describedby points at\n this.renderer.setAttribute(tooltipEl, 'id', this.tooltipId);\n this.addDescribedBy();\n this.setPositionClass(this.tooltipPosition());\n\n // Escape dismisses the tooltip (WCAG 1.4.13) — only when it is the\n // top-most overlay, so a modal underneath is not closed by the same key\n this.overlayStack.push(this.tooltipId);\n if (typeof document !== 'undefined') {\n this.escapeListener = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || !this.overlayStack.claim(this.tooltipId, event)) return;\n event.stopPropagation();\n this.hide();\n };\n document.addEventListener('keydown', this.escapeListener);\n }\n }\n }\n\n /**\n * Hide tooltip programmatically\n */\n hide(): void {\n this.clearTimeouts();\n\n if (this.escapeListener) {\n document.removeEventListener('keydown', this.escapeListener);\n this.escapeListener = undefined;\n }\n this.overlayStack.remove(this.tooltipId);\n\n if (this.tooltipRef) {\n this.tooltipRef.destroy();\n this.tooltipRef = undefined;\n }\n\n if (this.overlayRef) {\n this.overlayRef.detach();\n }\n\n this.removeDescribedBy();\n }\n\n /**\n * Toggle tooltip visibility\n */\n toggle(): void {\n if (this.tooltipRef) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n private showWithDelay(): void {\n this.clearTimeouts();\n const delay = this.tooltipShowDelay();\n\n if (delay > 0) {\n this.showTimeout = window.setTimeout(() => this.show(), delay);\n } else {\n this.show();\n }\n }\n\n private hideWithDelay(): void {\n this.clearTimeouts();\n const delay = this.tooltipHideDelay();\n\n if (delay > 0) {\n this.hideTimeout = window.setTimeout(() => this.hide(), delay);\n } else {\n this.hide();\n }\n }\n\n private createOverlay(): void {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions(this.getPositions());\n\n // Keep the tooltip element's position class in sync with the side the\n // overlay actually chose (it flips at viewport edges)\n this.positionSubscription = positionStrategy.positionChanges.subscribe((change) => {\n const applied = POSITION_NAMES.find((p) => POSITIONS[p] === change.connectionPair);\n if (applied) this.setPositionClass(applied);\n });\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n }) as OverlayRef;\n }\n\n /** Preferred position first, then the fallbacks the overlay may flip to. */\n private getPositions(): ConnectedPosition[] {\n const position = this.tooltipPosition();\n return [position, ...FALLBACKS[position]].map((p) => POSITIONS[p]);\n }\n\n private setPositionClass(position: TooltipPosition): void {\n const tooltipEl = this.tooltipRef?.location.nativeElement as HTMLElement | undefined;\n if (!tooltipEl) return;\n for (const p of POSITION_NAMES) {\n this.renderer.removeClass(tooltipEl, `lc-tooltip--${p}`);\n }\n this.renderer.addClass(tooltipEl, `lc-tooltip--${position}`);\n }\n\n /** Append the tooltip id to the host's aria-describedby without clobbering ids the caller set. */\n private addDescribedBy(): void {\n const host = this.elementRef.nativeElement;\n const ids = (host.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter(Boolean);\n if (!ids.includes(this.tooltipId)) ids.push(this.tooltipId);\n this.renderer.setAttribute(host, 'aria-describedby', ids.join(' '));\n }\n\n private removeDescribedBy(): void {\n const host = this.elementRef.nativeElement;\n const ids = (host.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter(Boolean);\n if (!ids.includes(this.tooltipId)) return;\n const rest = ids.filter((id) => id !== this.tooltipId);\n if (rest.length) {\n this.renderer.setAttribute(host, 'aria-describedby', rest.join(' '));\n } else {\n this.renderer.removeAttribute(host, 'aria-describedby');\n }\n }\n\n private clearTimeouts(): void {\n if (this.showTimeout) {\n window.clearTimeout(this.showTimeout);\n this.showTimeout = undefined;\n }\n if (this.hideTimeout) {\n window.clearTimeout(this.hideTimeout);\n this.hideTimeout = undefined;\n }\n }\n\n private cleanup(): void {\n this.clearTimeouts();\n this.positionSubscription?.unsubscribe();\n this.positionSubscription = undefined;\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = undefined;\n }\n }\n}\n"],"mappings":";;;;;AAwDA,IAAa,0BAAb,MAAa,wBAAuB;CAClC,UAAU;CADC,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAuB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAvB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAuB,cAAA;EAAA,UAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,UAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UA7BxB;EAAmD,UAAA;EAAA,QAAA,CAAA,oUAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AA6BlD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAuB,YAAA,CAAA;EAjCnC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAoB,YAClB;GAAI,SACP,CAAA;GAAE,UACD;GAAmD,iBAuB5C,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,MAAM;GACP;GAAA,QAAA,CAAA,oUAAA;EAAA,CAAA;;;AAMH,MAAM,YAAwD;CAC5D,KAAK;EACH,SAAS;EACT,SAAS;EACT,UAAU;EACV,UAAU;EACV,SAAS;EACT,YAAY;CACb;CACD,QAAQ;EACN,SAAS;EACT,SAAS;EACT,UAAU;EACV,UAAU;EACV,SAAS;EACT,YAAY;CACb;CACD,MAAM;EACJ,SAAS;EACT,SAAS;EACT,UAAU;EACV,UAAU;EACV,SAAS;EACT,YAAY;CACb;CACD,OAAO;EACL,SAAS;EACT,SAAS;EACT,UAAU;EACV,UAAU;EACV,SAAS;EACT,YAAY;CACb;AACF;AAED,MAAM,iBAAiB,OAAO,KAAK,SAAS;A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AAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAhB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAgB,YAAA,CAAA;EAJ5B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,YAAY;EACb,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDE,MAAA;GAAa,MAAA,CAAA,YAAY;;;GAKzB,MAAA;GAAa,MAAA,CAAA,YAAY;;;GAKzB,MAAA;GAAa,MAAA,CAAA,OAAO;;;GAKpB,MAAA;GAAa,MAAA,CAAA,MAAM"}
|
|
1
|
+
{"version":3,"file":"lifecorner-angular-ui-kit-tooltip.mjs","names":[],"sources":["../../../../libs/angular-ui-kit/src/lib/tooltip/tooltip.directive.ts"],"sourcesContent":["import {\n Directive,\n input,\n ElementRef,\n OnDestroy,\n Renderer2,\n ViewContainerRef,\n ComponentRef,\n HostListener,\n Component,\n ChangeDetectionStrategy,\n inject,\n} from '@angular/core';\nimport { Overlay, OverlayRef, ConnectedPosition, FlexibleConnectedPositionStrategy } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { Subscription } from 'rxjs';\nimport { OverlayStackService } from '@lifecorner/angular-ui-kit/internal/overlay';\nimport { closestLang } from '@lifecorner/angular-ui-kit/internal/a11y';\n\nexport type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';\n\n/**\n * Internal tooltip content component\n */\n@Component({\n selector: 'lc-tooltip-content',\n standalone: true,\n imports: [],\n template: `<div class=\"lc-tooltip-inner\">{{ content }}</div>`,\n styles: [\n `\n :host {\n display: block;\n /* Inverted surface: reads as a tooltip in both themes and keeps AAA\n contrast — near-white on the dark theme, near-black on the light one. */\n background-color: var(--color-text-primary);\n color: var(--color-surface);\n padding: 0.5rem 0.75rem;\n border-radius: var(--border-radius-md, 0.375rem);\n font-size: var(--font-size-sm, 0.875rem);\n line-height: 1.25rem;\n max-width: 300px;\n word-wrap: break-word;\n box-shadow: var(--elevation-2);\n }\n\n .lc-tooltip-inner {\n position: relative;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'lc-tooltip',\n role: 'tooltip',\n },\n})\nexport class TooltipContentComponent {\n content = '';\n}\n\nconst POSITIONS: Record<TooltipPosition, ConnectedPosition> = {\n top: {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -8,\n panelClass: 'lc-tooltip--top',\n },\n bottom: {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: 8,\n panelClass: 'lc-tooltip--bottom',\n },\n left: {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -8,\n panelClass: 'lc-tooltip--left',\n },\n right: {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: 8,\n panelClass: 'lc-tooltip--right',\n },\n};\n\nconst POSITION_NAMES = Object.keys(POSITIONS) as TooltipPosition[];\n\n/** Fallback order when the preferred side does not fit the viewport. */\nconst FALLBACKS: Record<TooltipPosition, TooltipPosition[]> = {\n top: ['bottom', 'right', 'left'],\n bottom: ['top', 'right', 'left'],\n left: ['right', 'top', 'bottom'],\n right: ['left', 'top', 'bottom'],\n};\n\n/**\n * What the tooltip describes (3.32, request 051): the host when it matches,\n * else the first element inside it that does (`lc-button`'s `<button>`).\n */\nconst CONTROL =\n 'a[href], button, input:not([type=hidden]), select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Tooltip directive for displaying contextual information.\n * Uses Angular CDK Overlay for positioning; flips to the opposite side when\n * the preferred one does not fit the viewport, and can be dismissed with\n * Escape (WCAG 1.4.13).\n *\n * The tooltip takes the `lang` of the host's closest `[lang]` (3.31).\n *\n * Shows on hover and on keyboard focus of the host or of an element inside it\n * (3.32). On a wrapper such as `lc-button`, the tooltip describes and anchors\n * to the wrapped `<button>`.\n *\n * @example\n * ```html\n * <button lcTooltip=\"Click me!\" tooltipPosition=\"top\">\n * Hover or focus\n * </button>\n * ```\n */\n@Directive({\n selector: '[lcTooltip]',\n standalone: true,\n})\nexport class TooltipDirective implements OnDestroy {\n private static nextId = 0;\n\n /**\n * Tooltip content text\n */\n lcTooltip = input.required<string>();\n\n /**\n * Tooltip position\n * @default 'top'\n */\n tooltipPosition = input<TooltipPosition>('top');\n\n /**\n * Show delay in milliseconds\n * @default 0\n */\n tooltipShowDelay = input<number>(0);\n\n /**\n * Hide delay in milliseconds\n * @default 0\n */\n tooltipHideDelay = input<number>(0);\n\n /**\n * Whether tooltip is disabled\n * @default false\n */\n tooltipDisabled = input<boolean>(false);\n\n /**\n * Id of the tooltip element; while shown, the `aria-describedby` of the\n * described element (the host, or the focusable element it wraps, such as\n * `lc-button`'s `<button>`) points at it.\n */\n readonly tooltipId = `lc-tooltip-${++TooltipDirective.nextId}`;\n\n private overlayRef?: OverlayRef;\n private tooltipRef?: ComponentRef<TooltipContentComponent>;\n private positionStrategy?: FlexibleConnectedPositionStrategy;\n /** The element whose `aria-describedby` holds the tooltip id while shown. */\n private describedEl?: HTMLElement;\n private positionSubscription?: Subscription;\n private showTimeout?: number;\n private hideTimeout?: number;\n private escapeListener?: (event: KeyboardEvent) => void;\n\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(Overlay);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly renderer = inject(Renderer2);\n private readonly overlayStack = inject(OverlayStackService);\n\n ngOnDestroy(): void {\n this.hide();\n this.cleanup();\n }\n\n @HostListener('mouseenter')\n onMouseEnter(): void {\n this.showWithDelay();\n }\n\n @HostListener('mouseleave')\n onMouseLeave(): void {\n this.hideWithDelay();\n }\n\n @HostListener('focus')\n onFocus(): void {\n this.showWithDelay();\n }\n\n @HostListener('blur')\n onBlur(): void {\n this.hideWithDelay();\n }\n\n /**\n * 3.32 (request 051, 050-f3): `focus` does not bubble, so focus on an\n * element inside the host (`lc-button`'s `<button>`) arrives as `focusin`.\n * The host's own focus is handled by `onFocus`, so it is skipped here.\n */\n @HostListener('focusin', ['$event'])\n onFocusIn(event: FocusEvent): void {\n if (event.target === this.elementRef.nativeElement) return;\n this.showWithDelay();\n }\n\n /** Hides when focus leaves the host from an element inside it (not when it moves within). */\n @HostListener('focusout', ['$event'])\n onFocusOut(event: FocusEvent): void {\n const host = this.elementRef.nativeElement;\n if (event.target === host) return;\n const next = event.relatedTarget as Node | null;\n if (next && host.contains(next)) return;\n this.hideWithDelay();\n }\n\n /**\n * Show tooltip programmatically\n */\n show(): void {\n if (this.tooltipDisabled() || !this.lcTooltip()) {\n return;\n }\n\n this.clearTimeouts();\n\n if (!this.overlayRef) {\n this.createOverlay();\n }\n\n if (!this.tooltipRef && this.overlayRef) {\n // Resolved at every show: the wrapped control is described, and it is\n // the anchor when it is the host's only child (3.32, request 051)\n const control = this.resolveControl();\n this.positionStrategy?.setOrigin(this.resolveAnchor(control));\n\n const portal = new ComponentPortal(TooltipContentComponent, this.viewContainerRef);\n this.tooltipRef = this.overlayRef.attach(portal) as ComponentRef<TooltipContentComponent>;\n this.tooltipRef.instance.content = this.lcTooltip();\n\n const tooltipEl = this.tooltipRef.location.nativeElement as HTMLElement;\n // The id is what the described element's aria-describedby points at\n this.renderer.setAttribute(tooltipEl, 'id', this.tooltipId);\n // The overlay renders under <body>, outside the host's lang (WCAG 3.1.2):\n // the tooltip takes the host's closest [lang], read at every show\n const lang = closestLang(this.elementRef.nativeElement);\n if (lang !== null) this.renderer.setAttribute(tooltipEl, 'lang', lang);\n this.addDescribedBy(control);\n this.setPositionClass(this.tooltipPosition());\n\n // Escape dismisses the tooltip (WCAG 1.4.13) — only when it is the\n // top-most overlay, so a modal underneath is not closed by the same key\n this.overlayStack.push(this.tooltipId);\n if (typeof document !== 'undefined') {\n this.escapeListener = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || !this.overlayStack.claim(this.tooltipId, event)) return;\n event.stopPropagation();\n this.hide();\n };\n document.addEventListener('keydown', this.escapeListener);\n }\n }\n }\n\n /**\n * Hide tooltip programmatically\n */\n hide(): void {\n this.clearTimeouts();\n\n if (this.escapeListener) {\n document.removeEventListener('keydown', this.escapeListener);\n this.escapeListener = undefined;\n }\n this.overlayStack.remove(this.tooltipId);\n\n if (this.tooltipRef) {\n this.tooltipRef.destroy();\n this.tooltipRef = undefined;\n }\n\n if (this.overlayRef) {\n this.overlayRef.detach();\n }\n\n this.removeDescribedBy();\n }\n\n /**\n * Toggle tooltip visibility\n */\n toggle(): void {\n if (this.tooltipRef) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n private showWithDelay(): void {\n this.clearTimeouts();\n const delay = this.tooltipShowDelay();\n\n if (delay > 0) {\n this.showTimeout = window.setTimeout(() => this.show(), delay);\n } else {\n this.show();\n }\n }\n\n private hideWithDelay(): void {\n this.clearTimeouts();\n const delay = this.tooltipHideDelay();\n\n if (delay > 0) {\n this.hideTimeout = window.setTimeout(() => this.hide(), delay);\n } else {\n this.hide();\n }\n }\n\n private createOverlay(): void {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions(this.getPositions());\n this.positionStrategy = positionStrategy;\n\n // Keep the tooltip element's position class in sync with the side the\n // overlay actually chose (it flips at viewport edges)\n this.positionSubscription = positionStrategy.positionChanges.subscribe((change) => {\n const applied = POSITION_NAMES.find((p) => POSITIONS[p] === change.connectionPair);\n if (applied) this.setPositionClass(applied);\n });\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n }) as OverlayRef;\n }\n\n /** Preferred position first, then the fallbacks the overlay may flip to. */\n private getPositions(): ConnectedPosition[] {\n const position = this.tooltipPosition();\n return [position, ...FALLBACKS[position]].map((p) => POSITIONS[p]);\n }\n\n private setPositionClass(position: TooltipPosition): void {\n const tooltipEl = this.tooltipRef?.location.nativeElement as HTMLElement | undefined;\n if (!tooltipEl) return;\n for (const p of POSITION_NAMES) {\n this.renderer.removeClass(tooltipEl, `lc-tooltip--${p}`);\n }\n this.renderer.addClass(tooltipEl, `lc-tooltip--${position}`);\n }\n\n /** The described element: the host if it is a control, else the first control inside it, else the host. */\n private resolveControl(): HTMLElement {\n const host = this.elementRef.nativeElement;\n if (host.matches(CONTROL)) return host;\n return host.querySelector<HTMLElement>(CONTROL) ?? host;\n }\n\n /** The overlay origin: the control when it is the host's only element child (a wrapper), else the host. */\n private resolveAnchor(control: HTMLElement): HTMLElement {\n const host = this.elementRef.nativeElement;\n return control !== host && host.childElementCount === 1 && host.firstElementChild === control ? control : host;\n }\n\n /** Append the tooltip id to the element's aria-describedby without clobbering ids the caller set. */\n private addDescribedBy(el: HTMLElement): void {\n this.describedEl = el;\n const ids = (el.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter(Boolean);\n if (!ids.includes(this.tooltipId)) ids.push(this.tooltipId);\n this.renderer.setAttribute(el, 'aria-describedby', ids.join(' '));\n }\n\n /** Removes the tooltip id from the element it was added to, keeping the other ids. */\n private removeDescribedBy(): void {\n const el = this.describedEl ?? this.elementRef.nativeElement;\n this.describedEl = undefined;\n const ids = (el.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter(Boolean);\n if (!ids.includes(this.tooltipId)) return;\n const rest = ids.filter((id) => id !== this.tooltipId);\n if (rest.length) {\n this.renderer.setAttribute(el, 'aria-describedby', rest.join(' '));\n } else {\n this.renderer.removeAttribute(el, 'aria-describedby');\n }\n }\n\n private clearTimeouts(): void {\n if (this.showTimeout) {\n window.clearTimeout(this.showTimeout);\n this.showTimeout = undefined;\n }\n if (this.hideTimeout) {\n window.clearTimeout(this.hideTimeout);\n this.hideTimeout = undefined;\n }\n }\n\n private cleanup(): void {\n this.clearTimeouts();\n this.positionSubscription?.unsubscribe();\n this.positionSubscription = undefined;\n this.positionStrategy = undefined;\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = undefined;\n }\n }\n}\n"],"mappings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}
|
package/package.json
CHANGED
|
@@ -474,3 +474,12 @@
|
|
|
474
474
|
.lc-header--dark {
|
|
475
475
|
@include -dark-theme-colors;
|
|
476
476
|
}
|
|
477
|
+
|
|
478
|
+
// `<lc-sidenav theme="dark">` on a light page: its badges took the page's
|
|
479
|
+
// light palette, light chips on the dark rail (request 051, 050-f2).
|
|
480
|
+
// Re-declared on the badge host they match a dark page (min 5.63:1). Only the
|
|
481
|
+
// badge: the collapsed rail's label tooltip floats over the page and keeps the
|
|
482
|
+
// page palette. A root-level token override does not reach inside.
|
|
483
|
+
.lc-sidenav-container--dark .lc-sidenav__nav-badge {
|
|
484
|
+
@include -dark-theme-colors;
|
|
485
|
+
}
|
|
@@ -486,3 +486,12 @@
|
|
|
486
486
|
.lc-header--light {
|
|
487
487
|
@include -light-theme-colors;
|
|
488
488
|
}
|
|
489
|
+
|
|
490
|
+
// `<lc-sidenav theme="light">` on a dark page: the rail is light, but its
|
|
491
|
+
// badges took the page's dark palette and measured 1.11–1.96:1 (request 051,
|
|
492
|
+
// 050-f2). Re-declared on the badge host they match a light page (4.85–10.97:1).
|
|
493
|
+
// Only the badge: the collapsed rail's label tooltip floats over the page and
|
|
494
|
+
// keeps the page palette. A root-level token override does not reach inside.
|
|
495
|
+
.lc-sidenav-container--light .lc-sidenav__nav-badge {
|
|
496
|
+
@include -light-theme-colors;
|
|
497
|
+
}
|
|
@@ -98,3 +98,47 @@ describe('Theme scope of a themed header', () => {
|
|
|
98
98
|
expect(dark.indexOf('.lc-header--dark {')).toBeGreaterThan(dark.indexOf(':root.system {'));
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Request 051 (050-f2, design §1 B, D-3): a sidenav with `theme="light"` /
|
|
104
|
+
* `"dark"` re-declares every colour token of that theme on its badge hosts,
|
|
105
|
+
* so the badges take the rail's palette instead of the page's (1.11–1.96:1 on
|
|
106
|
+
* a light rail on a dark page before). Only the badge host: the collapsed
|
|
107
|
+
* rail's label tooltip keeps the page palette. On a matching page the values
|
|
108
|
+
* equal the root's, so the badge renders exactly as before (AC-4).
|
|
109
|
+
*/
|
|
110
|
+
describe('Theme scope of a themed sidenav rail badge (request 051)', () => {
|
|
111
|
+
const COLOUR = /^--(color-|gradient-|shadow-|elevation-|accent-line$|app-background-image$)/;
|
|
112
|
+
const colours = (tokens: Record<string, string>) =>
|
|
113
|
+
Object.fromEntries(Object.entries(tokens).filter(([name]) => COLOUR.test(name)));
|
|
114
|
+
const LIGHT_RAIL = '.lc-sidenav-container--light .lc-sidenav__nav-badge {';
|
|
115
|
+
const DARK_RAIL = '.lc-sidenav-container--dark .lc-sidenav__nav-badge {';
|
|
116
|
+
|
|
117
|
+
it('AC-3/AC-4: the light rail badge declares exactly the colour tokens of the light root (172), with the same values', () => {
|
|
118
|
+
const badge = tokensOf(light, `\n${LIGHT_RAIL}`);
|
|
119
|
+
expect(Object.keys(badge)).toHaveLength(172);
|
|
120
|
+
expect(badge).toEqual(colours(tokensOf(light, ':root,')));
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('AC-3/AC-4: the dark rail badge declares exactly the colour tokens of the dark root (172), with the same values', () => {
|
|
124
|
+
const badge = tokensOf(dark, `\n${DARK_RAIL}`);
|
|
125
|
+
expect(Object.keys(badge)).toHaveLength(172);
|
|
126
|
+
expect(badge).toEqual(colours(tokensOf(dark, ':root.dark,')));
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('emits each rail rule once, in its own theme file, after the header rule', () => {
|
|
130
|
+
expect(light.split(LIGHT_RAIL)).toHaveLength(2);
|
|
131
|
+
expect(dark.split(DARK_RAIL)).toHaveLength(2);
|
|
132
|
+
expect(light.includes('.lc-sidenav-container--dark')).toBe(false);
|
|
133
|
+
expect(dark.includes('.lc-sidenav-container--light')).toBe(false);
|
|
134
|
+
expect(light.indexOf(LIGHT_RAIL)).toBeGreaterThan(light.indexOf('.lc-header--light {'));
|
|
135
|
+
expect(dark.indexOf(DARK_RAIL)).toBeGreaterThan(dark.indexOf('.lc-header--dark {'));
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('scopes the badge host only, not the rail or its label tooltip', () => {
|
|
139
|
+
for (const css of [light, dark]) {
|
|
140
|
+
const selectors = [...css.matchAll(/(^|\n)([^\n{}]*lc-sidenav[^\n{}]*)\{/g)].map((m) => m[2].trim());
|
|
141
|
+
expect(selectors).toEqual([expect.stringMatching(/^\.lc-sidenav-container--(light|dark) \.lc-sidenav__nav-badge$/)]);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|