@lidorsystems/integralui-web
Version:
IntegralUI Web - Advanced UI Components for Angular
15 lines (12 loc) • 5.05 kB
JavaScript
/*
filename: integralui.dialog.js
version : 20.2.0
Copyright © 2016-2020 Lidor Systems. All rights reserved.
This file is part of the "IntegralUI Web" Library.
The contents of this file are subject to the IntegralUI Web License, and may not be used except in compliance with the License.
A copy of the License should have been installed in the product's root installation directory or it can be found at
http://www.lidorsystems.com/products/web/studio/license-agreement.aspx.
This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language
governing rights and limitations under the License. Any infringement will be prosecuted under applicable laws.
*/
;var __extends=this&&this.__extends||function(){var e=function(i,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var t in i)if(i.hasOwnProperty(t))e[t]=i[t]})(i,t)};return function(i,t){e(i,t);function n(){this.constructor=i}i.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0});var core_1=require("@angular/core"),integralui_core_1=require("./integralui.core"),integralui_common_service_1=require("../services/integralui.common.service"),i0=require("@angular/core"),i1=require("../services/integralui.common.service"),i2=require("@angular/common"),_c0=["inputLabel"];function IntegralUIDialog_div_0_span_3_Template(e,i){if(1&e){var t=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"span",5);i0.ɵɵlistener("click",function(){i0.ɵɵrestoreView(t);return i0.ɵɵnextContext(2).close()});i0.ɵɵelementEnd()}}function IntegralUIDialog_div_0_Template(e,i){if(1&e){i0.ɵɵelementStart(0,"div",2);i0.ɵɵprojection(1);i0.ɵɵelementStart(2,"div",3);i0.ɵɵtemplate(3,IntegralUIDialog_div_0_span_3_Template,1,0,"span",4);i0.ɵɵelementEnd();i0.ɵɵelementEnd()}if(2&e){var t=i0.ɵɵnextContext();i0.ɵɵproperty("ngClass",t.getControlClass())("ngStyle",t.getControlStyle());i0.ɵɵadvance(3);i0.ɵɵproperty("ngIf",t.closeButton)}}function IntegralUIDialog_p_1_Template(e,i){if(1&e){var t=i0.ɵɵgetCurrentView();i0.ɵɵelementStart(0,"p",6);i0.ɵɵlistener("click",function(){i0.ɵɵrestoreView(t);return i0.ɵɵnextContext().close()});i0.ɵɵelementEnd()}}var _c1=["*"],IntegralUIDialog=function(e){__extends(i,e);function i(i){var t=e.call(this,i)||this;t.commonService=i;t.isEnabled=!0;t.isVisible=!1;t.closed=new core_1.EventEmitter;t.closing=new core_1.EventEmitter;t.opened=new core_1.EventEmitter;t.opening=new core_1.EventEmitter;return t}Object.defineProperty(i.prototype,"visible",{get:function(){return this.isVisible},set:function(e){if(this.isVisible!=e)if(e)this.open();else this.close()},enumerable:!0,configurable:!0});i.prototype.ngOnInit=function(){this.generalClassName="iui-dialog";this.initStyle()};i.prototype.updateLayout=function(){};i.prototype.open=function(){if(!this.isVisible){var e={cancel:!1};this.opening.emit(e);if(!e.cancel){this.isVisible=!0;this.opened.emit(null)}}};i.prototype.close=function(){if(this.isVisible){var e={cancel:!1};this.closing.emit(e);if(!e.cancel){this.isVisible=!1;this.closed.emit(null)}}};i.prototype.getControlStyle=function(){var e={};if(this.ctrlSize.width>0)e.width=this.ctrlSize.width+"px";if(this.ctrlSize.height>0)e.height=this.ctrlSize.height+"px";return e};i.ɵfac=function(e){return new(e||i)(i0.ɵɵdirectiveInject(i1.IntegralUICommonService))};i.ɵcmp=i0.ɵɵdefineComponent({type:i,selectors:[["iui-dialog"]],viewQuery:function(e,i){if(1&e)i0.ɵɵviewQuery(_c0,!0,core_1.ElementRef);if(2&e){var t;i0.ɵɵqueryRefresh(t=i0.ɵɵloadQuery())&&(i.inputLabelElem=t.first)}},inputs:{controlStyle:"controlStyle",data:"data",enabled:"enabled",name:"name",size:"size",state:"state",closeButton:"closeButton",visible:"visible"},outputs:{closed:"closed",closing:"closing",opened:"opened",opening:"opening"},features:[i0.ɵɵInheritDefinitionFeature],ngContentSelectors:_c1,decls:2,vars:2,consts:[["class","iui-dialog-animation",3,"ngClass","ngStyle",4,"ngIf"],["class","iui-dialog-overlay iui-overlay-animation",3,"click",4,"ngIf"],[1,"iui-dialog-animation",3,"ngClass","ngStyle"],[1,"iui-dialog-buttons"],["class","iui-dialog-icon iui-dialog-button-close",3,"click",4,"ngIf"],[1,"iui-dialog-icon","iui-dialog-button-close",3,"click"],[1,"iui-dialog-overlay","iui-overlay-animation",3,"click"]],template:function(e,i){if(1&e){i0.ɵɵprojectionDef();i0.ɵɵtemplate(0,IntegralUIDialog_div_0_Template,4,3,"div",0);i0.ɵɵtemplate(1,IntegralUIDialog_p_1_Template,1,0,"p",1)}if(2&e){i0.ɵɵproperty("ngIf",i.visible);i0.ɵɵadvance(1);i0.ɵɵproperty("ngIf",i.visible)}},directives:[i2.NgIf,i2.NgClass,i2.NgStyle],encapsulation:2});return i}(integralui_core_1.IntegralUIBaseComponent);exports.IntegralUIDialog=IntegralUIDialog;