@byuhbll/components 3.1.0 → 4.0.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/animations/animations.mjs +19 -1
- package/esm2022/lib/expand-collapse/expand-collapse.component.mjs +31 -0
- package/esm2022/lib/hbll-checkbox/hbll-checkbox.component.mjs +6 -8
- package/esm2022/lib/hbll-header/hbll-header.component.mjs +74 -31
- package/esm2022/lib/hbll-header/impersonate-modal/impersonate-modal.component.mjs +187 -0
- package/esm2022/lib/hbll-header/nav-bar/nav-bar.component.mjs +307 -0
- package/esm2022/lib/hbll-header/nav-bar-dropdown/nav-bar-dropdown.component.mjs +29 -0
- package/esm2022/lib/hbll-header/pipes/library-hours.pipe.mjs +31 -0
- package/esm2022/lib/ss-search-bar/advanced-search/advanced-search.component.mjs +3 -3
- package/esm2022/lib/ss-search-bar/simple-search/simple-search.component.mjs +3 -3
- package/esm2022/lib/ss-search-bar/ss-search-bar.component.mjs +3 -3
- package/esm2022/lib/utils.mjs +8 -0
- package/fesm2022/byuhbll-components.mjs +675 -64
- package/fesm2022/byuhbll-components.mjs.map +1 -1
- package/lib/animations/animations.d.ts +1 -0
- package/lib/expand-collapse/expand-collapse.component.d.ts +10 -0
- package/lib/hbll-checkbox/hbll-checkbox.component.d.ts +2 -2
- package/lib/hbll-header/hbll-header.component.d.ts +26 -18
- package/lib/hbll-header/impersonate-modal/impersonate-modal.component.d.ts +57 -0
- package/lib/hbll-header/nav-bar/nav-bar.component.d.ts +28 -0
- package/lib/hbll-header/nav-bar-dropdown/nav-bar-dropdown.component.d.ts +12 -0
- package/lib/hbll-header/pipes/library-hours.pipe.d.ts +7 -0
- package/lib/utils.d.ts +5 -0
- package/package.json +4 -1
- package/styles/scss/_mixins.scss +1 -1
- package/styles/scss/_vars.scss +6 -0
- package/styles/scss/base.scss +8 -5
- package/styles/scss/cta-btn.scss +2 -2
- package/styles/scss/pill-btn.scss +2 -2
- package/styles/scss/spinner.scss +20 -0
|
@@ -2,3 +2,4 @@ export declare const libHbllExpandCollapse: import("@angular/animations").Animat
|
|
|
2
2
|
export declare const libHbllFadeInOut: import("@angular/animations").AnimationTriggerMetadata;
|
|
3
3
|
export declare const libHbllFadeIn: import("@angular/animations").AnimationTriggerMetadata;
|
|
4
4
|
export declare const libHbllFadeOut: import("@angular/animations").AnimationTriggerMetadata;
|
|
5
|
+
export declare const libHbllSlideInOutRightLeft: import("@angular/animations").AnimationTriggerMetadata;
|
|
@@ -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
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class HbllCheckboxComponent {
|
|
3
|
-
isChecked: boolean
|
|
3
|
+
isChecked: import("@angular/core").InputSignal<boolean>;
|
|
4
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<HbllCheckboxComponent, never>;
|
|
5
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HbllCheckboxComponent, "lib-hbll-checkbox", never, { "isChecked": { "alias": "isChecked"; "required": false; }; }, {}, never, never, true, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HbllCheckboxComponent, "lib-hbll-checkbox", never, { "isChecked": { "alias": "isChecked"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
6
6
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { AfterViewInit, EventEmitter,
|
|
1
|
+
import { AfterViewInit, ElementRef, EventEmitter, Signal } from '@angular/core';
|
|
2
|
+
import { JwtPayload } from 'jwt-decode';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
export declare const LIBRARY_HOURS_API_URL = "https://apps.lib.byu.edu/libraryhours/api/hours";
|
|
3
5
|
interface LibraryHours {
|
|
4
6
|
date: string;
|
|
5
7
|
is_closed: boolean;
|
|
@@ -10,31 +12,37 @@ interface LibraryHours {
|
|
|
10
12
|
exception_message: string;
|
|
11
13
|
is_currently_open: boolean;
|
|
12
14
|
}
|
|
13
|
-
export declare class LibraryHoursDatePipe implements PipeTransform {
|
|
14
|
-
transform(date: string, time: string): Date;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LibraryHoursDatePipe, never>;
|
|
16
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<LibraryHoursDatePipe, "libraryHoursDate", true>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Header component built to be exported as a custom element.
|
|
20
|
-
* This component uses icons provided by Google Material.
|
|
21
|
-
* The link to these icons should be included once in the \<head> of your base html.
|
|
22
|
-
*
|
|
23
|
-
* When a non-empty string `name` is provided to this component, the user is considered logged in.
|
|
24
|
-
* Two outputs/events are accessible: `login` and `logout`.
|
|
25
|
-
*/
|
|
26
15
|
export declare class HbllHeaderComponent implements AfterViewInit {
|
|
27
16
|
private readonly r2;
|
|
28
17
|
private readonly http;
|
|
29
|
-
|
|
18
|
+
private readonly bo;
|
|
19
|
+
header: ElementRef;
|
|
20
|
+
accessToken: import("@angular/core").InputSignal<string>;
|
|
21
|
+
oidcBaseUri: import("@angular/core").InputSignal<string>;
|
|
22
|
+
oidcDefaultIdp: import("@angular/core").InputSignal<string>;
|
|
30
23
|
login: EventEmitter<void>;
|
|
31
24
|
logout: EventEmitter<void>;
|
|
25
|
+
endImpersonation: EventEmitter<void>;
|
|
26
|
+
private formatDateForHours;
|
|
32
27
|
private accountInfoEl;
|
|
33
|
-
|
|
34
|
-
protected
|
|
28
|
+
private hoursEl;
|
|
29
|
+
protected parsedToken: Signal<JwtPayload & Record<string, any>>;
|
|
30
|
+
protected isLoggedIn: Signal<boolean>;
|
|
31
|
+
protected isImpersonating: Signal<boolean>;
|
|
32
|
+
protected showImpersonateButton: Signal<any>;
|
|
33
|
+
protected name: Signal<any>;
|
|
34
|
+
protected libraryHours: Signal<LibraryHours | undefined>;
|
|
35
|
+
protected hoursExceptions$: import("rxjs").Observable<LibraryHours[]>;
|
|
35
36
|
protected showAccountDropdown: boolean;
|
|
37
|
+
protected showLibraryHours: boolean;
|
|
38
|
+
protected mobileSidebarHeight: number;
|
|
39
|
+
protected showNavBar: boolean;
|
|
40
|
+
protected showImpersonationModal: boolean;
|
|
41
|
+
protected isScreenSmall: Signal<boolean | undefined>;
|
|
36
42
|
ngAfterViewInit(): void;
|
|
43
|
+
private onResize;
|
|
44
|
+
private setMobileSidebarHeight;
|
|
37
45
|
static ɵfac: i0.ɵɵFactoryDeclaration<HbllHeaderComponent, never>;
|
|
38
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HbllHeaderComponent, "lib-hbll-header", never, { "
|
|
46
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HbllHeaderComponent, "lib-hbll-header", never, { "accessToken": { "alias": "accessToken"; "required": false; "isSignal": true; }; "oidcBaseUri": { "alias": "oidcBaseUri"; "required": false; "isSignal": true; }; "oidcDefaultIdp": { "alias": "oidcDefaultIdp"; "required": false; "isSignal": true; }; }, { "login": "login"; "logout": "logout"; "endImpersonation": "endImpersonation"; }, never, never, true, never>;
|
|
39
47
|
}
|
|
40
48
|
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, PipeTransform } from '@angular/core';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ImpersonateUserPipe implements PipeTransform {
|
|
5
|
+
transform(user: ImpersonateSearchResult): string;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ImpersonateUserPipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<ImpersonateUserPipe, "impersonateUser", true>;
|
|
8
|
+
}
|
|
9
|
+
export interface ImpersonateSearchResult {
|
|
10
|
+
netId: string;
|
|
11
|
+
institution: string;
|
|
12
|
+
username: string;
|
|
13
|
+
name: string;
|
|
14
|
+
preferredName: string;
|
|
15
|
+
givenName: string;
|
|
16
|
+
surname: string;
|
|
17
|
+
restricted: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare class ImpersonateModalComponent implements OnDestroy {
|
|
20
|
+
private readonly http;
|
|
21
|
+
private readonly fb;
|
|
22
|
+
private readonly eref;
|
|
23
|
+
set showModal(open: boolean);
|
|
24
|
+
oidcBaseUri: import("@angular/core").InputSignal<string>;
|
|
25
|
+
oidcDefaultIdp: import("@angular/core").InputSignal<string>;
|
|
26
|
+
accessToken: import("@angular/core").InputSignal<string>;
|
|
27
|
+
dismiss: EventEmitter<void>;
|
|
28
|
+
init: EventEmitter<void>;
|
|
29
|
+
protected isOpen: boolean;
|
|
30
|
+
protected hasError: boolean;
|
|
31
|
+
protected form: import("@angular/forms").FormGroup<{
|
|
32
|
+
search: import("@angular/forms").FormControl<string | null>;
|
|
33
|
+
}>;
|
|
34
|
+
protected selectedUsername?: string;
|
|
35
|
+
protected loading: boolean;
|
|
36
|
+
protected handleSearchSubject: Subject<boolean>;
|
|
37
|
+
protected results: import("@angular/core").Signal<ImpersonateSearchResult[] | null | undefined>;
|
|
38
|
+
private subs;
|
|
39
|
+
outsideClick(event: MouseEvent): void;
|
|
40
|
+
handleKeyDown: (event: KeyboardEvent) => void;
|
|
41
|
+
ngOnDestroy(): void;
|
|
42
|
+
/** Redirect to Keycloak impersonate page, which will redirect back
|
|
43
|
+
* after impersonation begins.
|
|
44
|
+
*/
|
|
45
|
+
protected startImpersonation: (username?: string) => void;
|
|
46
|
+
protected handleSelectUser: (event: Event) => void;
|
|
47
|
+
protected clearSearch: () => void;
|
|
48
|
+
protected close: () => void;
|
|
49
|
+
protected handleFormSubmit: (event: SubmitEvent) => void;
|
|
50
|
+
protected handleSearchKeyPress: (event: KeyboardEvent) => void;
|
|
51
|
+
protected handleResultKeyPress: (event: KeyboardEvent) => void;
|
|
52
|
+
/** Search Keycloak users using a generic search query. */
|
|
53
|
+
private searchUsers;
|
|
54
|
+
private replaceUrl;
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ImpersonateModalComponent, never>;
|
|
56
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ImpersonateModalComponent, "lib-impersonate-modal", never, { "showModal": { "alias": "showModal"; "required": false; }; "oidcBaseUri": { "alias": "oidcBaseUri"; "required": true; "isSignal": true; }; "oidcDefaultIdp": { "alias": "oidcDefaultIdp"; "required": true; "isSignal": true; }; "accessToken": { "alias": "accessToken"; "required": true; "isSignal": true; }; }, { "dismiss": "dismiss"; "init": "init"; }, never, never, true, never>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NavBarDropdownComponent } from '../nav-bar-dropdown/nav-bar-dropdown.component';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
type NavInfo = {
|
|
4
|
+
title: string;
|
|
5
|
+
mainSection?: Section;
|
|
6
|
+
otherSections: Section[];
|
|
7
|
+
};
|
|
8
|
+
type Section = {
|
|
9
|
+
title: string;
|
|
10
|
+
links: Link[];
|
|
11
|
+
auxiliaryLink?: Link;
|
|
12
|
+
};
|
|
13
|
+
type Link = {
|
|
14
|
+
label: string;
|
|
15
|
+
url: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare class NavBarComponent {
|
|
19
|
+
private bo;
|
|
20
|
+
height: import("@angular/core").InputSignal<number | null>;
|
|
21
|
+
dropdownComps: NavBarDropdownComponent[];
|
|
22
|
+
protected handleDropdownOpenEvent: (title: string) => void;
|
|
23
|
+
protected isScreenSmall: import("@angular/core").Signal<boolean | undefined>;
|
|
24
|
+
protected navInfos: NavInfo[];
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavBarComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NavBarComponent, "lib-nav-bar", never, { "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
closeDropdown: () => boolean;
|
|
8
|
+
protected isOpen: boolean;
|
|
9
|
+
protected handleClick: () => void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavBarDropdownComponent, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NavBarDropdownComponent, "lib-nav-bar-dropdown", never, { "title": { "alias": "title"; "required": true; "isSignal": true; }; "isSmallScreen": { "alias": "isSmallScreen"; "required": false; "isSignal": true; }; }, { "openEvent": "openEvent"; }, never, ["*"], true, never>;
|
|
12
|
+
}
|
|
@@ -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
|
+
}
|
package/lib/utils.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byuhbll/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^18.0.0",
|
|
6
6
|
"@angular/core": "^18.0.0"
|
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
"./pill-btn": {
|
|
26
26
|
"sass": "./styles/scss/pill-btn.scss"
|
|
27
27
|
},
|
|
28
|
+
"./spinner": {
|
|
29
|
+
"sass": "./styles/scss/spinner.scss"
|
|
30
|
+
},
|
|
28
31
|
"./package.json": {
|
|
29
32
|
"default": "./package.json"
|
|
30
33
|
},
|
package/styles/scss/_mixins.scss
CHANGED
package/styles/scss/_vars.scss
CHANGED
package/styles/scss/base.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use './
|
|
1
|
+
@use './vars';
|
|
2
2
|
|
|
3
3
|
$sourceSansProVersion: '1.0.0';
|
|
4
4
|
$icomoonVersion: '1.0.1';
|
|
@@ -203,8 +203,14 @@ q {
|
|
|
203
203
|
quotes: '' '';
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
a
|
|
206
|
+
a,
|
|
207
|
+
button {
|
|
208
|
+
border: none;
|
|
209
|
+
background: none;
|
|
210
|
+
font-family: inherit;
|
|
211
|
+
font-size: inherit;
|
|
207
212
|
text-decoration: none;
|
|
213
|
+
cursor: pointer;
|
|
208
214
|
}
|
|
209
215
|
|
|
210
216
|
a img {
|
|
@@ -218,8 +224,5 @@ ul {
|
|
|
218
224
|
*,
|
|
219
225
|
*::before,
|
|
220
226
|
*::after {
|
|
221
|
-
-moz-box-sizing: border-box;
|
|
222
|
-
-ms-box-sizing: border-box;
|
|
223
|
-
-webkit-box-sizing: border-box;
|
|
224
227
|
box-sizing: border-box;
|
|
225
228
|
}
|
package/styles/scss/cta-btn.scss
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@use 'vars';
|
|
2
|
+
|
|
3
|
+
.lib-spinner {
|
|
4
|
+
border: 0.3em solid #dfe9f7;
|
|
5
|
+
border-top: 0.3em solid vars.$interactive-blue;
|
|
6
|
+
border-radius: 100%;
|
|
7
|
+
width: 30px;
|
|
8
|
+
height: 30px;
|
|
9
|
+
animation: loadingSpinnerAnimate 1s ease infinite;
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes loadingSpinnerAnimate {
|
|
14
|
+
0% {
|
|
15
|
+
transform: rotate(0deg);
|
|
16
|
+
}
|
|
17
|
+
100% {
|
|
18
|
+
transform: rotate(360deg);
|
|
19
|
+
}
|
|
20
|
+
}
|