UNPKG

ng2-timeout-dialog

Version:
24 lines 1.92 kB
import { Component } from '@angular/core'; import { TimeoutService } from './timeout.service'; var TimeoutComponent = (function () { function TimeoutComponent(timeoutService) { var _this = this; this.timeoutService = timeoutService; this.isVisible = true; this.timeoutService.timeoutObservable.subscribe(function (val) { return _this.isVisible = val; }); } TimeoutComponent.decorators = [ { type: Component, args: [{ selector: 'sh-timeout', template: "\n <div *ngIf=\"isVisible\">\n <div class=\"timeout-overlay fullscreen\" (click)=\"isVisible = false\"></div>\n <div class=\"timeout-container\" #ref>\n <ng-content>\n </ng-content>\n </div>\n <div *ngIf=\"ref.children.length == 0\" class=\"timeout-default-box timeout-container\">\n <h2>Application will timeout soon.</h2>\n </div>\n </div>\n ", styles: ["\n .timeout-default-box {\n text-align: center;\n height: 250px;\n width: 250px;\n background-color: antiquewhite;\n border-radius: 5px;\n padding: 3px;\n }\n\n .timeout-default-box h2{\n margin-top: 50px;\n overflow-wrap: break-word;\n }\n \n .fullscreen {\n position: fixed;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n }\n\n .timeout-overlay {\n z-index: 100;\n background: rgba(0, 0, 0, .2);\n }\n\n .timeout-container {\n position: fixed;\n z-index: 101;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n }\n "] },] }, ]; /** @nocollapse */ TimeoutComponent.ctorParameters = function () { return [ { type: TimeoutService, }, ]; }; return TimeoutComponent; }()); export { TimeoutComponent }; //# sourceMappingURL=timeout.component.js.map