UNPKG

@blackbaud/skyux

Version:
55 lines 1.97 kB
import { EventEmitter, Injectable } from '@angular/core'; var SkyModalHostService = (function () { function SkyModalHostService() { this.close = new EventEmitter(); SkyModalHostService.modalHosts.push(this); } Object.defineProperty(SkyModalHostService, "openModalCount", { get: function () { return SkyModalHostService.modalHosts.length; }, enumerable: true, configurable: true }); Object.defineProperty(SkyModalHostService, "BASE_Z_INDEX", { get: function () { return 1040; }, enumerable: true, configurable: true }); Object.defineProperty(SkyModalHostService, "backdropZIndex", { get: function () { return SkyModalHostService.BASE_Z_INDEX + SkyModalHostService.modalHosts.length * 10; }, enumerable: true, configurable: true }); Object.defineProperty(SkyModalHostService, "topModal", { get: function () { return SkyModalHostService.modalHosts[SkyModalHostService.modalHosts.length - 1]; }, enumerable: true, configurable: true }); SkyModalHostService.prototype.getModalZIndex = function () { var zIndex = SkyModalHostService.BASE_Z_INDEX + 1; zIndex += (SkyModalHostService.modalHosts.indexOf(this) + 1) * 10; return zIndex; }; SkyModalHostService.prototype.onClose = function (modalComponent) { this.close.emit(modalComponent); }; SkyModalHostService.prototype.destroy = function () { SkyModalHostService.modalHosts.splice(SkyModalHostService.modalHosts.indexOf(this)); }; return SkyModalHostService; }()); export { SkyModalHostService }; SkyModalHostService.modalHosts = []; SkyModalHostService.decorators = [ { type: Injectable }, ]; /** @nocollapse */ SkyModalHostService.ctorParameters = function () { return []; }; //# sourceMappingURL=modal-host.service.js.map