@sourceloop/search-client 6.0.1 → 7.0.0

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.
@@ -2,7 +2,7 @@ import * as i2 from '@angular/common';
2
2
  import { isPlatformBrowser, CommonModule } from '@angular/common';
3
3
  import { HttpClientModule } from '@angular/common/http';
4
4
  import * as i0 from '@angular/core';
5
- import { InjectionToken, Injectable, EventEmitter, PLATFORM_ID, Component, Inject, Optional, Input, Output, ViewChild, NgModule } from '@angular/core';
5
+ import { InjectionToken, Injectable, EventEmitter, PLATFORM_ID, ViewChild, Output, Input, Inject, Optional, Component, NgModule } from '@angular/core';
6
6
  import { FlexLayoutModule } from '@angular/flex-layout';
7
7
  import * as i3 from '@angular/forms';
8
8
  import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
@@ -20,6 +20,9 @@ import * as i6 from '@angular/material/core';
20
20
  import * as i9 from '@angular/flex-layout/flex';
21
21
 
22
22
  // Copyright (c) 2023 Sourcefuse Technologies
23
+ //
24
+ // This software is released under the MIT License.
25
+ // https://opensource.org/licenses/MIT
23
26
  function isApiServiceWithPromise(service) {
24
27
  return !!service
25
28
  .searchApiRequestWithPromise;
@@ -47,10 +50,10 @@ class PromiseApiAdapterService {
47
50
  }),
48
51
  };
49
52
  }
53
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PromiseApiAdapterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
54
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PromiseApiAdapterService, providedIn: 'root' });
50
55
  }
