ng2-smart-table-custom
Version:
Angular Smart Table with inline-validations support
52 lines • 3.29 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 { Grid } from '../../../lib/grid';
import { Row } from '../../../lib/data-set/row';
var TheadFormRowComponent = (function () {
function TheadFormRowComponent() {
this.create = new EventEmitter();
}
TheadFormRowComponent.prototype.onCreate = function (event) {
event.stopPropagation();
this.grid.create(this.grid.getNewRow(), this.createConfirm);
};
TheadFormRowComponent.prototype.ngOnChanges = function () {
this.isMultiSelectVisible = this.grid.isMultiSelectVisible();
this.showActionColumnLeft = this.grid.showActionColumn('left');
this.showActionColumnRight = this.grid.showActionColumn('right');
this.addInputClass = this.grid.getSetting('add.inputClass');
};
return TheadFormRowComponent;
}());
__decorate([
Input(),
__metadata("design:type", Grid)
], TheadFormRowComponent.prototype, "grid", void 0);
__decorate([
Input(),
__metadata("design:type", Row)
], TheadFormRowComponent.prototype, "row", void 0);
__decorate([
Input(),
__metadata("design:type", EventEmitter)
], TheadFormRowComponent.prototype, "createConfirm", void 0);
__decorate([
Output(),
__metadata("design:type", Object)
], TheadFormRowComponent.prototype, "create", void 0);
TheadFormRowComponent = __decorate([
Component({
selector: '[ng2-st-thead-form-row]',
template: "\n <td *ngIf=\"\"></td>\n <td *ngIf=\"showActionColumnLeft\" class=\"ng2-smart-actions\">\n <ng2-st-actions [grid]=\"grid\" (create)=\"onCreate($event)\"></ng2-st-actions>\n </td>\n <td *ngFor=\"let cell of grid.getNewRow().getCells()\">\n <ng2-smart-table-cell [cell]=\"cell\"\n [grid]=\"grid\"\n [isNew]=\"true\"\n [createConfirm]=\"createConfirm\"\n [inputClass]=\"addInputClass\"\n [isInEditing]=\"grid.getNewRow().isInEditing\"\n (edited)=\"onCreate($event)\">\n </ng2-smart-table-cell>\n </td>\n <td *ngIf=\"showActionColumnRight\" class=\"ng2-smart-actions\">\n <ng2-st-actions [grid]=\"grid\" (create)=\"onCreate($event)\"></ng2-st-actions>\n </td>\n ",
})
], TheadFormRowComponent);
export { TheadFormRowComponent };
//# sourceMappingURL=thead-form-row.component.js.map