UNPKG

rb-data-table

Version:
51 lines 2.69 kB
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, EventEmitter } from '@angular/core'; import { Grid } from '../../../lib/grid'; import { Row } from '../../../lib/data-set/row'; var TbodyCreateCancelComponent = /** @class */ (function () { function TbodyCreateCancelComponent() { } TbodyCreateCancelComponent.prototype.onSave = function (event) { event.preventDefault(); event.stopPropagation(); this.grid.save(this.row, this.editConfirm); }; TbodyCreateCancelComponent.prototype.onCancelEdit = function (event) { event.preventDefault(); event.stopPropagation(); this.row.isInEditing = false; }; TbodyCreateCancelComponent.prototype.ngOnChanges = function () { this.saveButtonContent = this.grid.getSetting('edit.saveButtonContent'); this.cancelButtonContent = this.grid.getSetting('edit.cancelButtonContent'); }; __decorate([ Input(), __metadata("design:type", Grid) ], TbodyCreateCancelComponent.prototype, "grid", void 0); __decorate([ Input(), __metadata("design:type", Row) ], TbodyCreateCancelComponent.prototype, "row", void 0); __decorate([ Input(), __metadata("design:type", EventEmitter) ], TbodyCreateCancelComponent.prototype, "editConfirm", void 0); TbodyCreateCancelComponent = __decorate([ Component({ selector: 'ng2-st-tbody-create-cancel', template: "\n <a href=\"#\" class=\"ng2-smart-action ng2-smart-action-edit-save\"\n [innerHTML]=\"saveButtonContent\" (click)=\"onSave($event)\"></a>\n <a href=\"#\" class=\"ng2-smart-action ng2-smart-action-edit-cancel\"\n [innerHTML]=\"cancelButtonContent\" (click)=\"onCancelEdit($event)\"></a>\n ", }) ], TbodyCreateCancelComponent); return TbodyCreateCancelComponent; }()); export { TbodyCreateCancelComponent }; //# sourceMappingURL=create-cancel.component.js.map