@sourceloop/search-client 9.0.5 → 9.1.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.
package/README.md CHANGED
@@ -148,22 +148,7 @@ You can also choose to use your own icons by providing classes for icons in the
148
148
 
149
149
  ### Required Global Styles
150
150
 
151
- The search component uses Angular CDK overlays for the dropdown, which require global styles to function properly. **You must import the library's stylesheet in your application:**
152
-
153
- #### Option 1: Import in your `styles.scss`
154
-
155
- ```scss
156
- @import '@sourceloop/search-client/styles';
157
- ```
158
-
159
- #### Option 2: Add to `angular.json`
160
-
161
- ```json
162
- "styles": [
163
- "node_modules/@sourceloop/search-client/styles.scss",
164
- "src/styles.scss"
165
- ]
166
- ```
151
+ The search component uses Angular CDK overlays for the dropdown, which require global styles to function properly.
167
152
 
168
153
  ### Styling and Theming
169
154
 
@@ -186,19 +171,15 @@ sourceloop-search {
186
171
  --search-icon-color: #33333380; /* Color of icons */
187
172
  }
188
173
 
189
- #### Example: Custom Theming
190
-
191
- To customize the search component, add the following to your `styles.scss` (after importing the library styles):
192
-
193
- ```scss
194
- @import '@sourceloop/search-client/styles';
195
-
174
+ ####Example: Custom Theming To customize the search component, add the following
175
+ to your `component.scss` ```scss
176
+
196
177
  // Customize component colors
197
- sourceloop-search {
198
- --search-dropdown-background: #0056b3;
199
- --search-dropdown-text-color: #ffffff;
200
- --search-border-hover: #0056b3;
201
- --search-border-focus: #003d82;
178
+
179
+ :host ::ng-deep sourceloop-search {
180
+ --search-border-hover: #5c26f1 !important;
181
+ --search-border-focus: #5c26f1 !important;
182
+ --search-dropdown-background: #5c26f2 !important;
202
183
  }
203
184
  ````
204
185
 
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, EventEmitter, PLATFORM_ID, ViewChild, Output, Input, Inject, Optional, Component } from '@angular/core';
2
+ import { InjectionToken, Injectable, computed, input, output, effect, PLATFORM_ID, ViewChild, Inject, Optional, Component } from '@angular/core';
3
3
  import { from, Subject } from 'rxjs';
4
4
  import { tap, debounceTime } from 'rxjs/operators';
5
5
  import * as i3 from '@angular/forms';
@@ -61,10 +61,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
61
61
  // https://opensource.org/licenses/MIT
62
62
  const ALL_LABEL = 'All';
