bia-framework
Version:
Bia Framework to work with angular 2
108 lines • 5.74 kB
JavaScript
;
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 badge_1 = require('../badge/badge');
var core_bar_service_1 = require("./core-bar.service");
var CoreImage_1 = require("../core-image/CoreImage");
var core_icon_1 = require("../core-icon/core-icon");
var RippleEffect_1 = require("../ripple-effect/RippleEffect");
var DynamicComponentLoader_1 = require("../../services/DynamicComponentLoader");
var electron_1 = require('electron');
var CoreAnimations_1 = require("../core-animations/CoreAnimations");
var CoreBar = (function () {
function CoreBar(coreBarService, dynamicComponentLoader) {
var _this = this;
this.coreBarService = coreBarService;
this.dynamicComponentLoader = dynamicComponentLoader;
this.contentVisibility = true;
this.nativeVisibility = true;
this.LeftMenuItems = [];
this.RightMenuItems = [];
this.Menus = [];
this.visibilityChange = new core_1.EventEmitter();
this.nativeClick = function (type) {
if (electron_1.remote != null) {
var window = electron_1.remote.getCurrentWindow();
if (type == "minimize") {
window.minimize();
}
if (type == "toggle") {
if (window.isMaximized())
window.unmaximize();
else
window.maximize();
}
if (type == "close")
window.close();
}
};
this.loadDynamicContent = function (dynamicContent) {
_this.dynamicComponentLoader.load(_this.container, dynamicContent);
};
this.itemClicked = function (item) {
if (item.Click != null)
item.Click();
};
this.TitleBar = "";
this.coreBarService.LeftItensChanged.subscribe(function (leftItem) { return _this.LeftMenuItems = leftItem; });
this.coreBarService.RightItensChanged.subscribe(function (rightItem) { return _this.RightMenuItems = rightItem; });
this.coreBarService.TitleChanged.subscribe(function (newTitle) { return _this.TitleBar = newTitle; });
this.coreBarService.contentVisibilityChanged.subscribe(function (newVisibility) { return _this.contentVisibility = newVisibility; });
this.coreBarService.nativeVisibilityChanged.subscribe(function (newVisibility) { return _this.nativeVisibility = newVisibility; });
this.coreBarService.DropDownItemsChanged.subscribe(function (dropdownItems) { return _this.DropdownMenus = dropdownItems; });
this.coreBarService.BarBgVisibilityChanged.subscribe(function (newbg) { return _this.hasBarBg = newbg; });
this.coreBarService.DynamicContentChanged.subscribe(function (dynamic) { return _this.loadDynamicContent(dynamic); });
}
CoreBar.prototype.ngOnInit = function () {
this.hasDropShadown = this.hasDropShadown || true;
this.color = this.color || 'transparent';
};
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], CoreBar.prototype, "contentVisibility", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], CoreBar.prototype, "nativeVisibility", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], CoreBar.prototype, "color", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], CoreBar.prototype, "hasDropShadown", void 0);
__decorate([
core_1.ViewChild('coreBarDynContainer', { read: core_1.ViewContainerRef }),
__metadata('design:type', core_1.ViewContainerRef)
], CoreBar.prototype, "container", void 0);
__decorate([
core_1.Output(),
__metadata('design:type', core_1.EventEmitter)
], CoreBar.prototype, "visibilityChange", void 0);
CoreBar = __decorate([
core_1.Component({
selector: 'core-bar',
encapsulation: core_1.ViewEncapsulation.None,
templateUrl: "node_modules/bia-framework/components/core-bar/core-bar.template.html",
styleUrls: ['node_modules/bia-framework/components/core-bar//core-bar.style.css'],
providers: [DynamicComponentLoader_1.DynamicComponentLoader],
directives: [common_1.NgClass, common_1.NgFor, common_1.NgIf, badge_1.Badge, RippleEffect_1.RippleEffect, CoreImage_1.CoreImage, core_icon_1.CoreIcon],
animations: [CoreAnimations_1.CoreAnimations.animationSideSlide()]
}),
__metadata('design:paramtypes', [core_bar_service_1.CoreBarService, DynamicComponentLoader_1.DynamicComponentLoader])
], CoreBar);
return CoreBar;
}());
exports.CoreBar = CoreBar;
//# sourceMappingURL=core-bar.component.js.map