51
- PromiseApiAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PromiseApiAdapterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
52
- PromiseApiAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PromiseApiAdapterService, providedIn: 'root' });
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PromiseApiAdapterService, decorators: [{
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PromiseApiAdapterService, decorators: [{
54
57
  type: Injectable,
55
58
  args: [{
56
59
  providedIn: 'root',
@@ -58,48 +61,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
58
61
  }] });
59
62
 
60
63
  // Copyright (c) 2023 Sourcefuse Technologies
64
+ //
65
+ // This software is released under the MIT License.
66
+ // https://opensource.org/licenses/MIT
61
67
  const ALL_LABEL = 'All';
62
68
  class SearchComponent {
63
- constructor(searchService,
64
- // tslint:disable-next-line:ban-types
65
- platformId, cdr, promiseAdapter) {
66
- this.searchService = searchService;
67
- this.platformId = platformId;
68
- this.cdr = cdr;
69
- this.promiseAdapter = promiseAdapter;
70
- this.searchBoxInput = '';
71
- this.suggestionsDisplay = false;
72
- this.categoryDisplay = false;
73
- this.searching = false;
74
- this.suggestions = [];
75
- this.recentSearches = [];
76
- this.category = ALL_LABEL;
77
- this.searchRequest$ = new Subject();
78
- /**
79
- * configure when application has own search input and use different all label
80
- */
81
- this.customAllLabel = ALL_LABEL;
82
- /**
83
- * configure to true when to show only search result overlay without search bar
84
- */
85
- this.showOnlySearchResultOverlay = false;
86
- /**
87
- * provide custom search event when showOnlySearchResultOverlay configure to true
88
- */
89
- this.customSearchEvent = {
90
- searchValue: '',
91
- modelName: this.customAllLabel,
92
- };
93
- // emitted when user clicks one of the suggested results (including recent search sugestions)
94
- this.clicked = new EventEmitter();
95
- this.searched = new EventEmitter();
96
- /* emitted when user makes search request (including recent search requests
97
- & requests made on change in category from dropdown)
98
- In case of recent search Array of recent Search request result is emitted */
99
- this.onChange = () => { };
100
- this.onTouched = () => { };
101
- this.disabled = false;
102
- }
69
+ searchService;
70
+ platformId;
71
+ cdr;
72
+ promiseAdapter;
73
+ searchBoxInput = '';
74
+ suggestionsDisplay = false;
75
+ categoryDisplay = false;
76
+ searching = false;
77
+ suggestions = [];
78
+ recentSearches = [];
79
+ category = ALL_LABEL;
80
+ searchRequest$ = new Subject();
81
+ _config;
103
82
  get config() {
104
83
  return this._config;
105
84
  }
@@ -108,14 +87,14 @@ class SearchComponent {
108
87
  if (value && value.models) {
109
88
  value.models.unshift({
110
89
  name: ALL_LABEL,
111
- displayName: ALL_LABEL,
90
+ displayName: this.customAllLabel ?? ALL_LABEL,
112
91
  });
113
92
  }
114
93
  else if (value && !value.models) {
115
94
  value.models = [
116
95
  {
117
96
  name: ALL_LABEL,
118
- displayName: ALL_LABEL,
97
+ displayName: this.customAllLabel ?? ALL_LABEL,
119
98
  },
120
99
  ];
121
100
  }
@@ -132,6 +111,41 @@ class SearchComponent {
132
111
  get searchProvider() {
133
112
  return this.searchService;
134
113
  }
114
+ titleTemplate;
115
+ subtitleTemplate;
116
+ /**
117
+ * configure when application has own search input and use different all label
118
+ */
119
+ customAllLabel = ALL_LABEL;
120
+ /**
121
+ * configure to true when to show only search result overlay without search bar
122
+ */
123
+ showOnlySearchResultOverlay = false;
124
+ /**
125
+ * provide custom search event when showOnlySearchResultOverlay configure to true
126
+ */
127
+ customSearchEvent = {
128
+ searchValue: '',
129
+ modelName: this.customAllLabel,
130
+ };
131
+ // emitted when user clicks one of the suggested results (including recent search sugestions)
132
+ clicked = new EventEmitter();
133
+ searched = new EventEmitter();
134
+ /* emitted when user makes search request (including recent search requests
135
+ & requests made on change in category from dropdown)
136
+ In case of recent search Array of recent Search request result is emitted */
137
+ onChange = () => { };
138
+ onTouched = () => { };
139
+ disabled = false;
140
+ searchInputElement;
141
+ constructor(searchService,
142
+ // tslint:disable-next-line:ban-types
143
+ platformId, cdr, promiseAdapter) {
144
+ this.searchService = searchService;
145
+ this.platformId = platformId;
146
+ this.cdr = cdr;
147
+ this.promiseAdapter = promiseAdapter;
148
+ }
135
149
  ngOnInit() {
136
150
  this.searchRequest$
137
151
  .pipe(tap(v => (this.suggestions = [])), debounceTime(DEBOUNCE_TIME))
@@ -384,16 +398,16 @@ class SearchComponent {
384
398
  changes.customSearchEvent?.previousValue[propertyName] !==
385
399
  changes.customSearchEvent?.currentValue[propertyName]);
386
400
  }
401
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchComponent, deps: [{ token: SEARCH_SERVICE_TOKEN, optional: true }, { token: PLATFORM_ID }, { token: i0.ChangeDetectorRef }, { token: PromiseApiAdapterService }], target: i0.ɵɵFactoryTarget.Component });
402
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchComponent, selector: "sourceloop-search", inputs: { config: "config", searchProvider: "searchProvider", titleTemplate: "titleTemplate", subtitleTemplate: "subtitleTemplate", customAllLabel: "customAllLabel", showOnlySearchResultOverlay: "showOnlySearchResultOverlay", customSearchEvent: "customSearchEvent" }, outputs: { clicked: "clicked", searched: "searched" }, providers: [
403
+ {
404
+ provide: NG_VALUE_ACCESSOR,
405
+ useExisting: SearchComponent,
406
+ multi: true,
407
+ },
408
+ ], viewQueries: [{ propertyName: "searchInputElement", first: true, predicate: ["searchInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"!showOnlySearchResultOverlay\">\n <div fxLayout fxLayoutAlign=\"start center\" class=\"toolbar-search\" *ngIf=\"config\">\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-input\">\n <input\n matInput\n autocomplete=\"off\"\n type=\"text\"\n [placeholder]=\"\n config.placeholderFunction\n ? config.placeholderFunction(searchInput.value, category)\n : config.placeholder || 'Search'\n \"\n #searchInput\n name=\"searchInput\"\n (focus)=\"showSuggestions()\"\n (blur)=\"hideSuggestions()\"\n [(ngModel)]=\"searchBoxInput\"\n (keyup)=\"hitSearchApi($event)\"\n placeholder=\"Search\"\n (ngModelChange)=\"onChange(this.searchBoxInput)\"\n [disabled]=\"disabled\"\n />\n <mat-icon matPrefix [className]=\"config.searchIconClass\"></mat-icon>\n <mat-icon\n *ngIf=\"searchBoxInput\"\n matSuffix\n [className]=\"config.crossIconClass\"\n (click)=\"resetInput()\"\n ></mat-icon>\n </mat-form-field>\n \n <mat-form-field appearance=\"outline\" class=\"toolbar-search-select\">\n <mat-icon matSuffix [className]=\"config.dropDownButtonIconClass\"></mat-icon>\n <mat-select\n [value]=\"category\"\n (selectionChange)=\"setCategory($event.value)\"\n panelClass=\"search-select\"\n >\n <mat-option [value]=\"model.name\" *ngFor=\"let model of config.models\">\n {{ model.displayName }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n</ng-container>\n\n<div class=\"search-container\">\n <div\n *ngIf=\"suggestionsDisplay && (recentSearches.length || suggestions.length)\"\n class=\"search-popup\"\n >\n <ng-container *ngIf=\"searchBoxInput\">\n <span *ngIf=\"suggestions.length === 0\" class=\"search-message\">\n <ng-container *ngIf=\"searching\"> searching... </ng-container>\n <ng-container *ngIf=\"!searching\">\n {{ config.noResultMessage }}\n </ng-container>\n </span>\n <ng-container *ngIf=\"config.categorizeResults && suggestions.length\">\n <div\n class=\"search-result\"\n *ngFor=\"let modelWithSuggestions of getModelsWithSuggestions()\"\n >\n <h3 class=\"suggestions-heading\">\n <img\n *ngIf=\"modelWithSuggestions.model.imageUrl\"\n [src]=\"modelWithSuggestions.model.imageUrl\"\n [alt]=\"modelWithSuggestions.model.displayName\"\n />\n {{ modelWithSuggestions.model.displayName }} ({{\n modelWithSuggestions.items.length\n }})\n </h3>\n <ul>\n <li\n *ngFor=\"let suggestion of modelWithSuggestions.items\"\n (mousedown)=\"populateValue(suggestion, $event)\"\n class=\"suggestions\"\n >\n <ng-container *ngIf=\"subtitleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n subtitleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n <p\n *ngIf=\"!titleTemplate\"\n [innerHTML]=\"\n boldString(\n suggestion[config.displayPropertyName],\n searchBoxInput\n )\n \"\n style=\"display: inline\"\n ></p>\n <ng-container *ngIf=\"titleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n titleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n </li>\n </ul>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!config.categorizeResults\">\n <div class=\"search-result\">\n <ul>\n <li\n *ngFor=\"let suggestion of suggestions\"\n (mousedown)=\"populateValue(suggestion, $event)\"\n >\n <!--Need to call fetchModelImageUrlFromSuggestion as each suggestion can come from different model-->\n <img\n *ngIf=\"\n !titleTemplate && fetchModelImageUrlFromSuggestion(suggestion)\n \"\n class=\"suggestions-categorize-false\"\n [src]=\"fetchModelImageUrlFromSuggestion(suggestion)\"\n style=\"margin-right: 5px\"\n alt=\"Img\"\n />\n <ng-container *ngIf=\"subtitleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n subtitleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n <p\n *ngIf=\"!titleTemplate\"\n [innerHTML]=\"\n boldString(\n suggestion[config.displayPropertyName],\n searchBoxInput\n )\n \"\n style=\"display: inline\"\n ></p>\n <ng-container *ngIf=\"titleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n titleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n </li>\n </ul>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"!config.hideRecentSearch && recentSearches.length > 0\">\n <div class=\"recent-searches\">\n <h3 class=\"suggestions-heading\">Recent Searches</h3>\n <ul>\n <li\n *ngFor=\"let recentSearch of recentSearches\"\n class=\"suggestions\"\n (mousedown)=\"populateValueRecentSearch(recentSearch, $event)\"\n >\n <mat-icon\n matPrefix\n [className]=\"config.recentSearchIconClass\"\n ></mat-icon>\n\n <span>&nbsp;{{ recentSearch.match }}</span>\n </li>\n </ul>\n </div>\n </ng-container>\n </div>\n</div>\n", styles: [":host ::ng-deep .mat-form-field-wrapper{padding:0}:host ::ng-deep .mat-form-field-wrapper .mat-form-field-prefix{margin-right:12px}.toolbar-search-input{width:86%}.toolbar-search-input ::ng-deep input{margin:0}.toolbar-search-input ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-start{border-color:transparent}.toolbar-search-input ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-end{border:none;border-radius:0}.icomoon.Search,.icomoon.close{height:1rem;width:1rem;font-size:1rem;color:#33333380;padding-bottom:4px}.icomoon.close{cursor:pointer}.toolbar-search-select{width:14%}.toolbar-search-select ::ng-deep .mat-select-arrow{opacity:0}.toolbar-search-select ::ng-deep .mat-select-arrow-wrapper{display:inline-block;width:1px}.toolbar-search-select ::ng-deep .mat-select-value-text{font-size:9px}.toolbar-search-select ::ng-deep .mat-form-field-suffix .mat-icon{width:12px;font-size:14px}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-start{border-color:transparent;border-radius:0}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-end{border:none}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-infix{-webkit-padding-before:.7em}.toolbar-search{width:515px;background-color:#f7f7f7;border-radius:0 0 4px 4px}.toolbar-search ::ng-deep .mat-form-field-appearance-outline .mat-form-field-flex{height:39px;align-items:center}.toolbar-search ::ng-deep .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}.toolbar-search ::ng-deep .mat-form-field-infix{height:auto}.search-container{position:relative;width:515px}.search-container .search-popup{padding:0 15px 15px;margin:0;max-height:80vh;overflow-x:hidden;overflow-y:auto;position:absolute;top:100%;left:0;right:0;z-index:9999;background-color:#fff;box-shadow:0 5px 4px #0003;border-radius:0 0 4px 4px}.search-container .search-popup hr{border:0;border-top:1px solid #ebebeb;margin:0;position:sticky;top:0;padding:0 0 15px;z-index:1}.search-container .search-popup .search-message{display:inline-block;width:100%;text-align:center;font-size:16px;padding-top:12px}.search-container .search-popup .search-item-info{color:#91263b;text-align:center;font-size:12px;margin-bottom:15px;padding-top:12px}.search-container .search-popup ul{padding:0;margin:0}.search-container .search-popup ul li{list-style:none;font-size:1rem;font-weight:400;line-height:1.5;color:#333}.search-container .search-popup ul li.suggestions{font-size:15px;line-height:36px;padding:0 15px 0 44px;align-items:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.search-container .search-popup ul li.suggestions:hover{background-color:#fee8e8}.search-container .search-popup ul li.suggestions svg{margin-right:5px}.search-container .search-popup ul li.suggestions-categorize-false:hover{background-color:#fee8e8}.search-container .search-popup .search-result{padding:10px 0 0;margin:0 -15px}.search-container .search-popup .search-result.no-categorize-result ul{width:100%;padding:0;margin:0 0 10px}.search-container .search-popup .search-result.no-categorize-result ul li{font-size:15px;line-height:36px;padding:0 15px 0 31px;display:flex;align-items:center;cursor:pointer}.search-container .search-popup .search-result.no-categorize-result ul li:hover{background-color:#fee8e8}.search-container .search-popup .search-result.no-categorize-result ul li img{width:18px;margin-right:9px}.search-container .search-popup .suggestions-heading{color:#9c9c9c;font-size:14px;font-weight:400;margin:0 0 10px 17px;display:flex;align-items:center;position:relative}.search-container .search-popup .suggestions-heading .show-more{position:absolute;right:20px;color:#d1d1d1;font-size:12px;cursor:pointer;text-decoration:none}.search-container .search-popup .suggestions-heading .show-more :hover{text-decoration:underline}.search-container .search-popup .suggestions-heading img{width:18px;margin-right:9px}.search-container .search-popup .recent-searches{padding:10px 0 0;margin:0 -15px}.search-container .search-popup .recent-searches ul{display:inline-block;width:100%}.search-container .search-popup .recent-searches ul li.suggestions{display:flex}.search-container .search-popup .recent-searches ul li.suggestions span{width:100%;overflow:hidden;text-overflow:ellipsis}.search-container .search-popup .recent-searches .suggestions{display:flex}.search-container .search-popup .recent-searches .suggestions-heading{margin-left:30px}.search-container .search-popup .recent-searches li.suggestions{padding-left:31px}::ng-deep .search-select.mat-select-panel{margin-top:30px;margin-left:10px}::ng-deep .search-select .mat-option-text{display:contents}::ng-deep .toolbar-search .mat-form-field-infix{font-size:14px}::ng-deep .toolbar-search input{line-height:14px}::ng-deep .toolbar-search .mat-form-field-outline:first-child .mat-form-field-outline-start,::ng-deep .toolbar-search .mat-form-field-outline:first-child .mat-form-field-outline-end{background-color:#f1f3f4}::ng-deep .toolbar-search:hover .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-width:1px;border-color:#a53159}::ng-deep .toolbar-search:hover .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border:1px solid #a53159;border-left-style:none;border-right-style:none;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-radius:0;border-color:transparent;background-color:#a53159}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border-width:1px;border-color:#a53159;background-color:#a53159}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-select{color:#fff}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .icomoon.arrow_down{color:#fff}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-width:2px;border-color:#90003b}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border:2px solid #90003b;border-left-style:none;border-right-style:none;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-radius:0;border-color:transparent;background-color:#90003b}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border-width:2px;border-color:#90003b;background-color:#90003b}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-select{color:#fff}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .icomoon.arrow_down{color:#fff}::ng-deep .toolbar-search .mat-select-arrow{opacity:0}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i9.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i9.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }] });
387
409
  }
388
- SearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SearchComponent, deps: [{ token: SEARCH_SERVICE_TOKEN, optional: true }, { token: PLATFORM_ID }, { token: i0.ChangeDetectorRef }, { token: PromiseApiAdapterService }], target: i0.ɵɵFactoryTarget.Component });
389
- SearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SearchComponent, selector: "sourceloop-search", inputs: { config: "config", searchProvider: "searchProvider", titleTemplate: "titleTemplate", subtitleTemplate: "subtitleTemplate", customAllLabel: "customAllLabel", showOnlySearchResultOverlay: "showOnlySearchResultOverlay", customSearchEvent: "customSearchEvent" }, outputs: { clicked: "clicked", searched: "searched" }, providers: [
390
- {
391
- provide: NG_VALUE_ACCESSOR,
392
- useExisting: SearchComponent,
393
- multi: true,
394
- },
395
- ], viewQueries: [{ propertyName: "searchInputElement", first: true, predicate: ["searchInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"!showOnlySearchResultOverlay\">\n <div fxLayout fxLayoutAlign=\"start center\" class=\"toolbar-search\" *ngIf=\"config\">\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-input\">\n <input\n matInput\n autocomplete=\"off\"\n type=\"text\"\n [placeholder]=\"\n config.placeholderFunction\n ? config.placeholderFunction(searchInput.value, category)\n : config.placeholder || 'Search'\n \"\n #searchInput\n name=\"searchInput\"\n (focus)=\"showSuggestions()\"\n (blur)=\"hideSuggestions()\"\n [(ngModel)]=\"searchBoxInput\"\n (keyup)=\"hitSearchApi($event)\"\n placeholder=\"Search\"\n (ngModelChange)=\"onChange(this.searchBoxInput)\"\n [disabled]=\"disabled\"\n />\n <mat-icon matPrefix [className]=\"config.searchIconClass\"></mat-icon>\n <mat-icon\n *ngIf=\"searchBoxInput\"\n matSuffix\n [className]=\"config.crossIconClass\"\n (click)=\"resetInput()\"\n ></mat-icon>\n </mat-form-field>\n \n <mat-form-field appearance=\"outline\" class=\"toolbar-search-select\">\n <mat-icon matSuffix [className]=\"config.dropDownButtonIconClass\"></mat-icon>\n <mat-select\n [value]=\"category\"\n (selectionChange)=\"setCategory($event.value)\"\n panelClass=\"search-select\"\n >\n <mat-option [value]=\"model.name\" *ngFor=\"let model of config.models\">\n {{ model.displayName }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n</ng-container>\n\n<div class=\"search-container\">\n <div\n *ngIf=\"suggestionsDisplay && (recentSearches.length || suggestions.length)\"\n class=\"search-popup\"\n >\n <ng-container *ngIf=\"searchBoxInput\">\n <span *ngIf=\"suggestions.length === 0\" class=\"search-message\">\n <ng-container *ngIf=\"searching\"> searching... </ng-container>\n <ng-container *ngIf=\"!searching\">\n {{ config.noResultMessage }}\n </ng-container>\n </span>\n <ng-container *ngIf=\"config.categorizeResults && suggestions.length\">\n <div\n class=\"search-result\"\n *ngFor=\"let modelWithSuggestions of getModelsWithSuggestions()\"\n >\n <h3 class=\"suggestions-heading\">\n <img\n *ngIf=\"modelWithSuggestions.model.imageUrl\"\n [src]=\"modelWithSuggestions.model.imageUrl\"\n [alt]=\"modelWithSuggestions.model.displayName\"\n />\n {{ modelWithSuggestions.model.displayName }} ({{\n modelWithSuggestions.items.length\n }})\n </h3>\n <ul>\n <li\n *ngFor=\"let suggestion of modelWithSuggestions.items\"\n (mousedown)=\"populateValue(suggestion, $event)\"\n class=\"suggestions\"\n >\n <ng-container *ngIf=\"subtitleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n subtitleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n <p\n *ngIf=\"!titleTemplate\"\n [innerHTML]=\"\n boldString(\n suggestion[config.displayPropertyName],\n searchBoxInput\n )\n \"\n style=\"display: inline\"\n ></p>\n <ng-container *ngIf=\"titleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n titleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n </li>\n </ul>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!config.categorizeResults\">\n <div class=\"search-result\">\n <ul>\n <li\n *ngFor=\"let suggestion of suggestions\"\n (mousedown)=\"populateValue(suggestion, $event)\"\n >\n <!--Need to call fetchModelImageUrlFromSuggestion as each suggestion can come from different model-->\n <img\n *ngIf=\"\n !titleTemplate && fetchModelImageUrlFromSuggestion(suggestion)\n \"\n class=\"suggestions-categorize-false\"\n [src]=\"fetchModelImageUrlFromSuggestion(suggestion)\"\n style=\"margin-right: 5px\"\n alt=\"Img\"\n />\n <ng-container *ngIf=\"subtitleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n subtitleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n <p\n *ngIf=\"!titleTemplate\"\n [innerHTML]=\"\n boldString(\n suggestion[config.displayPropertyName],\n searchBoxInput\n )\n \"\n style=\"display: inline\"\n ></p>\n <ng-container *ngIf=\"titleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n titleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n </li>\n </ul>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"!config.hideRecentSearch && recentSearches.length > 0\">\n <div class=\"recent-searches\">\n <h3 class=\"suggestions-heading\">Recent Searches</h3>\n <ul>\n <li\n *ngFor=\"let recentSearch of recentSearches\"\n class=\"suggestions\"\n (mousedown)=\"populateValueRecentSearch(recentSearch, $event)\"\n >\n <mat-icon\n matPrefix\n [className]=\"config.recentSearchIconClass\"\n ></mat-icon>\n\n <span>&nbsp;{{ recentSearch.match }}</span>\n </li>\n </ul>\n </div>\n </ng-container>\n </div>\n</div>\n", styles: [":host ::ng-deep .mat-form-field-wrapper{padding:0}:host ::ng-deep .mat-form-field-wrapper .mat-form-field-prefix{margin-right:12px}.toolbar-search-input{width:86%}.toolbar-search-input ::ng-deep input{margin:0}.toolbar-search-input ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-start{border-color:transparent}.toolbar-search-input ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-end{border:none;border-radius:0}.icomoon.Search,.icomoon.close{height:1rem;width:1rem;font-size:1rem;color:#33333380;padding-bottom:4px}.icomoon.close{cursor:pointer}.toolbar-search-select{width:14%}.toolbar-search-select ::ng-deep .mat-select-arrow{opacity:0}.toolbar-search-select ::ng-deep .mat-select-arrow-wrapper{display:inline-block;width:1px}.toolbar-search-select ::ng-deep .mat-select-value-text{font-size:9px}.toolbar-search-select ::ng-deep .mat-form-field-suffix .mat-icon{width:12px;font-size:14px}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-start{border-color:transparent;border-radius:0}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-end{border:none}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-infix{-webkit-padding-before:.7em}.toolbar-search{width:515px;background-color:#f7f7f7;border-radius:0 0 4px 4px}.toolbar-search ::ng-deep .mat-form-field-appearance-outline .mat-form-field-flex{height:39px;align-items:center}.toolbar-search ::ng-deep .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}.toolbar-search ::ng-deep .mat-form-field-infix{height:auto}.search-container{position:relative;width:515px}.search-container .search-popup{padding:0 15px 15px;margin:0;max-height:80vh;overflow-x:hidden;overflow-y:auto;position:absolute;top:100%;left:0;right:0;z-index:9999;background-color:#fff;box-shadow:0 5px 4px #0003;border-radius:0 0 4px 4px}.search-container .search-popup hr{border:0;border-top:1px solid #ebebeb;margin:0;position:sticky;top:0;padding:0 0 15px;z-index:1}.search-container .search-popup .search-message{display:inline-block;width:100%;text-align:center;font-size:16px;padding-top:12px}.search-container .search-popup .search-item-info{color:#91263b;text-align:center;font-size:12px;margin-bottom:15px;padding-top:12px}.search-container .search-popup ul{padding:0;margin:0}.search-container .search-popup ul li{list-style:none;font-size:1rem;font-weight:400;line-height:1.5;color:#333}.search-container .search-popup ul li.suggestions{font-size:15px;line-height:36px;padding:0 15px 0 44px;align-items:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.search-container .search-popup ul li.suggestions:hover{background-color:#fee8e8}.search-container .search-popup ul li.suggestions svg{margin-right:5px}.search-container .search-popup ul li.suggestions-categorize-false:hover{background-color:#fee8e8}.search-container .search-popup .search-result{padding:10px 0 0;margin:0 -15px}.search-container .search-popup .search-result.no-categorize-result ul{width:100%;padding:0;margin:0 0 10px}.search-container .search-popup .search-result.no-categorize-result ul li{font-size:15px;line-height:36px;padding:0 15px 0 31px;display:flex;align-items:center;cursor:pointer}.search-container .search-popup .search-result.no-categorize-result ul li:hover{background-color:#fee8e8}.search-container .search-popup .search-result.no-categorize-result ul li img{width:18px;margin-right:9px}.search-container .search-popup .suggestions-heading{color:#9c9c9c;font-size:14px;font-weight:400;margin:0 0 10px 17px;display:flex;align-items:center;position:relative}.search-container .search-popup .suggestions-heading .show-more{position:absolute;right:20px;color:#d1d1d1;font-size:12px;cursor:pointer;text-decoration:none}.search-container .search-popup .suggestions-heading .show-more :hover{text-decoration:underline}.search-container .search-popup .suggestions-heading img{width:18px;margin-right:9px}.search-container .search-popup .recent-searches{padding:10px 0 0;margin:0 -15px}.search-container .search-popup .recent-searches ul{display:inline-block;width:100%}.search-container .search-popup .recent-searches ul li.suggestions{display:flex}.search-container .search-popup .recent-searches ul li.suggestions span{width:100%;overflow:hidden;text-overflow:ellipsis}.search-container .search-popup .recent-searches .suggestions{display:flex}.search-container .search-popup .recent-searches .suggestions-heading{margin-left:30px}.search-container .search-popup .recent-searches li.suggestions{padding-left:31px}::ng-deep .search-select.mat-select-panel{margin-top:30px;margin-left:10px}::ng-deep .search-select .mat-option-text{display:contents}::ng-deep .toolbar-search .mat-form-field-infix{font-size:14px}::ng-deep .toolbar-search input{line-height:14px}::ng-deep .toolbar-search .mat-form-field-outline:first-child .mat-form-field-outline-start,::ng-deep .toolbar-search .mat-form-field-outline:first-child .mat-form-field-outline-end{background-color:#f1f3f4}::ng-deep .toolbar-search:hover .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-width:1px;border-color:#a53159}::ng-deep .toolbar-search:hover .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border:1px solid #a53159;border-left-style:none;border-right-style:none;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-radius:0;border-color:transparent;background-color:#a53159}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border-width:1px;border-color:#a53159;background-color:#a53159}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-select{color:#fff}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .icomoon.arrow_down{color:#fff}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-width:2px;border-color:#90003b}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border:2px solid #90003b;border-left-style:none;border-right-style:none;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-radius:0;border-color:transparent;background-color:#90003b}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border-width:2px;border-color:#90003b;background-color:#90003b}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-select{color:#fff}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .icomoon.arrow_down{color:#fff}::ng-deep .toolbar-search .mat-select-arrow{opacity:0}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i9.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i9.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }] });
396
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SearchComponent, decorators: [{
410
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchComponent, decorators: [{
397
411
  type: Component,
398
412
  args: [{ selector: 'sourceloop-search', providers: [
399
413
  {
@@ -402,7 +416,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
402
416
  multi: true,
403
417
  },
404
418
  ], template: "<ng-container *ngIf=\"!showOnlySearchResultOverlay\">\n <div fxLayout fxLayoutAlign=\"start center\" class=\"toolbar-search\" *ngIf=\"config\">\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-input\">\n <input\n matInput\n autocomplete=\"off\"\n type=\"text\"\n [placeholder]=\"\n config.placeholderFunction\n ? config.placeholderFunction(searchInput.value, category)\n : config.placeholder || 'Search'\n \"\n #searchInput\n name=\"searchInput\"\n (focus)=\"showSuggestions()\"\n (blur)=\"hideSuggestions()\"\n [(ngModel)]=\"searchBoxInput\"\n (keyup)=\"hitSearchApi($event)\"\n placeholder=\"Search\"\n (ngModelChange)=\"onChange(this.searchBoxInput)\"\n [disabled]=\"disabled\"\n />\n <mat-icon matPrefix [className]=\"config.searchIconClass\"></mat-icon>\n <mat-icon\n *ngIf=\"searchBoxInput\"\n matSuffix\n [className]=\"config.crossIconClass\"\n (click)=\"resetInput()\"\n ></mat-icon>\n </mat-form-field>\n \n <mat-form-field appearance=\"outline\" class=\"toolbar-search-select\">\n <mat-icon matSuffix [className]=\"config.dropDownButtonIconClass\"></mat-icon>\n <mat-select\n [value]=\"category\"\n (selectionChange)=\"setCategory($event.value)\"\n panelClass=\"search-select\"\n >\n <mat-option [value]=\"model.name\" *ngFor=\"let model of config.models\">\n {{ model.displayName }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n</ng-container>\n\n<div class=\"search-container\">\n <div\n *ngIf=\"suggestionsDisplay && (recentSearches.length || suggestions.length)\"\n class=\"search-popup\"\n >\n <ng-container *ngIf=\"searchBoxInput\">\n <span *ngIf=\"suggestions.length === 0\" class=\"search-message\">\n <ng-container *ngIf=\"searching\"> searching... </ng-container>\n <ng-container *ngIf=\"!searching\">\n {{ config.noResultMessage }}\n </ng-container>\n </span>\n <ng-container *ngIf=\"config.categorizeResults && suggestions.length\">\n <div\n class=\"search-result\"\n *ngFor=\"let modelWithSuggestions of getModelsWithSuggestions()\"\n >\n <h3 class=\"suggestions-heading\">\n <img\n *ngIf=\"modelWithSuggestions.model.imageUrl\"\n [src]=\"modelWithSuggestions.model.imageUrl\"\n [alt]=\"modelWithSuggestions.model.displayName\"\n />\n {{ modelWithSuggestions.model.displayName }} ({{\n modelWithSuggestions.items.length\n }})\n </h3>\n <ul>\n <li\n *ngFor=\"let suggestion of modelWithSuggestions.items\"\n (mousedown)=\"populateValue(suggestion, $event)\"\n class=\"suggestions\"\n >\n <ng-container *ngIf=\"subtitleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n subtitleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n <p\n *ngIf=\"!titleTemplate\"\n [innerHTML]=\"\n boldString(\n suggestion[config.displayPropertyName],\n searchBoxInput\n )\n \"\n style=\"display: inline\"\n ></p>\n <ng-container *ngIf=\"titleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n titleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n </li>\n </ul>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!config.categorizeResults\">\n <div class=\"search-result\">\n <ul>\n <li\n *ngFor=\"let suggestion of suggestions\"\n (mousedown)=\"populateValue(suggestion, $event)\"\n >\n <!--Need to call fetchModelImageUrlFromSuggestion as each suggestion can come from different model-->\n <img\n *ngIf=\"\n !titleTemplate && fetchModelImageUrlFromSuggestion(suggestion)\n \"\n class=\"suggestions-categorize-false\"\n [src]=\"fetchModelImageUrlFromSuggestion(suggestion)\"\n style=\"margin-right: 5px\"\n alt=\"Img\"\n />\n <ng-container *ngIf=\"subtitleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n subtitleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n <p\n *ngIf=\"!titleTemplate\"\n [innerHTML]=\"\n boldString(\n suggestion[config.displayPropertyName],\n searchBoxInput\n )\n \"\n style=\"display: inline\"\n ></p>\n <ng-container *ngIf=\"titleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n titleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n </li>\n </ul>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"!config.hideRecentSearch && recentSearches.length > 0\">\n <div class=\"recent-searches\">\n <h3 class=\"suggestions-heading\">Recent Searches</h3>\n <ul>\n <li\n *ngFor=\"let recentSearch of recentSearches\"\n class=\"suggestions\"\n (mousedown)=\"populateValueRecentSearch(recentSearch, $event)\"\n >\n <mat-icon\n matPrefix\n [className]=\"config.recentSearchIconClass\"\n ></mat-icon>\n\n <span>&nbsp;{{ recentSearch.match }}</span>\n </li>\n </ul>\n </div>\n </ng-container>\n </div>\n</div>\n", styles: [":host ::ng-deep .mat-form-field-wrapper{padding:0}:host ::ng-deep .mat-form-field-wrapper .mat-form-field-prefix{margin-right:12px}.toolbar-search-input{width:86%}.toolbar-search-input ::ng-deep input{margin:0}.toolbar-search-input ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-start{border-color:transparent}.toolbar-search-input ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-end{border:none;border-radius:0}.icomoon.Search,.icomoon.close{height:1rem;width:1rem;font-size:1rem;color:#33333380;padding-bottom:4px}.icomoon.close{cursor:pointer}.toolbar-search-select{width:14%}.toolbar-search-select ::ng-deep .mat-select-arrow{opacity:0}.toolbar-search-select ::ng-deep .mat-select-arrow-wrapper{display:inline-block;width:1px}.toolbar-search-select ::ng-deep .mat-select-value-text{font-size:9px}.toolbar-search-select ::ng-deep .mat-form-field-suffix .mat-icon{width:12px;font-size:14px}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-start{border-color:transparent;border-radius:0}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-end{border:none}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-infix{-webkit-padding-before:.7em}.toolbar-search{width:515px;background-color:#f7f7f7;border-radius:0 0 4px 4px}.toolbar-search ::ng-deep .mat-form-field-appearance-outline .mat-form-field-flex{height:39px;align-items:center}.toolbar-search ::ng-deep .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}.toolbar-search ::ng-deep .mat-form-field-infix{height:auto}.search-container{position:relative;width:515px}.search-container .search-popup{padding:0 15px 15px;margin:0;max-height:80vh;overflow-x:hidden;overflow-y:auto;position:absolute;top:100%;left:0;right:0;z-index:9999;background-color:#fff;box-shadow:0 5px 4px #0003;border-radius:0 0 4px 4px}.search-container .search-popup hr{border:0;border-top:1px solid #ebebeb;margin:0;position:sticky;top:0;padding:0 0 15px;z-index:1}.search-container .search-popup .search-message{display:inline-block;width:100%;text-align:center;font-size:16px;padding-top:12px}.search-container .search-popup .search-item-info{color:#91263b;text-align:center;font-size:12px;margin-bottom:15px;padding-top:12px}.search-container .search-popup ul{padding:0;margin:0}.search-container .search-popup ul li{list-style:none;font-size:1rem;font-weight:400;line-height:1.5;color:#333}.search-container .search-popup ul li.suggestions{font-size:15px;line-height:36px;padding:0 15px 0 44px;align-items:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.search-container .search-popup ul li.suggestions:hover{background-color:#fee8e8}.search-container .search-popup ul li.suggestions svg{margin-right:5px}.search-container .search-popup ul li.suggestions-categorize-false:hover{background-color:#fee8e8}.search-container .search-popup .search-result{padding:10px 0 0;margin:0 -15px}.search-container .search-popup .search-result.no-categorize-result ul{width:100%;padding:0;margin:0 0 10px}.search-container .search-popup .search-result.no-categorize-result ul li{font-size:15px;line-height:36px;padding:0 15px 0 31px;display:flex;align-items:center;cursor:pointer}.search-container .search-popup .search-result.no-categorize-result ul li:hover{background-color:#fee8e8}.search-container .search-popup .search-result.no-categorize-result ul li img{width:18px;margin-right:9px}.search-container .search-popup .suggestions-heading{color:#9c9c9c;font-size:14px;font-weight:400;margin:0 0 10px 17px;display:flex;align-items:center;position:relative}.search-container .search-popup .suggestions-heading .show-more{position:absolute;right:20px;color:#d1d1d1;font-size:12px;cursor:pointer;text-decoration:none}.search-container .search-popup .suggestions-heading .show-more :hover{text-decoration:underline}.search-container .search-popup .suggestions-heading img{width:18px;margin-right:9px}.search-container .search-popup .recent-searches{padding:10px 0 0;margin:0 -15px}.search-container .search-popup .recent-searches ul{display:inline-block;width:100%}.search-container .search-popup .recent-searches ul li.suggestions{display:flex}.search-container .search-popup .recent-searches ul li.suggestions span{width:100%;overflow:hidden;text-overflow:ellipsis}.search-container .search-popup .recent-searches .suggestions{display:flex}.search-container .search-popup .recent-searches .suggestions-heading{margin-left:30px}.search-container .search-popup .recent-searches li.suggestions{padding-left:31px}::ng-deep .search-select.mat-select-panel{margin-top:30px;margin-left:10px}::ng-deep .search-select .mat-option-text{display:contents}::ng-deep .toolbar-search .mat-form-field-infix{font-size:14px}::ng-deep .toolbar-search input{line-height:14px}::ng-deep .toolbar-search .mat-form-field-outline:first-child .mat-form-field-outline-start,::ng-deep .toolbar-search .mat-form-field-outline:first-child .mat-form-field-outline-end{background-color:#f1f3f4}::ng-deep .toolbar-search:hover .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-width:1px;border-color:#a53159}::ng-deep .toolbar-search:hover .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border:1px solid #a53159;border-left-style:none;border-right-style:none;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-radius:0;border-color:transparent;background-color:#a53159}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border-width:1px;border-color:#a53159;background-color:#a53159}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-select{color:#fff}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .icomoon.arrow_down{color:#fff}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-width:2px;border-color:#90003b}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border:2px solid #90003b;border-left-style:none;border-right-style:none;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-radius:0;border-color:transparent;background-color:#90003b}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border-width:2px;border-color:#90003b;background-color:#90003b}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-select{color:#fff}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .icomoon.arrow_down{color:#fff}::ng-deep .toolbar-search .mat-select-arrow{opacity:0}\n"] }]
405
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
419
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
406
420
  type: Inject,
407
421
  args: [SEARCH_SERVICE_TOKEN]
408
422
  }, {
@@ -410,7 +424,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
410
424
  }] }, { type: Object, decorators: [{
411
425
  type: Inject,
412
426
  args: [PLATFORM_ID]
413
- }] }, { type: i0.ChangeDetectorRef }, { type: PromiseApiAdapterService }]; }, propDecorators: { config: [{
427
+ }] }, { type: i0.ChangeDetectorRef }, { type: PromiseApiAdapterService }], propDecorators: { config: [{
414
428
  type: Input
415
429
  }], searchProvider: [{
416
430
  type: Input
@@ -434,26 +448,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
434
448
  }] } });
435
449
 
436
450
  // Copyright (c) 2023 Sourcefuse Technologies
451
+ //
452
+ // This software is released under the MIT License.
453
+ // https://opensource.org/licenses/MIT
437
454
  class SearchLibModule {
455
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchLibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
456
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: SearchLibModule, declarations: [SearchComponent], imports: [CommonModule,
457
+ FormsModule,
458
+ HttpClientModule,
459
+ MatSelectModule,
460
+ MatFormFieldModule,
461
+ MatIconModule,
462
+ MatInputModule,
463
+ FlexLayoutModule], exports: [SearchComponent] });
464
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchLibModule, imports: [CommonModule,
465
+ FormsModule,
466
+ HttpClientModule,
467
+ MatSelectModule,
468
+ MatFormFieldModule,
469
+ MatIconModule,
470
+ MatInputModule,
471
+ FlexLayoutModule] });
438
472
  }