63
63
  class SearchComponent {
64
- searchService;
65
64
  platformId;
66
65
  cdr;
67
66
  promiseAdapter;
67
+ cfg = computed(() => {
68
+ const cfg = this.config();
69
+ if (!cfg) {
70
+ throw new Error('SearchComponent: config input is required');
71
+ }
72
+ return cfg;
73
+ }, ...(ngDevMode ? [{ debugName: "cfg" }] : []));
74
+ config = input(...(ngDevMode ? [undefined, { debugName: "config" }] : []));
75
+ searchProvider = input(...(ngDevMode ? [undefined, { debugName: "searchProvider" }] : []));
76
+ titleTemplate = input(...(ngDevMode ? [undefined, { debugName: "titleTemplate" }] : []));
77
+ subtitleTemplate = input(...(ngDevMode ? [undefined, { debugName: "subtitleTemplate" }] : []));
78
+ customAllLabel = input(ALL_LABEL, ...(ngDevMode ? [{ debugName: "customAllLabel" }] : []));
79
+ showOnlySearchResultOverlay = input(false, ...(ngDevMode ? [{ debugName: "showOnlySearchResultOverlay" }] : []));
80
+ customSearchEvent = input({
81
+ searchValue: '',
82
+ modelName: ALL_LABEL,
83
+ }, ...(ngDevMode ? [{ debugName: "customSearchEvent" }] : []));
84
+ clicked = output();
85
+ searched = output();
68
86
  searchBoxInput = '';
69
87
  suggestionsDisplay = false;
70
88
  categoryDisplay = false;
@@ -73,64 +91,7 @@ class SearchComponent {
73
91
  recentSearches = [];
74
92
  category = ALL_LABEL;
75
93
  searchRequest$ = new Subject();
76
- _config;
77
- get config() {
78
- return this._config;
79
- }
80
- set config(value) {
81
- this._config = value;
82
- if (value && value.models) {
83
- value.models.unshift({
84
- name: ALL_LABEL,
85
- displayName: this.customAllLabel ?? ALL_LABEL,
86
- });
87
- }
88
- else if (value && !value.models) {
89
- value.models = [
90
- {
91
- name: ALL_LABEL,
92
- displayName: this.customAllLabel ?? ALL_LABEL,
93
- },
94
- ];
95
- }
96
- else {
97
- // do nothing
98
- }
99
- }
100
- /* The above code is a setter method in a TypeScript class that takes a parameter `searchProvider` of
101
- type `ISearchService<T>` or `ISearchServiceWithPromises<T>`. */
102
- set searchProvider(value) {
103
- if (isApiServiceWithPromise(value)) {
104
- value = this.promiseAdapter.adapt(value);
105
- }
106
- this.searchService = value;
107
- }
108
- get searchProvider() {
109
- return this.searchService;
110
- }
111
- titleTemplate;
112
- subtitleTemplate;
113
- /**
114
- * configure when application has own search input and use different all label
115
- */
116
- customAllLabel = ALL_LABEL;
117
- /**
118
- * configure to true when to show only search result overlay without search bar
119
- */
120
- showOnlySearchResultOverlay = false;
121
- /**
122
- * provide custom search event when showOnlySearchResultOverlay configure to true
123
- */
124
- customSearchEvent = {
125
- searchValue: '',
126
- modelName: this.customAllLabel,
127
- };
128
- // emitted when user clicks one of the suggested results (including recent search sugestions)
129
- clicked = new EventEmitter();
130
- searched = new EventEmitter();
131
- /* emitted when user makes search request (including recent search requests
132
- & requests made on change in category from dropdown)
133
- In case of recent search Array of recent Search request result is emitted */
94
+ searchService;
134
95
  onChange = () => { };
135
96
  onTouched = () => { };
136
97
  disabled = false;
@@ -138,10 +99,52 @@ class SearchComponent {
138
99
  constructor(searchService,
139
100
  // tslint:disable-next-line:ban-types
140
101
  platformId, cdr, promiseAdapter) {
141
- this.searchService = searchService;
142
102
  this.platformId = platformId;
143
103
  this.cdr = cdr;
144
104
  this.promiseAdapter = promiseAdapter;
105
+ if (searchService) {
106
+ this.searchService = searchService;
107
+ }
108
+ effect(() => {
109
+ const cfg = this.config();
110
+ if (!cfg)
111
+ return;
112
+ if (cfg.models) {
113
+ cfg.models.unshift({
114
+ name: ALL_LABEL,
115
+ displayName: this.customAllLabel(),
116
+ });
117
+ }
118
+ else {
119
+ cfg.models = [
120
+ {
121
+ name: ALL_LABEL,
122
+ displayName: this.customAllLabel(),
123
+ },
124
+ ];
125
+ }
126
+ });
127
+ effect(() => {
128
+ let provider = this.searchProvider();
129
+ if (!provider)
130
+ return;
131
+ if (isApiServiceWithPromise(provider)) {
132
+ provider = this.promiseAdapter.adapt(provider);
133
+ }
134
+ this.searchService = provider;
135
+ });
136
+ effect(() => {
137
+ const event = this.customSearchEvent();
138
+ if (!event)
139
+ return;
140
+ if (event.searchValue !== undefined) {
141
+ this.searchBoxInput = event.searchValue;
142
+ this.searchOnCustomEventValueChange(this.searchBoxInput);
143
+ }
144
+ if (event.modelName) {
145
+ this.setCategory(event.modelName);
146
+ }
147
+ });
145
148
  }
146
149
  ngOnInit() {
147
150
  this.searchRequest$
@@ -171,15 +174,17 @@ class SearchComponent {
171
174
  this.disabled = isDisabled;
172
175
  }
173
176
  getSuggestions(eventValue) {
177
+ const cfg = this.config();
178
+ if (!cfg)
179
+ return;
174
180
  eventValue.input = eventValue.input.trim();
175
181
  if (!eventValue.input.length) {
176
182
  return;
177
183
  }
178
- const order = this.config.order ?? DEFAULT_ORDER;
179
- let orderString = '';
180
- order.forEach(preference => (orderString = `${orderString}${preference} `));
181
- let saveInRecents = this.config.saveInRecents ?? DEFAULT_SAVE_IN_RECENTS;
182
- if (this.config.saveInRecents && this.config.saveInRecentsOnlyOnEnter) {
184
+ const order = cfg.order ?? DEFAULT_ORDER;
185
+ const orderString = order.join(' ');
186
+ let saveInRecents = cfg.saveInRecents ?? DEFAULT_SAVE_IN_RECENTS;
187
+ if (cfg.saveInRecents && cfg.saveInRecentsOnlyOnEnter) {
183
188
  if (!eventValue.event ||
184
189
  (eventValue.event instanceof KeyboardEvent &&
185
190
  eventValue.event.key === 'Enter')) {
@@ -196,10 +201,10 @@ class SearchComponent {
196
201
  const requestParameters = {
197
202
  match: eventValue.input,
198
203
  sources: this._categoryToSourceName(this.category),
199
- limit: this.config.limit ?? DEFAULT_LIMIT,
200
- limitByType: this.config.limitByType ?? DEFAULT_LIMIT_TYPE,
204
+ limit: cfg.limit ?? DEFAULT_LIMIT,
205
+ limitByType: cfg.limitByType ?? DEFAULT_LIMIT_TYPE,
201
206
  order: orderString,
202
- offset: this.config.offset ?? DEFAULT_OFFSET,
207
+ offset: cfg.offset ?? DEFAULT_OFFSET,
203
208
  };
204
209
  this.searching = true;
205
210
  this.cdr.markForCheck();
@@ -216,20 +221,23 @@ class SearchComponent {
216
221
  });
217
222
  }
218
223
  getRecentSearches() {
219
- if (!this.config.hideRecentSearch &&
220
- this.searchService.recentSearchApiRequest) {
221
- this.searchService.recentSearchApiRequest().subscribe((value) => {
222
- this.recentSearches = value;
223
- this.cdr.markForCheck();
224
- }, (_error) => {
225
- this.recentSearches = [];
226
- this.cdr.markForCheck();
227
- });
228
- }
224
+ const cfg = this.config();
225
+ if (!cfg || cfg.hideRecentSearch)
226
+ return;
227
+ this.searchService.recentSearchApiRequest?.().subscribe((value) => {
228
+ this.recentSearches = value;
229
+ this.cdr.markForCheck();
230
+ }, (_error) => {
231
+ this.recentSearches = [];
232
+ this.cdr.markForCheck();
233
+ });
229
234
  }
230
235
  //event can be KeyBoardEvent or Event of type 'change'
231
236
  // fired on change in value of drop down for category
232
237
  hitSearchApi(event) {
238
+ const cfg = this.config();
239
+ if (!cfg)
240
+ return;
233
241
  // this will happen only in case user searches something and
234
242
  // then erases it, we need to update recent search
235
243
  if (!this.searchBoxInput) {
@@ -238,7 +246,7 @@ class SearchComponent {
238
246
  return;
239
247
  }
240
248
  // no debounce time needed in case of searchOnlyOnEnter
241
- if (this.config.searchOnlyOnEnter) {
249
+ if (cfg.searchOnlyOnEnter) {
242
250
  if (!event || (event instanceof KeyboardEvent && event.key === 'Enter')) {
243
251
  this.getSuggestions({ input: this.searchBoxInput, event });
244
252
  }
@@ -255,9 +263,11 @@ class SearchComponent {
255
263
  });
256
264
  }
257
265
  populateValue(suggestion, event) {
258
- const value = suggestion[this.config.displayPropertyName];
266
+ const cfg = this.config();
267
+ if (!cfg)
268
+ return;
269
+ this.searchBoxInput = String(suggestion[cfg.displayPropertyName]);
259
270
  // converted to string to assign value to searchBoxInput
260
- this.searchBoxInput = value;
261
271
  this.suggestionsDisplay = false;
262
272
  // ngModelChange doesn't detect change in value
263
273
  // when populated from outside, hence calling manually
@@ -283,7 +293,7 @@ class SearchComponent {
283
293
  fetchModelImageUrlFromSuggestion(suggestion) {
284
294
  const modelName = suggestion['source'];
285
295
  let url;
286
- this.config.models.forEach(model => {
296
+ this.config()?.models.forEach(model => {
287
297
  if (model.name === modelName && model.imageUrl) {
288
298
  url = model.imageUrl;
289
299
  }
@@ -305,7 +315,7 @@ class SearchComponent {
305
315
  }
306
316
  focusInput() {
307
317
  if (isPlatformBrowser(this.platformId) &&
308
- !this.showOnlySearchResultOverlay) {
318
+ !this.showOnlySearchResultOverlay()) {
309
319
  this.searchInputElement.nativeElement.focus();
310
320
  }
311
321
  }
@@ -338,7 +348,7 @@ class SearchComponent {
338
348
  this.searchRequest$.unsubscribe();
339
349
  }
340
350
  _categoryToSourceName(category) {
341
- if ([ALL_LABEL, this.customAllLabel].includes(category)) {
351
+ if ([ALL_LABEL, this.customAllLabel()].includes(category)) {
342
352
  return [];
343
353
  }
344
354
  else {
@@ -346,7 +356,7 @@ class SearchComponent {
346
356
  }
347
357
  }
348
358
  getModelFromModelName(name) {
349
- return this.config.models.find(item => item.name === name);
359
+ return this.config()?.models.find(item => item.name === name);
350
360
  }
351
361
  getModelsWithSuggestions() {
352
362
  const modelsWithSuggestions = [];
@@ -369,18 +379,6 @@ class SearchComponent {
369
379
  });
370
380
  return modelsWithSuggestions;
371
381
  }
372
- ngOnChanges(changes) {
373
- if (changes.customSearchEvent) {
374
- if (this._isCustomSearchEventChange(changes, 'searchValue')) {
375
- this.searchBoxInput = this.customSearchEvent?.searchValue ?? '';
376
- this.searchOnCustomEventValueChange(this.searchBoxInput);
377
- }
378
- if (this._isCustomSearchEventChange(changes, 'modelName') &&
379
- this.customSearchEvent?.modelName) {
380
- this.setCategory(this.customSearchEvent?.modelName);
381
- }
382
- }
383
- }
384
382
  searchOnCustomEventValueChange(value) {
385
383
  if (value?.length) {
386
384
  this.showSuggestions();
@@ -390,19 +388,14 @@ class SearchComponent {
390
388
  this.hideSuggestions();
391
389
  }
392
390
  }
393
- _isCustomSearchEventChange(changes, propertyName) {
394
- return (!changes.customSearchEvent?.previousValue ||
395
- changes.customSearchEvent?.previousValue[propertyName] !==
396
- changes.customSearchEvent?.currentValue[propertyName]);
397
- }
398
391
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SearchComponent, deps: [{ token: SEARCH_SERVICE_TOKEN, optional: true }, { token: PLATFORM_ID }, { token: i0.ChangeDetectorRef }, { token: PromiseApiAdapterService }], target: i0.ɵɵFactoryTarget.Component });
399
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: SearchComponent, isStandalone: true, selector: "sourceloop-search", inputs: { config: "config", searchProvider: "searchProvider", titleTemplate: "titleTemplate", subtitleTemplate: "subtitleTemplate", customAllLabel: "customAllLabel", showOnlySearchResultOverlay: "showOnlySearchResultOverlay", customSearchEvent: "customSearchEvent" }, outputs: { clicked: "clicked", searched: "searched" }, providers: [
392
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.15", type: SearchComponent, isStandalone: true, selector: "sourceloop-search", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, searchProvider: { classPropertyName: "searchProvider", publicName: "searchProvider", isSignal: true, isRequired: false, transformFunction: null }, titleTemplate: { classPropertyName: "titleTemplate", publicName: "titleTemplate", isSignal: true, isRequired: false, transformFunction: null }, subtitleTemplate: { classPropertyName: "subtitleTemplate", publicName: "subtitleTemplate", isSignal: true, isRequired: false, transformFunction: null }, customAllLabel: { classPropertyName: "customAllLabel", publicName: "customAllLabel", isSignal: true, isRequired: false, transformFunction: null }, showOnlySearchResultOverlay: { classPropertyName: "showOnlySearchResultOverlay", publicName: "showOnlySearchResultOverlay", isSignal: true, isRequired: false, transformFunction: null }, customSearchEvent: { classPropertyName: "customSearchEvent", publicName: "customSearchEvent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked", searched: "searched" }, providers: [
400
393
  {
401
394
  provide: NG_VALUE_ACCESSOR,
402
395
  useExisting: SearchComponent,
403
396
  multi: true,
404
397
  },
405
- ], viewQueries: [{ propertyName: "searchInputElement", first: true, predicate: ["searchInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"!showOnlySearchResultOverlay\">\n <div 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 (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-select\n [value]=\"category\"\n (selectionChange)=\"setCategory($event.value)\"\n panelClass=\"search-select\"\n \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 class=\"inline-display\"\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 suggestion-image\"\n [src]=\"fetchModelImageUrlFromSuggestion(suggestion)\"\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 class=\"inline-display\"\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{--search-background: #f7f7f7;--search-input-background: #f1f3f4;--search-input-text-color: #6b6b6b;--search-border-hover: #90003b;--search-border-focus: #90003b;--search-dropdown-background: #90003b;--search-dropdown-text-color: #fff;--search-highlight-bg: #fee8e8;--search-heading-color: #9c9c9c;--search-text-color: #333;--search-icon-color: #33333380}:host ::ng-deep .mat-mdc-form-field{padding:0;margin:0!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-prefix{padding:0 .5rem 0 .75rem}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-suffix{padding:0 .75rem 0 .5rem}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-subscript-wrapper{display:none}.toolbar-search{display:flex;align-items:center;width:100%;max-width:32rem;background-color:var(--search-background);border-radius:0 0 .25rem .25rem;gap:0}.toolbar-search ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper{height:2.5rem;align-items:center}.toolbar-search ::ng-deep .mat-mdc-form-field-infix{min-height:2.25rem;padding:.5rem 0}.toolbar-search-input{width:78%;flex:1 1 auto;margin-right:0!important;font-size:.75rem}.toolbar-search-input ::ng-deep input{margin:0;color:var(--search-input-text-color)!important}.toolbar-search-input ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--search-input-background)}.toolbar-search-input ::ng-deep .mdc-notched-outline__leading,.toolbar-search-input ::ng-deep .mdc-notched-outline__notch,.toolbar-search-input ::ng-deep .mdc-notched-outline__trailing{border:none!important;background-color:transparent!important}.toolbar-search-input ::ng-deep .mdc-notched-outline__leading{border-radius:.25rem 0 0 .25rem}.toolbar-search-input ::ng-deep .mdc-notched-outline__trailing{border-radius:0}.icomoon.Search,.icomoon.close{height:1rem;width:1rem;font-size:1rem;color:var(--search-icon-color);padding-bottom:.25rem}.icomoon.close{cursor:pointer}.toolbar-search-select{flex:1 1 auto;margin-left:0!important;min-width:0;width:22%}.toolbar-search-select ::ng-deep .mat-mdc-select-value-text{font-size:.75rem;line-height:normal;white-space:nowrap;overflow:hidden;display:flex;max-width:100%;align-items:center}.toolbar-search-select ::ng-deep .mat-mdc-select{max-width:100%;padding-left:0;padding-right:0}.toolbar-search-select ::ng-deep .mat-mdc-select-value{display:flex;align-items:center;min-width:0;flex:1 1 auto}.toolbar-search-select ::ng-deep .mat-mdc-form-field-text-suffix{display:flex;align-items:center;margin-left:.375rem;flex-shrink:0}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow-wrapper{width:1rem;flex-shrink:0}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow{transform:rotate(0) scale(1.3)!important}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-icon-color);stroke-width:1}.toolbar-search-select ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--search-input-background)}.toolbar-search-select ::ng-deep .mdc-notched-outline__leading,.toolbar-search-select ::ng-deep .mdc-notched-outline__notch,.toolbar-search-select ::ng-deep .mdc-notched-outline__trailing{border:none!important;background-color:transparent!important}.toolbar-search-select ::ng-deep .mdc-notched-outline__leading{border-radius:0}.toolbar-search-select ::ng-deep .mdc-notched-outline__trailing{border-radius:0 .25rem .25rem 0}.toolbar-search-select ::ng-deep .mat-mdc-form-field-infix{-webkit-padding-before:.7em;min-height:2.25rem;display:flex;align-items:center;padding:.375rem .25rem}::ng-deep .search-select.mat-mdc-select-panel{margin-top:1.875rem;margin-left:.625rem}.search-container{position:relative;width:100%;max-width:32.1875rem}.search-container .search-popup{padding:0 .9375rem .9375rem;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 .3125rem .25rem #0003;border-radius:0 0 .25rem .25rem}.search-container .search-popup hr{border:0;border-top:.0625rem solid #ebebeb;margin:0;position:sticky;top:0;padding-bottom:.9375rem;z-index:1}.search-container .search-popup .search-message{display:inline-block;width:100%;text-align:center;font-size:1rem;padding-top:.75rem}.search-container .search-popup .search-item-info{color:#91263b;text-align:center;font-size:.75rem;margin-bottom:.9375rem;padding-top:.75rem}.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:var(--search-text-color)}.search-container .search-popup ul li.suggestions{font-size:.9375rem;line-height:2.25rem;padding:0 .9375rem 0 2.75rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.search-container .search-popup ul li.suggestions:hover{background-color:var(--search-highlight-bg)}::ng-deep .toolbar-search input{line-height:.875rem;color:var(--search-input-text-color)!important}::ng-deep .toolbar-search input::placeholder{color:var(--search-input-text-color);opacity:.6}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border:.0625rem solid var(--search-border-hover)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-right:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) input{color:var(--search-input-text-color)!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{background:var(--search-dropdown-background)!important;border-radius:.25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:.0625rem solid var(--search-border-hover)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-right:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select,::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-value{color:var(--search-dropdown-text-color)!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-dropdown-text-color)!important;stroke-width:1}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border:.125rem solid var(--search-border-focus)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-right:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) input{color:var(--search-input-text-color)!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{background:var(--search-dropdown-background)!important;border-radius:.25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:.125rem solid var(--search-border-focus)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-right:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select,::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-value{color:var(--search-dropdown-text-color)!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-dropdown-text-color)!important;stroke-width:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: "ngmodule", type: FormsModule }, { 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: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i5.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", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] });
398
+ ], viewQueries: [{ propertyName: "searchInputElement", first: true, predicate: ["searchInput"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"!showOnlySearchResultOverlay()\">\n <div class=\"toolbar-search\" *ngIf=\"cfg()\">\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-input\">\n <input\n matInput\n autocomplete=\"off\"\n type=\"text\"\n [placeholder]=\"\n cfg().placeholderFunction?.(searchInput.value, category)\n ?? cfg().placeholder ?? 'Search'\n \"\n #searchInput\n name=\"searchInput\"\n (focus)=\"showSuggestions()\"\n (blur)=\"hideSuggestions()\"\n [(ngModel)]=\"searchBoxInput\"\n (keyup)=\"hitSearchApi($event)\"\n (ngModelChange)=\"onChange(this.searchBoxInput)\"\n [disabled]=\"disabled\"\n />\n <mat-icon matPrefix [className]=\"cfg().searchIconClass\"></mat-icon>\n <mat-icon\n *ngIf=\"searchBoxInput\"\n matSuffix\n [className]=\"cfg().crossIconClass\"\n (click)=\"resetInput()\"\n ></mat-icon>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-select\">\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 cfg().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 {{ cfg().noResultMessage }}\n </ng-container>\n </span>\n <ng-container *ngIf=\"cfg().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[cfg().displayPropertyName],\n searchBoxInput\n )\n \"\n class=\"inline-display\"\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=\"!cfg().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() &&\n fetchModelImageUrlFromSuggestion(suggestion)\n \"\n class=\"suggestions-categorize-false suggestion-image\"\n [src]=\"fetchModelImageUrlFromSuggestion(suggestion)\"\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[cfg().displayPropertyName],\n searchBoxInput\n )\n \"\n class=\"inline-display\"\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=\"!cfg().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]=\"cfg().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{--search-background: #f7f7f7;--search-input-background: #f1f3f4;--search-input-text-color: #6b6b6b;--search-border-hover: #90003b;--search-border-focus: #90003b;--search-dropdown-background: #90003b;--search-dropdown-text-color: #fff;--search-highlight-bg: #fee8e8;--search-heading-color: #9c9c9c;--search-text-color: #333;--search-icon-color: rgba(51, 51, 51, .5019607843)}:host ::ng-deep .mat-mdc-form-field{padding:0;margin:0!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-prefix{padding:0 .5rem 0 .75rem}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-suffix{padding:0 .75rem 0 .5rem}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-subscript-wrapper{display:none}.toolbar-search{display:flex;align-items:center;width:100%;max-width:32rem;background-color:var(--search-background)!important;border-radius:0 0 .25rem .25rem;gap:0}.toolbar-search ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper{height:2.5rem;align-items:center}.toolbar-search ::ng-deep .mat-mdc-form-field-infix{min-height:2.25rem;padding:.5rem 0}.toolbar-search-input{width:78%;flex:1 1 auto;margin-right:0!important;font-size:.75rem}.toolbar-search-input ::ng-deep input{margin:0;color:var(--search-input-text-color)!important}.toolbar-search-input ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--search-input-background)!important}.toolbar-search-input ::ng-deep .mdc-notched-outline__leading,.toolbar-search-input ::ng-deep .mdc-notched-outline__notch,.toolbar-search-input ::ng-deep .mdc-notched-outline__trailing{border:none!important;background-color:transparent!important}.toolbar-search-input ::ng-deep .mdc-notched-outline__leading{border-radius:.25rem 0 0 .25rem}.toolbar-search-input ::ng-deep .mdc-notched-outline__trailing{border-radius:0}.icomoon.Search,.icomoon.close{height:1rem;width:1rem;font-size:1rem;color:var(--search-icon-color);padding-bottom:.25rem}.icomoon.close{cursor:pointer}.toolbar-search-select{flex:1 1 auto;margin-left:0!important;min-width:0;width:22%}.toolbar-search-select ::ng-deep .mat-mdc-select-value-text{font-size:.75rem;line-height:normal;white-space:nowrap;overflow:hidden;display:flex;max-width:100%;align-items:center}.toolbar-search-select ::ng-deep .mat-mdc-select{max-width:100%;padding-left:0;padding-right:0}.toolbar-search-select ::ng-deep .mat-mdc-select-value{display:flex;align-items:center;min-width:0;flex:1 1 auto}.toolbar-search-select ::ng-deep .mat-mdc-form-field-text-suffix{display:flex;align-items:center;margin-left:.375rem;flex-shrink:0}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow-wrapper{width:1rem;flex-shrink:0}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow{transform:rotate(0) scale(1.3)!important}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-icon-color);stroke-width:1}.toolbar-search-select ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--search-input-background)!important}.toolbar-search-select ::ng-deep .mdc-notched-outline__leading,.toolbar-search-select ::ng-deep .mdc-notched-outline__notch,.toolbar-search-select ::ng-deep .mdc-notched-outline__trailing{border:none!important;background-color:transparent!important}.toolbar-search-select ::ng-deep .mdc-notched-outline__leading{border-radius:0}.toolbar-search-select ::ng-deep .mdc-notched-outline__trailing{border-radius:0 .25rem .25rem 0}.toolbar-search-select ::ng-deep .mat-mdc-form-field-infix{-webkit-padding-before:.7em;min-height:2.25rem;display:flex;align-items:center;padding:.375rem .25rem}::ng-deep .search-select.mat-mdc-select-panel{margin-top:1.875rem;margin-left:.625rem}.search-container{position:relative;width:100%;max-width:32.1875rem}.search-container .search-popup{padding:0 .9375rem .9375rem;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 .3125rem .25rem #0003;border-radius:0 0 .25rem .25rem}.search-container .search-popup hr{border:0;border-top:.0625rem solid #ebebeb;margin:0;position:sticky;top:0;padding-bottom:.9375rem;z-index:1}.search-container .search-popup .search-message{display:inline-block;width:100%;text-align:center;font-size:1rem;padding-top:.75rem}.search-container .search-popup .search-item-info{color:#91263b;text-align:center;font-size:.75rem;margin-bottom:.9375rem;padding-top:.75rem}.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:var(--search-text-color)}.search-container .search-popup ul li.suggestions{font-size:.9375rem;line-height:2.25rem;padding:0 .9375rem 0 2.75rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.search-container .search-popup ul li.suggestions:hover{background-color:var(--search-highlight-bg)}::ng-deep .toolbar-search input{line-height:.875rem;color:var(--search-input-text-color)!important}::ng-deep .toolbar-search input::placeholder{color:var(--search-input-text-color);opacity:.6}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border:.0625rem solid var(--search-border-hover)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-right:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) input{color:var(--search-input-text-color)!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{background:var(--search-dropdown-background)!important;border-radius:.25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:.0625rem solid var(--search-border-hover)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-right:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select,::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-value{color:var(--search-dropdown-text-color)!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-dropdown-text-color)!important;stroke-width:1}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border:.125rem solid var(--search-border-focus)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-right:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) input{color:var(--search-input-text-color)!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{background:var(--search-dropdown-background)!important;border-radius:.25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:.125rem solid var(--search-border-focus)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-right:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select,::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-value{color:var(--search-dropdown-text-color)!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-dropdown-text-color)!important;stroke-width:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: "ngmodule", type: FormsModule }, { 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: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i5.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", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] });
406
399
  }
407
400
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SearchComponent, decorators: [{
408
401
  type: Component,
@@ -419,7 +412,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
419
412
  MatSelectModule,
420
413
  MatFormFieldModule,
421
414
  MatInputModule,
422
- ], template: "<ng-container *ngIf=\"!showOnlySearchResultOverlay\">\n <div 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 (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-select\n [value]=\"category\"\n (selectionChange)=\"setCategory($event.value)\"\n panelClass=\"search-select\"\n \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 class=\"inline-display\"\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 suggestion-image\"\n [src]=\"fetchModelImageUrlFromSuggestion(suggestion)\"\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 class=\"inline-display\"\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{--search-background: #f7f7f7;--search-input-background: #f1f3f4;--search-input-text-color: #6b6b6b;--search-border-hover: #90003b;--search-border-focus: #90003b;--search-dropdown-background: #90003b;--search-dropdown-text-color: #fff;--search-highlight-bg: #fee8e8;--search-heading-color: #9c9c9c;--search-text-color: #333;--search-icon-color: #33333380}:host ::ng-deep .mat-mdc-form-field{padding:0;margin:0!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-prefix{padding:0 .5rem 0 .75rem}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-suffix{padding:0 .75rem 0 .5rem}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-subscript-wrapper{display:none}.toolbar-search{display:flex;align-items:center;width:100%;max-width:32rem;background-color:var(--search-background);border-radius:0 0 .25rem .25rem;gap:0}.toolbar-search ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper{height:2.5rem;align-items:center}.toolbar-search ::ng-deep .mat-mdc-form-field-infix{min-height:2.25rem;padding:.5rem 0}.toolbar-search-input{width:78%;flex:1 1 auto;margin-right:0!important;font-size:.75rem}.toolbar-search-input ::ng-deep input{margin:0;color:var(--search-input-text-color)!important}.toolbar-search-input ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--search-input-background)}.toolbar-search-input ::ng-deep .mdc-notched-outline__leading,.toolbar-search-input ::ng-deep .mdc-notched-outline__notch,.toolbar-search-input ::ng-deep .mdc-notched-outline__trailing{border:none!important;background-color:transparent!important}.toolbar-search-input ::ng-deep .mdc-notched-outline__leading{border-radius:.25rem 0 0 .25rem}.toolbar-search-input ::ng-deep .mdc-notched-outline__trailing{border-radius:0}.icomoon.Search,.icomoon.close{height:1rem;width:1rem;font-size:1rem;color:var(--search-icon-color);padding-bottom:.25rem}.icomoon.close{cursor:pointer}.toolbar-search-select{flex:1 1 auto;margin-left:0!important;min-width:0;width:22%}.toolbar-search-select ::ng-deep .mat-mdc-select-value-text{font-size:.75rem;line-height:normal;white-space:nowrap;overflow:hidden;display:flex;max-width:100%;align-items:center}.toolbar-search-select ::ng-deep .mat-mdc-select{max-width:100%;padding-left:0;padding-right:0}.toolbar-search-select ::ng-deep .mat-mdc-select-value{display:flex;align-items:center;min-width:0;flex:1 1 auto}.toolbar-search-select ::ng-deep .mat-mdc-form-field-text-suffix{display:flex;align-items:center;margin-left:.375rem;flex-shrink:0}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow-wrapper{width:1rem;flex-shrink:0}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow{transform:rotate(0) scale(1.3)!important}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-icon-color);stroke-width:1}.toolbar-search-select ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--search-input-background)}.toolbar-search-select ::ng-deep .mdc-notched-outline__leading,.toolbar-search-select ::ng-deep .mdc-notched-outline__notch,.toolbar-search-select ::ng-deep .mdc-notched-outline__trailing{border:none!important;background-color:transparent!important}.toolbar-search-select ::ng-deep .mdc-notched-outline__leading{border-radius:0}.toolbar-search-select ::ng-deep .mdc-notched-outline__trailing{border-radius:0 .25rem .25rem 0}.toolbar-search-select ::ng-deep .mat-mdc-form-field-infix{-webkit-padding-before:.7em;min-height:2.25rem;display:flex;align-items:center;padding:.375rem .25rem}::ng-deep .search-select.mat-mdc-select-panel{margin-top:1.875rem;margin-left:.625rem}.search-container{position:relative;width:100%;max-width:32.1875rem}.search-container .search-popup{padding:0 .9375rem .9375rem;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 .3125rem .25rem #0003;border-radius:0 0 .25rem .25rem}.search-container .search-popup hr{border:0;border-top:.0625rem solid #ebebeb;margin:0;position:sticky;top:0;padding-bottom:.9375rem;z-index:1}.search-container .search-popup .search-message{display:inline-block;width:100%;text-align:center;font-size:1rem;padding-top:.75rem}.search-container .search-popup .search-item-info{color:#91263b;text-align:center;font-size:.75rem;margin-bottom:.9375rem;padding-top:.75rem}.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:var(--search-text-color)}.search-container .search-popup ul li.suggestions{font-size:.9375rem;line-height:2.25rem;padding:0 .9375rem 0 2.75rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.search-container .search-popup ul li.suggestions:hover{background-color:var(--search-highlight-bg)}::ng-deep .toolbar-search input{line-height:.875rem;color:var(--search-input-text-color)!important}::ng-deep .toolbar-search input::placeholder{color:var(--search-input-text-color);opacity:.6}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border:.0625rem solid var(--search-border-hover)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-right:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) input{color:var(--search-input-text-color)!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{background:var(--search-dropdown-background)!important;border-radius:.25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:.0625rem solid var(--search-border-hover)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-right:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select,::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-value{color:var(--search-dropdown-text-color)!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-dropdown-text-color)!important;stroke-width:1}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border:.125rem solid var(--search-border-focus)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-right:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) input{color:var(--search-input-text-color)!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{background:var(--search-dropdown-background)!important;border-radius:.25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:.125rem solid var(--search-border-focus)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-right:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select,::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-value{color:var(--search-dropdown-text-color)!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-dropdown-text-color)!important;stroke-width:1}\n"] }]
415
+ ], template: "<ng-container *ngIf=\"!showOnlySearchResultOverlay()\">\n <div class=\"toolbar-search\" *ngIf=\"cfg()\">\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-input\">\n <input\n matInput\n autocomplete=\"off\"\n type=\"text\"\n [placeholder]=\"\n cfg().placeholderFunction?.(searchInput.value, category)\n ?? cfg().placeholder ?? 'Search'\n \"\n #searchInput\n name=\"searchInput\"\n (focus)=\"showSuggestions()\"\n (blur)=\"hideSuggestions()\"\n [(ngModel)]=\"searchBoxInput\"\n (keyup)=\"hitSearchApi($event)\"\n (ngModelChange)=\"onChange(this.searchBoxInput)\"\n [disabled]=\"disabled\"\n />\n <mat-icon matPrefix [className]=\"cfg().searchIconClass\"></mat-icon>\n <mat-icon\n *ngIf=\"searchBoxInput\"\n matSuffix\n [className]=\"cfg().crossIconClass\"\n (click)=\"resetInput()\"\n ></mat-icon>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-select\">\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 cfg().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 {{ cfg().noResultMessage }}\n </ng-container>\n </span>\n <ng-container *ngIf=\"cfg().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[cfg().displayPropertyName],\n searchBoxInput\n )\n \"\n class=\"inline-display\"\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=\"!cfg().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() &&\n fetchModelImageUrlFromSuggestion(suggestion)\n \"\n class=\"suggestions-categorize-false suggestion-image\"\n [src]=\"fetchModelImageUrlFromSuggestion(suggestion)\"\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[cfg().displayPropertyName],\n searchBoxInput\n )\n \"\n class=\"inline-display\"\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=\"!cfg().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]=\"cfg().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{--search-background: #f7f7f7;--search-input-background: #f1f3f4;--search-input-text-color: #6b6b6b;--search-border-hover: #90003b;--search-border-focus: #90003b;--search-dropdown-background: #90003b;--search-dropdown-text-color: #fff;--search-highlight-bg: #fee8e8;--search-heading-color: #9c9c9c;--search-text-color: #333;--search-icon-color: rgba(51, 51, 51, .5019607843)}:host ::ng-deep .mat-mdc-form-field{padding:0;margin:0!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-prefix{padding:0 .5rem 0 .75rem}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-suffix{padding:0 .75rem 0 .5rem}:host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-subscript-wrapper{display:none}.toolbar-search{display:flex;align-items:center;width:100%;max-width:32rem;background-color:var(--search-background)!important;border-radius:0 0 .25rem .25rem;gap:0}.toolbar-search ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper{height:2.5rem;align-items:center}.toolbar-search ::ng-deep .mat-mdc-form-field-infix{min-height:2.25rem;padding:.5rem 0}.toolbar-search-input{width:78%;flex:1 1 auto;margin-right:0!important;font-size:.75rem}.toolbar-search-input ::ng-deep input{margin:0;color:var(--search-input-text-color)!important}.toolbar-search-input ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--search-input-background)!important}.toolbar-search-input ::ng-deep .mdc-notched-outline__leading,.toolbar-search-input ::ng-deep .mdc-notched-outline__notch,.toolbar-search-input ::ng-deep .mdc-notched-outline__trailing{border:none!important;background-color:transparent!important}.toolbar-search-input ::ng-deep .mdc-notched-outline__leading{border-radius:.25rem 0 0 .25rem}.toolbar-search-input ::ng-deep .mdc-notched-outline__trailing{border-radius:0}.icomoon.Search,.icomoon.close{height:1rem;width:1rem;font-size:1rem;color:var(--search-icon-color);padding-bottom:.25rem}.icomoon.close{cursor:pointer}.toolbar-search-select{flex:1 1 auto;margin-left:0!important;min-width:0;width:22%}.toolbar-search-select ::ng-deep .mat-mdc-select-value-text{font-size:.75rem;line-height:normal;white-space:nowrap;overflow:hidden;display:flex;max-width:100%;align-items:center}.toolbar-search-select ::ng-deep .mat-mdc-select{max-width:100%;padding-left:0;padding-right:0}.toolbar-search-select ::ng-deep .mat-mdc-select-value{display:flex;align-items:center;min-width:0;flex:1 1 auto}.toolbar-search-select ::ng-deep .mat-mdc-form-field-text-suffix{display:flex;align-items:center;margin-left:.375rem;flex-shrink:0}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow-wrapper{width:1rem;flex-shrink:0}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow{transform:rotate(0) scale(1.3)!important}.toolbar-search-select ::ng-deep .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-icon-color);stroke-width:1}.toolbar-search-select ::ng-deep .mat-mdc-text-field-wrapper{background-color:var(--search-input-background)!important}.toolbar-search-select ::ng-deep .mdc-notched-outline__leading,.toolbar-search-select ::ng-deep .mdc-notched-outline__notch,.toolbar-search-select ::ng-deep .mdc-notched-outline__trailing{border:none!important;background-color:transparent!important}.toolbar-search-select ::ng-deep .mdc-notched-outline__leading{border-radius:0}.toolbar-search-select ::ng-deep .mdc-notched-outline__trailing{border-radius:0 .25rem .25rem 0}.toolbar-search-select ::ng-deep .mat-mdc-form-field-infix{-webkit-padding-before:.7em;min-height:2.25rem;display:flex;align-items:center;padding:.375rem .25rem}::ng-deep .search-select.mat-mdc-select-panel{margin-top:1.875rem;margin-left:.625rem}.search-container{position:relative;width:100%;max-width:32.1875rem}.search-container .search-popup{padding:0 .9375rem .9375rem;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 .3125rem .25rem #0003;border-radius:0 0 .25rem .25rem}.search-container .search-popup hr{border:0;border-top:.0625rem solid #ebebeb;margin:0;position:sticky;top:0;padding-bottom:.9375rem;z-index:1}.search-container .search-popup .search-message{display:inline-block;width:100%;text-align:center;font-size:1rem;padding-top:.75rem}.search-container .search-popup .search-item-info{color:#91263b;text-align:center;font-size:.75rem;margin-bottom:.9375rem;padding-top:.75rem}.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:var(--search-text-color)}.search-container .search-popup ul li.suggestions{font-size:.9375rem;line-height:2.25rem;padding:0 .9375rem 0 2.75rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.search-container .search-popup ul li.suggestions:hover{background-color:var(--search-highlight-bg)}::ng-deep .toolbar-search input{line-height:.875rem;color:var(--search-input-text-color)!important}::ng-deep .toolbar-search input::placeholder{color:var(--search-input-text-color);opacity:.6}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border:.0625rem solid var(--search-border-hover)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-right:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) input{color:var(--search-input-text-color)!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{background:var(--search-dropdown-background)!important;border-radius:.25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:.0625rem solid var(--search-border-hover)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.0625rem solid var(--search-border-hover)!important;border-bottom:.0625rem solid var(--search-border-hover)!important;border-right:.0625rem solid var(--search-border-hover)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select,::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-value{color:var(--search-dropdown-text-color)!important}::ng-deep .toolbar-search:hover:not(:focus-within) .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-dropdown-text-color)!important;stroke-width:1}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border:.125rem solid var(--search-border-focus)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-right:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-mdc-form-field:not(.mat-form-field-disabled) input{color:var(--search-input-text-color)!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{background:var(--search-dropdown-background)!important;border-radius:.25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__leading{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:.125rem solid var(--search-border-focus)!important;border-right:none!important;border-radius:.25rem 0 0 .25rem!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__notch{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-right:none!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mdc-notched-outline__trailing{border-top:.125rem solid var(--search-border-focus)!important;border-bottom:.125rem solid var(--search-border-focus)!important;border-right:.125rem solid var(--search-border-focus)!important;border-left:none!important;border-radius:0 .25rem .25rem 0!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select,::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-value{color:var(--search-dropdown-text-color)!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-select-arrow svg{fill:none!important;stroke:var(--search-dropdown-text-color)!important;stroke-width:1}\n"] }]
423
416
  }], ctorParameters: () => [{ type: undefined, decorators: [{
424
417
  type: Inject,
425
418
  args: [SEARCH_SERVICE_TOKEN]
@@ -428,25 +421,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
428
421
  }] }, { type: Object, decorators: [{
429
422
  type: Inject,
430
423
  args: [PLATFORM_ID]
431
- }] }, { type: i0.ChangeDetectorRef }, { type: PromiseApiAdapterService }], propDecorators: { config: [{
432
- type: Input
433
- }], searchProvider: [{
434
- type: Input
435
- }], titleTemplate: [{
436
- type: Input
437
- }], subtitleTemplate: [{
438
- type: Input
439
- }], customAllLabel: [{
440
- type: Input
441
- }], showOnlySearchResultOverlay: [{
442
- type: Input
443
- }], customSearchEvent: [{
444
- type: Input
445
- }], clicked: [{
446
- type: Output
447
- }], searched: [{
448
- type: Output
449
- }], searchInputElement: [{
424
+ }] }, { type: i0.ChangeDetectorRef }, { type: PromiseApiAdapterService }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], searchProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchProvider", required: false }] }], titleTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleTemplate", required: false }] }], subtitleTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitleTemplate", required: false }] }], customAllLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "customAllLabel", required: false }] }], showOnlySearchResultOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOnlySearchResultOverlay", required: false }] }], customSearchEvent: [{ type: i0.Input, args: [{ isSignal: true, alias: "customSearchEvent", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }], searched: [{ type: i0.Output, args: ["searched"] }], searchInputElement: [{
450
425
  type: ViewChild,
451
426
  args: ['searchInput']
452
427
  }] } });
