@sourceloop/search-client 4.3.2 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +17 -16
  2. package/esm2020/lib/lib-configuration.mjs +63 -0
  3. package/esm2020/lib/search/search.component.mjs +315 -0
  4. package/esm2020/lib/search-lib.module.mjs +50 -0
  5. package/{esm2015/lib/types.js → esm2020/lib/types.mjs} +0 -0
  6. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  7. package/{esm2015/sourceloop-search-client.js → esm2020/sourceloop-search-client.mjs} +0 -0
  8. package/fesm2015/sourceloop-search-client.mjs +449 -0
  9. package/fesm2015/sourceloop-search-client.mjs.map +1 -0
  10. package/fesm2020/sourceloop-search-client.mjs +443 -0
  11. package/fesm2020/sourceloop-search-client.mjs.map +1 -0
  12. package/lib/search/search.component.d.ts +3 -0
  13. package/lib/search-lib.module.d.ts +13 -0
  14. package/package.json +33 -21
  15. package/sourceloop-search-client.d.ts +1 -0
  16. package/bundles/sourceloop-search-client.umd.js +0 -428
  17. package/bundles/sourceloop-search-client.umd.js.map +0 -1
  18. package/esm2015/lib/lib-configuration.js +0 -66
  19. package/esm2015/lib/lib-configuration.ngsummary.json +0 -1
  20. package/esm2015/lib/search/search.component.js +0 -297
  21. package/esm2015/lib/search/search.component.ngfactory.js +0 -129
  22. package/esm2015/lib/search/search.component.ngsummary.json +0 -1
  23. package/esm2015/lib/search/search.component.scss.shim.ngstyle.js +0 -9
  24. package/esm2015/lib/search-lib.module.js +0 -29
  25. package/esm2015/lib/search-lib.module.ngfactory.js +0 -32
  26. package/esm2015/lib/search-lib.module.ngsummary.json +0 -1
  27. package/esm2015/lib/types.ngsummary.json +0 -1
  28. package/esm2015/public-api.ngsummary.json +0 -1
  29. package/esm2015/sourceloop-search-client.ngsummary.json +0 -1
  30. package/fesm2015/sourceloop-search-client.js +0 -408
  31. package/fesm2015/sourceloop-search-client.js.map +0 -1
  32. package/lib/search/search.component.ngfactory.d.ts +0 -1
  33. package/lib/search/search.component.scss.shim.ngstyle.d.ts +0 -1
  34. package/lib/search-lib.module.ngfactory.d.ts +0 -3
  35. package/sourceloop-search-client.metadata.json +0 -1
