UNPKG

ngx-easy-table

Version:
24 lines 4.4 kB
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import * as i0 from "@angular/core"; export class HeaderComponent { constructor() { this.update = new EventEmitter(); } unifyKey(key) { return key.replace('.', '_'); } onSearch(input) { this.update.emit([{ value: input.value, key: this.column.key }]); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: HeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: HeaderComponent, selector: "table-header", inputs: { column: "column" }, outputs: { update: "update" }, ngImport: i0, template: "<label for=\"search_{{ unifyKey(column.key) }}\">\n <input\n type=\"text\"\n id=\"search_{{ unifyKey(column.key) }}\"\n aria-label=\"Search\"\n placeholder=\"{{ column.placeholder ? column.placeholder : column.title }}\"\n class=\"ngx-table__header-search\"\n #input\n (input)=\"onSearch(input)\"\n />\n</label>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: HeaderComponent, decorators: [{ type: Component, args: [{ selector: 'table-header', changeDetection: ChangeDetectionStrategy.OnPush, template: "<label for=\"search_{{ unifyKey(column.key) }}\">\n <input\n type=\"text\"\n id=\"search_{{ unifyKey(column.key) }}\"\n aria-label=\"Search\"\n placeholder=\"{{ column.placeholder ? column.placeholder : column.title }}\"\n class=\"ngx-table__header-search\"\n #input\n (input)=\"onSearch(input)\"\n />\n</label>\n" }] }], propDecorators: { column: [{ type: Input }], update: [{ type: Output }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVhZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1lYXN5LX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