@@ -1 +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/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 {\n ControlValueAccessor,\n FormsModule,\n NG_VALUE_ACCESSOR,\n} 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 {CommonModule, isPlatformBrowser} from '@angular/common';\nimport {PromiseApiAdapterService} from './promise-api-adapter.service';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatSelectModule} from '@angular/material/select';\nimport {MatInputModule} from '@angular/material/input';\nconst ALL_LABEL = 'All';\n@Component({\n selector: 'sourceloop-search',\n standalone: true,\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 imports: [\n CommonModule,\n FormsModule,\n MatIconModule,\n MatSelectModule,\n MatFormFieldModule,\n MatInputModule,\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 /* The above code is a setter method in a TypeScript class that takes a parameter `searchProvider` of\ntype `ISearchService<T>` or `ISearchServiceWithPromises<T>`. */\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 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 (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-select\n [value]=\"category\"\n (selectionChange)=\"setCategory($event.value)\"\n panelClass=\"search-select\"\n \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 class=\"inline-display\"\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 suggestion-image\"\n [src]=\"fetchModelImageUrlFromSuggestion(suggestion)\"\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 class=\"inline-display\"\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 {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 */\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,kB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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;;;;"}
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/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 computed,\n effect,\n ElementRef,\n Inject,\n input,\n OnDestroy,\n OnInit,\n Optional,\n output,\n PLATFORM_ID,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {Configuration} from '../lib-configuration';\nimport {Subject} from 'rxjs';\nimport {debounceTime, tap} from 'rxjs/operators';\nimport {\n ControlValueAccessor,\n FormsModule,\n NG_VALUE_ACCESSOR,\n} 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 {CommonModule, isPlatformBrowser} from '@angular/common';\nimport {PromiseApiAdapterService} from './promise-api-adapter.service';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatSelectModule} from '@angular/material/select';\nimport {MatInputModule} from '@angular/material/input';\nconst ALL_LABEL = 'All';\n@Component({\n selector: 'sourceloop-search',\n standalone: true,\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 imports: [\n CommonModule,\n FormsModule,\n MatIconModule,\n MatSelectModule,\n MatFormFieldModule,\n MatInputModule,\n ],\n})\nexport class SearchComponent<T extends IReturnType>\n implements OnInit, OnDestroy, ControlValueAccessor\n{\n readonly cfg = computed(() => {\n const cfg = this.config();\n if (!cfg) {\n throw new Error('SearchComponent: config input is required');\n }\n return cfg;\n });\n config = input<Configuration<T>>();\n searchProvider = input<ISearchService<T> | ISearchServiceWithPromises<T>>();\n\n titleTemplate = input<TemplateRef<any> | undefined>();\n subtitleTemplate = input<TemplateRef<any> | undefined>();\n\n customAllLabel = input<string>(ALL_LABEL);\n showOnlySearchResultOverlay = input<boolean>(false);\n\n customSearchEvent = input<CustomSearchEvent>({\n searchValue: '',\n modelName: ALL_LABEL,\n });\n\n clicked = output<ItemClickedEvent<T>>();\n searched = output<RecentSearchEvent>();\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 searchService!: ISearchService<T>;\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 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 if (searchService) {\n this.searchService = searchService;\n }\n\n effect(() => {\n const cfg = this.config();\n if (!cfg) return;\n\n if (cfg.models) {\n cfg.models.unshift({\n name: ALL_LABEL,\n displayName: this.customAllLabel(),\n });\n } else {\n cfg.models = [\n {\n name: ALL_LABEL,\n displayName: this.customAllLabel(),\n },\n ];\n }\n });\n\n effect(() => {\n let provider = this.searchProvider();\n if (!provider) return;\n\n if (isApiServiceWithPromise(provider)) {\n provider = this.promiseAdapter.adapt(provider);\n }\n this.searchService = provider;\n });\n\n effect(() => {\n const event = this.customSearchEvent();\n if (!event) return;\n\n if (event.searchValue !== undefined) {\n this.searchBoxInput = event.searchValue;\n this.searchOnCustomEventValueChange(this.searchBoxInput);\n }\n\n if (event.modelName) {\n this.setCategory(event.modelName);\n }\n });\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 const cfg = this.config();\n if (!cfg) return;\n eventValue.input = eventValue.input.trim();\n if (!eventValue.input.length) {\n return;\n }\n const order = cfg.order ?? DEFAULT_ORDER;\n const orderString = order.join(' ');\n\n let saveInRecents = cfg.saveInRecents ?? DEFAULT_SAVE_IN_RECENTS;\n if (cfg.saveInRecents && cfg.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: cfg.limit ?? DEFAULT_LIMIT,\n limitByType: cfg.limitByType ?? DEFAULT_LIMIT_TYPE,\n order: orderString,\n offset: cfg.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 const cfg = this.config();\n if (!cfg || cfg.hideRecentSearch) return;\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 //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 const cfg = this.config();\n if (!cfg) return;\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 (cfg.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 cfg = this.config();\n if (!cfg) return;\n this.searchBoxInput = String(suggestion[cfg.displayPropertyName]);\n // converted to string to assign value to searchBoxInput\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 searchOnCustomEventValueChange(value: string) {\n if (value?.length) {\n this.showSuggestions();\n this.hitSearchApi();\n } else {\n this.hideSuggestions();\n }\n }\n}\n","<ng-container *ngIf=\"!showOnlySearchResultOverlay()\">\n <div class=\"toolbar-search\" *ngIf=\"cfg()\">\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-input\">\n <input\n matInput\n autocomplete=\"off\"\n type=\"text\"\n [placeholder]=\"\n cfg().placeholderFunction?.(searchInput.value, category)\n ?? cfg().placeholder ?? 'Search'\n \"\n #searchInput\n name=\"searchInput\"\n (focus)=\"showSuggestions()\"\n (blur)=\"hideSuggestions()\"\n [(ngModel)]=\"searchBoxInput\"\n (keyup)=\"hitSearchApi($event)\"\n (ngModelChange)=\"onChange(this.searchBoxInput)\"\n [disabled]=\"disabled\"\n />\n <mat-icon matPrefix [className]=\"cfg().searchIconClass\"></mat-icon>\n <mat-icon\n *ngIf=\"searchBoxInput\"\n matSuffix\n [className]=\"cfg().crossIconClass\"\n (click)=\"resetInput()\"\n ></mat-icon>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-select\">\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 cfg().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 {{ cfg().noResultMessage }}\n </ng-container>\n </span>\n <ng-container *ngIf=\"cfg().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[cfg().displayPropertyName],\n searchBoxInput\n )\n \"\n class=\"inline-display\"\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=\"!cfg().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() &&\n fetchModelImageUrlFromSuggestion(suggestion)\n \"\n class=\"suggestions-categorize-false suggestion-image\"\n [src]=\"fetchModelImageUrlFromSuggestion(suggestion)\"\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[cfg().displayPropertyName],\n searchBoxInput\n )\n \"\n class=\"inline-display\"\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=\"!cfg().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]=\"cfg().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 {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 */\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;IACH;wGAlBW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EA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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;;;;"}
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, OnInit, OnDestroy, TemplateRef, EventEmitter, ElementRef, ChangeDetectorRef, SimpleChanges } from '@angular/core';
1
+ import * as _angular_core from '@angular/core';
2
+ import { InjectionToken, OnInit, OnDestroy, TemplateRef, ElementRef, ChangeDetectorRef } from '@angular/core';
3
3
  import { Observable, Subject } from 'rxjs';
4
4
  import { ControlValueAccessor } from '@angular/forms';
5
5
 
@@ -99,15 +99,24 @@ declare class Configuration<T = IDefaultReturnType> {
99
99
 
100
100
  declare class PromiseApiAdapterService<T extends IReturnType> {
101
101
  adapt(instance: ISearchServiceWithPromises<T>): ISearchService<T>;
102
- static ɵfac: i0.ɵɵFactoryDeclaration<PromiseApiAdapterService<any>, never>;
103
- static ɵprov: i0.ɵɵInjectableDeclaration<PromiseApiAdapterService<any>>;
102
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PromiseApiAdapterService<any>, never>;
103
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<PromiseApiAdapterService<any>>;
104
104
  }
105
105
 
106
106
  declare class SearchComponent<T extends IReturnType> implements OnInit, OnDestroy, ControlValueAccessor {
107
- private searchService;
108
107
  private readonly platformId;
109
108
  private readonly cdr;
110
109
  private readonly promiseAdapter;
110
+ readonly cfg: _angular_core.Signal<Configuration<T>>;
111
+ config: _angular_core.InputSignal<Configuration<T> | undefined>;
112
+ searchProvider: _angular_core.InputSignal<ISearchService<T> | ISearchServiceWithPromises<T> | undefined>;
113
+ titleTemplate: _angular_core.InputSignal<TemplateRef<any> | undefined>;
114
+ subtitleTemplate: _angular_core.InputSignal<TemplateRef<any> | undefined>;
115
+ customAllLabel: _angular_core.InputSignal<string>;
116
+ showOnlySearchResultOverlay: _angular_core.InputSignal<boolean>;
117
+ customSearchEvent: _angular_core.InputSignal<CustomSearchEvent>;
118
+ clicked: _angular_core.OutputEmitterRef<ItemClickedEvent<T>>;
119
+ searched: _angular_core.OutputEmitterRef<RecentSearchEvent>;
111
120
  searchBoxInput: string;
112
121
  suggestionsDisplay: boolean;
113
122
  categoryDisplay: boolean;
@@ -119,27 +128,7 @@ declare class SearchComponent<T extends IReturnType> implements OnInit, OnDestro
119
128
  input: string;
120
129
  event: Event;
121
130
  }>;
122
- private _config;
123
- get config(): Configuration<T>;
124
- set config(value: Configuration<T>);
125
- set searchProvider(value: ISearchService<T> | ISearchServiceWithPromises<T>);
126
- get searchProvider(): ISearchService<T>;
127
- titleTemplate?: TemplateRef<any>;
128
- subtitleTemplate?: TemplateRef<any>;
129
- /**
130
- * configure when application has own search input and use different all label
131
- */
132
- customAllLabel: string;
133
- /**
134
- * configure to true when to show only search result overlay without search bar
135
- */
136
- showOnlySearchResultOverlay: boolean;
137
- /**
138
- * provide custom search event when showOnlySearchResultOverlay configure to true
139
- */
140
- customSearchEvent: CustomSearchEvent;
141
- clicked: EventEmitter<ItemClickedEvent<T>>;
142
- searched: EventEmitter<RecentSearchEvent>;
131
+ private searchService;
143
132
  onChange: (value: string | undefined) => void;
144
133
  onTouched: () => void;
145
134
  disabled: boolean;
@@ -171,11 +160,9 @@ declare class SearchComponent<T extends IReturnType> implements OnInit, OnDestro
171
160
  model: IModel;
172
161
  items: T[];
173
162
  }[];
174
- ngOnChanges(changes: SimpleChanges): void;
175
163
  searchOnCustomEventValueChange(value: string): void;
176
- private _isCustomSearchEventChange;
177
- static ɵfac: i0.ɵɵFactoryDeclaration<SearchComponent<any>, [{ optional: true; }, null, null, null]>;
178
- 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, true, never>;
164
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SearchComponent<any>, [{ optional: true; }, null, null, null]>;
165
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SearchComponent<any>, "sourceloop-search", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; "searchProvider": { "alias": "searchProvider"; "required": false; "isSignal": true; }; "titleTemplate": { "alias": "titleTemplate"; "required": false; "isSignal": true; }; "subtitleTemplate": { "alias": "subtitleTemplate"; "required": false; "isSignal": true; }; "customAllLabel": { "alias": "customAllLabel"; "required": false; "isSignal": true; }; "showOnlySearchResultOverlay": { "alias": "showOnlySearchResultOverlay"; "required": false; "isSignal": true; }; "customSearchEvent": { "alias": "customSearchEvent"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; "searched": "searched"; }, never, never, true, never>;
179
166
  }
180
167
 
181
168
  export { Configuration, DEBOUNCE_TIME, DEFAULT_LIMIT, DEFAULT_LIMIT_TYPE, DEFAULT_OFFSET, DEFAULT_ORDER, DEFAULT_SAVE_IN_RECENTS, SEARCH_SERVICE_TOKEN, SearchComponent, isApiServiceWithPromise };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sourceloop/search-client",
3
- "version": "9.0.5",
3
+ "version": "9.1.0",
4
4
  "description": "A global search component for search microservice.",
5
5
  "peerDependencies": {
6
6
  "@angular/animations": "^20.0.3",
@@ -33,7 +33,7 @@
33
33
  "author": "Sourcefuse",
34
34
  "license": "MIT",
35
35
  "private": false,
36
- "gitHead": "991375c61ea829f5bdcfb19a76f2b6ae4b0772dd",
36
+ "gitHead": "e80fcc36df6d9a1be8abd38a4d33a331f668154b",
37
37
  "module": "fesm2022/sourceloop-search-client.mjs",
38
38
  "typings": "index.d.ts",
39
39
  "exports": {