@byuhbll/components 6.0.0-rc.1 → 6.0.0-rc0.5

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 (44) hide show
  1. package/fesm2022/byuhbll-components.mjs +481 -129
  2. package/fesm2022/byuhbll-components.mjs.map +1 -1
  3. package/index.d.ts +3 -621
  4. package/lib/animations/animations.d.ts +4 -0
  5. package/lib/button/button.component.d.ts +66 -0
  6. package/lib/button-group/button-group.component.d.ts +46 -0
  7. package/lib/checkbox/checkbox.component.d.ts +6 -0
  8. package/lib/contact-utils.d.ts +19 -0
  9. package/lib/copy-tooltip/copy-tooltip.component.d.ts +12 -0
  10. package/lib/expand-collapse/expand-collapse.component.d.ts +10 -0
  11. package/lib/hbll-footer/hbll-footer.component.d.ts +33 -0
  12. package/lib/hbll-header/hbll-header.component.d.ts +38 -0
  13. package/lib/hbll-header/models/library-hours.d.ts +10 -0
  14. package/lib/hbll-header/nav-bar/nav-bar.component.d.ts +33 -0
  15. package/lib/hbll-header/nav-bar-dropdown/nav-bar-dropdown.component.d.ts +18 -0
  16. package/lib/hbll-header/pipes/library-hours.pipe.d.ts +7 -0
  17. package/lib/hbll-header/pipes/truncate.pipe.d.ts +7 -0
  18. package/lib/header-with-impersonation/header-with-impersonation.component.d.ts +39 -0
  19. package/lib/impersonate-modal/impersonate-modal.component.d.ts +60 -0
  20. package/lib/impersonation-banner/impersonation-banner.component.d.ts +52 -0
  21. package/lib/impersonation-banner/models/application-access.d.ts +15 -0
  22. package/lib/impersonation-banner/models/person-summary.d.ts +33 -0
  23. package/lib/models/token-payload.d.ts +3 -0
  24. package/lib/multi-select/multi-select.component.d.ts +52 -0
  25. package/lib/pipes/hbll-item-type-icon.pipe.d.ts +17 -0
  26. package/lib/snackbar/snackbar.component.d.ts +67 -0
  27. package/lib/snackbar/snackbar.service.d.ts +20 -0
  28. package/lib/ss-search-bar/advanced-search/advanced-search.component.d.ts +216 -0
  29. package/lib/ss-search-bar/constants.d.ts +153 -0
  30. package/lib/ss-search-bar/date-range/date-range.component.d.ts +25 -0
  31. package/lib/ss-search-bar/models/advanced-search.model.d.ts +18 -0
  32. package/lib/ss-search-bar/models/search-config.model.d.ts +32 -0
  33. package/lib/ss-search-bar/models/search-scope.model.d.ts +4 -0
  34. package/lib/ss-search-bar/pipes/advanced-field-warning.pipe.d.ts +9 -0
  35. package/lib/ss-search-bar/pipes/advanced-queries.pipe.d.ts +12 -0
  36. package/lib/ss-search-bar/pipes/field-by-scope.pipe.d.ts +12 -0
  37. package/lib/ss-search-bar/simple-search/simple-search.component.d.ts +28 -0
  38. package/lib/ss-search-bar/ss-search-bar.component.d.ts +25 -0
  39. package/lib/ss-search-bar/utils.d.ts +7 -0
  40. package/lib/status-button/status-button.component.d.ts +47 -0
  41. package/lib/subatomic-components/button-group-item/button-group-item.component.d.ts +18 -0
  42. package/lib/utils.d.ts +5 -0
  43. package/package.json +3 -3
  44. package/public-api.d.ts +18 -0
