UNPKG

angular4-material-table

Version:

Angular 4 table based on @angular/cdk table structure, to allow row insertion, edition, validation and deletion.

51 lines 1.9 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { TableElement } from './table-element'; var TableElementReactiveForms = /** @class */ (function (_super) { __extends(TableElementReactiveForms, _super); function TableElementReactiveForms(init) { var _this = _super.call(this) || this; _this.validator = init.validator; Object.assign(_this, init); return _this; } Object.defineProperty(TableElementReactiveForms.prototype, "currentData", { get: function () { return this.validator.getRawValue(); }, set: function (data) { this.validator.patchValue(data); }, enumerable: true, configurable: true }); Object.defineProperty(TableElementReactiveForms.prototype, "editing", { get: function () { return this.validator.enabled; }, set: function (value) { if (value) { this.validator.enable(); } else { this.validator.disable(); } }, enumerable: true, configurable: true }); TableElementReactiveForms.prototype.isValid = function () { return this.validator.valid; }; return TableElementReactiveForms; }(TableElement)); export { TableElementReactiveForms }; //# sourceMappingURL=table-element-reactive-forms.js.map