@covalent/core 4.1.7 → 4.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/common/pipes/truncate/truncate.pipe.mjs +2 -2
- package/esm2020/search/search-input/search-input.component.mjs +29 -25
- package/fesm2015/covalent-core-common.mjs +1 -1
- package/fesm2015/covalent-core-common.mjs.map +1 -1
- package/fesm2015/covalent-core-search.mjs +29 -25
- package/fesm2015/covalent-core-search.mjs.map +1 -1
- package/fesm2020/covalent-core-common.mjs +1 -1
- package/fesm2020/covalent-core-common.mjs.map +1 -1
- package/fesm2020/covalent-core-search.mjs +29 -25
- package/fesm2020/covalent-core-search.mjs.map +1 -1
- package/package.json +2 -2
- package/search/search-input/search-input.component.d.ts +13 -11
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { EventEmitter, forwardRef, Component, ChangeDetectionStrategy, Optional, ViewChild, Input, Output, NgModule } from '@angular/core';
|
2
|
+
import { EventEmitter, forwardRef, ElementRef, Component, ChangeDetectionStrategy, Optional, ViewChild, Input, Output, NgModule } from '@angular/core';
|
3
3
|
import * as i7 from '@angular/common';
|
4
4
|
import { CommonModule } from '@angular/common';
|
5
5
|
import * as i6 from '@angular/forms';
|
@@ -12,8 +12,9 @@ import * as i3 from '@angular/material/button';
|
|
12
12
|
import { MatButtonModule } from '@angular/material/button';
|
13
13
|
import { trigger, state, style, transition, animate, AUTO_STYLE } from '@angular/animations';
|
14
14
|
import * as i1 from '@angular/cdk/bidi';
|
15
|
-
import {
|
16
|
-
import {
|
15
|
+
import { Subject, fromEvent, noop } from 'rxjs';
|
16
|
+
import { debounceTime, skip, takeUntil } from 'rxjs/operators';
|
17
|
+
import { mixinControlValueAccessor } from '@covalent/core/common';
|
17
18
|
import * as i2 from '@angular/material/form-field';
|
18
19
|
|
19
20
|
class TdSearchInputBase {
|
@@ -21,10 +22,13 @@ class TdSearchInputBase {
|
|
21
22
|
this._changeDetectorRef = _changeDetectorRef;
|
22
23
|
}
|
23
24
|
}
|
24
|
-
|
25
|
-
|
25
|
+
const _TdSearchInputMixinBase = mixinControlValueAccessor(TdSearchInputBase);
|
26
|
+
class TdSearchInputComponent extends _TdSearchInputMixinBase {
|
27
|
+
constructor(_dir, _changeDetectorRef, _ngZone) {
|
28
|
+
super(_changeDetectorRef);
|
26
29
|
this._dir = _dir;
|
27
30
|
this._changeDetectorRef = _changeDetectorRef;
|
31
|
+
this._ngZone = _ngZone;
|
28
32
|
/**
|
29
33
|
* appearance?: MatFormFieldAppearance
|
30
34
|
* Appearance style for the underlying input component.
|
@@ -71,6 +75,7 @@ class TdSearchInputComponent {
|
|
71
75
|
* Event emitted after the blur event has been called in underlying input.
|
72
76
|
*/
|
73
77
|
this.blurSearch = new EventEmitter();
|
78
|
+
this._destroy$ = new Subject();
|
74
79
|
}
|
75
80
|
get isRTL() {
|
76
81
|
if (this._dir) {
|
@@ -80,21 +85,17 @@ class TdSearchInputComponent {
|
|
80
85
|
}
|
81
86
|
ngOnInit() {
|
82
87
|
this._input?.ngControl?.valueChanges
|
83
|
-
?.pipe(debounceTime(this.debounce), skip(1) // skip first change when value is set to undefined
|
84
|
-
)
|
88
|
+
?.pipe(debounceTime(this.debounce), skip(1), // skip first change when value is set to undefined
|
89
|
+
takeUntil(this._destroy$))
|
85
90
|
.subscribe((value) => {
|
86
91
|
this._searchTermChanged(value);
|
87
92
|
});
|
93
|
+
this._ngZone.runOutsideAngular(() => fromEvent(this._searchElement.nativeElement, 'search')
|
94
|
+
.pipe(takeUntil(this._destroy$))
|
95
|
+
.subscribe(this._stopPropagation));
|
88
96
|
}
|
89
|
-
|
90
|
-
this.
|
91
|
-
this._changeDetectorRef.markForCheck();
|
92
|
-
}
|
93
|
-
registerOnChange() {
|
94
|
-
noop;
|
95
|
-
}
|
96
|
-
registerOnTouched() {
|
97
|
-
noop;
|
97
|
+
ngOnDestroy() {
|
98
|
+
this._destroy$.next();
|
98
99
|
}
|
99
100
|
/**
|
100
101
|
* Method to focus to underlying input.
|
@@ -105,11 +106,8 @@ class TdSearchInputComponent {
|
|
105
106
|
handleBlur() {
|
106
107
|
this.blurSearch.emit();
|
107
108
|
}
|
108
|
-
stopPropagation(event) {
|
109
|
-
event.stopPropagation();
|
110
|
-
}
|
111
109
|
handleSearch(event) {
|
112
|
-
this.
|
110
|
+
this._stopPropagation(event);
|
113
111
|
if (typeof this.value == 'string') {
|
114
112
|
this.search.emit(this.value);
|
115
113
|
}
|
@@ -125,15 +123,18 @@ class TdSearchInputComponent {
|
|
125
123
|
_searchTermChanged(value) {
|
126
124
|
this.searchDebounce.emit(value);
|
127
125
|
}
|
126
|
+
_stopPropagation(event) {
|
127
|
+
event.stopPropagation();
|
128
|
+
}
|
128
129
|
}
|
129
|
-
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 }], target: i0.ɵɵFactoryTarget.Component });
|
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 });
|
130
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: [
|
131
132
|
{
|
132
133
|
provide: NG_VALUE_ACCESSOR,
|
133
134
|
useExisting: forwardRef(() => TdSearchInputComponent),
|
134
135
|
multi: true,
|
135
136
|
},
|
136
|
-
], viewQueries: [{ propertyName: "_input", first: true, predicate: MatInput, descendants: true, static: 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 (
|
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: [
|
137
138
|
trigger('searchState', [
|
138
139
|
state('hide-left', style({
|
139
140
|
transform: 'translateX(-150%)',
|
@@ -176,12 +177,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
|
|
176
177
|
transition('* => show', animate('200ms ease-in')),
|
177
178
|
transition('show => *', animate('200ms ease-out')),
|
178
179
|
]),
|
179
|
-
], 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 (
|
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"] }]
|
180
181
|
}], ctorParameters: function () { return [{ type: i1.Dir, decorators: [{
|
181
182
|
type: Optional
|
182
|
-
}] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { _input: [{
|
183
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }]; }, propDecorators: { _input: [{
|
183
184
|
type: ViewChild,
|
184
185
|
args: [MatInput, { static: true }]
|
186
|
+
}], _searchElement: [{
|
187
|
+
type: ViewChild,
|
188
|
+
args: ['searchElement', { static: true, read: ElementRef }]
|
185
189
|
}], appearance: [{
|
186
190
|
type: Input
|
187
191
|
}], showUnderline: [{
|
@@ -421,5 +425,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
|
|
421
425
|
* Generated bundle index. Do not edit.
|
422
426
|
*/
|
423
427
|
|
424
|
-
export { CovalentSearchModule, TdSearchBoxBase, TdSearchBoxComponent, TdSearchInputBase, TdSearchInputComponent };
|
428
|
+
export { CovalentSearchModule, TdSearchBoxBase, TdSearchBoxComponent, TdSearchInputBase, TdSearchInputComponent, _TdSearchInputMixinBase };
|
425
429
|
//# sourceMappingURL=covalent-core-search.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"covalent-core-search.mjs","sources":["../../../../libs/angular/search/src/search-input/search-input.component.ts","../../../../libs/angular/search/src/search-input/search-input.component.html","../../../../libs/angular/search/src/search-box/search-box.component.ts","../../../../libs/angular/search/src/search-box/search-box.component.html","../../../../libs/angular/search/src/search.module.ts","../../../../libs/angular/search/src/covalent-core-search.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n OnInit,\n Input,\n Output,\n EventEmitter,\n Optional,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n forwardRef,\n} from '@angular/core';\nimport {\n trigger,\n state,\n style,\n transition,\n animate,\n} from '@angular/animations';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Dir } from '@angular/cdk/bidi';\nimport { MatInput } from '@angular/material/input';\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\n\nimport { debounceTime, skip } from 'rxjs/operators';\nimport { noop } from 'rxjs';\n\nexport class TdSearchInputBase {\n constructor(public _changeDetectorRef: ChangeDetectorRef) {}\n}\n\n@Component({\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TdSearchInputComponent),\n multi: true,\n },\n ],\n selector: 'td-search-input',\n templateUrl: './search-input.component.html',\n styleUrls: ['./search-input.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [\n trigger('searchState', [\n state(\n 'hide-left',\n style({\n transform: 'translateX(-150%)',\n display: 'none',\n })\n ),\n state(\n 'hide-right',\n style({\n transform: 'translateX(150%)',\n display: 'none',\n })\n ),\n state(\n 'show',\n style({\n transform: 'translateX(0%)',\n display: 'block',\n })\n ),\n transition('* => show', animate('200ms ease-in')),\n transition('show => *', animate('200ms ease-out')),\n ]),\n ],\n})\nexport class TdSearchInputComponent implements ControlValueAccessor, OnInit {\n @ViewChild(MatInput, { static: true }) _input?: MatInput;\n\n /**\n * appearance?: MatFormFieldAppearance\n * Appearance style for the underlying input component.\n */\n @Input() appearance: MatFormFieldAppearance = 'legacy';\n\n /**\n * showUnderline?: boolean\n * Sets if the input underline should be visible. Defaults to 'false'.\n */\n @Input() showUnderline = false;\n\n /**\n * debounce?: number\n * Debounce timeout between keypresses. Defaults to 400.\n */\n @Input() debounce = 400;\n\n /**\n * placeholder?: string\n * Placeholder for the underlying input component.\n */\n @Input() placeholder = '';\n\n /**\n * clearIcon?: string\n * The icon used to clear the search input.\n * Defaults to 'cancel' icon.\n */\n @Input() clearIcon = 'cancel';\n\n @Input() value?: unknown;\n\n /**\n * searchDebounce: function($event)\n * Event emitted after the [debounce] timeout.\n */\n @Output() searchDebounce: EventEmitter<string> = new EventEmitter<string>();\n\n /**\n * search: function($event)\n * Event emitted after the key enter has been pressed.\n */\n @Output() search: EventEmitter<string> = new EventEmitter<string>();\n\n /**\n * clear: function()\n * Event emitted after the clear icon has been clicked.\n */\n @Output() clear: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * blur: function()\n * Event emitted after the blur event has been called in underlying input.\n */\n @Output() blurSearch: EventEmitter<void> = new EventEmitter<void>();\n\n get isRTL(): boolean {\n if (this._dir) {\n return this._dir.dir === 'rtl';\n }\n return false;\n }\n\n constructor(\n @Optional() private _dir: Dir,\n private _changeDetectorRef: ChangeDetectorRef\n ) {}\n\n ngOnInit(): void {\n this._input?.ngControl?.valueChanges\n ?.pipe(\n debounceTime(this.debounce),\n skip(1) // skip first change when value is set to undefined\n )\n .subscribe((value: string) => {\n this._searchTermChanged(value);\n });\n }\n\n writeValue(value: unknown): void {\n this.value = value;\n this._changeDetectorRef.markForCheck();\n }\n\n registerOnChange(): void {\n noop;\n }\n\n registerOnTouched(): void {\n noop;\n }\n\n /**\n * Method to focus to underlying input.\n */\n focus(): void {\n this._input?.focus();\n }\n\n handleBlur(): void {\n this.blurSearch.emit();\n }\n\n stopPropagation(event: Event): void {\n event.stopPropagation();\n }\n\n handleSearch(event: Event): void {\n this.stopPropagation(event);\n if (typeof this.value == 'string') {\n this.search.emit(this.value);\n }\n }\n\n /**\n * Method to clear the underlying input.\n */\n clearSearch(): void {\n this.value = '';\n this._changeDetectorRef.markForCheck();\n this.clear.emit();\n }\n\n private _searchTermChanged(value: string): void {\n this.searchDebounce.emit(value);\n }\n}\n","<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 (search)=\"stopPropagation($event)\"\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","import {\n Component,\n ViewChild,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n forwardRef,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n trigger,\n state,\n style,\n transition,\n animate,\n AUTO_STYLE,\n} from '@angular/animations';\n\nimport { TdSearchInputComponent } from '../search-input/search-input.component';\nimport { noop } from 'rxjs';\n\nexport class TdSearchBoxBase {\n constructor(public _changeDetectorRef: ChangeDetectorRef) {}\n}\n\n@Component({\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TdSearchBoxComponent),\n multi: true,\n },\n ],\n selector: 'td-search-box',\n templateUrl: './search-box.component.html',\n styleUrls: ['./search-box.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [\n trigger('inputState', [\n state(\n '0',\n style({\n width: '0%',\n margin: '0px',\n })\n ),\n state(\n '1',\n style({\n width: '100%',\n margin: AUTO_STYLE,\n })\n ),\n transition('0 => 1', animate('200ms ease-in')),\n transition('1 => 0', animate('200ms ease-out')),\n ]),\n ],\n})\nexport class TdSearchBoxComponent implements ControlValueAccessor {\n private _searchVisible = false;\n @ViewChild(TdSearchInputComponent, { static: true })\n _searchInput?: TdSearchInputComponent;\n\n get searchVisible(): boolean {\n return this._searchVisible;\n }\n\n /**\n * backIcon?: string\n * The icon used to close the search toggle, only shown when [alwaysVisible] is false.\n * Defaults to 'search' icon.\n */\n @Input() backIcon = 'search';\n\n /**\n * searchIcon?: string\n * The icon used to open/focus the search toggle.\n * Defaults to 'search' icon.\n */\n @Input() searchIcon = 'search';\n\n /**\n * clearIcon?: string\n * The icon used to clear the search input.\n * Defaults to 'cancel' icon.\n */\n @Input() clearIcon = 'cancel';\n\n /**\n * showUnderline?: boolean\n * Sets if the input underline should be visible. Defaults to 'false'.\n */\n @Input() showUnderline = false;\n\n /**\n * debounce?: number\n * Debounce timeout between keypresses. Defaults to 400.\n */\n @Input() debounce = 400;\n\n /**\n * alwaysVisible?: boolean\n * Sets if the input should always be visible. Defaults to 'false'.\n */\n @Input() alwaysVisible = false;\n\n /**\n * placeholder?: string\n * Placeholder for the underlying input component.\n */\n @Input() placeholder = '';\n\n @Input() value: unknown;\n\n /**\n * searchDebounce: function($event)\n * Event emitted after the [debounce] timeout.\n */\n @Output() searchDebounce: EventEmitter<string> = new EventEmitter<string>();\n\n /**\n * search: function($event)\n * Event emitted after the key enter has been pressed.\n */\n @Output() search: EventEmitter<string> = new EventEmitter<string>();\n\n /**\n * clear: function()\n * Event emitted after the clear icon has been clicked.\n */\n @Output() clear: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * blur: function()\n * Event emitted after the blur event has been called in underlying input.\n */\n @Output() blurSearch: EventEmitter<void> = new EventEmitter<void>();\n\n constructor(private _changeDetectorRef: ChangeDetectorRef) {}\n\n writeValue(value: unknown): void {\n this.value = value;\n this._changeDetectorRef.markForCheck();\n }\n\n registerOnChange(): void {\n noop;\n }\n\n registerOnTouched(): void {\n noop;\n }\n\n /**\n * Method executed when the search icon is clicked.\n */\n searchClicked(): void {\n if (!this.alwaysVisible && this._searchVisible) {\n this.value = '';\n this.handleClear();\n } else if (this.alwaysVisible || !this._searchVisible) {\n this._searchInput?.focus();\n }\n this.toggleVisibility();\n }\n\n toggleVisibility(): void {\n this._searchVisible = !this._searchVisible;\n this._changeDetectorRef.markForCheck();\n }\n\n handleSearchDebounce(value: string): void {\n this.searchDebounce.emit(value);\n }\n\n handleSearch(value: string): void {\n this.search.emit(value);\n }\n\n handleClear(): void {\n this.clear.emit();\n }\n\n handleBlur(): void {\n this.blurSearch.emit();\n }\n}\n","<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","import { NgModule } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\nimport { MatInputModule } from '@angular/material/input';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport { TdSearchInputComponent } from './search-input/search-input.component';\nimport { TdSearchBoxComponent } from './search-box/search-box.component';\n\n@NgModule({\n imports: [\n FormsModule,\n CommonModule,\n MatInputModule,\n MatIconModule,\n MatButtonModule,\n ],\n declarations: [TdSearchInputComponent, TdSearchBoxComponent],\n exports: [TdSearchInputComponent, TdSearchBoxComponent],\n})\nexport class CovalentSearchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;MA2Ba,iBAAiB;IAC5B,YAAmB,kBAAqC;QAArC,uBAAkB,GAAlB,kBAAkB,CAAmB;KAAI;CAC7D;MA0CY,sBAAsB;IAmEjC,YACsB,IAAS,EACrB,kBAAqC;QADzB,SAAI,GAAJ,IAAI,CAAK;QACrB,uBAAkB,GAAlB,kBAAkB,CAAmB;;;;;QA9DtC,eAAU,G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,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;4BAC9C,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;yBAChD,CAAC;qBACH;wGAKD,YAAY;sBADX,SAAS;uBAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;gBAY1C,QAAQ;sBAAhB,KAAK;gBAOG,UAAU;sBAAlB,KAAK;gBAOG,SAAS;sBAAjB,KAAK;gBAMG,aAAa;sBAArB,KAAK;gBAMG,QAAQ;sBAAhB,KAAK;gBAMG,aAAa;sBAArB,KAAK;gBAMG,WAAW;sBAAnB,KAAK;gBAEG,KAAK;sBAAb,KAAK;gBAMI,cAAc;sBAAvB,MAAM;gBAMG,MAAM;sBAAf,MAAM;gBAMG,KAAK;sBAAd,MAAM;gBAMG,UAAU;sBAAnB,MAAM;;;MEnHI,oBAAoB;;iHAApB,oBAAoB;kHAApB,oBAAoB,iBAHhB,sBAAsB,EAAE,oBAAoB,aANzD,WAAW;QACX,YAAY;QACZ,cAAc;QACd,aAAa;QACb,eAAe,aAGP,sBAAsB,EAAE,oBAAoB;kHAE3C,oBAAoB,YAVtB;YACP,WAAW;YACX,YAAY;YACZ,cAAc;YACd,aAAa;YACb,eAAe;SAChB;2FAIU,oBAAoB;kBAXhC,QAAQ;mBAAC;oBACR,OAAO,EAAE;wBACP,WAAW;wBACX,YAAY;wBACZ,cAAc;wBACd,aAAa;wBACb,eAAe;qBAChB;oBACD,YAAY,EAAE,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;oBAC5D,OAAO,EAAE,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;iBACxD;;;ACtBD;;;;;;"}
|
1
|
+
{"version":3,"file":"covalent-core-search.mjs","sources":["../../../../libs/angular/search/src/search-input/search-input.component.ts","../../../../libs/angular/search/src/search-input/search-input.component.html","../../../../libs/angular/search/src/search-box/search-box.component.ts","../../../../libs/angular/search/src/search-box/search-box.component.html","../../../../libs/angular/search/src/search.module.ts","../../../../libs/angular/search/src/covalent-core-search.ts"],"sourcesContent":["import {\n Component,\n ViewChild,\n OnInit,\n Input,\n Output,\n EventEmitter,\n Optional,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n forwardRef,\n OnDestroy,\n ElementRef,\n NgZone,\n} from '@angular/core';\nimport {\n trigger,\n state,\n style,\n transition,\n animate,\n} from '@angular/animations';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Dir } from '@angular/cdk/bidi';\nimport { MatInput } from '@angular/material/input';\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\nimport { fromEvent, Subject } from 'rxjs';\nimport { debounceTime, skip, takeUntil } from 'rxjs/operators';\nimport {\n IControlValueAccessor,\n mixinControlValueAccessor,\n} from '@covalent/core/common';\n\nexport class TdSearchInputBase {\n constructor(public _changeDetectorRef: ChangeDetectorRef) {}\n}\n\nexport const _TdSearchInputMixinBase =\n mixinControlValueAccessor(TdSearchInputBase);\n\n@Component({\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TdSearchInputComponent),\n multi: true,\n },\n ],\n selector: 'td-search-input',\n templateUrl: './search-input.component.html',\n styleUrls: ['./search-input.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [\n trigger('searchState', [\n state(\n 'hide-left',\n style({\n transform: 'translateX(-150%)',\n display: 'none',\n })\n ),\n state(\n 'hide-right',\n style({\n transform: 'translateX(150%)',\n display: 'none',\n })\n ),\n state(\n 'show',\n style({\n transform: 'translateX(0%)',\n display: 'block',\n })\n ),\n transition('* => show', animate('200ms ease-in')),\n transition('show => *', animate('200ms ease-out')),\n ]),\n ],\n})\nexport class TdSearchInputComponent\n extends _TdSearchInputMixinBase\n implements IControlValueAccessor, OnInit, OnDestroy\n{\n @ViewChild(MatInput, { static: true }) _input?: MatInput;\n\n @ViewChild('searchElement', { static: true, read: ElementRef })\n _searchElement!: ElementRef<HTMLInputElement>;\n\n /**\n * appearance?: MatFormFieldAppearance\n * Appearance style for the underlying input component.\n */\n @Input() appearance: MatFormFieldAppearance = 'legacy';\n\n /**\n * showUnderline?: boolean\n * Sets if the input underline should be visible. Defaults to 'false'.\n */\n @Input() showUnderline = false;\n\n /**\n * debounce?: number\n * Debounce timeout between keypresses. Defaults to 400.\n */\n @Input() debounce = 400;\n\n /**\n * placeholder?: string\n * Placeholder for the underlying input component.\n */\n @Input() placeholder = '';\n\n /**\n * clearIcon?: string\n * The icon used to clear the search input.\n * Defaults to 'cancel' icon.\n */\n @Input() clearIcon = 'cancel';\n\n @Input() override value!: unknown;\n\n /**\n * searchDebounce: function($event)\n * Event emitted after the [debounce] timeout.\n */\n @Output() searchDebounce: EventEmitter<string> = new EventEmitter<string>();\n\n /**\n * search: function($event)\n * Event emitted after the key enter has been pressed.\n */\n @Output() search: EventEmitter<string> = new EventEmitter<string>();\n\n /**\n * clear: function()\n * Event emitted after the clear icon has been clicked.\n */\n @Output() clear: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * blur: function()\n * Event emitted after the blur event has been called in underlying input.\n */\n @Output() blurSearch: EventEmitter<void> = new EventEmitter<void>();\n\n get isRTL(): boolean {\n if (this._dir) {\n return this._dir.dir === 'rtl';\n }\n return false;\n }\n\n private _destroy$ = new Subject<void>();\n\n constructor(\n @Optional() private _dir: Dir,\n override _changeDetectorRef: ChangeDetectorRef,\n private _ngZone: NgZone\n ) {\n super(_changeDetectorRef);\n }\n\n ngOnInit(): void {\n this._input?.ngControl?.valueChanges\n ?.pipe(\n debounceTime(this.debounce),\n skip(1), // skip first change when value is set to undefined\n takeUntil(this._destroy$)\n )\n .subscribe((value: string) => {\n this._searchTermChanged(value);\n });\n\n this._ngZone.runOutsideAngular(() =>\n fromEvent(this._searchElement.nativeElement, 'search')\n .pipe(takeUntil(this._destroy$))\n .subscribe(this._stopPropagation)\n );\n }\n\n ngOnDestroy(): void {\n this._destroy$.next();\n }\n\n /**\n * Method to focus to underlying input.\n */\n focus(): void {\n this._input?.focus();\n }\n\n handleBlur(): void {\n this.blurSearch.emit();\n }\n\n handleSearch(event: Event): void {\n this._stopPropagation(event);\n if (typeof this.value == 'string') {\n this.search.emit(this.value);\n }\n }\n\n /**\n * Method to clear the underlying input.\n */\n clearSearch(): void {\n this.value = '';\n this._changeDetectorRef.markForCheck();\n this.clear.emit();\n }\n\n private _searchTermChanged(value: string): void {\n this.searchDebounce.emit(value);\n }\n\n private _stopPropagation(event: Event): void {\n event.stopPropagation();\n }\n}\n","<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","import {\n Component,\n ViewChild,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n forwardRef,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n trigger,\n state,\n style,\n transition,\n animate,\n AUTO_STYLE,\n} from '@angular/animations';\n\nimport { TdSearchInputComponent } from '../search-input/search-input.component';\nimport { noop } from 'rxjs';\n\nexport class TdSearchBoxBase {\n constructor(public _changeDetectorRef: ChangeDetectorRef) {}\n}\n\n@Component({\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TdSearchBoxComponent),\n multi: true,\n },\n ],\n selector: 'td-search-box',\n templateUrl: './search-box.component.html',\n styleUrls: ['./search-box.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [\n trigger('inputState', [\n state(\n '0',\n style({\n width: '0%',\n margin: '0px',\n })\n ),\n state(\n '1',\n style({\n width: '100%',\n margin: AUTO_STYLE,\n })\n ),\n transition('0 => 1', animate('200ms ease-in')),\n transition('1 => 0', animate('200ms ease-out')),\n ]),\n ],\n})\nexport class TdSearchBoxComponent implements ControlValueAccessor {\n private _searchVisible = false;\n @ViewChild(TdSearchInputComponent, { static: true })\n _searchInput?: TdSearchInputComponent;\n\n get searchVisible(): boolean {\n return this._searchVisible;\n }\n\n /**\n * backIcon?: string\n * The icon used to close the search toggle, only shown when [alwaysVisible] is false.\n * Defaults to 'search' icon.\n */\n @Input() backIcon = 'search';\n\n /**\n * searchIcon?: string\n * The icon used to open/focus the search toggle.\n * Defaults to 'search' icon.\n */\n @Input() searchIcon = 'search';\n\n /**\n * clearIcon?: string\n * The icon used to clear the search input.\n * Defaults to 'cancel' icon.\n */\n @Input() clearIcon = 'cancel';\n\n /**\n * showUnderline?: boolean\n * Sets if the input underline should be visible. Defaults to 'false'.\n */\n @Input() showUnderline = false;\n\n /**\n * debounce?: number\n * Debounce timeout between keypresses. Defaults to 400.\n */\n @Input() debounce = 400;\n\n /**\n * alwaysVisible?: boolean\n * Sets if the input should always be visible. Defaults to 'false'.\n */\n @Input() alwaysVisible = false;\n\n /**\n * placeholder?: string\n * Placeholder for the underlying input component.\n */\n @Input() placeholder = '';\n\n @Input() value: unknown;\n\n /**\n * searchDebounce: function($event)\n * Event emitted after the [debounce] timeout.\n */\n @Output() searchDebounce: EventEmitter<string> = new EventEmitter<string>();\n\n /**\n * search: function($event)\n * Event emitted after the key enter has been pressed.\n */\n @Output() search: EventEmitter<string> = new EventEmitter<string>();\n\n /**\n * clear: function()\n * Event emitted after the clear icon has been clicked.\n */\n @Output() clear: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * blur: function()\n * Event emitted after the blur event has been called in underlying input.\n */\n @Output() blurSearch: EventEmitter<void> = new EventEmitter<void>();\n\n constructor(private _changeDetectorRef: ChangeDetectorRef) {}\n\n writeValue(value: unknown): void {\n this.value = value;\n this._changeDetectorRef.markForCheck();\n }\n\n registerOnChange(): void {\n noop;\n }\n\n registerOnTouched(): void {\n noop;\n }\n\n /**\n * Method executed when the search icon is clicked.\n */\n searchClicked(): void {\n if (!this.alwaysVisible && this._searchVisible) {\n this.value = '';\n this.handleClear();\n } else if (this.alwaysVisible || !this._searchVisible) {\n this._searchInput?.focus();\n }\n this.toggleVisibility();\n }\n\n toggleVisibility(): void {\n this._searchVisible = !this._searchVisible;\n this._changeDetectorRef.markForCheck();\n }\n\n handleSearchDebounce(value: string): void {\n this.searchDebounce.emit(value);\n }\n\n handleSearch(value: string): void {\n this.search.emit(value);\n }\n\n handleClear(): void {\n this.clear.emit();\n }\n\n handleBlur(): void {\n this.blurSearch.emit();\n }\n}\n","<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","import { NgModule } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\nimport { MatInputModule } from '@angular/material/input';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport { TdSearchInputComponent } from './search-input/search-input.component';\nimport { TdSearchBoxComponent } from './search-box/search-box.component';\n\n@NgModule({\n imports: [\n FormsModule,\n CommonModule,\n MatInputModule,\n MatIconModule,\n MatButtonModule,\n ],\n declarations: [TdSearchInputComponent, TdSearchBoxComponent],\n exports: [TdSearchInputComponent, TdSearchBoxComponent],\n})\nexport class CovalentSearchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;MAiCa,iBAAiB;IAC5B,YAAmB,kBAAqC;QAArC,uBAAkB,GAAlB,kBAAkB,CAAmB;KAAI;CAC7D;MAEY,uBAAuB,GAClC,yBAAyB,CAAC,iBAAiB,EAAE;MA0ClC,sBACX,SAAQ,uBAAuB;IA0E/B,YACsB,IAAS,EACpB,kBAAqC,EACtC,OAAe;QAEvB,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAJN,SAAI,GAAJ,IAAI,CAAK;QACpB,uBAAkB,GAAlB,kBAAkB,CAAmB;QACtC,YAAO,GAAP,OAAO,CAAQ;;;;;QAjEhB,eAAU,GAA2B,QAAQ,CAAC;;;;;QAM9C,kBAAa,GAAG,KAAK,CAAC;;;;;QAMtB,aAAQ,GAAG,GAAG,CAAC;;;;;QAMf,gBAAW,GAAG,EAAE,CAAC;;;;;;QAOjB,cAAS,GAAG,QAAQ,CAAC;;;;;QAQpB,mBAAc,GAAyB,IAAI,YAAY,EAAU,CAAC;;;;;QAMlE,WAAM,GAAyB,IAAI,YAAY,EAAU,CAAC;;;;;QAM1D,UAAK,GAAuB,IAAI,YAAY,EAAQ,CAAC;;;;;QAMrD,eAAU,GAAuB,IAAI,YAAY,EAAQ,CAA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C,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;yBAChD,CAAC;qBACH;wGAKD,YAAY;sBADX,SAAS;uBAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;gBAY1C,QAAQ;sBAAhB,KAAK;gBAOG,UAAU;sBAAlB,KAAK;gBAOG,SAAS;sBAAjB,KAAK;gBAMG,aAAa;sBAArB,KAAK;gBAMG,QAAQ;sBAAhB,KAAK;gBAMG,aAAa;sBAArB,KAAK;gBAMG,WAAW;sBAAnB,KAAK;gBAEG,KAAK;sBAAb,KAAK;gBAMI,cAAc;sBAAvB,MAAM;gBAMG,MAAM;sBAAf,MAAM;gBAMG,KAAK;sBAAd,MAAM;gBAMG,UAAU;sBAAnB,MAAM;;;MEnHI,oBAAoB;;iHAApB,oBAAoB;kHAApB,oBAAoB,iBAHhB,sBAAsB,EAAE,oBAAoB,aANzD,WAAW;QACX,YAAY;QACZ,cAAc;QACd,aAAa;QACb,eAAe,aAGP,sBAAsB,EAAE,oBAAoB;kHAE3C,oBAAoB,YAVtB;YACP,WAAW;YACX,YAAY;YACZ,cAAc;YACd,aAAa;YACb,eAAe;SAChB;2FAIU,oBAAoB;kBAXhC,QAAQ;mBAAC;oBACR,OAAO,EAAE;wBACP,WAAW;wBACX,YAAY;wBACZ,cAAc;wBACd,aAAa;wBACb,eAAe;qBAChB;oBACD,YAAY,EAAE,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;oBAC5D,OAAO,EAAE,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;iBACxD;;;ACtBD;;;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@covalent/core",
|
3
|
-
"version": "4.1.
|
3
|
+
"version": "4.1.10",
|
4
4
|
"exports": {
|
5
5
|
".": {
|
6
6
|
"sass": "./theming/_all-theme.scss",
|
@@ -127,7 +127,7 @@
|
|
127
127
|
"@angular/router": "^13.2.0",
|
128
128
|
"@angular/cdk": "^13.2.1",
|
129
129
|
"@angular/material": "^13.2.1",
|
130
|
-
"@covalent/core": "4.1.
|
130
|
+
"@covalent/core": "4.1.10",
|
131
131
|
"@angular/platform-browser": "^13.2.0",
|
132
132
|
"rxjs": "~7.4.0",
|
133
133
|
"@angular/animations": "^13.2.0",
|
@@ -1,17 +1,20 @@
|
|
1
|
-
import { OnInit, EventEmitter, ChangeDetectorRef } from '@angular/core';
|
2
|
-
import { ControlValueAccessor } from '@angular/forms';
|
1
|
+
import { OnInit, EventEmitter, ChangeDetectorRef, OnDestroy, ElementRef, NgZone } from '@angular/core';
|
3
2
|
import { Dir } from '@angular/cdk/bidi';
|
4
3
|
import { MatInput } from '@angular/material/input';
|
5
4
|
import { MatFormFieldAppearance } from '@angular/material/form-field';
|
5
|
+
import { IControlValueAccessor } from '@covalent/core/common';
|
6
6
|
import * as i0 from "@angular/core";
|
7
7
|
export declare class TdSearchInputBase {
|
8
8
|
_changeDetectorRef: ChangeDetectorRef;
|
9
9
|
constructor(_changeDetectorRef: ChangeDetectorRef);
|
10
10
|
}
|
11
|
-
export declare
|
11
|
+
export declare const _TdSearchInputMixinBase: (new (...args: any[]) => IControlValueAccessor) & typeof TdSearchInputBase;
|
12
|
+
export declare class TdSearchInputComponent extends _TdSearchInputMixinBase implements IControlValueAccessor, OnInit, OnDestroy {
|
12
13
|
private _dir;
|
13
|
-
|
14
|
+
_changeDetectorRef: ChangeDetectorRef;
|
15
|
+
private _ngZone;
|
14
16
|
_input?: MatInput;
|
17
|
+
_searchElement: ElementRef<HTMLInputElement>;
|
15
18
|
/**
|
16
19
|
* appearance?: MatFormFieldAppearance
|
17
20
|
* Appearance style for the underlying input component.
|
@@ -38,7 +41,7 @@ export declare class TdSearchInputComponent implements ControlValueAccessor, OnI
|
|
38
41
|
* Defaults to 'cancel' icon.
|
39
42
|
*/
|
40
43
|
clearIcon: string;
|
41
|
-
value
|
44
|
+
value: unknown;
|
42
45
|
/**
|
43
46
|
* searchDebounce: function($event)
|
44
47
|
* Event emitted after the [debounce] timeout.
|
@@ -60,23 +63,22 @@ export declare class TdSearchInputComponent implements ControlValueAccessor, OnI
|
|
60
63
|
*/
|
61
64
|
blurSearch: EventEmitter<void>;
|
62
65
|
get isRTL(): boolean;
|
63
|
-
|
66
|
+
private _destroy$;
|
67
|
+
constructor(_dir: Dir, _changeDetectorRef: ChangeDetectorRef, _ngZone: NgZone);
|
64
68
|
ngOnInit(): void;
|
65
|
-
|
66
|
-
registerOnChange(): void;
|
67
|
-
registerOnTouched(): void;
|
69
|
+
ngOnDestroy(): void;
|
68
70
|
/**
|
69
71
|
* Method to focus to underlying input.
|
70
72
|
*/
|
71
73
|
focus(): void;
|
72
74
|
handleBlur(): void;
|
73
|
-
stopPropagation(event: Event): void;
|
74
75
|
handleSearch(event: Event): void;
|
75
76
|
/**
|
76
77
|
* Method to clear the underlying input.
|
77
78
|
*/
|
78
79
|
clearSearch(): void;
|
79
80
|
private _searchTermChanged;
|
80
|
-
|
81
|
+
private _stopPropagation;
|
82
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdSearchInputComponent, [{ optional: true; }, null, null]>;
|
81
83
|
static ɵcmp: i0.ɵɵComponentDeclaration<TdSearchInputComponent, "td-search-input", never, { "appearance": "appearance"; "showUnderline": "showUnderline"; "debounce": "debounce"; "placeholder": "placeholder"; "clearIcon": "clearIcon"; "value": "value"; }, { "searchDebounce": "searchDebounce"; "search": "search"; "clear": "clear"; "blurSearch": "blurSearch"; }, never, never>;
|
82
84
|
}
|