@@ -0,0 +1,66 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export type ButtonType = 'primary' | 'secondary' | 'transparent';
4
+ export interface ButtonInputs {
5
+ buttonType?: ButtonType;
6
+ title?: string;
7
+ iconBefore?: string;
8
+ iconAfter?: string;
9
+ disabled?: boolean;
10
+ isThin?: boolean;
11
+ ariaLabel?: string;
12
+ }
13
+ /**
14
+ * A flexible, reusable button component that supports multiple button types
15
+ * and various content combinations (icon before, title, icon after).
16
+ *
17
+ * @example
18
+ * ```html
19
+ * <!-- Primary button with icon and title -->
20
+ * <lib-button
21
+ * buttonType="primary"
22
+ * title="Copy Citation"
23
+ * iconBefore="content_copy"
24
+ * (buttonClick)="copyCitation()">
25
+ * </lib-button>
26
+ *
27
+ * <!-- Secondary button with title only -->
28
+ * <lib-button
29
+ * buttonType="secondary"
30
+ * title="Cancel"
31
+ * (buttonClick)="cancelAction()">
32
+ * </lib-button>
33
+ *
34
+ * <!-- Transparent button with icon after title -->
35
+ * <lib-button
36
+ * buttonType="transparent"
37
+ * title="Download"
38
+ * iconAfter="download"
39
+ * (buttonClick)="downloadFile()">
40
+ * </lib-button>
41
+ *
42
+ * <!-- Thin button -->
43
+ * <lib-button
44
+ * buttonType="primary"
45
+ * title="Submit"
46
+ * [isThin]="true"
47
+ * (buttonClick)="submitForm()">
48
+ * </lib-button>
49
+ * ```
50
+ */
51
+ export declare class ButtonComponent {
52
+ buttonType: ButtonType;
53
+ title?: string;
54
+ iconBefore?: string;
55
+ iconAfter?: string;
56
+ disabled: boolean;
57
+ isThin: boolean;
58
+ ariaLabel?: string;
59
+ buttonClick: EventEmitter<void>;
60
+ /**
61
+ * Handles button click events and emits the buttonClick event if the button is not disabled.
62
+ */
63
+ onButtonClick(): void;
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
65
+ static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "lib-button", never, { "buttonType": { "alias": "buttonType"; "required": false; }; "title": { "alias": "title"; "required": false; }; "iconBefore": { "alias": "iconBefore"; "required": false; }; "iconAfter": { "alias": "iconAfter"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "isThin": { "alias": "isThin"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; }, { "buttonClick": "buttonClick"; }, never, never, true, never>;
66
+ }
@@ -0,0 +1,46 @@
1
+ import { EventEmitter, QueryList, AfterContentInit, OnDestroy } from '@angular/core';
2
+ import { ButtonGroupItemComponent } from '../subatomic-components/button-group-item/button-group-item.component';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ButtonGroupComponent implements AfterContentInit, OnDestroy {
5
+ initialActiveId?: string;
6
+ activeButtonChange: EventEmitter<string>;
7
+ buttonItems: QueryList<ButtonGroupItemComponent>;
8
+ private elementRef;
9
+ protected activeButtonId: import("@angular/core").WritableSignal<string>;
10
+ private subscriptions;
11
+ /**
12
+ * Angular lifecycle hook called after content projection is initialized.
13
+ * Sets up the initial active button and subscribes to button click events from all button items.
14
+ */
15
+ ngAfterContentInit(): void;
16
+ /**
17
+ * Initializes custom element children when used as web components.
18
+ */
19
+ private initializeCustomElements;
20
+ /**
21
+ * Sets the active state on a custom element by toggling the active class on its button.
22
+ */
23
+ private setActiveState;
24
+ /**
25
+ * Handles click events for custom element children.
26
+ */
27
+ private handleCustomElementClick;
28
+ /**
29
+ * Angular lifecycle hook called when the component is destroyed.
30
+ * Cleans up all subscriptions to prevent memory leaks.
31
+ */
32
+ ngOnDestroy(): void;
33
+ /**
34
+ * Initializes the active button state based on the initialActiveId input.
35
+ * Sets the active state on the matching button item if an initial ID is provided.
36
+ */
37
+ private initializeActiveButton;
38
+ /**
39
+ * Handles button click events from child button items.
40
+ * Updates the active button state and emits the activeButtonChange event.
41
+ * @param buttonId - The ID of the clicked button
42
+ */
43
+ onButtonClick(buttonId: string): void;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<ButtonGroupComponent, never>;
45
+ static ɵcmp: i0.ɵɵComponentDeclaration<ButtonGroupComponent, "lib-button-group", never, { "initialActiveId": { "alias": "initialActiveId"; "required": false; }; }, { "activeButtonChange": "activeButtonChange"; }, ["buttonItems"], ["*"], true, never>;
46
+ }
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class HbllCheckboxComponent {
3
+ isChecked: import("@angular/core").InputSignal<boolean>;
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<HbllCheckboxComponent, never>;
5
+ static ɵcmp: i0.ɵɵComponentDeclaration<HbllCheckboxComponent, "lib-checkbox", never, { "isChecked": { "alias": "isChecked"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
6
+ }
@@ -0,0 +1,19 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { FormBuilder } from '@angular/forms';
3
+ export declare const USER_STATUSES: readonly ["", "Undergraduate", "Graduate", "Faculty", "Staff", "Library Employee", "Other"];
4
+ export type UserStatus = (typeof USER_STATUSES)[number];
5
+ export interface ContactPayload {
6
+ email?: string;
7
+ message: string;
8
+ name?: string;
9
+ status?: UserStatus;
10
+ }
11
+ export declare const createContactForm: (fb: FormBuilder) => import("@angular/forms").FormGroup<{
12
+ name: import("@angular/forms").FormControl<string>;
13
+ email: import("@angular/forms").FormControl<string>;
14
+ message: import("@angular/forms").FormControl<string>;
15
+ status: import("@angular/forms").FormControl<"" | "Other" | "Undergraduate" | "Graduate" | "Faculty" | "Staff" | "Library Employee" | undefined>;
16
+ }>;
17
+ export declare const submitEmail: (payload: ContactPayload, byuid: string, http: HttpClient, apiBaseUrl: string) => import("rxjs").Observable<unknown>;
18
+ export declare const submitFeedback: (payload: ContactPayload, http: HttpClient, apiBaseUrl: string) => import("rxjs").Observable<unknown>;
19
+ export declare const getUserStatusFromRoles: (roles: string[]) => UserStatus;
@@ -0,0 +1,12 @@
1
+ import { MatTooltip, TooltipPosition } from '@angular/material/tooltip';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CopyTooltipComponent {
4
+ position: TooltipPosition;
5
+ copyText?: string;
6
+ tooltip: MatTooltip;
7
+ clipboardCopyMessage: string;
8
+ copyToClipboard: (text?: string) => Promise<void>;
9
+ handleMouseLeave: () => void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<CopyTooltipComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<CopyTooltipComponent, "lib-copy-tooltip", never, { "position": { "alias": "position"; "required": false; }; "copyText": { "alias": "copyText"; "required": false; }; }, {}, never, ["*"], true, never>;
12
+ }
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class ExpandCollapseComponent {
3
+ private contentRef;
4
+ private _isExpanded;
5
+ set isExpanded(isExpanded: boolean);
6
+ get isExpanded(): boolean;
7
+ protected heightOfContent: number;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExpandCollapseComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<ExpandCollapseComponent, "lib-expand-collapse", never, { "isExpanded": { "alias": "isExpanded"; "required": true; }; }, {}, never, ["*"], true, never>;
10
+ }
@@ -0,0 +1,33 @@
1
+ import { ContactPayload } from '../contact-utils';
2
+ import * as i0 from "@angular/core";
3
+ export declare class HbllFooterComponent {
4
+ private readonly fb;
5
+ private readonly http;
6
+ private readonly footerSkipTargetId;
7
+ private emailDialog;
8
+ mainsitebaseurl: string;
9
+ myaccountapibaseuri: string;
10
+ byuid: string;
11
+ set emailname(name: string);
12
+ set emailemail(email: string);
13
+ set emailmessage(message: string);
14
+ set emailstatus(status: ContactPayload['status']);
15
+ protected date: Date;
16
+ protected isSubmitted: boolean;
17
+ protected isLoading: boolean;
18
+ protected hasConnectionError: boolean;
19
+ protected isEmailSent: boolean;
20
+ protected emailForm: import("@angular/forms").FormGroup<{
21
+ name: import("@angular/forms").FormControl<string>;
22
+ email: import("@angular/forms").FormControl<string>;
23
+ message: import("@angular/forms").FormControl<string>;
24
+ status: import("@angular/forms").FormControl<"" | "Other" | "Undergraduate" | "Graduate" | "Faculty" | "Staff" | "Library Employee" | undefined>;
25
+ }>;
26
+ protected userStatuses: readonly ["", "Undergraduate", "Graduate", "Faculty", "Staff", "Library Employee", "Other"];
27
+ protected sendEmail: () => void;
28
+ protected handleClose: () => void;
29
+ openEmailForm: (formValues?: typeof this.emailForm.value) => void;
30
+ skipFooter(): void;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<HbllFooterComponent, never>;
32
+ static ɵcmp: i0.ɵɵComponentDeclaration<HbllFooterComponent, "lib-hbll-footer", never, { "mainsitebaseurl": { "alias": "mainsitebaseurl"; "required": false; }; "myaccountapibaseuri": { "alias": "myaccountapibaseuri"; "required": false; }; "byuid": { "alias": "byuid"; "required": false; }; "emailname": { "alias": "emailname"; "required": false; }; "emailemail": { "alias": "emailemail"; "required": false; }; "emailmessage": { "alias": "emailmessage"; "required": false; }; "emailstatus": { "alias": "emailstatus"; "required": false; }; }, {}, never, never, true, never>;
33
+ }
@@ -0,0 +1,38 @@
1
+ import { AfterViewInit, ElementRef, EventEmitter } from '@angular/core';
2
+ import { LibraryHours } from './models/library-hours';
3
+ import * as i0 from "@angular/core";
4
+ export declare const LIBRARY_HOURS_API_URL = "https://apps.lib.byu.edu/libraryhours/api/hours";
5
+ export declare class HbllHeaderComponent implements AfterViewInit {
6
+ private readonly r2;
7
+ private readonly http;
8
+ private readonly bo;
9
+ private doc;
10
+ header: ElementRef;
11
+ navWrapper: ElementRef<HTMLElement>;
12
+ backdrop: ElementRef<HTMLElement>;
13
+ name: string;
14
+ mainsitebaseurl: string;
15
+ showImpersonateButton: import("@angular/core").InputSignal<boolean>;
16
+ openImpersonationModal: EventEmitter<void>;
17
+ login: EventEmitter<void>;
18
+ logout: EventEmitter<void>;
19
+ private formatDateForHours;
20
+ private accountInfoEl;
21
+ private hoursEl;
22
+ protected get isLoggedIn(): boolean;
23
+ protected libraryHours: import("@angular/core").Signal<LibraryHours | undefined>;
24
+ protected hoursExceptions$: import("rxjs").Observable<LibraryHours[]>;
25
+ protected showAccountDropdown: boolean;
26
+ protected showLibraryHours: boolean;
27
+ protected mobileSidebarHeight: number;
28
+ protected showNavBar: boolean;
29
+ protected isScreenSmall: import("@angular/core").Signal<boolean | undefined>;
30
+ ngAfterViewInit(): void;
31
+ protected openSidebarNav: () => void;
32
+ protected closeSidebarNav: () => void;
33
+ private onResize;
34
+ private setMobileSidebarHeight;
35
+ focusMainContent(): void;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<HbllHeaderComponent, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<HbllHeaderComponent, "lib-hbll-header", never, { "name": { "alias": "name"; "required": false; }; "mainsitebaseurl": { "alias": "mainsitebaseurl"; "required": false; }; "showImpersonateButton": { "alias": "showImpersonateButton"; "required": false; "isSignal": true; }; }, { "openImpersonationModal": "openImpersonationModal"; "login": "login"; "logout": "logout"; }, never, never, true, never>;
38
+ }
@@ -0,0 +1,10 @@
1
+ export interface LibraryHours {
2
+ date: string;
3
+ is_closed: boolean;
4
+ open_time: string;
5
+ close_time: string;
6
+ has_exception: boolean;
7
+ exception_title: string;
8
+ exception_message: string;
9
+ is_currently_open: boolean;
10
+ }
@@ -0,0 +1,33 @@
1
+ import { Signal } from '@angular/core';
2
+ import { NavBarDropdownComponent } from '../nav-bar-dropdown/nav-bar-dropdown.component';
3
+ import * as i0 from "@angular/core";
4
+ type NavInfo = {
5
+ title: string;
6
+ mainSection?: Section;
7
+ otherSections: Section[];
8
+ };
9
+ type Section = {
10
+ title: string;
11
+ links: Link[];
12
+ auxiliaryLink?: Link;
13
+ };
14
+ type Link = {
15
+ label: string;
16
+ url: string;
17
+ icon?: string;
18
+ };
19
+ export declare class NavBarComponent {
20
+ private bo;
21
+ mainSiteBaseUrl: import("@angular/core").InputSignal<string>;
22
+ height: import("@angular/core").InputSignal<number | null>;
23
+ isInteractingWithNavbar: boolean;
24
+ dropdownComps: NavBarDropdownComponent[];
25
+ protected handleDropdownOpenEvent: (title: string) => void;
26
+ handleHoverStarted(): void;
27
+ handleNavbarMouseLeave(): void;
28
+ protected isScreenSmall: Signal<boolean | undefined>;
29
+ protected navInfos: Signal<NavInfo[]>;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<NavBarComponent, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavBarComponent, "lib-nav-bar", never, { "mainSiteBaseUrl": { "alias": "mainSiteBaseUrl"; "required": true; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
32
+ }
33
+ export {};
@@ -0,0 +1,18 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class NavBarDropdownComponent {
4
+ title: import("@angular/core").InputSignal<string>;
5
+ isSmallScreen: import("@angular/core").InputSignal<boolean>;
6
+ openEvent: EventEmitter<string>;
7
+ hoverStarted: EventEmitter<void>;
8
+ closeDropdown: () => boolean;
9
+ isInteracting: boolean;
10
+ protected isOpen: boolean;
11
+ private hoverTimeout;
12
+ private readonly DROPDOWN_OPEN_DELAY_MS;
13
+ protected handleClick: () => void;
14
+ handleMouseEnter(): void;
15
+ handleMouseLeave(): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<NavBarDropdownComponent, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavBarDropdownComponent, "lib-nav-bar-dropdown", never, { "title": { "alias": "title"; "required": true; "isSignal": true; }; "isSmallScreen": { "alias": "isSmallScreen"; "required": false; "isSignal": true; }; "isInteracting": { "alias": "isInteracting"; "required": false; }; }, { "openEvent": "openEvent"; "hoverStarted": "hoverStarted"; }, never, ["*"], true, never>;
18
+ }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class LibraryHoursPipe implements PipeTransform {
4
+ transform(date: string, time: string): string | null;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<LibraryHoursPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<LibraryHoursPipe, "libraryHours", true>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class TruncatePipe implements PipeTransform {
4
+ transform(value: string | null | undefined, max?: number, suffix?: string): string;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<TruncatePipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<TruncatePipe, "truncate", true>;
7
+ }
@@ -0,0 +1,39 @@
1
+ import { EventEmitter, Signal, OnInit, OnDestroy } from '@angular/core';
2
+ import { TokenPayload } from '../models/token-payload';
3
+ import { JwtPayload } from 'jwt-decode';
4
+ import * as i0 from "@angular/core";
5
+ export declare class HeaderWithImpersonationComponent implements OnInit, OnDestroy {
6
+ accessTokenPayload: import("@angular/core").InputSignal<TokenPayload>;
7
+ oidcBaseUri: import("@angular/core").InputSignal<string>;
8
+ oidcDefaultIdp: import("@angular/core").InputSignal<string>;
9
+ mainSiteBaseUrl: import("@angular/core").InputSignal<string>;
10
+ personBaseUri: import("@angular/core").InputSignal<string>;
11
+ myAccountApiBaseUri: import("@angular/core").InputSignal<string>;
12
+ login: EventEmitter<void>;
13
+ logout: EventEmitter<void>;
14
+ endImpersonation: EventEmitter<void>;
15
+ protected parsedToken: Signal<(JwtPayload & Record<string, any>) | null>;
16
+ protected name: Signal<any>;
17
+ protected showImpersonateButton: Signal<boolean>;
18
+ protected showImpersonationModal: boolean;
19
+ private isImpersonating;
20
+ private activityEvents;
21
+ private inactivityTimerId;
22
+ private inactivityTimeoutMs;
23
+ private debounceTimerId;
24
+ private debounceDelayMs;
25
+ private trackingActive;
26
+ private injector;
27
+ ngOnInit(): void;
28
+ ngOnDestroy(): void;
29
+ /** Begin listening and start countdown */
30
+ private startInactivityTracking;
31
+ /** Remove listeners and clear timers */
32
+ private stopInactivityTracking;
33
+ /** Reset the inactivity countdown (no-op if not impersonating) */
34
+ private resetInactivityTimer;
35
+ /** Debounce activity to avoid hammering resets during event storms */
36
+ private debouncedResetTimer;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<HeaderWithImpersonationComponent, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<HeaderWithImpersonationComponent, "lib-header-with-impersonation", never, { "accessTokenPayload": { "alias": "accessTokenPayload"; "required": true; "isSignal": true; }; "oidcBaseUri": { "alias": "oidcBaseUri"; "required": false; "isSignal": true; }; "oidcDefaultIdp": { "alias": "oidcDefaultIdp"; "required": false; "isSignal": true; }; "mainSiteBaseUrl": { "alias": "mainSiteBaseUrl"; "required": false; "isSignal": true; }; "personBaseUri": { "alias": "personBaseUri"; "required": false; "isSignal": true; }; "myAccountApiBaseUri": { "alias": "myAccountApiBaseUri"; "required": false; "isSignal": true; }; }, { "login": "login"; "logout": "logout"; "endImpersonation": "endImpersonation"; }, never, never, true, never>;
39
+ }
@@ -0,0 +1,60 @@
1
+ import { EventEmitter, OnDestroy, PipeTransform } from '@angular/core';
2
+ import { Subject } from 'rxjs';
3
+ import { TokenPayload } from '../models/token-payload';
4
+ import * as i0 from "@angular/core";
5
+ export declare const defaultOidcBaseUri = "https://keycloak.lib.byu.edu/";
6
+ export declare const defaultOidcDefaultIdp = "ces";
7
+ export declare class ImpersonateUserPipe implements PipeTransform {
8
+ transform(user: ImpersonateSearchResult): string;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<ImpersonateUserPipe, never>;
10
+ static ɵpipe: i0.ɵɵPipeDeclaration<ImpersonateUserPipe, "impersonateUser", true>;
11
+ }
12
+ export interface ImpersonateSearchResult {
13
+ netId: string;
14
+ institution: string;
15
+ username: string;
16
+ name: string;
17
+ preferredName: string;
18
+ givenName: string;
19
+ surname: string;
20
+ restricted: boolean;
21
+ }
22
+ export declare class ImpersonateModalComponent implements OnDestroy {
23
+ private readonly http;
24
+ private readonly fb;
25
+ private readonly eref;
26
+ set showModal(open: boolean);
27
+ oidcBaseUri: import("@angular/core").InputSignal<string>;
28
+ oidcDefaultIdp: import("@angular/core").InputSignal<string>;
29
+ accessTokenPayload: import("@angular/core").InputSignal<TokenPayload>;
30
+ dismiss: EventEmitter<void>;
31
+ init: EventEmitter<void>;
32
+ protected isOpen: boolean;
33
+ protected hasError: boolean;
34
+ protected form: import("@angular/forms").FormGroup<{
35
+ search: import("@angular/forms").FormControl<string | null>;
36
+ }>;
37
+ protected selectedUsername?: string;
38
+ protected loading: boolean;
39
+ protected handleSearchSubject: Subject<boolean>;
40
+ protected results: import("@angular/core").Signal<ImpersonateSearchResult[] | null | undefined>;
41
+ private subs;
42
+ outsideClick(event: MouseEvent): void;
43
+ handleKeyDown: (event: KeyboardEvent) => void;
44
+ ngOnDestroy(): void;
45
+ /** Redirect to Keycloak impersonate page, which will redirect back
46
+ * after impersonation begins.
47
+ */
48
+ protected startImpersonation: (username?: string) => void;
49
+ protected handleSelectUser: (event: Event) => void;
50
+ protected clearSearch: () => void;
51
+ protected close: () => void;
52
+ protected handleFormSubmit: (event: SubmitEvent) => void;
53
+ protected handleSearchKeyPress: (event: KeyboardEvent) => void;
54
+ protected handleResultKeyPress: (event: KeyboardEvent) => void;
55
+ /** Search Keycloak users using a generic search query. */
56
+ private searchUsers;
57
+ private replaceUrl;
58
+ static ɵfac: i0.ɵɵFactoryDeclaration<ImpersonateModalComponent, never>;
59
+ static ɵcmp: i0.ɵɵComponentDeclaration<ImpersonateModalComponent, "lib-impersonate-modal", never, { "showModal": { "alias": "showModal"; "required": false; }; "oidcBaseUri": { "alias": "oidcBaseUri"; "required": false; "isSignal": true; }; "oidcDefaultIdp": { "alias": "oidcDefaultIdp"; "required": false; "isSignal": true; }; "accessTokenPayload": { "alias": "accessTokenPayload"; "required": true; "isSignal": true; }; }, { "dismiss": "dismiss"; "init": "init"; }, never, never, true, never>;
60
+ }
@@ -0,0 +1,52 @@
1
+ import { EventEmitter, Signal } from '@angular/core';
2
+ import { type ApplicationAccess } from './models/application-access';
3
+ import { TokenPayload } from '../models/token-payload';
4
+ import { JwtPayload } from 'jwt-decode';
5
+ import { PersonSummary } from './models/person-summary';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * @todo: Refactor: my recommendation would be to allow a user to be passed into this component via an input instead of the users coming from an API call based on the JWT passed in. This might look something like:
9
+ * ```
10
+ * @Input() user: {
11
+ * primary_position_type_display?: string
12
+ * undergrad_graduate_status?: string
13
+ * restricted?: boolean
14
+ * is_retired?: boolean
15
+ * is_employee?: boolean
16
+ * primary_position_type?: string
17
+ * }
18
+ * ```
19
+ * Accepting all properties that are used in this component without needing to bring in the user type explicitly. Or the properties on this user object could be made even more general as to not be tied at all to any specific type.
20
+ *
21
+ * Something similar could be done with `accountStatuses`. I'd recommend the consuming application prepare arrays of strings to be passed into inputs of `accountsOk`, `accountsBlocked`, and `accountsNone`, that are then passed into and displayed in the template.
22
+ *
23
+ * The idea behind these revisions is that there is less business logic baked into this component, as it's role is just one of presentation. It will also avoid multiple API calls for the same data in our big Angular apps.
24
+ *
25
+ * Best of luck,
26
+ * Paul
27
+ */
28
+ export declare class ImpersonationBannerComponent {
29
+ private http;
30
+ accessTokenPayload: import("@angular/core").InputSignal<TokenPayload>;
31
+ personBaseUri: import("@angular/core").InputSignal<string>;
32
+ myAccountApiBaseUri: import("@angular/core").InputSignal<string>;
33
+ endImpersonation: EventEmitter<void>;
34
+ protected parsedToken: Signal<JwtPayload & Record<string, any>>;
35
+ protected isImpersonating: Signal<boolean>;
36
+ protected libraryId: Signal<any>;
37
+ protected user: Signal<PersonSummary | null | undefined>;
38
+ protected userFullName: Signal<string>;
39
+ protected isRestricted: Signal<boolean | undefined>;
40
+ protected userInfoTabs: Signal<Map<string, any>>;
41
+ protected userPhotoUrl: Signal<string>;
42
+ protected activityStatus: Signal<"retired" | "active" | "inactive" | null>;
43
+ protected employeeStatusDescription: Signal<string | null>;
44
+ protected independentStudyStatus: Signal<boolean | null | undefined>;
45
+ protected accountStatuses: Signal<{
46
+ ok: ApplicationAccess[];
47
+ blocked: ApplicationAccess[];
48
+ none: ApplicationAccess[];
49
+ } | null | undefined>;
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<ImpersonationBannerComponent, never>;
51
+ static ɵcmp: i0.ɵɵComponentDeclaration<ImpersonationBannerComponent, "lib-impersonation-banner", never, { "accessTokenPayload": { "alias": "accessTokenPayload"; "required": true; "isSignal": true; }; "personBaseUri": { "alias": "personBaseUri"; "required": false; "isSignal": true; }; "myAccountApiBaseUri": { "alias": "myAccountApiBaseUri"; "required": false; "isSignal": true; }; }, { "endImpersonation": "endImpersonation"; }, never, never, true, never>;
52
+ }
@@ -0,0 +1,15 @@
1
+ export declare enum AccessStatus {
2
+ OK = "ok",
3
+ BLOCKED = "blocked",
4
+ NONE = "none"
5
+ }
6
+ export interface ApplicationAccess {
7
+ label: string;
8
+ access: AccessStatus;
9
+ code?: string;
10
+ detail?: string;
11
+ }
12
+ export interface AccountsResponse {
13
+ netId: string;
14
+ applications: Record<string, ApplicationAccess>;
15
+ }
@@ -0,0 +1,33 @@
1
+ export declare enum EmployeePositionType {
2
+ STD = "std",
3
+ SNL = "snl",
4
+ FAC = "fac",
5
+ STF = "stf",
6
+ TMP = "tmp",
7
+ FTC = "ftc"
8
+ }
9
+ export declare enum UndergradGraduateStatus {
10
+ UNDERGRAD = "undergrad",
11
+ GRADUATE = "graduate"
12
+ }
13
+ export interface IndependentStudyResponse {
14
+ library_id: string;
15
+ is_enrolled: boolean;
16
+ }
17
+ export interface PersonSummary {
18
+ byu_id?: string;
19
+ email_address?: string;
20
+ first_name: string;
21
+ is_affiliate: boolean;
22
+ is_employee: boolean;
23
+ is_retired?: boolean;
24
+ primary_position_type?: EmployeePositionType;
25
+ primary_position_type_display?: string;
26
+ is_student: boolean;
27
+ undergrad_graduate_status?: UndergradGraduateStatus;
28
+ last_name: string;
29
+ library_id: string;
30
+ preferred_first_name: string;
31
+ restricted: boolean;
32
+ worker_id?: string;
33
+ }
@@ -0,0 +1,3 @@
1
+ export interface TokenPayload {
2
+ token: string;
3
+ }
@@ -0,0 +1,52 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
3
+ import { MatChipInputEvent } from '@angular/material/chips';
4
+ import { FormControl } from '@angular/forms';
5
+ import { Observable } from 'rxjs';
6
+ import * as i0 from "@angular/core";
7
+ export declare class HbllMultiSelectComponent {
8
+ private inputRef;
9
+ allOptions: Record<string, string>;
10
+ label: string;
11
+ /**
12
+ * An array that indicates which keys are selected.
13
+ */
14
+ selectedKeys: string[];
15
+ /**
16
+ * An EventEmitter that emits an array of keys indicating which options are currently selected.
17
+ */
18
+ selectedKeysChange: EventEmitter<string[]>;
19
+ protected inputControl: FormControl<string | null>;
20
+ protected filteredOptions$: Observable<string[]>;
21
+ protected separatorKeysCodes: number[];
22
+ /**
23
+ * Adds a key from the input to the array of selected key.
24
+ * The value from the input must match a key from the record of all options.
25
+ * @param {MatChipInputEvent} event MatChipInputEvent
26
+ */
27
+ protected addOption(event: MatChipInputEvent): void;
28
+ /**
29
+ * Removes a key from the array of selected options and emits the new selected keys.
30
+ * @param {MultiSelectKeyValPair} key key to remove
31
+ */
32
+ protected removeOption(key: string): void;
33
+ /**
34
+ * Adds an option to the array of selected keys when a user selects from the autocomplete.
35
+ * @param {MatAutocompleteSelectedEvent} event MatAutocompleteSelectedEvent
36
+ */
37
+ protected selectOption: (event: MatAutocompleteSelectedEvent) => void;
38
+ /**
39
+ * Filters the options by the supplied value as well as the currently selected values.
40
+ * @param {string} value value to filter by.
41
+ * @returns {string[]} the filtered keys
42
+ */
43
+ private filterOptions;
44
+ /**
45
+ * Adds a key to the selected keys array if the option is truthy and not already in the array.
46
+ * The input is also cleared (if available), and the new selected keys are emitted.
47
+ * @param {key} option key to add
48
+ */
49
+ private addOptionToSelectedOptions;
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<HbllMultiSelectComponent, never>;
51
+ static ɵcmp: i0.ɵɵComponentDeclaration<HbllMultiSelectComponent, "lib-multi-select", never, { "allOptions": { "alias": "allOptions"; "required": false; }; "label": { "alias": "label"; "required": false; }; "selectedKeys": { "alias": "selectedKeys"; "required": false; }; }, { "selectedKeysChange": "selectedKeysChange"; }, never, never, true, never>;
52
+ }
@@ -0,0 +1,17 @@
1
+ import { type PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Converts an item type to an icon type to be used with Google Material Icons
5
+ *
6
+ * Intended to be used with an imported font, such as: `<link
7
+ rel="stylesheet"
8
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,1,0"
9
+ />`
10
+ *
11
+ * Reference: https://fonts.google.com/icons?selected=Material+Symbols+Outlined:inventory_2:FILL@0;wght@400;GRAD@0;opsz@24&icon.query=invent&icon.size=24&icon.color=%235f6368
12
+ */
13
+ export declare class HbllItemTypeIconPipe implements PipeTransform {
14
+ transform(itemType: string): string;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<HbllItemTypeIconPipe, never>;
16
+ static ɵpipe: i0.ɵɵPipeDeclaration<HbllItemTypeIconPipe, "libByuItemTypeIcon", true>;
17
+ }