@arsedizioni/ars-utils 22.1.2 → 22.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,9 @@ import { Observable } from 'rxjs';
8
8
  import { MatFormFieldAppearance } from '@angular/material/form-field';
9
9
  import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from '@angular/forms';
10
10
  import { PasswordStrength } from '@arsedizioni/ars-utils/core';
11
+ import { ConnectedPosition } from '@angular/cdk/overlay';
12
+ import { TooltipPosition } from '@angular/material/tooltip';
13
+ import { ActivatedRoute } from '@angular/router';
11
14
 
12
15
  interface DialogResult {
13
16
  result?: 'ok' | 'cancel' | 'other';
@@ -1292,5 +1295,647 @@ declare class FlexLayoutModule {
1292
1295
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<FlexLayoutModule>;
1293
1296
  }
1294
1297
 
1295
- export { ALIAS_FAMILIES, BS5_BREAKPOINTS, BusyDialogComponent, BusyTimer, CANONICAL_ALIASES, ConfirmDialogComponent, CredentialsDialogComponent, DeleteDialogComponent, DeleteDialogConfirmMode, DialogService, FlexLayoutModule, FxClassDirective, FxFlexAlignDirective, FxFlexDirective, FxFlexFillDirective, FxFlexOffsetDirective, FxFlexOrderDirective, FxGridAreaDirective, FxGridColumnDirective, FxGridDirective, FxLayoutAlignDirective, FxLayoutDirective, FxLayoutGapDirective, FxLayoutWrapDirective, FxShowHideDirective, FxStyleDirective, IfBpDirective, InfoDialogComponent, LAYOUT_BREAKPOINTS, LAYOUT_VALUES, MediaObserver, NON_CANONICAL_PRIORITY, OtpInputComponent, PaginatorIntl, PasswordStrengthComponent, RecoverPasswordDialogComponent, ResetPasswordDialogComponent, ResponsiveBaseDirective, ToastComponent, UIService, applyVisibility, buildAlignStyles, buildFlexStyles, buildLayoutCSS, resolve, resolveAll, resolveFlexInput, resolveNonCanonical, resolveParentFlow, validateBasis, validateLayoutValue, validateWrapValue };
1296
- export type { BpValues, BreakpointAlias, CanonicalKey, ConfirmDialogData, ConfirmDialogOption, CredentialsDialogData, CredentialsDialogResult, DeleteDialogData, DialogOption, DialogResult, IDialogService, InfoDialogData, NcValues, NonCanonicalKey, RecoverPasswordDialogData, RecoverPasswordDialogResult, ResetPasswordDialogData, ResetPasswordDialogMode, ResetPasswordDialogResult, ToastData };
1298
+ /**
1299
+ * @file navigation.definitions.ts
1300
+ *
1301
+ * Data model shared by every variant of the Material Design 3 (Expressive)
1302
+ * navigation component: Navigation bar, Navigation rail (collapsed and
1303
+ * expanded) and Navigation drawer (standard and modal).
1304
+ *
1305
+ * Reference: https://m3.material.io/components/navigation-bar/specs
1306
+ * https://m3.material.io/components/navigation-rail/specs
1307
+ * https://m3.material.io/components/navigation-drawer/specs
1308
+ */
1309
+
1310
+ /**
1311
+ * Rendering variants supported by the component.
1312
+ *
1313
+ * - `bar` — Navigation bar, horizontal, anchored to the bottom edge (compact windows).
1314
+ * - `rail` — Collapsed navigation rail, vertical, 96dp wide (medium / expanded windows).
1315
+ * - `rail-expanded` — Expanded navigation rail, 220dp+, labels beside icons, supports sections.
1316
+ * - `drawer` — Standard navigation drawer, 360dp, inline with the page content.
1317
+ * - `modal` — Modal navigation drawer: same as `drawer` but overlaid on a scrim.
1318
+ * - `auto` — Resolved at runtime from the active CDK breakpoint (see `autoVariants`).
1319
+ */
1320
+ type NavigationVariant = 'auto' | 'bar' | 'rail' | 'rail-expanded' | 'drawer' | 'modal';
1321
+ /** Variants that can actually be rendered, i.e. every variant except `auto`. */
1322
+ type ResolvedNavigationVariant = Exclude<NavigationVariant, 'auto'>;
1323
+ /**
1324
+ * Label visibility policy, mirroring the four Material label visibility modes.
1325
+ *
1326
+ * - `auto` — Labels are always shown (current M3 guidance).
1327
+ * - `labeled` — Labels are always shown.
1328
+ * - `selected` — Only the active destination shows its label (legacy M3 "auto" behaviour).
1329
+ * - `unlabeled` — Icons only; the accessible name comes from `aria-label` / tooltip.
1330
+ */
1331
+ type NavigationLabelVisibility = 'auto' | 'labeled' | 'selected' | 'unlabeled';
1332
+ /**
1333
+ * Item layout inside a destination.
1334
+ *
1335
+ * - `vertical` — Icon stacked above the label (M3 default for compact windows).
1336
+ * - `horizontal` — Icon at the start of the label (M3 Expressive, medium windows and above).
1337
+ * - `auto` — `vertical` on compact windows, `horizontal` from 600dp upwards; always
1338
+ * `horizontal` for the expanded rail and the drawer.
1339
+ */
1340
+ type NavigationItemLayout = 'auto' | 'vertical' | 'horizontal';
1341
+ /** Vertical alignment of the destination list inside a rail. */
1342
+ type NavigationAlignment = 'top' | 'center' | 'bottom';
1343
+ /** Side the rail / drawer is anchored to. Automatically mirrored in RTL. */
1344
+ type NavigationPosition = 'start' | 'end';
1345
+ /**
1346
+ * Badge attached to a destination.
1347
+ * When `value` is `undefined` a small dot badge is rendered, otherwise a large
1348
+ * badge showing the value (clamped to `max`).
1349
+ */
1350
+ interface NavigationBadge {
1351
+ /** Numeric or textual content of the badge. Leave `undefined` for a dot badge. */
1352
+ value?: number | string;
1353
+ /** Upper bound for numeric values; above it the badge renders `${max}+`. Defaults to 999. */
1354
+ max?: number;
1355
+ /** Accessible description announced together with the destination label. */
1356
+ ariaLabel?: string;
1357
+ /** Optional CSS colour override for this badge only. */
1358
+ color?: string;
1359
+ }
1360
+ /**
1361
+ * Frame indices of a sprite sheet, one per interaction state.
1362
+ *
1363
+ * The same shape describes the light set (declared inline on the sprite) and the
1364
+ * dark set (declared under `NavigationIconSprite.dark`), so a sheet holding both
1365
+ * themes needs no duplicated geometry.
1366
+ */
1367
+ interface NavigationSpriteFrames {
1368
+ /** Zero-based frame index for the resting state. Defaults to 0. */
1369
+ normal?: number;
1370
+ /** Frame index used on hover and on keyboard focus. Defaults to `normal`. */
1371
+ hover?: number;
1372
+ /** Frame index used when the destination is selected. Defaults to `hover`. */
1373
+ active?: number;
1374
+ /** Frame index used when the destination is disabled. Defaults to `normal`. */
1375
+ disabled?: number;
1376
+ }
1377
+ /**
1378
+ * Sprite sheet descriptor: a single image holding every state frame of an icon,
1379
+ * revealed by shifting `background-position` — no extra request per state.
1380
+ *
1381
+ * Frames are assumed to be square and evenly spaced, laid out along a single
1382
+ * axis. Two geometries are described, and they are NOT the same thing:
1383
+ * - `size` is the side of a frame INSIDE the image file;
1384
+ * - `renderSize` is the side the icon is actually drawn at.
1385
+ * The component rescales the whole sheet through `background-size`, so a strip
1386
+ * of 26px frames can be drawn at the 24px of the surrounding Material icons
1387
+ * without the neighbouring frames bleeding in.
1388
+ *
1389
+ * The frame indices declared inline are the light-theme set; `dark` overrides
1390
+ * the ones that differ when the dark theme is active. A sheet that carries a
1391
+ * single set simply omits `dark`.
1392
+ */
1393
+ interface NavigationIconSprite extends NavigationSpriteFrames {
1394
+ /** URL of the sprite sheet. */
1395
+ url: string;
1396
+ /** Side of a single frame inside the image file, in pixels. Defaults to 24. */
1397
+ size?: number;
1398
+ /** Side the icon is drawn at, in pixels. Defaults to `size`. */
1399
+ renderSize?: number;
1400
+ /**
1401
+ * Total number of frames in the sheet, needed to rescale it.
1402
+ * Defaults to the highest referenced frame index plus one, which is correct
1403
+ * for any sheet that has no trailing unused frame.
1404
+ */
1405
+ frames?: number;
1406
+ /** Axis the frames are laid out along. Defaults to `vertical`. */
1407
+ direction?: 'vertical' | 'horizontal';
1408
+ /** Frame indices used when the dark theme is active. Defaults to the light ones. */
1409
+ dark?: NavigationSpriteFrames;
1410
+ }
1411
+ /** A single navigation destination. */
1412
+ interface NavigationItem {
1413
+ /** Stable unique identifier; used as the `@for` track key and as the selection value. */
1414
+ id: string;
1415
+ /** Visible label. Also used as the accessible name and as the tooltip fallback. */
1416
+ label: string;
1417
+ /** Material Symbols ligature rendered when the destination is NOT selected. */
1418
+ icon?: string;
1419
+ /** Material Symbols ligature rendered when the destination IS selected (usually the filled variant). */
1420
+ activeIcon?: string;
1421
+ /** Path of a raster / vector image rendered as the icon. Takes precedence over `icon`. */
1422
+ imageIcon?: string;
1423
+ /** Image used when the destination is selected. Takes precedence over `activeIcon`. */
1424
+ activeImageIcon?: string;
1425
+ /**
1426
+ * Sprite sheet holding every state frame of the icon. Takes precedence over
1427
+ * `imageIcon` and `icon`; state changes cost one `background-position` shift.
1428
+ */
1429
+ sprite?: NavigationIconSprite;
1430
+ /** Name of an SVG icon registered in `MatIconRegistry`; takes precedence over `icon`. */
1431
+ svgIcon?: string;
1432
+ /** SVG icon used when the destination is selected; takes precedence over `activeIcon`. */
1433
+ activeSvgIcon?: string;
1434
+ /** Badge shown on top of the icon (collapsed variants) or at the trailing edge (expanded variants). */
1435
+ badge?: NavigationBadge;
1436
+ /** Short trailing text shown at the end of the row in the expanded rail and in the drawer. */
1437
+ trailing?: string;
1438
+ /** When `true` the destination is rendered dimmed and is not interactive. */
1439
+ disabled?: boolean;
1440
+ /**
1441
+ * When `true` the destination is not rendered inline in the compact variants:
1442
+ * it is moved into the overflow menu instead. Which variants count as compact
1443
+ * is decided by the component's `overflowMode` input.
1444
+ */
1445
+ hideWhenCompact?: boolean;
1446
+ /** Tooltip text; defaults to `label` when the label is not visible. */
1447
+ tooltip?: string;
1448
+ /** Router commands used to build the destination URL. */
1449
+ route?: string | readonly unknown[];
1450
+ /** Query parameters appended to `route`. */
1451
+ queryParams?: Record<string, unknown>;
1452
+ /** Fragment appended to `route`. */
1453
+ fragment?: string;
1454
+ /** When `true` the route must match the whole URL to mark the destination active. Defaults to `false`. */
1455
+ exact?: boolean;
1456
+ /** External URL. Rendered as a plain anchor and never matched against the router. */
1457
+ href?: string;
1458
+ /** Anchor target used together with `href`. */
1459
+ target?: string;
1460
+ /** Explicit accessible name, when the visible label is not descriptive enough. */
1461
+ ariaLabel?: string;
1462
+ /**
1463
+ * Nested destinations. A destination with children never navigates on its own:
1464
+ * clicking it expands the group inline (expanded rail / drawer) or opens it in
1465
+ * a floating panel (bar / collapsed rail).
1466
+ */
1467
+ children?: readonly NavigationItem[];
1468
+ /** Initial expansion state of a destination that has `children`. Defaults to `false`. */
1469
+ expanded?: boolean;
1470
+ /**
1471
+ * Edge the destination is pinned to inside a rail or a drawer.
1472
+ * `bottom` destinations are pushed to the end of the surface. Ignored by the
1473
+ * navigation bar, where every destination shares the same row.
1474
+ */
1475
+ align?: 'top' | 'bottom';
1476
+ /** Arbitrary payload echoed back in `NavigationSelection`. */
1477
+ data?: unknown;
1478
+ }
1479
+ /**
1480
+ * A group of destinations. Section headlines and dividers are only rendered by
1481
+ * the expanded rail and by the drawer, exactly as described by the M3 specs.
1482
+ */
1483
+ interface NavigationSection {
1484
+ /** Stable unique identifier; used as the `@for` track key. */
1485
+ id: string;
1486
+ /** Optional headline rendered above the group. */
1487
+ label?: string;
1488
+ /** Destinations belonging to the section. */
1489
+ items: readonly NavigationItem[];
1490
+ /** When `true` a divider is rendered after the section. */
1491
+ divider?: boolean;
1492
+ }
1493
+ /** Payload emitted when a destination is activated. */
1494
+ interface NavigationSelection {
1495
+ /** The activated destination. */
1496
+ item: NavigationItem;
1497
+ /** The section the destination belongs to, when sections are in use. */
1498
+ section?: NavigationSection;
1499
+ /** The parent destination, when a nested destination was activated. */
1500
+ parent?: NavigationItem;
1501
+ /** Zero-based index of the destination across the whole flattened list. */
1502
+ index: number;
1503
+ }
1504
+ /**
1505
+ * Policy deciding where `hideWhenCompact` destinations are collapsed into the
1506
+ * overflow menu.
1507
+ *
1508
+ * - `bar` — only in the navigation bar (default).
1509
+ * - `compact` — in the navigation bar and in the collapsed rail.
1510
+ * - `never` — `hideWhenCompact` is ignored and every destination stays inline.
1511
+ */
1512
+ type NavigationOverflowMode = 'bar' | 'compact' | 'never';
1513
+ /**
1514
+ * Identifier of the synthesized overflow destination. Use it to recognise the
1515
+ * overflow entry inside `itemSelected`.
1516
+ */
1517
+ declare const NAVIGATION_OVERFLOW_ID = "__overflow";
1518
+ /** Map of breakpoint alias to the variant used when `variant` is `auto`. */
1519
+ type NavigationAutoVariants = Partial<Record<BreakpointAlias, ResolvedNavigationVariant>>;
1520
+ /**
1521
+ * Default `auto` mapping, aligned with the Material 3 window size classes:
1522
+ * compact windows get the navigation bar, medium and expanded windows get the
1523
+ * collapsed rail, large and extra-large windows get the expanded rail.
1524
+ */
1525
+ declare const DEFAULT_NAVIGATION_AUTO_VARIANTS: Required<NavigationAutoVariants>;
1526
+ /** Variants that render labels beside the icon and support sections and dividers. */
1527
+ declare const EXPANDED_NAVIGATION_VARIANTS: readonly ResolvedNavigationVariant[];
1528
+
1529
+ /** Internal, pre-computed render model for a single destination. */
1530
+ interface NavigationRenderItem {
1531
+ /** The source destination. */
1532
+ readonly item: NavigationItem;
1533
+ /** Owning section, when sections are in use. */
1534
+ readonly section?: NavigationSection;
1535
+ /** Parent destination, for nested destinations. */
1536
+ readonly parent?: NavigationItem;
1537
+ /** Zero-based index across the whole flattened destination list. */
1538
+ readonly index: number;
1539
+ /** Nesting level: `0` for a root destination. */
1540
+ readonly depth: number;
1541
+ /** Resolved URL, when the destination is routed or external. */
1542
+ readonly href?: string;
1543
+ /** `true` when the destination navigates through the Angular router. */
1544
+ readonly routed: boolean;
1545
+ /** Material Symbols ligature for the unselected state. */
1546
+ readonly iconOff?: string;
1547
+ /** Material Symbols ligature for the selected state. */
1548
+ readonly iconOn?: string;
1549
+ /** Registered SVG icon name for the unselected state. */
1550
+ readonly svgOff?: string;
1551
+ /** Registered SVG icon name for the selected state. */
1552
+ readonly svgOn?: string;
1553
+ /** Image URL for the unselected state. */
1554
+ readonly imageOff?: string;
1555
+ /** Image URL for the selected state. */
1556
+ readonly imageOn?: string;
1557
+ /** Inline custom properties driving a sprite-sheet icon, when one is used. */
1558
+ readonly spriteStyle?: Record<string, string>;
1559
+ /** Rendered badge text; empty string means "dot badge". */
1560
+ readonly badgeText: string;
1561
+ /** `true` when the destination carries a badge of any kind. */
1562
+ readonly hasBadge: boolean;
1563
+ /** `true` when the destination never renders its label, whatever the label policy. */
1564
+ readonly iconOnly: boolean;
1565
+ /** `true` when the destination owns nested destinations. */
1566
+ readonly hasChildren: boolean;
1567
+ /** Pre-computed render models of the nested destinations. */
1568
+ readonly children: readonly NavigationRenderItem[];
1569
+ /** Accessible name announced for the destination. */
1570
+ readonly ariaLabel: string;
1571
+ /** Tooltip text used when the label is not visible. */
1572
+ readonly tooltip: string;
1573
+ }
1574
+ /** Internal render model for a section and its destinations. */
1575
+ interface NavigationRenderSection {
1576
+ /** The source section. */
1577
+ readonly section: NavigationSection;
1578
+ /** Destinations of the section. */
1579
+ readonly items: readonly NavigationRenderItem[];
1580
+ }
1581
+ /** Internal render model for one row of the floating submenu panel. */
1582
+ interface NavigationPanelEntry {
1583
+ /** Stable `@for` track key. */
1584
+ readonly key: string;
1585
+ /** Heading text, when the row is a group heading. */
1586
+ readonly label?: string;
1587
+ /** Destination to render, when the row is an actual entry. */
1588
+ readonly render?: NavigationRenderItem;
1589
+ }
1590
+ /** Internal render model for one of the two anchoring groups of a surface. */
1591
+ interface NavigationRenderGroup {
1592
+ /** Edge the group is pinned to. */
1593
+ readonly align: 'top' | 'bottom';
1594
+ /** Sections belonging to the group. */
1595
+ readonly sections: readonly NavigationRenderSection[];
1596
+ }
1597
+ declare class NavigationBarComponent {
1598
+ private readonly media;
1599
+ private readonly themeService;
1600
+ private readonly router;
1601
+ private readonly directionality;
1602
+ private readonly hostRef;
1603
+ private readonly destroyRef;
1604
+ /** Flat list of destinations. Ignored when `sections` is provided. */
1605
+ readonly items: _angular_core.InputSignal<readonly NavigationItem[]>;
1606
+ /** Grouped destinations. Section headlines and dividers only render in the expanded variants. */
1607
+ readonly sections: _angular_core.InputSignal<readonly NavigationSection[]>;
1608
+ /** Rendering variant. `auto` resolves from the active breakpoint through `autoVariants`. */
1609
+ readonly variant: _angular_core.InputSignal<NavigationVariant>;
1610
+ /** Breakpoint → variant map used when `variant` is `auto`. Missing entries fall back to the M3 defaults. */
1611
+ readonly autoVariants: _angular_core.InputSignal<Partial<Record<"xs" | "sm" | "md" | "lg" | "xl", ResolvedNavigationVariant>>>;
1612
+ /** Two-way bound id of the selected destination. The router, when active, takes precedence. */
1613
+ readonly selectedId: _angular_core.ModelSignal<string>;
1614
+ /**
1615
+ * Two-way bound ids of the expanded parent destinations.
1616
+ * Leave unbound (`undefined`) to let the component manage the expansion state
1617
+ * on its own, seeding it from `NavigationItem.expanded` and auto-opening the
1618
+ * ancestors of the active destination.
1619
+ */
1620
+ readonly expandedIds: _angular_core.ModelSignal<readonly string[]>;
1621
+ /** Two-way bound open state of the modal drawer. Ignored by the other variants. */
1622
+ readonly open: _angular_core.ModelSignal<boolean>;
1623
+ /** Label visibility policy. */
1624
+ readonly labelVisibility: _angular_core.InputSignal<NavigationLabelVisibility>;
1625
+ /** Icon / label arrangement inside a destination. */
1626
+ readonly itemLayout: _angular_core.InputSignal<NavigationItemLayout>;
1627
+ /** Vertical alignment of the `top` destination group inside a rail. */
1628
+ readonly alignment: _angular_core.InputSignal<NavigationAlignment>;
1629
+ /** Edge the rail / drawer is anchored to. Mirrored automatically in RTL. */
1630
+ readonly position: _angular_core.InputSignal<NavigationPosition>;
1631
+ /** Headline rendered above the destinations in the expanded rail and in the drawer. */
1632
+ readonly headline: _angular_core.InputSignal<string>;
1633
+ /** When `true` a leading menu button is rendered; it emits `menuClick`. */
1634
+ readonly showMenuButton: _angular_core.InputSignalWithTransform<boolean, unknown>;
1635
+ /** Material Symbols ligature used by the menu button. */
1636
+ readonly menuIcon: _angular_core.InputSignal<string>;
1637
+ /** Material Symbols ligature used by the expand / collapse chevron. */
1638
+ readonly expandIcon: _angular_core.InputSignal<string>;
1639
+ /** Where `hideWhenCompact` destinations are collapsed into the overflow menu. */
1640
+ readonly overflowMode: _angular_core.InputSignal<NavigationOverflowMode>;
1641
+ /** Material Symbols ligature of the overflow destination. */
1642
+ readonly overflowIcon: _angular_core.InputSignal<string>;
1643
+ /** Accessible name and tooltip of the overflow destination, which renders icon-only. */
1644
+ readonly overflowLabel: _angular_core.InputSignal<string>;
1645
+ /**
1646
+ * Hard cap on the destinations rendered inline in the compact variants,
1647
+ * applied per anchoring group. The overflow destination counts as one slot.
1648
+ * `0` disables the cap; the M3 specs recommend 3 to 5 for the navigation bar.
1649
+ */
1650
+ readonly maxVisibleItems: _angular_core.InputSignalWithTransform<number, unknown>;
1651
+ /** Accessible name of the menu button. */
1652
+ readonly menuAriaLabel: _angular_core.InputSignal<string>;
1653
+ /** Accessible name of the navigation landmark. */
1654
+ readonly ariaLabel: _angular_core.InputSignal<string>;
1655
+ /** When `true` a scrim is rendered behind the modal drawer. */
1656
+ readonly scrim: _angular_core.InputSignalWithTransform<boolean, unknown>;
1657
+ /** When `true` the modal drawer closes as soon as a destination is activated. */
1658
+ readonly closeOnSelect: _angular_core.InputSignalWithTransform<boolean, unknown>;
1659
+ /** When `true` the surface gets the M3 elevation-3 shadow. */
1660
+ readonly elevated: _angular_core.InputSignalWithTransform<boolean, unknown>;
1661
+ /** When `true` a 1px divider separates the surface from the page content. */
1662
+ readonly bordered: _angular_core.InputSignalWithTransform<boolean, unknown>;
1663
+ /** When `true` tooltips are shown for destinations whose label is not visible. */
1664
+ readonly tooltips: _angular_core.InputSignalWithTransform<boolean, unknown>;
1665
+ /** When `true` the selection follows the current router URL. */
1666
+ readonly routerSync: _angular_core.InputSignalWithTransform<boolean, unknown>;
1667
+ /** Route used to resolve relative `route` commands. Absolute resolution when omitted. */
1668
+ readonly relativeTo: _angular_core.InputSignal<ActivatedRoute>;
1669
+ /** Explicit surface width in pixels for the rail / drawer variants. `0` keeps the spec default. */
1670
+ readonly width: _angular_core.InputSignalWithTransform<number, unknown>;
1671
+ /** When `true` the whole surface is hidden (animated off-screen) without being destroyed. */
1672
+ readonly hidden: _angular_core.InputSignalWithTransform<boolean, unknown>;
1673
+ /** Emitted when a destination is activated by the user. */
1674
+ readonly itemSelected: _angular_core.OutputEmitterRef<NavigationSelection>;
1675
+ /** Emitted when the leading menu button is pressed. */
1676
+ readonly menuClick: _angular_core.OutputEmitterRef<void>;
1677
+ /** Focusable destination elements, in DOM order; used for keyboard roving. */
1678
+ private readonly itemElements;
1679
+ /** Focusable entries of the floating submenu panel, in DOM order. */
1680
+ private readonly panelElements;
1681
+ /** Current router URL, kept in a signal so the template stays zoneless-friendly. */
1682
+ private readonly routerUrl;
1683
+ /**
1684
+ * Ticks whenever the application theme moves. The emitted value is ignored on
1685
+ * purpose: it is a change notification, not the answer.
1686
+ *
1687
+ * Reads `themeService`, so it MUST stay below the injected dependencies: moved
1688
+ * above them it would read `undefined`, `?? EMPTY` would swallow it and the
1689
+ * theme would silently stop propagating, with nothing to show for it at
1690
+ * compile time.
1691
+ */
1692
+ private readonly themeChanged;
1693
+ /**
1694
+ * `true` when the dark theme is active; selects the dark frame set of a sprite.
1695
+ *
1696
+ * The answer comes from `getTheme()`, the only one that resolves `auto`
1697
+ * against the OS preference. `getTheme()` already reads a signal for the
1698
+ * explicit modes, so `themeChanged()` is read for the one case that is not
1699
+ * reactive on its own: mode `auto` plus a change of the OS colour scheme,
1700
+ * which leaves the stored mode on `auto` and only travels through `changed`.
1701
+ * Falls back to the light set when no `ThemeService` is provided.
1702
+ */
1703
+ private readonly isDark;
1704
+ /** Id of the destination whose children are currently shown in the floating panel. */
1705
+ private readonly popupId;
1706
+ /**
1707
+ * Destination whose children are currently shown in the floating panel.
1708
+ *
1709
+ * Derived from the id and NOT stored as an object: the render model is rebuilt
1710
+ * whenever the destinations, the resolved URLs or the theme change, and a
1711
+ * stored object would keep the panel painting the sprite frames of the
1712
+ * previous theme until the panel is closed and reopened.
1713
+ *
1714
+ * The search is recursive because a panel entry can itself own children and
1715
+ * open a panel of its own, and those nested render models are not part of the
1716
+ * top level of `visibleGroups`.
1717
+ *
1718
+ * Reads `visibleGroups`, which is declared further down: safe because
1719
+ * `computed` is lazy and nothing reads this before the first render — the
1720
+ * opposite of `themeChanged` above, which reads its dependency immediately.
1721
+ */
1722
+ protected readonly popupItem: _angular_core.Signal<NavigationRenderItem>;
1723
+ /** Element the floating panel is anchored to. */
1724
+ private readonly popupAnchor;
1725
+ constructor();
1726
+ /** Sections actually rendered: the `sections` input, or a single implicit section wrapping `items`. */
1727
+ private readonly resolvedSections;
1728
+ /** Every destination, nested ones included, in depth-first order. */
1729
+ private readonly allItems;
1730
+ /** Map of destination id to the id of its parent destination. */
1731
+ private readonly parentOf;
1732
+ /** The variant to render, resolving `auto` against the active CDK breakpoint. */
1733
+ protected readonly resolvedVariant: _angular_core.Signal<ResolvedNavigationVariant>;
1734
+ /** `true` for the variants that render labels beside icons and support sections. */
1735
+ protected readonly isExpanded: _angular_core.Signal<boolean>;
1736
+ /** `true` when the surface is the modal drawer. */
1737
+ protected readonly isModal: _angular_core.Signal<boolean>;
1738
+ /** `true` when the modal drawer is currently open. */
1739
+ protected readonly isOverlayOpen: _angular_core.Signal<boolean>;
1740
+ /** `true` when the surface must be visually hidden. */
1741
+ protected readonly isHidden: _angular_core.Signal<boolean>;
1742
+ /** Resolved icon / label arrangement. */
1743
+ protected readonly resolvedLayout: _angular_core.Signal<"vertical" | "horizontal">;
1744
+ /** Resolved label visibility; the expanded variants always show labels. */
1745
+ protected readonly resolvedLabelVisibility: _angular_core.Signal<"labeled" | "selected" | "unlabeled">;
1746
+ /** `true` when the headline row (menu button, headline text) is rendered. */
1747
+ protected readonly showsHeader: _angular_core.Signal<boolean>;
1748
+ /**
1749
+ * Geometry of the active indicator:
1750
+ * `compact` wraps the icon only (56x32 pill), `wide` wraps icon and label
1751
+ * together, exactly as described by the M3 Expressive specs.
1752
+ */
1753
+ protected readonly indicatorMode: _angular_core.Signal<"compact" | "wide">;
1754
+ /** Tooltip placement derived from the variant and from the anchoring edge. */
1755
+ protected readonly tooltipPosition: _angular_core.Signal<TooltipPosition>;
1756
+ /** Inline width override for the rail / drawer, or `undefined` to keep the spec default. */
1757
+ protected readonly widthStyle: _angular_core.Signal<string>;
1758
+ /** Map of destination id to resolved URL. Recomputed only when the destinations change. */
1759
+ private readonly hrefs;
1760
+ /**
1761
+ * Static render model, rebuilt only when the destinations, the resolved URLs
1762
+ * or the theme change — never when the selection or the expansion state
1763
+ * changes. The theme is a dependency because sprite icons carry one frame set
1764
+ * per theme, and the frames are baked into the inline style of the icon.
1765
+ */
1766
+ private readonly renderGroups;
1767
+ /** Id of the destination matching the current router URL, using longest-prefix matching. */
1768
+ private readonly routerActiveId;
1769
+ /** Id of the currently active destination: router URL first, explicit selection as fallback. */
1770
+ protected readonly activeId: _angular_core.Signal<string>;
1771
+ /**
1772
+ * Expansion state used when `expandedIds` is left unbound: the destinations
1773
+ * flagged `expanded`, plus every ancestor of the active destination.
1774
+ */
1775
+ private readonly defaultExpandedIds;
1776
+ /** Ids of the parent destinations currently expanded. */
1777
+ protected readonly expandedSet: _angular_core.Signal<ReadonlySet<string>>;
1778
+ /** `true` when the current variant collapses `hideWhenCompact` destinations into the overflow menu. */
1779
+ protected readonly overflowApplies: _angular_core.Signal<boolean>;
1780
+ /**
1781
+ * Render model actually walked by the template: the static model with the
1782
+ * compact-only destinations moved into the overflow menu and the children of
1783
+ * the expanded parents spliced in.
1784
+ */
1785
+ protected readonly visibleGroups: _angular_core.Signal<readonly NavigationRenderGroup[]>;
1786
+ /**
1787
+ * Ids rendered with the selected styling. It is the active destination when it
1788
+ * is on screen, otherwise every rendered parent hiding it — a collapsed branch
1789
+ * or the overflow entry — so the user still sees where they are.
1790
+ */
1791
+ protected readonly highlightedIds: _angular_core.Signal<ReadonlySet<string>>;
1792
+ /**
1793
+ * Rows of the floating submenu panel. Nested destinations one level down are
1794
+ * flattened under a heading, so the overflow menu can hold parents too.
1795
+ */
1796
+ protected readonly popupEntries: _angular_core.Signal<readonly NavigationPanelEntry[]>;
1797
+ /** `true` when the floating submenu panel must be shown. */
1798
+ protected readonly isPopupOpen: _angular_core.Signal<boolean>;
1799
+ /** Element the floating submenu panel is anchored to. */
1800
+ protected readonly popupOrigin: _angular_core.Signal<HTMLElement>;
1801
+ /** Connected positions of the floating submenu panel, derived from the variant. */
1802
+ protected readonly popupPositions: _angular_core.Signal<ConnectedPosition[]>;
1803
+ /** `true` when the layout runs right-to-left; used to mirror the arrow keys. */
1804
+ private readonly isRtl;
1805
+ /**
1806
+ * Activates a destination, or expands it when it owns nested destinations.
1807
+ * A parent never navigates: it toggles its group inline in the wide variants
1808
+ * and opens the floating panel in the compact ones.
1809
+ * @param render - The render model of the activated destination.
1810
+ * @param event - The originating mouse or keyboard event.
1811
+ */
1812
+ protected select(render: NavigationRenderItem, event: Event): void;
1813
+ /**
1814
+ * Emits `menuClick` when the leading menu button is pressed.
1815
+ */
1816
+ protected onMenuClick(): void;
1817
+ /**
1818
+ * Closes the modal drawer when the scrim is clicked.
1819
+ */
1820
+ protected onScrimClick(): void;
1821
+ /**
1822
+ * Handles keyboard interaction: arrow keys move the focus between
1823
+ * destinations, `Home` / `End` jump to the first / last one and `Escape`
1824
+ * closes the floating submenu panel or the modal drawer.
1825
+ *
1826
+ * The same handler serves the surface and the floating panel, and it tells
1827
+ * them apart by `currentTarget`: roving inside an open `role="menu"` must stay
1828
+ * inside it, and a programmatic `focus()` is NOT stopped by the focus trap, so
1829
+ * sharing one element list would send the focus onto the surface behind the
1830
+ * overlay.
1831
+ *
1832
+ * @param event - The originating keyboard event.
1833
+ */
1834
+ protected onKeydown(event: KeyboardEvent): void;
1835
+ /**
1836
+ * Expands or collapses the parent destination with the given id.
1837
+ * @param id - Identifier of the parent destination to toggle.
1838
+ */
1839
+ toggleExpanded(id: string): void;
1840
+ /**
1841
+ * Opens the floating submenu panel of a parent destination.
1842
+ * @param render - The render model of the parent destination.
1843
+ * @param event - The originating event, used to anchor the panel.
1844
+ */
1845
+ protected openPopup(render: NavigationRenderItem, event: Event): void;
1846
+ /**
1847
+ * Closes the floating submenu panel.
1848
+ */
1849
+ closePopup(): void;
1850
+ /**
1851
+ * Opens the modal drawer. No-op for the other variants.
1852
+ */
1853
+ openDrawer(): void;
1854
+ /**
1855
+ * Closes the modal drawer. No-op for the other variants.
1856
+ */
1857
+ closeDrawer(): void;
1858
+ /**
1859
+ * Toggles the modal drawer. No-op for the other variants.
1860
+ */
1861
+ toggleDrawer(): void;
1862
+ /**
1863
+ * Moves the browser focus to the destination with the given id.
1864
+ * @param id - Identifier of the destination to focus.
1865
+ * @returns `true` when a matching destination was found and focused.
1866
+ */
1867
+ focusItem(id: string): boolean;
1868
+ /**
1869
+ * Moves the compact-only destinations of a group into a synthesized overflow
1870
+ * destination appended at the end of the group.
1871
+ * @param group - The group to process.
1872
+ * @param overflow - `true` when `hideWhenCompact` must be honoured.
1873
+ * @param max - Hard cap on the inline destinations; `0` disables it.
1874
+ * @returns The group with the overflow destination applied.
1875
+ */
1876
+ private applyOverflow;
1877
+ /**
1878
+ * Builds the synthesized, icon-only overflow destination.
1879
+ * @param children - The destinations moved into the overflow menu.
1880
+ * @returns The render model of the overflow destination.
1881
+ */
1882
+ private buildOverflowItem;
1883
+ /**
1884
+ * Merges the `top` and `bottom` groups into a single `top` group, combining
1885
+ * the sections that share an id so `@for` track keys stay unique.
1886
+ * @param groups - The groups to merge.
1887
+ * @returns A single-group array, or the input when there is nothing to merge.
1888
+ */
1889
+ private static mergeGroups;
1890
+ /**
1891
+ * Builds the render model of a destination and, recursively, of its children.
1892
+ * @param item - The source destination.
1893
+ * @param section - The section the destination belongs to.
1894
+ * @param parent - The parent destination, for nested destinations.
1895
+ * @param depth - Nesting level of the destination.
1896
+ * @param counter - Shared counter producing the flat destination index.
1897
+ * @param hrefs - Map of destination id to resolved URL.
1898
+ * @param dark - `true` when the dark theme is active, selecting the dark sprite frames.
1899
+ * @returns The render model of the destination.
1900
+ */
1901
+ private static buildRenderItem;
1902
+ /**
1903
+ * Translates a sprite descriptor into the inline custom properties the
1904
+ * stylesheet uses to size the icon and to shift `background-position` per
1905
+ * interaction state.
1906
+ *
1907
+ * The sheet is rescaled through `background-size` instead of being drawn at
1908
+ * its natural size: that is what lets a strip of 26px frames be painted at the
1909
+ * 24px of the surrounding Material icons without the neighbouring frames
1910
+ * bleeding into the box, and it makes the step between two frames exactly the
1911
+ * rendered side.
1912
+ *
1913
+ * @param item - The destination whose sprite must be translated.
1914
+ * @param dark - `true` when the dark theme is active, selecting the `dark` frame set.
1915
+ * @returns The inline style map, or `undefined` when the destination uses no sprite.
1916
+ */
1917
+ private static buildSpriteStyle;
1918
+ /**
1919
+ * Number of frames a sprite sheet holds, needed to rescale it.
1920
+ * @param sprite - The sprite descriptor to measure.
1921
+ * @returns The declared frame count, or the highest referenced index plus one.
1922
+ */
1923
+ private static spriteFrameCount;
1924
+ /**
1925
+ * Formats the badge content of a destination.
1926
+ * @param item - The destination whose badge must be formatted.
1927
+ * @returns The badge text, or an empty string for a dot badge / no badge.
1928
+ */
1929
+ private static formatBadge;
1930
+ /**
1931
+ * Strips the query string and the fragment from a URL.
1932
+ * @param url - The URL to normalise.
1933
+ * @returns The path portion of the URL.
1934
+ */
1935
+ private static pathOf;
1936
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NavigationBarComponent, never>;
1937
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NavigationBarComponent, "navigation-bar", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "sections": { "alias": "sections"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "autoVariants": { "alias": "autoVariants"; "required": false; "isSignal": true; }; "selectedId": { "alias": "selectedId"; "required": false; "isSignal": true; }; "expandedIds": { "alias": "expandedIds"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "labelVisibility": { "alias": "labelVisibility"; "required": false; "isSignal": true; }; "itemLayout": { "alias": "itemLayout"; "required": false; "isSignal": true; }; "alignment": { "alias": "alignment"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "headline": { "alias": "headline"; "required": false; "isSignal": true; }; "showMenuButton": { "alias": "showMenuButton"; "required": false; "isSignal": true; }; "menuIcon": { "alias": "menuIcon"; "required": false; "isSignal": true; }; "expandIcon": { "alias": "expandIcon"; "required": false; "isSignal": true; }; "overflowMode": { "alias": "overflowMode"; "required": false; "isSignal": true; }; "overflowIcon": { "alias": "overflowIcon"; "required": false; "isSignal": true; }; "overflowLabel": { "alias": "overflowLabel"; "required": false; "isSignal": true; }; "maxVisibleItems": { "alias": "maxVisibleItems"; "required": false; "isSignal": true; }; "menuAriaLabel": { "alias": "menuAriaLabel"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "scrim": { "alias": "scrim"; "required": false; "isSignal": true; }; "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "elevated": { "alias": "elevated"; "required": false; "isSignal": true; }; "bordered": { "alias": "bordered"; "required": false; "isSignal": true; }; "tooltips": { "alias": "tooltips"; "required": false; "isSignal": true; }; "routerSync": { "alias": "routerSync"; "required": false; "isSignal": true; }; "relativeTo": { "alias": "relativeTo"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "hidden": { "alias": "hidden"; "required": false; "isSignal": true; }; }, { "selectedId": "selectedIdChange"; "expandedIds": "expandedIdsChange"; "open": "openChange"; "itemSelected": "itemSelected"; "menuClick": "menuClick"; }, never, ["[navHeader]", "[navFab]", "[navFooter]"], true, never>;
1938
+ }
1939
+
1940
+ export { ALIAS_FAMILIES, BS5_BREAKPOINTS, BusyDialogComponent, BusyTimer, CANONICAL_ALIASES, ConfirmDialogComponent, CredentialsDialogComponent, DEFAULT_NAVIGATION_AUTO_VARIANTS, DeleteDialogComponent, DeleteDialogConfirmMode, DialogService, EXPANDED_NAVIGATION_VARIANTS, FlexLayoutModule, FxClassDirective, FxFlexAlignDirective, FxFlexDirective, FxFlexFillDirective, FxFlexOffsetDirective, FxFlexOrderDirective, FxGridAreaDirective, FxGridColumnDirective, FxGridDirective, FxLayoutAlignDirective, FxLayoutDirective, FxLayoutGapDirective, FxLayoutWrapDirective, FxShowHideDirective, FxStyleDirective, IfBpDirective, InfoDialogComponent, LAYOUT_BREAKPOINTS, LAYOUT_VALUES, MediaObserver, NAVIGATION_OVERFLOW_ID, NON_CANONICAL_PRIORITY, NavigationBarComponent, OtpInputComponent, PaginatorIntl, PasswordStrengthComponent, RecoverPasswordDialogComponent, ResetPasswordDialogComponent, ResponsiveBaseDirective, ToastComponent, UIService, applyVisibility, buildAlignStyles, buildFlexStyles, buildLayoutCSS, resolve, resolveAll, resolveFlexInput, resolveNonCanonical, resolveParentFlow, validateBasis, validateLayoutValue, validateWrapValue };
1941
+ export type { BpValues, BreakpointAlias, CanonicalKey, ConfirmDialogData, ConfirmDialogOption, CredentialsDialogData, CredentialsDialogResult, DeleteDialogData, DialogOption, DialogResult, IDialogService, InfoDialogData, NavigationAlignment, NavigationAutoVariants, NavigationBadge, NavigationIconSprite, NavigationItem, NavigationItemLayout, NavigationLabelVisibility, NavigationOverflowMode, NavigationPosition, NavigationSection, NavigationSelection, NavigationSpriteFrames, NavigationVariant, NcValues, NonCanonicalKey, RecoverPasswordDialogData, RecoverPasswordDialogResult, ResetPasswordDialogData, ResetPasswordDialogMode, ResetPasswordDialogResult, ResolvedNavigationVariant, ToastData };