@@ -1,428 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/http'), require('@angular/core'), require('@angular/flex-layout'), require('@angular/forms'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@angular/material/input'), require('@angular/material/select'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@sourceloop/search-client', ['exports', '@angular/common', '@angular/common/http', '@angular/core', '@angular/flex-layout', '@angular/forms', '@angular/material/form-field', '@angular/material/icon', '@angular/material/input', '@angular/material/select', 'rxjs', 'rxjs/operators'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.sourceloop = global.sourceloop || {}, global.sourceloop["search-client"] = {}), global.ng.common, global.ng.common.http, global.ng.core, global.ng.flexLayout, global.ng.forms, global.ng.material.formField, global.ng.material.icon, global.ng.material.input, global.ng.material.select, global.rxjs, global.rxjs.operators));
5
- })(this, (function (exports, common, http, core, flexLayout, forms, formField, icon, input, select, rxjs, operators) { 'use strict';
6
-
7
- // cant use T extends IReturnType here
8
- var SEARCH_SERVICE_TOKEN = new core.InjectionToken('Search_Service_Token');
9
- // IRequestParameters default values
10
- var DEFAULT_LIMIT = 20;
11
- var DEFAULT_LIMIT_TYPE = false;
12
- var DEFAULT_ORDER = [];
13
- var DEBOUNCE_TIME = 1000;
14
- var DEFAULT_OFFSET = 0;
15
- var DEFAULT_SAVE_IN_RECENTS = true;
16
-
17
- var ALL_LABEL = 'All';
18
- var SearchComponent = /** @class */ (function () {
19
- function SearchComponent(searchService,
20
- // tslint:disable-next-line:ban-types
21
- platformId, cdr) {
22
- this.searchService = searchService;
23
- this.platformId = platformId;
24
- this.cdr = cdr;
25
- this.searchBoxInput = '';
26
- this.suggestionsDisplay = false;
27
- this.categoryDisplay = false;
28
- this.searching = false;
29
- this.suggestions = [];
30
- this.recentSearches = [];
31
- this.category = ALL_LABEL;
32
- this.searchRequest$ = new rxjs.Subject();
33
- // emitted when user clicks one of the suggested results (including recent search sugestions)
34
- this.clicked = new core.EventEmitter();
35
- this.searched = new core.EventEmitter();
36
- this.disabled = false;
37
- }
38
- Object.defineProperty(SearchComponent.prototype, "config", {
39
- get: function () {
40
- return this._config;
41
- },
42
- set: function (value) {
43
- this._config = value;
44
- if (value && value.models) {
45
- value.models.unshift({
46
- name: ALL_LABEL,
47
- displayName: ALL_LABEL,
48
- });
49
- }
50
- else if (value && !value.models) {
51
- value.models = [
52
- {
53
- name: ALL_LABEL,
54
- displayName: ALL_LABEL,
55
- },
56
- ];
57
- }
58
- else {
59
- // do nothing
60
- }
61
- },
62
- enumerable: false,
63
- configurable: true
64
- });
65
- SearchComponent.prototype.ngOnInit = function () {
66
- var _this = this;
67
- this.searchRequest$
68
- .pipe(operators.tap(function (v) { return (_this.suggestions = []); }), operators.debounceTime(DEBOUNCE_TIME))
69
- .subscribe(function (value) {
70
- _this.searched.emit({
71
- event: value.event,
72
- keyword: value.input,
73
- category: _this.category,
74
- });
75
- _this.getSuggestions(value);
76
- _this.cdr.markForCheck();
77
- });
78
- };
79
- // ControlValueAccessor Implementation
80
- SearchComponent.prototype.writeValue = function (value) {
81
- this.searchBoxInput = value;
82
- };
83
- // When the value in the UI is changed, this method will invoke a callback function
84
- SearchComponent.prototype.registerOnChange = function (fn) {
85
- this.onChange = fn;
86
- };
87
- SearchComponent.prototype.registerOnTouched = function (fn) {
88
- this.onTouched = fn;
89
- };
90
- SearchComponent.prototype.setDisabledState = function (isDisabled) {
91
- this.disabled = isDisabled;
92
- };
93
- SearchComponent.prototype.getSuggestions = function (eventValue) {
94
- var _this = this;
95
- var _a, _b, _c, _d, _e;
96
- eventValue.input = eventValue.input.trim();
97
- if (!eventValue.input.length) {
98
- return;
99
- }
100
- var order = (_a = this.config.order) !== null && _a !== void 0 ? _a : DEFAULT_ORDER;
101
- var orderString = '';
102
- order.forEach(function (preference) { return (orderString = "" + orderString + preference + " "); });
103
- var saveInRecents = (_b = this.config.saveInRecents) !== null && _b !== void 0 ? _b : DEFAULT_SAVE_IN_RECENTS;
104
- if (this.config.saveInRecents && this.config.saveInRecentsOnlyOnEnter) {
105
- if (!eventValue.event ||
106
- (eventValue.event instanceof KeyboardEvent &&
107
- eventValue.event.key === 'Enter')) {
108
- saveInRecents = true; // save in recents only on enter or change in category
109
- }
110
- else {
111
- // do not save in recent search on typing
112
- saveInRecents = false;
113
- }
114
- }
115
- /* need to put default value here and not in contructor
116
- because sonar was giving code smell with definite assertion as all these parameters are optional */
117
- var requestParameters = {
118
- match: eventValue.input,
119
- sources: this._categoryToSourceName(this.category),
120
- limit: (_c = this.config.limit) !== null && _c !== void 0 ? _c : DEFAULT_LIMIT,
121
- limitByType: (_d = this.config.limitByType) !== null && _d !== void 0 ? _d : DEFAULT_LIMIT_TYPE,
122
- order: orderString,
123
- offset: (_e = this.config.offset) !== null && _e !== void 0 ? _e : DEFAULT_OFFSET,
124
- };
125
- this.searching = true;
126
- this.cdr.markForCheck();
127
- this.searchService
128
- .searchApiRequest(requestParameters, saveInRecents)
129
- .subscribe(function (value) {
130
- _this.suggestions = value;
131
- _this.searching = false;
132
- _this.cdr.markForCheck();
133
- }, function (_error) {
134
- _this.suggestions = [];
135
- _this.searching = false;
136
- _this.cdr.markForCheck();
137
- });
138
- };
139
- SearchComponent.prototype.getRecentSearches = function () {
140
- var _this = this;
141
- if (!this.config.hideRecentSearch &&
142
- this.searchService.recentSearchApiRequest) {
143
- this.searchService.recentSearchApiRequest().subscribe(function (value) {
144
- _this.recentSearches = value;
145
- _this.cdr.markForCheck();
146
- }, function (_error) {
147
- _this.recentSearches = [];
148
- _this.cdr.markForCheck();
149
- });
150
- }
151
- };
152
- // event can be KeyBoardEvent or Event of type 'change' fired on change in value of drop down for category
153
- SearchComponent.prototype.hitSearchApi = function (event) {
154
- // this will happen only in case user searches something and then erases it, we need to update recent search
155
- if (!this.searchBoxInput) {
156
- this.suggestions = [];
157
- this.getRecentSearches();
158
- return;
159
- }
160
- // no debounce time needed in case of searchOnlyOnEnter
161
- if (this.config.searchOnlyOnEnter) {
162
- if (!event || (event instanceof KeyboardEvent && event.key === 'Enter')) {
163
- this.getSuggestions({ input: this.searchBoxInput, event: event });
164
- }
165
- return;
166
- }
167
- // no debounce time needed in case of change in category
168
- if (!event) {
169
- this.getSuggestions({ input: this.searchBoxInput, event: event });
170
- return;
171
- }
172
- this.searchRequest$.next({
173
- input: this.searchBoxInput,
174
- event: event,
175
- });
176
- };
177
- SearchComponent.prototype.populateValue = function (suggestion, event) {
178
- var value = suggestion[this.config.displayPropertyName]; // converted to string to assign value to searchBoxInput
179
- this.searchBoxInput = value;
180
- this.suggestionsDisplay = false;
181
- // ngModelChange doesn't detect change in value when populated from outside, hence calling manually
182
- this.onChange(this.searchBoxInput);
183
- // need to do this to show more search options for selected suggestion - just in case user reopens search input
184
- this.getSuggestions({ input: this.searchBoxInput, event: event });
185
- this.clicked.emit({ item: suggestion, event: event });
186
- };
187
- SearchComponent.prototype.populateValueRecentSearch = function (recentSearch, event) {
188
- event.stopPropagation();
189
- event.preventDefault();
190
- var value = recentSearch['match'];
191
- this.searchBoxInput = value;
192
- this.suggestionsDisplay = false;
193
- this.onChange(this.searchBoxInput);
194
- // need to do this to show more search options for selected suggestion - just in case user reopens search input
195
- this.getSuggestions({ input: this.searchBoxInput, event: event });
196
- this.focusInput();
197
- this.showSuggestions();
198
- };
199
- SearchComponent.prototype.fetchModelImageUrlFromSuggestion = function (suggestion) {
200
- var modelName = suggestion['source'];
201
- var url;
202
- this.config.models.forEach(function (model) {
203
- if (model.name === modelName && model.imageUrl) {
204
- url = model.imageUrl;
205
- }
206
- });
207
- return url;
208
- };
209
- SearchComponent.prototype.boldString = function (str, substr) {
210
- var strRegExp = new RegExp("(" + substr + ")", 'gi');
211
- var stringToMakeBold = str;
212
- return stringToMakeBold.replace(strRegExp, "<b>$1</b>");
213
- };
214
- SearchComponent.prototype.hideSuggestions = function () {
215
- this.suggestionsDisplay = false;
216
- this.onTouched();
217
- };
218
- SearchComponent.prototype.showSuggestions = function () {
219
- this.suggestionsDisplay = true;
220
- this.getRecentSearches();
221
- };
222
- SearchComponent.prototype.focusInput = function () {
223
- if (common.isPlatformBrowser(this.platformId)) {
224
- this.searchInputElement.nativeElement.focus();
225
- }
226
- };
227
- SearchComponent.prototype.setCategory = function (category) {
228
- this.category = category;
229
- this.categoryDisplay = false;
230
- if (this.searchBoxInput) {
231
- this.hitSearchApi();
232
- this.focusInput();
233
- this.showSuggestions();
234
- }
235
- };
236
- SearchComponent.prototype.showCategory = function () {
237
- this.categoryDisplay = !this.categoryDisplay;
238
- };
239
- SearchComponent.prototype.hideCategory = function () {
240
- this.categoryDisplay = false;
241
- };
242
- SearchComponent.prototype.resetInput = function () {
243
- this.searchBoxInput = '';
244
- this.suggestions = [];
245
- this.suggestionsDisplay = true;
246
- this.focusInput();
247
- // ngModelChange doesn't detect change in value when populated from outside, hence calling manually
248
- this.onChange(this.searchBoxInput);
249
- this.getRecentSearches();
250
- };
251
- SearchComponent.prototype.ngOnDestroy = function () {
252
- this.searchRequest$.unsubscribe();
253
- };
254
- SearchComponent.prototype._categoryToSourceName = function (category) {
255
- if (category === ALL_LABEL) {
256
- return [];
257
- }
258
- else {
259
- return [category];
260
- }
261
- };
262
- SearchComponent.prototype.getModelFromModelName = function (name) {
263
- return this.config.models.find(function (item) { return item.name === name; });
264
- };
265
- SearchComponent.prototype.getModelsWithSuggestions = function () {
266
- var _this = this;
267
- var modelsWithSuggestions = [];
268
- var sources = [];
269
- this.suggestions.forEach(function (suggestion) {
270
- if (sources.indexOf(suggestion['source']) >= 0) {
271
- modelsWithSuggestions.every(function (modelWithSuggestions) {
272
- if (modelWithSuggestions.model.name === suggestion['source']) {
273
- modelWithSuggestions.items.push(suggestion);
274
- return false;
275
- }
276
- return true;
277
- });
278
- }
279
- else {
280
- var model = _this.getModelFromModelName(suggestion['source']);
281
- modelsWithSuggestions.push({ model: model, items: [suggestion] });
282
- sources.push(suggestion['source']);
283
- }
284
- });
285
- return modelsWithSuggestions;
286
- };
287
- return SearchComponent;
288
- }());
289
- SearchComponent.decorators = [
290
- { type: core.Component, args: [{
291
- selector: 'sourceloop-search',
292
- template: "<div fxLayout fxLayoutAlign=\"start center\" class=\"toolbar-search\">\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-input\">\n <input\n matInput\n autocomplete=\"off\"\n type=\"text\"\n [placeholder]=\"\n config.placeholderFunction\n ? config.placeholderFunction(searchInput.value, category)\n : config.placeholder || 'Search'\n \"\n #searchInput\n name=\"searchInput\"\n (focus)=\"showSuggestions()\"\n (blur)=\"hideSuggestions()\"\n [(ngModel)]=\"searchBoxInput\"\n (keyup)=\"hitSearchApi($event)\"\n placeholder=\"Search\"\n (ngModelChange)=\"onChange(this.searchBoxInput)\"\n [disabled]=\"disabled\"\n />\n <mat-icon matPrefix [className]=\"config.searchIconClass\"></mat-icon>\n <mat-icon\n *ngIf=\"searchBoxInput\"\n matSuffix\n [className]=\"config.crossIconClass\"\n (click)=\"resetInput()\"\n ></mat-icon>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" class=\"toolbar-search-select\">\n <mat-icon matSuffix [className]=\"config.dropDownButtonIconClass\"></mat-icon>\n <mat-select\n [value]=\"category\"\n (selectionChange)=\"setCategory($event.value)\"\n panelClass=\"search-select\"\n >\n <mat-option [value]=\"model.name\" *ngFor=\"let model of config.models\">\n {{ model.displayName }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n</div>\n\n<div class=\"search-container\">\n <div\n *ngIf=\"suggestionsDisplay && (recentSearches.length || suggestions.length)\"\n class=\"search-popup\"\n >\n <ng-container *ngIf=\"searchBoxInput\">\n <span *ngIf=\"suggestions.length === 0\" class=\"search-message\">\n <ng-container *ngIf=\"searching\"> searching... </ng-container>\n <ng-container *ngIf=\"!searching\">\n {{ config.noResultMessage }}\n </ng-container>\n </span>\n <ng-container *ngIf=\"config.categorizeResults && suggestions.length\">\n <div\n class=\"search-result\"\n *ngFor=\"let modelWithSuggestions of getModelsWithSuggestions()\"\n >\n <h3 class=\"suggestions-heading\">\n <img\n *ngIf=\"modelWithSuggestions.model.imageUrl\"\n [src]=\"modelWithSuggestions.model.imageUrl\"\n [alt]=\"modelWithSuggestions.model.displayName\"\n />\n {{ modelWithSuggestions.model.displayName }} ({{\n modelWithSuggestions.items.length\n }})\n </h3>\n <ul>\n <li\n *ngFor=\"let suggestion of modelWithSuggestions.items\"\n (mousedown)=\"populateValue(suggestion, $event)\"\n class=\"suggestions\"\n >\n <ng-container *ngIf=\"subtitleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n subtitleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n <p\n *ngIf=\"!titleTemplate\"\n [innerHTML]=\"\n boldString(\n suggestion[config.displayPropertyName],\n searchBoxInput\n )\n \"\n style=\"display: inline\"\n ></p>\n <ng-container *ngIf=\"titleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n titleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n </li>\n </ul>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!config.categorizeResults\">\n <div class=\"search-result\">\n <ul>\n <li\n *ngFor=\"let suggestion of suggestions\"\n (mousedown)=\"populateValue(suggestion, $event)\"\n >\n <!--Need to call fetchModelImageUrlFromSuggestion as each suggestion can come from different model-->\n <img\n *ngIf=\"\n !titleTemplate && fetchModelImageUrlFromSuggestion(suggestion)\n \"\n class=\"suggestions-categorize-false\"\n [src]=\"fetchModelImageUrlFromSuggestion(suggestion)\"\n style=\"margin-right: 5px\"\n alt=\"Img\"\n />\n <ng-container *ngIf=\"subtitleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n subtitleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n <p\n *ngIf=\"!titleTemplate\"\n [innerHTML]=\"\n boldString(\n suggestion[config.displayPropertyName],\n searchBoxInput\n )\n \"\n style=\"display: inline\"\n ></p>\n <ng-container *ngIf=\"titleTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n titleTemplate;\n context: {$implicit: suggestion}\n \"\n >\n </ng-container>\n </ng-container>\n </li>\n </ul>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"!config.hideRecentSearch && recentSearches.length > 0\">\n <div class=\"recent-searches\">\n <h3 class=\"suggestions-heading\">Recent Searches</h3>\n <ul>\n <li\n *ngFor=\"let recentSearch of recentSearches\"\n class=\"suggestions\"\n (mousedown)=\"populateValueRecentSearch(recentSearch, $event)\"\n >\n <mat-icon\n matPrefix\n [className]=\"config.recentSearchIconClass\"\n ></mat-icon>\n\n <span>&nbsp;{{ recentSearch.match }}</span>\n </li>\n </ul>\n </div>\n </ng-container>\n </div>\n</div>\n",
293
- providers: [
294
- {
295
- provide: forms.NG_VALUE_ACCESSOR,
296
- useExisting: SearchComponent,
297
- multi: true,
298
- },
299
- ],
300
- styles: [":host ::ng-deep .mat-form-field-wrapper{padding:0}:host ::ng-deep .mat-form-field-wrapper .mat-form-field-prefix{margin-right:12px}.toolbar-search-input{width:86%}.toolbar-search-input ::ng-deep input{margin:0}.toolbar-search-input ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-start{border-color:transparent}.toolbar-search-input ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-end{border:none;border-radius:0}.icomoon.Search,.icomoon.close{height:1rem;width:1rem;font-size:1rem;color:#33333380;padding-bottom:4px}.icomoon.close{cursor:pointer}.toolbar-search-select{width:calc(100% - 86%)}.toolbar-search-select ::ng-deep .mat-select-arrow{opacity:0}.toolbar-search-select ::ng-deep .mat-select-arrow-wrapper{display:inline-block;width:1px}.toolbar-search-select ::ng-deep .mat-select-value-text{font-size:9px}.toolbar-search-select ::ng-deep .mat-form-field-suffix .mat-icon{width:12px;font-size:14px}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-start{border-color:transparent;border-radius:0}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-outline:first-child .mat-form-field-outline-end{border:none}.toolbar-search-select ::ng-deep .mat-form-field-flex .mat-form-field-infix{-webkit-padding-before:.7em!important}.toolbar-search{width:515px;background-color:#f7f7f7;border-radius:0 0 4px 4px}.toolbar-search ::ng-deep .mat-form-field-appearance-outline .mat-form-field-flex{height:39px;align-items:center!important}.toolbar-search ::ng-deep .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0}.toolbar-search ::ng-deep .mat-form-field-infix{height:auto!important}.search-container{position:relative;width:515px}.search-container .search-popup{padding:0 15px 15px;margin:0;max-height:80vh;overflow-x:hidden;overflow-y:auto;position:absolute;top:100%;left:0px;right:0px;z-index:9999;background-color:#fff;box-shadow:0 5px 4px #0003;border-radius:0 0 4px 4px}.search-container .search-popup hr{border:0;border-top:1px solid #ebebeb;margin:0;position:sticky;top:0;padding:0 0 15px;z-index:1}.search-container .search-popup .search-message{display:inline-block;width:100%;text-align:center;font-size:16px;padding-top:12px}.search-container .search-popup .search-item-info{color:#91263b;text-align:center;font-size:12px;margin-bottom:15px;padding-top:12px}.search-container .search-popup ul{padding:0;margin:0}.search-container .search-popup ul li{list-style:none;font-size:1rem;font-weight:400;line-height:1.5;color:#333}.search-container .search-popup ul li.suggestions{font-size:15px;line-height:36px;padding:0 15px 0 44px;align-items:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.search-container .search-popup ul li.suggestions:hover{background-color:#fee8e8}.search-container .search-popup ul li.suggestions svg{margin-right:5px}.search-container .search-popup ul li.suggestions-categorize-false:hover{background-color:#fee8e8}.search-container .search-popup .search-result{padding:10px 0 0;margin:0 -15px}.search-container .search-popup .search-result.no-categorize-result ul{width:100%;padding:0;margin:0 0 10px}.search-container .search-popup .search-result.no-categorize-result ul li{font-size:15px;line-height:36px;padding:0 15px 0 31px;display:flex;align-items:center;cursor:pointer}.search-container .search-popup .search-result.no-categorize-result ul li:hover{background-color:#fee8e8}.search-container .search-popup .search-result.no-categorize-result ul li img{width:18px;margin-right:9px}.search-container .search-popup .suggestions-heading{color:#9c9c9c;font-size:14px;font-weight:normal;margin:0 0 10px 17px;display:flex;align-items:center;position:relative}.search-container .search-popup .suggestions-heading .show-more{position:absolute;right:20px;color:#d1d1d1;font-size:12px;cursor:pointer;text-decoration:none}.search-container .search-popup .suggestions-heading .show-more :hover{text-decoration:underline}.search-container .search-popup .suggestions-heading img{width:18px;margin-right:9px}.search-container .search-popup .recent-searches{padding:10px 0 0;margin:0 -15px}.search-container .search-popup .recent-searches ul{display:inline-block;width:100%}.search-container .search-popup .recent-searches ul li.suggestions{display:flex}.search-container .search-popup .recent-searches ul li.suggestions span{width:100%;overflow:hidden;text-overflow:ellipsis}.search-container .search-popup .recent-searches .suggestions{display:flex}.search-container .search-popup .recent-searches .suggestions-heading{margin-left:30px}.search-container .search-popup .recent-searches li.suggestions{padding-left:31px}::ng-deep .search-select.mat-select-panel{margin-top:30px;margin-left:10px}::ng-deep .search-select .mat-option-text{display:contents!important}::ng-deep .toolbar-search .mat-form-field-infix{font-size:14px}::ng-deep .toolbar-search input{line-height:14px}::ng-deep .toolbar-search .mat-form-field-outline:first-child .mat-form-field-outline-start,::ng-deep .toolbar-search .mat-form-field-outline:first-child .mat-form-field-outline-end{background-color:#f1f3f4}::ng-deep .toolbar-search:hover .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-width:1px!important;border-color:#a53159!important}::ng-deep .toolbar-search:hover .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border:1px solid #a53159!important;border-left-style:none!important;border-right-style:none!important;border-top-right-radius:0!important;border-bottom-right-radius:0!important}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-radius:0;border-color:transparent!important;background-color:#a53159!important}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border-width:1px!important;border-color:#a53159!important;background-color:#a53159!important}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-select{color:#fff!important}::ng-deep .toolbar-search:hover .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .icomoon.arrow_down{color:#fff}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-width:2px!important;border-color:#90003b!important}::ng-deep .toolbar-search:focus-within .toolbar-search-input.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border:2px solid #90003b!important;border-left-style:none!important;border-right-style:none!important;border-top-right-radius:0!important;border-bottom-right-radius:0!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-start{border-radius:0;border-color:transparent!important;background-color:#90003b!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-form-field-outline .mat-form-field-outline-end{border-width:2px!important;border-color:#90003b!important;background-color:#90003b!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .mat-select{color:#fff!important}::ng-deep .toolbar-search:focus-within .toolbar-search-select.mat-form-field:not(.mat-form-field-disabled) .icomoon.arrow_down{color:#fff}::ng-deep .toolbar-search .mat-select-arrow{opacity:0}\n"]
301
- },] }
302
- ];
303
- SearchComponent.ctorParameters = function () { return [
304
- { type: undefined, decorators: [{ type: core.Inject, args: [SEARCH_SERVICE_TOKEN,] }] },
305
- { type: Object, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] },
306
- { type: core.ChangeDetectorRef }
307
- ]; };
308
- SearchComponent.propDecorators = {
309
- config: [{ type: core.Input }],
310
- titleTemplate: [{ type: core.Input }],
311
- subtitleTemplate: [{ type: core.Input }],
312
- clicked: [{ type: core.Output }],
313
- searched: [{ type: core.Output }],
314
- searchInputElement: [{ type: core.ViewChild, args: ['searchInput',] }]
315
- };
316
-
317
- var SearchLibModule = /** @class */ (function () {
318
- function SearchLibModule() {
319
- }
320
- return SearchLibModule;
321
- }());
322
- SearchLibModule.decorators = [
323
- { type: core.NgModule, args: [{
324
- declarations: [SearchComponent],
325
- imports: [
326
- common.CommonModule,
327
- forms.FormsModule,
328
- http.HttpClientModule,
329
- select.MatSelectModule,
330
- formField.MatFormFieldModule,
331
- icon.MatIconModule,
332
- input.MatInputModule,
333
- flexLayout.FlexLayoutModule,
334
- ],
335
- exports: [SearchComponent],
336
- },] }
337
- ];
338
-
339
- var Configuration = /** @class */ (function () {
340
- function Configuration(d) {
341
- checkForError(d);
342
- this.displayPropertyName = d.displayPropertyName;
343
- this.models = d.models;
344
- /* IRequestParameters - will be given default values before call is made in case undefined/null,
345
- otherwise there ! is used on which sonar gives code smell */
346
- this.limit = d.limit;
347
- this.limitByType = d.limitByType;
348
- this.order = d.order;
349
- this.offset = d.offset;
350
- this.saveInRecents = d.saveInRecents;
351
- var displayTexts = setDisplayText(d);
352
- this.noResultMessage = displayTexts.noResultMessage;
353
- this.placeholder = displayTexts.placeholder;
354
- this.placeholderFunction = displayTexts.placeholderFunction;
355
- var searchConfig = setSearchConfig(d);
356
- this.categorizeResults = searchConfig.categorizeResults;
357
- this.hideRecentSearch = searchConfig.hideRecentSearch;
358
- this.hideCategorizeButton = searchConfig.hideCategorizeButton;
359
- this.saveInRecentsOnlyOnEnter = searchConfig.saveInRecentsOnlyOnEnter;
360
- this.searchOnlyOnEnter = searchConfig.searchOnlyOnEnter;
361
- var classes = setIconClasses(d);
362
- this.searchIconClass = classes.searchIconClass;
363
- this.crossIconClass = classes.crossIconClass;
364
- this.dropDownButtonIconClass = classes.dropDownButtonIconClass;
365
- this.recentSearchIconClass = classes.recentSearchIconClass;
366
- }
367
- return Configuration;
368
- }());
369
- function checkForError(d) {
370
- if (d.categorizeResults === false &&
371
- (d.hideCategorizeButton === false || d.hideCategorizeButton === undefined)) {
372
- throw new Error('You must provide hideCategorizeButton:true as categorizeResults is false');
373
- }
374
- if (d.saveInRecents === false && d.saveInRecentsOnlyOnEnter === true) {
375
- throw new Error('You must provide saveInRecents:true for saveInRecentsOnlyOnEnter:true');
376
- }
377
- }
378
- function setDisplayText(d) {
379
- var _a, _b;
380
- return {
381
- placeholder: (_a = d.placeholder) !== null && _a !== void 0 ? _a : 'Search',
382
- noResultMessage: (_b = d.noResultMessage) !== null && _b !== void 0 ? _b : 'No result found',
383
- placeholderFunction: d.placeholderFunction,
384
- };
385
- }
386
- function setSearchConfig(d) {
387
- var _a, _b, _c, _d, _e;
388
- return {
389
- categorizeResults: (_a = d.categorizeResults) !== null && _a !== void 0 ? _a : true,
390
- hideRecentSearch: (_b = d.hideRecentSearch) !== null && _b !== void 0 ? _b : false,
391
- hideCategorizeButton: (_c = d.hideCategorizeButton) !== null && _c !== void 0 ? _c : false,
392
- saveInRecentsOnlyOnEnter: (_d = d.saveInRecentsOnlyOnEnter) !== null && _d !== void 0 ? _d : false,
393
- searchOnlyOnEnter: (_e = d.searchOnlyOnEnter) !== null && _e !== void 0 ? _e : false,
394
- };
395
- }
396
- function setIconClasses(d) {
397
- var _a, _b, _c, _d;
398
- return {
399
- searchIconClass: (_a = d.searchIconClass) !== null && _a !== void 0 ? _a : 'icomoon Search',
400
- crossIconClass: (_b = d.crossIconClass) !== null && _b !== void 0 ? _b : 'icomoon close',
401
- dropDownButtonIconClass: (_c = d.dropDownButtonIconClass) !== null && _c !== void 0 ? _c : 'icomoon arrow_down',
402
- recentSearchIconClass: (_d = d.recentSearchIconClass) !== null && _d !== void 0 ? _d : 'icomoon Search',
403
- };
404
- }
405
-
406
- /*
407
- * Public API Surface of my-lib
408
- */
409
-
410
- /**
411
- * Generated bundle index. Do not edit.
412
- */
413
-
414
- exports.Configuration = Configuration;
415
- exports.DEBOUNCE_TIME = DEBOUNCE_TIME;
416
- exports.DEFAULT_LIMIT = DEFAULT_LIMIT;
417
- exports.DEFAULT_LIMIT_TYPE = DEFAULT_LIMIT_TYPE;
418
- exports.DEFAULT_OFFSET = DEFAULT_OFFSET;
419
- exports.DEFAULT_ORDER = DEFAULT_ORDER;
420
- exports.DEFAULT_SAVE_IN_RECENTS = DEFAULT_SAVE_IN_RECENTS;
421
- exports.SEARCH_SERVICE_TOKEN = SEARCH_SERVICE_TOKEN;
422
- exports.SearchComponent = SearchComponent;
423
- exports.SearchLibModule = SearchLibModule;
424
-
425
- Object.defineProperty(exports, '__esModule', { value: true });
426
-
427
- }));
428
- //# sourceMappingURL=sourceloop-search-client.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sourceloop-search-client.umd.js","sources":["../../src/lib/types.ts","../../src/lib/search/search.component.ts","../../src/lib/search-lib.module.ts","../../src/lib/lib-configuration.ts","../../src/public-api.ts","../../src/sourceloop-search-client.ts"],"sourcesContent":["import {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\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;\n","import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n OnDestroy,\n OnInit,\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 {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {\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} from '../types';\nimport {isPlatformBrowser} from '@angular/common';\n\nconst ALL_LABEL = 'All';\n@Component({\n selector: 'sourceloop-search',\n templateUrl: './search.component.html',\n styleUrls: ['./search.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: SearchComponent,\n multi: true,\n },\n ],\n})\nexport class SearchComponent<T extends IReturnType>\n implements OnInit, OnDestroy, ControlValueAccessor\n{\n searchBoxInput = '';\n suggestionsDisplay = false;\n categoryDisplay = false;\n searching = false;\n suggestions: T[] = [];\n recentSearches: ISearchQuery[] = [];\n category: string = ALL_LABEL;\n searchRequest$ = new Subject<{input: string; event: Event}>();\n\n private _config!: Configuration<T>;\n public get config(): Configuration<T> {\n return this._config;\n }\n @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: ALL_LABEL,\n });\n } else if (value && !value.models) {\n value.models = [\n {\n name: ALL_LABEL,\n displayName: ALL_LABEL,\n },\n ];\n } else {\n // do nothing\n }\n }\n\n @Input() titleTemplate?: TemplateRef<any>;\n @Input() subtitleTemplate?: TemplateRef<any>;\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 & 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 private readonly searchService: ISearchService<T>,\n // tslint:disable-next-line:ban-types\n @Inject(PLATFORM_ID) private readonly platformId: Object,\n private readonly cdr: ChangeDetectorRef,\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 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' fired on change in value of drop down for category\n hitSearchApi(event?: Event) {\n // this will happen only in case user searches something and 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; // converted to string to assign value to searchBoxInput\n this.searchBoxInput = value;\n this.suggestionsDisplay = false;\n // ngModelChange doesn't detect change in value when populated from outside, hence calling manually\n this.onChange(this.searchBoxInput);\n // need to do this to show more search options for selected 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 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 (isPlatformBrowser(this.platformId)) {\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 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 (category === ALL_LABEL) {\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","import {CommonModule} from '@angular/common';\nimport {HttpClientModule} from '@angular/common/http';\nimport {NgModule} from '@angular/core';\nimport {FlexLayoutModule} from '@angular/flex-layout';\nimport {FormsModule} from '@angular/forms';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatInputModule} from '@angular/material/input';\nimport {MatSelectModule} from '@angular/material/select';\n\nimport {SearchComponent} from './search/search.component';\n\n@NgModule({\n declarations: [SearchComponent],\n imports: [\n CommonModule,\n FormsModule,\n HttpClientModule,\n MatSelectModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n FlexLayoutModule,\n ],\n exports: [SearchComponent],\n})\nexport class SearchLibModule {}\n","import {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, 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","/*\n * Public API Surface of my-lib\n */\n\nexport * from './lib/search-lib.module';\nexport * from './lib/search/search.component';\nexport * from './lib/lib-configuration';\nexport * from './lib/types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["InjectionToken","Subject","EventEmitter","tap","debounceTime","isPlatformBrowser","Component","NG_VALUE_ACCESSOR","Inject","PLATFORM_ID","ChangeDetectorRef","Input","Output","ViewChild","NgModule","CommonModule","FormsModule","HttpClientModule","MatSelectModule","MatFormFieldModule","MatIconModule","MatInputModule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iBAAiB;YACvD,mBAAmB,EAAE,CAAC,CAAC,mBAAmB;SAC3C,CAAC;IACJ,CAAC;IACD,SAAS,eAAe,CAAI,CAAmB,EAAA;;QAC7C,OAAO;YACL,iBAAiB,EAAE,CAAA,EAAA,GAAA,CAAC,CAAC,iBAAiB,mCAAI,IAAI;YAC9C,gBAAgB,EAAE,CAAA,EAAA,GAAA,CAAC,CAAC,gBAAgB,mCAAI,KAAK;YAC7C,oBAAoB,EAAE,CAAA,EAAA,GAAA,CAAC,CAAC,oBAAoB,mCAAI,KAAK;YACrD,wBAAwB,EAAE,CAAA,EAAA,GAAA,CAAC,CAAC,wBAAwB,mCAAI,KAAK;YAC7D,iBAAiB,EAAE,CAAA,EAAA,GAAA,CAAC,CAAC,iBAAiB,mCAAI,KAAK;SAChD,CAAC;IACJ,CAAC;IACD,SAAS,cAAc,CAAI,CAAmB,EAAA;;QAC5C,OAAO;YACL,eAAe,EAAE,CAAA,EAAA,GAAA,CAAC,CAAC,eAAe,mCAAI,gBAAgB;YACtD,cAAc,EAAE,CAAA,EAAA,GAAA,CAAC,CAAC,cAAc,mCAAI,eAAe;YACnD,uBAAuB,EAAE,CAAA,EAAA,GAAA,CAAC,CAAC,uBAAuB,mCAAI,oBAAoB;YAC1E,qBAAqB,EAAE,CAAA,EAAA,GAAA,CAAC,CAAC,qBAAqB,mCAAI,gBAAgB;SACnE,CAAC;IACJ;;IC1GA;;IAEG;;ICFH;;IAEG;;;;;;;;;;;;;;;;;;;"}
@@ -1,66 +0,0 @@
1
- export class Configuration {
2
- constructor(d) {
3
- checkForError(d);
4
- this.displayPropertyName = d.displayPropertyName;
5
- this.models = d.models;
6
- /* IRequestParameters - will be given default values before call is made in case undefined/null,
7
- otherwise there ! is used on which sonar gives code smell */
8
- this.limit = d.limit;
9
- this.limitByType = d.limitByType;
10
- this.order = d.order;
11
- this.offset = d.offset;
12
- this.saveInRecents = d.saveInRecents;
13
- const displayTexts = setDisplayText(d);
14
- this.noResultMessage = displayTexts.noResultMessage;
15
- this.placeholder = displayTexts.placeholder;
16
- this.placeholderFunction = displayTexts.placeholderFunction;
17
- const searchConfig = setSearchConfig(d);
18
- this.categorizeResults = searchConfig.categorizeResults;
19
- this.hideRecentSearch = searchConfig.hideRecentSearch;
20
- this.hideCategorizeButton = searchConfig.hideCategorizeButton;
21
- this.saveInRecentsOnlyOnEnter = searchConfig.saveInRecentsOnlyOnEnter;
22
- this.searchOnlyOnEnter = searchConfig.searchOnlyOnEnter;
23
- const classes = setIconClasses(d);
24
- this.searchIconClass = classes.searchIconClass;
25
- this.crossIconClass = classes.crossIconClass;
26
- this.dropDownButtonIconClass = classes.dropDownButtonIconClass;
27
- this.recentSearchIconClass = classes.recentSearchIconClass;
28
- }
29
- }
30
- function checkForError(d) {
31
- if (d.categorizeResults === false &&
32
- (d.hideCategorizeButton === false || d.hideCategorizeButton === undefined)) {
33
- throw new Error('You must provide hideCategorizeButton:true as categorizeResults is false');
34
- }
35
- if (d.saveInRecents === false && d.saveInRecentsOnlyOnEnter === true) {
36
- throw new Error('You must provide saveInRecents:true for saveInRecentsOnlyOnEnter:true');
37
- }
38
- }
39
- function setDisplayText(d) {
40
- var _a, _b;
41
- return {
42
- placeholder: (_a = d.placeholder) !== null && _a !== void 0 ? _a : 'Search',
43
- noResultMessage: (_b = d.noResultMessage) !== null && _b !== void 0 ? _b : 'No result found',
44
- placeholderFunction: d.placeholderFunction,
45
- };
46
- }
47
- function setSearchConfig(d) {
48
- var _a, _b, _c, _d, _e;
49
- return {
50
- categorizeResults: (_a = d.categorizeResults) !== null && _a !== void 0 ? _a : true,
51
- hideRecentSearch: (_b = d.hideRecentSearch) !== null && _b !== void 0 ? _b : false,
52
- hideCategorizeButton: (_c = d.hideCategorizeButton) !== null && _c !== void 0 ? _c : false,
53
- saveInRecentsOnlyOnEnter: (_d = d.saveInRecentsOnlyOnEnter) !== null && _d !== void 0 ? _d : false,
54
- searchOnlyOnEnter: (_e = d.searchOnlyOnEnter) !== null && _e !== void 0 ? _e : false,
55
- };
56
- }
57
- function setIconClasses(d) {
58
- var _a, _b, _c, _d;
59
- return {
60
- searchIconClass: (_a = d.searchIconClass) !== null && _a !== void 0 ? _a : 'icomoon Search',
61
- crossIconClass: (_b = d.crossIconClass) !== null && _b !== void 0 ? _b : 'icomoon close',
62
- dropDownButtonIconClass: (_c = d.dropDownButtonIconClass) !== null && _c !== void 0 ? _c : 'icomoon arrow_down',
63
- recentSearchIconClass: (_d = d.recentSearchIconClass) !== null && _d !== void 0 ? _d : 'icomoon Search',
64
- };
65
- }
66
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGliLWNvbmZpZ3VyYXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL2xpYi1jb25maWd1cmF0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE1BQU0sT0FBTyxhQUFhO0lBbUN4QixZQUFZLENBQW1CO1FBQzdCLGFBQWEsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUNqQixJQUFJLENBQUMsbUJBQW1CLEdBQUcsQ0FBQyxDQUFDLG1CQUFtQixDQUFDO1FBQ2pELElBQUksQ0FBQyxNQUFNLEdBQUcsQ0FBQyxDQUFDLE1BQU0sQ0FBQztRQUV2QjtvRUFDNEQ7UUFDNUQsSUFBSSxDQUFDLEtBQUssR0FBRyxDQUFDLENBQUMsS0FBSyxDQUFDO1FBQ3JCLElBQUksQ0FBQyxXQUFXLEdBQUcsQ0FBQyxDQUFDLFdBQVcsQ0FBQztRQUNqQyxJQUFJLENBQUMsS0FBSyxHQUFHLENBQUMsQ0FBQyxLQUFLLENBQUM7UUFDckIsSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsTUFBTSxDQUFDO1FBQ3ZCLElBQUksQ0FBQyxhQUFhLEdBQUcsQ0FBQyxDQUFDLGFBQWEsQ0FBQztRQUVyQyxN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VJlY2VudFNlYXJjaDogZC5oaWRlUmVjZW50U2VhcmNoID8/IGZhbHNlLFxuICAgIGhpZGVDYXRlZ29yaXplQnV0dG9uOiBkLmhpZGVDYXRlZ29yaXplQnV0dG9uID8/IGZhbHNlLFxuICAgIHNhdmVJblJlY2VudHNPbmx5T25FbnRlcjogZC5zYXZlSW5SZWNlbnRzT25seU9uRW50ZXIgPz8gZmFsc2UsXG4gICAgc2VhcmNoT25seU9uRW50ZXI6IGQuc2VhcmNoT25seU9uRW50ZXIgPz8gZmFsc2UsXG4gIH07XG59XG5mdW5jdGlvbiBzZXRJY29uQ2xhc3NlczxUPihkOiBDb25maWd1cmF0aW9uPFQ+KSB7XG4gIHJldHVybiB7XG4gICAgc2VhcmNoSWNvbkNsYXNzOiBkLnNlYXJjaEljb25DbGFzcyA/PyAnaWNvbW9vbiBTZWFyY2gnLFxuICAgIGNyb3NzSWNvbkNsYXNzOiBkLmNyb3NzSWNvbkNsYXNzID8/ICdpY29tb29uIGNsb3NlJyxcbiAgICBkcm9wRG93bkJ1dHRvbkljb25DbGFzczogZC5kcm9wRG93bkJ1dHRvbkljb25DbGFzcyA/PyAnaWNvbW9vbiBhcnJvd19kb3duJyxcbiAgICByZWNlbnRTZWFyY2hJY29uQ2xhc3M6IGQucmVjZW50U2VhcmNoSWNvbkNsYXNzID8/ICdpY29tb29uIFNlYXJjaCcsXG4gIH07XG59XG4iXX0=
@@ -1 +0,0 @@
1
- {"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbol":0,"members":[]}]}]}}}],"symbols":[{"__symbol":0,"name":"Configuration","filePath":"./lib-configuration"}]}