bitfront-library
Version:
Angular CLI project with components and classes used by other Angular projects of the BIT foundation.
107 lines • 7.09 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigListTableViewComponent = void 0;
var core_1 = require("@angular/core");
var router_1 = require("@angular/router");
var index_1 = require("../../base/index");
var index_2 = require("../../shared/index");
var i0 = require("@angular/core");
var i1 = require("../../shared/index");
var i2 = require("@angular/router");
var i3 = require("@angular/common");
var i4 = require("primeng/table");
var i5 = require("primeng/api");
function ConfigListTableViewComponent_p_table_0_ng_template_1_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "tr");
i0.ɵɵelementStart(1, "th", 4);
i0.ɵɵtext(2, "Codi");
i0.ɵɵelement(3, "p-sortIcon", 5);
i0.ɵɵelementEnd();
i0.ɵɵelementStart(4, "th", 6);
i0.ɵɵtext(5, "Valor");
i0.ɵɵelement(6, "p-sortIcon", 7);
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
} }
function ConfigListTableViewComponent_p_table_0_ng_template_2_Template(rf, ctx) { if (rf & 1) {
var _r5 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "tr", 8);
i0.ɵɵlistener("click", function ConfigListTableViewComponent_p_table_0_ng_template_2_Template_tr_click_0_listener() { i0.ɵɵrestoreView(_r5); var rowData_r3 = ctx.$implicit; var ctx_r4 = i0.ɵɵnextContext(2); return ctx_r4.gotoForm(rowData_r3); });
i0.ɵɵelementStart(1, "td");
i0.ɵɵtext(2);
i0.ɵɵelementEnd();
i0.ɵɵelementStart(3, "td");
i0.ɵɵtext(4);
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
} if (rf & 2) {
var rowData_r3 = ctx.$implicit;
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate(rowData_r3.codigo);
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate(rowData_r3.valor);
} }
function ConfigListTableViewComponent_p_table_0_Template(rf, ctx) { if (rf & 1) {
var _r7 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "p-table", 1);
i0.ɵɵlistener("onRowClick", function ConfigListTableViewComponent_p_table_0_Template_p_table_onRowClick_0_listener($event) { i0.ɵɵrestoreView(_r7); var ctx_r6 = i0.ɵɵnextContext(); return ctx_r6.gotoForm($event); });
i0.ɵɵtemplate(1, ConfigListTableViewComponent_p_table_0_ng_template_1_Template, 7, 0, "ng-template", 2);
i0.ɵɵtemplate(2, ConfigListTableViewComponent_p_table_0_ng_template_2_Template, 5, 2, "ng-template", 3);
i0.ɵɵelementEnd();
} if (rf & 2) {
var ctx_r0 = i0.ɵɵnextContext();
i0.ɵɵproperty("columns", ctx_r0.cols)("value", ctx_r0.items);
} }
var ConfigListTableViewComponent = /** @class */ (function (_super) {
__extends(ConfigListTableViewComponent, _super);
function ConfigListTableViewComponent(domainCachedService, tableViewService, router, activatedRoute) {
var _this = _super.call(this, domainCachedService, tableViewService) || this;
_this.domainCachedService = domainCachedService;
_this.tableViewService = tableViewService;
_this.router = router;
_this.activatedRoute = activatedRoute;
_this.cols = [
{ field: "codigo", header: "Codi" },
{ field: "valor", header: "Valor" }
];
_this.cols = [
{ field: "codigo", header: "Codi" },
{ field: "valor", header: "Valor" }
];
return _this;
}
ConfigListTableViewComponent.prototype.gotoForm = function (event) {
this.router.navigate(["form", event.codigo], { relativeTo: this.activatedRoute }); //, {relativeTo: this.activatedRoute}
};
ConfigListTableViewComponent.ɵfac = function ConfigListTableViewComponent_Factory(t) { return new (t || ConfigListTableViewComponent)(i0.ɵɵdirectiveInject(i1.DomainCachedService), i0.ɵɵdirectiveInject(i1.TableViewService), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(i2.ActivatedRoute)); };
ConfigListTableViewComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ConfigListTableViewComponent, selectors: [["config-list-tableview"]], inputs: { items: "items" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["selectionMode", "single", 3, "columns", "value", "onRowClick", 4, "ngIf"], ["selectionMode", "single", 3, "columns", "value", "onRowClick"], ["pTemplate", "header"], ["pTemplate", "body"], ["pSortableColumn", "codigo"], ["field", "codigo"], ["pSortableColumn", "valor"], ["field", "valor"], [3, "click"]], template: function ConfigListTableViewComponent_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵtemplate(0, ConfigListTableViewComponent_p_table_0_Template, 3, 2, "p-table", 0);
} if (rf & 2) {
i0.ɵɵproperty("ngIf", ctx.items != null && ctx.items.length > 0);
} }, directives: [i3.NgIf, i4.Table, i5.PrimeTemplate, i4.SortableColumn, i4.SortIcon], encapsulation: 2 });
return ConfigListTableViewComponent;
}(index_1.BaseTableViewComponent));
exports.ConfigListTableViewComponent = ConfigListTableViewComponent;
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfigListTableViewComponent, [{
type: core_1.Component,
args: [{
selector: "config-list-tableview",
template: "\n <!--<p-dataTable [value]=\"items\" (onRowClick)=\"gotoForm($event)\" selectionMode=\"single\" *ngIf=\"(items != null && items.length > 0)\">\n <p-column field=\"codigo\" header=\"Codi\" [sortable]=\"true\"></p-column>\n <p-column field=\"valor\" header=\"Valor\" [sortable]=\"true\"></p-column>\n</p-dataTable>-->\n <p-table\n [columns]=\"cols\"\n [value]=\"items\"\n (onRowClick)=\"gotoForm($event)\"\n selectionMode=\"single\"\n *ngIf=\"items != null && items.length > 0\"\n >\n <ng-template pTemplate=\"header\">\n <tr>\n <th pSortableColumn=\"codigo\">Codi<p-sortIcon field=\"codigo\"></p-sortIcon></th>\n <th pSortableColumn=\"valor\">Valor<p-sortIcon field=\"valor\"></p-sortIcon></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData>\n <tr (click)=\"gotoForm(rowData)\">\n <td>{{ rowData.codigo }}</td>\n <td>{{ rowData.valor }}</td>\n </tr>\n </ng-template>\n </p-table>\n "
}]
}], function () { return [{ type: i1.DomainCachedService }, { type: i1.TableViewService }, { type: i2.Router }, { type: i2.ActivatedRoute }]; }, { items: [{
type: core_1.Input
}] }); })();
//# sourceMappingURL=config-list-tableview.component.js.map