439
- SearchLibModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SearchLibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
440
- SearchLibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SearchLibModule, declarations: [SearchComponent], imports: [CommonModule,
441
- FormsModule,
442
- HttpClientModule,
443
- MatSelectModule,
444
- MatFormFieldModule,
445
- MatIconModule,
446
- MatInputModule,
447
- FlexLayoutModule], exports: [SearchComponent] });
448
- SearchLibModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SearchLibModule, imports: [CommonModule,
449
- FormsModule,
450
- HttpClientModule,
451
- MatSelectModule,
452
- MatFormFieldModule,
453
- MatIconModule,
454
- MatInputModule,
455
- FlexLayoutModule] });
456
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SearchLibModule, decorators: [{
473
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchLibModule, decorators: [{
457
474
  type: NgModule,
458
475
  args: [{
459
476
  declarations: [SearchComponent],
@@ -472,6 +489,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
472
489
  }] });
473
490
 
474
491
  class Configuration {
492
+ /** property to be displayed in the results */
493
+ displayPropertyName;
494
+ /** list of model configuration to be render and categorize search results */
495
+ models;
496
+ /** max number of results (based on limitByType option) */
497
+ limit;
498
+ /** apply limit on individual models, or on overall results */
499
+ limitByType;
500
+ /** apply a particular ordering on results */
501
+ order;
502
+ /** offset for results in case limit is used */
503
+ offset;
504
+ /** save the search query in recent history */
505
+ saveInRecents;
506
+ /** a placeholder to display in the search box */
507
+ placeholder;
508
+ /** a function to generate placeholder, overrides the placeholder property */
509
+ placeholderFunction;
510
+ /** categorize results on the basis of models provided */
511
+ categorizeResults;
512
+ /** hides the recent search list */
513
+ hideRecentSearch;
514
+ /** hide the category selection button */
515
+ hideCategorizeButton;
516
+ /** save value in recent search only on enter or change in category,
517
+ * if false, also saved on typing */
518
+ saveInRecentsOnlyOnEnter;
519
+ /** search only on enter key or when category is changed */
520
+ searchOnlyOnEnter;
521
+ noResultMessage;
522
+ searchIconClass;
523
+ crossIconClass;
524
+ dropDownButtonIconClass;
525
+ recentSearchIconClass;
475
526
  constructor(d) {
476
527
  checkForError(d);
477
528
  this.displayPropertyName = d.displayPropertyName;
@@ -535,6 +586,12 @@ function setIconClasses(d) {
535
586
  }
536
587
 
537
588
  // Copyright (c) 2023 Sourcefuse Technologies
589
+ //
590
+ // This software is released under the MIT License.
591
+ // https://opensource.org/licenses/MIT
592
+ /*
593
+ * Public API Surface of my-lib
594
+ */
538
595
 
539
596
  /**
540
597
  * Generated bundle index. Do not edit.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceloop-search-client.mjs","sources":["../../src/lib/types.ts","../../src/lib/search/promise-api-adapter.service.ts","../../src/lib/search/search.component.ts","../../src/lib/search/search.component.html","../../src/lib/search-lib.module.ts","../../src/lib/lib-configuration.ts","../../src/public-api.ts","../../src/sourceloop-search-client.ts"],"sourcesContent":["// Copyright (c) 2023 Sourcefuse Technologies\n//\n// This software is released under the MIT License.\n// https://opensource.org/licenses/MIT\nimport {InjectionToken} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nexport interface ISearchQuery {\n match: string;\n limit: number | null;\n order: string | null;\n limitByType: boolean | null;\n offset: number | null;\n sources: string[] | null;\n}\nexport interface IModel {\n name: string;\n displayName: string;\n imageUrl?: string;\n icon?: string;\n}\nexport interface IReturnType {\n rank: number;\n source: string;\n}\nexport interface IDefaultReturnType extends IReturnType {\n name: string;\n description: string;\n}\n\nexport interface ISearchService<T extends IReturnType> {\n searchApiRequest(\n requestParameters: ISearchQuery,\n saveInRecents: boolean,\n ): Observable<T[]>;\n recentSearchApiRequest?(): Observable<ISearchQuery[]>;\n}\n\nexport interface ISearchServiceWithPromises<T extends IReturnType> {\n searchApiRequestWithPromise(\n requestParameters: ISearchQuery,\n saveInRecents: boolean,\n ): Promise<T[]>;\n recentSearchApiRequestWithPromise?(): Promise<ISearchQuery[]>;\n}\n\nexport function isApiServiceWithPromise(\n service:\n | ISearchService<IReturnType>\n | ISearchServiceWithPromises<IReturnType>,\n): service is ISearchServiceWithPromises<IReturnType> {\n return !!(service as ISearchServiceWithPromises<IReturnType>)\n .searchApiRequestWithPromise;\n}\n\n// cant use T extends IReturnType here\nexport const SEARCH_SERVICE_TOKEN: InjectionToken<ISearchService<IReturnType>> =\n new InjectionToken<ISearchService<IReturnType>>('Search_Service_Token');\n\nexport type RecentSearchEvent = {\n event?: Event;\n keyword: string;\n category: string;\n};\n\nexport type ItemClickedEvent<T> = {\n event: MouseEvent;\n item: T;\n};\n\nexport type TypeEvent = {\n event?: Event;\n input: string;\n};\n// IRequestParameters default values\nexport const DEFAULT_LIMIT = 20;\nexport const DEFAULT_LIMIT_TYPE = false;\nexport const DEFAULT_ORDER = [];\nexport const DEBOUNCE_TIME = 1000;\nexport const DEFAULT_OFFSET = 0;\nexport const DEFAULT_SAVE_IN_RECENTS = true;\nexport type CustomSearchEvent = {\n searchValue: string;\n modelName: string;\n};\n","import {Injectable} from '@angular/core';\nimport {from} from 'rxjs';\nimport {\n IReturnType,\n ISearchService,\n ISearchServiceWithPromises,\n} from '../types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PromiseApiAdapterService<T extends IReturnType> {\n adapt(instance: ISearchServiceWithPromises<T>): ISearchService<T> {\n // this is a workaround for the fact that the recentSearchApiRequestWithPromise\n // method is optional in the ISearchServiceWithPromises interface\n // and type system is not able maintain the type information of a property\n const recentSearchMethod = instance.recentSearchApiRequestWithPromise;\n return {\n searchApiRequest: (requestParameters, saveInRecents) =>\n from(\n instance.searchApiRequestWithPromise(\n requestParameters,\n saveInRecents,\n ),\n ),\n ...(recentSearchMethod && {\n recentSearchApiRequest: () => from(recentSearchMethod()),\n }),\n };\n }\n}\n","// Copyright (c) 2023 Sourcefuse Technologies\n//\n// This software is released under the MIT License.\n// https://opensource.org/licenses/MIT\nimport {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n PLATFORM_ID,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {Configuration} from '../lib-configuration';\nimport {Subject} from 'rxjs';\nimport {debounceTime, tap} from 'rxjs/operators';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {\n CustomSearchEvent,\n ISearchService,\n ISearchQuery,\n SEARCH_SERVICE_TOKEN,\n DEBOUNCE_TIME,\n DEFAULT_LIMIT,\n DEFAULT_LIMIT_TYPE,\n DEFAULT_OFFSET,\n DEFAULT_SAVE_IN_RECENTS,\n DEFAULT_ORDER,\n IReturnType,\n RecentSearchEvent,\n TypeEvent,\n ItemClickedEvent,\n IModel,\n ISearchServiceWithPromises,\n isApiServiceWithPromise,\n} from '../types';\nimport {isPlatformBrowser} from '@angular/common';\nimport {PromiseApiAdapterService} from './promise-api-adapter.service';\n\nconst ALL_LABEL = 'All';\n@Component({\n selector: 'sourceloop-search',\n templateUrl: './search.component.html',\n styleUrls: ['./search.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: SearchComponent,\n multi: true,\n },\n ],\n})\nexport class SearchComponent<T extends IReturnType>\n implements OnInit, OnDestroy, ControlValueAccessor\n{\n searchBoxInput = '';\n suggestionsDisplay = false;\n categoryDisplay = false;\n searching = false;\n suggestions: T[] = [];\n recentSearches: ISearchQuery[] = [];\n category: string = ALL_LABEL;\n searchRequest$ = new Subject<{input: string; event: Event}>();\n\n private _config!: Configuration<T>;\n public get config(): Configuration<T> {\n return this._config;\n }\n\n @Input()\n public set config(value: Configuration<T>) {\n this._config = value;\n\n if (value && value.models) {\n value.models.unshift({\n name: ALL_LABEL,\n displayName: this.customAllLabel ?? ALL_LABEL,\n });\n } else if (value && !value.models) {\n value.models = [\n {\n name: ALL_LABEL,\n displayName: this.customAllLabel ?? ALL_LABEL,\n },\n ];\n } else {\n // do nothing\n }\n }\n\n @Input()\n public set searchProvider(\n value: ISearchService<T> | ISearchServiceWithPromises<T>,\n ) {\n if (isApiServiceWithPromise(value)) {\n value = this.promiseAdapter.adapt(value);\n }\n this.searchService = value;\n }\n\n public get searchProvider(): ISearchService<T> {\n return this.searchService;\n }\n\n @Input() titleTemplate?: TemplateRef<any>;\n @Input() subtitleTemplate?: TemplateRef<any>;\n /**\n * configure when application has own search input and use different all label\n */\n @Input() customAllLabel = ALL_LABEL;\n /**\n * configure to true when to show only search result overlay without search bar\n */\n @Input() showOnlySearchResultOverlay = false;\n /**\n * provide custom search event when showOnlySearchResultOverlay configure to true\n */\n @Input() customSearchEvent: CustomSearchEvent = {\n searchValue: '',\n modelName: this.customAllLabel,\n };\n // emitted when user clicks one of the suggested results (including recent search sugestions)\n @Output() clicked = new EventEmitter<ItemClickedEvent<T>>();\n @Output() searched = new EventEmitter<RecentSearchEvent>();\n /* emitted when user makes search request (including recent search requests\n & requests made on change in category from dropdown)\n In case of recent search Array of recent Search request result is emitted */\n\n onChange: (value: string | undefined) => void = () => {};\n onTouched: () => void = () => {};\n disabled = false;\n\n @ViewChild('searchInput') public searchInputElement!: ElementRef;\n\n constructor(\n @Inject(SEARCH_SERVICE_TOKEN)\n @Optional()\n private searchService: ISearchService<T>,\n // tslint:disable-next-line:ban-types\n @Inject(PLATFORM_ID)\n private readonly platformId: Object,\n private readonly cdr: ChangeDetectorRef,\n private readonly promiseAdapter: PromiseApiAdapterService<T>,\n ) {}\n\n ngOnInit(): void {\n this.searchRequest$\n .pipe(\n tap(v => (this.suggestions = [])),\n debounceTime(DEBOUNCE_TIME),\n )\n .subscribe((value: TypeEvent) => {\n this.searched.emit({\n event: value.event,\n keyword: value.input,\n category: this.category,\n });\n this.getSuggestions(value);\n this.cdr.markForCheck();\n });\n }\n\n // ControlValueAccessor Implementation\n writeValue(value: string): void {\n this.searchBoxInput = value;\n }\n // When the value in the UI is changed, this method will invoke a callback function\n registerOnChange(fn: (value: string | undefined) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState?(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n getSuggestions(eventValue: TypeEvent) {\n eventValue.input = eventValue.input.trim();\n if (!eventValue.input.length) {\n return;\n }\n const order = this.config.order ?? DEFAULT_ORDER;\n let orderString = '';\n order.forEach(preference => (orderString = `${orderString}${preference} `));\n\n let saveInRecents = this.config.saveInRecents ?? DEFAULT_SAVE_IN_RECENTS;\n if (this.config.saveInRecents && this.config.saveInRecentsOnlyOnEnter) {\n if (\n !eventValue.event ||\n (eventValue.event instanceof KeyboardEvent &&\n eventValue.event.key === 'Enter')\n ) {\n saveInRecents = true; // save in recents only on enter or change in category\n } else {\n // do not save in recent search on typing\n saveInRecents = false;\n }\n }\n /* need to put default value here and not in contructor\n because sonar was giving code smell with definite assertion as all these\n parameters are optional */\n const requestParameters: ISearchQuery = {\n match: eventValue.input,\n sources: this._categoryToSourceName(this.category),\n limit: this.config.limit ?? DEFAULT_LIMIT,\n limitByType: this.config.limitByType ?? DEFAULT_LIMIT_TYPE,\n order: orderString,\n offset: this.config.offset ?? DEFAULT_OFFSET,\n };\n\n this.searching = true;\n this.cdr.markForCheck();\n this.searchService\n .searchApiRequest(requestParameters, saveInRecents)\n .subscribe(\n (value: T[]) => {\n this.suggestions = value;\n this.searching = false;\n this.cdr.markForCheck();\n },\n (_error: Error) => {\n this.suggestions = [];\n this.searching = false;\n this.cdr.markForCheck();\n },\n );\n }\n getRecentSearches() {\n if (\n !this.config.hideRecentSearch &&\n this.searchService.recentSearchApiRequest\n ) {\n this.searchService.recentSearchApiRequest().subscribe(\n (value: ISearchQuery[]) => {\n this.recentSearches = value;\n this.cdr.markForCheck();\n },\n (_error: Error) => {\n this.recentSearches = [];\n this.cdr.markForCheck();\n },\n );\n }\n }\n\n //event can be KeyBoardEvent or Event of type 'change'\n // fired on change in value of drop down for category\n\n hitSearchApi(event?: Event) {\n // this will happen only in case user searches something and\n // then erases it, we need to update recent search\n if (!this.searchBoxInput) {\n this.suggestions = [];\n this.getRecentSearches();\n return;\n }\n\n // no debounce time needed in case of searchOnlyOnEnter\n if (this.config.searchOnlyOnEnter) {\n if (!event || (event instanceof KeyboardEvent && event.key === 'Enter')) {\n this.getSuggestions({input: this.searchBoxInput, event});\n }\n return;\n }\n\n // no debounce time needed in case of change in category\n if (!event) {\n this.getSuggestions({input: this.searchBoxInput, event});\n return;\n }\n\n this.searchRequest$.next({\n input: this.searchBoxInput,\n event,\n });\n }\n\n populateValue(suggestion: T, event: MouseEvent) {\n const value = suggestion[\n this.config.displayPropertyName\n ] as unknown as string;\n // converted to string to assign value to searchBoxInput\n this.searchBoxInput = value;\n this.suggestionsDisplay = false;\n // ngModelChange doesn't detect change in value\n // when populated from outside, hence calling manually\n this.onChange(this.searchBoxInput);\n // need to do this to show more search options for selected\n //suggestion - just in case user reopens search input\n this.getSuggestions({input: this.searchBoxInput, event});\n this.clicked.emit({item: suggestion, event});\n }\n populateValueRecentSearch(recentSearch: ISearchQuery, event: MouseEvent) {\n event.stopPropagation();\n event.preventDefault();\n const value = recentSearch['match'];\n this.searchBoxInput = value;\n this.suggestionsDisplay = false;\n this.onChange(this.searchBoxInput);\n // need to do this to show more search options for selected\n // suggestion - just in case user reopens search input\n this.getSuggestions({input: this.searchBoxInput, event});\n this.focusInput();\n this.showSuggestions();\n }\n\n fetchModelImageUrlFromSuggestion(suggestion: T) {\n const modelName = suggestion[\n 'source' as unknown as keyof T\n ] as unknown as string;\n let url: string | undefined;\n this.config.models.forEach(model => {\n if (model.name === modelName && model.imageUrl) {\n url = model.imageUrl;\n }\n });\n return url;\n }\n\n boldString(str: T[keyof T] | string, substr: string) {\n const strRegExp = new RegExp(`(${substr})`, 'gi');\n const stringToMakeBold: string = str as unknown as string;\n return stringToMakeBold.replace(strRegExp, `<b>$1</b>`);\n }\n\n hideSuggestions() {\n this.suggestionsDisplay = false;\n this.onTouched();\n }\n\n showSuggestions() {\n this.suggestionsDisplay = true;\n this.getRecentSearches();\n }\n\n focusInput() {\n if (\n isPlatformBrowser(this.platformId) &&\n !this.showOnlySearchResultOverlay\n ) {\n this.searchInputElement.nativeElement.focus();\n }\n }\n\n setCategory(category: string) {\n this.category = category;\n this.categoryDisplay = false;\n if (this.searchBoxInput) {\n this.hitSearchApi();\n this.focusInput();\n this.showSuggestions();\n }\n }\n\n showCategory() {\n this.categoryDisplay = !this.categoryDisplay;\n }\n\n hideCategory() {\n this.categoryDisplay = false;\n }\n\n resetInput() {\n this.searchBoxInput = '';\n this.suggestions = [];\n this.suggestionsDisplay = true;\n this.focusInput();\n // ngModelChange doesn't detect change in value\n // when populated from outside, hence calling manually\n this.onChange(this.searchBoxInput);\n this.getRecentSearches();\n }\n ngOnDestroy() {\n this.searchRequest$.unsubscribe();\n }\n\n _categoryToSourceName(category: string) {\n if ([ALL_LABEL, this.customAllLabel].includes(category)) {\n return [];\n } else {\n return [category];\n }\n }\n getModelFromModelName(name: string) {\n return this.config.models.find(item => item.name === name) as IModel;\n }\n getModelsWithSuggestions() {\n const modelsWithSuggestions: {model: IModel; items: T[]}[] = [];\n const sources: string[] = [];\n this.suggestions.forEach(suggestion => {\n if (sources.indexOf(suggestion['source']) >= 0) {\n modelsWithSuggestions.every(modelWithSuggestions => {\n if (modelWithSuggestions.model.name === suggestion['source']) {\n modelWithSuggestions.items.push(suggestion);\n return false;\n }\n return true;\n });\n } else {\n const model = this.getModelFromModelName(suggestion['source']);\n modelsWithSuggestions.push({model, items: [suggestion]});\n sources.push(suggestion['source']);\n }\n });\n return modelsWithSuggestions;\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.customSearchEvent) {\n if (this._isCustomSearchEventChange(changes, 'searchValue')) {\n this.searchBoxInput = this.customSearchEvent?.searchValue ?? '';\n this.searchOnCustomEventValueChange(this.searchBoxInput);\n }\n if (\n this._isCustomSearchEventChange(changes, 'modelName') &&\n this.customSearchEvent?.modelName\n ) {\n this.setCategory(this.customSearchEvent?.modelName);\n }\n }\n }\n\n searchOnCustomEventValueChange(value: string) {\n if (value?.length) {\n this.showSuggestions();\n this.hitSearchApi();\n } else {\n this.hideSuggestions();\n }\n }\n\n private _isCustomSearchEventChange(\n changes: SimpleChanges,\n propertyName: string,\n ) {\n return (\n !changes.customSearchEvent?.previousValue ||\n changes.customSearchEvent?.previousValue[propertyName] !==\n changes.customSearchEvent?.currentValue[propertyName]\n );\n }\n}\n","<ng-container *ngIf=\"!showOnlySearchResultOverlay\">\n <div fxLayout fxLayoutAlign=\"start center\" class=\"toolbar-search\" *ngIf=\"config\">\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-input\">\n <input\n matInput\n autocomplete=\"off\"\n type=\"text\"\n [placeholder]=\"\n config.placeholderFunction\n ? config.placeholderFunction(searchInput.value, category)\n : config.placeholder || 'Search'\n \"\n #searchInput\n name=\"searchInput\"\n (focus)=\"showSuggestions()\"\n (blur)=\"hideSuggestions()\"\n [(ngModel)]=\"searchBoxInput\"\n (keyup)=\"hitSearchApi($event)\"\n placeholder=\"Search\"\n (ngModelChange)=\"onChange(this.searchBoxInput)\"\n [disabled]=\"disabled\"\n />\n <mat-icon matPrefix [className]=\"config.searchIconClass\"></mat-icon>\n <mat-icon\n *ngIf=\"searchBoxInput\"\n matSuffix\n [className]=\"config.crossIconClass\"\n (click)=\"resetInput()\"\n ></mat-icon>\n </mat-form-field>\n \n <mat-form-field appearance=\"outline\" class=\"toolbar-search-select\">\n <mat-icon matSuffix [className]=\"config.dropDownButtonIconClass\"></mat-icon>\n <mat-select\n [value]=\"category\"\n (selectionChange)=\"setCategory($event.value)\"\n panelClass=\"search-select\"\n >\n <mat-option [value]=\"model.name\" *ngFor=\"let model of config.models\">\n {{ model.displayName }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n</ng-container>\n\n<div class=\"search-container\">\n <div\n *ngIf=\"suggestionsDisplay && (recentSearches.length || suggestions.length)\"\n class=\"search-popup\"\n >\n <ng-container *ngIf=\"searchBoxInput\">\n <span *ngIf=\"suggestions.length === 0\" class=\"search-message\">\n <ng-container *ngIf=\"searching\"> searching... </ng-container>\n <ng-container *ngIf=\"!searching\">\n {{ config.noResultMessage }}\n </ng-container>\n </span>\n <ng-container *ngIf=\"config.categorizeResults && suggestions.length\">\n <div\n class=\"search-result\"\n *ngFor=\"let modelWithSuggestions of getModelsWithSuggestions()\"\n >\n <h3 class=\"suggestions-heading\">\n <img\n *ngIf=\"modelWithSuggestions.model.imageUrl\"\n [src]=\"modelWithSuggestions.model.imageUrl\"\n [alt]=\"modelWithSuggestions.model.displayName\"\n />\n {{ modelWithSuggestions.model.displayName }} ({{\n modelWithSuggestions.items.length\n }})\n </h3>\n <ul>\n <li\n *ngFor=\"let suggestion of modelWithSuggestions.items\"\n (mousedown)=\"populateValue(suggestion, $event)\"\n class=\"suggestions\"\n >\n <ng-container *ngIf=\"subtitleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n subtitleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n <p\n *ngIf=\"!titleTemplate\"\n [innerHTML]=\"\n boldString(\n suggestion[config.displayPropertyName],\n searchBoxInput\n )\n \"\n style=\"display: inline\"\n ></p>\n <ng-container *ngIf=\"titleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n titleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n </li>\n </ul>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!config.categorizeResults\">\n <div class=\"search-result\">\n <ul>\n <li\n *ngFor=\"let suggestion of suggestions\"\n (mousedown)=\"populateValue(suggestion, $event)\"\n >\n <!--Need to call fetchModelImageUrlFromSuggestion as each suggestion can come from different model-->\n <img\n *ngIf=\"\n !titleTemplate && fetchModelImageUrlFromSuggestion(suggestion)\n \"\n class=\"suggestions-categorize-false\"\n [src]=\"fetchModelImageUrlFromSuggestion(suggestion)\"\n style=\"margin-right: 5px\"\n alt=\"Img\"\n />\n <ng-container *ngIf=\"subtitleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n subtitleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n <p\n *ngIf=\"!titleTemplate\"\n [innerHTML]=\"\n boldString(\n suggestion[config.displayPropertyName],\n searchBoxInput\n )\n \"\n style=\"display: inline\"\n ></p>\n <ng-container *ngIf=\"titleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n titleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n </li>\n </ul>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"!config.hideRecentSearch && recentSearches.length > 0\">\n <div class=\"recent-searches\">\n <h3 class=\"suggestions-heading\">Recent Searches</h3>\n <ul>\n <li\n *ngFor=\"let recentSearch of recentSearches\"\n class=\"suggestions\"\n (mousedown)=\"populateValueRecentSearch(recentSearch, $event)\"\n >\n <mat-icon\n matPrefix\n [className]=\"config.recentSearchIconClass\"\n ></mat-icon>\n\n <span>&nbsp;{{ recentSearch.match }}</span>\n </li>\n </ul>\n </div>\n </ng-container>\n </div>\n</div>\n","// Copyright (c) 2023 Sourcefuse Technologies\n//\n// This software is released under the MIT License.\n// https://opensource.org/licenses/MIT\nimport {CommonModule} from '@angular/common';\nimport {HttpClientModule} from '@angular/common/http';\nimport {NgModule} from '@angular/core';\nimport {FlexLayoutModule} from '@angular/flex-layout';\nimport {FormsModule} from '@angular/forms';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatInputModule} from '@angular/material/input';\nimport {MatSelectModule} from '@angular/material/select';\n\nimport {SearchComponent} from './search/search.component';\n\n@NgModule({\n declarations: [SearchComponent],\n imports: [\n CommonModule,\n FormsModule,\n HttpClientModule,\n MatSelectModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n FlexLayoutModule,\n ],\n exports: [SearchComponent],\n})\nexport class SearchLibModule {}\n","// Copyright (c) 2023 Sourcefuse Technologies\n//\n// This software is released under the MIT License.\n// https://opensource.org/licenses/MIT\nimport {IDefaultReturnType, IModel} from './types';\nexport class Configuration<T = IDefaultReturnType> {\n /** property to be displayed in the results */\n displayPropertyName: keyof T;\n /** list of model configuration to be render and categorize search results */\n models: IModel[];\n /** max number of results (based on limitByType option) */\n limit?: number;\n /** apply limit on individual models, or on overall results */\n limitByType?: boolean;\n /** apply a particular ordering on results */\n order?: string[];\n /** offset for results in case limit is used */\n offset?: number;\n /** save the search query in recent history */\n saveInRecents?: boolean;\n /** a placeholder to display in the search box */\n placeholder?: string;\n /** a function to generate placeholder, overrides the placeholder property */\n placeholderFunction?: (input: string, category: string) => string;\n /** categorize results on the basis of models provided */\n categorizeResults?: boolean;\n /** hides the recent search list */\n hideRecentSearch?: boolean;\n /** hide the category selection button */\n hideCategorizeButton?: boolean;\n /** save value in recent search only on enter or change in category,\n * if false, also saved on typing */\n saveInRecentsOnlyOnEnter?: boolean;\n /** search only on enter key or when category is changed */\n searchOnlyOnEnter?: boolean;\n noResultMessage?: string;\n searchIconClass?: string;\n crossIconClass?: string;\n dropDownButtonIconClass?: string;\n recentSearchIconClass?: string;\n\n constructor(d: Configuration<T>) {\n checkForError(d);\n this.displayPropertyName = d.displayPropertyName;\n this.models = d.models;\n\n /* IRequestParameters - will be given default values before call is made in case undefined/null,\n otherwise there ! is used on which sonar gives code smell */\n this.limit = d.limit;\n this.limitByType = d.limitByType;\n this.order = d.order;\n this.offset = d.offset;\n this.saveInRecents = d.saveInRecents;\n\n const displayTexts = setDisplayText(d);\n this.noResultMessage = displayTexts.noResultMessage;\n this.placeholder = displayTexts.placeholder;\n this.placeholderFunction = displayTexts.placeholderFunction;\n\n const searchConfig = setSearchConfig(d);\n this.categorizeResults = searchConfig.categorizeResults;\n this.hideRecentSearch = searchConfig.hideRecentSearch;\n this.hideCategorizeButton = searchConfig.hideCategorizeButton;\n this.saveInRecentsOnlyOnEnter = searchConfig.saveInRecentsOnlyOnEnter;\n this.searchOnlyOnEnter = searchConfig.searchOnlyOnEnter;\n\n const classes = setIconClasses(d);\n this.searchIconClass = classes.searchIconClass;\n this.crossIconClass = classes.crossIconClass;\n this.dropDownButtonIconClass = classes.dropDownButtonIconClass;\n this.recentSearchIconClass = classes.recentSearchIconClass;\n }\n}\nfunction checkForError<T>(d: Configuration<T>) {\n if (\n d.categorizeResults === false &&\n (d.hideCategorizeButton === false || d.hideCategorizeButton === undefined)\n ) {\n throw new Error(\n 'You must provide hideCategorizeButton:true as categorizeResults is false',\n );\n }\n if (d.saveInRecents === false && d.saveInRecentsOnlyOnEnter === true) {\n throw new Error(\n 'You must provide saveInRecents:true for saveInRecentsOnlyOnEnter:true',\n );\n }\n}\nfunction setDisplayText<T>(d: Configuration<T>) {\n return {\n placeholder: d.placeholder ?? 'Search',\n noResultMessage: d.noResultMessage ?? 'No result found',\n placeholderFunction: d.placeholderFunction,\n };\n}\nfunction setSearchConfig<T>(d: Configuration<T>) {\n return {\n categorizeResults: d.categorizeResults ?? true,\n hideRecentSearch: d.hideRecentSearch ?? false,\n hideCategorizeButton: d.hideCategorizeButton ?? false,\n saveInRecentsOnlyOnEnter: d.saveInRecentsOnlyOnEnter ?? false,\n searchOnlyOnEnter: d.searchOnlyOnEnter ?? false,\n };\n}\nfunction setIconClasses<T>(d: Configuration<T>) {\n return {\n searchIconClass: d.searchIconClass ?? 'icomoon Search',\n crossIconClass: d.crossIconClass ?? 'icomoon close',\n dropDownButtonIconClass: d.dropDownButtonIconClass ?? 'icomoon arrow_down',\n recentSearchIconClass: d.recentSearchIconClass ?? 'icomoon Search',\n };\n}\n","// Copyright (c) 2023 Sourcefuse Technologies\n//\n// This software is released under the MIT License.\n// https://opensource.org/licenses/MIT\n/*\n * Public API Surface of my-lib\n */\n\nexport * from './lib/search-lib.module';\nexport * from './lib/search/search.component';\nexport * from './lib/lib-configuration';\nexport * from './lib/types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.PromiseApiAdapterService"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AA2CM,SAAU,uBAAuB,CACrC,OAE2C,EAAA;IAE3C,OAAO,CAAC,CAAE;AACP,SAAA,2BAA2B;AAChC;AAEA;MACa,oBAAoB,GAC/B,IAAI,cAAc,CAA8B,sBAAsB;AAiBxE;AACO,MAAM,aAAa,GAAG;AACtB,MAAM,kBAAkB,GAAG;AAC3B,MAAM,aAAa,GAAG;AACtB,MAAM,aAAa,GAAG;AACtB,MAAM,cAAc,GAAG;AACvB,MAAM,uBAAuB,GAAG;;MCrE1B,wBAAwB,CAAA;AACnC,IAAA,KAAK,CAAC,QAAuC,EAAA;;;;AAI3C,QAAA,MAAM,kBAAkB,GAAG,QAAQ,CAAC,iCAAiC;QACrE,OAAO;AACL,YAAA,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,aAAa,KACjD,IAAI,CACF,QAAQ,CAAC,2BAA2B,CAClC,iBAAiB,EACjB,aAAa,CACd,CACF;YACH,IAAI,kBAAkB,IAAI;gBACxB,sBAAsB,EAAE,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;aACzD,CAAC;SACH;;wGAjBQ,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cAFvB,MAAM,EAAA,CAAA;;4FAEP,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAHpC,UAAU;AAAC,YAAA,IAAA,EAA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AAK,CACb,0EAA0E,CAC3E;AACF;IACD,IAAI,CAAC,CAAC,aAAa,KAAK,KAAK,IAAI,CAAC,CAAC,wBAAwB,KAAK,IAAI,EAAE;AACpE,QAAA,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE;AACF;AACH;AACA,SAAS,cAAc,CAAI,CAAmB,EAAA;IAC5C,OAAO;AACL,QAAA,WAAW,EAAE,CAAC,CAAC,WAAW,IAAI,QAAQ;AACtC,QAAA,eAAe,EAAE,CAAC,CAAC,eAAe,IAAI,iBAAiB;QACvD,mBAAmB,EAAE,CAAC,CAAC,mBAAmB;KAC3C;AACH;AACA,SAAS,eAAe,CAAI,CAAmB,EAAA;IAC7C,OAAO;AACL,QAAA,iBAAiB,EAAE,CAAC,CAAC,iBAAiB,IAAI,IAAI;AAC9C,QAAA,gBAAgB,EAAE,CAAC,CAAC,gBAAgB,IAAI,KAAK;AAC7C,QAAA,oBAAoB,EAAE,CAAC,CAAC,oBAAoB,IAAI,KAAK;AACrD,QAAA,wBAAwB,EAAE,CAAC,CAAC,wBAAwB,IAAI,KAAK;AAC7D,QAAA,iBAAiB,EAAE,CAAC,CAAC,iBAAiB,IAAI,KAAK;KAChD;AACH;AACA,SAAS,cAAc,CAAI,CAAmB,EAAA;IAC5C,OAAO;AACL,QAAA,eAAe,EAAE,CAAC,CAAC,eAAe,IAAI,gBAAgB;AACtD,QAAA,cAAc,EAAE,CAAC,CAAC,cAAc,IAAI,eAAe;AACnD,QAAA,uBAAuB,EAAE,CAAC,CAAC,uBAAuB,IAAI,oBAAoB;AAC1E,QAAA,qBAAqB,EAAE,CAAC,CAAC,qBAAqB,IAAI,gBAAgB;KACnE;AACH;;AC/GA;AACA;AACA;AACA;AACA;;AAEG;;ACNH;;AAEG;;;;"}
@@ -77,5 +77,5 @@ export declare class SearchComponent<T extends IReturnType> implements OnInit, O
77
77
  searchOnCustomEventValueChange(value: string): void;
78
78
  private _isCustomSearchEventChange;
79
79
  static ɵfac: i0.ɵɵFactoryDeclaration<SearchComponent<any>, [{ optional: true; }, null, null, null]>;
80
- static ɵcmp: i0.ɵɵComponentDeclaration<SearchComponent<any>, "sourceloop-search", never, { "config": "config"; "searchProvider": "searchProvider"; "titleTemplate": "titleTemplate"; "subtitleTemplate": "subtitleTemplate"; "customAllLabel": "customAllLabel"; "showOnlySearchResultOverlay": "showOnlySearchResultOverlay"; "customSearchEvent": "customSearchEvent"; }, { "clicked": "clicked"; "searched": "searched"; }, never, never, false>;
80
+ static ɵcmp: i0.ɵɵComponentDeclaration<SearchComponent<any>, "sourceloop-search", never, { "config": { "alias": "config"; "required": false; }; "searchProvider": { "alias": "searchProvider"; "required": false; }; "titleTemplate": { "alias": "titleTemplate"; "required": false; }; "subtitleTemplate": { "alias": "subtitleTemplate"; "required": false; }; "customAllLabel": { "alias": "customAllLabel"; "required": false; }; "showOnlySearchResultOverlay": { "alias": "showOnlySearchResultOverlay"; "required": false; }; "customSearchEvent": { "alias": "customSearchEvent"; "required": false; }; }, { "clicked": "clicked"; "searched": "searched"; }, never, never, false, never>;
81
81
  }
package/lib/types.d.ts CHANGED
@@ -32,16 +32,16 @@ export interface ISearchServiceWithPromises<T extends IReturnType> {
32
32
  }
33
33
  export declare function isApiServiceWithPromise(service: ISearchService<IReturnType> | ISearchServiceWithPromises<IReturnType>): service is ISearchServiceWithPromises<IReturnType>;
34
34
  export declare const SEARCH_SERVICE_TOKEN: InjectionToken<ISearchService<IReturnType>>;
35
- export declare type RecentSearchEvent = {
35
+ export type RecentSearchEvent = {
36
36
  event?: Event;
37
37
  keyword: string;
38
38
  category: string;
39
39
  };
40
- export declare type ItemClickedEvent<T> = {
40
+ export type ItemClickedEvent<T> = {
41
41
  event: MouseEvent;
42
42
  item: T;
43
43
  };
44
- export declare type TypeEvent = {
44
+ export type TypeEvent = {
45
45
  event?: Event;
46
46
  input: string;
47
47
  };
@@ -51,7 +51,7 @@ export declare const DEFAULT_ORDER: never[];
51
51
  export declare const DEBOUNCE_TIME = 1000;
52
52
  export declare const DEFAULT_OFFSET = 0;
53
53
  export declare const DEFAULT_SAVE_IN_RECENTS = true;
54
- export declare type CustomSearchEvent = {
54
+ export type CustomSearchEvent = {
55
55
  searchValue: string;
56
56
  modelName: string;
57
57
  };