UNPKG

27.6 kBJavaScriptView Raw
1import * as i0 from '@angular/core';
2import { EventEmitter, forwardRef, ElementRef, Component, ChangeDetectionStrategy, Optional, ViewChild, Input, Output, NgModule } from '@angular/core';
3import * as i3 from '@angular/common';
4import { CommonModule } from '@angular/common';
5import * as i2 from '@angular/forms';
6import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
7import * as i4 from '@angular/material/input';
8import { MatInput, MatInputModule } from '@angular/material/input';
9import * as i6 from '@angular/material/icon';
10import { MatIconModule } from '@angular/material/icon';
11import * as i7 from '@angular/material/button';
12import { MatButtonModule } from '@angular/material/button';
13import { trigger, state, style, transition, animate, AUTO_STYLE } from '@angular/animations';
14import * as i1 from '@angular/cdk/bidi';
15import { Subject, fromEvent, noop } from 'rxjs';
16import { debounceTime, skip, takeUntil } from 'rxjs/operators';
17import { mixinControlValueAccessor } from '@covalent/core/common';
18import * as i5 from '@angular/material/form-field';
19
20class TdSearchInputBase {
21 _changeDetectorRef;
22 constructor(_changeDetectorRef) {
23 this._changeDetectorRef = _changeDetectorRef;
24 }
25}
26const _TdSearchInputMixinBase = mixinControlValueAccessor(TdSearchInputBase);
27class TdSearchInputComponent extends _TdSearchInputMixinBase {
28 _dir;
29 _changeDetectorRef;
30 _ngZone;
31 _input;
32 _searchElement;
33 /**
34 * appearance?: MatFormFieldAppearance
35 * Appearance style for the underlying input component.
36 */
37 appearance = 'outline';
38 /**
39 * showUnderline?: boolean
40 * Sets if the input underline should be visible. Defaults to 'false'.
41 */
42 showUnderline = false;
43 /**
44 * debounce?: number
45 * Debounce timeout between keypresses. Defaults to 400.
46 */
47 debounce = 400;
48 /**
49 * placeholder?: string
50 * Placeholder for the underlying input component.
51 */
52 placeholder = '';
53 /**
54 * clearIcon?: string
55 * The icon used to clear the search input.
56 * Defaults to 'cancel' icon.
57 */
58 clearIcon = 'cancel';
59 value;
60 /**
61 * searchDebounce: function($event)
62 * Event emitted after the [debounce] timeout.
63 */
64 searchDebounce = new EventEmitter();
65 /**
66 * search: function($event)
67 * Event emitted after the key enter has been pressed.
68 */
69 search = new EventEmitter();
70 /**
71 * clear: function()
72 * Event emitted after the clear icon has been clicked.
73 */
74 clear = new EventEmitter();
75 /**
76 * blur: function()
77 * Event emitted after the blur event has been called in underlying input.
78 */
79 blurSearch = new EventEmitter();
80 get isRTL() {
81 if (this._dir) {
82 return this._dir.dir === 'rtl';
83 }
84 return false;
85 }
86 _destroy$ = new Subject();
87 constructor(_dir, _changeDetectorRef, _ngZone) {
88 super(_changeDetectorRef);
89 this._dir = _dir;
90 this._changeDetectorRef = _changeDetectorRef;
91 this._ngZone = _ngZone;
92 }
93 ngOnInit() {
94 this._input?.ngControl?.valueChanges
95 ?.pipe(debounceTime(this.debounce), skip(1), // skip first change when value is set to undefined
96 takeUntil(this._destroy$))
97 .subscribe((value) => {
98 this._searchTermChanged(value);
99 });
100 this._ngZone.runOutsideAngular(() => fromEvent(this._searchElement.nativeElement, 'search')
101 .pipe(takeUntil(this._destroy$))
102 .subscribe(this._stopPropagation));
103 }
104 ngOnDestroy() {
105 this._destroy$.next();
106 }
107 /**
108 * Method to focus to underlying input.
109 */
110 focus() {
111 this._input?.focus();
112 }
113 handleBlur() {
114 this.blurSearch.emit();
115 }
116 handleSearch(event) {
117 this._stopPropagation(event);
118 if (typeof this.value == 'string') {
119 this.search.emit(this.value);
120 }
121 }
122 /**
123 * Method to clear the underlying input.
124 */
125 clearSearch() {
126 this.value = '';
127 this._changeDetectorRef.markForCheck();
128 this.clear.emit();
129 }
130 _searchTermChanged(value) {
131 this.searchDebounce.emit(value);
132 }
133 _stopPropagation(event) {
134 event.stopPropagation();
135 }
136 static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdSearchInputComponent, deps: [{ token: i1.Dir, optional: true }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
137 static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: TdSearchInputComponent, selector: "td-search-input", inputs: { appearance: "appearance", showUnderline: "showUnderline", debounce: "debounce", placeholder: "placeholder", clearIcon: "clearIcon", value: "value" }, outputs: { searchDebounce: "searchDebounce", search: "search", clear: "clear", blurSearch: "blurSearch" }, providers: [
138 {
139 provide: NG_VALUE_ACCESSOR,
140 useExisting: forwardRef(() => TdSearchInputComponent),
141 multi: true,
142 },
143 ], viewQueries: [{ propertyName: "_input", first: true, predicate: MatInput, descendants: true, static: true }, { propertyName: "_searchElement", first: true, predicate: ["searchElement"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"td-search-input\">\n <mat-form-field\n class=\"td-search-input-field\"\n [class.mat-hide-underline]=\"!showUnderline\"\n [appearance]=\"appearance\"\n >\n <input\n matInput\n #searchElement\n type=\"search\"\n [(ngModel)]=\"value\"\n [placeholder]=\"placeholder\"\n (blur)=\"handleBlur()\"\n (keyup.enter)=\"handleSearch($event)\"\n />\n <span\n matSuffix\n *ngIf=\"\n appearance === 'fill' ||\n appearance === 'outline' ||\n appearance === 'standard'\n \"\n >\n <ng-template [ngTemplateOutlet]=\"clearButton\"></ng-template>\n </span>\n </mat-form-field>\n</div>\n<ng-template #clearButton>\n <button\n mat-icon-button\n class=\"td-search-input-clear\"\n type=\"button\"\n [@searchState]=\"\n searchElement.value ? 'show' : isRTL ? 'hide-left' : 'hide-right'\n \"\n (click)=\"clearSearch()\"\n >\n <mat-icon>{{ clearIcon }}</mat-icon>\n </button>\n</ng-template>\n", styles: [":host .td-search-input{overflow-x:hidden;box-sizing:border-box;display:flex;flex-direction:row;align-items:baseline;align-content:center;max-width:100%;justify-content:flex-end}:host .td-search-input .td-search-input-field{flex:1}:host .td-search-input ::ng-deep mat-form-field .mat-mdc-form-field-subscript-wrapper{display:none}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper{padding-bottom:0}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-fill .mat-form-field-wrapper{padding-bottom:0}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-fill .mat-form-field-wrapper .mat-form-field-flex{height:52px}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-fill .mat-form-field-wrapper .mat-form-field-underline{bottom:0}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-standard .mat-form-field-wrapper{padding-bottom:0}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-standard .mat-form-field-wrapper .mat-form-field-infix{bottom:.4em}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-standard .mat-form-field-wrapper .mat-form-field-underline{bottom:0}:host .td-search-input ::ng-deep mat-form-field .mat-input-element{caret-color:currentColor}:host .td-search-input ::ng-deep mat-form-field.mat-hide-underline .mat-form-field-underline{display:none}:host .td-search-input .td-search-input-clear{flex:0 0 auto}\n"], dependencies: [{ kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }], animations: [
144 trigger('searchState', [
145 state('hide-left', style({
146 transform: 'translateX(-150%)',
147 display: 'none',
148 })),
149 state('hide-right', style({
150 transform: 'translateX(150%)',
151 display: 'none',
152 })),
153 state('show', style({
154 transform: 'translateX(0%)',
155 display: 'block',
156 })),
157 transition('* => show', animate('200ms ease-in')),
158 transition('show => *', animate('200ms ease-out')),
159 ]),
160 ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
161}
162i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdSearchInputComponent, decorators: [{
163 type: Component,
164 args: [{ providers: [
165 {
166 provide: NG_VALUE_ACCESSOR,
167 useExisting: forwardRef(() => TdSearchInputComponent),
168 multi: true,
169 },
170 ], selector: 'td-search-input', changeDetection: ChangeDetectionStrategy.OnPush, animations: [
171 trigger('searchState', [
172 state('hide-left', style({
173 transform: 'translateX(-150%)',
174 display: 'none',
175 })),
176 state('hide-right', style({
177 transform: 'translateX(150%)',
178 display: 'none',
179 })),
180 state('show', style({
181 transform: 'translateX(0%)',
182 display: 'block',
183 })),
184 transition('* => show', animate('200ms ease-in')),
185 transition('show => *', animate('200ms ease-out')),
186 ]),
187 ], template: "<div class=\"td-search-input\">\n <mat-form-field\n class=\"td-search-input-field\"\n [class.mat-hide-underline]=\"!showUnderline\"\n [appearance]=\"appearance\"\n >\n <input\n matInput\n #searchElement\n type=\"search\"\n [(ngModel)]=\"value\"\n [placeholder]=\"placeholder\"\n (blur)=\"handleBlur()\"\n (keyup.enter)=\"handleSearch($event)\"\n />\n <span\n matSuffix\n *ngIf=\"\n appearance === 'fill' ||\n appearance === 'outline' ||\n appearance === 'standard'\n \"\n >\n <ng-template [ngTemplateOutlet]=\"clearButton\"></ng-template>\n </span>\n </mat-form-field>\n</div>\n<ng-template #clearButton>\n <button\n mat-icon-button\n class=\"td-search-input-clear\"\n type=\"button\"\n [@searchState]=\"\n searchElement.value ? 'show' : isRTL ? 'hide-left' : 'hide-right'\n \"\n (click)=\"clearSearch()\"\n >\n <mat-icon>{{ clearIcon }}</mat-icon>\n </button>\n</ng-template>\n", styles: [":host .td-search-input{overflow-x:hidden;box-sizing:border-box;display:flex;flex-direction:row;align-items:baseline;align-content:center;max-width:100%;justify-content:flex-end}:host .td-search-input .td-search-input-field{flex:1}:host .td-search-input ::ng-deep mat-form-field .mat-mdc-form-field-subscript-wrapper{display:none}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper{padding-bottom:0}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-fill .mat-form-field-wrapper{padding-bottom:0}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-fill .mat-form-field-wrapper .mat-form-field-flex{height:52px}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-fill .mat-form-field-wrapper .mat-form-field-underline{bottom:0}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-standard .mat-form-field-wrapper{padding-bottom:0}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-standard .mat-form-field-wrapper .mat-form-field-infix{bottom:.4em}:host .td-search-input ::ng-deep mat-form-field.mat-form-field-appearance-standard .mat-form-field-wrapper .mat-form-field-underline{bottom:0}:host .td-search-input ::ng-deep mat-form-field .mat-input-element{caret-color:currentColor}:host .td-search-input ::ng-deep mat-form-field.mat-hide-underline .mat-form-field-underline{display:none}:host .td-search-input .td-search-input-clear{flex:0 0 auto}\n"] }]
188 }], ctorParameters: () => [{ type: i1.Dir, decorators: [{
189 type: Optional
190 }] }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }], propDecorators: { _input: [{
191 type: ViewChild,
192 args: [MatInput, { static: true }]
193 }], _searchElement: [{
194 type: ViewChild,
195 args: ['searchElement', { static: true, read: ElementRef }]
196 }], appearance: [{
197 type: Input
198 }], showUnderline: [{
199 type: Input
200 }], debounce: [{
201 type: Input
202 }], placeholder: [{
203 type: Input
204 }], clearIcon: [{
205 type: Input
206 }], value: [{
207 type: Input
208 }], searchDebounce: [{
209 type: Output
210 }], search: [{
211 type: Output
212 }], clear: [{
213 type: Output
214 }], blurSearch: [{
215 type: Output
216 }] } });
217
218class TdSearchBoxBase {
219 _changeDetectorRef;
220 constructor(_changeDetectorRef) {
221 this._changeDetectorRef = _changeDetectorRef;
222 }
223}
224class TdSearchBoxComponent {
225 _changeDetectorRef;
226 _searchVisible = false;
227 _searchInput;
228 get searchVisible() {
229 return this._searchVisible;
230 }
231 /**
232 * backIcon?: string
233 * The icon used to close the search toggle, only shown when [alwaysVisible] is false.
234 * Defaults to 'search' icon.
235 */
236 backIcon = 'search';
237 /**
238 * searchIcon?: string
239 * The icon used to open/focus the search toggle.
240 * Defaults to 'search' icon.
241 */
242 searchIcon = 'search';
243 /**
244 * clearIcon?: string
245 * The icon used to clear the search input.
246 * Defaults to 'cancel' icon.
247 */
248 clearIcon = 'cancel';
249 /**
250 * showUnderline?: boolean
251 * Sets if the input underline should be visible. Defaults to 'false'.
252 */
253 showUnderline = false;
254 /**
255 * debounce?: number
256 * Debounce timeout between keypresses. Defaults to 400.
257 */
258 debounce = 400;
259 /**
260 * alwaysVisible?: boolean
261 * Sets if the input should always be visible. Defaults to 'false'.
262 */
263 alwaysVisible = false;
264 /**
265 * placeholder?: string
266 * Placeholder for the underlying input component.
267 */
268 placeholder = '';
269 value;
270 /**
271 * searchDebounce: function($event)
272 * Event emitted after the [debounce] timeout.
273 */
274 searchDebounce = new EventEmitter();
275 /**
276 * search: function($event)
277 * Event emitted after the key enter has been pressed.
278 */
279 search = new EventEmitter();
280 /**
281 * clear: function()
282 * Event emitted after the clear icon has been clicked.
283 */
284 clear = new EventEmitter();
285 /**
286 * blur: function()
287 * Event emitted after the blur event has been called in underlying input.
288 */
289 blurSearch = new EventEmitter();
290 constructor(_changeDetectorRef) {
291 this._changeDetectorRef = _changeDetectorRef;
292 }
293 writeValue(value) {
294 this.value = value;
295 this._changeDetectorRef.markForCheck();
296 }
297 registerOnChange() {
298 noop;
299 }
300 registerOnTouched() {
301 noop;
302 }
303 /**
304 * Method executed when the search icon is clicked.
305 */
306 searchClicked() {
307 if (!this.alwaysVisible && this._searchVisible) {
308 this.value = '';
309 this.handleClear();
310 }
311 else if (this.alwaysVisible || !this._searchVisible) {
312 this._searchInput?.focus();
313 }
314 this.toggleVisibility();
315 }
316 toggleVisibility() {
317 this._searchVisible = !this._searchVisible;
318 this._changeDetectorRef.markForCheck();
319 }
320 handleSearchDebounce(value) {
321 this.searchDebounce.emit(value);
322 }
323 handleSearch(value) {
324 this.search.emit(value);
325 }
326 handleClear() {
327 this.clear.emit();
328 }
329 handleBlur() {
330 this.blurSearch.emit();
331 }
332 static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdSearchBoxComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
333 static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: TdSearchBoxComponent, selector: "td-search-box", inputs: { backIcon: "backIcon", searchIcon: "searchIcon", clearIcon: "clearIcon", showUnderline: "showUnderline", debounce: "debounce", alwaysVisible: "alwaysVisible", placeholder: "placeholder", value: "value" }, outputs: { searchDebounce: "searchDebounce", search: "search", clear: "clear", blurSearch: "blurSearch" }, providers: [
334 {
335 provide: NG_VALUE_ACCESSOR,
336 useExisting: forwardRef(() => TdSearchBoxComponent),
337 multi: true,
338 },
339 ], viewQueries: [{ propertyName: "_searchInput", first: true, predicate: TdSearchInputComponent, descendants: true, static: true }], ngImport: i0, template: "<div class=\"td-search-box\">\n <button\n mat-icon-button\n type=\"button\"\n class=\"td-search-icon\"\n (click)=\"searchClicked()\"\n >\n <mat-icon *ngIf=\"searchVisible && !alwaysVisible\">{{ backIcon }}</mat-icon>\n <mat-icon *ngIf=\"!searchVisible || alwaysVisible\">{{\n searchIcon\n }}</mat-icon>\n </button>\n <td-search-input\n #searchInput\n [@inputState]=\"alwaysVisible || searchVisible\"\n [debounce]=\"debounce\"\n [(ngModel)]=\"value\"\n [showUnderline]=\"showUnderline\"\n [placeholder]=\"placeholder\"\n [clearIcon]=\"clearIcon\"\n (searchDebounce)=\"handleSearchDebounce($event)\"\n (search)=\"handleSearch($event)\"\n (clear)=\"handleClear(); toggleVisibility()\"\n (blur)=\"handleBlur()\"\n ></td-search-input>\n</div>\n", styles: [":host{display:block}.td-search-box{box-sizing:border-box;display:flex;flex-direction:row;align-content:center;max-width:100%;justify-content:flex-end}.td-search-box .td-search-icon{margin-top:4px}.td-search-box td-search-input{margin-left:12px}::ng-deep [dir=rtl] .td-search-box td-search-input{margin-right:12px;margin-left:0!important}.td-search-box td-search-input ::ng-deep .mat-form.field.mat-form-field-appearance-legacy .mat-form-field-wrapper{padding-bottom:1em}.mat-toolbar :host ::ng-deep .mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input{color:#fff}\n"], dependencies: [{ kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: TdSearchInputComponent, selector: "td-search-input", inputs: ["appearance", "showUnderline", "debounce", "placeholder", "clearIcon", "value"], outputs: ["searchDebounce", "search", "clear", "blurSearch"] }], animations: [
340 trigger('inputState', [
341 state('0', style({
342 width: '0%',
343 margin: '0px',
344 })),
345 state('1', style({
346 width: '100%',
347 margin: AUTO_STYLE,
348 })),
349 transition('0 => 1', animate('200ms ease-in')),
350 transition('1 => 0', animate('200ms ease-out')),
351 ]),
352 ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
353}
354i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdSearchBoxComponent, decorators: [{
355 type: Component,
356 args: [{ providers: [
357 {
358 provide: NG_VALUE_ACCESSOR,
359 useExisting: forwardRef(() => TdSearchBoxComponent),
360 multi: true,
361 },
362 ], selector: 'td-search-box', changeDetection: ChangeDetectionStrategy.OnPush, animations: [
363 trigger('inputState', [
364 state('0', style({
365 width: '0%',
366 margin: '0px',
367 })),
368 state('1', style({
369 width: '100%',
370 margin: AUTO_STYLE,
371 })),
372 transition('0 => 1', animate('200ms ease-in')),
373 transition('1 => 0', animate('200ms ease-out')),
374 ]),
375 ], template: "<div class=\"td-search-box\">\n <button\n mat-icon-button\n type=\"button\"\n class=\"td-search-icon\"\n (click)=\"searchClicked()\"\n >\n <mat-icon *ngIf=\"searchVisible && !alwaysVisible\">{{ backIcon }}</mat-icon>\n <mat-icon *ngIf=\"!searchVisible || alwaysVisible\">{{\n searchIcon\n }}</mat-icon>\n </button>\n <td-search-input\n #searchInput\n [@inputState]=\"alwaysVisible || searchVisible\"\n [debounce]=\"debounce\"\n [(ngModel)]=\"value\"\n [showUnderline]=\"showUnderline\"\n [placeholder]=\"placeholder\"\n [clearIcon]=\"clearIcon\"\n (searchDebounce)=\"handleSearchDebounce($event)\"\n (search)=\"handleSearch($event)\"\n (clear)=\"handleClear(); toggleVisibility()\"\n (blur)=\"handleBlur()\"\n ></td-search-input>\n</div>\n", styles: [":host{display:block}.td-search-box{box-sizing:border-box;display:flex;flex-direction:row;align-content:center;max-width:100%;justify-content:flex-end}.td-search-box .td-search-icon{margin-top:4px}.td-search-box td-search-input{margin-left:12px}::ng-deep [dir=rtl] .td-search-box td-search-input{margin-right:12px;margin-left:0!important}.td-search-box td-search-input ::ng-deep .mat-form.field.mat-form-field-appearance-legacy .mat-form-field-wrapper{padding-bottom:1em}.mat-toolbar :host ::ng-deep .mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input{color:#fff}\n"] }]
376 }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { _searchInput: [{
377 type: ViewChild,
378 args: [TdSearchInputComponent, { static: true }]
379 }], backIcon: [{
380 type: Input
381 }], searchIcon: [{
382 type: Input
383 }], clearIcon: [{
384 type: Input
385 }], showUnderline: [{
386 type: Input
387 }], debounce: [{
388 type: Input
389 }], alwaysVisible: [{
390 type: Input
391 }], placeholder: [{
392 type: Input
393 }], value: [{
394 type: Input
395 }], searchDebounce: [{
396 type: Output
397 }], search: [{
398 type: Output
399 }], clear: [{
400 type: Output
401 }], blurSearch: [{
402 type: Output
403 }] } });
404
405class CovalentSearchModule {
406 static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: CovalentSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
407 static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.2", ngImport: i0, type: CovalentSearchModule, declarations: [TdSearchInputComponent, TdSearchBoxComponent], imports: [FormsModule,
408 CommonModule,
409 MatInputModule,
410 MatIconModule,
411 MatButtonModule], exports: [TdSearchInputComponent, TdSearchBoxComponent] });
412 static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: CovalentSearchModule, imports: [FormsModule,
413 CommonModule,
414 MatInputModule,
415 MatIconModule,
416 MatButtonModule] });
417}
418i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: CovalentSearchModule, decorators: [{
419 type: NgModule,
420 args: [{
421 imports: [
422 FormsModule,
423 CommonModule,
424 MatInputModule,
425 MatIconModule,
426 MatButtonModule,
427 ],
428 declarations: [TdSearchInputComponent, TdSearchBoxComponent],
429 exports: [TdSearchInputComponent, TdSearchBoxComponent],
430 }]
431 }] });
432
433/**
434 * Generated bundle index. Do not edit.
435 */
436
437export { CovalentSearchModule, TdSearchBoxBase, TdSearchBoxComponent, TdSearchInputBase, TdSearchInputComponent, _TdSearchInputMixinBase };
438//# sourceMappingURL=covalent-core-search.mjs.map