@byuhbll/components 0.0.8 → 0.0.9

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,7 +8,6 @@ export declare const ADVANCED_SEARCH_QUALIFIER_MAP: {
8
8
  };
9
9
  export declare const ADVANCED_SEARCH_FIELD_MAP: {
10
10
  abstract: string;
11
- allText: string;
12
11
  any: string;
13
12
  callNumber: string;
14
13
  contributor: string;
@@ -21,6 +20,29 @@ export declare const ADVANCED_SEARCH_FIELD_MAP: {
21
20
  subject: string;
22
21
  title: string;
23
22
  };
23
+ export declare const ADVANCED_SEARCH_QUERIES_LIMIT = 12;
24
+ export declare const PERIOD_OPTIONS: readonly ["", "1", "2", "5", "10", "custom"];
25
+ export declare const ADVANCED_SEARCH_OPTIONS: {
26
+ readonly boolean: readonly ["AND", "OR", "NOT"];
27
+ readonly fields: readonly ["any", "title", "creator", "subject", "issn", "isbn"];
28
+ readonly localFields: readonly ["callNumber", "contributor", "genre", "series"];
29
+ readonly externalFields: readonly ["source", "abstract"];
30
+ readonly qualifiers: {
31
+ readonly any: readonly ["contains"];
32
+ readonly title: readonly ["contains", "exact", "begins_with", "index"];
33
+ readonly callNumber: readonly ["contains", "exact", "begins_with", "index"];
34
+ readonly creator: readonly ["contains", "exact", "begins_with", "index"];
35
+ readonly contributor: readonly ["contains", "exact"];
36
+ readonly isbn: readonly ["contains", "exact"];
37
+ readonly issn: readonly ["contains", "exact"];
38
+ readonly genre: readonly ["contains", "exact"];
39
+ readonly subject: readonly ["contains", "exact", "subject_lc", "subject_expanded"];
40
+ readonly series: readonly ["contains", "exact"];
41
+ };
42
+ readonly resultsPerPage: readonly ["10", "20", "50", "100"];
43
+ readonly period: readonly ["", "1", "2", "5", "10", "custom"];
44
+ 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"];
45
+ };
24
46
  export declare const PRIMARY_BLUE = "rgba(63, 112, 176, 1)";
25
47
  export declare const PRIMARY_BLUE_HOVER = "hsl(214, 48%, 60%, 1)";
26
48
  export declare const PRIMARY_LIGHT_BLUE = "rgba(223, 233, 247, 1)";
@@ -0,0 +1,18 @@
1
+ import { ADVANCED_SEARCH_OPTIONS } from '../constants';
2
+ export type AdvancedSearchBooleanOption = (typeof ADVANCED_SEARCH_OPTIONS.boolean)[number];
3
+ export type AdvancedSearchFieldOption = (typeof ADVANCED_SEARCH_OPTIONS.fields)[number];
4
+ export declare const isAdvancedSearchFieldOption: (field: string) => field is "callNumber" | "contributor" | "genre" | "series";
5
+ export type AdvancedSearchLocalFieldOption = (typeof ADVANCED_SEARCH_OPTIONS.localFields)[number];
6
+ export declare const isAdvancedSearchLocalFieldOption: (field: string) => field is "callNumber" | "contributor" | "genre" | "series";
7
+ export type AdvancedSearchExternalFieldOption = (typeof ADVANCED_SEARCH_OPTIONS.externalFields)[number];
8
+ export declare const isAdvancedSearchExternalFieldOption: (field: string) => field is "source" | "abstract";
9
+ export type AdvancedSearchQualifierOption = (typeof ADVANCED_SEARCH_OPTIONS.qualifiers)[keyof typeof ADVANCED_SEARCH_OPTIONS.qualifiers][number];
10
+ export type AdvancedSearchResultsPerPageOption = (typeof ADVANCED_SEARCH_OPTIONS.resultsPerPage)[number];
11
+ export type AdvancedSearchLanguageOption = (typeof ADVANCED_SEARCH_OPTIONS.languages)[number];
12
+ export type AdvancedSearchQualifier = keyof typeof ADVANCED_SEARCH_OPTIONS.qualifiers;
13
+ export interface AdvancedSearchQueryRow {
14
+ boolean?: AdvancedSearchBooleanOption;
15
+ field?: AdvancedSearchFieldOption | AdvancedSearchLocalFieldOption | AdvancedSearchExternalFieldOption;
16
+ qualifier?: AdvancedSearchQualifierOption;
17
+ query: string;
18
+ }
@@ -0,0 +1 @@
1
+ export type SearchScope = 'local' | 'external';
@@ -0,0 +1,9 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { AdvancedSearchQueryRow } from '../models/advanced-search.model';
3
+ import { SearchScope } from '../models/search-scope.model';
4
+ import * as i0 from "@angular/core";
5
+ export declare class AdvancedFieldWarningPipe implements PipeTransform {
6
+ transform(queryRows: AdvancedSearchQueryRow[], scope: SearchScope): string;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdvancedFieldWarningPipe, never>;
8
+ static ɵpipe: i0.ɵɵPipeDeclaration<AdvancedFieldWarningPipe, "advancedFieldWarning", true>;
9
+ }
@@ -1,8 +1,12 @@
1
1
  import { PipeTransform } from '@angular/core';
2
- import { AdvancedSearchQueryRow } from '../ss-search-bar.component';
2
+ import { AdvancedSearchQueryRow } from '../models/advanced-search.model';
3
+ import { SearchScope } from '../models/search-scope.model';
4
+ import { FieldByScopePipe } from './field-by-scope.pipe';
3
5
  import * as i0 from "@angular/core";
4
6
  export declare class SsAdvancedQueriesPipe implements PipeTransform {
5
- transform(queryRows: AdvancedSearchQueryRow[]): string;
7
+ private fieldByScopePipe;
8
+ constructor(fieldByScopePipe: FieldByScopePipe);
9
+ transform(queryRows: AdvancedSearchQueryRow[], scope: SearchScope): string;
6
10
  static ɵfac: i0.ɵɵFactoryDeclaration<SsAdvancedQueriesPipe, never>;
7
11
  static ɵpipe: i0.ɵɵPipeDeclaration<SsAdvancedQueriesPipe, "ssAdvancedQueries", true>;
8
12
  }
@@ -0,0 +1,12 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { AdvancedSearchExternalFieldOption, AdvancedSearchFieldOption, AdvancedSearchLocalFieldOption } from '../models/advanced-search.model';
3
+ import { SearchScope } from '../models/search-scope.model';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Returns the field value based on the scope. If a field value does not exist in a specific scope, the default is returned.
7
+ */
8
+ export declare class FieldByScopePipe implements PipeTransform {
9
+ transform(fieldValue: AdvancedSearchFieldOption | AdvancedSearchLocalFieldOption | AdvancedSearchExternalFieldOption, scope: SearchScope): AdvancedSearchFieldOption | AdvancedSearchLocalFieldOption | AdvancedSearchExternalFieldOption;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<FieldByScopePipe, never>;
11
+ static ɵpipe: i0.ɵɵPipeDeclaration<FieldByScopePipe, "fieldByScope", true>;
12
+ }
@@ -1,49 +1,13 @@
1
1
  import { EventEmitter } from '@angular/core';
2
+ import { AdvancedSearchQueryRow } from './models/advanced-search.model';
3
+ import { SearchScope } from './models/search-scope.model';
2
4
  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
5
  export interface SearchConfig {
41
6
  showExternalTab: boolean;
42
7
  showAdvancedSearch: boolean;
43
8
  showAdvancedSearchAsText: boolean;
44
- scope: 'local' | 'external';
9
+ scope: SearchScope;
45
10
  q: string;
46
- isFacetSearch: boolean;
47
11
  advancedSearchQueryRows: AdvancedSearchQueryRow[];
48
12
  localAdvancedSearch: {
49
13
  selectedResourceTypes: string[];
@@ -75,7 +39,7 @@ export interface SearchConfig {
75
39
  showExternalTab: boolean;
76
40
  showAdvancedSearch: boolean;
77
41
  showAdvancedSearchAsText: boolean;
78
- scope: 'local' | 'external';
42
+ scope: SearchScope;
79
43
  q: string;
80
44
  isFacetSearch: boolean;
81
45
  advancedSearchQueryRows: AdvancedSearchQueryRow[];
@@ -108,14 +72,16 @@ export declare class SsSearchBarComponent {
108
72
  clearSimpleSearch: EventEmitter<SearchConfig>;
109
73
  advancedSearch: EventEmitter<SearchConfig>;
110
74
  advancedSearchClosed: EventEmitter<SearchConfig>;
75
+ advancedSearchOpen: EventEmitter<SearchConfig>;
76
+ tabChange: EventEmitter<SearchConfig>;
111
77
  private barWrapperRef;
112
78
  protected heightOfContainer: number;
113
79
  protected emitClearSimpleSearch: () => void;
114
80
  protected emitSimpleSearch: (updatedProps: Partial<SearchConfig>) => void;
115
81
  protected emitAdvancedSearchClosed: () => void;
116
82
  protected emitAdvancedSearch: (config: SearchConfig) => void;
117
- protected goToFacetSearchInExternalScope: () => void;
118
- protected showFullAdvancedSearch: () => void;
83
+ protected emitAdvancedSearchOpen: () => void;
84
+ protected emitTabChange: (newScope: SearchScope) => void;
119
85
  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>;
86
+ static ɵcmp: i0.ɵɵComponentDeclaration<SsSearchBarComponent, "lib-ss-search-bar", never, { "config": { "alias": "config"; "required": true; }; }, { "simpleSearch": "simpleSearch"; "clearSimpleSearch": "clearSimpleSearch"; "advancedSearch": "advancedSearch"; "advancedSearchClosed": "advancedSearchClosed"; "advancedSearchOpen": "advancedSearchOpen"; "tabChange": "tabChange"; }, never, never, true, never>;
121
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byuhbll/components",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.0.0",
6
6
  "@angular/core": "^18.0.0"