ngx-easy-table
Version:
Angular easy table
43 lines • 3.13 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { Component, EventEmitter, Input, Output } from '@angular/core';
export class HeaderComponent {
constructor() {
this.update = new EventEmitter();
}
/**
* @param {?} key
* @return {?}
*/
unifyKey(key) {
return key.replace('.', '_');
}
/**
* @param {?} input
* @return {?}
*/
onSearch(input) {
this.update.emit([
{ value: input.value, key: this.column.key },
]);
}
}
HeaderComponent.decorators = [
{ type: Component, args: [{
selector: 'table-header',
template: "<label for=\"search_{{ unifyKey(column.key) }}\">\n <input 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"
}] }
];
HeaderComponent.propDecorators = {
column: [{ type: Input }],
update: [{ type: Output }]
};
if (false) {
/** @type {?} */
HeaderComponent.prototype.column;
/** @type {?} */
HeaderComponent.prototype.update;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVhZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1lYXN5LXRhYmxlLyIsInNvdXJjZXMiOlsibGliL2NvbXBvbmVudHMvaGVhZGVyL2hlYWRlci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFRdkUsTUFBTSxPQUFPLGVBQWU7SUFMNUI7UUFPcUIsV0FBTSxHQUFHLElBQUksWUFBWSxFQUF5QyxDQUFDO0lBV3hGLENBQUM7Ozs7O0lBVEMsUUFBUSxDQUFDLEdB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