/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, EventEmitter, Input, Output } from '@angular/core';
/**
 * A search input for searching by keyword
 *
 * {\@link https://ng.ant.design/components/input/en#components-input-demo-search-input}
 */
export class KengicSearchComponent {
    constructor() {
        //region Input
        //region Input
        /**
         * The keyword
         */
        this.key = '';
        //endregion
        //region Output
        /**
         * The keyword change event
         */
        this.keyChange = new EventEmitter();
        /**
         * Clear the keyword
         */
        this.clear = new EventEmitter();
        /**
         * Press the `Enter` key or click the search button
         */
        this.search = new EventEmitter();
        //endregion
    }
    //endregion
    //region Method
    /**
     * Press the `Enter` key or click the search button
     * @return {?}
     */
    handleSearch() {
        this.search.emit(this.key);
    }
    /**
     * Clear the keyword
     * @return {?}
     */
    handleClear() {
        this.keyChange.emit('');
        this.clear.emit();
    }
}
KengicSearchComponent.decorators = [
    { type: Component, args: [{
                selector: 'kengic-search',
                template: "<nz-input-group [nzSearch]=\"true\" [nzAddOnAfter]=\"searchIcon\">\r\n  <input\r\n    type=\"text\"\r\n    nz-input\r\n    [ngStyle]=\"{\r\n      width: '200px'\r\n    }\"\r\n    [ngModel]=\"key\"\r\n    (ngModelChange)=\"keyChange.emit($event)\"\r\n    (keyup.enter)=\"handleSearch()\"\r\n  />\r\n</nz-input-group>\r\n\r\n<ng-template #searchIcon>\r\n  <nz-button-group>\r\n    <button\r\n      nz-button\r\n      [ngStyle]=\"{\r\n        borderRadius: '0px'\r\n      }\"\r\n      (click)=\"handleClear()\"\r\n    >\r\n      <i nz-icon nzType=\"close\" nzTheme=\"outline\"></i>\r\n    </button>\r\n    <button nz-button nzType=\"primary\" (click)=\"handleSearch()\">\r\n      <i nz-icon nzType=\"search\" nzTheme=\"outline\"></i>\r\n    </button>\r\n  </nz-button-group>\r\n</ng-template>\r\n"
            }] }
];
KengicSearchComponent.propDecorators = {
    key: [{ type: Input }],
    keyChange: [{ type: Output }],
    clear: [{ type: Output }],
    search: [{ type: Output }]
};
if (false) {
    /**
     * The keyword
     * @type {?}
     */
    KengicSearchComponent.prototype.key;
    /**
     * The keyword change event
     * @type {?}
     */
    KengicSearchComponent.prototype.keyChange;
    /**
     * Clear the keyword
     * @type {?}
     */
    KengicSearchComponent.prototype.clear;
    /**
     * Press the `Enter` key or click the search button
     * @type {?}
     */
    KengicSearchComponent.prototype.search;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2VuZ2ljLXNlYXJjaC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Aa2VuZ2ljL2ZlLW5nLyIsInNvdXJjZXMiOlsibGliL2NvbXBvbmVudC9zZWFyY2gva2VuZ2ljLXNlYXJjaC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7Ozs7OztBQVd2RSxNQUFNLE9BQU8scUJBQXFCO0lBSmxDO1FBS0UsY0FBYzs7Ozs7UUFJUCxRQUFHLEdBQVcsRUFBRSxDQUFDOzs7Ozs7UUFRakIsY0FBUyxHQUF5QixJQUFJLFlBQVksRUFBRSxDQUFDOzs7O1FBSXJELFVBQUssR0FBeUIsSUFBSSxZQUFZLEVBQUUsQ0FBQzs7OztRQUlqRCxXQUFNLEdBQXlCLElBQUksWUFBWSxFQUFFLENBQUM7UUFxQnpELFdBQVc7SUFDYixDQUFDOzs7Ozs7O0lBYlEsWUFBWTtRQUNqQixJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDN0IsQ0FBQzs7Ozs7SUFLTSxXQUFXO1FBQ2hCLElBQUksQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQ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