UNPKG

bia-framework

Version:

Bia Framework to work with angular 2

61 lines 3.2 kB
"use strict"; 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); }; var core_1 = require("@angular/core"); var common_1 = require("@angular/common"); var core_dialog_service_1 = require("./core-dialog.service"); var core_icon_1 = require("../core-icon/core-icon"); var CoreDialog = (function () { function CoreDialog(coreDialogService, resolver) { var _this = this; this.coreDialogService = coreDialogService; this.resolver = resolver; this.isProcessing = false; this.isVisible = false; this.hasBackButton = false; this.back = function () { _this.coreDialogService.back(); _this.isVisible = false; _this.container.remove(); console.log("container removido..."); }; this.showDialog = function (request) { _this.isProcessing = true; _this.isVisible = true; _this.backgroundColor = request.backgroundColor || "white"; _this.hasBackButton = request.hasBackButton || false; _this.tittle = request.tittle || ""; System.import(request.path).then(function (c) { return c[request.className]; }).then(function (result) { _this.resolver.resolveComponent(result).then(function (factory) { _this.container.createComponent(factory, 0, _this.container.injector); }); }); }; this.coreDialogService.onShow.subscribe(function (newRequest) { return _this.showDialog(newRequest); }); } ; __decorate([ core_1.ViewChild('container', { read: core_1.ViewContainerRef }), __metadata('design:type', core_1.ViewContainerRef) ], CoreDialog.prototype, "container", void 0); CoreDialog = __decorate([ core_1.Component({ selector: 'core-dialog', templateUrl: "node_modules/bia-framework/components/core-dialog/core-dialog.template.html", styleUrls: ['node_modules/bia-framework/components/core-dialog/core-dialog.style.css'], encapsulation: core_1.ViewEncapsulation.None, directives: [common_1.NgIf, common_1.NgClass, core_icon_1.CoreIcon] }), __metadata('design:paramtypes', [core_dialog_service_1.CoreDialogService, core_1.ComponentResolver]) ], CoreDialog); return CoreDialog; }()); exports.CoreDialog = CoreDialog; //# sourceMappingURL=core-dialog.component.js.map