@cqa-lib/cqa-ui 1.1.557 → 1.1.558

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.
Files changed (29) hide show
  1. package/esm2020/lib/sidebar/nav-item.component.mjs +171 -0
  2. package/esm2020/lib/sidebar/nav-menu.component.mjs +56 -0
  3. package/esm2020/lib/sidebar/nav-sub-item.component.mjs +27 -0
  4. package/esm2020/lib/sidebar/profile-menu/profile-menu.component.mjs +122 -0
  5. package/esm2020/lib/sidebar/profile-menu/profile-menu.models.mjs +4 -0
  6. package/esm2020/lib/sidebar/sidebar.component.mjs +286 -0
  7. package/esm2020/lib/sidebar/sidebar.models.mjs +5 -0
  8. package/esm2020/lib/sidebar/workspace-menu/workspace-menu.component.mjs +120 -0
  9. package/esm2020/lib/sidebar/workspace-menu/workspace-menu.models.mjs +2 -0
  10. package/esm2020/lib/templates/modular-table-template/modular-table-template.component.mjs +3 -3
  11. package/esm2020/lib/ui-kit.module.mjs +31 -1
  12. package/esm2020/lib/utils/tw-overlay-container.mjs +3 -1
  13. package/esm2020/public-api.mjs +10 -1
  14. package/fesm2015/cqa-lib-cqa-ui.mjs +818 -20
  15. package/fesm2015/cqa-lib-cqa-ui.mjs.map +1 -1
  16. package/fesm2020/cqa-lib-cqa-ui.mjs +801 -20
  17. package/fesm2020/cqa-lib-cqa-ui.mjs.map +1 -1
  18. package/lib/sidebar/nav-item.component.d.ts +48 -0
  19. package/lib/sidebar/nav-menu.component.d.ts +19 -0
  20. package/lib/sidebar/nav-sub-item.component.d.ts +11 -0
  21. package/lib/sidebar/profile-menu/profile-menu.component.d.ts +35 -0
  22. package/lib/sidebar/profile-menu/profile-menu.models.d.ts +35 -0
  23. package/lib/sidebar/sidebar.component.d.ts +97 -0
  24. package/lib/sidebar/sidebar.models.d.ts +63 -0
  25. package/lib/sidebar/workspace-menu/workspace-menu.component.d.ts +34 -0
  26. package/lib/sidebar/workspace-menu/workspace-menu.models.d.ts +12 -0
  27. package/lib/ui-kit.module.d.ts +164 -158
  28. package/package.json +1 -1
  29. package/public-api.d.ts +9 -0
