bitfront-library
Version:
Angular CLI project with components and classes used by other Angular projects of the BIT foundation.
63 lines • 3.85 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BitBotonAyudaComponent = void 0;
var core_1 = require("@angular/core");
var ayuda_service_1 = require("../service/ayuda.service");
var i0 = require("@angular/core");
var i1 = require("../service/ayuda.service");
var i2 = require("@angular/common");
function BitBotonAyudaComponent_button_0_Template(rf, ctx) { if (rf & 1) {
var _r3 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "button", 2);
i0.ɵɵlistener("click", function BitBotonAyudaComponent_button_0_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); var ctx_r2 = i0.ɵɵnextContext(); return ctx_r2.mostrarAyuda(); });
i0.ɵɵtext(1, " Ajuda\u00A0\u00A0");
i0.ɵɵelement(2, "span", 3);
i0.ɵɵelementEnd();
} if (rf & 2) {
var ctx_r0 = i0.ɵɵnextContext();
i0.ɵɵproperty("ngClass", "btn btn-transparent " + ctx_r0.extraClass);
} }
function BitBotonAyudaComponent_i_1_Template(rf, ctx) { if (rf & 1) {
var _r5 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "i", 4);
i0.ɵɵlistener("click", function BitBotonAyudaComponent_i_1_Template_i_click_0_listener() { i0.ɵɵrestoreView(_r5); var ctx_r4 = i0.ɵɵnextContext(); return ctx_r4.mostrarAyuda(); });
i0.ɵɵelementEnd();
} if (rf & 2) {
var ctx_r1 = i0.ɵɵnextContext();
i0.ɵɵproperty("ngClass", "btn-ayuda fa fa-question " + ctx_r1.extraClass);
} }
var BitBotonAyudaComponent = /** @class */ (function () {
function BitBotonAyudaComponent(ayudaService) {
this.ayudaService = ayudaService;
this.boton = false; // show a little [?] or a full button
this.extraClass = ""; // extra CSS classes for HTML component
}
BitBotonAyudaComponent.prototype.mostrarAyuda = function () {
this.ayudaService.mostrarAyuda(this.ayuda);
};
BitBotonAyudaComponent.ɵfac = function BitBotonAyudaComponent_Factory(t) { return new (t || BitBotonAyudaComponent)(i0.ɵɵdirectiveInject(i1.AyudaService)); };
BitBotonAyudaComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BitBotonAyudaComponent, selectors: [["bit-boton-ayuda"]], inputs: { ayuda: "ayuda", boton: "boton", extraClass: "extraClass" }, decls: 2, vars: 2, consts: [["type", "button", 3, "ngClass", "click", 4, "ngIf"], [3, "ngClass", "click", 4, "ngIf"], ["type", "button", 3, "ngClass", "click"], [1, "fa", "fa-life-ring"], [3, "ngClass", "click"]], template: function BitBotonAyudaComponent_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵtemplate(0, BitBotonAyudaComponent_button_0_Template, 3, 1, "button", 0);
i0.ɵɵtemplate(1, BitBotonAyudaComponent_i_1_Template, 1, 1, "i", 1);
} if (rf & 2) {
i0.ɵɵproperty("ngIf", ctx.boton);
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngIf", !ctx.boton);
} }, directives: [i2.NgIf, i2.NgClass], encapsulation: 2 });
return BitBotonAyudaComponent;
}());
exports.BitBotonAyudaComponent = BitBotonAyudaComponent;
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BitBotonAyudaComponent, [{
type: core_1.Component,
args: [{
selector: "bit-boton-ayuda",
template: "\n <button *ngIf=\"boton\" type=\"button\" (click)=\"mostrarAyuda()\" [ngClass]=\"'btn btn-transparent ' + extraClass\">\n Ajuda <span class=\"fa fa-life-ring\"></span>\n </button>\n\n <i *ngIf=\"!boton\" [ngClass]=\"'btn-ayuda fa fa-question ' + extraClass\" (click)=\"mostrarAyuda()\"></i>\n "
}]
}], function () { return [{ type: i1.AyudaService }]; }, { ayuda: [{
type: core_1.Input
}], boton: [{
type: core_1.Input
}], extraClass: [{
type: core_1.Input
}] }); })();
//# sourceMappingURL=bit-boton-ayuda.component.js.map