@byuhbll/components 0.0.8
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/README.md +25 -0
- package/esm2022/byuhbll-components.mjs +5 -0
- package/esm2022/lib/animations/animations.mjs +22 -0
- package/esm2022/lib/directives/hbll-pill-btn/hbll-pill-btn.directive.mjs +121 -0
- package/esm2022/lib/hbll-checkbox/hbll-checkbox.component.mjs +17 -0
- package/esm2022/lib/hbll-header/hbll-header.component.mjs +60 -0
- package/esm2022/lib/hbll-multi-select/hbll-multi-select.component.mjs +114 -0
- package/esm2022/lib/ss-search-bar/advanced-search/advanced-search.component.mjs +270 -0
- package/esm2022/lib/ss-search-bar/constants.mjs +41 -0
- package/esm2022/lib/ss-search-bar/date-range/date-range.component.mjs +71 -0
- package/esm2022/lib/ss-search-bar/pipes/advanced-queries.pipe.mjs +27 -0
- package/esm2022/lib/ss-search-bar/simple-search/simple-search.component.mjs +85 -0
- package/esm2022/lib/ss-search-bar/ss-search-bar.component.mjs +199 -0
- package/esm2022/lib/ss-search-bar/utils.mjs +16 -0
- package/esm2022/public-api.mjs +6 -0
- package/fesm2022/byuhbll-components.mjs +1001 -0
- package/fesm2022/byuhbll-components.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/animations/animations.d.ts +4 -0
- package/lib/directives/hbll-pill-btn/hbll-pill-btn.directive.d.ts +17 -0
- package/lib/hbll-checkbox/hbll-checkbox.component.d.ts +6 -0
- package/lib/hbll-header/hbll-header.component.d.ts +40 -0
- package/lib/hbll-multi-select/hbll-multi-select.component.d.ts +52 -0
- package/lib/ss-search-bar/advanced-search/advanced-search.component.d.ts +122 -0
- package/lib/ss-search-bar/constants.d.ts +40 -0
- package/lib/ss-search-bar/date-range/date-range.component.d.ts +25 -0
- package/lib/ss-search-bar/pipes/advanced-queries.pipe.d.ts +8 -0
- package/lib/ss-search-bar/simple-search/simple-search.component.d.ts +28 -0
- package/lib/ss-search-bar/ss-search-bar.component.d.ts +121 -0
- package/lib/ss-search-bar/utils.d.ts +7 -0
- package/package.json +25 -0
- package/public-api.d.ts +2 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { SearchConfig } from '../ss-search-bar.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class SimpleSearchComponent implements OnInit, OnDestroy {
|
|
6
|
+
private readonly fb;
|
|
7
|
+
private searchInput;
|
|
8
|
+
private inputTooltip;
|
|
9
|
+
private subscription;
|
|
10
|
+
private _config;
|
|
11
|
+
set config(config: SearchConfig);
|
|
12
|
+
get config(): SearchConfig;
|
|
13
|
+
simpleSearch: EventEmitter<SearchConfig>;
|
|
14
|
+
clearSimpleSearch: EventEmitter<void>;
|
|
15
|
+
protected isSubmitted: boolean;
|
|
16
|
+
protected searchForm: import("@angular/forms").FormGroup<{
|
|
17
|
+
simpleQuery: FormControl<string>;
|
|
18
|
+
}>;
|
|
19
|
+
get simpleQuery(): FormControl<any>;
|
|
20
|
+
ngOnInit(): void;
|
|
21
|
+
ngOnDestroy(): void;
|
|
22
|
+
protected emitSimpleSearch: () => void;
|
|
23
|
+
protected clearQuery: () => void;
|
|
24
|
+
private setupForm;
|
|
25
|
+
private showSearchValidationToolTip;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SimpleSearchComponent, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SimpleSearchComponent, "lib-ss-simple-search", never, { "config": { "alias": "config"; "required": true; }; }, { "simpleSearch": "simpleSearch"; "clearSimpleSearch": "clearSimpleSearch"; }, never, never, true, never>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare const ADVANCED_SEARCH_QUERIES_LIMIT = 12;
|
|
4
|
+
export declare const PERIOD_OPTIONS: readonly ["", "1", "2", "5", "10", "custom"];
|
|
5
|
+
export declare const ADVANCED_SEARCH_OPTIONS: {
|
|
6
|
+
readonly boolean: readonly ["AND", "OR", "NOT"];
|
|
7
|
+
readonly localFields: readonly ["any", "title", "callNumber", "creator", "contributor", "isbn", "issn", "genre", "subject", "series"];
|
|
8
|
+
readonly externalFields: readonly ["allText", "creator", "title", "subject", "source", "abstract", "issn", "isbn"];
|
|
9
|
+
readonly qualifiers: {
|
|
10
|
+
readonly any: readonly ["contains"];
|
|
11
|
+
readonly title: readonly ["contains", "exact", "begins_with", "index"];
|
|
12
|
+
readonly callNumber: readonly ["contains", "exact", "begins_with", "index"];
|
|
13
|
+
readonly creator: readonly ["contains", "exact", "begins_with", "index"];
|
|
14
|
+
readonly contributor: readonly ["contains", "exact"];
|
|
15
|
+
readonly isbn: readonly ["contains", "exact"];
|
|
16
|
+
readonly issn: readonly ["contains", "exact"];
|
|
17
|
+
readonly genre: readonly ["contains", "exact"];
|
|
18
|
+
readonly subject: readonly ["contains", "exact", "subject_lc", "subject_expanded"];
|
|
19
|
+
readonly series: readonly ["contains", "exact"];
|
|
20
|
+
};
|
|
21
|
+
readonly resultsPerPage: readonly ["10", "20", "50", "100"];
|
|
22
|
+
readonly period: readonly ["", "1", "2", "5", "10", "custom"];
|
|
23
|
+
readonly languages: readonly ["eng", "ara", "chi", "ces", "dan", "dut", "fin", "fre", "ger", "gre", "heb", "hin", "hun", "ice", "ita", "jpn", "kor", "lat", "nor", "pol", "por", "pan", "rum", "rus", "spa", "swe", "wel", "yid"];
|
|
24
|
+
};
|
|
25
|
+
export type AdvancedSearchBooleanOption = (typeof ADVANCED_SEARCH_OPTIONS.boolean)[number];
|
|
26
|
+
export type AdvancedSearchLocalFieldOption = (typeof ADVANCED_SEARCH_OPTIONS.localFields)[number];
|
|
27
|
+
export declare const isAdvancedSearchLocalFieldOption: (field: string) => field is "any" | "title" | "callNumber" | "creator" | "contributor" | "isbn" | "issn" | "genre" | "subject" | "series";
|
|
28
|
+
export type AdvancedSearchExternalFieldOption = (typeof ADVANCED_SEARCH_OPTIONS.externalFields)[number];
|
|
29
|
+
export declare const isAdvancedSearchExternalFieldOption: (field: string) => field is "title" | "creator" | "isbn" | "issn" | "subject" | "allText" | "source" | "abstract";
|
|
30
|
+
export type AdvancedSearchQualifierOption = (typeof ADVANCED_SEARCH_OPTIONS.qualifiers)[keyof typeof ADVANCED_SEARCH_OPTIONS.qualifiers][number];
|
|
31
|
+
export type AdvancedSearchResultsPerPageOption = (typeof ADVANCED_SEARCH_OPTIONS.resultsPerPage)[number];
|
|
32
|
+
export type AdvancedSearchLanguageOption = (typeof ADVANCED_SEARCH_OPTIONS.languages)[number];
|
|
33
|
+
export type AdvancedSearchQualifier = keyof typeof ADVANCED_SEARCH_OPTIONS.qualifiers;
|
|
34
|
+
export interface AdvancedSearchQueryRow {
|
|
35
|
+
boolean?: AdvancedSearchBooleanOption;
|
|
36
|
+
field?: AdvancedSearchLocalFieldOption | AdvancedSearchExternalFieldOption;
|
|
37
|
+
qualifier?: AdvancedSearchQualifierOption;
|
|
38
|
+
query: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SearchConfig {
|
|
41
|
+
showExternalTab: boolean;
|
|
42
|
+
showAdvancedSearch: boolean;
|
|
43
|
+
showAdvancedSearchAsText: boolean;
|
|
44
|
+
scope: 'local' | 'external';
|
|
45
|
+
q: string;
|
|
46
|
+
isFacetSearch: boolean;
|
|
47
|
+
advancedSearchQueryRows: AdvancedSearchQueryRow[];
|
|
48
|
+
localAdvancedSearch: {
|
|
49
|
+
selectedResourceTypes: string[];
|
|
50
|
+
availableResourceTypes: Record<string, string>;
|
|
51
|
+
selectedCollections: string[];
|
|
52
|
+
availableCollections: Record<string, string>;
|
|
53
|
+
};
|
|
54
|
+
externalAdvancedSearch: {
|
|
55
|
+
datePublished: {
|
|
56
|
+
from: string;
|
|
57
|
+
to: string;
|
|
58
|
+
};
|
|
59
|
+
selectedLanguages: string[];
|
|
60
|
+
availableLanguages: Record<string, string>;
|
|
61
|
+
limitResults: {
|
|
62
|
+
peerReviewed: boolean;
|
|
63
|
+
};
|
|
64
|
+
expandResults: {
|
|
65
|
+
applyRelatedWords: boolean;
|
|
66
|
+
applyEquivalentSubjects: boolean;
|
|
67
|
+
fullText: boolean;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Accepts as input, and emits as events, SearchConfig objects:
|
|
73
|
+
* ```
|
|
74
|
+
* SearchConfig {
|
|
75
|
+
showExternalTab: boolean;
|
|
76
|
+
showAdvancedSearch: boolean;
|
|
77
|
+
showAdvancedSearchAsText: boolean;
|
|
78
|
+
scope: 'local' | 'external';
|
|
79
|
+
q: string;
|
|
80
|
+
isFacetSearch: boolean;
|
|
81
|
+
advancedSearchQueryRows: AdvancedSearchQueryRow[];
|
|
82
|
+
localAdvancedSearch: {
|
|
83
|
+
selectedResourceTypes: string[];
|
|
84
|
+
availableResourceTypes: Record<string, string>;
|
|
85
|
+
selectedCollections: string[];
|
|
86
|
+
availableCollections: Record<string, string>;
|
|
87
|
+
};
|
|
88
|
+
externalAdvancedSearch: {
|
|
89
|
+
datePublished: { from: string; to: string };
|
|
90
|
+
selectedLanguages: string[];
|
|
91
|
+
availableLanguages: Record<string, string>;
|
|
92
|
+
limitResults: {
|
|
93
|
+
peerReviewed: boolean;
|
|
94
|
+
};
|
|
95
|
+
expandResults: {
|
|
96
|
+
applyRelatedWords: boolean;
|
|
97
|
+
applyEquivalentSubjects: boolean;
|
|
98
|
+
fullText: boolean;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare class SsSearchBarComponent {
|
|
104
|
+
private _config;
|
|
105
|
+
set config(config: string);
|
|
106
|
+
get config(): SearchConfig;
|
|
107
|
+
simpleSearch: EventEmitter<SearchConfig>;
|
|
108
|
+
clearSimpleSearch: EventEmitter<SearchConfig>;
|
|
109
|
+
advancedSearch: EventEmitter<SearchConfig>;
|
|
110
|
+
advancedSearchClosed: EventEmitter<SearchConfig>;
|
|
111
|
+
private barWrapperRef;
|
|
112
|
+
protected heightOfContainer: number;
|
|
113
|
+
protected emitClearSimpleSearch: () => void;
|
|
114
|
+
protected emitSimpleSearch: (updatedProps: Partial<SearchConfig>) => void;
|
|
115
|
+
protected emitAdvancedSearchClosed: () => void;
|
|
116
|
+
protected emitAdvancedSearch: (config: SearchConfig) => void;
|
|
117
|
+
protected goToFacetSearchInExternalScope: () => void;
|
|
118
|
+
protected showFullAdvancedSearch: () => void;
|
|
119
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SsSearchBarComponent, never>;
|
|
120
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SsSearchBarComponent, "lib-ss-search-bar", never, { "config": { "alias": "config"; "required": true; }; }, { "simpleSearch": "simpleSearch"; "clearSimpleSearch": "clearSimpleSearch"; "advancedSearch": "advancedSearch"; "advancedSearchClosed": "advancedSearchClosed"; }, never, never, true, never>;
|
|
121
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ValidatorFn } from '@angular/forms';
|
|
2
|
+
/**
|
|
3
|
+
* Validator method to check if a `FormGroup<{ from: FormControl<string>; to: FormControl<string> }>` is valid.
|
|
4
|
+
* The FormGroup is considered valid if either both `from` and `to` are set, or both are empty strings.
|
|
5
|
+
* @returns {ValidationErrors | null} validation errors, if any
|
|
6
|
+
*/
|
|
7
|
+
export declare const validateDateRangeFields: () => ValidatorFn;
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@byuhbll/components",
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^18.0.0",
|
|
6
|
+
"@angular/core": "^18.0.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/byuhbll-components.mjs",
|
|
13
|
+
"typings": "index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./index.d.ts",
|
|
20
|
+
"esm2022": "./esm2022/byuhbll-components.mjs",
|
|
21
|
+
"esm": "./esm2022/byuhbll-components.mjs",
|
|
22
|
+
"default": "./fesm2022/byuhbll-components.mjs"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
package/public-api.d.ts
ADDED