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