@@ -0,0 +1,48 @@
1
+ import { ElementRef, OnDestroy, EventEmitter } from '@angular/core';
2
+ import { ConnectedPosition, Overlay, ScrollStrategy } from '@angular/cdk/overlay';
3
+ import { NavChildItem, NavItem } from './sidebar.models';
4
+ import * as i0 from "@angular/core";
5
+ export declare class NavItemComponent implements OnDestroy {
6
+ private readonly overlay;
7
+ item: NavItem;
8
+ isActive: boolean;
9
+ /** Whether the sidebar is in expanded (wide) mode */
10
+ isExpanded: boolean;
11
+ /** Whether this item's sub-menu is open */
12
+ isOpen: boolean;
13
+ /** Current route / selection id — used to highlight child in collapsed flyout */
14
+ activeNavId: string;
15
+ itemClick: EventEmitter<string>;
16
+ navHostRef?: ElementRef<HTMLElement>;
17
+ /** Collapsed parent: drives CDK connected overlay for submenu */
18
+ showCollapsedFlyout: boolean;
19
+ private closeFlyoutTimer;
20
+ private static readonly FLYOUT_CLOSE_DELAY_MS;
21
+ readonly flyoutScrollStrategy: ScrollStrategy;
22
+ readonly collapsedFlyoutPositions: ConnectedPosition[];
23
+ constructor(overlay: Overlay);
24
+ ngOnDestroy(): void;
25
+ get hasChildren(): boolean;
26
+ get collapsedFlyoutOpen(): boolean;
27
+ /**
28
+ * Collapsed rail: show label (leaf) or disabled copy in MatTooltip so it renders in CDK overlay,
29
+ * not as an absolute child inside the scrolling nav.
30
+ */
31
+ get collapsedRailTooltip(): string;
32
+ get collapsedRailTooltipClass(): string;
33
+ isChildRowActive(childId: string): boolean;
34
+ onHostMouseEnter(): void;
35
+ onHostMouseLeave(): void;
36
+ onHostFocusIn(_e: FocusEvent): void;
37
+ onHostFocusOut(e: FocusEvent): void;
38
+ onFlyoutOverlayPointerEnter(): void;
39
+ onFlyoutOverlayPointerLeave(): void;
40
+ onFlyoutOverlayFocusOut(e: FocusEvent): void;
41
+ closeCollapsedFlyout(): void;
42
+ onClick(): void;
43
+ onChildRowClick(e: Event, child: NavChildItem): void;
44
+ private clearFlyoutCloseTimer;
45
+ private scheduleCloseCollapsedFlyout;
46
+ static ɵfac: i0.ɵɵFactoryDeclaration<NavItemComponent, never>;
47
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavItemComponent, "cqa-nav-item", never, { "item": "item"; "isActive": "isActive"; "isExpanded": "isExpanded"; "isOpen": "isOpen"; "activeNavId": "activeNavId"; }, { "itemClick": "itemClick"; }, never, never>;
48
+ }
@@ -0,0 +1,19 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { NavMenuItem, NavItem, NavSection } from './sidebar.models';
3
+ import * as i0 from "@angular/core";
4
+ export declare class NavMenuComponent {
5
+ items: NavMenuItem[];
6
+ activeId: string;
7
+ isExpanded: boolean;
8
+ /** IDs of parent nav items whose sub-menus are currently open */
9
+ openParents: string[];
10
+ itemClick: EventEmitter<string>;
11
+ isSection(item: NavMenuItem): item is NavSection;
12
+ asNavItem(item: NavMenuItem): NavItem;
13
+ isItemActive(item: NavItem): boolean;
14
+ isParentOpen(item: NavItem): boolean;
15
+ isChildActive(childId: string): boolean;
16
+ onItemClick(id: string): void;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<NavMenuComponent, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavMenuComponent, "cqa-nav-menu", never, { "items": "items"; "activeId": "activeId"; "isExpanded": "isExpanded"; "openParents": "openParents"; }, { "itemClick": "itemClick"; }, never, never>;
19
+ }
@@ -0,0 +1,11 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { NavChildItem } from './sidebar.models';
3
+ import * as i0 from "@angular/core";
4
+ export declare class NavSubItemComponent {
5
+ item: NavChildItem;
6
+ isActive: boolean;
7
+ itemClick: EventEmitter<string>;
8
+ onClick(): void;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<NavSubItemComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavSubItemComponent, "cqa-nav-sub-item", never, { "item": "item"; "isActive": "isActive"; }, { "itemClick": "itemClick"; }, never, never>;
11
+ }
@@ -0,0 +1,35 @@
1
+ import { AfterViewInit, EventEmitter, OnChanges, OnDestroy, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core';
2
+ import { Overlay } from '@angular/cdk/overlay';
3
+ import { ProfileMenuEntry, ProfileMenuItem, ProfileMenuUser, isProfileMenuDivider } from './profile-menu.models';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ProfileMenuComponent implements AfterViewInit, OnChanges, OnDestroy {
6
+ private overlay;
7
+ private viewContainerRef;
8
+ user: ProfileMenuUser;
9
+ entries: ProfileMenuEntry[];
10
+ anchor: HTMLElement | null;
11
+ /** Optional id on the popover element — useful for aria-labelledby wiring. */
12
+ popoverId?: string;
13
+ itemClick: EventEmitter<string>;
14
+ dismissed: EventEmitter<void>;
15
+ popoverTpl: TemplateRef<unknown>;
16
+ private overlayRef;
17
+ private keySub;
18
+ private backdropSub;
19
+ private viewInitialized;
20
+ constructor(overlay: Overlay, viewContainerRef: ViewContainerRef);
21
+ ngAfterViewInit(): void;
22
+ ngOnChanges(changes: SimpleChanges): void;
23
+ ngOnDestroy(): void;
24
+ isDivider: typeof isProfileMenuDivider;
25
+ /** Narrowing helper for the template — Angular's template type checker can't
26
+ * follow our custom type guard through `*ngIf-else`, so we surface a typed cast
27
+ * via this method instead. */
28
+ asItem(entry: ProfileMenuEntry): ProfileMenuItem | null;
29
+ trackByEntry: (index: number, _entry: ProfileMenuEntry) => number;
30
+ onItemClick(item: ProfileMenuItem): void;
31
+ private openOverlay;
32
+ private closeOverlay;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<ProfileMenuComponent, never>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<ProfileMenuComponent, "cqa-profile-menu", never, { "user": "user"; "entries": "entries"; "anchor": "anchor"; "popoverId": "popoverId"; }, { "itemClick": "itemClick"; "dismissed": "dismissed"; }, never, never>;
35
+ }
@@ -0,0 +1,35 @@
1
+ export interface ProfileMenuUser {
2
+ /** Two-letter initials shown in the avatar circle (e.g. "TB"). */
3
+ initials: string;
4
+ /** Display name (e.g. "Teslim Bello"). */
5
+ name: string;
6
+ /** Optional email shown under the name. */
7
+ email?: string;
8
+ /** Optional role pill rendered below the email (e.g. "Workspace Admin"). */
9
+ badge?: {
10
+ label: string;
11
+ /** Visual variant: 'admin' (purple, default) or 'default' (neutral). */
12
+ variant?: 'admin' | 'default';
13
+ };
14
+ /** Optional CSS background override for the avatar (gradient or solid). */
15
+ avatarColor?: string;
16
+ }
17
+ export interface ProfileMenuItem {
18
+ /** Stable identifier emitted via `itemClick` when the row is clicked. */
19
+ id: string;
20
+ label: string;
21
+ /** Icon font class — same convention as NavItem.iconClass (e.g. "fa-solid fa-user"). */
22
+ iconClass?: string;
23
+ /** Raw inline SVG markup. Sanitized internally before render. Takes precedence over `iconClass`. */
24
+ iconSvg?: string;
25
+ /** Optional keyboard hint chip rendered on the right (e.g. "⌘O"). */
26
+ shortcut?: string;
27
+ /** 'danger' renders the row in red (used for Logout). */
28
+ variant?: 'default' | 'danger';
29
+ disabled?: boolean;
30
+ }
31
+ export interface ProfileMenuDivider {
32
+ type: 'divider';
33
+ }
34
+ export declare type ProfileMenuEntry = ProfileMenuItem | ProfileMenuDivider;
35
+ export declare function isProfileMenuDivider(entry: ProfileMenuEntry): entry is ProfileMenuDivider;
@@ -0,0 +1,97 @@
1
+ import { EventEmitter, OnChanges, OnInit, SimpleChanges, ElementRef, OnDestroy } from '@angular/core';
2
+ import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
3
+ import { NavMenuItem, SidebarConfig } from './sidebar.models';
4
+ import { ProfileMenuEntry, ProfileMenuUser } from './profile-menu/profile-menu.models';
5
+ import { WorkspaceMenuItem } from './workspace-menu/workspace-menu.models';
6
+ import * as i0 from "@angular/core";
7
+ export declare class SidebarComponent implements OnInit, OnChanges, OnDestroy {
8
+ private sanitizer;
9
+ config: SidebarConfig;
10
+ navItems: NavMenuItem[];
11
+ activeNavId: string;
12
+ /** Parent item IDs to open by default (in addition to the one containing the active item). */
13
+ initialOpenParentIds: string[];
14
+ /**
15
+ * User details rendered in the profile-menu popover header. Required for the popover
16
+ * to open; when undefined the profile card retains its legacy single-action behavior
17
+ * (clicking it directly fires `logoutClick`).
18
+ */
19
+ profileUser?: ProfileMenuUser;
20
+ /**
21
+ * Menu entries shown inside the profile-menu popover. Provide at least one entry to
22
+ * enable the popover; an empty array preserves the legacy `logoutClick` behavior.
23
+ */
24
+ profileMenuEntries: ProfileMenuEntry[];
25
+ /**
26
+ * Workspaces shown inside the workspace-switcher popover. Provide at least one entry
27
+ * to enable the popover; an empty array preserves the legacy `workspaceSwitchClick`
28
+ * behavior (single emit on click, no UI).
29
+ */
30
+ workspaces: WorkspaceMenuItem[];
31
+ /** Id of the currently active workspace — drives the checkmark and active-row tint. */
32
+ currentWorkspaceId?: string | number;
33
+ navItemClick: EventEmitter<string>;
34
+ ctaClick: EventEmitter<void>;
35
+ searchClick: EventEmitter<void>;
36
+ workspaceSwitchClick: EventEmitter<void>;
37
+ logoutClick: EventEmitter<void>;
38
+ notificationsClick: EventEmitter<void>;
39
+ helpDocsClick: EventEmitter<void>;
40
+ speakerClick: EventEmitter<void>;
41
+ liveChatClick: EventEmitter<void>;
42
+ expandedChange: EventEmitter<boolean>;
43
+ /** Emits `ProfileMenuItem.id` when the user activates an entry in the profile popover. */
44
+ profileMenuItemClick: EventEmitter<string>;
45
+ /** Emits the workspace id when the user picks one from the workspace popover. */
46
+ workspaceSelected: EventEmitter<string | number>;
47
+ /** Emits when the user clicks the "Workspace Management" footer row. */
48
+ manageWorkspacesClick: EventEmitter<void>;
49
+ profileAnchorRef?: ElementRef<HTMLElement>;
50
+ workspaceAnchorRef?: ElementRef<HTMLElement>;
51
+ isExpanded: boolean;
52
+ isPinned: boolean;
53
+ openParents: string[];
54
+ isProfileMenuOpen: boolean;
55
+ isWorkspaceMenuOpen: boolean;
56
+ private leaveCollapseTimer;
57
+ private static readonly LEAVE_COLLAPSE_MS;
58
+ constructor(sanitizer: DomSanitizer);
59
+ /**
60
+ * Sanitizer bypass so `data:image/svg+xml;base64,…` URIs render in the workspace
61
+ * avatar — Angular 13's default URL sanitizer rewrites them to `unsafe:…`.
62
+ */
63
+ get workspaceLogoSafe(): SafeUrl | null;
64
+ ngOnInit(): void;
65
+ ngOnDestroy(): void;
66
+ ngOnChanges(changes: SimpleChanges): void;
67
+ onProfileClick(): void;
68
+ onProfileMenuItemClick(id: string): void;
69
+ onProfileMenuDismissed(): void;
70
+ onWorkspaceClick(): void;
71
+ onWorkspaceMenuItemClick(id: string | number): void;
72
+ onWorkspaceMenuDismissed(): void;
73
+ onManageWorkspacesClick(): void;
74
+ /** Burger: wide sidebar without pinning — collapses on mouse leave. */
75
+ openSidebar(): void;
76
+ /** Header collapse control: always closes and clears pin. */
77
+ closeSidebar(): void;
78
+ pinSidebar(): void;
79
+ /** Cancel delayed collapse when the pointer returns to the sidebar. */
80
+ onAsideMouseEnter(): void;
81
+ /**
82
+ * When expanded but not pinned, collapse after the pointer leaves the rail.
83
+ * Skips scheduling if the pointer is moving into our CDK flyout / rail tooltip overlays.
84
+ */
85
+ onAsideMouseLeave(ev: MouseEvent): void;
86
+ private isPointerEnteringSidebarOverlay;
87
+ private clearLeaveCollapseTimer;
88
+ onNavItemClick(id: string): void;
89
+ get workspaceInitial(): string;
90
+ private toggleParent;
91
+ /** True if `id` matches a submenu row under some top-level nav item. */
92
+ private isChildNavId;
93
+ private findTopLevelNavItem;
94
+ private ensureActiveParentOpen;
95
+ static ɵfac: i0.ɵɵFactoryDeclaration<SidebarComponent, never>;
96
+ static ɵcmp: i0.ɵɵComponentDeclaration<SidebarComponent, "cqa-sidebar", never, { "config": "config"; "navItems": "navItems"; "activeNavId": "activeNavId"; "initialOpenParentIds": "initialOpenParentIds"; "profileUser": "profileUser"; "profileMenuEntries": "profileMenuEntries"; "workspaces": "workspaces"; "currentWorkspaceId": "currentWorkspaceId"; }, { "navItemClick": "navItemClick"; "ctaClick": "ctaClick"; "searchClick": "searchClick"; "workspaceSwitchClick": "workspaceSwitchClick"; "logoutClick": "logoutClick"; "notificationsClick": "notificationsClick"; "helpDocsClick": "helpDocsClick"; "speakerClick": "speakerClick"; "liveChatClick": "liveChatClick"; "expandedChange": "expandedChange"; "profileMenuItemClick": "profileMenuItemClick"; "workspaceSelected": "workspaceSelected"; "manageWorkspacesClick": "manageWorkspacesClick"; }, never, never>;
97
+ }
@@ -0,0 +1,63 @@
1
+ export interface NavItem {
2
+ id: string;
3
+ label: string;
4
+ /** CSS icon class rendered as <i class="iconClass"> */
5
+ iconClass?: string;
6
+ /** Route path — consuming component navigates on navItemClick */
7
+ routerLink?: string;
8
+ children?: NavChildItem[];
9
+ /** Badge count or label, e.g. "3" */
10
+ badge?: string;
11
+ status?: 'live' | 'danger';
12
+ isNew?: boolean;
13
+ disabled?: boolean;
14
+ disabledTooltip?: string;
15
+ }
16
+ export interface NavChildItem {
17
+ id: string;
18
+ label: string;
19
+ iconClass?: string;
20
+ routerLink?: string;
21
+ isNew?: boolean;
22
+ disabled?: boolean;
23
+ }
24
+ export interface NavSection {
25
+ type: 'section';
26
+ label: string;
27
+ }
28
+ export declare type NavMenuItem = NavItem | NavSection;
29
+ export declare function isNavSection(item: NavMenuItem): item is NavSection;
30
+ export { ProfileMenuUser, ProfileMenuItem, ProfileMenuDivider, ProfileMenuEntry, isProfileMenuDivider, } from './profile-menu/profile-menu.models';
31
+ export interface SidebarConfig {
32
+ workspaceName?: string;
33
+ /** Optional logo image URL/data-URI shown inside the workspace avatar. Falls back to the workspace initial when not provided. */
34
+ workspaceLogo?: string;
35
+ /** e.g. 'Live' */
36
+ workspaceBadge?: string;
37
+ workspaceStatus?: 'live' | 'warning' | 'offline';
38
+ userName?: string;
39
+ userInitials?: string;
40
+ userRole?: string;
41
+ /** Label for the CTA button, e.g. 'New Test Case' */
42
+ ctaLabel?: string;
43
+ searchPlaceholder?: string;
44
+ showSearch?: boolean;
45
+ /** When true, shows a ⌘K hint in the expanded search row */
46
+ showSearchShortcut?: boolean;
47
+ showCta?: boolean;
48
+ /** Reserved; notifications are not shown on the collapsed rail. */
49
+ showNotifications?: boolean;
50
+ /** Reserved; badge is not shown on the collapsed rail. */
51
+ notificationCount?: number;
52
+ showLiveChat?: boolean;
53
+ /** Help & docs entry (expanded footer + collapsed utility stack). Default true */
54
+ showHelpDocs?: boolean;
55
+ /** Reserved; speaker / “what’s new” is not shown on the collapsed rail. */
56
+ showSpeaker?: boolean;
57
+ /** Label for the help utility when the sidebar is expanded */
58
+ helpDocsLabel?: string;
59
+ /** When true, the sidebar starts expanded and pinned (mouse leave does not collapse). */
60
+ defaultPinned?: boolean;
61
+ /** When false, hides the header pin control (expanded sidebar always auto-collapses on mouse leave unless defaultPinned). Default: true. */
62
+ showSidebarPin?: boolean;
63
+ }
@@ -0,0 +1,34 @@
1
+ import { AfterViewInit, EventEmitter, OnChanges, OnDestroy, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core';
2
+ import { Overlay } from '@angular/cdk/overlay';
3
+ import { WorkspaceMenuItem } from './workspace-menu.models';
4
+ import * as i0 from "@angular/core";
5
+ export declare class WorkspaceMenuComponent implements AfterViewInit, OnChanges, OnDestroy {
6
+ private overlay;
7
+ private viewContainerRef;
8
+ workspaces: WorkspaceMenuItem[];
9
+ currentWorkspaceId?: string | number;
10
+ /** Name of the currently active workspace — interpolated into the popover heading. */
11
+ workspaceName?: string;
12
+ anchor: HTMLElement | null;
13
+ /** Optional id on the popover element — useful for aria-labelledby wiring. */
14
+ popoverId?: string;
15
+ workspaceSelected: EventEmitter<string | number>;
16
+ manageWorkspacesClick: EventEmitter<void>;
17
+ dismissed: EventEmitter<void>;
18
+ popoverTpl: TemplateRef<unknown>;
19
+ private overlayRef;
20
+ private keySub;
21
+ private backdropSub;
22
+ private viewInitialized;
23
+ constructor(overlay: Overlay, viewContainerRef: ViewContainerRef);
24
+ ngAfterViewInit(): void;
25
+ ngOnChanges(changes: SimpleChanges): void;
26
+ ngOnDestroy(): void;
27
+ trackByWs: (_index: number, item: WorkspaceMenuItem) => string | number;
28
+ onItemClick(item: WorkspaceMenuItem): void;
29
+ onManageClick(): void;
30
+ private openOverlay;
31
+ private closeOverlay;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<WorkspaceMenuComponent, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<WorkspaceMenuComponent, "cqa-workspace-menu", never, { "workspaces": "workspaces"; "currentWorkspaceId": "currentWorkspaceId"; "workspaceName": "workspaceName"; "anchor": "anchor"; "popoverId": "popoverId"; }, { "workspaceSelected": "workspaceSelected"; "manageWorkspacesClick": "manageWorkspacesClick"; "dismissed": "dismissed"; }, never, never>;
34
+ }
@@ -0,0 +1,12 @@
1
+ export interface WorkspaceMenuItem {
2
+ id: string | number;
3
+ name: string;
4
+ /** One-line meta text shown under the name, e.g. "Web · 12 members". Free-form. */
5
+ subtitle?: string;
6
+ /** Initials drawn inside the avatar tile when no logo URL is provided (e.g. "CQ"). */
7
+ initials?: string;
8
+ /** Optional logo image URL or data-URI. Takes precedence over `initials`. */
9
+ logoUrl?: string;
10
+ /** Optional CSS background for the avatar tile (gradient or solid). */
11
+ avatarColor?: string;
12
+ }