bitfront-library
Version:
Angular CLI project with components and classes used by other Angular projects of the BIT foundation.
128 lines • 9.4 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExceptionListTableViewComponent = void 0;
var core_1 = require("@angular/core");
var message_service_1 = require("../../shared/service/message.service");
var bitmessage_1 = require("../../shared/data/bitmessage");
var i0 = require("@angular/core");
var i1 = require("../../shared/service/message.service");
var i2 = require("@angular/common");
var i3 = require("primeng/table");
var i4 = require("primeng/api");
function ExceptionListTableViewComponent_p_table_0_ng_template_1_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "tr");
i0.ɵɵelementStart(1, "th", 4);
i0.ɵɵtext(2, "Login");
i0.ɵɵelement(3, "p-sortIcon", 5);
i0.ɵɵelementEnd();
i0.ɵɵelementStart(4, "th", 6);
i0.ɵɵtext(5, "Concepto");
i0.ɵɵelement(6, "p-sortIcon", 7);
i0.ɵɵelementEnd();
i0.ɵɵelementStart(7, "th", 8);
i0.ɵɵtext(8, "Operaci\u00F3n");
i0.ɵɵelement(9, "p-sortIcon", 9);
i0.ɵɵelementEnd();
i0.ɵɵelementStart(10, "th", 10);
i0.ɵɵtext(11, "Hora");
i0.ɵɵelement(12, "p-sortIcon", 11);
i0.ɵɵelementEnd();
i0.ɵɵelement(13, "th");
i0.ɵɵelementEnd();
} }
function ExceptionListTableViewComponent_p_table_0_ng_template_2_button_13_Template(rf, ctx) { if (rf & 1) {
var _r7 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "button", 16);
i0.ɵɵlistener("click", function ExceptionListTableViewComponent_p_table_0_ng_template_2_button_13_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r7); var log_r3 = i0.ɵɵnextContext().$implicit; var ctx_r5 = i0.ɵɵnextContext(2); return ctx_r5.showDatosLog($event, log_r3.error, "Error"); });
i0.ɵɵtext(1, " Error\u00A0\u00A0");
i0.ɵɵelement(2, "span", 17);
i0.ɵɵelementEnd();
} }
function ExceptionListTableViewComponent_p_table_0_ng_template_2_Template(rf, ctx) { if (rf & 1) {
var _r9 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "tr", 12);
i0.ɵɵlistener("click", function ExceptionListTableViewComponent_p_table_0_ng_template_2_Template_tr_click_0_listener() { i0.ɵɵrestoreView(_r9); var log_r3 = ctx.$implicit; var ctx_r8 = i0.ɵɵnextContext(2); return ctx_r8.gotoForm(log_r3); });
i0.ɵɵelementStart(1, "td");
i0.ɵɵtext(2);
i0.ɵɵelementEnd();
i0.ɵɵelementStart(3, "td");
i0.ɵɵtext(4);
i0.ɵɵelementEnd();
i0.ɵɵelementStart(5, "td");
i0.ɵɵtext(6);
i0.ɵɵelementEnd();
i0.ɵɵelementStart(7, "td");
i0.ɵɵelementStart(8, "span");
i0.ɵɵtext(9);
i0.ɵɵpipe(10, "date");
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
i0.ɵɵelementStart(11, "td", 13);
i0.ɵɵelementStart(12, "div", 14);
i0.ɵɵtemplate(13, ExceptionListTableViewComponent_p_table_0_ng_template_2_button_13_Template, 3, 0, "button", 15);
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
} if (rf & 2) {
var log_r3 = ctx.$implicit;
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate(log_r3.login);
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate(log_r3.concepto);
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate(log_r3.method);
i0.ɵɵadvance(3);
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(10, 5, log_r3.fecha, "HH:mm"));
i0.ɵɵadvance(4);
i0.ɵɵproperty("ngIf", log_r3.error);
} }
function ExceptionListTableViewComponent_p_table_0_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "p-table", 1);
i0.ɵɵtemplate(1, ExceptionListTableViewComponent_p_table_0_ng_template_1_Template, 14, 0, "ng-template", 2);
i0.ɵɵtemplate(2, ExceptionListTableViewComponent_p_table_0_ng_template_2_Template, 14, 8, "ng-template", 3);
i0.ɵɵelementEnd();
} if (rf & 2) {
var ctx_r0 = i0.ɵɵnextContext();
i0.ɵɵproperty("columns", ctx_r0.cols)("value", ctx_r0.items);
} }
var ExceptionListTableViewComponent = /** @class */ (function () {
function ExceptionListTableViewComponent(messageService) {
this.messageService = messageService;
this.cols = [
{ field: "login", header: "Login" },
{ field: "concepto", header: "Concepto" },
{ field: "method", header: "Operación" },
{ field: "fecha", header: "Hora" },
{ field: "", header: "" }
];
}
/** Muestra los datos de log en un diálogo*/
ExceptionListTableViewComponent.prototype.showDatosLog = function (event, log, titulo) {
var width = bitmessage_1.BitMessage.WIDTH;
if (titulo === "Error") {
width = 800;
}
this.messageService.sendMessage(new bitmessage_1.BitMessage(titulo, log, width));
};
ExceptionListTableViewComponent.prototype.gotoForm = function () {
console.log("go");
};
ExceptionListTableViewComponent.ɵfac = function ExceptionListTableViewComponent_Factory(t) { return new (t || ExceptionListTableViewComponent)(i0.ɵɵdirectiveInject(i1.MessageService)); };
ExceptionListTableViewComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ExceptionListTableViewComponent, selectors: [["exception-list-tableview"]], inputs: { items: "items" }, decls: 1, vars: 1, consts: [[3, "columns", "value", 4, "ngIf"], [3, "columns", "value"], ["pTemplate", "header"], ["pTemplate", "body"], ["pSortableColumn", "login"], ["field", "login"], ["pSortableColumn", "concepto"], ["field", "concepto"], ["pSortableColumn", "method"], ["field", "method"], ["pSortableColumn", "fecha"], ["field", "fecha"], [3, "click"], [1, "col-button"], ["role", "group", 1, "btn-group"], ["class", "btn btn-danger btn-xs", 3, "click", 4, "ngIf"], [1, "btn", "btn-danger", "btn-xs", 3, "click"], [1, "glyphicon", "glyphicon-alert"]], template: function ExceptionListTableViewComponent_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵtemplate(0, ExceptionListTableViewComponent_p_table_0_Template, 3, 2, "p-table", 0);
} if (rf & 2) {
i0.ɵɵproperty("ngIf", ctx.items != null && ctx.items.length > 0);
} }, directives: [i2.NgIf, i3.Table, i4.PrimeTemplate, i3.SortableColumn, i3.SortIcon], pipes: [i2.DatePipe], encapsulation: 2 });
return ExceptionListTableViewComponent;
}());
exports.ExceptionListTableViewComponent = ExceptionListTableViewComponent;
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ExceptionListTableViewComponent, [{
type: core_1.Component,
args: [{
selector: "exception-list-tableview",
template: "\n <!--<p-dataTable [value]=\"items\" *ngIf=\"(items != null && items.length > 0)\">\n <p-column field=\"login\" header=\"Login\" [sortable]=\"true\"></p-column>\n <p-column field=\"concepto\" header=\"Concepto\" [sortable]=\"true\"></p-column>\n <p-column field=\"method\" header=\"Operaci\u00F3n\" [sortable]=\"true\"></p-column>\n <p-column field=\"fecha\" header=\"Hora\" [sortable]=\"true\">\n <ng-template let-log=\"rowData\" pTemplate type=\"body\">\n <span>{{log.fecha | date:\"HH:mm\"}}</span>\n </ng-template>\n </p-column> \n <p-column styleClass=\"col-button\">\n <ng-template let-log=\"rowData\" pTemplate type=\"body\"> \n <div class=\"btn-group\" role=\"group\">\n <button *ngIf=\"log.error\" class=\"btn btn-danger btn-xs\" (click)=\"showDatosLog($event,log.error,'Error');\"> Error <span class=\"glyphicon glyphicon-alert\"></span>\n </button>\n </div>\n </ng-template>\n </p-column>\n</p-dataTable>-->\n <p-table [columns]=\"cols\" [value]=\"items\" *ngIf=\"items != null && items.length > 0\">\n <ng-template pTemplate=\"header\">\n <tr>\n <th pSortableColumn=\"login\">Login<p-sortIcon field=\"login\"></p-sortIcon></th>\n <th pSortableColumn=\"concepto\">Concepto<p-sortIcon field=\"concepto\"></p-sortIcon></th>\n <th pSortableColumn=\"method\">Operaci\u00F3n<p-sortIcon field=\"method\"></p-sortIcon></th>\n <th pSortableColumn=\"fecha\">Hora<p-sortIcon field=\"fecha\"></p-sortIcon></th>\n <th></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-log>\n <tr (click)=\"gotoForm(log)\">\n <td>{{ log.login }}</td>\n <td>{{ log.concepto }}</td>\n <td>{{ log.method }}</td>\n <td>\n <span>{{ log.fecha | date: \"HH:mm\" }}</span>\n </td>\n <td class=\"col-button\">\n <div class=\"btn-group\" role=\"group\">\n <button\n *ngIf=\"log.error\"\n class=\"btn btn-danger btn-xs\"\n (click)=\"showDatosLog($event, log.error, 'Error')\"\n >\n Error <span class=\"glyphicon glyphicon-alert\"></span>\n </button>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n <!-- cols = [\n{ field: \"login\", header: \"Login\" },\n{ field: \"concepto\", header: \"Concepto\" },\n{ field: \"method\", header: \"Operaci\u00F3n\" },\n{ field: \"fecha\", header: \"Hora\" },\n{ field: \"\", header: \"\" },\n]; -->\n "
}]
}], function () { return [{ type: i1.MessageService }]; }, { items: [{
type: core_1.Input
}] }); })();
//# sourceMappingURL=exception-list-tableview.component.js.map