@duoduo-oba/ng-devui
Version:
DevUI components based on Angular
2 lines • 22.8 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/animations"),require("ng-devui/window-ref"),require("lodash-es"),require("rxjs"),require("@angular/platform-browser"),require("@angular/common"),require("ng-devui/overlay-container"),require("ng-devui/button")):"function"==typeof define&&define.amd?define("ng-devui/modal",["exports","@angular/core","@angular/animations","ng-devui/window-ref","lodash-es","rxjs","@angular/platform-browser","@angular/common","ng-devui/overlay-container","ng-devui/button"],t):t(((e=e||self)["ng-devui"]=e["ng-devui"]||{},e["ng-devui"].modal={}),e.ng.core,e.ng.animations,e["ng-devui"]["window-ref"],e.lodashEs,e.rxjs,e.ng.platformBrowser,e.ng.common,e["ng-devui"]["overlay-container"],e["ng-devui"].button)}(this,(function(e,t,n,o,r,i,a,s,l,d){"use strict";var c=function(){function e(e){this.viewContainerRef=e}return e.decorators=[{type:t.Directive,args:[{selector:"[dModalContentHost]"}]}],e.ctorParameters=function(){return[{type:t.ViewContainerRef}]},e}();var p=function(){function e(e){this.viewContainerRef=e}return e.decorators=[{type:t.Directive,args:[{selector:"[dModalContainerHost]"}]}],e.ctorParameters=function(){return[{type:t.ViewContainerRef}]},e}();var u=function(){function e(e,t){var n=this;this.documentRef=e,this.renderer=t,this.placement="center",this.animateState=this.showAnimate?"void":"",this.ignoreBackDropClick=!1,this.pressEscToClose=new i.Subscription,this.onModalClick=function(e){n.backdropCloseable&&!n.ignoreBackDropClick&&!n.dialogElement.nativeElement.contains(e.target)&&document.body.contains(e.target)&&n.hide(),n.ignoreBackDropClick=!1},this.modalMouseDown=function(e){n.mouseDwonEl=e.target},this.modalMouseUp=function(e){e.target!==n.mouseDwonEl&&(n.ignoreBackDropClick=!0)},this.backdropCloseable=!!r.isUndefined(this.backdropCloseable)||this.backdropCloseable}return e.prototype.ngOnInit=function(){var e=this;this.pressEscToClose.add(i.fromEvent(window,"keydown").subscribe((function(t){27===t.keyCode&&e.hide()})));var t=document.getElementById("d-modal-header");t&&(this.draggableHandleEl=t)},e.prototype.onAnimationDone=function(e){"void"===e.toState&&this.onHidden()},e.prototype.onHidden=function(){},e.prototype.canHideModel=function(){var e=Promise.resolve(!0);if(this.beforeHidden){var t=this.beforeHidden();void 0!==t&&(e=t.then?t:t.subscribe?t.toPromise():Promise.resolve(t))}return e},e.prototype.hide=function(){var e=this;this.canHideModel().then((function(t){t&&(e.bodyScrollable||e.renderer.removeClass(e.documentRef.body,"modal-open"),e.showAnimate?e.animateState="void":e.onHidden())}))},e.prototype.show=function(){this.bodyScrollable||this.renderer.addClass(this.documentRef.body,"modal-open"),this.dialogElement.nativeElement.focus(),this.showAnimate&&(this.animateState="in")},e.prototype.resolveTransformTranslate=function(){var e;switch(this.placement){case"top":e="40px";break;case"bottom":e="-40px";break;case"center":default:e="0"}return"translate("+(this.offsetX?this.offsetX:"0")+","+(this.offsetY?this.offsetY:e)+")"},e.prototype.ngOnDestroy=function(){this.pressEscToClose.unsubscribe()},e.decorators=[{type:t.Component,args:[{selector:"d-modal",template:'<div class="modal-backdrop" [@backdropAnimation]="animateState"></div>\r\n<div class="modal in" [attr.id]="id" (mousedown)="modalMouseDown($event)" (mouseup)="modalMouseUp($event)" (click)="onModalClick($event)">\r\n <div\r\n class="modal-dialog"\r\n [ngClass]="{\r\n \'place-at-top\': placement === \'top\',\r\n \'place-at-bottom\': placement === \'bottom\',\r\n \'place-at-center\': placement === \'center\'\r\n }"\r\n [ngStyle]="{ width: width }"\r\n [@modalAnimation]="animateState"\r\n (@modalAnimation.done)="onAnimationDone($event)"\r\n tabindex="1"\r\n #dialog\r\n >\r\n <div class="modal-content" [dMovable]="draggable" [handle]="draggableHandleEl" [ngStyle]="{ transform: resolveTransformTranslate() }">\r\n <ng-template dModalContainerHost></ng-template>\r\n </div>\r\n </div>\r\n</div>\r\n',animations:[n.trigger("backdropAnimation",[n.state("void",n.style({opacity:0})),n.state("in",n.style({opacity:.2})),n.transition("void => in",n.animate("400ms cubic-bezier(0.23, 1, 0.32, 1)")),n.transition("in => void",n.animate("300ms cubic-bezier(0.755, 0.05, 0.855, 0.06)"))]),n.trigger("modalAnimation",[n.state("void",n.style({opacity:0,transform:"scale(0.9)"})),n.state("in",n.style({opacity:1,transform:"scale(1)"})),n.transition("void => in",n.animate("400ms cubic-bezier(0.23, 1, 0.32, 1)")),n.transition("in => void",n.animate("300ms cubic-bezier(0.755, 0.05, 0.855, 0.06)"))])],styles:[".modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;outline:0;overflow-y:auto;display:block;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:0 auto}.modal-dialog.place-at-center{margin:auto}.modal-dialog.place-at-top{margin-bottom:auto}.modal-dialog.place-at-bottom{margin-top:auto}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;opacity:.2;background-color:#000}:host ::ng-deep .modal-content{position:relative;border-radius:2px;border:none;background-color:#fff;background-clip:padding-box;outline:0;box-shadow:5px 5px 20px 0 rgba(41,48,64,.2)}:host ::ng-deep .modal-content .modal-body{padding:24px 24px 16px}:host ::ng-deep .modal-content .modal-footer{border-top:none;padding:7px;text-align:center}:host ::ng-deep .modal-content .modal-footer button{margin:5px;padding:5px 20px;width:auto}:host ::ng-deep .modal-content .modal-footer button.pull-left{padding-left:5px;padding-right:5px;position:relative;left:-5px}:host ::ng-deep .modal-content .modal-footer button+button{margin-bottom:16px}:host ::ng-deep .d-btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;touch-action:manipulation;cursor:pointer;background-image:none;white-space:nowrap;font-size:14px;line-height:1.42857143;border-radius:2px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:focus{outline:0}"]}]}],e.ctorParameters=function(){return[{type:o.DocumentRef},{type:t.Renderer2}]},e.propDecorators={id:[{type:t.Input}],showAnimate:[{type:t.Input}],width:[{type:t.Input}],backdropCloseable:[{type:t.Input}],beforeHidden:[{type:t.Input}],draggable:[{type:t.Input}],placement:[{type:t.Input}],offsetX:[{type:t.Input}],offsetY:[{type:t.Input}],bodyScrollable:[{type:t.Input}],modalContainerHost:[{type:t.ViewChild,args:[p,{static:!0}]}],dialogElement:[{type:t.ViewChild,args:["dialog",{static:!0}]}]},e}();var m=function(){function e(e){this.sanitizer=e,this.dialogtype="standard"}return e.prototype.ngOnInit=function(){this.html&&(this.content=this.sanitizer.bypassSecurityTrustHtml(this.content))},e.prototype.close=function(e){this.onClose(e)},e.decorators=[{type:t.Component,args:[{selector:"d-modal-container",template:'<div>\r\n <d-modal-header\r\n id="d-modal-header"\r\n [title]="title"\r\n (closeEvent)="close($event)"\r\n [dialogtype]="dialogtype"\r\n [showCloseBtn]="showCloseBtn"\r\n ></d-modal-header>\r\n <div\r\n class="modal-body devui-scrollbar"\r\n [ngClass]="{\r\n \'flex-content\': dialogtype === \'warning\' || dialogtype === \'failed\' || dialogtype === \'success\' || dialogtype === \'info\'\r\n }"\r\n [ngStyle]="{ maxHeight: maxHeight, \'overflow-y\': \'auto\' }"\r\n >\r\n <div\r\n [ngClass]="{\r\n \'display-flex\': dialogtype !== \'\' && dialogtype !== \'standard\'\r\n }"\r\n >\r\n <div class="content" [style.max-height]="maxHeight" *ngIf="!!content && !html">\r\n {{ content }}\r\n </div>\r\n <div class="content" [style.max-height]="maxHeight" *ngIf="!!content && html" [innerHTML]="content"></div>\r\n <ng-template dModalContentHost></ng-template>\r\n </div>\r\n </div>\r\n\r\n <d-modal-footer [buttons]="buttons"></d-modal-footer>\r\n</div>\r\n',styles:[".modal-body{padding:10px 30px}.display-flex{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;display:-ms-flexbox;-ms-flex-align:center;max-width:100%}.alert-icon{margin-right:10px}div.content{word-break:normal;word-wrap:break-word;width:100%}.alert-icon+div.content{width:'calc(100% - 60px)'}.flex-content ::ng-deep div.content{font-size:14px;word-break:normal;word-wrap:break-word;white-space:pre-wrap}.flex-content{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center}"]}]}],e.ctorParameters=function(){return[{type:a.DomSanitizer}]},e.propDecorators={maxHeight:[{type:t.Input}],data:[{type:t.Input}],title:[{type:t.Input}],content:[{type:t.Input}],buttons:[{type:t.Input}],html:[{type:t.Input}],onClose:[{type:t.Input}],modalContentHost:[{type:t.ViewChild,args:[c,{static:!0}]}],dialogtype:[{type:t.Input}],showCloseBtn:[{type:t.Input}]},e}();var h=function(){function e(e,t){this.componentFactoryResolver=e,this.overlayContainerRef=t}return e.prototype.open=function(e){var t=e.id,n=e.component,o=e.injector,i=e.width,a=e.data,s=e.handler,l=e.showAnimate,d=e.backdropCloseable,c=e.componentFactoryResolver,p=e.onClose,m=e.beforeHidden,h=e.placement,g=void 0===h?"center":h,f=e.offsetX,v=e.offsetY,y=e.bodyScrollable,b=c||this.componentFactoryResolver,w=this.overlayContainerRef.createComponent(b.resolveComponentFactory(u),o);r.assign(w.instance,{id:t,width:i,showAnimate:l,beforeHidden:m,backdropCloseable:!!r.isUndefined(d)||d,placement:g,offsetX:f,offsetY:v,bodyScrollable:y});var x=w.instance.modalContainerHost.viewContainerRef.createComponent(b.resolveComponentFactory(n),0,o);return r.assign(x.instance,{data:a,handler:s}),w.instance.onHidden=function(){p&&p(),setTimeout((function(){w.hostView.destroy()}))},w.instance.show(),{modalInstance:w.instance,modalContentInstance:x.instance}},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:l.OverlayContainerRef}]},e}();var g=function(){function e(){this.closeEvent=new t.EventEmitter,this.dialogtype="standard"}return e.prototype.close=function(e){this.closeEvent.emit(e)},e.decorators=[{type:t.Component,args:[{selector:"d-modal-header",template:'<div class="modal-header">\r\n <button *ngIf="showCloseBtn" type="button" class="close" aria-label="Close" (click)="close($event)">\r\n <svg class="svg-icon-close" xmlns="http://www.w3.org/2000/svg" width="12px" height="12px" viewBox="0 0 12 12" version="1.1">\r\n <g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\r\n <g id="图标" transform="translate(-1236.000000, -1286.000000)" fill-rule="nonzero">\r\n <g id="close" transform="translate(1234.000000, 1284.000000)">\r\n <polygon\r\n id="Mask"\r\n points="8 6.58578644 12.2426407 2.34314575 13.6568542 3.75735931 9.41421356 8 13.6568542 12.2426407 12.2426407 13.6568542 8 9.41421356 3.75735931 13.6568542 2.34314575 12.2426407 6.58578644 8 2.34314575 3.75735931 3.75735931 2.34314575"\r\n />\r\n </g>\r\n </g>\r\n </g>\r\n </svg>\r\n </button>\r\n\r\n <div class="standard-title">\r\n <div *ngIf="(dialogtype | lowercase) == \'warning\'" class="header-alert-icon">\r\n <svg\r\n t="1523848353321"\r\n class="icon"\r\n style=""\r\n viewBox="0 0 1024 1024"\r\n version="1.1"\r\n xmlns="http://www.w3.org/2000/svg"\r\n p-id="2903"\r\n width="16"\r\n height="16"\r\n >\r\n <defs>\r\n <style type="text/css"></style>\r\n </defs>\r\n <path\r\n d="M512 0C229.205333 0 0 229.205333 0 512s229.205333 512 512 512 512-229.205333 512-512S794.794667 0 512 0z m-40.021333 230.997333a39.978667 39.978667 0 1 1 80.042666 0v369.024a39.978667 39.978667 0 1 1-80.042666 0V230.997333zM512 794.026667a44.928 44.928 0 0 1-45.013333-44.970667c0-24.917333 20.096-45.013333 45.013333-45.013333s45.013333 20.096 45.013333 45.013333c0 24.746667-20.096 44.970667-45.013333 44.970667z"\r\n fill="#fecc55"\r\n p-id="2904"\r\n ></path>\r\n </svg>\r\n </div>\r\n <div *ngIf="(dialogtype | lowercase) == \'failed\'" class="header-alert-icon">\r\n <svg\r\n t="1523848193850"\r\n class="icon"\r\n style=""\r\n viewBox="0 0 1024 1024"\r\n version="1.1"\r\n xmlns="http://www.w3.org/2000/svg"\r\n p-id="2647"\r\n width="16"\r\n height="16"\r\n >\r\n <defs>\r\n <style type="text/css"></style>\r\n </defs>\r\n <path\r\n d="M512 0C229.205333 0 0 229.205333 0 512s229.205333 512 512 512 512-229.205333 512-512S794.794667 0 512 0z m205.312 666.88a36.010667 36.010667 0 0 1-51.029333 50.816L512 562.986667l-154.282667 154.709333a35.84 35.84 0 0 1-50.901333 0.085333 36.010667 36.010667 0 0 1-0.128-50.901333L461.226667 512 306.773333 357.12a36.010667 36.010667 0 0 1 50.986667-50.816L512 461.013333l154.282667-154.794666a36.010667 36.010667 0 0 1 51.029333 50.773333L562.773333 512l154.453334 154.88z"\r\n fill="#F9504B"\r\n p-id="2648"\r\n ></path>\r\n </svg>\r\n </div>\r\n <div *ngIf="(dialogtype | lowercase) == \'sucess\' || (dialogtype | lowercase) == \'success\'" class="header-alert-icon">\r\n <svg\r\n t="1523848446605"\r\n class="icon"\r\n style=""\r\n viewBox="0 0 1024 1024"\r\n version="1.1"\r\n xmlns="http://www.w3.org/2000/svg"\r\n p-id="3058"\r\n width="16"\r\n height="16"\r\n >\r\n <defs>\r\n <style type="text/css"></style>\r\n </defs>\r\n <path\r\n d="M512 0C229.205333 0 0 229.205333 0 512s229.205333 512 512 512 512-229.205333 512-512S794.794667 0 512 0z m260.266667 356.394667l-359.466667 360.704-0.426667 0.426666a35.925333 35.925333 0 0 1-57.6-6.826666l-108.885333-190.378667a35.882667 35.882667 0 0 1 13.397333-49.109333 35.882667 35.882667 0 0 1 49.109334 13.397333l85.418666 149.504 327.466667-328.533333a36.010667 36.010667 0 0 1 51.029333 50.816z"\r\n fill="#41C99F"\r\n p-id="3059"\r\n ></path>\r\n </svg>\r\n </div>\r\n <div *ngIf="(dialogtype | lowercase) == \'info\'" class="header-alert-icon">\r\n <svg\r\n t="1523848507870"\r\n class="icon"\r\n style=""\r\n viewBox="0 0 1024 1024"\r\n version="1.1"\r\n xmlns="http://www.w3.org/2000/svg"\r\n p-id="3217"\r\n width="16"\r\n height="16"\r\n >\r\n <defs>\r\n <style type="text/css"></style>\r\n </defs>\r\n <path\r\n d="M512 0C229.205333 0 0 229.205333 0 512s229.205333 512 512 512 512-229.205333 512-512S794.794667 0 512 0z m-2.986667 184.490667a35.968 35.968 0 1 1 0 71.978666 35.968 35.968 0 0 1 0-71.978666z m157.184 557.098666a35.968 35.968 0 0 1-36.010666 36.010667H387.84a35.968 35.968 0 1 1 0-72.021333h85.205333V391.552H413.013333a35.968 35.968 0 1 1 0-72.021333h96c19.882667 0 35.968 16.128 35.968 36.010666v350.122667h85.205334c19.925333 0 36.010667 16.085333 36.010666 35.968z"\r\n fill="#797979"\r\n p-id="3218"\r\n ></path>\r\n </svg>\r\n </div>\r\n <span *ngIf="!!title" [title]="title" class="title-text">{{ title }}</span>\r\n <span *ngIf="!!!title && (dialogtype | lowercase) === \'warning\'" class="title-text">提醒</span>\r\n <span *ngIf="!!!title && (dialogtype | lowercase) === \'failed\'" class="title-text">错误</span>\r\n <span *ngIf="!!!title && ((dialogtype | lowercase) === \'sucess\' || (dialogtype | lowercase) == \'success\')" class="title-text"\r\n >成功</span\r\n >\r\n <span *ngIf="!!!title && (dialogtype | lowercase) === \'info\'" class="title-text">提示</span>\r\n </div>\r\n</div>\r\n',styles:[".modal-header{padding:10px 20px 0;height:43px}.modal-header .standard-title{color:#252b3a;letter-spacing:0;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}button.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}svg.svg-icon-close>g>g{fill:#252b3a}.header-alert-icon{width:16px;height:16px;display:inline-block;vertical-align:middle;margin-right:5px}.title-text{font-size:16px;font-weight:600;vertical-align:middle}button{outline:0;height:30px;width:30px}.close:hover{background:#f2f5fc}.close:hover svg g{fill:#344899}"]}]}],e.propDecorators={title:[{type:t.Input}],closeEvent:[{type:t.Output}],dialogtype:[{type:t.Input}],showCloseBtn:[{type:t.Input}]},e}();var f=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"d-modal-footer",template:'<div class="modal-footer">\r\n <div>\r\n <d-button\r\n *ngFor="let button of buttons"\r\n [attr.id]="button.id"\r\n (btnClick)="button.handler($event)"\r\n bsStyle="{{ button.cssClass }}"\r\n circled="true"\r\n [width]="button.btnwidth"\r\n [autofocus]="button.autofocus"\r\n >{{ button.text }}\r\n </d-button>\r\n </div>\r\n</div>\r\n',styles:[".modal-footer{height:64px;padding:14px 7px 7px}"]}]}],e.propDecorators={buttons:[{type:t.Input}]},e}();var v=function(){function e(){}return e.prototype.close=function(e){this.data.onClose(e)},e.decorators=[{type:t.Component,args:[{selector:"d-modal-alert",template:'<div>\r\n <div class="modal-body">\r\n <div *ngIf="!!data.content">{{ data.content }}</div>\r\n </div>\r\n <div class="modal-footer">\r\n <d-button (btnClick)="close($event)" bsStyle="stress">{{ data.cancelBtnText }} </d-button>\r\n </div>\r\n</div>\r\n'}]}],e.propDecorators={data:[{type:t.Input}]},e}();var y=function(){function e(e,t){this.componentFactoryResolver=e,this.overlayContainerRef=t}return e.prototype.open=function(e){var t=e.id,n=e.width,o=e.backdropCloseable,i=e.maxHeight,a=e.showAnimate,s=e.title,l=e.content,d=e.html,c=e.data,p=e.buttons,h=e.injector,g=e.componentFactoryResolver,f=e.beforeHidden,v=e.onClose,y=e.dialogtype,b=void 0===y?"standard":y,w=e.showCloseBtn,x=void 0===w||w,C=e.draggable,k=void 0===C||C,I=e.placement,M=void 0===I?"center":I,H=e.offsetX,S=e.offsetY,D=e.bodyScrollable,R=g||this.componentFactoryResolver,E=this.overlayContainerRef.createComponent(R.resolveComponentFactory(u),h);r.assign(E.instance,{id:t,width:n,showAnimate:a,beforeHidden:f,backdropCloseable:!!r.isUndefined(o)||o,draggable:k,placement:M,offsetX:H,offsetY:S,bodyScrollable:D});var T=E.instance.modalContainerHost.viewContainerRef.createComponent(R.resolveComponentFactory(m),0,h);return r.assign(T.instance,{title:s,buttons:p,maxHeight:i,dialogtype:b,showCloseBtn:x}),"string"==typeof l?r.assign(T.instance,{content:l,html:d}):(this.contentRef=T.instance.modalContentHost.viewContainerRef.createComponent(R.resolveComponentFactory(l)),r.assign(this.contentRef.instance,{data:c},b)),T.instance.onClose=function(){E.instance.hide()},E.instance.onHidden=function(){v&&v(),setTimeout((function(){E.hostView.destroy()}))},E.instance.show(),{modalInstance:E.instance,modalContentInstance:this.contentRef?this.contentRef.instance:null}},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:l.OverlayContainerRef}]},e}();var b=function(){function e(e){this.el=e,this.topStart=0,this.leftStart=0,this._allowDrag=!1,this.checkHandleTarget=function(e,t){if(!t)return!1;if("BUTTON"===t.tagName)return!1;if(t===e)return!0;for(var n in t.children)if(t.children.hasOwnProperty(n)&&this.checkHandleTarget(e,t.children[n]))return!0;return!1}}return e.prototype.ngOnInit=function(){this.element=this.moveEl||this.el.nativeElement,this._allowDrag&&(this.element.style.position="relative")},e.prototype.ngOnChanges=function(e){e.moveEl&&(this.element=this.moveEl||this.el.nativeElement)},e.prototype.onMouseDown=function(e){2!==e.button&&this.checkHandleTarget(e.target,this.handle)&&(this.md=!0,this.topStart=e.clientY-this.element.style.top.replace("px",""),this.leftStart=e.clientX-this.element.style.left.replace("px",""))},e.prototype.onMouseUp=function(e){this.md=!1},e.prototype.onMouseMove=function(e){if(this.md&&this._allowDrag){e.stopPropagation(),e.preventDefault();var t=this.element.getBoundingClientRect(),n=this.element.parentNode.getBoundingClientRect(),o=e.clientY-this.topStart,r=e.clientX-this.leftStart,i=window.innerHeight-n.top-t.height;o=n.top+o<=0&&-n.top||i-o<=0&&i||o;var a=(window.innerWidth-t.width)/2;r=r+a<=0&&-a||a-r<=0&&a||r,this.element.style.top=o+"px",this.element.style.left=r+"px"}},e.prototype.onTouchStart=function(e){this.md=!0,this.topStart=e.changedTouches[0].clientY-this.element.style.top.replace("px",""),this.leftStart=e.changedTouches[0].clientX-this.element.style.left.replace("px",""),e.stopPropagation()},e.prototype.onTouchEnd=function(){this.md=!1},e.prototype.onTouchMove=function(e){this.md&&this._allowDrag&&(this.element.style.top=e.changedTouches[0].clientY-this.topStart+"px",this.element.style.left=e.changedTouches[0].clientX-this.leftStart+"px"),e.stopPropagation()},Object.defineProperty(e.prototype,"allowDrag",{set:function(e){this._allowDrag=e,this._allowDrag&&(this.handle.style.cursor="move")},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Directive,args:[{selector:"[dMovable]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={handle:[{type:t.Input}],moveEl:[{type:t.Input}],onMouseDown:[{type:t.HostListener,args:["mousedown",["$event"]]}],onMouseUp:[{type:t.HostListener,args:["document:mouseup",["$event"]]}],onMouseMove:[{type:t.HostListener,args:["document:mousemove",["$event"]]}],onTouchStart:[{type:t.HostListener,args:["touchstart",["$event"]]}],onTouchEnd:[{type:t.HostListener,args:["document:touchend"]}],onTouchMove:[{type:t.HostListener,args:["document:touchmove",["$event"]]}],allowDrag:[{type:t.Input,args:["dMovable"]}]},e}();var w=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[s.CommonModule,l.OverlayContainerModule,d.ButtonModule],declarations:[u,m,p,c,g,f,v,b],exports:[u,m,g,f,v,b],providers:[h,y,o.DocumentRef],entryComponents:[u,m,v]}]}],e}();e.DialogService=y,e.ModalAlertComponent=v,e.ModalComponent=u,e.ModalContainerComponent=m,e.ModalContainerDirective=p,e.ModalContentDirective=c,e.ModalFooterComponent=f,e.ModalHeaderComponent=g,e.ModalModule=w,e.ModalService=h,e.MovableDirective=b,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ng-devui-modal.umd.min.js.map