rb-data-table
Version:
Angular Smart Table
45 lines • 2.6 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { Cell } from '../../../lib/data-set/cell';
var EditCellComponent = /** @class */ (function () {
function EditCellComponent() {
this.inputClass = '';
this.edited = new EventEmitter();
}
EditCellComponent.prototype.onEdited = function (event) {
this.edited.next(event);
return false;
};
EditCellComponent.prototype.getEditorType = function () {
return this.cell.getColumn().editor && this.cell.getColumn().editor.type;
};
__decorate([
Input(),
__metadata("design:type", Cell)
], EditCellComponent.prototype, "cell", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], EditCellComponent.prototype, "inputClass", void 0);
__decorate([
Output(),
__metadata("design:type", Object)
], EditCellComponent.prototype, "edited", void 0);
EditCellComponent = __decorate([
Component({
selector: 'table-cell-edit-mode',
template: "\n <div [ngSwitch]=\"getEditorType()\">\n <table-cell-custom-editor *ngSwitchCase=\"'custom'\"\n [cell]=\"cell\"\n [inputClass]=\"inputClass\"\n (edited)=\"onEdited($event)\">\n </table-cell-custom-editor>\n <table-cell-default-editor *ngSwitchDefault\n [cell]=\"cell\"\n [inputClass]=\"inputClass\"\n (edited)=\"onEdited($event)\">\n </table-cell-default-editor>\n </div>\n ",
})
], EditCellComponent);
return EditCellComponent;
}());
export { EditCellComponent };
//# sourceMappingURL=edit-cell.component.js.map